For the complete documentation index, see llms.txt. This page is also available as Markdown.

Sponsored Withdrawal

Submit a user-signed WithdrawToken permit through Gateway. Gateway pays the ValueChain gas fee; the user still authorizes the withdrawal with a signature. This is not the Transaction Relayer.

Submit a withdrawal

POST /user/{userAddress}/evm-withdraw

curl -X POST \
  "https://mainnet-gw.sodex.dev/api/v1/user/0x1111111111111111111111111111111111111111/evm-withdraw" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "cmdData": "0x...",
    "nonce": "123",
    "deadline": "1780000000",
    "signature": "0x..."
  }'

Request body

Name
Type
Required
Description

cmdData

string

Yes

ABI-encoded WithdrawToken command data with a 0x prefix.

nonce

string

Yes

Nonce included in the permit signature.

deadline

string

Yes

Permit expiration included in the signature.

signature

string

Yes

User permit signature with a 0x prefix.

Do not send to or cmdType. Gateway fixes them to the withdrawal handler and WithdrawToken command.

Build the permit

Encode cmdData in this order:

Position
Value

1

Canonical assetName from Asset Configuration.

2

Exact destination chain identifier.

3

Case-sensitive receiver. If a memo/tag is required, use ${address}:${memo/tag}. See Encode the receiver.

4

Raw integer amount after applying asset decimals.

5

Route type: 0 for custody or 1 for bridge.

6

Route-specific memo value; use an empty string when unused.

7

Whether funds should return to CLOB if external execution fails.

Read the user's nonce from the Mainnet permit contract 0x890B7D142841065E64E5f94a455876e6352A7801 using nonces(address owner, uint192 key). Call hashCallForPermit on that contract with target 0x441BDb33C7d6DC49f627a42c3d71671D50DC2e94, command WithdrawToken, the encoded command data, nonce, and deadline, then sign the returned hash.

Response

This response confirms only that Gateway submitted the ValueChain transaction. Track final external settlement with the History & Status API.

Integration guide

Withdrawals

Last updated