Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.calmtreasury.xyz/llms.txt

Use this file to discover all available pages before exploring further.

All wallet routes require:
  • A valid calm_session cookie (call POST /v1/session first)
  • :address matches the cookie’s bound wallet (else 403 wallet_token_mismatch)
The cookie is sent automatically by browsers when the SDK uses credentials: "include".

GET /v1/wallets/:address

Read current state for the wallet. Proxied from Bridge — no caching.
curl https://api.calmtreasury.xyz/v1/wallets/0xabc… \
  --cookie "calm_session=<jwt>"
{
  "wallet":         "0xabc…",
  "kycState":       "not_started",
  "hasAcceptedTos": false
}
wallet
string
Echoed from the URL.
kycState
enum
not_started | incomplete | under_review | active | rejected. Derived from Bridge’s customer status.
hasAcceptedTos
boolean
True after the user has accepted Bridge’s ToS via the hosted page.
Errors: session_required, session_invalid, wallet_token_mismatch, invalid_wallet, customer_not_registered, bridge_error.

POST /v1/wallets/:address

Register a new (app_id, wallet) pair. Creates the Bridge customer and the local mirror row.
curl -X POST https://api.calmtreasury.xyz/v1/wallets/0xabc… \
  --cookie "calm_session=<jwt>" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Ada",
    "last_name":  "Lovelace",
    "email":      "ada@example.com",
    "country":    "US"
  }'
{
  "wallet":         "0xabc…",
  "kycState":       "not_started",
  "hasAcceptedTos": false
}

Body

first_name
string
required
last_name
string
required
email
string
required
Must be unique across the entire Bridge dev account. Bridge rejects duplicates with email_already_in_use.
country
string
required
ISO 3166-1 alpha-2 (e.g. "US"). Normalized to uppercase server-side.
Errors: validation_error, wallet_token_mismatch, invalid_wallet, already_registered (409), email_already_in_use (400, surfaced from Bridge), bridge_error.

POST /v1/wallets/:address/tos-link

Returns Bridge’s hosted ToS URL. Iframe it; Bridge sends a postMessage with signedAgreementId on accept.
curl -X POST https://api.calmtreasury.xyz/v1/wallets/0xabc…/tos-link \
  --cookie "calm_session=<jwt>"
{
  "url": "https://compliance.bridge.xyz/accept-terms-of-service?session_token=…"
}
Errors: customer_not_registered (404), wallet_token_mismatch, bridge_error.

POST /v1/wallets/:address/kyc-link

Returns Bridge’s hosted KYC URL. Same iframe pattern as the ToS link, but no postMessage — the SDK polls GET /v1/wallets/:address to watch the state transition.
curl -X POST https://api.calmtreasury.xyz/v1/wallets/0xabc…/kyc-link \
  --cookie "calm_session=<jwt>"
{
  "url": "https://compliance.bridge.xyz/kyc?session_token=…"
}
Errors: customer_not_registered (404), wallet_token_mismatch, bridge_error.