You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
865 B
25 lines
865 B
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getChainContractAddress = getChainContractAddress;
|
|
const chain_js_1 = require("../../errors/chain.js");
|
|
function getChainContractAddress({ blockNumber, chain, contract: name, }) {
|
|
const contract = chain?.contracts?.[name];
|
|
if (!contract)
|
|
throw new chain_js_1.ChainDoesNotSupportContract({
|
|
chain,
|
|
contract: { name },
|
|
});
|
|
if (blockNumber &&
|
|
contract.blockCreated &&
|
|
contract.blockCreated > blockNumber)
|
|
throw new chain_js_1.ChainDoesNotSupportContract({
|
|
blockNumber,
|
|
chain,
|
|
contract: {
|
|
name,
|
|
blockCreated: contract.blockCreated,
|
|
},
|
|
});
|
|
return contract.address;
|
|
}
|
|
//# sourceMappingURL=getChainContractAddress.js.map
|