import { BigNumber, ethers } from 'ethers'; import { JsonRpcSigner } from '@ethersproject/providers'; import { SendBroadcastResult, SendMailResult, SwitchAccountCallback, YlidePublicKeyVersion, IGenericAccount, AbstractWalletController, PublicKey, MessageKey, WalletControllerFactory, Uint256 } from '@ylide/sdk'; import { EVMNetwork, IEVMMailerContractLink, IEVMRegistryContractLink } from '../misc'; import { EthereumBlockchainReader } from './helpers/EthereumBlockchainReader'; import { EthereumMailerV6Wrapper } from '../contract-wrappers/EthereumMailerV6Wrapper'; import { EthereumMailerV7Wrapper } from '../contract-wrappers/EthereumMailerV7Wrapper'; import { EthereumMailerV8Wrapper } from '../contract-wrappers/v8/EthereumMailerV8Wrapper'; import { EthereumRegistryV3Wrapper } from '../contract-wrappers/EthereumRegistryV3Wrapper'; import { EthereumRegistryV4Wrapper } from '../contract-wrappers/EthereumRegistryV4Wrapper'; import { EthereumRegistryV5Wrapper } from '../contract-wrappers/EthereumRegistryV5Wrapper'; import { EthereumRegistryV6Wrapper } from '../contract-wrappers/EthereumRegistryV6Wrapper'; export type NetworkSwitchHandler = (reason: string, currentNetwork: EVMNetwork | undefined, needNetwork: EVMNetwork, needChainId: number) => Promise; export declare class EthereumWalletController extends AbstractWalletController { readonly blockchainReader: EthereumBlockchainReader; readonly signer: JsonRpcSigner; private readonly onNetworkSwitchRequest; private readonly _wallet; readonly mailers: { link: IEVMMailerContractLink; wrapper: EthereumMailerV6Wrapper | EthereumMailerV7Wrapper | EthereumMailerV8Wrapper; }[]; readonly registries: { link: IEVMRegistryContractLink; wrapper: EthereumRegistryV3Wrapper | EthereumRegistryV4Wrapper | EthereumRegistryV5Wrapper | EthereumRegistryV6Wrapper; }[]; private lastCurrentAccount; readonly providerObject: any; constructor(options?: { dev?: boolean; endpoint?: string; wallet?: string; signer?: JsonRpcSigner; providerObject?: any; onNetworkSwitchRequest?: NetworkSwitchHandler; onSwitchAccountRequest?: SwitchAccountCallback; }); private handleError; blockchainGroup(): string; wallet(): string; init(): Promise; private getRegistryByNetwork; private getMailerByNetwork; setBonucer(network: EVMNetwork, from: string, newBonucer: string, val: boolean): Promise; setBonuses(network: EVMNetwork, from: string, _newcomerBonus: string, _referrerBonus: string): Promise; private getCurrentChainId; private getCurrentNetwork; private ensureNetworkOptions; private ensureAccount; requestYlidePrivateKey(me: IGenericAccount): Promise; signString(account: IGenericAccount, message: string): Promise<{ message: string; r: string; s: string; v: number; }>; signMagicString(account: IGenericAccount, magicString: string): Promise; addressToUint256(address: string): Uint256; getAuthenticatedAccount(): Promise; getCurrentBlockchain(): Promise; attachPublicKey(me: IGenericAccount, publicKey: Uint8Array, keyVersion?: YlidePublicKeyVersion, registrar?: number, options?: { network?: EVMNetwork; value?: BigNumber; }): Promise; requestAuthentication(): Promise; isMultipleAccountsSupported(): boolean; disconnectAccount(account: IGenericAccount): Promise; sendMail(me: IGenericAccount, feedId: Uint256, contentData: Uint8Array, recipients: { address: Uint256; messageKey: MessageKey; }[], options?: { network?: EVMNetwork; value?: BigNumber; }): Promise; sendBroadcast(me: IGenericAccount, feedId: Uint256, contentData: Uint8Array, options?: { network?: EVMNetwork; value?: BigNumber; }): Promise; decryptMessageKey(recipientAccount: IGenericAccount, senderPublicKey: PublicKey, encryptedKey: Uint8Array): Promise; deployRegistryV3(me: IGenericAccount, previousContractAddress?: string, options?: { network?: EVMNetwork; value?: BigNumber; }): Promise; deployRegistryV4(me: IGenericAccount, previousContractAddress?: string, options?: { network?: EVMNetwork; value?: BigNumber; }): Promise; deployRegistryV5(me: IGenericAccount, previousContractAddress?: string, options?: { network?: EVMNetwork; value?: BigNumber; }): Promise; deployRegistryV6(me: IGenericAccount, options?: { network?: EVMNetwork; value?: BigNumber; }): Promise; deployMailerV6(me: IGenericAccount, options?: { network?: EVMNetwork; value?: BigNumber; }): Promise; deployMailerV7(me: IGenericAccount, options?: { network?: EVMNetwork; value?: BigNumber; }): Promise; deployMailerV8(me: IGenericAccount, options?: { network?: EVMNetwork; value?: BigNumber; }): Promise; } export declare const evmWalletFactories: Record;