import { ISigner } from "applesauce-signers"; import { BehaviorSubject } from "rxjs"; import { IAccount, IAccountConstructor, SerializedAccount } from "./types.js"; export declare class AccountManager { types: Map>; active$: BehaviorSubject | undefined>; get active(): IAccount | undefined; accounts$: BehaviorSubject[]>; get accounts(): IAccount[]; /** Proxy signer for currently active account */ signer: ISigner; /** Disable request queueing for any accounts added to this manager */ disableQueue?: boolean; constructor(); /** Add account type class */ registerType(accountType: IAccountConstructor): void; /** Remove account type */ unregisterType(type: string): void; /** gets an account in the manager */ getAccount(id: string | IAccount): IAccount | undefined; /** Return the first account for a pubkey */ getAccountForPubkey(pubkey: string): IAccount | undefined; /** Returns all accounts for a pubkey */ getAccountsForPubkey(pubkey: string): IAccount[]; /** adds an account to the manager */ addAccount(account: IAccount): void; /** Removes an account from the manager */ removeAccount(account: string | IAccount): void; /** Replaces an account with another */ replaceAccount(old: string | IAccount, account: IAccount): void; /** Returns the currently active account */ getActive(): IAccount | undefined; /** Sets the currently active account */ setActive(id: string | IAccount): void; /** Clears the currently active account */ clearActive(): void; /** sets the metadata on an account */ setAccountMetadata(id: string | IAccount, metadata: Metadata): void; /** sets the metadata on an account */ getAccountMetadata(id: string | IAccount): Metadata | undefined; /** Removes all metadata on the account */ clearAccountMetadata(id: string | IAccount): void; /** Returns an array of serialized accounts */ toJSON(quite?: boolean): SerializedAccount[]; /** * Restores all accounts from an array of serialized accounts * NOTE: this will clear all existing accounts */ fromJSON(accounts: SerializedAccount[], quite?: boolean): void; }