Obtain the client
Source is inclients/private; the reviewed web build produces sdk.js, channel.js and channel_bg.wasm under tools/web-channel/pkg. These are not published npm packages. Maintainers reproduce it with the tracked preparation and qualification instructions.
Do not distribute fixture bundles, fixture roots or test release policies. Obtain code and policy independently of the relay you verify.
Connect and query
This excerpt assumes those three artifacts are in your application. Variables are supplied by a reviewed deployment; there is no default live URL.walletSigner supplies a 32-byte public key and signMessage(bytes) returning a 64-byte Ed25519 signature. The SDK binds it to the verified session. authExpiry must fit both the channel expiry and the deployment’s authentication lifetime. Never pass the wallet’s private key to the relay.
Set transport: 'websocket' for socket commands/subscriptions; HTTP is default. Serialize requests. See authentication, units and unknown outcomes.
Reference examples
API pages reuse this verifiedclient. Their ctx is your application’s input
context, not an SDK-generated object: id, epoch and expiresAt are the request
values above; market is a configured market ID; goodUntil is the financial
deadline. Cancel/lookup examples use originalOrderId and a distinct
cancelAttemptId. Grant examples use the agent’s agentPublicKey and
agentExpiresAt; import READ, TRADE and CANCEL from sdk.js.
Decoded-response examples are illustrative TypeScript objects, not JSON to submit.
recordedIntentDigest, snapshotRevision and quoteUnitId stand for 32-byte
values from the corresponding record/configuration; observedAt is a qualified
millisecond timestamp. Integer amounts illustrate encoding, not live prices or
approved leverage/fee policy.