Relay Transactions
The Tachyon SDK provides a complete workflow for submitting transactions to the relay network, monitoring their status, and waiting for on-chain execution. This guide covers the three main methods you’ll use: submitting transactions, checking their status, and waiting for confirmation.
Quick Start
EVM Chains (Ethereum, Base, Polygon, etc.)
import { Tachyon, ChainId } from '@rathfi/tachyon'
// Initialize the SDK
const tachyon = new Tachyon({
apiKey: 'API-KEY',
})
// Submit a transaction on Base
const txId = await tachyon.relay({
chainId: ChainId.BASE, // 8453
to: '0x3dbE34f2C21b3B2980d4dc53f3c7E51e39663F49',
value: '1', // 1 wei
callData: '0x',
label: 'My Base Transaction',
})
console.log('Transaction submitted with ID:', txId)
// Check transaction status
const status = await tachyon.getRelayStatus(txId)
console.log('Transaction status:', status.status)
// Wait for execution
const executedTx = await tachyon.waitForExecutionHash(txId)
console.log('Execution hash:', executedTx.executionTxHash)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"
}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). Must be a valid address for the specified chain. |
callData | string | Yes | Encoded transaction data in hexadecimal format (use ‘0x’ for simple transfers). |
value | string | No (default: '0') | Amount of native currency to send in the smallest unit (wei for EVM, lamports for Solana, yoctoNEAR for NEAR, MIST for Sui). Use ‘0’ for contract calls with no value transfer. |
label | string | No | Human-readable label for easier transaction identification and tracking. |
gasLimit | string | No | Gas limit for the transaction. If not specified, it will be estimated automatically. Required for Aptos transactions. |
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 provided together with maxPriorityFeePerGas. |
maxPriorityFeePerGas | string | No | Maximum priority fee per gas for EIP-1559 transactions. Must be provided together with maxFeePerGas. |
maxUSD | number | No | Maximum USD cost limit for the transaction. Transaction will fail if estimated cost exceeds this value. |
retries | number | No (default: 0) | Number of retry attempts for failed transactions. |
shouldBatchInMulticall | boolean | No | Whether to batch this transaction in a multicall for gas optimization. |
isAuthenticatedTx | boolean | No (default: false) | Enable authenticated relay mode for additional security and verification. |
derivationPath | string | No | HD wallet derivation path for transaction signing (useful for multi-account setups). |
transactionType | "flash" | "authenticated" | "funding-signed" | "flash-blocks" | Optional (default: "flash") | Type of relay transaction. "flash-blocks" is only supported on Base (8453) and Base Sepolia (84532). |
authorizationList | AuthorizationListItem[] | No | List of authorization entries for delegated transactions or batched operations. Not allowed for "flash-blocks" transactions. |
Important Constraints
- Gas Parameters:
gasPricecannot be used together withmaxFeePerGasormaxPriorityFeePerGas - EIP-1559 Fees: Both
maxFeePerGasandmaxPriorityFeePerGasmust be provided together if either is specified - Flash-blocks Support:
transactionType: "flash-blocks"is only supported on Base (8453) and Base Sepolia (84532) - Authorization List:
authorizationListcannot be used with"flash-blocks"transaction type - Address Validation: The
toaddress must be valid for the specifiedchainId
Returns: Promise<string> — A unique transaction ID that can be used to track the transaction status and execution.