Requires mint URL to create this object.
Optionaloptions: { authProvider?: AuthProvider; customRequest?: RequestFn; logger?: Logger }Checks if specific proofs have already been redeemed.
The payload containing proofs to check.
OptionalcustomRequest: RequestFnOptional override for the request function.
Redeemed and unredeemed ordered list of booleans.
Checks an existing melt quote for any payment method.
The melt quote response.
Uses /v1/melt/quote/{method}/{quote} and validates method format. Normalization follows the
same stacking pattern as Mint.createMeltQuote.
Gets an existing melt quote.
Quote ID.
OptionalcustomRequest: RequestFnOptional override for the request function.
The melt quote response.
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.
OptionalcustomRequest: RequestFnOptional override for the request function.
Updated quote with current payment state and preimage if available.
Checks an existing mint quote for any payment method.
The mint quote response.
Uses /v1/mint/quote/{method}/{quote} and validates method format. Normalization follows the
same stacking pattern as Mint.createMintQuote.
Gets an existing mint quote from the mint.
Quote ID.
OptionalcustomRequest: RequestFnOptional override for the request function.
The status of the mint quote, including payment details and state.
Gets an existing BOLT12 mint quote from the mint.
Quote ID to check.
OptionalcustomRequest: RequestFnOptional override for the request function.
Updated quote with current payment and issuance amounts.
Tries to establish a websocket connection with the websocket mint url according to NUT-17.
Creates a melt quote for any payment method.
The melt quote response.
Uses /v1/melt/quote/{method} and validates method format. Base normalization (amount, expiry,
change) is always applied. For first-class methods (bolt11/bolt12), bolt-specific normalization
(fee_reserve, request) is stacked on top. Custom methods can supply an optional normalize
callback for their own fields.
Requests a new melt quote from the mint.
Payload for creating a new melt quote.
OptionalcustomRequest: RequestFnOptional override for the request function.
The melt quote response.
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.
OptionalcustomRequest: RequestFnOptional override for the request function.
Melt quote with amount, fee reserve, and payment state.
Creates a mint quote for any payment method.
The mint quote response.
Requests a new mint quote from the mint.
Payload for creating a new mint quote.
OptionalcustomRequest: RequestFnOptional override for the request function.
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.
OptionalcustomRequest: RequestFnOptional override for the request function.
A mint quote containing a BOLT12 offer.
Closes a websocket connection.
Fetches mint's info at the /info endpoint.
OptionalcustomRequest: RequestFnOptional override for the request function.
The mint's information response.
Get the mint's public keys.
OptionalkeysetId: stringOptional param to get the keys for a specific keyset. If not specified, the keys from all active keysets are fetched.
OptionalmintUrl: stringOptional alternative mint URL to use for this request.
OptionalcustomRequest: RequestFnOptional override for the request function.
The mint's public keys.
Get the mint's keysets in no specific order.
OptionalcustomRequest: RequestFnOptional override for the request function.
All the mint's past and current keysets.
Generic method to melt tokens using any payment method endpoint.
The payment method (e.g., 'bolt11', 'bolt12', or custom method name).
The melt payload containing inputs and optional outputs.
Optionaloptions: {OptionalcustomRequest?: RequestFnOptional override for the request function.
Optionalnormalize?: (raw: Record<string, unknown>) => MeltQuoteBaseResponse & TResOptional callback to normalize method-specific response fields.
A response object with at least the required melt quote fields.
This method enables support for custom payment methods without modifying the Mint class. It
constructs the endpoint as /v1/melt/{method} and POSTs the payload. The response must contain
the common fields: quote, amount, state, expiry. Method-specific fields (e.g. fee_reserve for
bolt11/bolt12) are normalized when present. Custom methods can supply an optional normalize
callback for their own fields.
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.
The melt payload containing inputs and optional outputs.
Optionaloptions: { customRequest?: RequestFn }OptionalcustomRequest?: RequestFnOptional override for the request function.
The melt response.
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.
Optionaloptions: { customRequest?: RequestFn }OptionalcustomRequest?: RequestFnOptional override for the request function.
Payment result with state and optional change signatures.
Mints new tokens for a given payment method.
The minting method (e.g., 'bolt11', 'bolt12', or custom method name).
Payload containing the quote ID and outputs to get blind signatures on.
Optionaloptions: {OptionalcustomRequest?: RequestFnOptional override for the request function.
Optionalnormalize?: (raw: Record<string, unknown>) => MintResponse & TResOptional callback to normalize method-specific response fields.
Serialized blinded signatures for the requested outputs.
Mints new tokens by requesting blind signatures on the provided outputs.
Payload containing the outputs to get blind signatures on.
OptionalcustomRequest: RequestFnOptional override for the request function.
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.
OptionalcustomRequest: RequestFnOptional override for the request function.
Serialized blinded signatures for the requested outputs.
Create an OIDC client using this mint’s NUT-21 metadata.
Optionalopts: OIDCAuthOptionsconst oidc = await mint.oidcAuth({ onTokens: (t) => authMgr.setCAT(t.access_token!) });
const start = await oidc.deviceStart();
// show start.user_code / start.verification_uri to the user
const token = await oidc.devicePoll(start.device_code, start.interval ?? 5);
// token.access_token is your CAT
Restores proofs from the provided blinded messages.
The payload containing outputs to restore.
OptionalcustomRequest: RequestFnOptional override for the request function.
The restore response with outputs and signatures.
Seeds the mint-info cache from already-fetched data.
Performs a swap operation with ecash inputs and outputs.
Payload containing inputs and outputs.
OptionalcustomRequest: RequestFnOptional override for the request function.
Signed outputs.
Class represents Cashu Mint API.
Remarks
This class contains lower-level functions that are implemented by Wallet.