YieldSubmitTransactionHash reports a broadcast transaction hash to Yield for lifecycle tracking.
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash \
--header 'Content-Type: application/json' \
--data '
{
"transactionId": "<string>",
"transactionHash": "<string>"
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash"
payload = {
"transactionId": "<string>",
"transactionHash": "<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({transactionId: '<string>', transactionHash: '<string>'})
};
fetch('https://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash', 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/YieldSubmitTransactionHash",
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([
'transactionId' => '<string>',
'transactionHash' => '<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://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash"
payload := strings.NewReader("{\n \"transactionId\": \"<string>\",\n \"transactionHash\": \"<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://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash")
.header("Content-Type", "application/json")
.body("{\n \"transactionId\": \"<string>\",\n \"transactionHash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash")
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 \"transactionId\": \"<string>\",\n \"transactionHash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"transaction": {
"id": "<string>",
"title": "<string>",
"network": "<string>",
"status": "<string>",
"type": "<string>",
"createdAt": "<string>",
"hash": "<string>",
"broadcastedAt": "<string>",
"signedTransaction": "<string>",
"unsignedTransaction": {},
"annotatedTransaction": {},
"structuredTransaction": {},
"stepIndex": 123,
"description": "<string>",
"error": "<string>",
"gasEstimate": "<string>",
"explorerUrl": "<string>",
"isMessage": true
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Earn
YieldSubmitTransactionHash
Report the on-chain hash of a broadcast Yield deposit or withdrawal transaction
POST
/
rpc
/
Trails
/
YieldSubmitTransactionHash
YieldSubmitTransactionHash reports a broadcast transaction hash to Yield for lifecycle tracking.
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash \
--header 'Content-Type: application/json' \
--data '
{
"transactionId": "<string>",
"transactionHash": "<string>"
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash"
payload = {
"transactionId": "<string>",
"transactionHash": "<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({transactionId: '<string>', transactionHash: '<string>'})
};
fetch('https://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash', 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/YieldSubmitTransactionHash",
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([
'transactionId' => '<string>',
'transactionHash' => '<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://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash"
payload := strings.NewReader("{\n \"transactionId\": \"<string>\",\n \"transactionHash\": \"<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://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash")
.header("Content-Type", "application/json")
.body("{\n \"transactionId\": \"<string>\",\n \"transactionHash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash")
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 \"transactionId\": \"<string>\",\n \"transactionHash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"transaction": {
"id": "<string>",
"title": "<string>",
"network": "<string>",
"status": "<string>",
"type": "<string>",
"createdAt": "<string>",
"hash": "<string>",
"broadcastedAt": "<string>",
"signedTransaction": "<string>",
"unsignedTransaction": {},
"annotatedTransaction": {},
"structuredTransaction": {},
"stepIndex": 123,
"description": "<string>",
"error": "<string>",
"gasEstimate": "<string>",
"explorerUrl": "<string>",
"isMessage": true
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Overview
YieldSubmitTransactionHash reports the on-chain transaction hash of a broadcast Yield action back to Trails’ upstream Yield provider so it can advance lifecycle tracking and discover the resulting position in aggregate balance queries.
Yield actions are constructed through YieldCreateEnterAction and YieldCreateExitAction, then signed and broadcast by the client. This endpoint is how the client hands the resulting hash back to Trails so the position shows up in YieldGetBalances.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
transactionId | string | Yes | Yield transaction ID returned in the YieldAction payload from YieldCreateEnterAction / YieldCreateExitAction |
transactionHash | string | Yes | On-chain hash of the broadcast transaction |
InvalidArgument if empty.
Response
- transaction (
YieldTransaction): The updated Yield transaction record.
Example
// Step 1: Build the deposit action
const actionResponse = await fetch('https://trails-api.sequence.app/rpc/Trails/YieldCreateEnterAction', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY',
},
body: JSON.stringify({
earnMarketId: 'base-usdc-aave-v3-lending',
userWalletAddress: '0xYourWalletAddress',
}),
})
const { action } = await actionResponse.json()
const { transactions } = JSON.parse(action.payload)
// Step 2: Sign and broadcast on-chain
const hash = await walletClient.sendTransaction({
to: transactions[0].to,
data: transactions[0].data,
value: BigInt(transactions[0].value ?? 0),
})
// Step 3: Report the broadcast hash back to Yield
await fetch('https://trails-api.sequence.app/rpc/Trails/YieldSubmitTransactionHash', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY',
},
body: JSON.stringify({
transactionId: action.transactionId,
transactionHash: hash,
}),
})
Errors
| Error | When |
|---|---|
InvalidArgument | transactionId or transactionHash is missing/empty |
Unavailable | The Yield provider is not configured on this deployment |
See also
- YieldCreateEnterAction — Build a deposit action
- YieldCreateExitAction — Build a withdrawal action
- YieldGetBalances — Read aggregate Yield balances
Was this page helpful?