UNPKG

aa-schnorr-multisig-sdk

Version:

Account Abstraction Schnorr Multi-Signatures SDK

13 lines (12 loc) 679 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.predictAccountAddress = void 0; const ethers_1 = require("ethers"); const abi_1 = require("../abi"); async function predictAccountAddress(factoryAddress, signer, combinedPubKeys, salt) { const smartAccountFactory = new ethers_1.ethers.Contract(factoryAddress, abi_1.MultiSigSmartAccountFactory_abi, signer); const saltHash = ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.toUtf8Bytes(salt)); const predictedAccount = await smartAccountFactory.getAccountAddress(combinedPubKeys, saltHash); return predictedAccount; } exports.predictAccountAddress = predictAccountAddress;