Send USDC in sandbox
Send test USDC from one sandbox wallet to another on the same network, and know which crypto sends sandbox cannot settle today.
Use this recipe to send test USDC from one sandbox wallet to another on the same network, and to find out which crypto sends sandbox cannot settle today.
Who it is for. A crypto payroll tool that pays contractors in USDC and wants to test sends between its customers' wallets.
Status. Available for a same-network send. Not yet available in sandbox for a cross-network send, or for a failed send on purpose.
Money example
- Your customer's sandbox Polygon wallet holds 200 test USDC.
- You send 75.00 USDC to another sandbox Polygon wallet.
- The send completes in about 3 seconds. The source wallet then shows 125, and the destination wallet shows 75.
Before you start
- A sandbox wallet that holds test USDC. Read its balance with
GET /v1/wallets/{wallet_id}. On EVM networks this balance is the sandbox test dollar. USDC from a public faucet does not show in it. Putting test dollars on a standalone EVM wallet through the API is Not yet available. Ask support if you need a funded sandbox wallet. - A destination address on the same network.
Find out what is required
The network, asset and memo rules of the destination network are the same as in live. See Send stablecoins to an outside wallet.
Steps
1. Send
Send a normal POST /v1/transfer with the crypto destination, exactly as in Send stablecoins to an outside wallet, with your sandbox key. Do not add _simulate_web3.
2. Follow it
curl --request GET \
--url https://api.gravv.xyz/v1/transactions/1a2a73ed-562b-4f79-8374-59eef50bea63 \
--header 'Api-Key: <API_KEY>'
const response = await fetch("https://api.gravv.xyz/v1/transactions/1a2a73ed-562b-4f79-8374-59eef50bea63", {
method: "GET",
headers: {
"Api-Key": process.env.GRAVV_API_KEY,
},
});
console.log(response.status, await response.json());
import os
import requests
response = requests.get(
"https://api.gravv.xyz/v1/transactions/1a2a73ed-562b-4f79-8374-59eef50bea63",
headers={
"Api-Key": os.environ["GRAVV_API_KEY"],
},
)
print(response.status_code, response.json())
A same-network send settles in seconds. You receive transfer.status.pending events that carry a tx_hash, then transfer.status.completed. For a USDC wallet source, the transfer response shows amount_currency USD.
3. Read the balances
Call GET /v1/wallets/{wallet_id} for both wallets. A wallet can show "stale": true for a few minutes after a send. If it does, read it again later.
What can go wrong
| Response | Why | Fix |
|---|---|---|
| The send never completes | You added "_simulate_web3": "success" |
Remove it and send a normal transfer |
pending with no event at all, and the wallet is not debited |
You added "_simulate_web3": "failed" |
Remove it |
For a cross-network send, Gravv sends transfer.status.failed while the row stays pending, or the send stays pending |
Cross-network sends do not settle in sandbox today | Test same-network sends only |
400 insufficient balance from a Stellar or Solana wallet |
The wallet holds no test dollars | Send from a funded EVM wallet |
400 invalid transfer input |
You sent _simulate_web3 with a live key |
Remove it |
| Faucet USDC does not show on an EVM sandbox wallet | EVM sandbox wallets show the sandbox test dollar | See Fund wallets during testing |
balance_before and balance_after repeat on the rows |
A known sandbox difference | Read the wallet balance instead |
Webhooks you will receive
You receive the same webhooks as in live, transfer.status.pending and then transfer.status.completed.
Testing in sandbox
This page is the sandbox guide for crypto sends. You cannot produce a failed crypto send, so test that screen with a recorded transfer.status.failed payload.