Cashu TS is a JavaScript library for Cashu wallets written in Typescript.
Wallet Features:
- [x] connect to mint (load keys)
- [x] request minting tokens
- [x] minting tokens
- [x] sending tokens (get encoded token for chosen value)
- [x] receiving tokens
- [x] melting tokens
- [x] check if tokens are spent
- [ ] ...
Implemented NUTs:
- [x] NUT-00
- [x] NUT-01
- [x] NUT-02
- [x] NUT-03
- [x] NUT-04
- [x] NUT-05
- [x] NUT-06
- [x] NUT-07
- [x] NUT-08
- [x] NUT-09
- [x] NUT-11
Supported token formats:
- [x] v1 read
- [x] v2 read (deprecated)
- [x] v3 read/write
Go to the docs for detailed usage, or have a look at the integration tests for examples on how to implement a wallet.
npm i @cashu/cashu-ts
import { CashuMint, CashuWallet, getEncodedToken } from '@cashu/cashu-ts';
const mint = new CashuMint(mintUrl);
const wallet = new CashuWallet(mint);
const mintQuote = await wallet.mintQuote(64);
const tokens = await wallet.mintTokens(64, mintQuote.quote);
Contributions are very welcome.
If you want to contribute, please open an Issue or a PR.