Skip to content

Widen common quote structs for custom payment methods#1

Merged
asmogo merged 1 commit into
asmogo:generic-payment-methodfrom
robwoodgate:feat/382-custom-base-structs
Jun 15, 2026
Merged

Widen common quote structs for custom payment methods#1
asmogo merged 1 commit into
asmogo:generic-payment-methodfrom
robwoodgate:feat/382-custom-base-structs

Conversation

@robwoodgate

Copy link
Copy Markdown

Consolidates my review feedback on the common request/response structs into one diff you can merge straight into this branch.

Scoped to the delta not owned by cashubtc#377 (accounting fields) or cashubtc#387 (method), so this does not touch the lines those PRs change and cannot push them backwards:

  • common mint quote request: optional amount, description, pubkey
  • common melt quote request: optional amount
  • common mint quote response: expiry, optional pubkey
  • common melt quote response: request, optional fee_reserve
  • custom mint quotes MUST carry the accounting fields (no legacy-state fallback exists for an unknown method) — forward-references the fields Align NUT-04 mint quote accounting with amount_paid / amount_issued cashubtc/nuts#377 adds
  • custom melt quotes MUST use the standard UNPAID/PENDING/PAID states

All of this is implemented and tested in cashu-ts (cashubtc/cashu-ts#693). Happy to adjust wording.

Comment thread 04.md
For a custom `{method}`, the wallet sends a request following the common mint quote request format (see [General Flow](#general-flow)). Method-specific fields (e.g., an `amount` of tokens to mint, a `description`, or a `pubkey` for [NUT-20][20] locks) are defined by the method-specific NUT.

The mint responds with the common mint quote response format. The `request` field contains the method-specific payment request (e.g., a payment URL, an on-chain address, an account identifier). Additional method-specific fields (such as `amount` or `expiry`) are defined by the method-specific NUT.
The mint responds with the common mint quote response format and **MUST** include the `amount_paid`, `amount_issued` and `updated_at` accounting fields. The `request` field contains the method-specific payment request (e.g., a payment URL, an on-chain address, an account identifier). Additional method-specific fields are defined by the method-specific NUT.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This foreshadows cashubtc#377 being merged

Consolidates review feedback on the generic payment method PR. Scoped to
the delta NOT covered by cashubtc#377 (accounting fields) or cashubtc#387 (method), so
those can merge independently:

- common mint quote request: optional amount, description, pubkey
- common melt quote request: optional amount
- common mint quote response: expiry, optional pubkey
- common melt quote response: request, optional fee_reserve
- custom mint quotes MUST carry the accounting fields
- custom melt quotes MUST use the standard UNPAID/PENDING/PAID states
@robwoodgate robwoodgate force-pushed the feat/382-custom-base-structs branch from 0e0899a to 6ade8b4 Compare June 15, 2026 11:38
@asmogo asmogo merged commit 491d3c3 into asmogo:generic-payment-method Jun 15, 2026
@robwoodgate robwoodgate deleted the feat/382-custom-base-structs branch June 15, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants