Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Keyring

A collection of wallets

Hierarchy

  • Keyring

Index

Constructors

constructor

Methods

add

  • Stores a copy of the given wallet in the Keyring.

    Outside changes of the wallet do not affect the Keyring. Use keyring's setWalletLabel, createIdentity, setIdentityLabel to mutate wallets in the keyring.

    Parameters

    Returns WalletInfo

clone

createIdentity

  • createIdentity(walletId: WalletId, chainId: ChainId, options: Ed25519Keypair | keyof Slip10RawIndex[] | number): Promise<Identity>
  • Creates an identity in the wallet with the given ID in the primary keyring

    The identity is bound to one chain ID to encourage using different keypairs on different chains.

    Parameters

    • walletId: WalletId
    • chainId: ChainId
    • options: Ed25519Keypair | keyof Slip10RawIndex[] | number

    Returns Promise<Identity>

getAllIdentities

  • getAllIdentities(): keyof Identity[]
  • All identities of all wallets

    Returns keyof Identity[]

getWallet

  • Finds a wallet and returns an immutable reference.

    Parameters

    Returns ReadonlyWallet | undefined

    a wallet if ID is found, undefined otherwise

getWalletByIdentity

  • Finds a wallet for a given identity and returns an immutable reference.

    Parameters

    • identity: Identity

    Returns ReadonlyWallet | undefined

    a wallet if ID is found, undefined otherwise

getWallets

  • getWallets(): keyof ReadonlyWallet[]
  • Returns an array with immutable references.

    Returns keyof ReadonlyWallet[]

serialize

setIdentityLabel

  • setIdentityLabel(identity: Identity, label: string | undefined): void
  • Assigns a label to one of the identities in the wallet with the given ID in the primary keyring

    Parameters

    • identity: Identity
    • label: string | undefined

    Returns void

setWalletLabel

  • setWalletLabel(walletId: WalletId, label: string | undefined): void
  • Sets the label of the wallet with the given ID in the primary keyring

    Parameters

    • walletId: WalletId
    • label: string | undefined

    Returns void

Static registerWalletType

Generated using TypeDoc