Bearer authentication
trading:read; trading keys created in settings also have trading:write. The server checks current account ownership, key revocation, scopes, network, and feature availability.
Wallet-signed registration
Settings handles registration for most integrations. The low-level endpoints are documented under API key actions. A wallet signs EIP-712 typed data with domain nameLegend Trading API, version 1, and a salt equal to keccak256(UTF8("https://app.legend.trade/api/trading")). Use this exact audience for production registration and revocation.
TradingAccess contains these fields, in order:
The JSON consent uses snake_case field names and
expires_at: null (or omits that field). A signature must be registered within five minutes of issued_at. This freshness requirement applies to registration only; the created key does not expire.
The signed network, account, permissions, and audience cannot be changed. Create a new key to change permissions. Only main-account, mainnet grants are accepted. A key hash cannot be registered again, including after revocation.
Revocation
Settings signsRevokeTradingAccess under the same domain, with account and keyHash as string fields. The owner signature is required; knowledge of a key hash alone cannot revoke a key. Revocation works even if trading is disabled. A revocation submitted before registration prevents later replay of that registration.
Existing grants that explicitly authorized a finite expiry retain that signed restriction; they are not silently extended. Create a new key for access until revocation.