Exports
Functions
getChains(cache?)
Fetch all supported source chains for bridging.| Parameter | Type | Required | Description |
|---|---|---|---|
cache | ChainCache | No | Optional cache instance (uses default if not provided) |
ChainsResponse
| Property | Type | Description |
|---|---|---|
chains | Chain[] | Array of supported chains |
isStale | boolean | Whether data is from stale cache |
cachedAt | number | null | Timestamp when data was cached |
ChainFetchError if API fails and no cache available.
Example:
getDestinationChains()
Get destination chains (currently only HyperEVM).getChainsByRoutes(toChainId?, cache?)
Get chains that have valid bridge routes to a specific destination.| Parameter | Type | Default | Description |
|---|---|---|---|
toChainId | number | 999 | Destination chain ID (HyperEVM) |
cache | ChainCache | - | Optional cache instance |
getChainById(chainId, cache?)
Get a specific chain by its ID.| Parameter | Type | Required | Description |
|---|---|---|---|
chainId | number | Yes | Chain ID to find |
cache | ChainCache | No | Optional cache instance |
invalidateChainCache(cache?)
Manually invalidate the chain cache.createChainCache()
Factory function to create a new cache instance.Types
ChainsResponse
Chain
ChainFetchError
Constants
HYPEREVM_CHAIN
Pre-defined HyperEVM chain data.ChainCache Class
TheChainCache class manages caching for chain data with a 30-minute TTL.
