import { IConnection } from '@iamo/custody-lib/build/shared/Connection'; import { IAMORole, IBunkerConsent, IEnrichedTransactionParameters, IMultisigAccount } from './Transaction'; export declare enum AccountType { Unknown = 0, OwnLocal = 1, Other = 2 } export declare enum Role { Owner = 0, Approver = 1, Challenger = 2 } export interface IAccount { accountAddress: string; privateKey?: string; mnemonic?: string; ensDomain?: string; etherBalanceInWei?: string; accountKeyType: AccountType; roles?: Role[]; } export declare enum AccountCreationStatus { Sent = "sent", Error = "error", AlreadyVerified = "alreadyVerified", InvalidTarget = "invalidTarget" } export interface IBunkerKey { name: string; 'key-rights': string; value: string; 'key-type': string; metadata: any; } /** * Account class for the wallet functionality */ export declare class Account { connection: IConnection; /** * initialized the account class * @param connection The backend connection object. */ constructor(connection: IConnection); /** * Creates a new ethereum account * @param entropy Additional entropy for the account creation. * @returns a new IAccount-object */ createAccount(entropy?: string): IAccount; /** * Updates the account type of account object * @param account The ethereum account which should be checked. * @returns the updated account */ checkAccountType(account: IAccount): Promise; /** * Updates the ether balance of account object * @param account The ethereum account which should be checked. * @returns the updated account */ checkEtherBalance(account: IAccount): Promise; /** * Creates an account object. * @param accountAddress The ethereum account address. * @returns the created account object */ importAccount(accountAddress: string): Promise; /** * Creates an account in the bunker * @param phone The phone number of the user * @param email The email of the user * @param deviceName The device name of the user * @param deviceType The device type * @returns an AccountCreation-status */ createBunkerAccount(phone: string, email: string, deviceName: string, deviceType: string): Promise<{ signature: { timestamp: string; value: string; }; status: AccountCreationStatus; }>; /** * Gets an account from the bunker * @returns the account from the bunker */ getBunkerAccount(): Promise<{ phone: string; email: string; }>; /** * Creates a new key in the bunker and returns the enrichedTransactionParameters * to add the key to the appropriate place on the blockchain. * @param instanceAddress The multisig address * @param secret Secret for the key * @param name Name of the key * @param keyRights The rights of the key * @param metadata The metadata of the key * @param consent The bunker-consent * @returns the enriched transaction parameters */ createBunkerKey(instanceAddress: string, secret: string, name: string, keyRights: IAMORole[], metadata: any, consent: IBunkerConsent): Promise; /** * Adds an external key to the bunker * @param publicKey the publicKey of the key * @param name the name of the key * @param keyRights the key-rights of the key * @param metadata the metadata of the key * @param consent the bunker-consent * @returns the public-key */ addExternalKeyToBunker(publicKey: string, name: string, keyRights: IAMORole[], metadata: any, consent: IBunkerConsent): Promise<{ 'public-key': string; }>; /** * Gets all bunker keys associated with the user key * @returns all bunker keys associated with the user key */ getBunkerKeys(): Promise; /** * Takes all keys in the safe and modules and moves them to the bunker * @param instanceAddress The multisig instance address * @returns An array with the multisig-accounts */ migrateKeysToBunker(instanceAddress: string): Promise; } export default Account;