github cashubtc/cashu-ts v3.0.0

one day ago

Version 3.0.0 - Major Release

We're excited to announce version 3.0.0 of cashu-ts! This release brings significant improvements to the API design, making it more intuitive and powerful. While this version includes breaking changes, we've streamlined the developer experience and added new features that make working with Cashu easier than ever.

Highlights

Simplified Class Names & Initialization

  • CashuWalletWallet
  • CashuMintMint
  • Wallets can now be instantiated directly with a mint URL
  • New loadMint() method completes initialization

New Fluent Builder API

Introducing WalletOps - a beautiful, chainable API for wallet operations:

const { keep, send } = await wallet.ops
  .send(amount, proofs)
  .asP2PK({ pubkey: bytesToHex(pubKeyBob) })
  .includeFees(true)
  .run();

Simplified Exports

  • Crypto functions now exported directly from main package
  • No more sub-module imports needed
  • Cleaner, more consistent type names

Better Organization

  • Keyset management delegated to wallet.keyChain
  • Event subscriptions delegated to wallet.on
  • More modular and maintainable code structure

Enhanced Authentication

  • New AuthManager for CAT/BAT management
  • createAuthWallet() helper for authenticated sessions
  • Modern OIDCAuth class for OIDC flows

API Cleanup

  • Logger now uses lowercase string levels ('debug', 'info', etc.)
  • Mint methods renamed for clarity (e.g., createMintQuoteBolt11)
  • Removed unused constants and deprecated code

Developer Experience and Type Safety

  • Lots of internal refactoring make it easier to work on Cashu-TS
  • Typesafety on configs and method increased to make using Cashu-TS easier

Migration Guide

Please see the full migration guide for detailed instructions on upgrading your code.

Thank You

Thanks to all contributors who made this release possible! Special thanks to @robwoodgate who led the redesign effort and showed incredible dedication in building this release!

What's Changed

Full Changelog: v2.7.2...v3.0.0

Don't miss a new cashu-ts release

NewReleases is sending notifications on new releases.