UNPKG

startale-aa-sdk

Version:

SDK for startale account integration with support for account abstraction, ERC-7579, ERC-4337.

25 lines 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.installModules = installModules; const account_abstraction_1 = require("viem/account-abstraction"); const utils_1 = require("viem/utils"); const AccountNotFound_1 = require("../../../account/utils/AccountNotFound.js"); const installModule_1 = require("./installModule.js"); async function installModules(client, parameters) { const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, modules } = parameters; if (!account_) { throw new AccountNotFound_1.AccountNotFoundError({ docsPath: "/startale-client/methods#sendtransaction" }); } const account = (0, utils_1.parseAccount)(account_); const calls = (await Promise.all(modules.flatMap((module) => (0, installModule_1.toInstallWithSafeSenderCalls)(account, module)))).flat(); return (0, utils_1.getAction)(client, account_abstraction_1.sendUserOperation, "sendUserOperation")({ calls, maxFeePerGas, maxPriorityFeePerGas, nonce, account }); } //# sourceMappingURL=installModules.js.map