@lifi/sdk
Version:
LI.FI Any-to-Any Cross-Chain-Swap SDK
11 lines (9 loc) • 326 B
text/typescript
import type { ChainId } from '@lifi/types'
import { config } from '../config.js'
export const getRpcUrls = async (chainId: ChainId): Promise<string[]> => {
const rpcUrls = (await config.getRPCUrls())[chainId]
if (!rpcUrls?.length) {
throw new Error(`RPC URL not found for chainId: ${chainId}`)
}
return rpcUrls
}