curl --request POST \
--url https://api.walletsuite.io/api/swaps/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"srcChain": "ethereum",
"dstChain": "ethereum",
"srcToken": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"dstToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"srcAmount": 10000000000000000,
"fromAddress": "0xYourEvmWalletHere",
"toAddress": "0xYourEvmWalletHere",
"slippageBps": 100,
"srcSymbol": "WETH",
"dstSymbol": "USDC",
"srcDecimals": 18,
"dstDecimals": 6,
"provider": "oneinch",
"excludeProviders": [
"odos"
]
}
'import requests
url = "https://api.walletsuite.io/api/swaps/quote"
payload = {
"srcChain": "ethereum",
"dstChain": "ethereum",
"srcToken": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"dstToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"srcAmount": 10000000000000000,
"fromAddress": "0xYourEvmWalletHere",
"toAddress": "0xYourEvmWalletHere",
"slippageBps": 100,
"srcSymbol": "WETH",
"dstSymbol": "USDC",
"srcDecimals": 18,
"dstDecimals": 6,
"provider": "oneinch",
"excludeProviders": ["odos"]
}
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({
srcChain: 'ethereum',
dstChain: 'ethereum',
srcToken: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
dstToken: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
srcAmount: 10000000000000000,
fromAddress: '0xYourEvmWalletHere',
toAddress: '0xYourEvmWalletHere',
slippageBps: 100,
srcSymbol: 'WETH',
dstSymbol: 'USDC',
srcDecimals: 18,
dstDecimals: 6,
provider: 'oneinch',
excludeProviders: ['odos']
})
};
fetch('https://api.walletsuite.io/api/swaps/quote', 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.walletsuite.io/api/swaps/quote",
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([
'srcChain' => 'ethereum',
'dstChain' => 'ethereum',
'srcToken' => '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
'dstToken' => '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
'srcAmount' => 10000000000000000,
'fromAddress' => '0xYourEvmWalletHere',
'toAddress' => '0xYourEvmWalletHere',
'slippageBps' => 100,
'srcSymbol' => 'WETH',
'dstSymbol' => 'USDC',
'srcDecimals' => 18,
'dstDecimals' => 6,
'provider' => 'oneinch',
'excludeProviders' => [
'odos'
]
]),
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://api.walletsuite.io/api/swaps/quote"
payload := strings.NewReader("{\n \"srcChain\": \"ethereum\",\n \"dstChain\": \"ethereum\",\n \"srcToken\": \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\n \"dstToken\": \"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\n \"srcAmount\": 10000000000000000,\n \"fromAddress\": \"0xYourEvmWalletHere\",\n \"toAddress\": \"0xYourEvmWalletHere\",\n \"slippageBps\": 100,\n \"srcSymbol\": \"WETH\",\n \"dstSymbol\": \"USDC\",\n \"srcDecimals\": 18,\n \"dstDecimals\": 6,\n \"provider\": \"oneinch\",\n \"excludeProviders\": [\n \"odos\"\n ]\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://api.walletsuite.io/api/swaps/quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"srcChain\": \"ethereum\",\n \"dstChain\": \"ethereum\",\n \"srcToken\": \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\n \"dstToken\": \"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\n \"srcAmount\": 10000000000000000,\n \"fromAddress\": \"0xYourEvmWalletHere\",\n \"toAddress\": \"0xYourEvmWalletHere\",\n \"slippageBps\": 100,\n \"srcSymbol\": \"WETH\",\n \"dstSymbol\": \"USDC\",\n \"srcDecimals\": 18,\n \"dstDecimals\": 6,\n \"provider\": \"oneinch\",\n \"excludeProviders\": [\n \"odos\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.walletsuite.io/api/swaps/quote")
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 \"srcChain\": \"ethereum\",\n \"dstChain\": \"ethereum\",\n \"srcToken\": \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\n \"dstToken\": \"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\n \"srcAmount\": 10000000000000000,\n \"fromAddress\": \"0xYourEvmWalletHere\",\n \"toAddress\": \"0xYourEvmWalletHere\",\n \"slippageBps\": 100,\n \"srcSymbol\": \"WETH\",\n \"dstSymbol\": \"USDC\",\n \"srcDecimals\": 18,\n \"dstDecimals\": 6,\n \"provider\": \"oneinch\",\n \"excludeProviders\": [\n \"odos\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"code": "<string>",
"message": "<string>",
"data": {
"request": {
"srcChain": "<string>",
"dstChain": "<string>",
"srcToken": "<string>",
"dstToken": "<string>",
"srcAmount": 123,
"fromAddress": "<string>",
"toAddress": "<string>",
"slippageBps": 123,
"feeBps": 123,
"integratorTag": "<string>",
"excludeProviders": [],
"timeoutMs": 123,
"srcDecimals": 123,
"dstDecimals": 123,
"srcSymbol": "<string>",
"dstSymbol": "<string>",
"feeRecipient": "<string>",
"onlyProviders": []
},
"ranked": [
{
"rank": 123,
"netDstAmount": 123,
"integratorFeeInDstAmount": 123,
"quote": {
"srcChain": "<string>",
"dstChain": "<string>",
"srcToken": "<string>",
"dstToken": "<string>",
"srcAmount": 123,
"dstAmount": 123,
"minDstAmount": 123,
"rawProviderRef": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"fees": {
"integratorBps": 123,
"total": 123,
"totalBps": 123,
"integratorAmount": 123,
"protocolBps": 123,
"protocolAmount": 123,
"gasBaseFee": 123,
"outboundFee": 123,
"liquidityFee": 123,
"priceImpactBps": 123,
"feeAsset": "<string>"
},
"warnings": [
"<string>"
],
"priceImpactBps": 123,
"estimatedGas": 123,
"gasUsd": 123,
"estimatedDurationSec": 123,
"approvalSpender": "<string>",
"tx": {
"chain": "<string>",
"from": "<string>",
"to": "<string>",
"approvalRequired": true,
"chainId": 123,
"data": "<string>",
"valueWei": 123,
"gasLimit": 123,
"maxPriorityFeePerGas": 123,
"maxFeePerGas": 123,
"gasPrice": 123,
"nonce": 123,
"memo": "<string>",
"approvalSpender": "<string>",
"approvalToken": "<string>",
"approvalAmount": 123,
"solanaTransactionBase64": "<string>",
"depositAddress": "<string>",
"depositExpiresAt": "2023-11-07T05:31:56Z"
},
"notes": "<string>"
}
}
],
"errors": [
{
"code": "<string>",
"message": "<string>",
"durationMs": 123
}
],
"quotedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"quoteId": "<string>",
"winner": {
"srcChain": "<string>",
"dstChain": "<string>",
"srcToken": "<string>",
"dstToken": "<string>",
"srcAmount": 123,
"dstAmount": 123,
"minDstAmount": 123,
"rawProviderRef": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"fees": {
"integratorBps": 123,
"total": 123,
"totalBps": 123,
"integratorAmount": 123,
"protocolBps": 123,
"protocolAmount": 123,
"gasBaseFee": 123,
"outboundFee": 123,
"liquidityFee": 123,
"priceImpactBps": 123,
"feeAsset": "<string>"
},
"warnings": [
"<string>"
],
"priceImpactBps": 123,
"estimatedGas": 123,
"gasUsd": 123,
"estimatedDurationSec": 123,
"approvalSpender": "<string>",
"tx": {
"chain": "<string>",
"from": "<string>",
"to": "<string>",
"approvalRequired": true,
"chainId": 123,
"data": "<string>",
"valueWei": 123,
"gasLimit": 123,
"maxPriorityFeePerGas": 123,
"maxFeePerGas": 123,
"gasPrice": 123,
"nonce": 123,
"memo": "<string>",
"approvalSpender": "<string>",
"approvalToken": "<string>",
"approvalAmount": 123,
"solanaTransactionBase64": "<string>",
"depositAddress": "<string>",
"depositExpiresAt": "2023-11-07T05:31:56Z"
},
"notes": "<string>"
}
}
}Swap quote — fans out to all providers, returns ranked best route
curl --request POST \
--url https://api.walletsuite.io/api/swaps/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"srcChain": "ethereum",
"dstChain": "ethereum",
"srcToken": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"dstToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"srcAmount": 10000000000000000,
"fromAddress": "0xYourEvmWalletHere",
"toAddress": "0xYourEvmWalletHere",
"slippageBps": 100,
"srcSymbol": "WETH",
"dstSymbol": "USDC",
"srcDecimals": 18,
"dstDecimals": 6,
"provider": "oneinch",
"excludeProviders": [
"odos"
]
}
'import requests
url = "https://api.walletsuite.io/api/swaps/quote"
payload = {
"srcChain": "ethereum",
"dstChain": "ethereum",
"srcToken": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"dstToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"srcAmount": 10000000000000000,
"fromAddress": "0xYourEvmWalletHere",
"toAddress": "0xYourEvmWalletHere",
"slippageBps": 100,
"srcSymbol": "WETH",
"dstSymbol": "USDC",
"srcDecimals": 18,
"dstDecimals": 6,
"provider": "oneinch",
"excludeProviders": ["odos"]
}
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({
srcChain: 'ethereum',
dstChain: 'ethereum',
srcToken: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
dstToken: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
srcAmount: 10000000000000000,
fromAddress: '0xYourEvmWalletHere',
toAddress: '0xYourEvmWalletHere',
slippageBps: 100,
srcSymbol: 'WETH',
dstSymbol: 'USDC',
srcDecimals: 18,
dstDecimals: 6,
provider: 'oneinch',
excludeProviders: ['odos']
})
};
fetch('https://api.walletsuite.io/api/swaps/quote', 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.walletsuite.io/api/swaps/quote",
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([
'srcChain' => 'ethereum',
'dstChain' => 'ethereum',
'srcToken' => '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
'dstToken' => '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
'srcAmount' => 10000000000000000,
'fromAddress' => '0xYourEvmWalletHere',
'toAddress' => '0xYourEvmWalletHere',
'slippageBps' => 100,
'srcSymbol' => 'WETH',
'dstSymbol' => 'USDC',
'srcDecimals' => 18,
'dstDecimals' => 6,
'provider' => 'oneinch',
'excludeProviders' => [
'odos'
]
]),
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://api.walletsuite.io/api/swaps/quote"
payload := strings.NewReader("{\n \"srcChain\": \"ethereum\",\n \"dstChain\": \"ethereum\",\n \"srcToken\": \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\n \"dstToken\": \"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\n \"srcAmount\": 10000000000000000,\n \"fromAddress\": \"0xYourEvmWalletHere\",\n \"toAddress\": \"0xYourEvmWalletHere\",\n \"slippageBps\": 100,\n \"srcSymbol\": \"WETH\",\n \"dstSymbol\": \"USDC\",\n \"srcDecimals\": 18,\n \"dstDecimals\": 6,\n \"provider\": \"oneinch\",\n \"excludeProviders\": [\n \"odos\"\n ]\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://api.walletsuite.io/api/swaps/quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"srcChain\": \"ethereum\",\n \"dstChain\": \"ethereum\",\n \"srcToken\": \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\n \"dstToken\": \"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\n \"srcAmount\": 10000000000000000,\n \"fromAddress\": \"0xYourEvmWalletHere\",\n \"toAddress\": \"0xYourEvmWalletHere\",\n \"slippageBps\": 100,\n \"srcSymbol\": \"WETH\",\n \"dstSymbol\": \"USDC\",\n \"srcDecimals\": 18,\n \"dstDecimals\": 6,\n \"provider\": \"oneinch\",\n \"excludeProviders\": [\n \"odos\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.walletsuite.io/api/swaps/quote")
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 \"srcChain\": \"ethereum\",\n \"dstChain\": \"ethereum\",\n \"srcToken\": \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\n \"dstToken\": \"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\n \"srcAmount\": 10000000000000000,\n \"fromAddress\": \"0xYourEvmWalletHere\",\n \"toAddress\": \"0xYourEvmWalletHere\",\n \"slippageBps\": 100,\n \"srcSymbol\": \"WETH\",\n \"dstSymbol\": \"USDC\",\n \"srcDecimals\": 18,\n \"dstDecimals\": 6,\n \"provider\": \"oneinch\",\n \"excludeProviders\": [\n \"odos\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"code": "<string>",
"message": "<string>",
"data": {
"request": {
"srcChain": "<string>",
"dstChain": "<string>",
"srcToken": "<string>",
"dstToken": "<string>",
"srcAmount": 123,
"fromAddress": "<string>",
"toAddress": "<string>",
"slippageBps": 123,
"feeBps": 123,
"integratorTag": "<string>",
"excludeProviders": [],
"timeoutMs": 123,
"srcDecimals": 123,
"dstDecimals": 123,
"srcSymbol": "<string>",
"dstSymbol": "<string>",
"feeRecipient": "<string>",
"onlyProviders": []
},
"ranked": [
{
"rank": 123,
"netDstAmount": 123,
"integratorFeeInDstAmount": 123,
"quote": {
"srcChain": "<string>",
"dstChain": "<string>",
"srcToken": "<string>",
"dstToken": "<string>",
"srcAmount": 123,
"dstAmount": 123,
"minDstAmount": 123,
"rawProviderRef": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"fees": {
"integratorBps": 123,
"total": 123,
"totalBps": 123,
"integratorAmount": 123,
"protocolBps": 123,
"protocolAmount": 123,
"gasBaseFee": 123,
"outboundFee": 123,
"liquidityFee": 123,
"priceImpactBps": 123,
"feeAsset": "<string>"
},
"warnings": [
"<string>"
],
"priceImpactBps": 123,
"estimatedGas": 123,
"gasUsd": 123,
"estimatedDurationSec": 123,
"approvalSpender": "<string>",
"tx": {
"chain": "<string>",
"from": "<string>",
"to": "<string>",
"approvalRequired": true,
"chainId": 123,
"data": "<string>",
"valueWei": 123,
"gasLimit": 123,
"maxPriorityFeePerGas": 123,
"maxFeePerGas": 123,
"gasPrice": 123,
"nonce": 123,
"memo": "<string>",
"approvalSpender": "<string>",
"approvalToken": "<string>",
"approvalAmount": 123,
"solanaTransactionBase64": "<string>",
"depositAddress": "<string>",
"depositExpiresAt": "2023-11-07T05:31:56Z"
},
"notes": "<string>"
}
}
],
"errors": [
{
"code": "<string>",
"message": "<string>",
"durationMs": 123
}
],
"quotedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"quoteId": "<string>",
"winner": {
"srcChain": "<string>",
"dstChain": "<string>",
"srcToken": "<string>",
"dstToken": "<string>",
"srcAmount": 123,
"dstAmount": 123,
"minDstAmount": 123,
"rawProviderRef": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"fees": {
"integratorBps": 123,
"total": 123,
"totalBps": 123,
"integratorAmount": 123,
"protocolBps": 123,
"protocolAmount": 123,
"gasBaseFee": 123,
"outboundFee": 123,
"liquidityFee": 123,
"priceImpactBps": 123,
"feeAsset": "<string>"
},
"warnings": [
"<string>"
],
"priceImpactBps": 123,
"estimatedGas": 123,
"gasUsd": 123,
"estimatedDurationSec": 123,
"approvalSpender": "<string>",
"tx": {
"chain": "<string>",
"from": "<string>",
"to": "<string>",
"approvalRequired": true,
"chainId": 123,
"data": "<string>",
"valueWei": 123,
"gasLimit": 123,
"maxPriorityFeePerGas": 123,
"maxFeePerGas": 123,
"gasPrice": 123,
"nonce": 123,
"memo": "<string>",
"approvalSpender": "<string>",
"approvalToken": "<string>",
"approvalAmount": 123,
"solanaTransactionBase64": "<string>",
"depositAddress": "<string>",
"depositExpiresAt": "2023-11-07T05:31:56Z"
},
"notes": "<string>"
}
}
}Authorizations
API key provided by WalletSuite team
Body
Quote request: returns the best route across all enabled providers.
Source chain key (lowercase).
"ethereum"
Destination chain key (lowercase).
"ethereum"
Source token address (EVM hex / Solana mint), native, or the EVM EEEE sentinel.
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
Destination token address.
"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
Source amount in raw base units (wei, lamports, sats).
10000000000000000
Sender address on srcChain.
"0xYourEvmWalletHere"
Recipient address on dstChain. Defaults to fromAddress.
"0xYourEvmWalletHere"
Slippage tolerance in basis points (10 = 0.1%).
100
Optional source token symbol (required for THORChain ERC-20 pools).
"WETH"
Optional destination token symbol.
"USDC"
Source token decimals (required for non-EVM aggregator routing).
18
Destination token decimals.
6
Restrict the fanout to a single provider id.
"oneinch"
Provider ids to skip during fanout.
["odos"]
Was this page helpful?