UNPKG

@nomicfoundation/hardhat-verify

Version:
11 lines 386 B
const chainIdCache = new WeakMap(); export async function getChainId(provider) { const cachedChainId = chainIdCache.get(provider); if (cachedChainId !== undefined) { return cachedChainId; } const chainId = Number(await provider.request({ method: "eth_chainId" })); chainIdCache.set(provider, chainId); return chainId; } //# sourceMappingURL=chains.js.map