curl --request POST \
--url https://api.circle.com/v1/exchange/stablefx/signatures \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tradeId": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"details": {
"permitted": {
"token": "0xTOKEN",
"amount": "1000"
},
"spender": "0xa8f94168b4981840ba27d423f4ad6332bedee006",
"nonce": "309585810",
"deadline": "1770302983",
"witness": {
"consideration": {
"quoteId": "<string>",
"base": "<string>",
"quote": "<string>",
"baseAmount": "<string>",
"quoteAmount": "<string>",
"maturity": "1716153600"
},
"fee": "80000"
}
},
"signature": "<string>"
}
'import requests
url = "https://api.circle.com/v1/exchange/stablefx/signatures"
payload = {
"tradeId": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"details": {
"permitted": {
"token": "0xTOKEN",
"amount": "1000"
},
"spender": "0xa8f94168b4981840ba27d423f4ad6332bedee006",
"nonce": "309585810",
"deadline": "1770302983",
"witness": {
"consideration": {
"quoteId": "<string>",
"base": "<string>",
"quote": "<string>",
"baseAmount": "<string>",
"quoteAmount": "<string>",
"maturity": "1716153600"
},
"fee": "80000"
}
},
"signature": "<string>"
}
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: 'c4d1da72-111e-4d52-bdbf-2e74a2d803d5',
address: '0x1234567890abcdef1234567890abcdef12345678',
details: {
permitted: {token: '0xTOKEN', amount: '1000'},
spender: '0xa8f94168b4981840ba27d423f4ad6332bedee006',
nonce: '309585810',
deadline: '1770302983',
witness: {
consideration: {
quoteId: '<string>',
base: '<string>',
quote: '<string>',
baseAmount: '<string>',
quoteAmount: '<string>',
maturity: '1716153600'
},
fee: '80000'
}
},
signature: '<string>'
})
};
fetch('https://api.circle.com/v1/exchange/stablefx/signatures', 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",
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' => 'c4d1da72-111e-4d52-bdbf-2e74a2d803d5',
'address' => '0x1234567890abcdef1234567890abcdef12345678',
'details' => [
'permitted' => [
'token' => '0xTOKEN',
'amount' => '1000'
],
'spender' => '0xa8f94168b4981840ba27d423f4ad6332bedee006',
'nonce' => '309585810',
'deadline' => '1770302983',
'witness' => [
'consideration' => [
'quoteId' => '<string>',
'base' => '<string>',
'quote' => '<string>',
'baseAmount' => '<string>',
'quoteAmount' => '<string>',
'maturity' => '1716153600'
],
'fee' => '80000'
]
],
'signature' => '<string>'
]),
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"
payload := strings.NewReader("{\n \"tradeId\": \"c4d1da72-111e-4d52-bdbf-2e74a2d803d5\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"details\": {\n \"permitted\": {\n \"token\": \"0xTOKEN\",\n \"amount\": \"1000\"\n },\n \"spender\": \"0xa8f94168b4981840ba27d423f4ad6332bedee006\",\n \"nonce\": \"309585810\",\n \"deadline\": \"1770302983\",\n \"witness\": {\n \"consideration\": {\n \"quoteId\": \"<string>\",\n \"base\": \"<string>\",\n \"quote\": \"<string>\",\n \"baseAmount\": \"<string>\",\n \"quoteAmount\": \"<string>\",\n \"maturity\": \"1716153600\"\n },\n \"fee\": \"80000\"\n }\n },\n \"signature\": \"<string>\"\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tradeId\": \"c4d1da72-111e-4d52-bdbf-2e74a2d803d5\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"details\": {\n \"permitted\": {\n \"token\": \"0xTOKEN\",\n \"amount\": \"1000\"\n },\n \"spender\": \"0xa8f94168b4981840ba27d423f4ad6332bedee006\",\n \"nonce\": \"309585810\",\n \"deadline\": \"1770302983\",\n \"witness\": {\n \"consideration\": {\n \"quoteId\": \"<string>\",\n \"base\": \"<string>\",\n \"quote\": \"<string>\",\n \"baseAmount\": \"<string>\",\n \"quoteAmount\": \"<string>\",\n \"maturity\": \"1716153600\"\n },\n \"fee\": \"80000\"\n }\n },\n \"signature\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.circle.com/v1/exchange/stablefx/signatures")
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\": \"c4d1da72-111e-4d52-bdbf-2e74a2d803d5\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"details\": {\n \"permitted\": {\n \"token\": \"0xTOKEN\",\n \"amount\": \"1000\"\n },\n \"spender\": \"0xa8f94168b4981840ba27d423f4ad6332bedee006\",\n \"nonce\": \"309585810\",\n \"deadline\": \"1770302983\",\n \"witness\": {\n \"consideration\": {\n \"quoteId\": \"<string>\",\n \"base\": \"<string>\",\n \"quote\": \"<string>\",\n \"baseAmount\": \"<string>\",\n \"quoteAmount\": \"<string>\",\n \"maturity\": \"1716153600\"\n },\n \"fee\": \"80000\"\n }\n },\n \"signature\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"tradeId": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
"createDate": "2023-01-01T12:04:05Z",
"updateDate": "2023-01-01T12:04:05Z"
}Register a trade signature
Registers a signed EIP-712 payload from the trader that confirms trade intent.
curl --request POST \
--url https://api.circle.com/v1/exchange/stablefx/signatures \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tradeId": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"details": {
"permitted": {
"token": "0xTOKEN",
"amount": "1000"
},
"spender": "0xa8f94168b4981840ba27d423f4ad6332bedee006",
"nonce": "309585810",
"deadline": "1770302983",
"witness": {
"consideration": {
"quoteId": "<string>",
"base": "<string>",
"quote": "<string>",
"baseAmount": "<string>",
"quoteAmount": "<string>",
"maturity": "1716153600"
},
"fee": "80000"
}
},
"signature": "<string>"
}
'import requests
url = "https://api.circle.com/v1/exchange/stablefx/signatures"
payload = {
"tradeId": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"details": {
"permitted": {
"token": "0xTOKEN",
"amount": "1000"
},
"spender": "0xa8f94168b4981840ba27d423f4ad6332bedee006",
"nonce": "309585810",
"deadline": "1770302983",
"witness": {
"consideration": {
"quoteId": "<string>",
"base": "<string>",
"quote": "<string>",
"baseAmount": "<string>",
"quoteAmount": "<string>",
"maturity": "1716153600"
},
"fee": "80000"
}
},
"signature": "<string>"
}
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: 'c4d1da72-111e-4d52-bdbf-2e74a2d803d5',
address: '0x1234567890abcdef1234567890abcdef12345678',
details: {
permitted: {token: '0xTOKEN', amount: '1000'},
spender: '0xa8f94168b4981840ba27d423f4ad6332bedee006',
nonce: '309585810',
deadline: '1770302983',
witness: {
consideration: {
quoteId: '<string>',
base: '<string>',
quote: '<string>',
baseAmount: '<string>',
quoteAmount: '<string>',
maturity: '1716153600'
},
fee: '80000'
}
},
signature: '<string>'
})
};
fetch('https://api.circle.com/v1/exchange/stablefx/signatures', 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",
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' => 'c4d1da72-111e-4d52-bdbf-2e74a2d803d5',
'address' => '0x1234567890abcdef1234567890abcdef12345678',
'details' => [
'permitted' => [
'token' => '0xTOKEN',
'amount' => '1000'
],
'spender' => '0xa8f94168b4981840ba27d423f4ad6332bedee006',
'nonce' => '309585810',
'deadline' => '1770302983',
'witness' => [
'consideration' => [
'quoteId' => '<string>',
'base' => '<string>',
'quote' => '<string>',
'baseAmount' => '<string>',
'quoteAmount' => '<string>',
'maturity' => '1716153600'
],
'fee' => '80000'
]
],
'signature' => '<string>'
]),
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"
payload := strings.NewReader("{\n \"tradeId\": \"c4d1da72-111e-4d52-bdbf-2e74a2d803d5\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"details\": {\n \"permitted\": {\n \"token\": \"0xTOKEN\",\n \"amount\": \"1000\"\n },\n \"spender\": \"0xa8f94168b4981840ba27d423f4ad6332bedee006\",\n \"nonce\": \"309585810\",\n \"deadline\": \"1770302983\",\n \"witness\": {\n \"consideration\": {\n \"quoteId\": \"<string>\",\n \"base\": \"<string>\",\n \"quote\": \"<string>\",\n \"baseAmount\": \"<string>\",\n \"quoteAmount\": \"<string>\",\n \"maturity\": \"1716153600\"\n },\n \"fee\": \"80000\"\n }\n },\n \"signature\": \"<string>\"\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tradeId\": \"c4d1da72-111e-4d52-bdbf-2e74a2d803d5\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"details\": {\n \"permitted\": {\n \"token\": \"0xTOKEN\",\n \"amount\": \"1000\"\n },\n \"spender\": \"0xa8f94168b4981840ba27d423f4ad6332bedee006\",\n \"nonce\": \"309585810\",\n \"deadline\": \"1770302983\",\n \"witness\": {\n \"consideration\": {\n \"quoteId\": \"<string>\",\n \"base\": \"<string>\",\n \"quote\": \"<string>\",\n \"baseAmount\": \"<string>\",\n \"quoteAmount\": \"<string>\",\n \"maturity\": \"1716153600\"\n },\n \"fee\": \"80000\"\n }\n },\n \"signature\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.circle.com/v1/exchange/stablefx/signatures")
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\": \"c4d1da72-111e-4d52-bdbf-2e74a2d803d5\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"details\": {\n \"permitted\": {\n \"token\": \"0xTOKEN\",\n \"amount\": \"1000\"\n },\n \"spender\": \"0xa8f94168b4981840ba27d423f4ad6332bedee006\",\n \"nonce\": \"309585810\",\n \"deadline\": \"1770302983\",\n \"witness\": {\n \"consideration\": {\n \"quoteId\": \"<string>\",\n \"base\": \"<string>\",\n \"quote\": \"<string>\",\n \"baseAmount\": \"<string>\",\n \"quoteAmount\": \"<string>\",\n \"maturity\": \"1716153600\"\n },\n \"fee\": \"80000\"\n }\n },\n \"signature\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"tradeId": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
"createDate": "2023-01-01T12:04:05Z",
"updateDate": "2023-01-01T12:04:05Z"
}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
Request body for submitting a maker trade signature
System-generated unique identifier of the resource.
"c4d1da72-111e-4d52-bdbf-2e74a2d803d5"
The wallet address signing the trade presign data
"0x1234567890abcdef1234567890abcdef12345678"
The maker Permit2 message for signature registration. Contains the signed Permit2 witness transfer data including maker-specific witness details with consideration and fee.
Show child attributes
Show child attributes
The signature generated from signing the trade presign data
Response
Trade signature registered successfully
Response from registering a trade signature
System-generated unique identifier of the resource.
"c4d1da72-111e-4d52-bdbf-2e74a2d803d5"
Date and time when the resource was created
"2023-01-01T12:04:05Z"
Date and time when the resource was last updated
"2023-01-01T12:04:05Z"
Was this page helpful?