feat: reusable pay-with-any-token invoice module (#595) #1117

Merged
PlasticDigits merged 1 commit from issue-595-pay-invoice into main 2026-08-23 03:27:39 +00:00
PlasticDigits commented 2026-08-23 03:10:02 +00:00 (Migrated from gitlab.com)

Summary

  • Shared quotePayInvoice / buildPayInvoiceMsgs + PayWithAnyToken card so paid features (#593 SKU unlock / settings batch, later #597) do not fork Swap quote/execute.
  • v1 settlement is one executeTerraContractMulti: optional wrap → router swap (to = user, minimum_receive ≥ invoice) → CW20 Send exactly the invoice amount. Excess invoice token stays with the user.
  • Invoice Send gas (PAY_INVOICE_SEND_GAS_LIMIT) + wrap+2hop+invoice combined envelope. Invariants I595-1–I595-14 in docs/frontend.md and skills/AGENTS_FRONTEND_PAY_INVOICE.md.

Closes #595.

Test plan

  • make verify-issue-595 (unit + docs/skills drift) — passed twice after commit
  • make verify-issue-475 — retail inventory still green
  • #593 Create Token / Manage Save import this card (pages not in this MR)
  • LocalTerra: pay a #592 SKU in UST1, cLUNC, LUNC (wrap); settings batch Save in a non-UST1 token (needs launcher)
  • Confirm launcher still accepts only UST1 Send (#592)
## Summary - Shared `quotePayInvoice` / `buildPayInvoiceMsgs` + `PayWithAnyToken` card so paid features (#593 SKU unlock / settings batch, later #597) do not fork Swap quote/execute. - v1 settlement is one `executeTerraContractMulti`: optional wrap → router swap (`to` = user, `minimum_receive` ≥ invoice) → CW20 `Send` **exactly** the invoice amount. Excess invoice token stays with the user. - Invoice Send gas (`PAY_INVOICE_SEND_GAS_LIMIT`) + wrap+2hop+invoice combined envelope. Invariants **I595-1–I595-14** in `docs/frontend.md` and `skills/AGENTS_FRONTEND_PAY_INVOICE.md`. Closes #595. ## Test plan - [x] `make verify-issue-595` (unit + docs/skills drift) — passed twice after commit - [x] `make verify-issue-475` — retail inventory still green - [ ] `#593` Create Token / Manage Save import this card (pages not in this MR) - [ ] LocalTerra: pay a #592 SKU in UST1, cLUNC, LUNC (wrap); settings batch Save in a non-UST1 token (needs launcher) - [ ] Confirm launcher still accepts only UST1 `Send` (#592)
PlasticDigits commented 2026-08-23 03:27:40 +00:00 (Migrated from gitlab.com)

mentioned in commit 276423e6b8

mentioned in commit 276423e6b8a5fac236bf3a2de22819b578d08652
PlasticDigits (Migrated from gitlab.com) merged commit 276423e6b8 into main 2026-08-23 03:27:40 +00:00
PlasticDigits commented 2026-08-23 03:29:58 +00:00 (Migrated from gitlab.com)

mentioned in commit 328b2b8d6d

mentioned in commit 328b2b8d6d365581d73fa3385749e7e8cff26f4c
PlasticDigits commented 2026-08-23 03:31:19 +00:00 (Migrated from gitlab.com)

mentioned in issue #595

mentioned in issue #595
PlasticDigits commented 2026-08-23 03:31:20 +00:00 (Migrated from gitlab.com)

mentioned in issue #599

mentioned in issue #599
PlasticDigits commented 2026-08-23 03:31:24 +00:00 (Migrated from gitlab.com)

mentioned in issue #593

mentioned in issue #593
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!1117
No description provided.