Cashu-TS - v3.3.0
    Preparing search index...

    Class KeyChain

    Manages the unit-specific keysets for a Mint.

    Will ONLY load keysets in the KeyChain unit.

    Index

    Constructors

    Accessors

    Methods

    • Returns all the keys in this KeyChain.

      Returns MintKeys[]

      Array of MintKeys objects.

      This mirrors the old wallet.getAllKeys() behaviour and is the preferred replacement in v3.

      If uninitialized.

    • Returns all the keyset IDs in this KeyChain.

      Returns string[]

      Array of keyset IDs.

      If uninitialized.

    • Legacy Mint API cache format.

      Returns { keys: MintKeys[]; keysets: MintKeyset[]; mintUrl: string; unit: string }

      Useful for instantiating new wallets / keychains without repeatedly calling the mint API.

      Use the cache getter which returns a consolidated KeyChainCache.

    • Get the cheapest active keyset.

      Returns Keyset

      Active Keyset.

      Selects active keyset with lowest fee and hex ID.

      If none found or uninitialized.

    • Get a keyset by ID or the cheapest keyset if no ID is provided.

      Parameters

      • Optionalid: string

        Optional keyset ID.

      Returns Keyset

      Keyset with keys.

      If keyset not found or uninitialized.

    • Asynchronously load keysets and keys from the mint.

      Parameters

      • OptionalforceRefresh: boolean

        If true, re-fetches data even if already loaded.

      Returns Promise<void>

      Intended for callers that want the freshest data from the mint and can use an asynchronous path.

    • Synchronously load keysets and keys from cached data.

      Parameters

      Returns void

      Does not hit the network. Intended for callers that already have a KeyChainCache and want a synchronous path.