Class CashuMint

Class represents Cashu Mint API. This class contains Lower level functions that are implemented by CashuWallet.

Hierarchy

  • CashuMint

Constructors

  • Parameters

    • _mintUrl: string

      requires mint URL to create this object

    Returns CashuMint

Properties

_mintUrl: string

requires mint URL to create this object

Accessors

  • get mintUrl(): string
  • Returns string

Methods

  • Estimate fees for a given LN invoice

    Parameters

    • checkfeesPayload: {
          pr: string;
      }

      Payload containing LN invoice that needs to get a fee estimate

      • pr: string

    Returns Promise<{
        fee: number;
    }>

    estimated Fee

  • Get the mints keysets in no specific order

    Returns Promise<{
        keysets: string[];
    }>

    all the mints past and current keysets.

  • Get the mints public keys

    Parameters

    • Optional keysetId: string

      optional param to get the keys for a specific keyset. If not specified, the keys from the active keyset are fetched

    Returns Promise<MintKeys>

    the mints public keys

  • Ask mint to perform a melt operation. This pays a lightning invoice and destroys tokens matching its amount + fees

    Parameters

    Returns Promise<MeltResponse>

  • Starts a minting process by requesting an invoice from the mint

    Parameters

    • amount: number

      Amount requesting for mint.

    Returns Promise<RequestMintResponse>

    the mint will create and return a Lightning invoice for the specified amount

  • Ask mint to perform a split operation

    Parameters

    • splitPayload: SplitPayload

      data needed for performing a token split

    Returns Promise<SplitResponse>

    split tokens

  • Estimate fees for a given LN invoice

    Parameters

    • mintUrl: string
    • checkfeesPayload: {
          pr: string;
      }

      Payload containing LN invoice that needs to get a fee estimate

      • pr: string

    Returns Promise<{
        fee: number;
    }>

    estimated Fee

  • fetches mints info at the /info endpoint

    Parameters

    • mintUrl: string

    Returns Promise<GetInfoResponse>

  • Get the mints keysets in no specific order

    Parameters

    • mintUrl: string

    Returns Promise<{
        keysets: string[];
    }>

    all the mints past and current keysets.

  • Get the mints public keys

    Parameters

    • mintUrl: string
    • Optional keysetId: string

      optional param to get the keys for a specific keyset. If not specified, the keys from the active keyset are fetched

    Returns Promise<MintKeys>

  • Ask mint to perform a melt operation. This pays a lightning invoice and destroys tokens matching its amount + fees

    Parameters

    Returns Promise<MeltResponse>

  • Requests the mint to perform token minting after the LN invoice has been paid

    Parameters

    • mintUrl: string
    • payloads: {
          outputs: SerializedBlindedMessage[];
      }

      outputs (Blinded messages) that can be written

    • hash: string

      hash (id) used for by the mint to keep track of wether the invoice has been paid yet

    Returns Promise<{
        promises: SerializedBlindedSignature[];
    } & ApiError>

    serialized blinded signatures

  • Starts a minting process by requesting an invoice from the mint

    Parameters

    • mintUrl: string
    • amount: number

      Amount requesting for mint.

    Returns Promise<RequestMintResponse>

    the mint will create and return a Lightning invoice for the specified amount

  • Ask mint to perform a split operation

    Parameters

    • mintUrl: string
    • splitPayload: SplitPayload

      data needed for performing a token split

    Returns Promise<SplitResponse>

    split tokens

Generated using TypeDoc