import { ethers, BigNumber } from "ethers"; import { BlsWalletSigner, Bundle, Operation, PublicKey, Signature } from "./signer"; import { BLSWallet, VerificationGateway } from "../typechain-types"; type SignerOrProvider = ethers.Signer | ethers.providers.Provider; /** * Class representing a BLS Wallet */ export default class BlsWalletWrapper { #private; blsWalletSigner: BlsWalletSigner; walletContract: BLSWallet; defaultGatewayAddress: string; address: string; blockGasLimit: BigNumber; private constructor(); static BLSWallet(privateKey: string, verificationGateway: VerificationGateway): Promise; /** * Gets the address for this wallet. * * This could be: * - The address the wallet is registered to on the VerificationGateway. * - The expected address if it has not already be created/registered. * - The original wallet address before it was recovered to another key pair. * * Throws an exception if wallet was recovered to a different private key. * * @param privateKey private key associated with the wallet * @param verificationGatewayAddress address of the VerficationGateway contract * @param signerOrProvider ethers.js Signer or Provider * @returns The wallet's address */ static Address(privateKey: string, verificationGatewayAddress: string, signerOrProvider: SignerOrProvider): Promise; /** Get the wallet contract address for the given public key */ static AddressFromPublicKey(publicKey: PublicKey, verificationGateway: VerificationGateway): Promise; static getRandomBlsPrivateKey(): Promise; /** * Instantiate a `BLSWallet` associated with the provided private key. * associated wallet contract already exists. * * Throws an exception if wallet was recovered to a different private key. * * @param privateKey private key associated with the wallet * @param verificationGatewayAddress address of the VerficationGateway contract * @param provider ethers.js Provider * @returns a BLS Wallet */ static connect(privateKey: string, verificationGatewayAddress: string, provider: ethers.providers.Provider): Promise; syncWallet(verificationGateway: VerificationGateway): Promise; /** * Get the next expected nonce for the wallet contract based on the latest * block. */ Nonce(): Promise; static Nonce(publicKey: PublicKey, verificationGatewayAddress: string, signerOrProvider: SignerOrProvider): Promise; /** Sign an operation with an estimate of the gas required. */ signWithGasEstimate(operation: Omit, /** * Optional: Multiply estimate by `(1+overhead)` to account for uncertainty. * Reduces the chance of running out of gas. */ overhead?: number): Promise; /** Estimate the gas needed for an operation. */ estimateGas(operation: Omit): Promise; /** Sign an operation, producing a `Bundle` object suitable for use with an aggregator. */ sign(operation: Operation): Bundle; /** Sign a message */ signMessage(message: string): Signature; /** * Gets the BLS public key associated with this wallet. * * @returns Wallet's BLS public key. */ PublicKey(): PublicKey; /** * Gets the BLS public key associated with this wallet as a concatenated string. * * @returns Wallet's BLS public key as a string. */ PublicKeyStr(): string; getSetRecoveryHashBundle(salt: string, recoverWalletAddress: string): Promise; getRecoverWalletBundle(recoveryAddress: string, newPrivateKey: string, recoverySalt: string, verificationGateway: VerificationGateway, signatureExpiryTimestamp: number): Promise; private static ExpectedAddress; private static validateWalletNotRecovered; } export {}; //# sourceMappingURL=BlsWalletWrapper.d.ts.map