Skip to Content
TachyonSDK ReferenceRelay Transactions

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.)

relay-transaction.js
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:

relay-response.json
{ "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.

NameTypeRequiredDescription
chainIdnumberYesThe blockchain network ID where the transaction will be executed. Must be a supported chain.
tostringYesThe 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.
callDatastringYesEncoded transaction data in hexadecimal format (use ‘0x’ for simple transfers).
valuestringNo (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.
labelstringNoHuman-readable label for easier transaction identification and tracking.
gasLimitstringNoGas limit for the transaction. If not specified, it will be estimated automatically. Required for Aptos transactions.
gasPricestringNoGas price for legacy transactions. Cannot be used with maxFeePerGas or maxPriorityFeePerGas.
maxFeePerGasstringNoMaximum fee per gas for EIP-1559 transactions. Must be provided together with maxPriorityFeePerGas.
maxPriorityFeePerGasstringNoMaximum priority fee per gas for EIP-1559 transactions. Must be provided together with maxFeePerGas.
maxUSDnumberNoMaximum USD cost limit for the transaction. Transaction will fail if estimated cost exceeds this value.
retriesnumberNo (default: 0)Number of retry attempts for failed transactions.
shouldBatchInMulticallbooleanNoWhether to batch this transaction in a multicall for gas optimization.
isAuthenticatedTxbooleanNo (default: false)Enable authenticated relay mode for additional security and verification.
derivationPathstringNoHD 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).
authorizationListAuthorizationListItem[]NoList of authorization entries for delegated transactions or batched operations. Not allowed for "flash-blocks" transactions.

Important Constraints

  • Gas Parameters: gasPrice cannot be used together with maxFeePerGas or maxPriorityFeePerGas
  • EIP-1559 Fees: Both maxFeePerGas and maxPriorityFeePerGas must 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: authorizationList cannot be used with "flash-blocks" transaction type
  • Address Validation: The to address must be valid for the specified chainId

Returns: Promise<string> — A unique transaction ID that can be used to track the transaction status and execution.

Last updated on