@cashu/cashu-ts
    Preparing search index...

    Class KeyChain

    Manages the unit-specific keysets for a Mint.

    Will ONLY load keysets in the Keychain unit.

    Index

    Constructors

    Methods

    • Extract the Mint API data from the keychain.

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

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

    • 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.

    • Single entry point to load or refresh keysets and keys for the unit.

      Parameters

      • OptionalforceRefresh: boolean

        If true, refetch even if loaded.

      Returns Promise<void>

      Fetches in parallel, filters by unit, assigns keys.