curl --request POST \
--url https://xreserve-api-testnet.circle.com/v1/withdraw \
--header 'Content-Type: application/json' \
--data '
{
"batches": [
{
"burnIntents": [
{
"maxBlockHeight": "1000000",
"maxFee": "100000",
"spec": {
"version": 1,
"sourceDomain": 0,
"destinationDomain": 1,
"sourceContract": "0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6",
"destinationContract": "0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7",
"sourceToken": "0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c",
"destinationToken": "0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d",
"sourceDepositor": "0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad",
"destinationRecipient": "0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe",
"sourceSigner": "0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
"destinationCaller": "0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1",
"value": "1000000",
"salt": "0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4",
"hookData": {
"remoteDomain": 10001,
"remoteDepositor": "0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6",
"remoteToken": "0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7",
"forwardingContractAddress": "0x0000000000000000000000000000000000000000",
"forwardingCalldata": "0x"
}
}
}
],
"burnSignatures": [
"<string>"
],
"burnTxId": "<string>",
"useCircleForwarding": true
}
]
}
'import requests
url = "https://xreserve-api-testnet.circle.com/v1/withdraw"
payload = { "batches": [
{
"burnIntents": [
{
"maxBlockHeight": "1000000",
"maxFee": "100000",
"spec": {
"version": 1,
"sourceDomain": 0,
"destinationDomain": 1,
"sourceContract": "0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6",
"destinationContract": "0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7",
"sourceToken": "0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c",
"destinationToken": "0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d",
"sourceDepositor": "0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad",
"destinationRecipient": "0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe",
"sourceSigner": "0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
"destinationCaller": "0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1",
"value": "1000000",
"salt": "0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4",
"hookData": {
"remoteDomain": 10001,
"remoteDepositor": "0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6",
"remoteToken": "0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7",
"forwardingContractAddress": "0x0000000000000000000000000000000000000000",
"forwardingCalldata": "0x"
}
}
}
],
"burnSignatures": ["<string>"],
"burnTxId": "<string>",
"useCircleForwarding": True
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
batches: [
{
burnIntents: [
{
maxBlockHeight: '1000000',
maxFee: '100000',
spec: {
version: 1,
sourceDomain: 0,
destinationDomain: 1,
sourceContract: '0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6',
destinationContract: '0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7',
sourceToken: '0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c',
destinationToken: '0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d',
sourceDepositor: '0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad',
destinationRecipient: '0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe',
sourceSigner: '0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0',
destinationCaller: '0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1',
value: '1000000',
salt: '0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4',
hookData: {
remoteDomain: 10001,
remoteDepositor: '0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6',
remoteToken: '0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7',
forwardingContractAddress: '0x0000000000000000000000000000000000000000',
forwardingCalldata: '0x'
}
}
}
],
burnSignatures: ['<string>'],
burnTxId: '<string>',
useCircleForwarding: true
}
]
})
};
fetch('https://xreserve-api-testnet.circle.com/v1/withdraw', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://xreserve-api-testnet.circle.com/v1/withdraw",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'batches' => [
[
'burnIntents' => [
[
'maxBlockHeight' => '1000000',
'maxFee' => '100000',
'spec' => [
'version' => 1,
'sourceDomain' => 0,
'destinationDomain' => 1,
'sourceContract' => '0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6',
'destinationContract' => '0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7',
'sourceToken' => '0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c',
'destinationToken' => '0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d',
'sourceDepositor' => '0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad',
'destinationRecipient' => '0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe',
'sourceSigner' => '0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0',
'destinationCaller' => '0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1',
'value' => '1000000',
'salt' => '0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4',
'hookData' => [
'remoteDomain' => 10001,
'remoteDepositor' => '0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6',
'remoteToken' => '0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7',
'forwardingContractAddress' => '0x0000000000000000000000000000000000000000',
'forwardingCalldata' => '0x'
]
]
]
],
'burnSignatures' => [
'<string>'
],
'burnTxId' => '<string>',
'useCircleForwarding' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://xreserve-api-testnet.circle.com/v1/withdraw"
payload := strings.NewReader("{\n \"batches\": [\n {\n \"burnIntents\": [\n {\n \"maxBlockHeight\": \"1000000\",\n \"maxFee\": \"100000\",\n \"spec\": {\n \"version\": 1,\n \"sourceDomain\": 0,\n \"destinationDomain\": 1,\n \"sourceContract\": \"0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6\",\n \"destinationContract\": \"0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7\",\n \"sourceToken\": \"0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c\",\n \"destinationToken\": \"0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d\",\n \"sourceDepositor\": \"0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad\",\n \"destinationRecipient\": \"0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe\",\n \"sourceSigner\": \"0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0\",\n \"destinationCaller\": \"0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1\",\n \"value\": \"1000000\",\n \"salt\": \"0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4\",\n \"hookData\": {\n \"remoteDomain\": 10001,\n \"remoteDepositor\": \"0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6\",\n \"remoteToken\": \"0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7\",\n \"forwardingContractAddress\": \"0x0000000000000000000000000000000000000000\",\n \"forwardingCalldata\": \"0x\"\n }\n }\n }\n ],\n \"burnSignatures\": [\n \"<string>\"\n ],\n \"burnTxId\": \"<string>\",\n \"useCircleForwarding\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://xreserve-api-testnet.circle.com/v1/withdraw")
.header("Content-Type", "application/json")
.body("{\n \"batches\": [\n {\n \"burnIntents\": [\n {\n \"maxBlockHeight\": \"1000000\",\n \"maxFee\": \"100000\",\n \"spec\": {\n \"version\": 1,\n \"sourceDomain\": 0,\n \"destinationDomain\": 1,\n \"sourceContract\": \"0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6\",\n \"destinationContract\": \"0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7\",\n \"sourceToken\": \"0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c\",\n \"destinationToken\": \"0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d\",\n \"sourceDepositor\": \"0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad\",\n \"destinationRecipient\": \"0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe\",\n \"sourceSigner\": \"0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0\",\n \"destinationCaller\": \"0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1\",\n \"value\": \"1000000\",\n \"salt\": \"0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4\",\n \"hookData\": {\n \"remoteDomain\": 10001,\n \"remoteDepositor\": \"0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6\",\n \"remoteToken\": \"0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7\",\n \"forwardingContractAddress\": \"0x0000000000000000000000000000000000000000\",\n \"forwardingCalldata\": \"0x\"\n }\n }\n }\n ],\n \"burnSignatures\": [\n \"<string>\"\n ],\n \"burnTxId\": \"<string>\",\n \"useCircleForwarding\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://xreserve-api-testnet.circle.com/v1/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"batches\": [\n {\n \"burnIntents\": [\n {\n \"maxBlockHeight\": \"1000000\",\n \"maxFee\": \"100000\",\n \"spec\": {\n \"version\": 1,\n \"sourceDomain\": 0,\n \"destinationDomain\": 1,\n \"sourceContract\": \"0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6\",\n \"destinationContract\": \"0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7\",\n \"sourceToken\": \"0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c\",\n \"destinationToken\": \"0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d\",\n \"sourceDepositor\": \"0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad\",\n \"destinationRecipient\": \"0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe\",\n \"sourceSigner\": \"0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0\",\n \"destinationCaller\": \"0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1\",\n \"value\": \"1000000\",\n \"salt\": \"0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4\",\n \"hookData\": {\n \"remoteDomain\": 10001,\n \"remoteDepositor\": \"0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6\",\n \"remoteToken\": \"0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7\",\n \"forwardingContractAddress\": \"0x0000000000000000000000000000000000000000\",\n \"forwardingCalldata\": \"0x\"\n }\n }\n }\n ],\n \"burnSignatures\": [\n \"<string>\"\n ],\n \"burnTxId\": \"<string>\",\n \"useCircleForwarding\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"withdrawalId": "6149dc3d-71bf-4d57-8cc1-5e2d4c0a8e70",
"burnTxId": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"useCircleForwarding": true,
"transferSpecHashes": [
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
],
"attestationPayload": "<string>",
"attestation": "<string>",
"transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"failureReason": "verification_failed"
}
]{
"success": false,
"message": "Error message"
}{
"success": false,
"message": "The remote `burnTxId` is already associated with an active withdrawal.",
"conflict": {
"withdrawalId": "550e8400-e29b-41d4-a716-446655440000",
"burnTxId": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
}{
"success": false,
"message": "Error message"
}Submit signed burn intents for withdrawal
Submits up to five signed burn intent batches per request call. Each batch may contain one burn intent or a set of up to 10.
curl --request POST \
--url https://xreserve-api-testnet.circle.com/v1/withdraw \
--header 'Content-Type: application/json' \
--data '
{
"batches": [
{
"burnIntents": [
{
"maxBlockHeight": "1000000",
"maxFee": "100000",
"spec": {
"version": 1,
"sourceDomain": 0,
"destinationDomain": 1,
"sourceContract": "0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6",
"destinationContract": "0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7",
"sourceToken": "0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c",
"destinationToken": "0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d",
"sourceDepositor": "0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad",
"destinationRecipient": "0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe",
"sourceSigner": "0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
"destinationCaller": "0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1",
"value": "1000000",
"salt": "0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4",
"hookData": {
"remoteDomain": 10001,
"remoteDepositor": "0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6",
"remoteToken": "0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7",
"forwardingContractAddress": "0x0000000000000000000000000000000000000000",
"forwardingCalldata": "0x"
}
}
}
],
"burnSignatures": [
"<string>"
],
"burnTxId": "<string>",
"useCircleForwarding": true
}
]
}
'import requests
url = "https://xreserve-api-testnet.circle.com/v1/withdraw"
payload = { "batches": [
{
"burnIntents": [
{
"maxBlockHeight": "1000000",
"maxFee": "100000",
"spec": {
"version": 1,
"sourceDomain": 0,
"destinationDomain": 1,
"sourceContract": "0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6",
"destinationContract": "0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7",
"sourceToken": "0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c",
"destinationToken": "0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d",
"sourceDepositor": "0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad",
"destinationRecipient": "0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe",
"sourceSigner": "0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
"destinationCaller": "0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1",
"value": "1000000",
"salt": "0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4",
"hookData": {
"remoteDomain": 10001,
"remoteDepositor": "0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6",
"remoteToken": "0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7",
"forwardingContractAddress": "0x0000000000000000000000000000000000000000",
"forwardingCalldata": "0x"
}
}
}
],
"burnSignatures": ["<string>"],
"burnTxId": "<string>",
"useCircleForwarding": True
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
batches: [
{
burnIntents: [
{
maxBlockHeight: '1000000',
maxFee: '100000',
spec: {
version: 1,
sourceDomain: 0,
destinationDomain: 1,
sourceContract: '0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6',
destinationContract: '0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7',
sourceToken: '0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c',
destinationToken: '0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d',
sourceDepositor: '0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad',
destinationRecipient: '0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe',
sourceSigner: '0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0',
destinationCaller: '0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1',
value: '1000000',
salt: '0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4',
hookData: {
remoteDomain: 10001,
remoteDepositor: '0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6',
remoteToken: '0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7',
forwardingContractAddress: '0x0000000000000000000000000000000000000000',
forwardingCalldata: '0x'
}
}
}
],
burnSignatures: ['<string>'],
burnTxId: '<string>',
useCircleForwarding: true
}
]
})
};
fetch('https://xreserve-api-testnet.circle.com/v1/withdraw', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://xreserve-api-testnet.circle.com/v1/withdraw",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'batches' => [
[
'burnIntents' => [
[
'maxBlockHeight' => '1000000',
'maxFee' => '100000',
'spec' => [
'version' => 1,
'sourceDomain' => 0,
'destinationDomain' => 1,
'sourceContract' => '0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6',
'destinationContract' => '0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7',
'sourceToken' => '0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c',
'destinationToken' => '0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d',
'sourceDepositor' => '0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad',
'destinationRecipient' => '0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe',
'sourceSigner' => '0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0',
'destinationCaller' => '0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1',
'value' => '1000000',
'salt' => '0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4',
'hookData' => [
'remoteDomain' => 10001,
'remoteDepositor' => '0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6',
'remoteToken' => '0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7',
'forwardingContractAddress' => '0x0000000000000000000000000000000000000000',
'forwardingCalldata' => '0x'
]
]
]
],
'burnSignatures' => [
'<string>'
],
'burnTxId' => '<string>',
'useCircleForwarding' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://xreserve-api-testnet.circle.com/v1/withdraw"
payload := strings.NewReader("{\n \"batches\": [\n {\n \"burnIntents\": [\n {\n \"maxBlockHeight\": \"1000000\",\n \"maxFee\": \"100000\",\n \"spec\": {\n \"version\": 1,\n \"sourceDomain\": 0,\n \"destinationDomain\": 1,\n \"sourceContract\": \"0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6\",\n \"destinationContract\": \"0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7\",\n \"sourceToken\": \"0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c\",\n \"destinationToken\": \"0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d\",\n \"sourceDepositor\": \"0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad\",\n \"destinationRecipient\": \"0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe\",\n \"sourceSigner\": \"0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0\",\n \"destinationCaller\": \"0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1\",\n \"value\": \"1000000\",\n \"salt\": \"0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4\",\n \"hookData\": {\n \"remoteDomain\": 10001,\n \"remoteDepositor\": \"0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6\",\n \"remoteToken\": \"0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7\",\n \"forwardingContractAddress\": \"0x0000000000000000000000000000000000000000\",\n \"forwardingCalldata\": \"0x\"\n }\n }\n }\n ],\n \"burnSignatures\": [\n \"<string>\"\n ],\n \"burnTxId\": \"<string>\",\n \"useCircleForwarding\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://xreserve-api-testnet.circle.com/v1/withdraw")
.header("Content-Type", "application/json")
.body("{\n \"batches\": [\n {\n \"burnIntents\": [\n {\n \"maxBlockHeight\": \"1000000\",\n \"maxFee\": \"100000\",\n \"spec\": {\n \"version\": 1,\n \"sourceDomain\": 0,\n \"destinationDomain\": 1,\n \"sourceContract\": \"0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6\",\n \"destinationContract\": \"0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7\",\n \"sourceToken\": \"0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c\",\n \"destinationToken\": \"0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d\",\n \"sourceDepositor\": \"0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad\",\n \"destinationRecipient\": \"0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe\",\n \"sourceSigner\": \"0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0\",\n \"destinationCaller\": \"0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1\",\n \"value\": \"1000000\",\n \"salt\": \"0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4\",\n \"hookData\": {\n \"remoteDomain\": 10001,\n \"remoteDepositor\": \"0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6\",\n \"remoteToken\": \"0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7\",\n \"forwardingContractAddress\": \"0x0000000000000000000000000000000000000000\",\n \"forwardingCalldata\": \"0x\"\n }\n }\n }\n ],\n \"burnSignatures\": [\n \"<string>\"\n ],\n \"burnTxId\": \"<string>\",\n \"useCircleForwarding\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://xreserve-api-testnet.circle.com/v1/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"batches\": [\n {\n \"burnIntents\": [\n {\n \"maxBlockHeight\": \"1000000\",\n \"maxFee\": \"100000\",\n \"spec\": {\n \"version\": 1,\n \"sourceDomain\": 0,\n \"destinationDomain\": 1,\n \"sourceContract\": \"0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6\",\n \"destinationContract\": \"0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7\",\n \"sourceToken\": \"0x000000000000000000000000c2d8b55f8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c\",\n \"destinationToken\": \"0x000000000000000000000000d3e9c66f9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d9d\",\n \"sourceDepositor\": \"0x000000000000000000000000e4fad77fadadadadadadadadadadadadadadadad\",\n \"destinationRecipient\": \"0x000000000000000000000000f5abc88abebebebebebebebebebebebebebebebe\",\n \"sourceSigner\": \"0x000000000000000000000000a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0\",\n \"destinationCaller\": \"0x000000000000000000000000b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1\",\n \"value\": \"1000000\",\n \"salt\": \"0xc3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4\",\n \"hookData\": {\n \"remoteDomain\": 10001,\n \"remoteDepositor\": \"0x000000000000000000000000a0b86a33e6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6\",\n \"remoteToken\": \"0x000000000000000000000000b1c97a44e7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7\",\n \"forwardingContractAddress\": \"0x0000000000000000000000000000000000000000\",\n \"forwardingCalldata\": \"0x\"\n }\n }\n }\n ],\n \"burnSignatures\": [\n \"<string>\"\n ],\n \"burnTxId\": \"<string>\",\n \"useCircleForwarding\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"withdrawalId": "6149dc3d-71bf-4d57-8cc1-5e2d4c0a8e70",
"burnTxId": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"useCircleForwarding": true,
"transferSpecHashes": [
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
],
"attestationPayload": "<string>",
"attestation": "<string>",
"transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"failureReason": "verification_failed"
}
]{
"success": false,
"message": "Error message"
}{
"success": false,
"message": "The remote `burnTxId` is already associated with an active withdrawal.",
"conflict": {
"withdrawalId": "550e8400-e29b-41d4-a716-446655440000",
"burnTxId": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
}{
"success": false,
"message": "Error message"
}Body
Contains signed burn intents to submit for withdrawal.
Array of burn intent batches to submit, up to five per request.
1 - 5 elementsShow child attributes
Show child attributes
Response
Successfully created withdrawal records.
The unique identifier of the withdrawal group.
"6149dc3d-71bf-4d57-8cc1-5e2d4c0a8e70"
The transaction ID of the burn on the remote network.
^0x[a-fA-F0-9]+$"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
The status of the withdrawal.
- 'created': The withdrawal has been created but the burn transaction on the remote network has not been verified yet.
- 'verified': The burn transaction on the remote network has been successfully verified. The attestation is available but has been submitted on chain yet.
- 'confirmed': The attestation has been submitted onchain but the transaction has not been finalized yet.
- 'finalized': The transaction has been successfully finalized. This state is terminal.
- 'expired': The attestation expired before it was used. This state is terminal and can be retried.
- 'failed': The verification failed. The withdrawal cannot proceed. This state is terminal and cannot be retried.
created, verified, confirmed, finalized, expired, failed Indicates whether Circle should forward the transaction and release funds on either a CCTP supported blockchain or another remote blockchain.
true
List of transfer specification hashes for all withdrawal intents in the group.
^0x[a-fA-F0-9]{64}$[
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
]
The full attestation payload.
^0x[a-fA-F0-9]*$The xReserve attestation signature.
^0x[a-fA-F0-9]*$The hash of forwarded transaction.
^0x[a-fA-F0-9]{64}$"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
The reason for failure. Returned when the status is 'failed'.
"verification_failed"
Was this page helpful?