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.
29 lines
1.2 KiB
29 lines
1.2 KiB
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.estimateProveWithdrawalGas = estimateProveWithdrawalGas;
|
|
const estimateContractGas_js_1 = require("../../actions/public/estimateContractGas.js");
|
|
const abis_js_1 = require("../abis.js");
|
|
async function estimateProveWithdrawalGas(client, parameters) {
|
|
const { account, chain = client.chain, gas, l2OutputIndex, maxFeePerGas, maxPriorityFeePerGas, nonce, outputRootProof, targetChain, withdrawalProof, withdrawal, } = parameters;
|
|
const portalAddress = (() => {
|
|
if (parameters.portalAddress)
|
|
return parameters.portalAddress;
|
|
if (chain)
|
|
return targetChain.contracts.portal[chain.id].address;
|
|
return Object.values(targetChain.contracts.portal)[0].address;
|
|
})();
|
|
const params = {
|
|
account,
|
|
abi: abis_js_1.portalAbi,
|
|
address: portalAddress,
|
|
functionName: 'proveWithdrawalTransaction',
|
|
args: [withdrawal, l2OutputIndex, outputRootProof, withdrawalProof],
|
|
gas,
|
|
maxFeePerGas,
|
|
maxPriorityFeePerGas,
|
|
nonce,
|
|
chain,
|
|
};
|
|
return (0, estimateContractGas_js_1.estimateContractGas)(client, params);
|
|
}
|
|
//# sourceMappingURL=estimateProveWithdrawalGas.js.map
|