UNPKG

@xuxinlai2002/pns-js

Version:

A NPM package in Typescript for .Play Name Service

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