Post Swap Route Limits
curl --request POST \
--url https://api.layerswap.io/api/v2/limits \
--header 'Content-Type: application/json' \
--header 'X-LS-APIKEY: <api-key>' \
--data '
{
"source_network": "<string>",
"source_token": "<string>",
"destination_network": "<string>",
"destination_token": "<string>",
"source_address": "<string>",
"destination_address": "<string>",
"use_deposit_address": true,
"use_gasless": true,
"use_frontend_swap": true,
"refuel": true,
"fee_sponsorship_percentage": 123,
"integrator_fee_splits": [
{
"recipient": "<string>",
"bps": 123
}
]
}
'import requests
url = "https://api.layerswap.io/api/v2/limits"
payload = {
"source_network": "<string>",
"source_token": "<string>",
"destination_network": "<string>",
"destination_token": "<string>",
"source_address": "<string>",
"destination_address": "<string>",
"use_deposit_address": True,
"use_gasless": True,
"use_frontend_swap": True,
"refuel": True,
"fee_sponsorship_percentage": 123,
"integrator_fee_splits": [
{
"recipient": "<string>",
"bps": 123
}
]
}
headers = {
"X-LS-APIKEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-LS-APIKEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_network: '<string>',
source_token: '<string>',
destination_network: '<string>',
destination_token: '<string>',
source_address: '<string>',
destination_address: '<string>',
use_deposit_address: true,
use_gasless: true,
use_frontend_swap: true,
refuel: true,
fee_sponsorship_percentage: 123,
integrator_fee_splits: [{recipient: '<string>', bps: 123}]
})
};
fetch('https://api.layerswap.io/api/v2/limits', 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.layerswap.io/api/v2/limits",
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([
'source_network' => '<string>',
'source_token' => '<string>',
'destination_network' => '<string>',
'destination_token' => '<string>',
'source_address' => '<string>',
'destination_address' => '<string>',
'use_deposit_address' => true,
'use_gasless' => true,
'use_frontend_swap' => true,
'refuel' => true,
'fee_sponsorship_percentage' => 123,
'integrator_fee_splits' => [
[
'recipient' => '<string>',
'bps' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-LS-APIKEY: <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://api.layerswap.io/api/v2/limits"
payload := strings.NewReader("{\n \"source_network\": \"<string>\",\n \"source_token\": \"<string>\",\n \"destination_network\": \"<string>\",\n \"destination_token\": \"<string>\",\n \"source_address\": \"<string>\",\n \"destination_address\": \"<string>\",\n \"use_deposit_address\": true,\n \"use_gasless\": true,\n \"use_frontend_swap\": true,\n \"refuel\": true,\n \"fee_sponsorship_percentage\": 123,\n \"integrator_fee_splits\": [\n {\n \"recipient\": \"<string>\",\n \"bps\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-LS-APIKEY", "<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://api.layerswap.io/api/v2/limits")
.header("X-LS-APIKEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source_network\": \"<string>\",\n \"source_token\": \"<string>\",\n \"destination_network\": \"<string>\",\n \"destination_token\": \"<string>\",\n \"source_address\": \"<string>\",\n \"destination_address\": \"<string>\",\n \"use_deposit_address\": true,\n \"use_gasless\": true,\n \"use_frontend_swap\": true,\n \"refuel\": true,\n \"fee_sponsorship_percentage\": 123,\n \"integrator_fee_splits\": [\n {\n \"recipient\": \"<string>\",\n \"bps\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.layerswap.io/api/v2/limits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-LS-APIKEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_network\": \"<string>\",\n \"source_token\": \"<string>\",\n \"destination_network\": \"<string>\",\n \"destination_token\": \"<string>\",\n \"source_address\": \"<string>\",\n \"destination_address\": \"<string>\",\n \"use_deposit_address\": true,\n \"use_gasless\": true,\n \"use_frontend_swap\": true,\n \"refuel\": true,\n \"fee_sponsorship_percentage\": 123,\n \"integrator_fee_splits\": [\n {\n \"recipient\": \"<string>\",\n \"bps\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "<string>",
"message": "<string>",
"metadata": {}
},
"data": {
"fee_sponsorship_percentage": 123,
"min_amount_in_usd": 123,
"min_amount": 123,
"max_amount_in_usd": 123,
"max_amount": 123
}
}Swaps
Post Swap Route Limits
Calculates limits from JSON, including optional integrator_fee_splits. Nonnegative integer shares must total at most 2000 bps; zero-bps entries are ignored. Active recipients must be nonzero Base EVM addresses. Optional fee_sponsorship_percentage (0–100) sponsors that percentage of fees; integrator fees are not sponsored.
POST
/
api
/
v2
/
limits
Post Swap Route Limits
curl --request POST \
--url https://api.layerswap.io/api/v2/limits \
--header 'Content-Type: application/json' \
--header 'X-LS-APIKEY: <api-key>' \
--data '
{
"source_network": "<string>",
"source_token": "<string>",
"destination_network": "<string>",
"destination_token": "<string>",
"source_address": "<string>",
"destination_address": "<string>",
"use_deposit_address": true,
"use_gasless": true,
"use_frontend_swap": true,
"refuel": true,
"fee_sponsorship_percentage": 123,
"integrator_fee_splits": [
{
"recipient": "<string>",
"bps": 123
}
]
}
'import requests
url = "https://api.layerswap.io/api/v2/limits"
payload = {
"source_network": "<string>",
"source_token": "<string>",
"destination_network": "<string>",
"destination_token": "<string>",
"source_address": "<string>",
"destination_address": "<string>",
"use_deposit_address": True,
"use_gasless": True,
"use_frontend_swap": True,
"refuel": True,
"fee_sponsorship_percentage": 123,
"integrator_fee_splits": [
{
"recipient": "<string>",
"bps": 123
}
]
}
headers = {
"X-LS-APIKEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-LS-APIKEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_network: '<string>',
source_token: '<string>',
destination_network: '<string>',
destination_token: '<string>',
source_address: '<string>',
destination_address: '<string>',
use_deposit_address: true,
use_gasless: true,
use_frontend_swap: true,
refuel: true,
fee_sponsorship_percentage: 123,
integrator_fee_splits: [{recipient: '<string>', bps: 123}]
})
};
fetch('https://api.layerswap.io/api/v2/limits', 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.layerswap.io/api/v2/limits",
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([
'source_network' => '<string>',
'source_token' => '<string>',
'destination_network' => '<string>',
'destination_token' => '<string>',
'source_address' => '<string>',
'destination_address' => '<string>',
'use_deposit_address' => true,
'use_gasless' => true,
'use_frontend_swap' => true,
'refuel' => true,
'fee_sponsorship_percentage' => 123,
'integrator_fee_splits' => [
[
'recipient' => '<string>',
'bps' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-LS-APIKEY: <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://api.layerswap.io/api/v2/limits"
payload := strings.NewReader("{\n \"source_network\": \"<string>\",\n \"source_token\": \"<string>\",\n \"destination_network\": \"<string>\",\n \"destination_token\": \"<string>\",\n \"source_address\": \"<string>\",\n \"destination_address\": \"<string>\",\n \"use_deposit_address\": true,\n \"use_gasless\": true,\n \"use_frontend_swap\": true,\n \"refuel\": true,\n \"fee_sponsorship_percentage\": 123,\n \"integrator_fee_splits\": [\n {\n \"recipient\": \"<string>\",\n \"bps\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-LS-APIKEY", "<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://api.layerswap.io/api/v2/limits")
.header("X-LS-APIKEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source_network\": \"<string>\",\n \"source_token\": \"<string>\",\n \"destination_network\": \"<string>\",\n \"destination_token\": \"<string>\",\n \"source_address\": \"<string>\",\n \"destination_address\": \"<string>\",\n \"use_deposit_address\": true,\n \"use_gasless\": true,\n \"use_frontend_swap\": true,\n \"refuel\": true,\n \"fee_sponsorship_percentage\": 123,\n \"integrator_fee_splits\": [\n {\n \"recipient\": \"<string>\",\n \"bps\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.layerswap.io/api/v2/limits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-LS-APIKEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_network\": \"<string>\",\n \"source_token\": \"<string>\",\n \"destination_network\": \"<string>\",\n \"destination_token\": \"<string>\",\n \"source_address\": \"<string>\",\n \"destination_address\": \"<string>\",\n \"use_deposit_address\": true,\n \"use_gasless\": true,\n \"use_frontend_swap\": true,\n \"refuel\": true,\n \"fee_sponsorship_percentage\": 123,\n \"integrator_fee_splits\": [\n {\n \"recipient\": \"<string>\",\n \"bps\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "<string>",
"message": "<string>",
"metadata": {}
},
"data": {
"fee_sponsorship_percentage": 123,
"min_amount_in_usd": 123,
"min_amount": 123,
"max_amount_in_usd": 123,
"max_amount": 123
}
}Authorizations
Headers
X-LS-APIKEY
string
default:NDBxG+aon6WlbgIA2LfwmcbLU52qUL9qTnztTuTRPNSohf/VnxXpRaJlA5uLSQVqP8YGIiy/0mz+mMeZhLY4/Q
Body
application/json
Show child attributes
Show child attributes
Was this page helpful?