Skip to main content
POST
/
off_exchange
/
add
TypeScript
const response: Promise<FireblocksResponse<CreateTransactionResponse>> = fireblocks.offExchanges.addOffExchange(offExchangesApiAddOffExchangeRequest);
CompletableFuture<ApiResponse<CreateTransactionResponse>> response = fireblocks.offExchanges().addOffExchange(addCollateralRequestBody, idempotencyKey);
response = fireblocks.off_exchanges.add_off_exchange(add_collateral_request_body, idempotency_key);
curl --request POST \
--url https://api.fireblocks.io/v1/off_exchange/add \
--header 'Content-Type: application/json' \
--data '
{
"transactionRequest": {
"operation": "TRANSFER",
"note": "Ticket 123",
"externalTxId": "00000000-0000-0000-0000-000000000000",
"assetId": "ETH",
"destinations": [
{
"amount": "<string>",
"travelRuleMessageId": "trm_12345678-1234-1234-1234-123456789012",
"customerRefId": "abcdef"
}
],
"amount": "0.02",
"treatAsGrossAmount": false,
"forceSweep": false,
"feeLevel": "MEDIUM",
"fee": "<string>",
"priorityFee": "2",
"failOnLowFee": true,
"maxFee": "120",
"maxTotalFee": "88",
"gasLimit": "21000",
"gasPrice": "<string>",
"networkFee": "<string>",
"replaceTxByHash": "00000000-0000-0000-0000-000000000000",
"extraParameters": {
"nodeControls": {},
"rawMessageData": {},
"contractCallData": "<string>",
"programCallData": "<string>",
"inputsSelection": {},
"allowBaseAssetAddress": true,
"piiData": {}
},
"utxoSelectionParams": {
"filters": {
"includeAllLabels": [
"cold-storage"
],
"includeAnyLabels": [
"vip",
"high-value"
],
"excludeAnyLabels": [
"deprecated"
],
"address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"minAmount": "0.001",
"maxAmount": "9.999"
},
"inputSelection": {
"inputsToSpend": [
{
"txHash": "b34f0c3ce612f1e5a5c19d6b1e6b5e3e7f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c",
"index": 0
}
],
"inputsToExclude": [
{
"txHash": "b34f0c3ce612f1e5a5c19d6b1e6b5e3e7f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c",
"index": 0
}
],
"fillFeeForSelectedInputs": true
}
},
"customerRefId": "abcdef",
"travelRuleMessageId": "trm_12345678-1234-1234-1234-123456789012",
"autoStaking": true,
"networkStaking": "<string>",
"cpuStaking": "<string>",
"useGasless": true,
"configurations": {
"expiresAfterSeconds": 3600
}
},
"isSrcCollateral": true
}
'
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
transactionRequest: {
operation: 'TRANSFER',
note: 'Ticket 123',
externalTxId: '00000000-0000-0000-0000-000000000000',
assetId: 'ETH',
destinations: [
{
amount: '<string>',
travelRuleMessageId: 'trm_12345678-1234-1234-1234-123456789012',
customerRefId: 'abcdef'
}
],
amount: '0.02',
treatAsGrossAmount: false,
forceSweep: false,
feeLevel: 'MEDIUM',
fee: '<string>',
priorityFee: '2',
failOnLowFee: true,
maxFee: '120',
maxTotalFee: '88',
gasLimit: '21000',
gasPrice: '<string>',
networkFee: '<string>',
replaceTxByHash: '00000000-0000-0000-0000-000000000000',
extraParameters: {
nodeControls: {},
rawMessageData: {},
contractCallData: '<string>',
programCallData: '<string>',
inputsSelection: {},
allowBaseAssetAddress: true,
piiData: {}
},
utxoSelectionParams: {
filters: {
includeAllLabels: ['cold-storage'],
includeAnyLabels: ['vip', 'high-value'],
excludeAnyLabels: ['deprecated'],
address: '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa',
minAmount: '0.001',
maxAmount: '9.999'
},
inputSelection: {
inputsToSpend: [
{
txHash: 'b34f0c3ce612f1e5a5c19d6b1e6b5e3e7f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c',
index: 0
}
],
inputsToExclude: [
{
txHash: 'b34f0c3ce612f1e5a5c19d6b1e6b5e3e7f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c',
index: 0
}
],
fillFeeForSelectedInputs: true
}
},
customerRefId: 'abcdef',
travelRuleMessageId: 'trm_12345678-1234-1234-1234-123456789012',
autoStaking: true,
networkStaking: '<string>',
cpuStaking: '<string>',
useGasless: true,
configurations: {expiresAfterSeconds: 3600}
},
isSrcCollateral: true
})
};

fetch('https://api.fireblocks.io/v1/off_exchange/add', 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.fireblocks.io/v1/off_exchange/add",
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([
'transactionRequest' => [
'operation' => 'TRANSFER',
'note' => 'Ticket 123',
'externalTxId' => '00000000-0000-0000-0000-000000000000',
'assetId' => 'ETH',
'destinations' => [
[
'amount' => '<string>',
'travelRuleMessageId' => 'trm_12345678-1234-1234-1234-123456789012',
'customerRefId' => 'abcdef'
]
],
'amount' => '0.02',
'treatAsGrossAmount' => false,
'forceSweep' => false,
'feeLevel' => 'MEDIUM',
'fee' => '<string>',
'priorityFee' => '2',
'failOnLowFee' => true,
'maxFee' => '120',
'maxTotalFee' => '88',
'gasLimit' => '21000',
'gasPrice' => '<string>',
'networkFee' => '<string>',
'replaceTxByHash' => '00000000-0000-0000-0000-000000000000',
'extraParameters' => [
'nodeControls' => [

],
'rawMessageData' => [

],
'contractCallData' => '<string>',
'programCallData' => '<string>',
'inputsSelection' => [

],
'allowBaseAssetAddress' => true,
'piiData' => [

]
],
'utxoSelectionParams' => [
'filters' => [
'includeAllLabels' => [
'cold-storage'
],
'includeAnyLabels' => [
'vip',
'high-value'
],
'excludeAnyLabels' => [
'deprecated'
],
'address' => '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa',
'minAmount' => '0.001',
'maxAmount' => '9.999'
],
'inputSelection' => [
'inputsToSpend' => [
[
'txHash' => 'b34f0c3ce612f1e5a5c19d6b1e6b5e3e7f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c',
'index' => 0
]
],
'inputsToExclude' => [
[
'txHash' => 'b34f0c3ce612f1e5a5c19d6b1e6b5e3e7f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c',
'index' => 0
]
],
'fillFeeForSelectedInputs' => true
]
],
'customerRefId' => 'abcdef',
'travelRuleMessageId' => 'trm_12345678-1234-1234-1234-123456789012',
'autoStaking' => true,
'networkStaking' => '<string>',
'cpuStaking' => '<string>',
'useGasless' => true,
'configurations' => [
'expiresAfterSeconds' => 3600
]
],
'isSrcCollateral' => 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://api.fireblocks.io/v1/off_exchange/add"

payload := strings.NewReader("{\n \"transactionRequest\": {\n \"operation\": \"TRANSFER\",\n \"note\": \"Ticket 123\",\n \"externalTxId\": \"00000000-0000-0000-0000-000000000000\",\n \"assetId\": \"ETH\",\n \"destinations\": [\n {\n \"amount\": \"<string>\",\n \"travelRuleMessageId\": \"trm_12345678-1234-1234-1234-123456789012\",\n \"customerRefId\": \"abcdef\"\n }\n ],\n \"amount\": \"0.02\",\n \"treatAsGrossAmount\": false,\n \"forceSweep\": false,\n \"feeLevel\": \"MEDIUM\",\n \"fee\": \"<string>\",\n \"priorityFee\": \"2\",\n \"failOnLowFee\": true,\n \"maxFee\": \"120\",\n \"maxTotalFee\": \"88\",\n \"gasLimit\": \"21000\",\n \"gasPrice\": \"<string>\",\n \"networkFee\": \"<string>\",\n \"replaceTxByHash\": \"00000000-0000-0000-0000-000000000000\",\n \"extraParameters\": {\n \"nodeControls\": {},\n \"rawMessageData\": {},\n \"contractCallData\": \"<string>\",\n \"programCallData\": \"<string>\",\n \"inputsSelection\": {},\n \"allowBaseAssetAddress\": true,\n \"piiData\": {}\n },\n \"utxoSelectionParams\": {\n \"filters\": {\n \"includeAllLabels\": [\n \"cold-storage\"\n ],\n \"includeAnyLabels\": [\n \"vip\",\n \"high-value\"\n ],\n \"excludeAnyLabels\": [\n \"deprecated\"\n ],\n \"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\n \"minAmount\": \"0.001\",\n \"maxAmount\": \"9.999\"\n },\n \"inputSelection\": {\n \"inputsToSpend\": [\n {\n \"txHash\": \"b34f0c3ce612f1e5a5c19d6b1e6b5e3e7f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c\",\n \"index\": 0\n }\n ],\n \"inputsToExclude\": [\n {\n \"txHash\": \"b34f0c3ce612f1e5a5c19d6b1e6b5e3e7f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c\",\n \"index\": 0\n }\n ],\n \"fillFeeForSelectedInputs\": true\n }\n },\n \"customerRefId\": \"abcdef\",\n \"travelRuleMessageId\": \"trm_12345678-1234-1234-1234-123456789012\",\n \"autoStaking\": true,\n \"networkStaking\": \"<string>\",\n \"cpuStaking\": \"<string>\",\n \"useGasless\": true,\n \"configurations\": {\n \"expiresAfterSeconds\": 3600\n }\n },\n \"isSrcCollateral\": true\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))

}
require 'uri'
require 'net/http'

url = URI("https://api.fireblocks.io/v1/off_exchange/add")

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 \"transactionRequest\": {\n \"operation\": \"TRANSFER\",\n \"note\": \"Ticket 123\",\n \"externalTxId\": \"00000000-0000-0000-0000-000000000000\",\n \"assetId\": \"ETH\",\n \"destinations\": [\n {\n \"amount\": \"<string>\",\n \"travelRuleMessageId\": \"trm_12345678-1234-1234-1234-123456789012\",\n \"customerRefId\": \"abcdef\"\n }\n ],\n \"amount\": \"0.02\",\n \"treatAsGrossAmount\": false,\n \"forceSweep\": false,\n \"feeLevel\": \"MEDIUM\",\n \"fee\": \"<string>\",\n \"priorityFee\": \"2\",\n \"failOnLowFee\": true,\n \"maxFee\": \"120\",\n \"maxTotalFee\": \"88\",\n \"gasLimit\": \"21000\",\n \"gasPrice\": \"<string>\",\n \"networkFee\": \"<string>\",\n \"replaceTxByHash\": \"00000000-0000-0000-0000-000000000000\",\n \"extraParameters\": {\n \"nodeControls\": {},\n \"rawMessageData\": {},\n \"contractCallData\": \"<string>\",\n \"programCallData\": \"<string>\",\n \"inputsSelection\": {},\n \"allowBaseAssetAddress\": true,\n \"piiData\": {}\n },\n \"utxoSelectionParams\": {\n \"filters\": {\n \"includeAllLabels\": [\n \"cold-storage\"\n ],\n \"includeAnyLabels\": [\n \"vip\",\n \"high-value\"\n ],\n \"excludeAnyLabels\": [\n \"deprecated\"\n ],\n \"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\n \"minAmount\": \"0.001\",\n \"maxAmount\": \"9.999\"\n },\n \"inputSelection\": {\n \"inputsToSpend\": [\n {\n \"txHash\": \"b34f0c3ce612f1e5a5c19d6b1e6b5e3e7f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c\",\n \"index\": 0\n }\n ],\n \"inputsToExclude\": [\n {\n \"txHash\": \"b34f0c3ce612f1e5a5c19d6b1e6b5e3e7f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c\",\n \"index\": 0\n }\n ],\n \"fillFeeForSelectedInputs\": true\n }\n },\n \"customerRefId\": \"abcdef\",\n \"travelRuleMessageId\": \"trm_12345678-1234-1234-1234-123456789012\",\n \"autoStaking\": true,\n \"networkStaking\": \"<string>\",\n \"cpuStaking\": \"<string>\",\n \"useGasless\": true,\n \"configurations\": {\n \"expiresAfterSeconds\": 3600\n }\n },\n \"isSrcCollateral\": true\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "status": "<string>",
  "systemMessages": [
    {
      "message": "Slow transaction processing. Outgoing transactions might be stuck."
    }
  ]
}
{
"message": "<string>",
"code": 123
}

Headers

Idempotency-Key
string

A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours.

Body

application/json
transactionRequest
object
isSrcCollateral
boolean

optional

Response

A transaction object

id
string

The ID of the transaction.

status
string

The primary status of the transaction. For details, see [Primary transaction statuses.] (https://developers.fireblocks.com/reference/primary-transaction-statuses)

systemMessages
object[]