⚠️ Don't be reckless: This project is in early development, it does however work with real sats! Always use amounts you don't mind loosing.
Cashu TS is a JavaScript library for Cashu wallets written in Typescript.
Wallet Features:
Implemented NUTs:
Supported token formats:
npm i @cashu/cashu-ts
import { CashuMint, CashuWallet, getEncodedToken } from '@cashu/cashu-ts';
const wallet = new CashuWallet(new CashuMint('{MINT_URL}'));
const { pr, hash } = await wallet.requestMint(200);
//pay this LN invoice
console.log({ pr }, { hash });
async function invoiceHasBeenPaid() {
const proofs = await wallet.requestTokens(200, hash);
//Encoded proofs can be spent at the mint
const encoded = getEncodedToken({
token: [{ mint: '{MINT_URL}', proofs }]
});
console.log(encoded);
}
Contributions are very welcome.
If you want to contribute, please open an Issue or a PR.
Generated using TypeDoc