YieldGetNetworks returns available Yield networks.
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/YieldGetNetworks \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://trails-api.sequence.app/rpc/Trails/YieldGetNetworks"
payload = {}
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({})
};
fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetNetworks', 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://trails-api.sequence.app/rpc/Trails/YieldGetNetworks",
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([
]),
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://trails-api.sequence.app/rpc/Trails/YieldGetNetworks"
payload := strings.NewReader("{}")
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://trails-api.sequence.app/rpc/Trails/YieldGetNetworks")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/YieldGetNetworks")
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 = "{}"
response = http.request(request)
puts response.read_body{
"networks": [
{
"id": "<string>",
"name": "<string>",
"category": "<string>",
"logoURI": "<string>"
}
]
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Earn
YieldGetNetworks
POST
/
rpc
/
Trails
/
YieldGetNetworks
YieldGetNetworks returns available Yield networks.
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/YieldGetNetworks \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://trails-api.sequence.app/rpc/Trails/YieldGetNetworks"
payload = {}
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({})
};
fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetNetworks', 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://trails-api.sequence.app/rpc/Trails/YieldGetNetworks",
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([
]),
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://trails-api.sequence.app/rpc/Trails/YieldGetNetworks"
payload := strings.NewReader("{}")
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://trails-api.sequence.app/rpc/Trails/YieldGetNetworks")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/YieldGetNetworks")
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 = "{}"
response = http.request(request)
puts response.read_body{
"networks": [
{
"id": "<string>",
"name": "<string>",
"category": "<string>",
"logoURI": "<string>"
}
]
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Overview
TheYieldGetNetworks endpoint returns the networks (chains) that yield providers can be queried on. Use it to populate chain pickers in earn UIs or to validate that a target chain is supported before calling YieldGetMarkets.
Request
YieldGetNetworks takes no parameters.
Response
- networks (array of
YieldNetwork):- id (string)
- name (string)
- category (string)
- logoURI (string)
Example
const response = await fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetNetworks', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY'
},
body: JSON.stringify({})
});
const { networks } = await response.json();
for (const network of networks) {
console.log(network.id, network.name);
}
Next Steps
YieldGetMarkets
List markets on a network
YieldGetProviders
List yield providers
Body
application/json
The body is of type object.
Response
OK
[]YieldNetwork
Show child attributes
Show child attributes
Was this page helpful?
⌘I