Conversation
This adds a new endpoints to Mint that allows batch minting operations. It also adds new methods to Wallet that trigger a batch mint.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36a41b92bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // this.assertAmount(amount, `_mintProofs: ${method}`); | ||
| outputType = outputType ?? this.defaultOutputType(); // Fallback to policy | ||
| const { keysetId, proofsWeHave, onCountersReserved } = config ?? {}; | ||
|
|
||
| // Shape output type and denominations for our proofs |
There was a problem hiding this comment.
Validate batch quote amounts before deriving outputs
_batchMintProofs accepts amounts from a public wallet method but the only amount guard is commented out, so invalid runtime inputs (e.g., negative, fractional, or NaN amounts from JS callers or malformed quote objects) flow directly into output splitting. In that case the wallet can fail with low-level errors from downstream math/splitting rather than a controlled validation error, which makes batch minting brittle and harder to handle safely.
Useful? React with 👍 / 👎.
| ); | ||
|
|
||
| if (!isObj(data) || !Array.isArray(data?.signatures)) { | ||
| this._logger.error('Invalid response from mint...', { data, op: 'mintBolt11' }); |
There was a problem hiding this comment.
Tag bolt12 batch response errors with correct operation
When mintBolt12Batch receives an invalid response, the logger records op: 'mintBolt11', which misattributes bolt12 failures in logs/telemetry. This creates avoidable confusion during incident triage because errors from /v1/mint/bolt12/batch appear as bolt11 issues.
Useful? React with 👍 / 👎.
Description
This is a basic implementation of the new Batch Minting NUT.
Changes
PR Tasks
npm run test--> no failing unit testsnpm run lint--> no warnings or errorsnpm run formatnpm run api:check--> runnpm run api:updatefor changes to the API