Parameters

ParameterDescriptionRequired
baseApiUrlBase api url for the relay api, defaults to https://api.relay.link but can also be configured to https://api.testnets.relay.link
optionsQuery parameters that map directly to the chains api
queryOptionsTanstack 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

Query Function

import { queryRelayChains } from '@reservoir0x/relay-kit-hooks'

queryRelayChains()