Relay
SupportGet in TouchTry Relay
Relay PlatformAPI ReferenceRelayKitRelay ProtocolChangelog

Getting Started

What is Relay?How Relay Works

Solutions

Payment Service ProvidersWallets & Wallet ProvidersMultichain AppsChainsCommerce & Payments

Use Cases

Bridging & OnboardingSwapsCall Execution

Features

App FeesFee SponsorshipDeposit AddressesGas Top-UpGasless ExecutionFast FillGasless SwapsPrice StabilizationRouting Integration Models

Security

Transaction ScreeningUnsupported ExchangesBug Bounty ProgramMEV protectionCommunity SupportContract Audits

Resources

Supported ChainsIntegrating using AISupportBrand Assets

API Reference

API OverviewQuickstartApps, API keys, and Rate LimitsAccess TokensUnderstanding Step ExecutionWallet DetectionCost & Fee StructureRefundsInput ValidationTrade TypesSurplus & ShortageHandling Quote ErrorsHandling Rate LimitsHandling Execution ErrorsContract CompatibilityBridging Integration GuideCall Execution Integration GuideTransaction IndexingBase Builder CodesSmart Accounts in RelayTestnet SupportSolana SupportBitcoin SupportHyperliquid SupportLighter SupportDeep LinkingWebsocketsWebhooksMigrating to Requests v3Migrating to Currencies v2Migrating to Token Price v2Supported ChainsContract AddressesSupported Tokens & RoutesTroubleshootingGet QuoteSubmit PermitGet StatusGet RequestsGet Published RequestsGet ChainsGet Chains LiquidityGet CurrenciesGet Currency ClassificationsGet Token PriceTransactions IndexTransactions SingleDeposit Address ReindexGet App Fee BalancesGet Balance EventsClaim App FeesGet UsageFast FillGet Swap SourcesCreate Access TokenExecute Gasless TxsAttest DepositGet Recovery BalancesRequest WithdrawalGet Withdrawal StatusGet Requests (v2)Get PriceGet ConfigGet Execution StatusGet Currencies (v1)Get Token Price (v1)Get Quote

RelayKit

OverviewInstallationcreateClientgetQuoteexecutegetAppFeesclaimAppFeesfastFillexecuteGaslessBatchAdaptersTypescript API TypingsChain UtilsInstallationuseQuoteuseRelayChainsuseRequestsuseTokenListuseTokenPriceuseExecutionStatusInstallationRelayKitProviderSwapWidgetThemingTroubleshooting

Protocol

Relay ProtocolHow It WorksThe Relay ChainDepositoryDeposit AddressesOracleHubAllocatorSecurity CouncilSecurity & AuditsFor AppsProgrammatic WithdrawalsWithdrawing with a SafeOperate a Third-Party Relay OracleAddressesEVM Depository ReferenceSVM Depository ReferenceOverviewArchitectureSecurityRelay Vaults BackendBridgingInteracting with Relay VaultsWithdrawing from Relay VaultsRelayPoolFactoryRelayPoolRelayPoolNativeGatewayRelayBridgeFactoryRelayBridge

Changelog

Changelog
## Documentation Index Fetch the complete documentation index at: https://docs.relay.link/llms.txt Use this file to discover all available pages before exploring further.
## Agent Instructions To quote bridges and swaps, look up chains and tokens, or track Relay transactions from an agent, use the Relay MCP server: npx -y @relayprotocol/relay-mcp. It is read-only and does not sign or broadcast transactions. Setup: https://docs.relay.link/resources/developing-with-ai.md For Relay Protocol's trust model, security architecture, and audits, see https://docs.relay.link/references/protocol/security.md. For address screening, see https://docs.relay.link/security/transaction-screening.md.

Adapters

An introduction to adapters and how to use them

What is an adapter anyway?

An adapter is a function that takes parameters and returns an object that adheres to this interface. Let's review the interface in depth:

PropertyDescriptionRequired
vmTypeA string representing a supported vmType (evm svm bvm tvm lvm tonvm)✅
getChainIdAn async function that returns a chain id✅
handleSignMessageStepAn async function that given a signature step item and a step generates a signature✅
handleSendTransactionStepAn async function that given a chain id, a transaction step item and a step returns a transaction hash✅
handleConfirmTransactionStepAn async function that given a transaction hash, a chain id, an onReplaced function and an onCancelled function returns a promise with either an evm receipt or an svm receipt✅
addressAn async function that returns the currently connected to address, an address that can sign messages and submit transactions✅
switchChainAn async function that given a chain id switches to that chain, either by prompting the user or automatically switching chains✅
transportAn optional transport to use when making rpc calls.❌
getBalanceAn optional method to override the default balance fetching logic for selected tokens in the ui kit.❌
supportsAtomicBatchAn optional async function that takes a chain ID and returns whether the wallet supports EIP-5792's atomic batch capability. EVM wallets only.❌
handleBatchTransactionStepAn optional async function that takes a chain ID and an array of transaction step items, returning a call bundle identifier for batch processing. Only available for EVM wallets that support atomic batching.❌
isEOAAn optional boolean that indicates if the wallet is an EOA (Externally Owned Account). This is used to determine if the wallet is an EOA or a contract account.❌

What adapters are available out of the box?

The following adapters are officially maintained and developed by the Relay team:

SVM Adapter: This adapter gives the sdk the ability to submit transactions on SVM (Solana Virtual Machine) networks. It does not support signing messages and under the hood it uses the solana web3 sdk.

Bitcoin Adapter: This adapter gives the sdk the ability to submit transaction to the Bitcoin blockchain. Under the hood it uses bitcoinjs-lib to sign and submit transactions. Note that bitcoin transactions have a long finalization period and unlike quicker vms are not polled in real time for confirmation.

Viem Adapter: This adapter is the default one used when no adapter is provided. You can also import it yourself to convert any viem wallet client into an adapted wallet ready to be used in the sdk.

Ethers Adapter: If your application uses ethers then you'll need this adapter to use the SDK. You'll still need to install viem as that's required for polling transactions but you can pass in your ethers signer to submit transactions and sign messages.

Tron Adapter: This adapter gives the sdk the ability to submit transactions to the Tron blockchain. Under the hood it uses the tronweb sdk.

Lighter Adapter: This adapter gives the SDK the ability to deposit to Lighter from any Relay-supported chain. It owns the full Lighter session lifecycle — resolving the user's Lighter account index, generating an in-memory API key, and registering it via changeApiKey on first transfer. Integrators who already run their own Lighter session (backend-provisioned key, wallet-level integration) can pass a pre-built signerClient to bypass the bootstrap entirely.

TON Adapter: This adapter gives the SDK the ability to submit transactions on the TON blockchain. The user's key stays in their wallet, so the adapter never signs — you pass a sendTransaction callback (for example wrapping Dynamic's TON connector or TonConnect UI) that signs and broadcasts the request, while the adapter handles request building and on-chain confirmation. Confirmation reads use a read-only `@ton/ton` TonClient pointed at the TON chain's httpRpcUrl from the Relay client's chain configuration; to use a custom endpoint (e.g. a keyed provider in production), override that chain's httpRpcUrl when configuring the SDK client rather than passing it to the adapter. TON support requires the @ton/core and @ton/ton peer dependencies in addition to viem and @relayprotocol/relay-sdk.

How can I use an adapter?

You can either make your own adapter, as long as it adheres to the interface above or you can use one of the officials adapters developed and maintained by the Relay team. All of our sdk methods handle a viem wallet or adapted wallet. The viem wallet adapter is used by default when a viem wallet is passed in for convenience. Refer below for implementation details:

import { getClient, Execute, getQuote } from "@relayprotocol/relay-sdk";
import { adaptSolanaWallet } from '@relayprotocol/relay-solana-wallet-adapter'
import { Connection, Keypair, clusterApiUrl, SystemProgram, Transaction } from '@solana/web3.js';
...

//In this example we are loading a keypair as the wallet, but if you have a connector like dynamic you can just fetch the connection from that library
const wallet = Keypair.generate();
const connection = new Connection(clusterApiUrl('devnet'), 'confirmed');
const walletAddress = wallet.publicKey.toString()

const adaptedWallet = adaptSolanaWallet(
  walletAddress,
  792703809, // Chain ID that Relay uses to identify Solana 
  connection, // The Solana web3.js Connection instance for interacting with the network
  connection.sendTransaction // Function to sign and send a transaction, returning a promise with a base58 encoded transaction signature
)

const options = ... // define this based on getQuote options

const quote = await getClient().actions.getQuote(options)

getClient().actions.execute({
  quote,
  wallet: adaptedWallet,
  onProgress: ({steps, fees, breakdown, currentStep, currentStepItem, txHashes, details}) => {
        // custom handling
  },
  ...
})
import { getClient, Execute, getQuote, adaptViemWallet } from "@relayprotocol/relay-sdk";
import { createWalletClient } from 'wagmi'
import { mainnet } from 'viem/chains'

...
 
const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum!)
})

const options = ... // define this based on getQuote options

const quote = await getClient().actions.getQuote(options)

getClient().actions.execute({
  quote,
  wallet: adaptViemWallet(walletClient),
  onProgress: ({steps, fees, breakdown, currentStep, currentStepItem, txHashes, details}) => {
        // custom handling
  },
  ...
})
import { getClient, Execute, getQuote } from "@relayprotocol/relay-sdk";
import { adaptBitcoinWallet } from '@relayprotocol/relay-bitcoin-wallet-adapter'
import { createWalletClient } from 'wagmi'
import { mainnet } from 'viem/chains'

...
 
const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum!)
})

const options = ... //define this based on getQuote options

const quote = await getClient().actions.getQuote(options)

const adaptedWallet = adaptBitcoinWallet(
  primaryWallet.address,
  async (_address, _psbt, dynamicParams) => {
    try {
      // Request the wallet to sign the PSBT (this is using dynamic but you could use whatever framework you want)
      const response = await primaryWallet.signPsbt(dynamicParams)
      if (!response) {
        throw 'Missing psbt response'
      }
      return response.signedPsbt
    } catch (e) {
      throw e
    }
  }
)

getClient().actions.execute({
  quote,
  wallet: adaptedWallet,
  onProgress: ({steps, fees, breakdown, currentStep, currentStepItem, txHashes, details}) => {
        //custom handling
  },
  ...
})
import { getClient } from '@relayprotocol/relay-sdk'
import { adaptEthersSigner } from '@relayprotocol/relay-ethers-wallet-adapter'
import { useSigner } from 'wagmi'

...

const { data: signer } = useSigner()
const adaptedWallet = adaptEthersSigner(signer)

const options = ... //define this based on getQuote options

const quote = await getClient().actions.getQuote(options)

getClient().actions.execute({
  quote,
  wallet: adaptedWallet,
  onProgress: ({steps, fees, breakdown, currentStep, currentStepItem, txHashes, details}) => {
        //custom handling
  },
  ...
})
import { TronWallet } from 'tronweb'
import { getClient, Execute, getQuote } from "@relayprotocol/relay-sdk"
import { adaptTronWallet } from '@relayprotocol/relay-tron-wallet-adapter'

// Create a TronWeb instance, we recommend using a provider like dynamiclabs if using this on the frontend
// Note: you should never share your private key with anyone or use on the frontend
const tronWeb = new TronWeb({fullHost: 'xxx', privateKey: 'privateKey'});
const walletAddress = tronWeb.defaultAddress.base58
if (!tronWeb) {
  throw 'Unable to setup Tron wallet'
}

const adaptedWallet = adaptTronWallet(
  walletAddress,
  tronWeb
)
const options = ... //define this based on getQuote options

const quote = await getClient().actions.getQuote(options)

getClient().actions.execute({
  quote,
  wallet: adaptedWallet,
  onProgress: ({steps, fees, breakdown, currentStep, currentStepItem, txHashes, details}) => {
    //custom handling
  },
    ...
})
import { getClient, getQuote } from '@relayprotocol/relay-sdk'
import { adaptLighterWallet } from '@relayprotocol/relay-lighter-wallet-adapter'
import { createWalletClient, custom } from 'viem'
import { mainnet } from 'viem/chains'

// Lighter deposits are authorized by an L1 (EVM) signature, so the adapter
// only needs the user's connected EVM address and a signMessage callback.
const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum!)
})

const [address] = await walletClient.requestAddresses()

const adaptedWallet = adaptLighterWallet({
  l1Address: address,
  signL1Message: (message) =>
    walletClient.signMessage({ account: address, message })
})

const options = ... // define this based on getQuote options (destinationChainId: 3586256, recipient: <Lighter account index>)

const quote = await getClient().actions.getQuote(options)

getClient().actions.execute({
  quote,
  wallet: adaptedWallet,
  onProgress: ({ steps, fees, breakdown, currentStep, currentStepItem, txHashes, details }) => {
    // custom handling
  }
})
import { getClient, Execute, getQuote } from "@relayprotocol/relay-sdk"
import { adaptTonWallet } from '@relayprotocol/relay-ton-wallet-adapter'

// The user's key lives in their TON wallet, so the adapter never signs. You
// provide a sendTransaction callback that forwards the TonConnect-style request
// to your wallet provider (e.g. Dynamic's TON connector or tonConnectUI), signs
// + broadcasts it, and returns the result. The adapter accepts a signed
// external-message { boc } (what most TonConnect wallets return) or a
// { transactionHash }. The confirmation RPC is read from the TON chain's
// httpRpcUrl in your Relay client config — there is no adapter-level endpoint.
const adaptedWallet = adaptTonWallet(walletAddress, async (request) => {
  const { boc } = await wallet.sendTransaction(request)
  return { boc }
})

const options = ... // define this based on getQuote options

const quote = await getClient().actions.getQuote(options)

getClient().actions.execute({
  quote,
  wallet: adaptedWallet,
  onProgress: ({ steps, fees, breakdown, currentStep, currentStepItem, txHashes, details }) => {
    // custom handling
  },
  ...
})

Viem adapter options

adaptViemWallet accepts an optional second argument for adapter-level configuration:

PropertyDescription
disableCapabilitiesCheckSkip wallet.getCapabilities calls used for EIP-5792 atomic-batch detection and smart-wallet detection. Set this for wallets with a broken getCapabilities implementation that hangs or never resolves. When true, execution falls back to sequential transactions.
import { adaptViemWallet } from "@relayprotocol/relay-sdk";

const adaptedWallet = adaptViemWallet(walletClient, {
  disableCapabilitiesCheck: true,
});
[!TIP] The same flag is available directly on getQuote, execute, and claimAppFees when you pass a raw viem WalletClient — the SDK forwards it to adaptViemWallet internally.

This documentation is built and hosted on Mintlify, a developer documentation platform.

PreviousexecuteGaslessBatchNextTypescript API Typings
Relay© 2026 Uneven Labs, Inc. All rights reserved.XGitHubSupport