## 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.useRelayChains
Fetch all relay supported chains
Parameters
| Parameter | Description | Required | |
|---|---|---|---|
| baseApiUrl | Base api url for the relay api, defaults to https://api.relay.link but can also be configured to https://api.testnets.relay.link | ❌ | |
| options | Query parameters that map directly to the chains api | ❌ | |
| queryOptions | Tanstack query options. Refer to the Tanstack docs. | ❌ |
Return Data
The hook returns an object with the base Tanstack Query response. The data property maps to the object returned in the aforementioned chains api. You'll also get back chains (an array of RelayChains) and viemChains (an array of viem compatible chains). You can use the viem chains in your wagmi config.
Usage
import { useRelayChains } from '@relayprotocol/relay-kit-hooks'
const { chains, viemChains } = useRelayChains()
Query Function
import { queryRelayChains } from '@relayprotocol/relay-kit-hooks'
queryRelayChains()
This documentation is built and hosted on Mintlify, a developer documentation platform.