Skip to content

feat: add nodeControl contract + checkout.mintInvoice#17

Merged
martinsaposnic merged 1 commit intomainfrom
feat/ws-control-plane-contracts
Apr 20, 2026
Merged

feat: add nodeControl contract + checkout.mintInvoice#17
martinsaposnic merged 1 commit intomainfrom
feat/ws-control-plane-contracts

Conversation

@martinsaposnic
Copy link
Copy Markdown
Contributor

Summary

  • Add oRPC contracts and Zod schemas for the WS-based node control protocol (payout, BOLT11/BOLT12 invoice minting, server-pushed event stream)
  • Add mintInvoice to the checkout contract, replacing the legacy two-step local-mint + registerInvoice flow
  • Part of the WS control plane feature (PR 1 of 6)

Test plan

  • npx tsc --noEmit passes
  • Dependent PRs in lightning-node consume these contracts correctly

…plane

Add the oRPC contracts and Zod schemas for the WebSocket-based node control
protocol between mdk.com and merchant lightning-js nodes. Includes payout,
invoice minting (BOLT11 + BOLT12), and server-pushed event stream contracts.
Also adds mintInvoice to the checkout contract, replacing the legacy
two-step local-mint + registerInvoice flow.
Copy link
Copy Markdown

@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: f2a7ea097a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/contracts/checkout.ts
create: createCheckoutContract,
confirm: confirmCheckoutContract,
registerInvoice: registerInvoiceContract,
mintInvoice: mintInvoiceContract,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Wire mintInvoice into sdkContract checkout map

This adds checkout.mintInvoice to the core contract, but sdkContract.checkout still exports only registerInvoice in src/index.ts (lines 205-210), so any SDK router/client that is typed from sdkContract cannot adopt the new single-step mint flow and will stay pinned to the legacy path. That mismatch makes this feature unavailable in the SDK-facing contract surface even though it is now publicly defined.

Useful? React with 👍 / 👎.

@martinsaposnic martinsaposnic merged commit bc3996d into main Apr 20, 2026
2 checks passed
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