## 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.Chain Utils
Utility functions for configuring chains in the Relay SDK
Overview
The /chain-utils subpath export contains utilities for dynamically configuring chains in your application. These functions were moved to a separate entry point to enable better tree-shaking and reduce the default SDK bundle size.
Installation
The chain utilities are included in the main SDK package. Simply import from the /chain-utils subpath:
import {
configureViemChain,
configureDynamicChains
} from '@relayprotocol/relay-sdk/chain-utils'Functions
configureViemChain
Configures a single viem chain for use with the Relay SDK.
import { configureViemChain } from '@relayprotocol/relay-sdk/chain-utils'
import { arbitrum } from 'viem/chains'
const relayChain = configureViemChain(arbitrum)| Parameter | Type | Description | |
|---|---|---|---|
| chain | Chain | A viem chain object to configure for Relay |
Returns: A configured Relay chain object ready to use with the SDK.
configureDynamicChains
Fetches supported chains from the Relay API and configures them dynamically in the SDK. This is useful for applications that want to support all available chains without hardcoding them.
import { configureDynamicChains } from '@relayprotocol/relay-sdk/chain-utils'
const chains = await configureDynamicChains()
// Returns an array of configured chains with viemChain propertiesReturns: Promise<RelayChain[]> - An array of Relay chain objects, each containing a viemChain property for use with wagmi/viem.
This documentation is built and hosted on Mintlify, a developer documentation platform.