Skip to main content
GET
/
v1
/
exchange
/
stablefx
/
signatures
/
presign
/
{tradeId}
Generate trade presign data
curl --request GET \
  --url https://api.circle.com/v1/exchange/stablefx/signatures/presign/{tradeId} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.circle.com/v1/exchange/stablefx/signatures/presign/{tradeId}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.circle.com/v1/exchange/stablefx/signatures/presign/{tradeId}', 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/presign/{tradeId}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.circle.com/v1/exchange/stablefx/signatures/presign/{tradeId}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.circle.com/v1/exchange/stablefx/signatures/presign/{tradeId}")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.circle.com/v1/exchange/stablefx/signatures/presign/{tradeId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "typedData": {
    "domain": {
      "name": "Permit2",
      "chainId": 11155111,
      "verifyingContract": "0xffd21ca8F0876DaFAD7de09404E0c1f868bbf1AE"
    },
    "types": {
      "EIP712Domain": [
        {
          "name": "<string>",
          "type": "<string>"
        }
      ],
      "Consideration": [
        {
          "name": "<string>",
          "type": "<string>"
        }
      ],
      "TraderDetails": [
        {
          "name": "consideration",
          "type": "Consideration"
        },
        {
          "name": "recipient",
          "type": "address"
        },
        {
          "name": "fee",
          "type": "uint256"
        },
        {
          "name": "authorizer",
          "type": "address"
        }
      ],
      "TokenPermissions": [
        {
          "name": "<string>",
          "type": "<string>"
        }
      ],
      "PermitWitnessTransferFrom": [
        {
          "name": "<string>",
          "type": "<string>"
        }
      ]
    },
    "primaryType": "PermitWitnessTransferFrom",
    "message": {
      "permitted": {
        "token": "0x3600000000000000000000000000000000000000",
        "amount": "429000000"
      },
      "spender": "0xa8f94168b4981840ba27d423f4ad6332bedee006",
      "nonce": "309585810",
      "deadline": "1770302983",
      "witness": {
        "consideration": {
          "quoteId": "<string>",
          "base": "<string>",
          "quote": "<string>",
          "baseAmount": "<string>",
          "quoteAmount": "<string>",
          "maturity": "1716153600"
        },
        "fee": "80000",
        "authorizer": "0x0000000000000000000000000000000000000000",
        "recipient": "0x1f531ce3c418bbd830d06138a9e5b5eacfdfb3d6"
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Circle's API Keys are formatted in the following structure "PREFIX:ID:SECRET". All three parts are requred to make a successful request.

Path Parameters

tradeId
string<uuid>
required

The ID of the trade. System-generated unique identifier of the resource.

Example:

"c4d1da72-111e-4d52-bdbf-2e74a2d803d5"

Query Parameters

recipientAddress
string
required

The address of the recipient of the settlement tokens. A blockchain address

Example:

"0x1234567890abcdef1234567890abcdef12345678"

Response

200 - application/json

Signature data generated successfully

Permit2 EIP-712 Typed Data for Trade Registration

typedData
object
required

EIP-712 typed data for trade registration