WithdrawService
Create Trading Withdraw
Create or return one API-key-authorized withdraw from Trading.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/v1/chain/trading-withdraws' \
--header 'Accept: */*' \
--header 'X-API-KEY-ID: YOUR_API_KEY_ID' \
--header 'X-API-TIMESTAMP: YOUR_API_TIMESTAMP' \
--header 'X-API-SIGNATURE: YOUR_API_SIGNATURE' \
--header 'Content-Type: application/json' \
--data '{
"payload": {
"action": "TO_FUNDING",
"amount": "18.446744073709551617",
"assetId": 100,
"deadlineTsSec": "1735689600",
"destinationAddress": "0x3333333333333333333333333333333333333333",
"destinationChainId": "1",
"idempotencyKey": "idem_01J5EXAMPLE0000000000000",
"nonce": "18446744073709551617"
},
"payloadSignature": "AA=="
}'Responses
{
"intentId": "9155001234567"
}Destination for funds leaving Trading.
Withdraw amount in canonical 18-decimal unified asset units. For example, 0.5 is encoded as 500000000000000000.
Unified asset identifier from Polyester asset metadata. amount_e18 is denominated in this asset at canonical 18-decimal scale.
Unix timestamp in seconds after which this signed user authorization is no longer accepted by the API. This is separate from the server-owned execution deadline used later for on-chain submission.
Destination address. For TO_EXTERNAL_CHAIN this is an address on destination_chain_id and is validated according to that network. For TO_FUNDING, omit it to move funds to the selected account's Funding account or provide another Polyester funding address for a Trading-to-Funding transfer.
External network id for TO_EXTERNAL_CHAIN. Omit for TO_FUNDING.
Client-chosen idempotency key. Reusing the same key with the same payload returns the existing withdraw; reusing it with different payload fails.
Client-generated unsigned 128-bit nonce bound to the signed request. This is an identifier, not a decimal amount.
User/API signature over deterministic TradingWithdrawIntentPayload bytes.
Stable server-owned intent identifier for the accepted withdraw lifecycle. Clients use this id to follow later progress for the same withdraw flow.
9155001234567| Key | Status | Error | When |
|---|---|---|---|
| unauthenticated | 401 | Unauthenticated | Authentication required. |
| permission-denied | 403 | Permission Denied | Permission denied. |
| invalid-argument | 400 | Invalid Argument | Invalid argument. |
| not-found | 404 | Not Found | Not found. |
| unavailable | 503 | Unavailable | Service unavailable. |