curl --request POST \
--url https://gateway-api-testnet.circle.com/v1/estimate \
--header 'Content-Type: application/json' \
--data '
[
{
"spec": {
"version": 1,
"sourceDomain": 0,
"destinationDomain": 4,
"sourceContract": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationContract": "0x1234567890123456789012345678901234567890123456789012345678901234",
"sourceToken": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationToken": "0x1234567890123456789012345678901234567890123456789012345678901234",
"sourceDepositor": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234",
"sourceSigner": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationCaller": "0x1234567890123456789012345678901234567890123456789012345678901234",
"value": "1000000000000000000",
"salt": "0x1234567890123456789012345678901234567890123456789012345678901234",
"hookData": "0x1a2b3c4d"
},
"maxBlockHeight": "1000000000000000000",
"maxFee": "1000000000000000000"
}
]
'import requests
url = "https://gateway-api-testnet.circle.com/v1/estimate"
payload = [
{
"spec": {
"version": 1,
"sourceDomain": 0,
"destinationDomain": 4,
"sourceContract": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationContract": "0x1234567890123456789012345678901234567890123456789012345678901234",
"sourceToken": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationToken": "0x1234567890123456789012345678901234567890123456789012345678901234",
"sourceDepositor": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234",
"sourceSigner": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationCaller": "0x1234567890123456789012345678901234567890123456789012345678901234",
"value": "1000000000000000000",
"salt": "0x1234567890123456789012345678901234567890123456789012345678901234",
"hookData": "0x1a2b3c4d"
},
"maxBlockHeight": "1000000000000000000",
"maxFee": "1000000000000000000"
}
]
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([
{
spec: {
version: 1,
sourceDomain: 0,
destinationDomain: 4,
sourceContract: '0x1234567890123456789012345678901234567890123456789012345678901234',
destinationContract: '0x1234567890123456789012345678901234567890123456789012345678901234',
sourceToken: '0x1234567890123456789012345678901234567890123456789012345678901234',
destinationToken: '0x1234567890123456789012345678901234567890123456789012345678901234',
sourceDepositor: '0x1234567890123456789012345678901234567890123456789012345678901234',
destinationRecipient: '0x1234567890123456789012345678901234567890123456789012345678901234',
sourceSigner: '0x1234567890123456789012345678901234567890123456789012345678901234',
destinationCaller: '0x1234567890123456789012345678901234567890123456789012345678901234',
value: '1000000000000000000',
salt: '0x1234567890123456789012345678901234567890123456789012345678901234',
hookData: '0x1a2b3c4d'
},
maxBlockHeight: '1000000000000000000',
maxFee: '1000000000000000000'
}
])
};
fetch('https://gateway-api-testnet.circle.com/v1/estimate', 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://gateway-api-testnet.circle.com/v1/estimate",
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([
[
'spec' => [
'version' => 1,
'sourceDomain' => 0,
'destinationDomain' => 4,
'sourceContract' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'destinationContract' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'sourceToken' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'destinationToken' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'sourceDepositor' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'destinationRecipient' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'sourceSigner' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'destinationCaller' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'value' => '1000000000000000000',
'salt' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'hookData' => '0x1a2b3c4d'
],
'maxBlockHeight' => '1000000000000000000',
'maxFee' => '1000000000000000000'
]
]),
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://gateway-api-testnet.circle.com/v1/estimate"
payload := strings.NewReader("[\n {\n \"spec\": {\n \"version\": 1,\n \"sourceDomain\": 0,\n \"destinationDomain\": 4,\n \"sourceContract\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationContract\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceToken\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationToken\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceDepositor\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationRecipient\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceSigner\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationCaller\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"value\": \"1000000000000000000\",\n \"salt\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"hookData\": \"0x1a2b3c4d\"\n },\n \"maxBlockHeight\": \"1000000000000000000\",\n \"maxFee\": \"1000000000000000000\"\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://gateway-api-testnet.circle.com/v1/estimate")
.header("Content-Type", "application/json")
.body("[\n {\n \"spec\": {\n \"version\": 1,\n \"sourceDomain\": 0,\n \"destinationDomain\": 4,\n \"sourceContract\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationContract\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceToken\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationToken\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceDepositor\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationRecipient\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceSigner\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationCaller\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"value\": \"1000000000000000000\",\n \"salt\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"hookData\": \"0x1a2b3c4d\"\n },\n \"maxBlockHeight\": \"1000000000000000000\",\n \"maxFee\": \"1000000000000000000\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway-api-testnet.circle.com/v1/estimate")
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 {\n \"spec\": {\n \"version\": 1,\n \"sourceDomain\": 0,\n \"destinationDomain\": 4,\n \"sourceContract\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationContract\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceToken\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationToken\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceDepositor\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationRecipient\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceSigner\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationCaller\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"value\": \"1000000000000000000\",\n \"salt\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"hookData\": \"0x1a2b3c4d\"\n },\n \"maxBlockHeight\": \"1000000000000000000\",\n \"maxFee\": \"1000000000000000000\"\n }\n]"
response = http.request(request)
puts response.read_body{
"body": [
{
"burnIntent": {
"maxBlockHeight": "1000000000000000000",
"maxFee": "1000000000000000000",
"spec": {
"version": 1,
"sourceDomain": 0,
"destinationDomain": 4,
"sourceContract": "0x1234567890123456789012345678901234567890",
"destinationContract": "0x1234567890123456789012345678901234567890",
"sourceToken": "0x1234567890123456789012345678901234567890",
"destinationToken": "0x1234567890123456789012345678901234567890",
"sourceDepositor": "0x1234567890123456789012345678901234567890",
"destinationRecipient": "0x1234567890123456789012345678901234567890",
"sourceSigner": "0x1234567890123456789012345678901234567890",
"destinationCaller": "0x1234567890123456789012345678901234567890",
"value": "1000000000000000000",
"salt": "0x1234567890123456789012345678901234567890123456789012345678901234",
"hookData": "0x1a2b3c4d"
},
"recipientSetupOptions": {
"includeRecipientSetup": true,
"recipientOwnerAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
}
}
}
],
"fees": {
"total": "1.178",
"token": "USDC",
"perIntent": [
{
"transferSpecHash": "0x1234567890123456789012345678901234567890123456789012345678901234",
"baseFee": "2",
"transferFee": "0.125"
}
],
"forwardingFee": "0.210000"
}
}Calculates the required fees and expiration block heights for a transfer without requiring signatures or executing the transaction.
curl --request POST \
--url https://gateway-api-testnet.circle.com/v1/estimate \
--header 'Content-Type: application/json' \
--data '
[
{
"spec": {
"version": 1,
"sourceDomain": 0,
"destinationDomain": 4,
"sourceContract": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationContract": "0x1234567890123456789012345678901234567890123456789012345678901234",
"sourceToken": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationToken": "0x1234567890123456789012345678901234567890123456789012345678901234",
"sourceDepositor": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234",
"sourceSigner": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationCaller": "0x1234567890123456789012345678901234567890123456789012345678901234",
"value": "1000000000000000000",
"salt": "0x1234567890123456789012345678901234567890123456789012345678901234",
"hookData": "0x1a2b3c4d"
},
"maxBlockHeight": "1000000000000000000",
"maxFee": "1000000000000000000"
}
]
'import requests
url = "https://gateway-api-testnet.circle.com/v1/estimate"
payload = [
{
"spec": {
"version": 1,
"sourceDomain": 0,
"destinationDomain": 4,
"sourceContract": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationContract": "0x1234567890123456789012345678901234567890123456789012345678901234",
"sourceToken": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationToken": "0x1234567890123456789012345678901234567890123456789012345678901234",
"sourceDepositor": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234",
"sourceSigner": "0x1234567890123456789012345678901234567890123456789012345678901234",
"destinationCaller": "0x1234567890123456789012345678901234567890123456789012345678901234",
"value": "1000000000000000000",
"salt": "0x1234567890123456789012345678901234567890123456789012345678901234",
"hookData": "0x1a2b3c4d"
},
"maxBlockHeight": "1000000000000000000",
"maxFee": "1000000000000000000"
}
]
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([
{
spec: {
version: 1,
sourceDomain: 0,
destinationDomain: 4,
sourceContract: '0x1234567890123456789012345678901234567890123456789012345678901234',
destinationContract: '0x1234567890123456789012345678901234567890123456789012345678901234',
sourceToken: '0x1234567890123456789012345678901234567890123456789012345678901234',
destinationToken: '0x1234567890123456789012345678901234567890123456789012345678901234',
sourceDepositor: '0x1234567890123456789012345678901234567890123456789012345678901234',
destinationRecipient: '0x1234567890123456789012345678901234567890123456789012345678901234',
sourceSigner: '0x1234567890123456789012345678901234567890123456789012345678901234',
destinationCaller: '0x1234567890123456789012345678901234567890123456789012345678901234',
value: '1000000000000000000',
salt: '0x1234567890123456789012345678901234567890123456789012345678901234',
hookData: '0x1a2b3c4d'
},
maxBlockHeight: '1000000000000000000',
maxFee: '1000000000000000000'
}
])
};
fetch('https://gateway-api-testnet.circle.com/v1/estimate', 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://gateway-api-testnet.circle.com/v1/estimate",
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([
[
'spec' => [
'version' => 1,
'sourceDomain' => 0,
'destinationDomain' => 4,
'sourceContract' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'destinationContract' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'sourceToken' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'destinationToken' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'sourceDepositor' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'destinationRecipient' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'sourceSigner' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'destinationCaller' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'value' => '1000000000000000000',
'salt' => '0x1234567890123456789012345678901234567890123456789012345678901234',
'hookData' => '0x1a2b3c4d'
],
'maxBlockHeight' => '1000000000000000000',
'maxFee' => '1000000000000000000'
]
]),
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://gateway-api-testnet.circle.com/v1/estimate"
payload := strings.NewReader("[\n {\n \"spec\": {\n \"version\": 1,\n \"sourceDomain\": 0,\n \"destinationDomain\": 4,\n \"sourceContract\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationContract\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceToken\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationToken\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceDepositor\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationRecipient\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceSigner\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationCaller\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"value\": \"1000000000000000000\",\n \"salt\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"hookData\": \"0x1a2b3c4d\"\n },\n \"maxBlockHeight\": \"1000000000000000000\",\n \"maxFee\": \"1000000000000000000\"\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://gateway-api-testnet.circle.com/v1/estimate")
.header("Content-Type", "application/json")
.body("[\n {\n \"spec\": {\n \"version\": 1,\n \"sourceDomain\": 0,\n \"destinationDomain\": 4,\n \"sourceContract\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationContract\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceToken\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationToken\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceDepositor\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationRecipient\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceSigner\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationCaller\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"value\": \"1000000000000000000\",\n \"salt\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"hookData\": \"0x1a2b3c4d\"\n },\n \"maxBlockHeight\": \"1000000000000000000\",\n \"maxFee\": \"1000000000000000000\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway-api-testnet.circle.com/v1/estimate")
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 {\n \"spec\": {\n \"version\": 1,\n \"sourceDomain\": 0,\n \"destinationDomain\": 4,\n \"sourceContract\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationContract\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceToken\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationToken\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceDepositor\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationRecipient\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"sourceSigner\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"destinationCaller\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"value\": \"1000000000000000000\",\n \"salt\": \"0x1234567890123456789012345678901234567890123456789012345678901234\",\n \"hookData\": \"0x1a2b3c4d\"\n },\n \"maxBlockHeight\": \"1000000000000000000\",\n \"maxFee\": \"1000000000000000000\"\n }\n]"
response = http.request(request)
puts response.read_body{
"body": [
{
"burnIntent": {
"maxBlockHeight": "1000000000000000000",
"maxFee": "1000000000000000000",
"spec": {
"version": 1,
"sourceDomain": 0,
"destinationDomain": 4,
"sourceContract": "0x1234567890123456789012345678901234567890",
"destinationContract": "0x1234567890123456789012345678901234567890",
"sourceToken": "0x1234567890123456789012345678901234567890",
"destinationToken": "0x1234567890123456789012345678901234567890",
"sourceDepositor": "0x1234567890123456789012345678901234567890",
"destinationRecipient": "0x1234567890123456789012345678901234567890",
"sourceSigner": "0x1234567890123456789012345678901234567890",
"destinationCaller": "0x1234567890123456789012345678901234567890",
"value": "1000000000000000000",
"salt": "0x1234567890123456789012345678901234567890123456789012345678901234",
"hookData": "0x1a2b3c4d"
},
"recipientSetupOptions": {
"includeRecipientSetup": true,
"recipientOwnerAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
}
}
}
],
"fees": {
"total": "1.178",
"token": "USDC",
"perIntent": [
{
"transferSpecHash": "0x1234567890123456789012345678901234567890123456789012345678901234",
"baseFee": "2",
"transferFee": "0.125"
}
],
"forwardingFee": "0.210000"
}
}Query Parameters
Maximum allowed size (in bytes) for the encoded attestation.
x >= 1Whether to enable the forwarding service for estimating the fees.
Body
1- Option 1
- Option 2
A burn intent for estimation purposes without signatures. Optional maxBlockHeight and maxFee for cost estimation.
Show child attributes
Show child attributes
The maximum block height at which this burn is valid (optional for estimation).
"1000000000000000000"
The maximum fee the user is willing to pay (optional for estimation).
"1000000000000000000"
Options for automatic Associated Token Account (ATA) creation on Solana. When the destination chain is Solana, the destinationRecipient must be an initialized USDC token account. If the recipient does not already have one, the Forwarding Service can create the ATA as part of the mint transaction. Omit this field if the recipient already has a USDC token account.
Show child attributes
Show child attributes
Response
Successfully calculated the estimated fees and expiration block heights
Response containing estimated burn intents with calculated fees and expiration block heights.
Was this page helpful?