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

    • Optional _customRequest: (<T>(options) => Promise<T>)

      if passed, use custom request implementation for network communication with the mint

        • <T>(options): Promise<T>
        • Type Parameters

          • T

          Parameters

          • options: RequestOptions

          Returns Promise<T>

    Returns CashuMint

Properties

_customRequest?: (<T>(options) => Promise<T>)

Type declaration

    • <T>(options): Promise<T>
    • if passed, use custom request implementation for network communication with the mint

      Type Parameters

      • T

      Parameters

      • options: RequestOptions

      Returns Promise<T>

_mintUrl: string

requires mint URL to create this object

Accessors

Methods

  • Gets an existing mint quote from the mint.

    Parameters

    • quote: string

      Quote ID

    Returns Promise<MintQuoteResponse>

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

  • Requests a new mint quote from the mint.

    Parameters

    Returns Promise<MintQuoteResponse>

    the mint will create and return a new mint quote containing a payment request for the specified amount and unit

  • 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 all active keysets are fetched

    • Optional mintUrl: string

    Returns Promise<MintActiveKeys>

    the mints public keys

  • Mints new tokens by requesting blind signatures on the provided outputs.

    Parameters

    • mintPayload: MintPayload

      Payload containing the outputs to get blind signatures on

    Returns Promise<MintResponse>

    serialized blinded signatures

  • Checks if specific proofs have already been redeemed

    Parameters

    • mintUrl: string
    • checkPayload: CheckStatePayload
    • Optional customRequest: (<T>(options) => Promise<T>)
        • <T>(options): Promise<T>
        • Type Parameters

          • T

          Parameters

          • options: RequestOptions

          Returns Promise<T>

    Returns Promise<CheckStateResponse>

    redeemed and unredeemed ordered list of booleans

  • Gets an existing melt quote.

    Parameters

    • mintUrl: string
    • quote: string

      Quote ID

    • Optional customRequest: (<T>(options) => Promise<T>)
        • <T>(options): Promise<T>
        • Type Parameters

          • T

          Parameters

          • options: RequestOptions

          Returns Promise<T>

    Returns Promise<MeltQuoteResponse>

  • Gets an existing mint quote from the mint.

    Parameters

    • mintUrl: string
    • quote: string

      Quote ID

    • Optional customRequest: (<T>(options) => Promise<T>)
        • <T>(options): Promise<T>
        • Type Parameters

          • T

          Parameters

          • options: RequestOptions

          Returns Promise<T>

    Returns Promise<MintQuoteResponse>

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

  • Requests a new melt quote from the mint.

    Parameters

    • mintUrl: string
    • meltQuotePayload: MeltQuotePayload
    • Optional customRequest: (<T>(options) => Promise<T>)
        • <T>(options): Promise<T>
        • Type Parameters

          • T

          Parameters

          • options: RequestOptions

          Returns Promise<T>

    Returns Promise<MeltQuoteResponse>

  • Requests a new mint quote from the mint.

    Parameters

    • mintUrl: string
    • mintQuotePayload: MintQuotePayload

      Payload for creating a new mint quote

    • Optional customRequest: (<T>(options) => Promise<T>)
        • <T>(options): Promise<T>
        • Type Parameters

          • T

          Parameters

          • options: RequestOptions

          Returns Promise<T>

    Returns Promise<MintQuoteResponse>

    the mint will create and return a new mint quote containing a payment request for the specified amount and unit

  • fetches mints info at the /info endpoint

    Parameters

    • mintUrl: string
    • Optional customRequest: (<T>(options) => Promise<T>)
        • <T>(options): Promise<T>
        • Type Parameters

          • T

          Parameters

          • options: RequestOptions

          Returns Promise<T>

    Returns Promise<GetInfoResponse>

  • Get the mints keysets in no specific order

    Parameters

    • mintUrl: string
    • Optional customRequest: (<T>(options) => Promise<T>)
        • <T>(options): Promise<T>
        • Type Parameters

          • T

          Parameters

          • options: RequestOptions

          Returns Promise<T>

    Returns Promise<MintAllKeysets>

    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 all active keysets are fetched

    • Optional customRequest: (<T>(options) => Promise<T>)
        • <T>(options): Promise<T>
        • Type Parameters

          • T

          Parameters

          • options: RequestOptions

          Returns Promise<T>

    Returns Promise<MintActiveKeys>

  • Requests the mint to pay for a Bolt11 payment request by providing ecash as inputs to be spent. The inputs contain the amount and the fee_reserves for a Lightning payment. The payload can also contain blank outputs in order to receive back overpaid Lightning fees.

    Parameters

    • mintUrl: string
    • meltPayload: MeltPayload
    • Optional customRequest: (<T>(options) => Promise<T>)
        • <T>(options): Promise<T>
        • Type Parameters

          • T

          Parameters

          • options: RequestOptions

          Returns Promise<T>

    Returns Promise<MeltQuoteResponse>

  • Mints new tokens by requesting blind signatures on the provided outputs.

    Parameters

    • mintUrl: string
    • mintPayload: MintPayload

      Payload containing the outputs to get blind signatures on

    • Optional customRequest: (<T>(options) => Promise<T>)
        • <T>(options): Promise<T>
        • Type Parameters

          • T

          Parameters

          • options: RequestOptions

          Returns Promise<T>

    Returns Promise<MintResponse>

    serialized blinded signatures

  • Performs a swap operation with ecash inputs and outputs.

    Parameters

    • mintUrl: string
    • swapPayload: SwapPayload

      payload containing inputs and outputs

    • Optional customRequest: (<T>(options) => Promise<T>)
        • <T>(options): Promise<T>
        • Type Parameters

          • T

          Parameters

          • options: RequestOptions

          Returns Promise<T>

    Returns Promise<SwapResponse>

    signed outputs

Generated using TypeDoc