Smart Contract Call
Use the Tachyon Relay API to interact with smart contracts across multiple blockchains. The /api/submit-tx endpoint supports EVM, Solana, Aptos, Sui, and NEAR, enabling a unified interface for submitting encoded contract calls through the Tachyon network.
Chain Examples
EVM Chains (Ethereum, Base, Polygon, etc.)
REST API
Using REST API
Code Example
curl -X POST https://api.tachyon.rath.fi/api/submit-tx \
-H "apikey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chainId": 8453,
"to": "0xA7A833e6641D7901F30EaD6f27d4Ee2C9bb670a7",
"value": "0",
"callData": "0xc3a9b1c50000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001348656c6c6f2066726f6d2054616368796f6e2100000000000000000000000000",
"label": "Hello From Tachyon Call"
}'Response:
{ "txId": "68fa3450539a3c9d28bbca33" }Step-by-Step Instructions
-
Obtain your API key from the Tachyon dashboard at https://api.tachyon.rath.fi
-
Prepare your contract call data:
- Identify the target contract address (
to) - Encode your function call into
callData(see SDK example for encoding details) - Determine the
chainIdfor your target network (e.g., 8453 for Base, 1 for Ethereum)
- Identify the target contract address (
-
Set the transaction value:
- Use
"0"for non-payable functions - Specify the amount in wei as a string for payable functions
- Use
-
Make the API request:
- Send a POST request to
https://api.tachyon.rath.fi/api/submit-tx - Include your API key in the api-key header as
YOUR_API_KEY - Set Content-Type header to
application/json
- Send a POST request to
-
Handle the response:
- Extract the
txIdfrom the response - Use this
txIdto track your transaction status
- Extract the
API Parameters
The RelayParams object defines the parameters required when calling the relay() method.
| Name | Type | Required | Description |
|---|---|---|---|
chainId | number | Yes | The blockchain network ID where the transaction will be executed. Must be a supported chain. |
to | string | Yes | The recipient wallet address or smart contract address. Format varies by chain (hex for EVM, base58 for Solana, named for NEAR). |
callData | string | Yes | Encoded transaction data in hexadecimal format (use ‘0x’ for simple transfers). |
value | string | No | Amount of native currency to send in the smallest unit (wei for EVM, lamports for Solana, yoctoNEAR for NEAR). Defaults to ‘0’ if not specified. |
label | string | No | Optional human-readable label for easier transaction identification and tracking. |
gasLimit | string | No | Optional gas limit for the transaction. If not specified, it will be estimated automatically. |
gasPrice | string | No | Gas price for legacy transactions. Cannot be used with maxFeePerGas or maxPriorityFeePerGas. |
maxFeePerGas | string | No | Maximum fee per gas for EIP-1559 transactions. Must be used together with maxPriorityFeePerGas. |
maxPriorityFeePerGas | string | No | Maximum priority fee per gas for EIP-1559 transactions. Must be used together with maxFeePerGas. |
maxUSD | number | No | Maximum cost in USD that you’re willing to pay for this transaction. |
retries | number | No | Number of retry attempts for the transaction. Defaults to 0. |
shouldBatchInMulticall | boolean | No | Whether to batch this transaction in a multicall operation. |
isAuthenticatedTx | boolean | No | Enable authenticated relay mode for additional security and verification. Defaults to false. |
derivationPath | string | No | Optional HD wallet derivation path for transaction signing (useful for multi-account setups). |
transactionType | "flash" | "authenticated" | "funding-signed" | "flash-blocks" | No | Type of relay transaction. Defaults to "flash". "flash-blocks" is only supported on Base (8453) and Base Sepolia (84532). |
authorizationList | AuthorizationListItem[] | No | Optional list of authorization entries for delegated transactions or batched operations. Cannot be used with "flash-blocks" transaction type. |
Transaction Lifecycle
After submitting your transaction through either the REST API or SDK:
- Submission: The
/api/submit-txendpoint returns a uniquetxId - Queued: Transaction enters the relay queue with
NOT_PICKED_UPstatus - Processing: A relay node picks up and broadcasts the transaction to the blockchain
- Executed: Transaction gets confirmed on-chain; execution hash becomes available
You can use the txId to query the transaction status and retrieve the execution hash once confirmed.
Summary
The Tachyon Relay API provides a simple, unified interface for interacting with smart contracts across multiple blockchain networks. Whether you’re using the REST API for direct HTTP calls or the TypeScript SDK for type-safe integration, the process remains straightforward: encode your contract call, submit it to the relay, and track it using the returned transaction ID.