Cashu mint instance is used to make api calls
Optional
options: {Optional
bip39seed?: Uint8Array<ArrayBufferLike>BIP39 seed for deterministic secrets.
Optional
denominationTarget?: numbertarget number proofs per denomination (default: see
Optional
keepFactory?: OutputDataFactoryA function that will be used by all parts of the library that produce proofs to be kept (change, etc.). This can lead to poor performance, in which case the seed should be directly provided
Optional
keys?: MintKeys | MintKeys[]public keys from the mint (will be fetched from mint if not provided)
Optional
keysets?: MintKeyset[]keysets from the mint (will be fetched from mint if not provided)
Optional
mintInfo?: GetInfoResponsemint info from the mint (will be fetched from mint if not provided)
Optional
unit?: stringoptionally set unit (default is 'sat')
Return an existing melt quote from the mint.
ID of the melt quote
the mint will return an existing melt quote
Gets an existing mint quote from the mint.
Quote ID
the mint will create and return a Lightning invoice for the specified amount
Get an array of the states of proofs from the mint (as an array of CheckStateEnum's)
(only the secret
field is required)
Requests a melt quote from the mint. Response returns amount and fees for a given unit in order to pay a Lightning invoice.
LN invoice that needs to get a fee estimate
the mint will create and return a melt quote for the invoice with an amount and fee reserve
Requests a mint quote form the mint. Response returns a Lightning payment request for the requested given amount and unit.
Amount requesting for mint.
Optional
description: stringoptional description for the mint quote
the mint will return a mint quote with a Lightning invoice for minting tokens of the specified amount and unit
Choose a keyset to activate based on the lowest input fee
Note: this function will filter out deprecated base64 keysets
keysets to choose from
active keyset
Get public keys from the mint. If keys were already fetched, it will return those.
If keysetId
is set, it will fetch and return that specific keyset.
Otherwise, we select an active keyset with the unit of the wallet.
Optional
keysetId: stringoptional keysetId to get keys for
Optional
forceRefresh: booleankeyset
Get keysets from the mint with the unit of the wallet
keysets with wallet's unit
Melt proofs for a melt quote. proofsToSend must be at least amount+fee_reserve form the melt quote. This function does not perform coin selection!. Returns melt quote and change proofs
ID of the melt quote
proofs to melt
Optional
options: MeltProofOptionsOptional parameters for configuring the Melting Proof operation
Mint proofs for a given mint quote
amount to request
ID of mint quote
Optional
options: MintProofOptionsOptional parameters for configuring the Mint Proof operation
proofs
Register a callback to be called whenever a melt quote's state changes
Callback function that will be called whenever a melt quote state changes
Register a callback to be called when a single melt quote gets paid
Callback function that will be called when this melt quote gets paid
Register a callback to be called when a single mint quote gets paid
Mint quote id that should be subscribed to
Callback function that will be called when this mint quote gets paid
Register a callback to be called whenever a mint quote's state changes
List of mint quote IDs that should be subscribed to
Callback function that will be called whenever a mint quote state changes
Register a callback to be called whenever a subscribed proof state changes
List of proofs that should be subscribed to
Callback function that will be called whenever a proof's state changes
Receive an encoded or raw Cashu token (only supports single tokens. It will only process the first token in the token array)
Cashu token, either as string or decoded
Optional
options: ReceiveOptionsOptional configuration for token processing
New token with newly created proofs, token entries that had errors
Regenerates
set starting point for count (first cycle for each keyset should usually be 0)
set number of blinded messages that should be generated
Optional
options: RestoreOptionsOptional
includeFees: booleanSend proofs of a given amount, by providing at least the required amount of proofs
amount to send
array of proofs (accumulated amount of proofs must be >= than amount)
Optional
options: SendOptionsOptional parameters for configuring the send operation
Splits and creates sendable tokens if no amount is specified, the amount is implied by the cumulative amount of all proofs if both amount and preference are set, but the preference cannot fulfill the amount, then we use the default split
Optional
options: SwapOptionsOptional parameters for configuring the swap operation
promise of the change- and send-proofs
Class that represents a Cashu wallet. This class should act as the entry point for this library