The helper function was removed. Instead users will have to manage a melt quote manually:
const quote = await wallet.createMeltQuote(invoice);
const totalAmount = quote.fee_reserve + invoiceAmount;
const { keep, send } = await wallet.send(totalAmount, proofs);
const payRes = await wallet.meltProofs(quote, send);
AmountPreference
is not used anymore.
preference?: Array<AmountPreference>;
-> outputAmounts?: OutputAmounts;
where
export type OutputAmounts = {
sendAmounts: Array<number>;
keepAmounts?: Array<number>;
};
In order to reduce the bundle size, BIP39 has been removed as a dependency of cashu-ts. Therefore users that want to use deterministic secrets with a BIP39 menmonic will have to convert the wordlist into a seed manually and then instantiate the wallet using:
const wallet = new CashuWallet(mint, { bip39seed: uint8ArrayOfSeed });
To check the state of a Proof
, call CashuWallet.checkProofsStates
. checkProofsStates
now returns an array of ProofState
's, one for each Proof
provided. The spent states are in ProofState.state
and can have the values CheckStateEnum.SPENT
, CheckStateEnum.UNSPENT
, and CheckStateEnum.PENDING
. ProofState
also contains a witness
if present.
- in
SendResponse
,returnChange
is now calledkeep
CashuWallet.mintTokens()
is now calledCashuWallet.mintProofs()
and returns <Promise<Array> instead of Promise<{proofs: Array}>CashuWallet.meltTokens()
is now calledCashuWallet.meltProofs()
CashuMint.split()
is now calledCashuMint.swap()
BlindedTransaction
has been removedBlindedMessageData
has been replaced byBlindingData
- In
BlindingData
rs
has been renamed toblindingFactors
- In
- The
Token
type no longer reassembles the token v3 structure, but instead is a simple object type:
type Token = {
mint: string;
proofs: Array<Proof>;
memo?: string;
unit?: string;
};
- The old
Token
type got renamed toDeprecatedToken