PreviewQuote
curl --request POST \
--url https://api.hular.dev/json/v1/quote/preview \
--header 'Content-Type: application/json' \
--data '
{
"srcChain": "<string>",
"dstChain": "<string>",
"srcToken": "<string>",
"dstToken": "<string>",
"amount": "<string>",
"slippageBps": 1,
"srcSlippageBps": 1,
"referrers": [
{
"address": "<string>",
"bps": 1
}
],
"gasDrop": "<string>"
}
'import requests
url = "https://api.hular.dev/json/v1/quote/preview"
payload = {
"srcChain": "<string>",
"dstChain": "<string>",
"srcToken": "<string>",
"dstToken": "<string>",
"amount": "<string>",
"slippageBps": 1,
"srcSlippageBps": 1,
"referrers": [
{
"address": "<string>",
"bps": 1
}
],
"gasDrop": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
srcChain: '<string>',
dstChain: '<string>',
srcToken: '<string>',
dstToken: '<string>',
amount: '<string>',
slippageBps: 1,
srcSlippageBps: 1,
referrers: [{address: '<string>', bps: 1}],
gasDrop: '<string>'
})
};
fetch('https://api.hular.dev/json/v1/quote/preview', 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.hular.dev/json/v1/quote/preview",
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' => '<string>',
'dstChain' => '<string>',
'srcToken' => '<string>',
'dstToken' => '<string>',
'amount' => '<string>',
'slippageBps' => 1,
'srcSlippageBps' => 1,
'referrers' => [
[
'address' => '<string>',
'bps' => 1
]
],
'gasDrop' => '<string>'
]),
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.hular.dev/json/v1/quote/preview"
payload := strings.NewReader("{\n \"srcChain\": \"<string>\",\n \"dstChain\": \"<string>\",\n \"srcToken\": \"<string>\",\n \"dstToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"slippageBps\": 1,\n \"srcSlippageBps\": 1,\n \"referrers\": [\n {\n \"address\": \"<string>\",\n \"bps\": 1\n }\n ],\n \"gasDrop\": \"<string>\"\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))
}HttpResponse<String> response = Unirest.post("https://api.hular.dev/json/v1/quote/preview")
.header("Content-Type", "application/json")
.body("{\n \"srcChain\": \"<string>\",\n \"dstChain\": \"<string>\",\n \"srcToken\": \"<string>\",\n \"dstToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"slippageBps\": 1,\n \"srcSlippageBps\": 1,\n \"referrers\": [\n {\n \"address\": \"<string>\",\n \"bps\": 1\n }\n ],\n \"gasDrop\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hular.dev/json/v1/quote/preview")
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 \"srcChain\": \"<string>\",\n \"dstChain\": \"<string>\",\n \"srcToken\": \"<string>\",\n \"dstToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"slippageBps\": 1,\n \"srcSlippageBps\": 1,\n \"referrers\": [\n {\n \"address\": \"<string>\",\n \"bps\": 1\n }\n ],\n \"gasDrop\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"amountIn": "<string>",
"amountOut": "<string>",
"minAmountOut": "<string>",
"amountInUsdMicros": "<string>",
"amountOutUsdMicros": "<string>",
"slippageBps": 1,
"feeBreakdown": {
"components": [
{
"name": "<string>",
"side": "<string>",
"usdMicros": "<string>",
"native": "<string>"
}
],
"dstTotalUsdMicros": "<string>",
"srcTotalUsdMicros": "<string>",
"dstGasNative": "<string>",
"srcGasNative": "<string>"
},
"sameChainSwap": true,
"fulfillEtaSecs": "<string>",
"isGuaranteed": true
}{
"code": 123,
"message": "<string>",
"details": [
{}
]
}BlinkApi
PreviewQuote
POST
/
v1
/
quote
/
preview
PreviewQuote
curl --request POST \
--url https://api.hular.dev/json/v1/quote/preview \
--header 'Content-Type: application/json' \
--data '
{
"srcChain": "<string>",
"dstChain": "<string>",
"srcToken": "<string>",
"dstToken": "<string>",
"amount": "<string>",
"slippageBps": 1,
"srcSlippageBps": 1,
"referrers": [
{
"address": "<string>",
"bps": 1
}
],
"gasDrop": "<string>"
}
'import requests
url = "https://api.hular.dev/json/v1/quote/preview"
payload = {
"srcChain": "<string>",
"dstChain": "<string>",
"srcToken": "<string>",
"dstToken": "<string>",
"amount": "<string>",
"slippageBps": 1,
"srcSlippageBps": 1,
"referrers": [
{
"address": "<string>",
"bps": 1
}
],
"gasDrop": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
srcChain: '<string>',
dstChain: '<string>',
srcToken: '<string>',
dstToken: '<string>',
amount: '<string>',
slippageBps: 1,
srcSlippageBps: 1,
referrers: [{address: '<string>', bps: 1}],
gasDrop: '<string>'
})
};
fetch('https://api.hular.dev/json/v1/quote/preview', 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.hular.dev/json/v1/quote/preview",
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' => '<string>',
'dstChain' => '<string>',
'srcToken' => '<string>',
'dstToken' => '<string>',
'amount' => '<string>',
'slippageBps' => 1,
'srcSlippageBps' => 1,
'referrers' => [
[
'address' => '<string>',
'bps' => 1
]
],
'gasDrop' => '<string>'
]),
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.hular.dev/json/v1/quote/preview"
payload := strings.NewReader("{\n \"srcChain\": \"<string>\",\n \"dstChain\": \"<string>\",\n \"srcToken\": \"<string>\",\n \"dstToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"slippageBps\": 1,\n \"srcSlippageBps\": 1,\n \"referrers\": [\n {\n \"address\": \"<string>\",\n \"bps\": 1\n }\n ],\n \"gasDrop\": \"<string>\"\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))
}HttpResponse<String> response = Unirest.post("https://api.hular.dev/json/v1/quote/preview")
.header("Content-Type", "application/json")
.body("{\n \"srcChain\": \"<string>\",\n \"dstChain\": \"<string>\",\n \"srcToken\": \"<string>\",\n \"dstToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"slippageBps\": 1,\n \"srcSlippageBps\": 1,\n \"referrers\": [\n {\n \"address\": \"<string>\",\n \"bps\": 1\n }\n ],\n \"gasDrop\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hular.dev/json/v1/quote/preview")
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 \"srcChain\": \"<string>\",\n \"dstChain\": \"<string>\",\n \"srcToken\": \"<string>\",\n \"dstToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"slippageBps\": 1,\n \"srcSlippageBps\": 1,\n \"referrers\": [\n {\n \"address\": \"<string>\",\n \"bps\": 1\n }\n ],\n \"gasDrop\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"amountIn": "<string>",
"amountOut": "<string>",
"minAmountOut": "<string>",
"amountInUsdMicros": "<string>",
"amountOutUsdMicros": "<string>",
"slippageBps": 1,
"feeBreakdown": {
"components": [
{
"name": "<string>",
"side": "<string>",
"usdMicros": "<string>",
"native": "<string>"
}
],
"dstTotalUsdMicros": "<string>",
"srcTotalUsdMicros": "<string>",
"dstGasNative": "<string>",
"srcGasNative": "<string>"
},
"sameChainSwap": true,
"fulfillEtaSecs": "<string>",
"isGuaranteed": true
}{
"code": 123,
"message": "<string>",
"details": [
{}
]
}Headers
Optional. Without a key the request is rate limited per client IP and quotes carry extra spread.
Body
application/json
Required range:
x >= 0Required range:
x >= 0Show child attributes
Show child attributes
Available options:
TRADE_TYPE_UNSPECIFIED, TRADE_TYPE_EXACT_INPUT, TRADE_TYPE_EXPECTED_OUTPUT, TRADE_TYPE_EXACT_OUTPUT Response
OK
Required range:
x >= 0Show child attributes
Show child attributes
64-bit unsigned integer, sent and returned as a decimal string