From 9f57bd4cf71d8543eaac4f7be3e88ac0ec99e5ba Mon Sep 17 00:00:00 2001 From: elnosh Date: Fri, 12 Jul 2024 06:06:54 -0500 Subject: [PATCH] remove unneeded reserved field in token to send (#190) --- package-lock.json | 1 + src/stores/wallet.ts | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) 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); }