shared: route ref-script server helpers via tx/server (keep buyer bundle clean)

Static re-exports from tx/index.ts caused vite to trace
loadEscrowScript/loadAdvertScript/buildLiveTxForPublishReferenceScripts
into the buyer UI bundle, hitting the CML WASM "ESM integration proposal"
limitation. Sibling builders avoid this with /* @vite-ignore */ dynamic
imports; we keep symmetry by parking the helpers on a separate
@marketplace/shared/tx/server entry that the buyer never imports.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
david
2026-05-14 15:41:29 +02:00
parent 5cae0c4f6c
commit 57e77e0e25
4 changed files with 27 additions and 11 deletions

View File

@@ -25,13 +25,13 @@ import * as ed from "@noble/ed25519";
import { blake2b } from "@noble/hashes/blake2b";
import { bech32 } from "bech32";
import { LiveOgmiosProvider } from "@marketplace/shared/chain";
import type { WalletKey } from "@marketplace/shared/tx";
import {
buildLiveTxForPublishReferenceScripts,
loadEscrowScript,
loadAdvertScript,
pkhToEnterpriseAddress,
} from "@marketplace/shared/tx";
import type { WalletKey } from "@marketplace/shared/tx";
} from "@marketplace/shared/tx/server";
ed.etc.sha512Sync = (...messages: Uint8Array[]): Uint8Array => {
const h = createHash("sha512");