Before you begin
Obtain three sets of inputs before running the example:- Service configuration and SDK bundle: the API address, network and deployment IDs, and matching SDK files from the Cinder service operator or your application’s integration maintainer.
- Trusted release policy: the expected manifest hash and enclave measurements from an independently approved release. These values tell the client which enclave release to accept.
- Existing account configuration: your private account ID, applicable policy version, current authority epoch and permitted authentication lifetime, together with an owner wallet or authorized agent signer.
Prerequisites
API address
An illustrative origin ishttps://api.cinder.example, or https://api.cinder.example:8443 if a custom port is configured. These are examples, not live service addresses. Supply only the origin: the SDK adds paths such as /v1/attestation itself. Non-root paths, query parameters, fragments and embedded credentials are rejected.
The API origin is distinct from your frontend application’s origin, which the service may allow through its browser access configuration.
Trust and authorization
The release policy answers which service code to trust. The account ID and signer answer which account you may access. Network and deployment IDs identify the intended Cinder environment; they are not numeric blockchain chain IDs or venue identifiers. Expected release values must come from a trusted source independently of the relay being verified. The SDK compares the enclave’s attestation with those expectations before sending private requests. A matching attestation identifies the approved release; it does not by itself establish that the software is error-free. The authority epoch is separate from the policy version. If revocation advances an account from epoch3 to 4, subsequent requests must use 4; the account ID stays the same. Revocation does not automatically cancel outstanding orders. See agents.
The example limits each request’s authentication expiry to the earlier of the configured validity window and channel expiry. An order’s goodUntil and an agent’s grant expiry are separate deadlines; authentication expiry does not automatically close a position or cancel a resting order.
A signer exposes publicKey: Uint8Array (32 bytes) and signMessage(bytes), returning a 64-byte Ed25519 signature. It never sends its private key to Cinder.
Configuration example
Populate this application-defined configuration object with the inputs above. It is not an SDK export or an account-registration request. Replace every placeholder; there are no default service IDs, account IDs or authority values. Hashes and IDs are hexadecimal without a0x prefix.
'60000' means a 60-second authentication window, but is valid only if the configured service limit permits it. Do not assume that a policy version or authority epoch is always '1'.
Connect and read
Use the interface and configuration above in this module, alongside the web SDK bundle.readAccount(config, walletSigner) from your connected-wallet flow. With an authorized account and valid configuration, it returns a decoded value such as:
Decoded account view
Continue with commands and subscriptions
The example closes its channel after one read. For a trading client, retain the verified channel for its valid lifetime and serialize requests. Addtransport: 'websocket' to the connection options for socket commands and subscriptions.
Reference pages use client for this configured client and ctx for application-supplied request inputs:
In read examples,
Context is an application-defined type with the fields above, not a type exported by the SDK. Import ReadFamily from sdk.js when using the generic paging example.
Decoded examples also use recordedIntentDigest, snapshotRevision and quoteUnitId for 32-byte values from their corresponding records, observedAt for a millisecond timestamp, and approvedPolicyVersion for the configured u32 policy. Examples show typed SDK values, not JSON to send over HTTP.