> ## Documentation Index
> Fetch the complete documentation index at: https://trust-link-tsn.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference — Public TSN surfaces

> Source-backed reference for TSN APIs, SDK exports, operator commands, and Solana entrypoints used to build DESP applications.

This section documents public interfaces exposed by the Transfer Settlement Network (TSN), TrustLink Labs' implementation of a Decentralized Settlement Protocol (DESP).

DeFi decentralizes financial services; DESP decentralizes settlement infrastructure. The pages here describe what an application, operator, or integrator can call and what the source currently guarantees.

## Scope

The inventory is grouped by the public surface that owns the contract:

* **RPC Methods**: FastAPI Node endpoints and the Solana JSON-RPC gateway's HTTP control endpoints.
* **SDK**: `@trustlink/tsn-sdk` application helpers and `@trustlink/tsn-cranker-sdk` operator helpers.
* **CLI**: setup commands exposed by the Cranker SDK package.
* **On-chain Programs**: public Solana instruction entrypoints that settle or register protocol state.

No webhook group is listed because the scanned source does not expose a consumer webhook dispatcher. Receiver and worker communication is authenticated HTTP work leasing, not a public webhook contract.

## Base URLs

| Surface                  | Local default                       | Hosted value observed in source                                                       |
| ------------------------ | ----------------------------------- | ------------------------------------------------------------------------------------- |
| TSN Node                 | `http://127.0.0.1:8000`             | Configure a deployment URL; no hard-coded public Node URL is declared in `server.py`. |
| Receiver                 | Configure `TSN_RECEIVER_PUBLIC_URL` | Configure a deployment URL; the Node source treats it as environment configuration.   |
| Solana RPC gateway       | `http://127.0.0.1:8787`             | `https://tsn-rpc-gateway.vercel.app/`                                                 |
| Solana WebSocket gateway | `ws://127.0.0.1:8787/ws`            | Same gateway host with `/ws`.                                                         |

The SDK chooses local endpoints before live endpoints when both are supplied to `getTsnNetworkStatus`. Applications should use the gateway URL rather than embedding an upstream Solana provider URL.

## Versioning and evidence

The reference is generated from the source paths linked at the bottom of each page. It does not promote an interface merely because a route is present in configuration. A destination route must pass the Node's registered-route and live-liquidity checks before it is returned as ready.

When a type or account layout cannot be established from the inspected source, the page says `TODO: confirm from ...` rather than inventing a field.

## Source map

* [TSN Node](https://github.com/Trustlink-Labs/TSN-Protocol/blob/main/tsn-protocol/services/tsn-node/server.py)
* [RPC gateway](https://github.com/Trustlink-Labs/TSN-Protocol/tree/main/tsn-protocol/services/tsn-rpc-gateway)
* [TSN SDK exports](https://github.com/Trustlink-Labs/TSN-Protocol/blob/main/tsn-protocol/sdks/tsn-sdk/src/index.ts)
* [Cranker SDK CLI](https://github.com/Trustlink-Labs/TSN-Protocol/blob/main/tsn-protocol/sdks/tsn-cranker-sdk/src/cli.ts)
