Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UnencryptedFileSystemKeyStore

This module contains the UnencryptedFileSystemKeyStore class which is used to store keys on the file system.

Hierarchy

  • KeyStore
    • UnencryptedFileSystemKeyStore

Constructors

constructor

  • Parameters

    • keyDir: string

      base directory for key storage. Keys will be stored in keyDir/chainId/accountId.json

    Returns UnencryptedFileSystemKeyStore

Methods

clear

  • clear(): Promise<void>
  • Deletes all unencrypted files from the keyDir path.

    Returns Promise<void>

entries

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

getAccounts

  • getAccounts(chainId: ChainId): Promise<string[]>
  • Gets the account(s) files in keyDir/chainId

    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 subdirectory names in keyDir

    Returns Promise<string[]>

getKey

  • Gets a KeyPair from an unencrypted file

    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>
  • Deletes an unencrypted file holding a KeyPair

    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>
  • Store a KeyPair in an unencrypted file

    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