GetProtocolContracts returns Trails contract addresses used by the Trails Intents stack for the given protocol.
curl --request POST \
--url https://api.example.com/rpc/Trails/GetProtocolContracts \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.example.com/rpc/Trails/GetProtocolContracts"
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://api.example.com/rpc/Trails/GetProtocolContracts', 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.example.com/rpc/Trails/GetProtocolContracts",
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://api.example.com/rpc/Trails/GetProtocolContracts"
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://api.example.com/rpc/Trails/GetProtocolContracts")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/rpc/Trails/GetProtocolContracts")
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{
"TrailsContracts": {
"trailsIntentEntrypointAddress": "<string>",
"trailsRouterAddress": "<string>",
"trailsRouterShimAddress": "<string>",
"trailsUtilsAddress": "<string>"
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Protocol
GetProtocolContracts
POST
/
rpc
/
Trails
/
GetProtocolContracts
GetProtocolContracts returns Trails contract addresses used by the Trails Intents stack for the given protocol.
curl --request POST \
--url https://api.example.com/rpc/Trails/GetProtocolContracts \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.example.com/rpc/Trails/GetProtocolContracts"
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://api.example.com/rpc/Trails/GetProtocolContracts', 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.example.com/rpc/Trails/GetProtocolContracts",
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://api.example.com/rpc/Trails/GetProtocolContracts"
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://api.example.com/rpc/Trails/GetProtocolContracts")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/rpc/Trails/GetProtocolContracts")
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{
"TrailsContracts": {
"trailsIntentEntrypointAddress": "<string>",
"trailsRouterAddress": "<string>",
"trailsRouterShimAddress": "<string>",
"trailsUtilsAddress": "<string>"
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Overview
GetProtocolContracts returns the deployed Trails contract addresses for a given intent-protocol version. Use it when a client needs the router / entrypoint / router-shim / utils addresses for the version it is about to commit an intent against, instead of hardcoding an address that may drift when a new protocol version rolls out.
This replaces the deprecated
GetTrailsContracts endpoint. GetProtocolContracts accepts an explicit intentProtocol parameter, so a single client can serve multiple protocol versions concurrently.Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
intentProtocol | IntentProtocolVersion | No | Protocol version to resolve contracts for. Values: v1, v1_5. Defaults to the API’s current default when omitted. |
Response
- TrailsContracts (object)
- trailsIntentEntrypointAddress (string)
- trailsRouterAddress (string)
- trailsRouterShimAddress (string)
- trailsUtilsAddress (string)
Example
const response = await fetch(
'https://trails-api.sequence.app/rpc/Trails/GetProtocolContracts',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY',
},
body: JSON.stringify({ intentProtocol: 'v1_5' }),
},
)
const { TrailsContracts } = await response.json()
console.log('Entrypoint:', TrailsContracts.trailsIntentEntrypointAddress)
console.log('Utils:', TrailsContracts.trailsUtilsAddress)
Next Steps
GetSupportedIntentProtocols
List every supported intent-protocol version
GetDefaultIntentProtocol
Discover the API’s current default version
Was this page helpful?