YieldCreateEnterAction returns unsigned enter-action transaction payloads.
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/YieldCreateEnterAction \
--header 'Content-Type: application/json' \
--data '
{
"earnMarketId": "<string>",
"userWalletAddress": "<string>",
"args": {
"amount": "<string>",
"amounts": [
"<string>"
],
"validatorAddress": "<string>",
"validatorAddresses": [
"<string>"
],
"providerId": "<string>",
"duration": 123,
"inputToken": "<string>",
"inputTokenNetwork": "<string>",
"outputToken": "<string>",
"outputTokenNetwork": "<string>",
"subnetId": 123,
"tronResource": "<string>",
"feeConfigurationId": "<string>",
"cosmosPubKey": "<string>",
"tezosPubKey": "<string>",
"cAddressBech": "<string>",
"pAddressBech": "<string>",
"executionMode": "<string>",
"ledgerWalletApiCompatible": true,
"useMaxAmount": true,
"useInstantExecution": true,
"skipPrechecks": true,
"useMaxAllowance": true,
"feePayerAddress": "<string>",
"receiverAddress": "<string>",
"rangeMin": "<string>",
"rangeMax": "<string>",
"percentage": 123,
"tokenId": "<string>"
}
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/YieldCreateEnterAction"
payload = {
"earnMarketId": "<string>",
"userWalletAddress": "<string>",
"args": {
"amount": "<string>",
"amounts": ["<string>"],
"validatorAddress": "<string>",
"validatorAddresses": ["<string>"],
"providerId": "<string>",
"duration": 123,
"inputToken": "<string>",
"inputTokenNetwork": "<string>",
"outputToken": "<string>",
"outputTokenNetwork": "<string>",
"subnetId": 123,
"tronResource": "<string>",
"feeConfigurationId": "<string>",
"cosmosPubKey": "<string>",
"tezosPubKey": "<string>",
"cAddressBech": "<string>",
"pAddressBech": "<string>",
"executionMode": "<string>",
"ledgerWalletApiCompatible": True,
"useMaxAmount": True,
"useInstantExecution": True,
"skipPrechecks": True,
"useMaxAllowance": True,
"feePayerAddress": "<string>",
"receiverAddress": "<string>",
"rangeMin": "<string>",
"rangeMax": "<string>",
"percentage": 123,
"tokenId": "<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({
earnMarketId: '<string>',
userWalletAddress: '<string>',
args: {
amount: '<string>',
amounts: ['<string>'],
validatorAddress: '<string>',
validatorAddresses: ['<string>'],
providerId: '<string>',
duration: 123,
inputToken: '<string>',
inputTokenNetwork: '<string>',
outputToken: '<string>',
outputTokenNetwork: '<string>',
subnetId: 123,
tronResource: '<string>',
feeConfigurationId: '<string>',
cosmosPubKey: '<string>',
tezosPubKey: '<string>',
cAddressBech: '<string>',
pAddressBech: '<string>',
executionMode: '<string>',
ledgerWalletApiCompatible: true,
useMaxAmount: true,
useInstantExecution: true,
skipPrechecks: true,
useMaxAllowance: true,
feePayerAddress: '<string>',
receiverAddress: '<string>',
rangeMin: '<string>',
rangeMax: '<string>',
percentage: 123,
tokenId: '<string>'
}
})
};
fetch('https://trails-api.sequence.app/rpc/Trails/YieldCreateEnterAction', 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/YieldCreateEnterAction",
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([
'earnMarketId' => '<string>',
'userWalletAddress' => '<string>',
'args' => [
'amount' => '<string>',
'amounts' => [
'<string>'
],
'validatorAddress' => '<string>',
'validatorAddresses' => [
'<string>'
],
'providerId' => '<string>',
'duration' => 123,
'inputToken' => '<string>',
'inputTokenNetwork' => '<string>',
'outputToken' => '<string>',
'outputTokenNetwork' => '<string>',
'subnetId' => 123,
'tronResource' => '<string>',
'feeConfigurationId' => '<string>',
'cosmosPubKey' => '<string>',
'tezosPubKey' => '<string>',
'cAddressBech' => '<string>',
'pAddressBech' => '<string>',
'executionMode' => '<string>',
'ledgerWalletApiCompatible' => true,
'useMaxAmount' => true,
'useInstantExecution' => true,
'skipPrechecks' => true,
'useMaxAllowance' => true,
'feePayerAddress' => '<string>',
'receiverAddress' => '<string>',
'rangeMin' => '<string>',
'rangeMax' => '<string>',
'percentage' => 123,
'tokenId' => '<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/YieldCreateEnterAction"
payload := strings.NewReader("{\n \"earnMarketId\": \"<string>\",\n \"userWalletAddress\": \"<string>\",\n \"args\": {\n \"amount\": \"<string>\",\n \"amounts\": [\n \"<string>\"\n ],\n \"validatorAddress\": \"<string>\",\n \"validatorAddresses\": [\n \"<string>\"\n ],\n \"providerId\": \"<string>\",\n \"duration\": 123,\n \"inputToken\": \"<string>\",\n \"inputTokenNetwork\": \"<string>\",\n \"outputToken\": \"<string>\",\n \"outputTokenNetwork\": \"<string>\",\n \"subnetId\": 123,\n \"tronResource\": \"<string>\",\n \"feeConfigurationId\": \"<string>\",\n \"cosmosPubKey\": \"<string>\",\n \"tezosPubKey\": \"<string>\",\n \"cAddressBech\": \"<string>\",\n \"pAddressBech\": \"<string>\",\n \"executionMode\": \"<string>\",\n \"ledgerWalletApiCompatible\": true,\n \"useMaxAmount\": true,\n \"useInstantExecution\": true,\n \"skipPrechecks\": true,\n \"useMaxAllowance\": true,\n \"feePayerAddress\": \"<string>\",\n \"receiverAddress\": \"<string>\",\n \"rangeMin\": \"<string>\",\n \"rangeMax\": \"<string>\",\n \"percentage\": 123,\n \"tokenId\": \"<string>\"\n }\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/YieldCreateEnterAction")
.header("Content-Type", "application/json")
.body("{\n \"earnMarketId\": \"<string>\",\n \"userWalletAddress\": \"<string>\",\n \"args\": {\n \"amount\": \"<string>\",\n \"amounts\": [\n \"<string>\"\n ],\n \"validatorAddress\": \"<string>\",\n \"validatorAddresses\": [\n \"<string>\"\n ],\n \"providerId\": \"<string>\",\n \"duration\": 123,\n \"inputToken\": \"<string>\",\n \"inputTokenNetwork\": \"<string>\",\n \"outputToken\": \"<string>\",\n \"outputTokenNetwork\": \"<string>\",\n \"subnetId\": 123,\n \"tronResource\": \"<string>\",\n \"feeConfigurationId\": \"<string>\",\n \"cosmosPubKey\": \"<string>\",\n \"tezosPubKey\": \"<string>\",\n \"cAddressBech\": \"<string>\",\n \"pAddressBech\": \"<string>\",\n \"executionMode\": \"<string>\",\n \"ledgerWalletApiCompatible\": true,\n \"useMaxAmount\": true,\n \"useInstantExecution\": true,\n \"skipPrechecks\": true,\n \"useMaxAllowance\": true,\n \"feePayerAddress\": \"<string>\",\n \"receiverAddress\": \"<string>\",\n \"rangeMin\": \"<string>\",\n \"rangeMax\": \"<string>\",\n \"percentage\": 123,\n \"tokenId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/YieldCreateEnterAction")
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 \"earnMarketId\": \"<string>\",\n \"userWalletAddress\": \"<string>\",\n \"args\": {\n \"amount\": \"<string>\",\n \"amounts\": [\n \"<string>\"\n ],\n \"validatorAddress\": \"<string>\",\n \"validatorAddresses\": [\n \"<string>\"\n ],\n \"providerId\": \"<string>\",\n \"duration\": 123,\n \"inputToken\": \"<string>\",\n \"inputTokenNetwork\": \"<string>\",\n \"outputToken\": \"<string>\",\n \"outputTokenNetwork\": \"<string>\",\n \"subnetId\": 123,\n \"tronResource\": \"<string>\",\n \"feeConfigurationId\": \"<string>\",\n \"cosmosPubKey\": \"<string>\",\n \"tezosPubKey\": \"<string>\",\n \"cAddressBech\": \"<string>\",\n \"pAddressBech\": \"<string>\",\n \"executionMode\": \"<string>\",\n \"ledgerWalletApiCompatible\": true,\n \"useMaxAmount\": true,\n \"useInstantExecution\": true,\n \"skipPrechecks\": true,\n \"useMaxAllowance\": true,\n \"feePayerAddress\": \"<string>\",\n \"receiverAddress\": \"<string>\",\n \"rangeMin\": \"<string>\",\n \"rangeMax\": \"<string>\",\n \"percentage\": 123,\n \"tokenId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"action": {
"id": "<string>",
"intent": "<string>",
"type": "<string>",
"yieldId": "<string>",
"address": "<string>",
"transactions": [
{
"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
}
],
"executionPattern": "<string>",
"createdAt": "<string>",
"status": "<string>",
"amount": "<string>",
"amountRaw": "<string>",
"amountUsd": "<string>",
"rawArguments": {
"amount": "<string>",
"amounts": [
"<string>"
],
"validatorAddress": "<string>",
"validatorAddresses": [
"<string>"
],
"providerId": "<string>",
"duration": 123,
"inputToken": "<string>",
"inputTokenNetwork": "<string>",
"outputToken": "<string>",
"outputTokenNetwork": "<string>",
"subnetId": 123,
"tronResource": "<string>",
"feeConfigurationId": "<string>",
"cosmosPubKey": "<string>",
"tezosPubKey": "<string>",
"cAddressBech": "<string>",
"pAddressBech": "<string>",
"executionMode": "<string>",
"ledgerWalletApiCompatible": true,
"useMaxAmount": true,
"useInstantExecution": true,
"skipPrechecks": true,
"useMaxAllowance": true,
"feePayerAddress": "<string>",
"receiverAddress": "<string>",
"rangeMin": "<string>",
"rangeMax": "<string>",
"percentage": 123,
"tokenId": "<string>"
},
"completedAt": "<string>"
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Earn
YieldCreateEnterAction
Generate unsigned deposit transaction calldata for a DeFi yield market
POST
/
rpc
/
Trails
/
YieldCreateEnterAction
YieldCreateEnterAction returns unsigned enter-action transaction payloads.
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/YieldCreateEnterAction \
--header 'Content-Type: application/json' \
--data '
{
"earnMarketId": "<string>",
"userWalletAddress": "<string>",
"args": {
"amount": "<string>",
"amounts": [
"<string>"
],
"validatorAddress": "<string>",
"validatorAddresses": [
"<string>"
],
"providerId": "<string>",
"duration": 123,
"inputToken": "<string>",
"inputTokenNetwork": "<string>",
"outputToken": "<string>",
"outputTokenNetwork": "<string>",
"subnetId": 123,
"tronResource": "<string>",
"feeConfigurationId": "<string>",
"cosmosPubKey": "<string>",
"tezosPubKey": "<string>",
"cAddressBech": "<string>",
"pAddressBech": "<string>",
"executionMode": "<string>",
"ledgerWalletApiCompatible": true,
"useMaxAmount": true,
"useInstantExecution": true,
"skipPrechecks": true,
"useMaxAllowance": true,
"feePayerAddress": "<string>",
"receiverAddress": "<string>",
"rangeMin": "<string>",
"rangeMax": "<string>",
"percentage": 123,
"tokenId": "<string>"
}
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/YieldCreateEnterAction"
payload = {
"earnMarketId": "<string>",
"userWalletAddress": "<string>",
"args": {
"amount": "<string>",
"amounts": ["<string>"],
"validatorAddress": "<string>",
"validatorAddresses": ["<string>"],
"providerId": "<string>",
"duration": 123,
"inputToken": "<string>",
"inputTokenNetwork": "<string>",
"outputToken": "<string>",
"outputTokenNetwork": "<string>",
"subnetId": 123,
"tronResource": "<string>",
"feeConfigurationId": "<string>",
"cosmosPubKey": "<string>",
"tezosPubKey": "<string>",
"cAddressBech": "<string>",
"pAddressBech": "<string>",
"executionMode": "<string>",
"ledgerWalletApiCompatible": True,
"useMaxAmount": True,
"useInstantExecution": True,
"skipPrechecks": True,
"useMaxAllowance": True,
"feePayerAddress": "<string>",
"receiverAddress": "<string>",
"rangeMin": "<string>",
"rangeMax": "<string>",
"percentage": 123,
"tokenId": "<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({
earnMarketId: '<string>',
userWalletAddress: '<string>',
args: {
amount: '<string>',
amounts: ['<string>'],
validatorAddress: '<string>',
validatorAddresses: ['<string>'],
providerId: '<string>',
duration: 123,
inputToken: '<string>',
inputTokenNetwork: '<string>',
outputToken: '<string>',
outputTokenNetwork: '<string>',
subnetId: 123,
tronResource: '<string>',
feeConfigurationId: '<string>',
cosmosPubKey: '<string>',
tezosPubKey: '<string>',
cAddressBech: '<string>',
pAddressBech: '<string>',
executionMode: '<string>',
ledgerWalletApiCompatible: true,
useMaxAmount: true,
useInstantExecution: true,
skipPrechecks: true,
useMaxAllowance: true,
feePayerAddress: '<string>',
receiverAddress: '<string>',
rangeMin: '<string>',
rangeMax: '<string>',
percentage: 123,
tokenId: '<string>'
}
})
};
fetch('https://trails-api.sequence.app/rpc/Trails/YieldCreateEnterAction', 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/YieldCreateEnterAction",
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([
'earnMarketId' => '<string>',
'userWalletAddress' => '<string>',
'args' => [
'amount' => '<string>',
'amounts' => [
'<string>'
],
'validatorAddress' => '<string>',
'validatorAddresses' => [
'<string>'
],
'providerId' => '<string>',
'duration' => 123,
'inputToken' => '<string>',
'inputTokenNetwork' => '<string>',
'outputToken' => '<string>',
'outputTokenNetwork' => '<string>',
'subnetId' => 123,
'tronResource' => '<string>',
'feeConfigurationId' => '<string>',
'cosmosPubKey' => '<string>',
'tezosPubKey' => '<string>',
'cAddressBech' => '<string>',
'pAddressBech' => '<string>',
'executionMode' => '<string>',
'ledgerWalletApiCompatible' => true,
'useMaxAmount' => true,
'useInstantExecution' => true,
'skipPrechecks' => true,
'useMaxAllowance' => true,
'feePayerAddress' => '<string>',
'receiverAddress' => '<string>',
'rangeMin' => '<string>',
'rangeMax' => '<string>',
'percentage' => 123,
'tokenId' => '<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/YieldCreateEnterAction"
payload := strings.NewReader("{\n \"earnMarketId\": \"<string>\",\n \"userWalletAddress\": \"<string>\",\n \"args\": {\n \"amount\": \"<string>\",\n \"amounts\": [\n \"<string>\"\n ],\n \"validatorAddress\": \"<string>\",\n \"validatorAddresses\": [\n \"<string>\"\n ],\n \"providerId\": \"<string>\",\n \"duration\": 123,\n \"inputToken\": \"<string>\",\n \"inputTokenNetwork\": \"<string>\",\n \"outputToken\": \"<string>\",\n \"outputTokenNetwork\": \"<string>\",\n \"subnetId\": 123,\n \"tronResource\": \"<string>\",\n \"feeConfigurationId\": \"<string>\",\n \"cosmosPubKey\": \"<string>\",\n \"tezosPubKey\": \"<string>\",\n \"cAddressBech\": \"<string>\",\n \"pAddressBech\": \"<string>\",\n \"executionMode\": \"<string>\",\n \"ledgerWalletApiCompatible\": true,\n \"useMaxAmount\": true,\n \"useInstantExecution\": true,\n \"skipPrechecks\": true,\n \"useMaxAllowance\": true,\n \"feePayerAddress\": \"<string>\",\n \"receiverAddress\": \"<string>\",\n \"rangeMin\": \"<string>\",\n \"rangeMax\": \"<string>\",\n \"percentage\": 123,\n \"tokenId\": \"<string>\"\n }\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/YieldCreateEnterAction")
.header("Content-Type", "application/json")
.body("{\n \"earnMarketId\": \"<string>\",\n \"userWalletAddress\": \"<string>\",\n \"args\": {\n \"amount\": \"<string>\",\n \"amounts\": [\n \"<string>\"\n ],\n \"validatorAddress\": \"<string>\",\n \"validatorAddresses\": [\n \"<string>\"\n ],\n \"providerId\": \"<string>\",\n \"duration\": 123,\n \"inputToken\": \"<string>\",\n \"inputTokenNetwork\": \"<string>\",\n \"outputToken\": \"<string>\",\n \"outputTokenNetwork\": \"<string>\",\n \"subnetId\": 123,\n \"tronResource\": \"<string>\",\n \"feeConfigurationId\": \"<string>\",\n \"cosmosPubKey\": \"<string>\",\n \"tezosPubKey\": \"<string>\",\n \"cAddressBech\": \"<string>\",\n \"pAddressBech\": \"<string>\",\n \"executionMode\": \"<string>\",\n \"ledgerWalletApiCompatible\": true,\n \"useMaxAmount\": true,\n \"useInstantExecution\": true,\n \"skipPrechecks\": true,\n \"useMaxAllowance\": true,\n \"feePayerAddress\": \"<string>\",\n \"receiverAddress\": \"<string>\",\n \"rangeMin\": \"<string>\",\n \"rangeMax\": \"<string>\",\n \"percentage\": 123,\n \"tokenId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/YieldCreateEnterAction")
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 \"earnMarketId\": \"<string>\",\n \"userWalletAddress\": \"<string>\",\n \"args\": {\n \"amount\": \"<string>\",\n \"amounts\": [\n \"<string>\"\n ],\n \"validatorAddress\": \"<string>\",\n \"validatorAddresses\": [\n \"<string>\"\n ],\n \"providerId\": \"<string>\",\n \"duration\": 123,\n \"inputToken\": \"<string>\",\n \"inputTokenNetwork\": \"<string>\",\n \"outputToken\": \"<string>\",\n \"outputTokenNetwork\": \"<string>\",\n \"subnetId\": 123,\n \"tronResource\": \"<string>\",\n \"feeConfigurationId\": \"<string>\",\n \"cosmosPubKey\": \"<string>\",\n \"tezosPubKey\": \"<string>\",\n \"cAddressBech\": \"<string>\",\n \"pAddressBech\": \"<string>\",\n \"executionMode\": \"<string>\",\n \"ledgerWalletApiCompatible\": true,\n \"useMaxAmount\": true,\n \"useInstantExecution\": true,\n \"skipPrechecks\": true,\n \"useMaxAllowance\": true,\n \"feePayerAddress\": \"<string>\",\n \"receiverAddress\": \"<string>\",\n \"rangeMin\": \"<string>\",\n \"rangeMax\": \"<string>\",\n \"percentage\": 123,\n \"tokenId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"action": {
"id": "<string>",
"intent": "<string>",
"type": "<string>",
"yieldId": "<string>",
"address": "<string>",
"transactions": [
{
"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
}
],
"executionPattern": "<string>",
"createdAt": "<string>",
"status": "<string>",
"amount": "<string>",
"amountRaw": "<string>",
"amountUsd": "<string>",
"rawArguments": {
"amount": "<string>",
"amounts": [
"<string>"
],
"validatorAddress": "<string>",
"validatorAddresses": [
"<string>"
],
"providerId": "<string>",
"duration": 123,
"inputToken": "<string>",
"inputTokenNetwork": "<string>",
"outputToken": "<string>",
"outputTokenNetwork": "<string>",
"subnetId": 123,
"tronResource": "<string>",
"feeConfigurationId": "<string>",
"cosmosPubKey": "<string>",
"tezosPubKey": "<string>",
"cAddressBech": "<string>",
"pAddressBech": "<string>",
"executionMode": "<string>",
"ledgerWalletApiCompatible": true,
"useMaxAmount": true,
"useInstantExecution": true,
"skipPrechecks": true,
"useMaxAllowance": true,
"feePayerAddress": "<string>",
"receiverAddress": "<string>",
"rangeMin": "<string>",
"rangeMax": "<string>",
"percentage": 123,
"tokenId": "<string>"
},
"completedAt": "<string>"
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Overview
YieldCreateEnterAction returns the unsigned transaction payload needed to deposit into a DeFi yield market. This is the low-level endpoint that backs the lend and deposit composable actions in the SDK.
Use this endpoint when building custom DeFi UIs outside React, or when you need to construct the calldata manually before passing it to Trails via the to.calldata param on QuoteIntent.
For React apps, use the lend() or deposit() action builders with useTrailsSendTransaction — they call this endpoint internally.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
earnMarketId | string | Yes | Market ID from YieldGetMarkets |
userWalletAddress | string | Yes | Address of the depositing wallet |
args | object | No | Market-specific arguments (varies by protocol) |
Response
Returnspayload containing unsigned transaction data:
| Field | Description |
|---|---|
transactions | Array of transaction objects to execute |
transactions[].to | Contract address |
transactions[].data | ABI-encoded calldata |
transactions[].value | ETH value (for native token deposits) |
Examples
Build a deposit calldata for Aave
const response = 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 { payload } = await response.json()
const action = JSON.parse(payload)
// Pass action.transactions[0].data to QuoteIntent as to.calldata
With protocol-specific arguments
Some markets accept additional arguments (e.g. slippage, referral codes):const response = 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: 'ethereum-usdc-morpho-0x...',
userWalletAddress: '0xYourWalletAddress',
args: {
referralCode: 0,
},
}),
})
SDK alternative
For React, use thelend or deposit builders with useTrailsSendTransaction:
import { useTrailsSendTransaction, lend, deposit } from '0xtrails'
const { sendTransaction } = useTrailsSendTransaction({
actions: [
lend({ marketId: 'base-usdc-aave-v3-lending', amount: '100' }),
],
})
See also
- YieldCreateExitAction — Withdraw from a position
- YieldGetMarkets — Discover market IDs
- Composable Actions — SDK builders for DeFi deposits
Was this page helpful?
⌘I