Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BrowserLocalStorageKeyStore

This class is used to store keys in the browsers local storage.

example

{@link }

example

Hierarchy

Constructors

constructor

  • Parameters

    • localStorage: any = ...

      defaults to window.localStorage

    • prefix: string = ...

      defaults to minter-api-js:keystore:

    Returns BrowserLocalStorageKeyStore

Methods

clear

  • clear(): Promise<void>
  • Removes all items that start with prefix from local storage

    Returns Promise<void>

entries

  • entries(): Promise<IterableIterator<[string, string]>>
  • Returns Promise<IterableIterator<[string, string]>>

getAccounts

  • getAccounts(chainId: ChainId): Promise<string[]>
  • Gets the account(s) from local storage

    returns{promise<string[]>}

    Parameters

    • chainId: ChainId

      The targeted network. (ex. mainnet, testnet, etc…)

    Returns Promise<string[]>

getChains

  • getChains(): Promise<string[]>
  • Get the network(s) from local storage

    Returns Promise<string[]>

getKey

  • Gets a KeyPair from local storage

    Parameters

    • chainId: ChainId

      The targeted network. (ex. mainnet, testnet, etc…)

    • accountId: string

      The Minter account tied to the key pair

    Returns Promise<KeyPair>

removeKey

  • removeKey(chainId: ChainId, accountId: string): Promise<void>
  • Removes a KeyPair from local storage

    Parameters

    • chainId: ChainId

      The targeted network. (ex. mainnet, testnet, etc…)

    • accountId: string

      The Minter account tied to the key pair

    Returns Promise<void>

setKey

  • setKey(chainId: ChainId, accountId: string, keyPair: KeyPair): Promise<void>
  • Stores a KeyPair in local storage.

    Parameters

    • chainId: ChainId

      The targeted network. (ex. mainnet, testnet, etc…)

    • accountId: string

      The Minter account tied to the key pair

    • keyPair: KeyPair

      The key pair to store in local storage

    Returns Promise<void>

Generated using TypeDoc