UNPKG

@getclave/lifi-sdk

Version:

LI.FI Any-to-Any Cross-Chain-Swap SDK

18 lines (17 loc) 588 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRpcUrls = exports.getRpcUrl = void 0; const config_1 = require("../config"); const getRpcUrl = async (chainId) => { const rpcUrls = await (0, exports.getRpcUrls)(chainId); return rpcUrls[0]; }; exports.getRpcUrl = getRpcUrl; const getRpcUrls = async (chainId) => { const rpcUrls = (await config_1.config.getRPCUrls())[chainId]; if (!rpcUrls?.length) { throw new Error(`RPC URL not found for chainId: ${chainId}`); } return rpcUrls; }; exports.getRpcUrls = getRpcUrls;