@runonflux/aa-schnorr-multisig-sdk
Version:
Account Abstraction Schnorr Multi-Signatures SDK
52 lines (51 loc) • 3.07 kB
TypeScript
import type { Provider, Signer } from "ethers";
import type { Hex } from "../accountAbstraction";
export declare const PROXY_FACTORY_ADDRESS = "0x4e59b44847b379578588920ca78fbf26c0b4956c";
export declare const ENTRY_POINT_ALCHEMY_ADDRESS = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";
/**
* Calculates offchain MultiSigSmartAccount address with create2.
* @param factoryAddress MultiSigSmartAccountFactory address
* @param accountImplementationAddress MultiSigSmartAccount implementation address
* @param combinedAddresses combined schnorr signers' public addresses used as contract owners
* @param salt salt text: string or number
* @returns predicted MultiSigSmartAccount address
*/
export declare function predictAccountAddrOffchain(factoryAddress: string, accountImplementationAddress: string, combinedAddresses: string[], salt: string): string;
/**
* Calculates offchain MultiSigSmartAccount address with create2
* @param salt salt text: string or number
* @param entryPointAddress Account Abstraction's Entry Point address (default: Alchemy Entry Point)
* @returns predicted MultiSigSmartAccount Factory address
*/
export declare function predictFactoryAddrOffchain(salt: string, entryPointAddress?: string): string;
/**
* Calculates offchain MultiSigSmartAccount implementation address with create2
* @param factoryAddress MultiSigSmartAccount Factory address.
* If not known, can be predicted with given `factorySalt` and `entryPointAddress` params
* @param factorySalt salt text: string or number - the same used for Factory deployment
* @param entryPointAddress Account Abstraction's Entry Point address (default: Alchemy Entry Point)
* @returns
*/
export declare function predictAccountImplementationAddrOffchain(factorySalt: string, factoryAddress?: string, entryPointAddress?: string): string;
/**
* Calculates MultiSigSmartAccount address with create2 and onchain data.
* @param factoryAddress MultiSigSmartAccountFactory address
* @param combinedAddresses combined schnorr signers' public addresses used as contract owners
* @param salt salt text: string or number
* @param ethersSignerOrProvider Signer or Provider type to call the Factory contract
* @returns predicted MultiSigSmartAccount address
*/
export declare function predictAccountAddrOnchain(factoryAddress: string, combinedAddresses: string[], salt: string, ethersSignerOrProvider: Signer | Provider): Promise<`0x${string}`>;
/**
* Helper for getting account implementation address from Account Factory
* @param factoryAddress deployed MultiSigSmartAccountFactory address
* @param ethersSignerOrProvider signer or provider to call contract
* @returns account implementation address
*/
export declare function getAccountImplementationAddress(factoryAddress: string, ethersSignerOrProvider: Signer | Provider): Promise<string>;
/**
* Checks if salt is Hex and if not - converts from string or number to hashed string with keccak256.
* @param salt salt text: string or number
* @returns hashed salt
*/
export declare const saltToHex: (salt: string) => Hex;