Skip to content

Support NUT-XX Batch Minting#478

Open
Egge21M wants to merge 1 commit intomainfrom
batch-minting
Open

Support NUT-XX Batch Minting#478
Egge21M wants to merge 1 commit intomainfrom
batch-minting

Conversation

@Egge21M
Copy link
Collaborator

@Egge21M Egge21M commented Jan 27, 2026

Description

This is a basic implementation of the new Batch Minting NUT.

Changes

  • Add type for BatchMinting Payload (response is the same shape as regular minting)
  • Add Mint methods
  • Add Wallet methods

PR Tasks

  • Open PR
  • run npm run test --> no failing unit tests
  • run npm run lint --> no warnings or errors
  • run npm run format
  • run npm run api:check --> run npm run api:update for changes to the API

This adds a new endpoints to Mint that allows batch minting operations.
It also adds new methods to Wallet that trigger a batch mint.
@github-project-automation github-project-automation bot moved this to Backlog in cashu-ts Jan 27, 2026
@robwoodgate robwoodgate added on hold nut hold This PR is held pending the merge of a new or updated NUT labels Jan 27, 2026
@robwoodgate robwoodgate moved this from Backlog to Blocked in cashu-ts Jan 28, 2026
@robwoodgate robwoodgate moved this from Blocked to Needs Review in cashu-ts Jan 28, 2026
@robwoodgate robwoodgate changed the base branch from development to main February 5, 2026 12:25
@robwoodgate robwoodgate added needs review PR needs reviewers to give it the green light and removed needs review on hold labels Feb 9, 2026
@robwoodgate
Copy link
Collaborator

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1835 to +1839
// 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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' });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review PR needs reviewers to give it the green light nut hold This PR is held pending the merge of a new or updated NUT

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

2 participants