diff --git a/package.json b/package.json index c95f1d0..c918aea 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "machine-translate": "npx @inlang/cli machine translate --project minibits.inlang" }, "dependencies": { - "@cashu/cashu-ts": "^4.7.0", + "@cashu/cashu-ts": "^4.7.1", "@fortawesome/fontawesome-svg-core": "^7.1.0", "@fortawesome/free-brands-svg-icons": "^7.1.0", "@fortawesome/free-regular-svg-icons": "^7.1.0", diff --git a/src/models/WalletStore.ts b/src/models/WalletStore.ts index 12cf9fe..6e7764e 100644 --- a/src/models/WalletStore.ts +++ b/src/models/WalletStore.ts @@ -920,23 +920,13 @@ export const WalletStoreModel = types /** * Mint ecash against a confirmed onchain deposit. * - * Mirrors `mintProofs` (same counter discipline, same NUT-19 in-flight - * record, same error surface) with two differences: + * Mirrors `mintProofs`: same counter discipline, same NUT-19 in-flight record, + * same error surface. * - * - it goes through the GENERIC `mintProofs('onchain', ...)` rather than - * the `mintProofsOnchain` sugar. The sugar takes a narrowed config of - * just `{keysetId}` — it silently drops `onCountersReserved`, which is - * how we learn which derivation indices the library actually consumed. - * Losing that would desync our counter and risk blinded-secret reuse. - * The generic form takes the full MintProofsConfig, which carries BOTH - * `privkey` and `onCountersReserved`. - * - * - `quote` is the whole MintQuoteOnchainResponse, not an id. cashu-ts - * signs the request (NUT-20) when the quote carries a `pubkey`, and it - * reads that off the quote object. - * - * `privkey` is derived on demand from the seed and the quote's stored - * counterIndex; it is never persisted. + * `quote` is the whole MintQuoteOnchainResponse, not an id — cashu-ts signs the + * request (NUT-20) when the quote carries a `pubkey`, and it reads that off the + * quote object. `privkey` is derived on demand from the seed and the quote's + * stored counterIndex; it is never persisted. */ mintOnchainProofs: flow(function* mintOnchainProofs( mintUrl: string, @@ -995,13 +985,12 @@ export const WalletStoreModel = types let reservedCounters: OperationCounters | undefined try { - const proofs = yield cashuWallet.mintProofs( - 'onchain', + const proofs = yield cashuWallet.mintProofsOnchain( mintParams.amount, quoteResponse, + privkey, { keysetId: mintParams.options?.keysetId, - privkey, onCountersReserved: (info: OperationCounters) => { reservedCounters = info log.debug('[mintOnchainProofs] Counters reserved', info) diff --git a/yarn.lock b/yarn.lock index f8cc192..f882d88 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2869,15 +2869,15 @@ __metadata: languageName: node linkType: hard -"@cashu/cashu-ts@npm:^4.7.0": - version: 4.7.0 - resolution: "@cashu/cashu-ts@npm:4.7.0" +"@cashu/cashu-ts@npm:^4.7.1": + version: 4.7.1 + resolution: "@cashu/cashu-ts@npm:4.7.1" dependencies: "@noble/curves": ^2.2.0 "@noble/hashes": ^2.2.0 "@scure/base": ^2.2.0 "@scure/bip32": ^2.2.0 - checksum: 006f3dea45ceb6920b0d555e3b567576ee0fa9b48024110323101d26e57bc31a4c0157f6ab642cb0b185395999b262b1ecb6f70d05cf7ccb9560943a4f652159 + checksum: c8dfb7afd37835f0a79e30cc3e4f0fe70cafbd2670aa6674a978749ecec19c0d8e34597959cc05b96b9663f9ca9803bfd78efcc1d295e7b5e0f3a59c75875477 languageName: node linkType: hard @@ -14823,7 +14823,7 @@ __metadata: "@babel/plugin-proposal-export-namespace-from": ^7.18.9 "@babel/preset-env": ^7.25.3 "@babel/runtime": ^7.25.0 - "@cashu/cashu-ts": ^4.7.0 + "@cashu/cashu-ts": ^4.7.1 "@expo/fingerprint": ^0.13.4 "@fortawesome/fontawesome-svg-core": ^7.1.0 "@fortawesome/free-brands-svg-icons": ^7.1.0