- Install applesauce-content package for content parsing - Use getParsedContent() to parse nostr content according to applesauce patterns - Create proper TypeScript interfaces for ParsedNode and ParsedContent - Add renderParsedContent() component to render parsed content with proper styling - Handle mentions, links, and text content with appropriate styling - Add CSS styles for nostr-mention and nostr-link classes - Follow applesauce-content documentation patterns for content rendering - Maintain type safety with proper interfaces instead of 'any' types This follows the applesauce-content documentation exactly as shown in the examples, providing proper content parsing and rendering.
2.5 KiB
Version 2.0.0 Migration guide
⚠️ Upgrading to version 2.0.0 will come with breaking changes! Please follow the migration guide for a smooth transition to the new version.
Breaking changes
CashuWallet interface changes
removed payLnInvoice helper
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);
Preference for outputs are now passed as a object of simple arrays
AmountPreference is not used anymore.
preference?: Array<AmountPreference>; -> outputAmounts?: OutputAmounts;
where
export type OutputAmounts = {
sendAmounts: Array<number>;
keepAmounts?: Array<number>;
};
CashuWallet can no longer be instantiated using BIP39 mnemonic!
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 });
checkProofsStates replaces checkProofsSpent
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.
renamed functions
- in
SendResponse,returnChangeis 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()
Type changes
Wallet payload types
BlindedTransactionhas been removedBlindedMessageDatahas been replaced byBlindingData- In
BlindingDatarshas been renamed toblindingFactors
- In
Token Types
- The
Tokentype 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
Tokentype got renamed toDeprecatedToken