import { Models, Interfaces } from '@open-rights-exchange/chain-js'; import { EosChainState } from './eosChainState'; import { EosEntityName, EosAccountStruct, EosPermissionSimplified, EosActionStruct, EosPublicKey, EosNewKeysOptions, EosGeneratedPermissionKeys, LinkPermissionsParams, DeletePermissionsParams, UnlinkPermissionsParams, EosPermission, EosAccountResources } from './models'; export declare class EosAccount implements Interfaces.Account { private _account; private _chainState; private _generatedKeys; private _permHelper; constructor(chainState: EosChainState); /** Whether the account is currently unused and can be reused * Checks that existing account's active public key matches a designated unusedAccountPublicKey value */ get canBeRecycled(): boolean; /** Account name */ get name(): Models.ChainEntityNameBrand; /** Public Key(s) associated with the account */ get publicKeys(): EosPublicKey[]; /** account resources available */ get resources(): EosAccountResources; /** Whether the account is already in use on chain */ isValidNewAccountName(accountName: string): Promise; /** Tries to retrieve the account from the chain * Returns whether the account exists on the chain */ doesAccountExist(accountName: string): Promise; /** Retrieves account from chain */ load(accountName: EosEntityName): Promise; /** EOS accounts exist on the chain */ get supportsOnChainAccountRegistry(): boolean; /** EOS accounts can be recycled by replacing the account keys */ get supportsRecycling(): boolean; /** JSON representation of transaction data */ toJson(): EosAccountStruct; /** Returns the raw value from the chain */ get value(): EosAccountStruct; private assertHasAccount; /** Returns the simplified permission names and keys * only returns the first key for each permission * Hint: if publicKeyWeight != 1, then there might be another key for that permission */ get permissions(): EosPermission[]; /** Return permission details if account has it attached Or null otherwise */ hasPermission(permissionName: EosEntityName): EosPermission; /** Compose a collection of actions to add the requested permissions * Optionally generates keys if needed (required generateMissingKeysParams) * Returns an array of updateAuth actions as well as any newly generated keys */ composeAddPermissionsActions(authPermission: EosEntityName, permissionsToUpdate: Partial[], newKeysOptions?: EosNewKeysOptions, /** don't return an action for a permission that is already on the account with the same parent and publicKey */ skipExistingPermissions?: boolean, appendKeyToExistingPermission?: boolean): Promise<{ generatedKeys: EosGeneratedPermissionKeys[]; actions: EosActionStruct[]; }>; /** Compose a collection of actions to delete the specified permissions * Returns an array of deleteAuth actions */ composeDeletePermissionsActions(authPermission: EosEntityName, permissionsToUpdate: Partial[]): Promise; /** Compose a collection of actions to link permissions to contract actions * Returns an array of linkAuth actions */ composeLinkPermissionsActions(authPermission: EosEntityName, permissionsToUpdate: LinkPermissionsParams[]): Promise; /** Compose a collection of actions to unlink permissions to contract actions * Returns an array of unlinkAuth actions */ composeUnlinkPermissionsActions(authPermission: EosEntityName, permissionsToUpdate: UnlinkPermissionsParams[]): Promise; /** A new password must be provided if any permissions are missing public keys */ private assertValidOptionNewKeys; }