Skip to main content
This guide is for developers integrating a trading application or automated client with Cinder. It connects an existing Cinder account and returns its compact account view. Connecting a wallet authenticates that account; it does not create an account or deposit funds. Traders using an application do not enter these values manually. The application supplies the client configuration and asks their wallet to sign requests.

Before you begin

Obtain three sets of inputs before running the example:
  1. 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.
  2. 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.
  3. 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.
This page does not provide a public API hostname, SDK download URL or account-registration endpoint. Obtain the inputs for the service you intend to use rather than inventing IDs or treating the examples as connection credentials. You do not need to deploy an enclave or configure AWS to use the client.

Prerequisites

API address

An illustrative origin is https://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 epoch 3 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 a 0x prefix.
The three integer fields are positive decimal strings. For example, '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.
Call 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
The amounts are illustrative quote atoms, not dollar balances. See accounts and units. An invalid placeholder fails before connection; an application error returns a code described in errors.

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. Add transport: '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.