TypeScript SDK
Build validated intents, transactions, state reads, and receipt reconciliation.
@workspace/trust-stack is the domain client for the Move packages. It sits above
@workspace/supra-client, which owns canonical addresses, BCS encoding, transaction preparation,
RPC reads, and receipt types.
Integration pattern
const intent = parseTokenCreationIntent(formValues);
const request = buildTokenCreationTransaction(intent, creator);
const prepared = await client.prepareTransactionRequest(request);
const hash = await walletClient.signAndSubmit(prepared);
const receipt = await client.waitForTransactionReceipt({ hash });
const token = parseTokenCreatedEvent(receipt, { ...intent, creator });Keep these phases separate. Do not build BCS directly in page components, treat raw form strings as validated values, or assume a successful submission hash contains the expected event.
Package exports
Each domain follows the same shape where applicable:
- a Zod schema and intent parser;
- transaction builders with typed addresses and integers;
- state readers and response schemas;
- entry-function and event constants;
- exact receipt/event parsers;
- Merkle or manifest utilities for airdrops.
Numeric safety
Token amounts are decimal strings at the UI boundary and bigint in exact arithmetic. Conversion
must use authoritative metadata decimals and reject extra fractional places or u64 overflow.
Never use JavaScript number for base-unit balances or timestamps returned as large integers.
Address safety
Use parseSupraAddress to canonicalize and validate an address. Reject the zero address whenever a
creator-selected owner, beneficiary, or recipient must be a real account. Do not compare shortened
display strings.
Compatibility
Package function/event addresses are checked-in release constants. Updating one is a release change: record the finalized transaction, exact bytecode hash, ABI, source commit, and chain ID, then update tests and acceptance evidence in the same review.