Skip to main content
@trustlink/tsn-sdk is the application-facing TypeScript façade. It exports the client, authorization, TIN, cross-chain, wallet-transfer, receipt, recovery, and Solana helpers from src/index.ts. The snippets illustrate integration stages and assume caller-supplied variables. Complete typed examples and the full generated reference provide verified inputs and signatures.

Public modules and functions

The exports below are grouped by source module. The linked source is authoritative for the complete parameter type and return shape.

Network status

The application supplies endpoint values; the SDK does not read the application’s .env file. When both local and live endpoints are supplied, it prefers a reachable local endpoint before the configured live one. Native readiness requires the configured Node, Receiver, and RPC gateway to respond. Cross-chain readiness additionally requires a registered destination route. The Cranker is a transaction-submission role, not a public application HTTP dependency.

Payment authorization

The application separately constructs and wallet-signs the reserve deposit transaction. Node resolves the TIN’s current TIP route itself; do not add route commitments or the protected lookup secret to the sender authorization or intent request. Current Node validation accepts tcap_deposit_v2, not retired wallet-only or PRU funding modes.

TIN V1 lookup and recovery

resolveTinV1Identity derives the registry PDA from the TIN and TIP program ID, reads the account through the supplied Solana connection, validates the account’s version and keyed lookup commitment, and decrypts the identity envelope using the supplied lookup secret. Call it only in a trusted application environment where that secret is protected. Never bundle the lookup secret into browser code or send it to Receiver or Cranker. The Node independently verifies the recipient registry state and route when it validates payment work. TIN V1 creation encrypts the TIN and display name before they enter Receiver work. The SDK also provides owner-recovery PDA and envelope helpers so wallet recovery does not rely on public registry enumeration. Do not use retired resolveTIN or resolveTinRoute exports, raw legacy TIN account decoders, or direct-create instruction builders. Source: index.ts, network-status.ts:79-157, payment-authorization.ts:1-258, tins.ts:1168-1630, cross-chain.ts:1-450