KeyStore

Interface
export interface KeyStore { 
  readonly byteLimit?: number; 
  readonly currentUserAccount$: Observable<UserAccount | undefined>; 
  readonly getCurrentUserAccount: () => UserAccount | undefined; 
  readonly userAccounts$: Observable<readonly UserAccount[]>; 
  readonly getUserAccounts: () => readonly UserAccount[]; 
  readonly selectUserAccount: (id?: UserAccountID) => Promise<void>; 
  readonly deleteUserAccount?: (id: UserAccountID) => Promise<void>; 
  readonly updateUserAccountName?: (options: UpdateAccountNameOptions) => Promise<void>; 
  readonly sign: (options: { readonly account: UserAccountID; readonly message: string }) => Promise<string>; 
} 

Properties

byteLimit
number
An optional limit on the total byte size the KeyStore is capable of signing.
currentUserAccount$
Observable<UserAccount | undefined>
An Observable which emits the currently selected UserAccount.
userAccounts$
Observable<readonly UserAccount[]>
An Observable of all available UserAccounts

Methods

getCurrentUserAccount

() => UserAccount | undefined 

getUserAccounts

() => readonly UserAccount[] 

selectUserAccount

Select a specific UserAccount as the currently selected user account. If the KeyStore implements selecting UserAccounts in a way that does not allow arbitrary UserAccounts to be programatically selected, then the KeyStore should only ever return one available UserAccount from the userAccount$ and getUserAccounts properties.
(id?: UserAccountID) => Promise<void> 

deleteUserAccount

The KeyStore may optionally support deleting UserAccounts.
(id: UserAccountID) => Promise<void> 

updateUserAccountName

The KeyStore may optionally support updating the UserAccount name.
(options: UpdateAccountNameOptions) => Promise<void> 

sign

Sign an arbitrary message with the specified user account, returning a hex encoded string of the signature.
(options: { 
    readonly account: UserAccountID; 
    readonly message: string; 
}) => Promise<string> 
  • @neo-one/client
  • @neo-one/smart-contract
DOCS
InstallationMain ConceptsAdvanced GuidesAPI ReferenceContributing
CHANNELS
GitHubStack OverflowDiscord ChatTwitterYouTube
COPYRIGHT © 2021 NEO•ONE