Requires mint URL to create this object.
Optional
_customRequest: <T>(options: RequestOptions) => Promise<T>If passed, use custom request implementation for network communication with the mint.
Optional
authTokenGetter: () => Promise<string>A function that is called by the CashuMint instance to obtain a NUT-22 BlindedAuthToken (e.g. from a database or localstorage)
Optional
options: { logger?: Logger }Checks if specific proofs have already been redeemed.
Redeemed and unredeemed ordered list of booleans.
Gets an existing melt quote.
Quote ID.
Gets an existing BOLT12 melt quote from the mint. Returns current payment state (UNPAID, PENDING, or PAID) and payment preimage if paid.
Quote ID to check.
Updated quote with current payment state and preimage if available.
Gets an existing mint quote from the mint.
Quote ID.
The mint will create and return a Lightning invoice for the specified amount.
Gets an existing BOLT12 mint quote from the mint.
Quote ID to check.
Updated quote with current payment and issuance amounts.
Tries to establish a websocket connection with the websocket mint url according to NUT-17.
Requests a new melt quote from the mint.
Requests a new BOLT12 melt quote from the mint for paying a Lightning Network offer. For amount-less offers, specify the amount in options.amountless.amount_msat.
Payload containing the BOLT12 offer to pay and unit.
Melt quote with amount, fee reserve, and payment state.
Requests a new mint quote from the mint.
Payload for creating a new mint quote.
The mint will create and return a new mint quote containing a payment request for the specified amount and unit.
Requests a new BOLT12 mint quote from the mint using Lightning Network offers.
Payload containing amount, unit, optional description, and required pubkey.
A mint quote containing a BOLT12 offer.
Closes a websocket connection.
Fetches mints info at the /info endpoint.
Get the mints public keys.
Optional
keysetId: stringOptional param to get the keys for a specific keyset. If not specified, the keys from all active keysets are fetched.
Optional
mintUrl: stringThe mints public keys.
Get the mints keysets in no specific order.
All the mints past and current keysets.
Ask mint to perform a melt operation. This pays a lightning invoice and destroys tokens matching its amount + fees.
Requests the mint to pay a BOLT12 offer by providing ecash inputs to be spent. The inputs must cover the amount plus fee reserves. Optional outputs can be included to receive change for overpaid Lightning fees.
Payload containing quote ID, inputs, and optional outputs for change.
Payment result with state and optional change signatures.
Mints new tokens by requesting blind signatures on the provided outputs.
Payload containing the outputs to get blind signatures on.
Serialized blinded signatures.
Mints new tokens using a BOLT12 quote by requesting blind signatures on the provided outputs.
Payload containing the quote ID and outputs to get blind signatures on.
Serialized blinded signatures for the requested outputs.
Performs a swap operation with ecash inputs and outputs.
Payload containing inputs and outputs.
Signed outputs.
Static
checkChecks if specific proofs have already been redeemed.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Redeemed and unredeemed ordered list of booleans.
Static
checkGets an existing melt quote.
Quote ID.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional
blindAuthToken: stringOptional
logger: LoggerStatic
checkGets an existing BOLT12 melt quote from the mint. Returns current payment state (UNPAID, PENDING, or PAID) and payment preimage if paid.
The mint's base URL.
Quote ID to check.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional custom request implementation.
Optional
blindAuthToken: stringOptional authentication token for NUT-22.
Updated quote with current payment state and preimage if available.
Static
checkGets an existing mint quote from the mint.
Quote ID.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional
blindAuthToken: stringOptional
logger: LoggerThe mint will create and return a Lightning invoice for the specified amount.
Static
checkGets an existing BOLT12 mint quote from the mint.
The mint's base URL.
Quote ID to check.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional custom request implementation.
Optional
blindAuthToken: stringOptional authentication token for NUT-22.
Updated quote with current payment and issuance amounts.
Static
createRequests a new melt quote from the mint.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional
blindAuthToken: stringOptional
logger: LoggerStatic
createRequests a new BOLT12 melt quote from the mint for paying a Lightning Network offer. For amount-less offers, specify the amount in options.amountless.amount_msat.
The mint's base URL.
Payload containing the BOLT12 offer to pay and unit.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional custom request implementation.
Optional
blindAuthToken: stringOptional authentication token for NUT-22.
Melt quote with amount, fee reserve, and payment state.
Static
createRequests a new mint quote from the mint.
Payload for creating a new mint quote.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional
blindAuthToken: stringOptional
logger: LoggerThe mint will create and return a new mint quote containing a payment request for the specified amount and unit.
Static
createRequests a new BOLT12 mint quote from the mint using Lightning Network offers.
The mint's base URL.
Payload containing amount, unit, optional description, and required pubkey.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional custom request implementation.
Optional
blindAuthToken: stringOptional authentication token for NUT-22.
A mint quote containing a BOLT12 offer.
Static
getFetches mints info at the /info endpoint.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional
logger: LoggerStatic
getGet the mints public keys.
Optional
keysetId: stringOptional param to get the keys for a specific keyset. If not specified, the keys from all active keysets are fetched.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Static
getGet the mints keysets in no specific order.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>All the mints past and current keysets.
Static
meltRequests 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.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional
blindAuthToken: stringOptional
logger: LoggerStatic
meltRequests the mint to pay a BOLT12 offer by providing ecash inputs to be spent. The inputs must cover the amount plus fee reserves. Optional outputs can be included to receive change for overpaid Lightning fees.
The mint's base URL.
Payload containing quote ID, inputs, and optional outputs for change.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional custom request implementation.
Optional
blindAuthToken: stringOptional authentication token for NUT-22.
Payment result with state and optional change signatures.
Static
mintMints new tokens by requesting blind signatures on the provided outputs.
Payload containing the outputs to get blind signatures on.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional
blindAuthToken: stringSerialized blinded signatures.
Static
mintMints new tokens using a BOLT12 quote by requesting blind signatures on the provided outputs.
The mint's base URL.
Payload containing the quote ID and outputs to get blind signatures on.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional custom request implementation.
Optional
blindAuthToken: stringOptional authentication token for NUT-22.
Serialized blinded signatures for the requested outputs.
Static
restoreOptional
customRequest: <T>(options: RequestOptions) => Promise<T>Static
swapPerforms a swap operation with ecash inputs and outputs.
Payload containing inputs and outputs.
Optional
customRequest: <T>(options: RequestOptions) => Promise<T>Optional
blindAuthToken: stringSigned outputs.
Class represents Cashu Mint API. This class contains Lower level functions that are implemented by CashuWallet.