Returns all possible connections between two chains.
curl --request GET \
--url https://li.quest/v1/connectionsimport requests
url = "https://li.quest/v1/connections"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://li.quest/v1/connections', 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/connections",
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/connections"
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/connections")
.asString();require 'uri'
require 'net/http'
url = URI("https://li.quest/v1/connections")
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{
"connections": [
{
"fromChainId": 137,
"toChainId": 1,
"fromTokens": [
{
"address": "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063",
"chainId": 137
}
],
"toTokens": [
{
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
"chainId": 1
},
{
"address": "0x0000000000000000000000000000000000000000",
"chainId": 1
}
]
}
]
}连接
返回基于源链或目标链的所有可能连接
此端点返回基于指定源链或目标链的所有可能连接,显示可用的桥接路径和路由选项。
GET
/
v1
/
connections
Returns all possible connections between two chains.
curl --request GET \
--url https://li.quest/v1/connectionsimport requests
url = "https://li.quest/v1/connections"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://li.quest/v1/connections', 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/connections",
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/connections"
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/connections")
.asString();require 'uri'
require 'net/http'
url = URI("https://li.quest/v1/connections")
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{
"connections": [
{
"fromChainId": 137,
"toChainId": 1,
"fromTokens": [
{
"address": "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063",
"chainId": 137
}
],
"toTokens": [
{
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
"chainId": 1
},
{
"address": "0x0000000000000000000000000000000000000000",
"chainId": 1
}
]
}
]
}请求头
Authentication header, register in the LI.FI Partner Portal (https://portal.li.fi/ ) to get your API Key.

