@trustlink/tsn-sdk is the application-facing TypeScript package for TSN. It provides service selection, TIP/TIN identity helpers, signed payment authorization builders, intent submission, wallet transaction utilities, and recovery functions. The SDK prepares and submits authorized requests; the TSN Node verifies work, the Receiver coordinates it, and a permissioned Cranker submits the authorized transaction.
The package is currently maintained in the TSN Protocol workspace and is not published to the public npm registry. Use the repository build before importing it into an application:
Build the workspace SDK
First connection
Pass the endpoints selected by your application. The SDK checks configured local endpoints before configured live endpoints for Node, Receiver, and Solana RPC, then reports which endpoint was selected.Check service availability
TINS_LOOKUP_SECRET on the server; do not bundle it into browser code. The Node independently validates the TIN registry and route during payment verification.
Build an integration
The guides introduce one SDK task at a time, with the relevant inputs and code before the protocol details:Quickstart
Connect services, resolve a TIN, sign an authorization, submit a request, and follow its status.
Network status
Configure local-first service discovery and check readiness before requesting a wallet signature.
TIN V1 identity
Create private identity envelopes and recover a TIN through its owner-indexed record.
Payment lifecycle
Follow authorization, Receiver acceptance, Node verification, Cranker execution, and confirmation.