UNPKG

@biconomy/abstractjs

Version:

SDK for Biconomy integration with support for account abstraction, smart accounts, ERC-4337.

44 lines 1.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.deployGasTank = void 0; const mee_1 = require("../../clients/decorators/mee/index.js"); const deployGasTank = async (mcNexus, parameters) => { const { chainId, amount, tokenAddress, meeClient, confirmations } = parameters; const { isDeployed, address } = mcNexus.deploymentOn(chainId, true); const deployed = await isDeployed(); if (deployed) { return { isDeployed: true, address }; } const tranferInstruction = await mcNexus.build({ type: "transfer", data: { recipient: address, amount, chainId, tokenAddress } }); const fusionQuote = await meeClient.getFusionQuote({ trigger: { amount, tokenAddress, chainId }, instructions: [tranferInstruction], feeToken: { address: tokenAddress, chainId } }); const { hash } = await meeClient.executeFusionQuote({ fusionQuote }); await (0, mee_1.waitForSupertransactionReceipt)(meeClient, { hash, confirmations: confirmations || 2 }); return { isDeployed: true, address, hash }; }; exports.deployGasTank = deployGasTank; exports.default = exports.deployGasTank; //# sourceMappingURL=deployGasTank.js.map