Overview
@settlemint/dalp-sdk is the TypeScript client for the DALP Platform API, the HTTP API a DALP instance serves under /api/v2. Every published v2 route is a typed method on one object: GET /api/ is dalp.api.token.list() and GET /api/ is dalp..
The SDK and OpenAPI contract are generated from the same route declaration for a release. Match the SDK version to the deployment version: a newer client can name a route an older deployment does not serve.
One declaration, read once, emits the route table and type registry that generate the promise client, the Effect client and the CLI.
The SDK runs in browser, server and React Native applications. A browser or React Native client authenticates with the session cookie and refuses an API key, and a server client authenticates with an API key. It has no framework dependency: React, TanStack Start, Next.js, and a worker all use the same client, and the framework-shaped conveniences are opt-in.
Start with Install and configure. To call the API from another language, or to read the endpoint schemas themselves, use the API reference, which renders every route from the spec. The integration guides cover the header contracts every client shares.
Install and configure
Install the package, construct a client and pick the credential for your runtime.
Settlement, credentials, and caching
A write can resolve before the chain does. dalp. asks the platform to wait for a bounded time, set through settlementTimeoutMs. The call returns either the settled record or a handle, { transaction, for an instruction still in progress. A handle is not a failed write, and treating it as one tells a user their transfer was rejected while it is still in flight. Mutations and settlement covers both shapes and how to follow a handle.
The SDK refuses an API key in a browser client. A client whose runtime resolves to browser or react-native throws at construction when given a key, rather than waiting for the first request. An API key acts as its user in its issued organisation up to its read or read-write scope, so shipping one in a browser bundle exposes it to every visitor.
That guard trusts the configured runtime: passing runtime: "server", or setting X-Api-Key in per-call headers, sends the key wherever the code runs. Install and configure covers which credential belongs where.
Cache keys are derived, not written. queryOptions builds its key from route identity plus canonicalised input, so two callers passing the same parameters in different key order share one cache entry. A hand-written key that differs by one character creates a second entry that never invalidates, and a colliding key makes one entry serve two different requests. TanStack Query covers the key shape and invalidation.
Validation and state
The platform validates every request on the way in and every response on the way out. The SDK also validates each JSON and event-stream success response against the route's declared schema, throwing sdk. on a mismatch. Binary downloads skip validation.
Because enum checks are strict, an SDK older than the deployment can throw on enum values added in a later release. The SDK loads response schemas lazily on first call and does not validate request input. Validating user input stays your choice of library, and the Console's own approach shows one worked example.
The SDK is not a state manager. It returns promises and, for the routes that stream, async iterables. The TanStack Query factories are plain objects in the shapes that library expects.