Send Account Funds Externally
Sending funds from your Interlace Account to external blockchain wallets is one of the core functions of the API. This quickstart walks you through sending USDC
externally; the same steps apply for sending USDT
, ETH
and BTC
too.
Send Funds
To send account funds externally, you will need a blockchain address.
The sandbox environment is connected to the Ethereum Sepolia testing network, so the destination blockchain address has to be a valid Sepolia address.
USDC is connected to testing networks on other blockchains as well. This guide focuses on Ethereum but works similarly for other blockchains. For information on other testing networks see Test USDC
To send funds externally, you will use the create account withdrawal endpoint.
Since Interlace APIs are designed for multiple future chains and currencies, you will need to specify the currency and chain you wish to use. You can initiate a transfer with the command below.
# Replace ${YOUR_API_ACCESS_TOKEN} with your API access token
curl --request POST \
--url https://api-sandbox.interlace.money/open-api/v1/asset/wallets/withdrawals \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-access-token: ${YOUR_API_ACCESS_TOKEN}' \
--data '{
"currency": "USDC",
"chain": "ETH",
"amount": "1",
"address": "0x493A9869E3B5f846f72267ab19B76e9bf99d51b1"
}'
You should receive a response similar to the one shown below.
{
"id": "fda5dd13-57c4-4e14-92a4-7fadf624bf7a",
"accountId": "d37deed7-f0e7-4635-a43a-781af0cb59f0",
"balanceId": "93ca2b1a-c0af-46cd-b5c0-bfa6532c399b",
"chain": "ETH",
"currency": "USDC",
"amount": "1.01",
"fee": "0",
"status": "Pending",
"createTime": "2023-03-15T03:06:46.000Z",
"updateTime": "2023-03-15T03:06:46.000Z"
}
Check the Status of the Withdrawal
You can use the get withdrawal endpoint to retrieve details about the status of the transaction. You can use it as in the command below.
# Replace ${YOUR_API_ACCESS_TOKEN} with your API access token
curl --request GET \
--url https://api-sandbox.interlace.money/open-api/v1/asset/wallets/withdrawals?id=fda5dd13-57c4-4e14-92a4-7fadf624bf7a \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-access-token: ${YOUR_API_ACCESS_TOKEN}'
You will receive a response like below.
{
"data": [{
"id": "fda5dd13-57c4-4e14-92a4-7fadf624bf7a",
"createTime": "2023-03-15T03:06:46.000Z",
"updateTime": "2023-03-15T03:09:56.000Z",
"accountId": "d37deed7-f0e7-4635-a43a-781af0cb59f0",
"balanceId": "93ca2b1a-c0af-46cd-b5c0-bfa6532c399b",
"chain": "ETH",
"currency": "USDC",
"amount": "1.01",
"fee": "0",
"status": "Closed",
"transactionHash": "0x8558135eaaed89c59736a904cb5fda991085cb2e4e7625c8df5a4a95cc8e726c"
}],
}
The initial state transition for a withdrawal sets the status
to "created" and the transactionHash
set to null, indicating that Interlace has just begun processing the on-chain transfer. Once the transaction is successfully initiated, Interlace will broadcast the transfer, changing its status
to "running" and displaying transactionHash
, which can be used to track the transfer on-chain via Etherscan's tracker on Sepolia.
At this stage, the transaction is considered complete as it has been broadcasted to the network. Interlace will continue monitoring the transfer through 30 confirmations, after which the status will update to "complete". For most applications, you don’t need to wait for the "complete" state—this is typically relevant only for receiving external transfers. You can learn more about block confirmations here.
🎉 Congratulations! You have successfully sent cryptocurrency using Interlace APIs.
Updated 19 days ago