Get settlement advance Permit2 typed data for signing
curl --request POST \
--url https://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tradeId": "trade-abc-123"
}
'import requests
url = "https://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign"
payload = { "tradeId": "trade-abc-123" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({tradeId: 'trade-abc-123'})
};
fetch('https://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign', 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://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign",
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([
'tradeId' => 'trade-abc-123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign"
payload := strings.NewReader("{\n \"tradeId\": \"trade-abc-123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tradeId\": \"trade-abc-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tradeId\": \"trade-abc-123\"\n}"
response = http.request(request)
puts response.read_body{
"advance": {
"currency": "USDC",
"amount": "100.00"
},
"collateral": {
"currency": "USDC",
"amount": "100.00"
},
"makerPermitTypedData": {
"types": {},
"primaryType": "DelegateFundingAuthorizationPermitWitnessTransferFrom",
"domain": {
"name": "Permit2",
"chainId": 11155111,
"verifyingContract": "0xffd21ca8F0876DaFAD7de09404E0c1f868bbf1AE"
},
"message": {
"permitted": {
"token": "0xTOKEN",
"amount": "1000"
},
"spender": "0xFxEscrow000000000000000000000000000000000",
"nonce": "1234567890",
"deadline": "1782556800",
"witness": {
"id": "987654321",
"funder": "0xLLCFunderPW...address",
"recipient": "0xLLCEscrowPW...address",
"token": "0xMXNB...address",
"amount": "5000000000"
}
}
}
}{
"message": "Unknown error occurred",
"errors": [
{
"error": "MISSING_OR_INVALID_FIELD",
"message": "<string>",
"location": "<string>"
}
]
}{
"message": "Unknown error occurred",
"errors": [
{
"error": "MISSING_OR_INVALID_FIELD",
"message": "<string>",
"location": "<string>"
}
]
}Get settlement advance Permit2 typed data for signing
Returns Permit2 typed-data the maker signs to authorize delegate funding
of their side of a trade. The witness is a DelegateFundingAuthorization
with permitted.amount = 0 — Permit2 is used purely as an authorization
carrier, no tokens transfer from the maker.
Stateless: no persistence, no side effects.
POST
/
v1
/
exchange
/
stablefx
/
signatures
/
settlementAdvances
/
presign
Get settlement advance Permit2 typed data for signing
curl --request POST \
--url https://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tradeId": "trade-abc-123"
}
'import requests
url = "https://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign"
payload = { "tradeId": "trade-abc-123" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({tradeId: 'trade-abc-123'})
};
fetch('https://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign', 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://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign",
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([
'tradeId' => 'trade-abc-123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign"
payload := strings.NewReader("{\n \"tradeId\": \"trade-abc-123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tradeId\": \"trade-abc-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.circle.com/v1/exchange/stablefx/signatures/settlementAdvances/presign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tradeId\": \"trade-abc-123\"\n}"
response = http.request(request)
puts response.read_body{
"advance": {
"currency": "USDC",
"amount": "100.00"
},
"collateral": {
"currency": "USDC",
"amount": "100.00"
},
"makerPermitTypedData": {
"types": {},
"primaryType": "DelegateFundingAuthorizationPermitWitnessTransferFrom",
"domain": {
"name": "Permit2",
"chainId": 11155111,
"verifyingContract": "0xffd21ca8F0876DaFAD7de09404E0c1f868bbf1AE"
},
"message": {
"permitted": {
"token": "0xTOKEN",
"amount": "1000"
},
"spender": "0xFxEscrow000000000000000000000000000000000",
"nonce": "1234567890",
"deadline": "1782556800",
"witness": {
"id": "987654321",
"funder": "0xLLCFunderPW...address",
"recipient": "0xLLCEscrowPW...address",
"token": "0xMXNB...address",
"amount": "5000000000"
}
}
}
}{
"message": "Unknown error occurred",
"errors": [
{
"error": "MISSING_OR_INVALID_FIELD",
"message": "<string>",
"location": "<string>"
}
]
}{
"message": "Unknown error occurred",
"errors": [
{
"error": "MISSING_OR_INVALID_FIELD",
"message": "<string>",
"location": "<string>"
}
]
}Authorizations
Circle's API Keys are formatted in the following structure "PREFIX:ID:SECRET". All three parts are requred to make a successful request.
Body
application/json
Request body for getting settlement advance Permit2 typed-data.
Trade identifier.
Example:
"trade-abc-123"
Response
Typed-data ready for the maker to sign.
Settlement advance Permit2 typed-data for maker signing.
Was this page helpful?
⌘I