@biconomy/abstractjs
Version:
SDK for Biconomy integration with support for account abstraction, smart accounts, ERC-4337.
32 lines • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.withdrawFromGasTank = void 0;
const mee_1 = require("../../clients/decorators/mee/index.js");
const withdrawFromGasTank = async (mcNexus, parameters) => {
const { tokenAddress, chainId, amount, recipient, meeClient, confirmations } = parameters;
const withdrawal = mcNexus.buildComposable({
type: "withdrawal",
data: {
tokenAddress,
amount,
chainId,
recipient
}
});
const quote = await meeClient.getQuote({
instructions: [withdrawal],
feeToken: {
chainId,
address: tokenAddress
}
});
const { hash } = await meeClient.executeQuote({ quote });
await (0, mee_1.waitForSupertransactionReceipt)(meeClient, {
hash,
confirmations: confirmations || 2
});
return { hash };
};
exports.withdrawFromGasTank = withdrawFromGasTank;
exports.default = exports.withdrawFromGasTank;
//# sourceMappingURL=withdrawFromGasTank.js.map