Relay Transactions
Learn how to submit and track relay transactions using the Tachyon SDK across multiple blockchain networks.
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)Aptos
import { Tachyon, ChainId } from '@rathfi/tachyon'
// Initialize the SDK
const tachyon = new Tachyon({
apiKey: 'API-KEY',
})
// Submit a transaction on Aptos
const txId = await tachyon.relay({
chainId: 88888888, // Aptos chain ID
to: '0x09ebf332aa3e4edad203aff521bd8a47597119de1956885711223ec157eac219',
value: '1',
callData: '0x',
gasLimit: '100', // Required for Aptos
label: 'My Aptos 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)Solana
import { Tachyon, ChainId } from '@rathfi/tachyon'
// Initialize the SDK
const tachyon = new Tachyon({
apiKey: 'API-KEY',
})
// Submit a transaction on Solana
const txId = await tachyon.relay({
chainId: 10100000, // Solana chain ID
to: 'BSNsLtDDM1wN8rjEJQaZreVqRhibsUtsEq9m1G2deAm',
value: '1', // 1 lamport
callData: '0x',
label: 'My Solana 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)Sui
import { Tachyon, ChainId } from '@rathfi/tachyon'
// Initialize the SDK
const tachyon = new Tachyon({
apiKey: 'API-KEY',
})
// Submit a transaction on Sui
const txId = await tachyon.relay({
chainId: 897796746, // Sui chain ID
to: '0xf78da4499004aa2d594143d69a7804f6f989ab8152de59d3726def827c9fe1f0',
value: '100000000', // 0.1 SUI (in MIST)
callData: '0x',
gasLimit: '3000000',
label: 'send-native-sui',
})
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)NEAR
import { Tachyon, ChainId } from '@rathfi/tachyon'
// Initialize the SDK
const tachyon = new Tachyon({
apiKey: 'API-KEY',
})
// Submit a transaction on NEAR
const txId = await tachyon.relay({
chainId: 7777777, // NEAR chain ID
to: 'deeprice6887.near',
value: '1', // 1 yoctoNEAR
callData: '0x',
label: 'My NEAR 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)Starknet
import { Tachyon, ChainId } from '@rathfi/tachyon'
// Initialize the SDK
const tachyon = new Tachyon({
apiKey: 'API-KEY',
})
// Submit a transaction on Starknet
const txId = await tachyon.relay({
to: "0x021Af6FEc4753c4C7C248Dc68d1B43ed721f0246e9dC8A9e5b7d74Ff3373764B",
callData: "0x",
value: "1",
chainId: 23448594291968334,
label: "send strk",
retries: 0
})
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.