DEFAULT_DENOMINATION_TARGET)
Cashu mint instance is used to make api calls
Optional options: { Optional bip39seed?: Uint8ArrayBIP39 seed for deterministic secrets. This can lead to poor performance, in which case the seed should be directly provided
Optional denominationtarget number proofs per denomination (default: see
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 mintmint info from the mint (will be fetched from mint if not provided)
Optional unit?: stringoptionally set unit (default is 'sat')
Private _denominationPrivate _keysPrivate _keysetPrivate _keysetsPrivate _mintPrivate _seedPrivate _unitReturn 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)
Private constructconstruct proofs from
promises,
rs,
secrets, and
keyset
array of serialized blinded signatures
arrays of binding factors
array of secrets
mint keyset
array of serialized proofs
Private createCreates NUT-08 blank outputs (fee returns) for a given fee reserve See: https://github.com/cashubtc/nuts/blob/main/08.md
amount to cover with blank outputs
mint keysetId
Optional counter: numberblinded messages, secrets, and rs
Private createCreates blinded messages for a according to
Optional counter: numberOptional pubkey: stringblinded messages, secrets, rs, and amounts
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
Private createCreates blinded messages for a given amount
amount to create blinded messages for
Optional split: number[]optional preference for splitting proofs into specific amounts. overrides amount param
Optional counter: numberOptional pubkey: stringblinded messages, secrets, rs, and amounts
Private createCreates a split payload
amount to send
proofs to split*
Optional outputAmounts: OutputAmountsOptional counter: numberOptional pubkey: stringOptional privkey: stringChoose 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
calculates the fees based on inputs (proofs)
input proofs to calculate fees for
fee amount
Get keysets from the mint with the unit of the wallet
keysets with wallet's unit
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 information about the mint
mint info
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: { Optional counter?: numberOptional keysetOptional privkey?: stringMint proofs for a given mint quote
amount to request
ID of mint quote
Optional options: { Optional counter?: numberOptional keysetOptional outputOptional proofsOptional pubkey?: stringproofs
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: { Optional counter?: numberOptional keysetOptional outputOptional privkey?: stringOptional proofsOptional pubkey?: stringNew 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: { Optional keysetset a custom keysetId to restore from. keysetIds can be loaded with CashuMint.getKeySets()
proofs
Optional 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: { Optional counter?: numberOptional includeOptional keysetOptional offline?: booleanOptional outputOptional privkey?: stringOptional proofsOptional pubkey?: stringSplits 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
amount to send while performing the optimal split (least proofs possible). can be set to undefined if preference is set
proofs matching that amount
Optional options: { Optional counter?: numberOptional includeOptional keysetOptional outputOptional privkey?: stringOptional proofsOptional pubkey?: stringpromise of the change- and send-proofs
Generated using TypeDoc
Class that represents a Cashu wallet. This class should act as the entry point for this library