curl --request GET \
--url https://li.quest/v1/gas/suggestion/{chain}import requests
url = "https://li.quest/v1/gas/suggestion/{chain}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://li.quest/v1/gas/suggestion/{chain}', 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://li.quest/v1/gas/suggestion/{chain}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://li.quest/v1/gas/suggestion/{chain}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://li.quest/v1/gas/suggestion/{chain}")
.asString();require 'uri'
require 'net/http'
url = URI("https://li.quest/v1/gas/suggestion/{chain}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body获取指定链的 Gas 建议
此端点返回指定区块链的推荐 Gas 价格和设置,帮助您优化交易费用和执行时间。
curl --request GET \
--url https://li.quest/v1/gas/suggestion/{chain}import requests
url = "https://li.quest/v1/gas/suggestion/{chain}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://li.quest/v1/gas/suggestion/{chain}', 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://li.quest/v1/gas/suggestion/{chain}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://li.quest/v1/gas/suggestion/{chain}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://li.quest/v1/gas/suggestion/{chain}")
.asString();require 'uri'
require 'net/http'
url = URI("https://li.quest/v1/gas/suggestion/{chain}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body请求头
Authentication header, register in the LI.FI Partner Portal (https://portal.li.fi/ ) to get your API Key.
路径参数
Chain from which gas prices should be shown (can be a chain id or a chain key)
查询参数
If fromChain and fromToken are specified, the result will contain information about how much fromToken amount the user has to send to receive the suggested gas amount on the requested chain.
If fromChain and fromToken are specified, the result will contain information about how much fromToken amount the user has to send to receive the suggested gas amount on the requested chain.
响应
{ "available": true, "recommended": { "token": { "address": "0x0000000000000000000000000000000000000000", "chainId": 137, "symbol": "MATIC", "decimals": 18, "name": "MATIC", "priceUSD": "1.219821", "logoURI": "https://static.debank.com/image/matic_token/logo_url/matic/6f5a6b6f0732a7a235131bd7804d357c.png", "coinKey": "MATIC" }, "amount": "190510922050970750", "amountUsd": "0.23" }, "limit": { "token": { "address": "0x0000000000000000000000000000000000000000", "chainId": 137, "symbol": "MATIC", "decimals": 18, "name": "MATIC", "priceUSD": "1.219821", "logoURI": "https://static.debank.com/image/matic_token/logo_url/matic/6f5a6b6f0732a7a235131bd7804d357c.png", "coinKey": "MATIC" }, "amount": "1639584824330782959", "amountUsd": "2" }, "fromToken": { "address": "eth", "symbol": "ETH", "decimals": 18, "chainId": 1, "name": "ETH", "coinKey": "ETH", "priceUSD": "1622.39", "logoURI": "https://static.debank.com/image/token/logo_url/eth/935ae4e4d1d12d59a99717a24f2540b5.png" }, "fromAmount": "141766159801281" }

