diff --git a/package-lock.json b/package-lock.json index 07b5cbd3..f4edd970 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19507,6 +19507,7 @@ } }, "src/contrib/cashu-ts": { + "name": "@cashu/cashu-ts", "version": "1.0.0-rc.3", "license": "MIT", "dependencies": { diff --git a/src/stores/wallet.ts b/src/stores/wallet.ts index cacce241..4ef39ed1 100644 --- a/src/stores/wallet.ts +++ b/src/stores/wallet.ts @@ -300,7 +300,7 @@ export const useWalletStore = defineStore("wallet", { mintStore.removeProofs(proofsToSplit); return { keepProofs, sendProofs }; }, - splitToSend: async function (proofs: WalletProof[], amount: number, invlalidate: boolean = false) { + splitToSend: async function (proofs: WalletProof[], amount: number, invalidate: boolean = false) { /* splits proofs so the user can keep firstProofs, send scndProofs. then sets scndProofs as reserved. @@ -332,12 +332,19 @@ export const useWalletStore = defineStore("wallet", { mintStore.addProofs(sendProofs); } else if (totalAmount == amount) { keepProofs = []; - sendProofs = proofsToSplit; + sendProofs = proofsToSplit.map((p) => { + return { + amount: p.amount, + secret: p.secret, + C: p.C, + id: p.id, + }; + }); } else { throw new Error("could not split proofs."); } - if (invlalidate) { + if (invalidate) { mintStore.removeProofs(sendProofs); }