1. CRX
  2. API reference
  3. Viewers
  4. Grant a viewer

Grant a viewer

PUT/viewers/{viewer}

Lets another wallet read your account: GET /balance, GET /positions and GET /trades. Send no body. The viewer signs with x-crx-address set to your account and x-crx-signer set to its own wallet.

Authentication

  • x-crx-address x-crx-ts x-crx-sig
  • x-crx-address x-crx-signer x-crx-ts x-crx-sig

Parameters

NameInTypeDescription
viewer requiredpathstring

The viewer wallet, 0x hex. Not the zero address and not the account wallet.

Responses

200

The wallet already held a grant.

FieldTypeDescription
account requiredstring
viewer requiredstring
granted_by requiredstring

Wallet that granted access.

granted_at requiredintegerminimum 0

Unix time in milliseconds.

201

Viewer granted.

FieldTypeDescription
account requiredstring
viewer requiredstring
granted_by requiredstring

Wallet that granted access.

granted_at requiredintegerminimum 0

Unix time in milliseconds.

400

invalid_signature, viewer_invalid.

code invalid_signature viewer_invalid

401

unauthorized: a header is missing or malformed, x-crx-ts is out of range, the call was already used, the signature does not match, or the caller lacks access.

code unauthorized

403

not_whitelisted, viewer_is_maker. viewer_grant_wallet_only: only the account wallet can add a viewer.

code not_whitelisted viewer_grant_wallet_only viewer_is_maker

408

timeout: no answer within 30 seconds.

code timeout

409

viewer_cap: the viewer limit is reached; remove one first.

code viewer_cap

429

rate_limited: retry after Retry-After seconds.

code rate_limited

HeaderTypeDescription
Retry-Afterinteger

Seconds until the next call is accepted.

ratelimit-limitinteger

Maximum calls in a burst.

ratelimit-remaininginteger

Calls remaining before the limit.

ratelimit-resetinteger

Seconds until the full limit is restored.

ratelimit-refillinteger

Calls restored per minute.

502

upstream: a chain read failed. Retry shortly.

code upstream

503

viewers_unavailable: viewer data is unavailable. Retry later.

code viewers_unavailable