UNPKG

viem

Version:

TypeScript Interface for Ethereum

22 lines 731 B
import { ChainDoesNotSupportContract, } from '../../errors/chain.js'; export function getChainContractAddress({ blockNumber, chain, contract: name, }) { const contract = chain?.contracts?.[name]; if (!contract) throw new ChainDoesNotSupportContract({ chain, contract: { name }, }); if (blockNumber && contract.blockCreated && contract.blockCreated > blockNumber) throw new ChainDoesNotSupportContract({ blockNumber, chain, contract: { name, blockCreated: contract.blockCreated, }, }); return contract.address; } //# sourceMappingURL=getChainContractAddress.js.map