Execute a Chain Transaction
Use this endpoint to broadcast a state-changing transaction to an EVM-compatible chain. This is ideal for performing actions like token transfers, contract interactions, or submitting signed transactions. The transaction is signed by an FSCO wallet and sent on-chain.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure:
- You have a valid FSCO
walletId
- Your transaction is correctly encoded as
txData
(RLP or calldata) - The wallet has sufficient native tokens to cover gas
Endpoint
Section titled “Endpoint”POST /v2/chain/execute
Request Parameters
Section titled “Request Parameters”{ "txData": "0xabcdef...", "chainId": 137, "walletId": "wallet-uuid", "sentAt": "2025-05-08T12:00:00Z"}
txData
: RLP-encoded transaction data (or raw calldata if unsigned)chainId
: Numeric EVM chain ID (e.g. 1 for Ethereum, 137 for Polygon)walletId
: ID of the FSCO wallet that will sign and send the transactionsentAt
: ISO timestamp marking submission time
Example Request
Section titled “Example Request”curl -X POST https://api.fsco.io/v2/chain/execute \ -H "Authorization: Bearer $FSCO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "txData": "0xabcdef...", "chainId": 137, "walletId": "wallet-uuid", "sentAt": "2025-05-08T12:00:00Z" }'
import axios from 'axios';
const FSCO_API_KEY = process.env.FSCO_API_KEY;
const executeTransaction = async () => { const response = await axios.post( 'https://api.fsco.io/v2/chain/execute', { txData: '0xabcdef...', chainId: 137, walletId: 'wallet-uuid', sentAt: '2025-05-08T12:00:00Z' }, { headers: { Authorization: `Bearer ${FSCO_API_KEY}`, 'Content-Type': 'application/json' } } );
console.log('Transaction executed:', response.data);};
executeTransaction();
import requestsimport os
FSCO_API_KEY = os.getenv("FSCO_API_KEY")
headers = { "Authorization": f"Bearer {FSCO_API_KEY}", "Content-Type": "application/json",}
payload = { "txData": "0xabcdef...", "chainId": 137, "walletId": "wallet-uuid", "sentAt": "2025-05-08T12:00:00Z",}
response = requests.post( "https://api.fsco.io/v2/chain/execute", json=payload, headers=headers)
print("Transaction executed:", response.json())
using System;using System.Net.Http;using System.Net.Http.Headers;using System.Text;using System.Threading.Tasks;
class Program{ static async Task Main() { var apiKey = Environment.GetEnvironmentVariable("FSCO_API_KEY");
var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
var json = @"{ ""txData"": ""0xabcdef..."", ""chainId"": 137, ""walletId"": ""wallet-uuid"", ""sentAt"": ""2025-05-08T12:00:00Z"" }"; var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.fsco.io/v2/chain/execute", content); var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine("Transaction executed: " + responseString); }}
Response
Section titled “Response”{ "queryId": "uuid-string"}
The response contains a queryId
which uniquely identifies the transaction within FSCO. You can use this to retrieve the transaction later or monitor its status.
Next Steps
Section titled “Next Steps”- Call a contract method to interact with smart contracts
- Get transaction by ID to check transaction status using the FSCO queryId
- Get transaction by hash to look up transaction details using the on-chain hash
- Learn more in the Chain module overview
- View the complete Chain API reference