Returns pre-built transactions for the given route. It is assumed that transactions will be signed and sent by the sender via wallet
curl --request POST \
--url https://backend.swap.coffee/v2/route/transactions \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"sender_address": "UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV",
"paths": [
{
"blockchain": "ton",
"dex": "stonfi",
"pool_address": "<string>",
"input_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"listed": true,
"image_url": "<string>"
}
},
"output_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"listed": true,
"image_url": "<string>"
}
},
"swap": {
"input_amount": 123,
"output_amount": 123,
"before_reserves": [
123
],
"after_reserves": [
123
],
"reason": "<string>",
"left_amount": 123
},
"recommended_gas": 123,
"average_gas": 123,
"next": "<array>"
}
],
"slippage": 0.05,
"dynamic_slippage": true,
"referral_name": "tonkeeper",
"custom_fee": {
"fixed_fee": "<string>",
"percentage_fee": 123,
"min_percentage_fee_fixed": "<string>",
"max_percentage_fee_fixed": "<string>"
},
"mev_protection": true
}
'import requests
url = "https://backend.swap.coffee/v2/route/transactions"
payload = {
"sender_address": "UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV",
"paths": [
{
"blockchain": "ton",
"dex": "stonfi",
"pool_address": "<string>",
"input_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"listed": True,
"image_url": "<string>"
}
},
"output_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"listed": True,
"image_url": "<string>"
}
},
"swap": {
"input_amount": 123,
"output_amount": 123,
"before_reserves": [123],
"after_reserves": [123],
"reason": "<string>",
"left_amount": 123
},
"recommended_gas": 123,
"average_gas": 123,
"next": "<array>"
}
],
"slippage": 0.05,
"dynamic_slippage": True,
"referral_name": "tonkeeper",
"custom_fee": {
"fixed_fee": "<string>",
"percentage_fee": 123,
"min_percentage_fee_fixed": "<string>",
"max_percentage_fee_fixed": "<string>"
},
"mev_protection": True
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sender_address: 'UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV',
paths: [
{
blockchain: 'ton',
dex: 'stonfi',
pool_address: '<string>',
input_token: {
address: {blockchain: 'ton', address: 'native'},
metadata: {
name: 'ARBUZ',
symbol: 'ARBUZ',
decimals: 123,
listed: true,
image_url: '<string>'
}
},
output_token: {
address: {blockchain: 'ton', address: 'native'},
metadata: {
name: 'ARBUZ',
symbol: 'ARBUZ',
decimals: 123,
listed: true,
image_url: '<string>'
}
},
swap: {
input_amount: 123,
output_amount: 123,
before_reserves: [123],
after_reserves: [123],
reason: '<string>',
left_amount: 123
},
recommended_gas: 123,
average_gas: 123,
next: '<array>'
}
],
slippage: 0.05,
dynamic_slippage: true,
referral_name: 'tonkeeper',
custom_fee: {
fixed_fee: '<string>',
percentage_fee: 123,
min_percentage_fee_fixed: '<string>',
max_percentage_fee_fixed: '<string>'
},
mev_protection: true
})
};
fetch('https://backend.swap.coffee/v2/route/transactions', 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://backend.swap.coffee/v2/route/transactions",
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([
'sender_address' => 'UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV',
'paths' => [
[
'blockchain' => 'ton',
'dex' => 'stonfi',
'pool_address' => '<string>',
'input_token' => [
'address' => [
'blockchain' => 'ton',
'address' => 'native'
],
'metadata' => [
'name' => 'ARBUZ',
'symbol' => 'ARBUZ',
'decimals' => 123,
'listed' => true,
'image_url' => '<string>'
]
],
'output_token' => [
'address' => [
'blockchain' => 'ton',
'address' => 'native'
],
'metadata' => [
'name' => 'ARBUZ',
'symbol' => 'ARBUZ',
'decimals' => 123,
'listed' => true,
'image_url' => '<string>'
]
],
'swap' => [
'input_amount' => 123,
'output_amount' => 123,
'before_reserves' => [
123
],
'after_reserves' => [
123
],
'reason' => '<string>',
'left_amount' => 123
],
'recommended_gas' => 123,
'average_gas' => 123,
'next' => '<array>'
]
],
'slippage' => 0.05,
'dynamic_slippage' => true,
'referral_name' => 'tonkeeper',
'custom_fee' => [
'fixed_fee' => '<string>',
'percentage_fee' => 123,
'min_percentage_fee_fixed' => '<string>',
'max_percentage_fee_fixed' => '<string>'
],
'mev_protection' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://backend.swap.coffee/v2/route/transactions"
payload := strings.NewReader("{\n \"sender_address\": \"UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV\",\n \"paths\": [\n {\n \"blockchain\": \"ton\",\n \"dex\": \"stonfi\",\n \"pool_address\": \"<string>\",\n \"input_token\": {\n \"address\": {\n \"blockchain\": \"ton\",\n \"address\": \"native\"\n },\n \"metadata\": {\n \"name\": \"ARBUZ\",\n \"symbol\": \"ARBUZ\",\n \"decimals\": 123,\n \"listed\": true,\n \"image_url\": \"<string>\"\n }\n },\n \"output_token\": {\n \"address\": {\n \"blockchain\": \"ton\",\n \"address\": \"native\"\n },\n \"metadata\": {\n \"name\": \"ARBUZ\",\n \"symbol\": \"ARBUZ\",\n \"decimals\": 123,\n \"listed\": true,\n \"image_url\": \"<string>\"\n }\n },\n \"swap\": {\n \"input_amount\": 123,\n \"output_amount\": 123,\n \"before_reserves\": [\n 123\n ],\n \"after_reserves\": [\n 123\n ],\n \"reason\": \"<string>\",\n \"left_amount\": 123\n },\n \"recommended_gas\": 123,\n \"average_gas\": 123,\n \"next\": \"<array>\"\n }\n ],\n \"slippage\": 0.05,\n \"dynamic_slippage\": true,\n \"referral_name\": \"tonkeeper\",\n \"custom_fee\": {\n \"fixed_fee\": \"<string>\",\n \"percentage_fee\": 123,\n \"min_percentage_fee_fixed\": \"<string>\",\n \"max_percentage_fee_fixed\": \"<string>\"\n },\n \"mev_protection\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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://backend.swap.coffee/v2/route/transactions")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sender_address\": \"UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV\",\n \"paths\": [\n {\n \"blockchain\": \"ton\",\n \"dex\": \"stonfi\",\n \"pool_address\": \"<string>\",\n \"input_token\": {\n \"address\": {\n \"blockchain\": \"ton\",\n \"address\": \"native\"\n },\n \"metadata\": {\n \"name\": \"ARBUZ\",\n \"symbol\": \"ARBUZ\",\n \"decimals\": 123,\n \"listed\": true,\n \"image_url\": \"<string>\"\n }\n },\n \"output_token\": {\n \"address\": {\n \"blockchain\": \"ton\",\n \"address\": \"native\"\n },\n \"metadata\": {\n \"name\": \"ARBUZ\",\n \"symbol\": \"ARBUZ\",\n \"decimals\": 123,\n \"listed\": true,\n \"image_url\": \"<string>\"\n }\n },\n \"swap\": {\n \"input_amount\": 123,\n \"output_amount\": 123,\n \"before_reserves\": [\n 123\n ],\n \"after_reserves\": [\n 123\n ],\n \"reason\": \"<string>\",\n \"left_amount\": 123\n },\n \"recommended_gas\": 123,\n \"average_gas\": 123,\n \"next\": \"<array>\"\n }\n ],\n \"slippage\": 0.05,\n \"dynamic_slippage\": true,\n \"referral_name\": \"tonkeeper\",\n \"custom_fee\": {\n \"fixed_fee\": \"<string>\",\n \"percentage_fee\": 123,\n \"min_percentage_fee_fixed\": \"<string>\",\n \"max_percentage_fee_fixed\": \"<string>\"\n },\n \"mev_protection\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.swap.coffee/v2/route/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sender_address\": \"UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV\",\n \"paths\": [\n {\n \"blockchain\": \"ton\",\n \"dex\": \"stonfi\",\n \"pool_address\": \"<string>\",\n \"input_token\": {\n \"address\": {\n \"blockchain\": \"ton\",\n \"address\": \"native\"\n },\n \"metadata\": {\n \"name\": \"ARBUZ\",\n \"symbol\": \"ARBUZ\",\n \"decimals\": 123,\n \"listed\": true,\n \"image_url\": \"<string>\"\n }\n },\n \"output_token\": {\n \"address\": {\n \"blockchain\": \"ton\",\n \"address\": \"native\"\n },\n \"metadata\": {\n \"name\": \"ARBUZ\",\n \"symbol\": \"ARBUZ\",\n \"decimals\": 123,\n \"listed\": true,\n \"image_url\": \"<string>\"\n }\n },\n \"swap\": {\n \"input_amount\": 123,\n \"output_amount\": 123,\n \"before_reserves\": [\n 123\n ],\n \"after_reserves\": [\n 123\n ],\n \"reason\": \"<string>\",\n \"left_amount\": 123\n },\n \"recommended_gas\": 123,\n \"average_gas\": 123,\n \"next\": \"<array>\"\n }\n ],\n \"slippage\": 0.05,\n \"dynamic_slippage\": true,\n \"referral_name\": \"tonkeeper\",\n \"custom_fee\": {\n \"fixed_fee\": \"<string>\",\n \"percentage_fee\": 123,\n \"min_percentage_fee_fixed\": \"<string>\",\n \"max_percentage_fee_fixed\": \"<string>\"\n },\n \"mev_protection\": true\n}"
response = http.request(request)
puts response.read_body{
"route_id": 123,
"transactions": [
{
"address": "EQCM3B12QK1e4yZSf8GtBRT0aLMNyEsBc_DhVfRRtOEffLez",
"value": "<string>",
"cell": "aSDinaTvuI8gbWludGxpZnk=",
"send_mode": 123,
"query_id": 123,
"stateInit": "aSDinaTvuI8gbWludGxpZnk="
}
]
}{
"error": "<string>"
}Routing
Returns pre-built transactions for the given route. It is assumed that transactions will be signed and sent by the sender via wallet
POST
/
v2
/
route
/
transactions
Returns pre-built transactions for the given route. It is assumed that transactions will be signed and sent by the sender via wallet
curl --request POST \
--url https://backend.swap.coffee/v2/route/transactions \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"sender_address": "UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV",
"paths": [
{
"blockchain": "ton",
"dex": "stonfi",
"pool_address": "<string>",
"input_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"listed": true,
"image_url": "<string>"
}
},
"output_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"listed": true,
"image_url": "<string>"
}
},
"swap": {
"input_amount": 123,
"output_amount": 123,
"before_reserves": [
123
],
"after_reserves": [
123
],
"reason": "<string>",
"left_amount": 123
},
"recommended_gas": 123,
"average_gas": 123,
"next": "<array>"
}
],
"slippage": 0.05,
"dynamic_slippage": true,
"referral_name": "tonkeeper",
"custom_fee": {
"fixed_fee": "<string>",
"percentage_fee": 123,
"min_percentage_fee_fixed": "<string>",
"max_percentage_fee_fixed": "<string>"
},
"mev_protection": true
}
'import requests
url = "https://backend.swap.coffee/v2/route/transactions"
payload = {
"sender_address": "UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV",
"paths": [
{
"blockchain": "ton",
"dex": "stonfi",
"pool_address": "<string>",
"input_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"listed": True,
"image_url": "<string>"
}
},
"output_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"listed": True,
"image_url": "<string>"
}
},
"swap": {
"input_amount": 123,
"output_amount": 123,
"before_reserves": [123],
"after_reserves": [123],
"reason": "<string>",
"left_amount": 123
},
"recommended_gas": 123,
"average_gas": 123,
"next": "<array>"
}
],
"slippage": 0.05,
"dynamic_slippage": True,
"referral_name": "tonkeeper",
"custom_fee": {
"fixed_fee": "<string>",
"percentage_fee": 123,
"min_percentage_fee_fixed": "<string>",
"max_percentage_fee_fixed": "<string>"
},
"mev_protection": True
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sender_address: 'UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV',
paths: [
{
blockchain: 'ton',
dex: 'stonfi',
pool_address: '<string>',
input_token: {
address: {blockchain: 'ton', address: 'native'},
metadata: {
name: 'ARBUZ',
symbol: 'ARBUZ',
decimals: 123,
listed: true,
image_url: '<string>'
}
},
output_token: {
address: {blockchain: 'ton', address: 'native'},
metadata: {
name: 'ARBUZ',
symbol: 'ARBUZ',
decimals: 123,
listed: true,
image_url: '<string>'
}
},
swap: {
input_amount: 123,
output_amount: 123,
before_reserves: [123],
after_reserves: [123],
reason: '<string>',
left_amount: 123
},
recommended_gas: 123,
average_gas: 123,
next: '<array>'
}
],
slippage: 0.05,
dynamic_slippage: true,
referral_name: 'tonkeeper',
custom_fee: {
fixed_fee: '<string>',
percentage_fee: 123,
min_percentage_fee_fixed: '<string>',
max_percentage_fee_fixed: '<string>'
},
mev_protection: true
})
};
fetch('https://backend.swap.coffee/v2/route/transactions', 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://backend.swap.coffee/v2/route/transactions",
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([
'sender_address' => 'UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV',
'paths' => [
[
'blockchain' => 'ton',
'dex' => 'stonfi',
'pool_address' => '<string>',
'input_token' => [
'address' => [
'blockchain' => 'ton',
'address' => 'native'
],
'metadata' => [
'name' => 'ARBUZ',
'symbol' => 'ARBUZ',
'decimals' => 123,
'listed' => true,
'image_url' => '<string>'
]
],
'output_token' => [
'address' => [
'blockchain' => 'ton',
'address' => 'native'
],
'metadata' => [
'name' => 'ARBUZ',
'symbol' => 'ARBUZ',
'decimals' => 123,
'listed' => true,
'image_url' => '<string>'
]
],
'swap' => [
'input_amount' => 123,
'output_amount' => 123,
'before_reserves' => [
123
],
'after_reserves' => [
123
],
'reason' => '<string>',
'left_amount' => 123
],
'recommended_gas' => 123,
'average_gas' => 123,
'next' => '<array>'
]
],
'slippage' => 0.05,
'dynamic_slippage' => true,
'referral_name' => 'tonkeeper',
'custom_fee' => [
'fixed_fee' => '<string>',
'percentage_fee' => 123,
'min_percentage_fee_fixed' => '<string>',
'max_percentage_fee_fixed' => '<string>'
],
'mev_protection' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://backend.swap.coffee/v2/route/transactions"
payload := strings.NewReader("{\n \"sender_address\": \"UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV\",\n \"paths\": [\n {\n \"blockchain\": \"ton\",\n \"dex\": \"stonfi\",\n \"pool_address\": \"<string>\",\n \"input_token\": {\n \"address\": {\n \"blockchain\": \"ton\",\n \"address\": \"native\"\n },\n \"metadata\": {\n \"name\": \"ARBUZ\",\n \"symbol\": \"ARBUZ\",\n \"decimals\": 123,\n \"listed\": true,\n \"image_url\": \"<string>\"\n }\n },\n \"output_token\": {\n \"address\": {\n \"blockchain\": \"ton\",\n \"address\": \"native\"\n },\n \"metadata\": {\n \"name\": \"ARBUZ\",\n \"symbol\": \"ARBUZ\",\n \"decimals\": 123,\n \"listed\": true,\n \"image_url\": \"<string>\"\n }\n },\n \"swap\": {\n \"input_amount\": 123,\n \"output_amount\": 123,\n \"before_reserves\": [\n 123\n ],\n \"after_reserves\": [\n 123\n ],\n \"reason\": \"<string>\",\n \"left_amount\": 123\n },\n \"recommended_gas\": 123,\n \"average_gas\": 123,\n \"next\": \"<array>\"\n }\n ],\n \"slippage\": 0.05,\n \"dynamic_slippage\": true,\n \"referral_name\": \"tonkeeper\",\n \"custom_fee\": {\n \"fixed_fee\": \"<string>\",\n \"percentage_fee\": 123,\n \"min_percentage_fee_fixed\": \"<string>\",\n \"max_percentage_fee_fixed\": \"<string>\"\n },\n \"mev_protection\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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://backend.swap.coffee/v2/route/transactions")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sender_address\": \"UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV\",\n \"paths\": [\n {\n \"blockchain\": \"ton\",\n \"dex\": \"stonfi\",\n \"pool_address\": \"<string>\",\n \"input_token\": {\n \"address\": {\n \"blockchain\": \"ton\",\n \"address\": \"native\"\n },\n \"metadata\": {\n \"name\": \"ARBUZ\",\n \"symbol\": \"ARBUZ\",\n \"decimals\": 123,\n \"listed\": true,\n \"image_url\": \"<string>\"\n }\n },\n \"output_token\": {\n \"address\": {\n \"blockchain\": \"ton\",\n \"address\": \"native\"\n },\n \"metadata\": {\n \"name\": \"ARBUZ\",\n \"symbol\": \"ARBUZ\",\n \"decimals\": 123,\n \"listed\": true,\n \"image_url\": \"<string>\"\n }\n },\n \"swap\": {\n \"input_amount\": 123,\n \"output_amount\": 123,\n \"before_reserves\": [\n 123\n ],\n \"after_reserves\": [\n 123\n ],\n \"reason\": \"<string>\",\n \"left_amount\": 123\n },\n \"recommended_gas\": 123,\n \"average_gas\": 123,\n \"next\": \"<array>\"\n }\n ],\n \"slippage\": 0.05,\n \"dynamic_slippage\": true,\n \"referral_name\": \"tonkeeper\",\n \"custom_fee\": {\n \"fixed_fee\": \"<string>\",\n \"percentage_fee\": 123,\n \"min_percentage_fee_fixed\": \"<string>\",\n \"max_percentage_fee_fixed\": \"<string>\"\n },\n \"mev_protection\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.swap.coffee/v2/route/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sender_address\": \"UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV\",\n \"paths\": [\n {\n \"blockchain\": \"ton\",\n \"dex\": \"stonfi\",\n \"pool_address\": \"<string>\",\n \"input_token\": {\n \"address\": {\n \"blockchain\": \"ton\",\n \"address\": \"native\"\n },\n \"metadata\": {\n \"name\": \"ARBUZ\",\n \"symbol\": \"ARBUZ\",\n \"decimals\": 123,\n \"listed\": true,\n \"image_url\": \"<string>\"\n }\n },\n \"output_token\": {\n \"address\": {\n \"blockchain\": \"ton\",\n \"address\": \"native\"\n },\n \"metadata\": {\n \"name\": \"ARBUZ\",\n \"symbol\": \"ARBUZ\",\n \"decimals\": 123,\n \"listed\": true,\n \"image_url\": \"<string>\"\n }\n },\n \"swap\": {\n \"input_amount\": 123,\n \"output_amount\": 123,\n \"before_reserves\": [\n 123\n ],\n \"after_reserves\": [\n 123\n ],\n \"reason\": \"<string>\",\n \"left_amount\": 123\n },\n \"recommended_gas\": 123,\n \"average_gas\": 123,\n \"next\": \"<array>\"\n }\n ],\n \"slippage\": 0.05,\n \"dynamic_slippage\": true,\n \"referral_name\": \"tonkeeper\",\n \"custom_fee\": {\n \"fixed_fee\": \"<string>\",\n \"percentage_fee\": 123,\n \"min_percentage_fee_fixed\": \"<string>\",\n \"max_percentage_fee_fixed\": \"<string>\"\n },\n \"mev_protection\": true\n}"
response = http.request(request)
puts response.read_body{
"route_id": 123,
"transactions": [
{
"address": "EQCM3B12QK1e4yZSf8GtBRT0aLMNyEsBc_DhVfRRtOEffLez",
"value": "<string>",
"cell": "aSDinaTvuI8gbWludGxpZnk=",
"send_mode": 123,
"query_id": 123,
"stateInit": "aSDinaTvuI8gbWludGxpZnk="
}
]
}{
"error": "<string>"
}Authorizations
Body
application/json
Example:
"UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV"
Value of this field is a response from route building endpoint
Show child attributes
Show child attributes
If the slippage is exceeded, the transaction will not be executed and intermediate tokens will be returned to the sender.
Required range:
0 <= x <= 1Example:
0.05
If set to true, slippage will be calculated dynamically.
Example:
true
May be set whilst building transactions from B2B partnership products
Example:
"tonkeeper"
If present, additional transaction for fees collection will be generated. Because of that, be careful with max_splits to not exceed wallet contract limits
Show child attributes
Show child attributes
Whether a MEV protection should be enabled
Example:
true
Returns the best route for the given trade pair using smart settingsReturns pre-built transaction for the given unstake request. It is assumed that transaction will be signed and sent by the sender via wallet
⌘I