Skip to main content
@trustlink/tsn-sdk@0.1.0 is a private source workspace package. It is not currently published for a public-registry npm install @trustlink/tsn-sdk. Developers need access to the repository or a separately supplied built package. The package’s main and types point to dist, so source checkout alone is not the built SDK.

Build in the existing workspace

From a checkout with its dependencies installed, use the root script:
The script builds the TCAP SDK dependency, then the TSN SDK. A separate application can install the built local SDK directory using npm’s local-directory dependency mechanism; it must also be able to resolve the TCAP SDK’s local dependency. The package is ESM. For build-tool troubleshooting and environment-specific setup, use the internal operations record. The manifest does not declare a tested Node/browser version matrix. Modules require the facilities they actually call: fetch, WebCrypto, Solana binary types and, for server modules, Node APIs. The root barrel exports server facilities as well as client helpers. Browser applications must select browser-safe imports or use the repository’s browser bundle; importing the root does not guarantee every export is browser-safe.

Initialize a client

This is an illustrative initialization snippet. The complete typed client example takes endpoint and request arguments explicitly.
The client removes a trailing slash, uses supplied fetch or global fetch, and adds x-api-key only when configured. It has generic post/get/patch methods and intent helpers. It does not start services, manage a wallet, read your application’s .env, or retry failed requests automatically.

Your first offline integration

Start with canonical authorization preparation. The complete example creates a real SDK message and request with explicit inputs, then lets the caller supply wallet approval. Its offline validation checks the decimal amount, recipient-owner hash and HTTP request shape with mocked transport. These checks establish example behavior without submitting a payment. After that, configure service endpoints, integrate a wallet-approved reserve deposit, and implement status reconciliation. Live credit additionally requires the matching deployed programs, valid recipient registration, initialized verifier, accepted asset/reserve state and current witness/prover configuration. These dependencies are not checked by client initialization.

Reference and extension

The complete API catalog lists all discovered public exports and class/interface members. Use identity guidance for trusted lookup and wallet recovery, troubleshooting for failures, and integration boundaries for merchant, service-provider and operator applications.