Introduction
Learn the shared relay transaction methods and lifecycle used across Tachyon-supported networks.
The Tachyon SDK provides a complete workflow for submitting transactions to the relay network, monitoring their status, and waiting for on-chain execution. Use the chain-specific pages in this section for runnable examples, then refer back here for the shared methods and lifecycle.
Methods
relay(params)
Submits a transaction to the Tachyon relay network for execution. The relay service handles gas payments and transaction submission on your behalf, returning a unique transaction ID for tracking.
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 | No 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. |
Important Notes:
gasPriceandmaxFeePerGascannot be used togethergasPriceandmaxPriorityFeePerGascannot be used together- If using EIP-1559 gas parameters, both
maxFeePerGasandmaxPriorityFeePerGasmust be provided together authorizationListis not allowed for"flash-blocks"transactions"flash-blocks"transaction type is only supported on Base (8453) and Base Sepolia (84532)
getRelayStatus(txId)
Retrieves the current status of a relay transaction, including execution details, costs, and any errors that may have occurred.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
txId | string | Yes | The transaction ID returned from the relay() method. |
Returns: Promise<RelayStatusBase> resolving to a status object containing detailed information about the transaction.
Status Object Properties:
| Property | Type | Description |
|---|---|---|
id | string | Unique transaction identifier. |
status | string | Current status (e.g., "NOT_PICKED_UP", "PENDING", "EXECUTED", "FAILED"). |
executionTxHash | string | null | On-chain transaction hash once executed, null if pending. |
costUSD | number | Estimated or actual cost of the transaction in USD. |
timestamp | string | ISO timestamp of when the transaction was submitted. |
latency | number | null | Time taken for execution in milliseconds, null if not yet executed. |
retries | number | Number of retry attempts made for this transaction. |
waitForExecutionHash(txId, timeoutMs?, pollIntervalMs?)
Polls the relay service until the transaction has been executed on-chain, returning the final transaction status with the execution hash. This method is useful when you need to wait for confirmation before proceeding with subsequent operations.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
txId | string | Yes | The transaction ID to monitor. |
timeoutMs | number | Optional | Maximum time to wait for execution in milliseconds (default: 5000ms). |
pollIntervalMs | number | Optional | Time between status checks in milliseconds (default: 50ms). |
Returns: Promise<RelayStatusBase> resolving to the completed transaction status object with the execution hash.
Throws: Will reject the promise if the timeout is reached before the transaction executes.
Transaction Lifecycle
- Submission: Call
relay()with transaction parameters to submit to the relay network. - Queued: Transaction enters the relay queue with status
"NOT_PICKED_UP". - Processing: Relay service picks up and submits the transaction on-chain.
- Executed: Transaction is confirmed on-chain and
executionTxHashbecomes available.
Example Output
After submitting a transaction and checking its status, you'll receive a response similar to this:
{
"id": "68fa3450539a3c9d28bbca33",
"userId": "68c275846a6ba1c9a2198a8c",
"to": "0x3dbE34f2C21b3B2980d4dc53f3c7E51e39663F49",
"callData": "0x",
"value": "1",
"chainId": 8453,
"gasPrice": null,
"maxFeePerGas": null,
"maxPriorityFeePerGas": null,
"gasLimit": null,
"label": "My Transaction",
"status": "NOT_PICKED_UP",
"executionTxHash": null,
"timestamp": "2025-10-23T13:57:36.672Z",
"latency": null,
"costUSD": 0.8400561743999754,
"retries": 0,
"isAccountCharged": false,
"extraData": null,
"transactionType": "flash"
}Once the transaction is executed, the executionTxHash will be populated:
Execution hash: 0x094b3e172162c1f7618397413dbcde074f7f908bc63fd8010d4e6ca40d5afa76You can use this hash to view the transaction on a block explorer or verify its execution on-chain.
Smart Contract Calls
Use the Tachyon Relay API to interact with smart contracts across multiple blockchains. The /api/submit-tx endpoint supports EVM, Solana, Aptos, Sui, NEAR, and Starknet through a unified relay flow: encode your contract call, submit it to Tachyon, then track the returned transaction ID.
Use the chain-specific pages in this section for runnable SDK and REST examples.
SDK Step-by-Step Instructions
- Install the required dependencies:
npm install @rathfi/tachyon ethers-
Import the necessary modules:
- Import
TachyonandChainIdfrom@rathfi/tachyon. - Import the chain-specific encoding library, such as
ethersfor EVM calldata.
- Import
-
Initialize the Tachyon SDK:
- Create a new
Tachyoninstance. - Pass your API key in the configuration object:
{ apiKey: 'YOUR_API_KEY' }.
- Create a new
-
Define the contract call:
- For EVM, define the ABI function signature.
- For non-EVM chains, build the chain-specific payload required by that runtime.
-
Encode the function call:
- Convert the function call into
callData. - For EVM, use
ethers.Interface.encodeFunctionData(). - For Aptos, Sui, NEAR, Solana, and Starknet, use the chain-specific payload encoding shown in the child pages.
- Convert the function call into
-
Submit the relay transaction:
- Call
tachyon.relay()withchainId,to,value,callData, and any optional relay parameters. - Use
awaitbecause the relay call is asynchronous.
- Call
-
Handle the transaction ID:
- The method returns a
txIdstring. - Use this ID to track transaction status through Tachyon.
- The method returns a
SDK Function Parameters
tachyon.relay(options)
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
chainId | ChainId or number | Yes | Chain identifier. Use a ChainId enum value when available, or the numeric chain ID. | ChainId.BASE or 8453 |
to | string | Yes | Target contract address. | "0xA7A833e6641D7901F30EaD6f27d4Ee2C9bb670a7" |
value | string | Yes | Native token amount in the chain's smallest unit. Use "0" for non-payable calls. | "0" |
callData | string | Yes | Encoded function call data. | Result from iface.encodeFunctionData() |
label | string | Optional | Custom transaction label. | "Say Hello Example" |
gasLimit | string | Optional | Gas limit override. | "100000" |
isAuthenticatedTx | boolean | Optional | Authenticated relay mode. | true or false |
transactionType | string | Optional | Processing type. | "flash" or "flash-blocks" |
Returns: Promise<string> - The transaction ID (txId).
REST API Step-by-Step Instructions
-
Obtain your API key from the Tachyon dashboard at
https://accounts.rath.fi. -
Prepare your contract call data:
- Identify the target contract address (
to). - Encode your function call into
callData. - Determine the
chainIdfor your target network, such as8453for Base.
- Identify the target contract address (
-
Set the transaction value:
- Use
"0"for non-payable functions. - Specify the amount as a string in the chain's smallest unit for payable functions.
- Use
-
Make the API request:
- Send a
POSTrequest tohttps://tachyon.rath.fi/api/submit-tx. - Include your API key in the
api-keyheader. - Set
Content-Typetoapplication/json.
- Send a
-
Handle the response:
- Extract the
txIdfrom the response. - Use this
txIdto track transaction status.
- Extract the
API Parameters
The RelayParams object defines the parameters used by both the SDK and REST API relay request.
| Name | Type | Required | Description |
|---|---|---|---|
chainId | number | Yes | Blockchain network ID where the transaction will be executed. Must be a supported chain. |
to | string | Yes | Recipient wallet address or smart contract address. Format varies by chain. |
callData | string | Yes | Encoded transaction data. Use '0x' only for simple transfers. |
value | string | No | Native token amount in the smallest unit. Defaults to '0' if not specified. |
label | string | No | Optional human-readable label for transaction identification and tracking. |
gasLimit | string | No | Optional gas limit. If omitted, Tachyon estimates it automatically. |
gasPrice | string | No | Legacy gas price. Cannot be used with maxFeePerGas or maxPriorityFeePerGas. |
maxFeePerGas | string | No | EIP-1559 max fee per gas. Must be used with maxPriorityFeePerGas. |
maxPriorityFeePerGas | string | No | EIP-1559 priority fee per gas. Must be used with maxFeePerGas. |
maxUSD | number | No | Maximum transaction cost in USD. |
retries | number | No | Number of retry attempts. Defaults to 0. |
shouldBatchInMulticall | boolean | No | Whether to batch this transaction in a multicall operation. |
isAuthenticatedTx | boolean | No | Enables authenticated relay mode. Defaults to false. |
derivationPath | string | No | Optional HD wallet derivation path for transaction signing. |
transactionType | "flash" | "authenticated" | "funding-signed" | "flash-blocks" | No | Relay transaction type. Defaults to "flash". |
authorizationList | AuthorizationListItem[] | No | Optional authorization entries for delegated transactions or batched operations. Cannot be used with "flash-blocks". |
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 and the execution hash becomes available.
You can use the txId to query transaction status and retrieve the execution hash once confirmed.
Summary
The Tachyon Relay API provides a unified interface for smart contract calls across multiple blockchain networks. Whether you use direct REST calls or the TypeScript SDK, the flow remains the same: encode the call, submit it to the relay, and track execution with the returned transaction ID.