import { getEncodedToken } from'@cashu/cashu-ts'; // we assume that `wallet` already minted `proofs`, as above // or you fetched existing proofs from your app database constproofs = [...]; // array of proofs const { keep, send } = awaitwallet.send(32, proofs); consttoken = getEncodedToken({ mint:mintUrl, proofs:send }); console.log(token);
constwallet2 = newWallet(mintUrl); // receiving wallet awaitwallet2.loadMint(); // wallet2 is now ready to use constreceiveProofs = awaitwallet2.receive(token); // store receiveProofs in your app ..