cURL
curl --request POST \
--url https://api.example.com/rpc/Trails/RetryIntent \
--header 'Content-Type: application/json' \
--data '
{
"intentId": "<string>",
"depositTransactionHash": "<string>"
}
'import requests
url = "https://api.example.com/rpc/Trails/RetryIntent"
payload = {
"intentId": "<string>",
"depositTransactionHash": "<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({intentId: '<string>', depositTransactionHash: '<string>'})
};
fetch('https://api.example.com/rpc/Trails/RetryIntent', 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/RetryIntent",
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([
'intentId' => '<string>',
'depositTransactionHash' => '<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://api.example.com/rpc/Trails/RetryIntent"
payload := strings.NewReader("{\n \"intentId\": \"<string>\",\n \"depositTransactionHash\": \"<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://api.example.com/rpc/Trails/RetryIntent")
.header("Content-Type", "application/json")
.body("{\n \"intentId\": \"<string>\",\n \"depositTransactionHash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/rpc/Trails/RetryIntent")
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 \"intentId\": \"<string>\",\n \"depositTransactionHash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"intentId": "<string>",
"intentStatus": "QUOTED"
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Intents (Advanced)
RetryIntent
POST
/
rpc
/
Trails
/
RetryIntent
cURL
curl --request POST \
--url https://api.example.com/rpc/Trails/RetryIntent \
--header 'Content-Type: application/json' \
--data '
{
"intentId": "<string>",
"depositTransactionHash": "<string>"
}
'import requests
url = "https://api.example.com/rpc/Trails/RetryIntent"
payload = {
"intentId": "<string>",
"depositTransactionHash": "<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({intentId: '<string>', depositTransactionHash: '<string>'})
};
fetch('https://api.example.com/rpc/Trails/RetryIntent', 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/RetryIntent",
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([
'intentId' => '<string>',
'depositTransactionHash' => '<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://api.example.com/rpc/Trails/RetryIntent"
payload := strings.NewReader("{\n \"intentId\": \"<string>\",\n \"depositTransactionHash\": \"<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://api.example.com/rpc/Trails/RetryIntent")
.header("Content-Type", "application/json")
.body("{\n \"intentId\": \"<string>\",\n \"depositTransactionHash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/rpc/Trails/RetryIntent")
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 \"intentId\": \"<string>\",\n \"depositTransactionHash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"intentId": "<string>",
"intentStatus": "QUOTED"
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Overview
TheRetryIntent endpoint repairs a failed user-submitted deposit flow by validating a replacement deposit transaction hash, marking the deposit leg as confirmed, and requeueing downstream execution.
Use Cases
- Recover from a failed or dropped deposit transaction
- Resubmit a deposit with a corrected transaction hash
- Resume execution of an intent that failed during the deposit phase
Request Parameters
Required Fields
- intentId (string): The unique ID of the intent to retry
- depositTransactionHash (string): The transaction hash of the new or corrected deposit transaction
Response
- intentId (string): The ID of the retried intent
- intentStatus (
IntentStatus): Updated status of the intent after retry
Examples
Retry a Failed Deposit
const response = await fetch('https://trails-api.sequence.app/rpc/Trails/RetryIntent', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY'
},
body: JSON.stringify({
intentId: 'intent_abc123',
depositTransactionHash: '0xnewdeposithash...'
})
});
const { intentId, intentStatus } = await response.json();
console.log(`Intent ${intentId} is now ${intentStatus}`);
With the Trails SDK
import { TrailsClient } from '0xtrails'
const trails = new TrailsClient({ accessKey: 'YOUR_ACCESS_KEY' })
const result = await trails.retryIntent({
intentId: 'intent_abc123',
depositTransactionHash: '0xnewdeposithash...'
})
console.log('Retry result:', result.intentStatus)
The replacement deposit transaction must be confirmed on-chain before calling this endpoint. The
depositTransactionHash must correspond to a valid on-chain transaction that deposits the correct token and amount to the intent address.Next Steps
GetIntentReceipt
Check the receipt after retrying
WaitIntentReceipt
Stream updates until the intent completes
Was this page helpful?