The custody gateway routes live under /. They form the custodyOps operation group of the Platform API, and the generated API reference lists every route and schema. This page walks the routes in the order a deposit and a withdrawal use them. Deposit and withdrawal stages lists what each stage means and who moves it. Custody gateway explains the model.
Before you call
- The “Self-custody” module must be on. With it off, every route answers
DALP-20531(platform.module.DISABLED). - Paths below are relative to
/.api/ v2/ addons/ custody- gateways {gatewayAddress}is the client's gateway address. - Each write carries a
walletVerificationobject that proves the acting wallet. A write answers200when it is final and202when it waits for a second approver. A write honours anIdempotency-Keyheader, so a retry with the same key does not repeat it. Idempotency and async settlement says how. - Gateway manager actions need the gateway manager role on the acting wallet, and the screener actions need the screener role. A client acts with the wallet bound to its gateway.
Bind the client wallet
A gateway has no client wallet when it is created. Bind one before the client's own routes work:
curl -X PATCH "https://your-instance.example.com/api/v2/addons/custody-gateways/gateways/$GATEWAY/client-wallet" \
-H "X-Api-Key: sm_dalp_..." -H "Content-Type: application/json" \
-d '{"clientWallet": "0x...", "walletVerification": {...}}'The wallet must belong to the gateway's client identity. The result is { "client. GET /gateways/ then returns the gateway to the client, with the address the client deposits into.
Walk a deposit
- The client reads the gateway with
GET /gateways/and sends coins to its address, or records a deposit from a wallet withmine POST /gateways/. The body is{gateway Address}/ deposits { "token", "amount", "wallet.Verification" } - List the gateway's deposits with
GET /gateways/and read one with{gateway Address}/ deposits GET /gateways/. A new deposit rests at{gateway Address}/ deposits/ {deposit Id} Quarantined. - The screener moves it with
POST /gateways/:{gateway Address}/ deposits/ {deposit Id}/ transitions
curl -X POST ".../gateways/$GATEWAY/deposits/$DEPOSIT/transitions" \
-H "X-Api-Key: sm_dalp_..." -H "Content-Type: application/json" \
-d '{"transition": "clear", "walletVerification": {...}}'- The operator transitions are
confirm-sender,clear,refuse,flag,unfreeze,renew-freeze,report,return,retry,custody-returnedandrecover. The client transitions arepull-backandexit.recoveralso takes"to", the wallet that receives the coins. - Read
GET .../for the screening result anddeposits/ {deposit Id}/ screening POST .../to add an operator note.deposits/ {deposit Id}/ notes
Walk a withdrawal
- The client asks for the fee with
GET .../, then creates the request withwithdrawal- fee- quotes POST /gateways/. The body is{gateway Address}/ withdrawals { "receipt. The payout address must be on the gateway's approved payout list.Token", "shares", "payout", "wallet Verification" } - List and read requests with
GET .../andwithdrawals GET .../. Readwithdrawals/ {request Id} GET .../for the screening result.withdrawals/ {request Id}/ screening - Move a request with
POST .../. The operator transitions arewithdrawals/ {request Id}/ transitions clear,approve,reject,flag,unfreeze,renew-freeze,report,returnandunfulfil. The client transitions arecancel,collect,exitandset-payout, andset-payoutalso takes"payout". - The client sets how it is paid with
PATCH .../(auto- claim { "enabled", "wallet) andVerification" } PATCH .../(default- payout { "payout", "wallet).Verification" }
curl -X POST ".../gateways/$GATEWAY/withdrawals/$REQUEST/transitions" \
-H "X-Api-Key: sm_dalp_..." -H "Content-Type: application/json" \
-d '{"transition": "collect", "walletVerification": {...}}'Reinstate a payout address
A client flag suspends the gateway's payout addresses. Clearing the flag does not reinstate them. After review, a gateway manager reinstates one with the address's transitions route:
curl -X POST ".../gateways/$GATEWAY/approved-payouts/$ADDRESS/transitions" \
-H "X-Api-Key: sm_dalp_..." -H "Content-Type: application/json" \
-d '{"transition": "reinstate", "walletVerification": {...}}'The other transitions on that route are remove and suspend. GET .../ lists the addresses and their state, and POST .../ adds one.