Type alias KeyStoreInteractor

KeyStoreInteractor: {
    login: ((loginOptions) => Promise<SessionWithLogout>);
    getAccounts(): Promise<Account[]>;
    getAccountsPaginated(limit, cursor): Promise<PaginatedEntity<Account>>;
    getSession(accountId): Promise<Session>;
    onKeyStoreChanged(callback): void;
}

Type declaration

  • login: ((loginOptions) => Promise<SessionWithLogout>)

    Uses the underlying keystore to sign into the specified account

    Returns

    the authenticated temporary session

  • getAccounts:function
    • Retrieves a list of Accounts associated with the signer. At most MAX_PAGE_SIZE. To fetch more Accounts, use getAccountsPaginated

      Returns Promise<Account[]>

  • getAccountsPaginated:function
  • getSession:function
    • Creates a session object for the provided account id.

      Parameters

      • accountId: BufferId

        account id to create a session for

      Returns Promise<Session>

  • onKeyStoreChanged:function
    • Register a callback that is invoked when the underlying keystore is changed. This could e.g., happen if the user switches account in MetaMask.

      Parameters

      • callback: ((newKeyStore) => void)

        the callback function to invoke when keystore changes

      Returns void