Deposits and withdrawals
Deposit from other chains through your deposit addresses, and withdraw USDT to other chains through the bridge: quote, sign a transfer, track the payout.
On this page
Help me with: Deposits and withdrawals. Deposit from other chains through your deposit addresses, and withdraw USDT to other chains through the bridge: quote, sign a transfer, track the payout.
Target environment: {environment} (chain ID {chainId}). Recorded signing cases keep their original environment.
{executionGuidance}
Read this first: {origin}/bundle/guides/deposits-and-withdrawals.md (~21 KB, plain Markdown: this page plus the AGENTS.md rules, Environments).
Fetch other pages from the index at {origin}/llms.txt only as you need them. {origin}/downloads/contract.json is a machine-readable contract for tools, not for reading.
Rules: follow AGENTS.md; do not send requests without the user asking you to; read credentials from environment variables; never retry writes automatically; show me the code and how to run it. URLs on this page: Testnet (chain ID 326). Other code on this page doesn't change: it stays on testnet until you switch it in your code. Tutorials, signing cases and live tools always use testnet.
Use this page to move funds between Grvt and wallets on other chains from code:
- Deposits: each main account has a deposit address on every supported chain. Tokens sent there are bridged to Grvt and credited to your main account.
- Withdrawals to other chains go through Grvt's bridge partner: get a quote, sign a transfer, then track the payout.
- Withdrawals to Ethereum use the withdrawal call instead, which the SDKs have.
The deposit address and bridge calls are on the edge host and have no SDK methods yet. Send them over HTTP as shown here.
Authenticate edge calls
- Deposit addresses: send your API key in an
X-API-Keyheader. A session cookie from a login works too. - Bridge withdrawals: send the session cookie,
Cookie: gravity=..., from a login (Authentication). The API key header alone gets HTTP 401 (err_auth_user_not_logged_in).
Errors come back with an HTTP status and a body like
{"code": "err_withdrawal_quote_expired", "message": "withdrawal quote has expired", "params": {}}. Match on
code.
Get your deposit addresses
export GRVT_DOMAIN=testnet.grvt.io
curl -sS "https://edge.testnet.grvt.io/api/v1/deposit/addresses" \
-H "X-API-Key: $GRVT_API_KEY"
The response lists one entry per chain:
{
"chains": [
{
"chain": "BASE_SEPOLIA",
"chain_id": "84532",
"deposit_address": "0x...",
"supported_tokens": [{"name": "USDT", "contract_address": "0x..."}]
},
{
"chain": "SOLANA_TEST",
"chain_id": "solana_test",
"deposit_address": "",
"supported_tokens": [{"name": "USDT", "contract_address": "..."}]
}
]
}
| Field | Meaning |
|---|---|
chain | The chain's name. Pass it back exactly as returned. |
chain_id | The EVM chain ID, or a name for chains without one, such as "solana" and "tron" ("solana_test" and "tron_test" on testnet). |
deposit_address | Send tokens here. Empty when the address doesn't exist yet (Create an address). |
supported_tokens | The tokens you can deposit on this chain, with their contract addresses. |
token_out | Present only when deposits are credited as a different token, which it names. |
Watch out:
- The chains and tokens differ by environment and change over time. Read them from this call; don't hard-code them.
- A
contract_addresscan be empty when Grvt couldn't look it up. Call again before you send that token. - A new account fails with
err_chain_account_not_setup("funding account is not set up") until its main account is set up.
Create an address on another chain
When: a chain is listed with an empty deposit_address.
curl -sS "https://edge.testnet.grvt.io/api/v1/deposit/generate-address" \
-H "X-API-Key: $GRVT_API_KEY" \
-H "Content-Type: application/json" \
--data '{"chain": "SOLANA_TEST"}'
It returns one entry in the same shape, with the new deposit_address. The chain name is not case-sensitive.
An unknown chain fails with err_deposit_chain_not_supported, and a chain that isn't open to your account with
err_deposit_chain_not_available.
Track deposits
A bridged deposit arrives in your main account as a transfer with transfer_type
NON_NATIVE_BRIDGE_DEPOSIT. Find it with transfer_history.
Withdraw to another chain
When: you send USDT from your main account to a wallet on another chain.
Before you start:
- The destination address must be in your main account's withdrawal address book.
- The signing wallet needs the External Transfer (or Admin) permission on the main account (Permissions). The withdrawal is a transfer to the bridge partner's Grvt account.
- The funds must be in the main account. Move them from a sub-account with transfer first.
-
Read the routes and the bridge partner's account:
curl -sS "https://edge.testnet.grvt.io/api/v1/bridge/withdrawal-info" -H "Cookie: gravity=$GRVT_COOKIE"{ "provider": "RHINO", "funding_address": "0x...", "route": { "USDT": [{"chain": "BASE_SEPOLIA", "chain_id": "84532", "chain_type": "evm", "tokens_out": ["USDT"]}], "USDC": [] } }routemaps each token you can send (token_in) to the chains and tokens it can arrive as. Only USDT can be withdrawn this way today. -
Get a quote. Nothing moves yet.
curl -sS "https://edge.testnet.grvt.io/api/v1/bridge/withdrawal-quote" \ -H "Cookie: gravity=$GRVT_COOKIE" \ -H "Content-Type: application/json" \ --data '{"to_address": "0x...", "chain": "BASE_SEPOLIA", "token_in": "USDT", "token_out": "USDT", "amount": "100"}'The reply has
quote_id,pay_amount(what leaves your main account),receive_amount(what arrives),fee(intoken_in),fee_usd,speedandexpires_at. All amounts are decimal strings. -
Sign a Transfer from your main account to the bridge partner, with the quote's amount:
Field Value fromAccountyour main account ID fromSubAccount0toAccountfunding_addressfrom step 1toSubAccount0tokenCurrencythe idof USDT from get_currencynumTokenspay_amount× 10^balance_decimalsof USDTnonce,expirationa random uint32; unix nanoseconds, at most 30 days ahead Signing explains the domain and the hashing.
-
Send the quote ID and the signature before
expires_at:curl -sS "https://edge.testnet.grvt.io/api/v1/bridge/withdraw" \ -H "Cookie: gravity=$GRVT_COOKIE" \ -H "Content-Type: application/json" \ --data @- <<'EOF' { "quote_id": "...", "signature": {"signer": "0x...", "r": "0x...", "s": "0x...", "v": 28, "expiration": "1767225600000000000", "nonce": 1002, "chain_id": 326} } EOFHere
chain_idis a number, not a string as in other signed requests. You can leave it out: Grvt then uses its own chain ID.HTTP 202 means the transfer was sent:
{"quote_id", "tx_id", "state": "SUBMITTED", "receive_amount", "fee", "fee_usd"}. -
Check progress until the state is final:
curl -sS "https://edge.testnet.grvt.io/api/v1/bridge/withdrawal-status?quote_id=$QUOTE_ID" \ -H "Cookie: gravity=$GRVT_COOKIE"The reply has
state,chain,token_out,receive_amountand, once paid,withdraw_tx_hashon the destination chain.
| State | Meaning |
|---|---|
CREATED | Quoted, not sent. |
SUBMITTED | Sent to the bridge partner; payout not started. |
SENDING | The bridge partner is paying out. |
COMPLETED | Paid out. Final. |
REFUNDED | Not paid out; the funds were returned. Final. |
FAILED | Not paid out. Final. |
Watch out:
- If step 4 times out or returns a 5xx, the withdrawal may still go through. Check the status, or send the same request again with the same signature: if it went through, you get the first reply back. A quote can be sent only once, so retrying it can't withdraw twice.
- Don't get a new quote and sign again until the status of the first one is final, or you may withdraw twice.
- A quote past
expires_atfails witherr_withdrawal_quote_expired(HTTP 410). Get a new one.
Errors
| Status | Code | Cause |
|---|---|---|
| 404 | err_withdrawal_address_not_in_address_book | to_address isn't in the withdrawal address book for this chain type. |
| 422 | err_withdrawal_token_not_supported | token_in isn't USDT. |
| 422 | err_withdrawal_route_not_supported | This chain and token_out aren't a route right now. |
| 422 | err_withdrawal_amount_below_fee | The amount doesn't cover the fee. |
| 422 | err_withdrawal_limit_exceeded | A daily limit or the bridge's available funds would be exceeded. |
| 422 | err_withdrawal_insufficient_balance | The main account doesn't hold pay_amount. |
| 400 | err_withdrawal_signature_invalid | The signature doesn't match the quote, or has expired. |
| 403 | err_withdrawal_address_rejected | The destination failed screening or can't be used. |
| 403 | err_user_has_insufficient_permissions | The signing wallet lacks External Transfer. |
| 409 | err_withdrawal_already_executed | This quote was already sent. |
| 410 | err_withdrawal_quote_expired | Get a new quote. |
| 404 | err_withdrawal_not_found | No withdrawal with this quote_id for your account. |