Skip to main content
The Developer SDK’s API client has one trust boundary: it runs on your server with a Swig developer API key. The package’s narrow signing helpers are separate and cannot call the hosted API.

Transaction lifecycle

The signer may be a wallet, passkey flow, hardware device, HSM, enclave, or custody service. Your application owns that integration and the key material. The optional helper only adapts its result to the prepared transaction format.

Credentials and imports

TypeScript
Requests use Authorization: Bearer <api-key> against https://api.onswig.com. Set baseUrl / base_url only when targeting a different trusted deployment.
Do not use NEXT_PUBLIC_*, Vite public variables, or mobile build variables for the API key. Do not import SwigClient or any server entrypoint into shipped client code.

Prepared response groups

Prepared responses preserve transaction order and expose embedded signature metadata. Treat the serialized Solana transaction as the final source of truth for transaction-level signers: The word client in the response schema identifies an API category. It does not describe a shipped browser client, and the derived collections are not a complete transaction-signature checklist. In particular, an Ed25519 requester is represented as a required signer in the serialized Solana transaction while signatureRequests remains empty.

Retries and safe repeats

4xx responses raise immediately. Network failures and 5xx responses use the configured retry policy where the operation is safe to repeat.

Wallet handles

A server-side wallet handle binds the config address, optional wallet address, network, and requester authority used for preparation:
TypeScript
Reads do not require a requester authority. Preparation calls do. If the authority comes from application auth or role mapping, resolve and validate it on the server before calling the SDK. Continue to Browser Signers for the optional no-API-key helper surface.