Skip to content

feat: build invoice token conversion UI#89

Open
newmattock wants to merge 2 commits into
Invoice-Liquidity-Network:mainfrom
newmattock:feat/invoice-token-conversion-ui
Open

feat: build invoice token conversion UI#89
newmattock wants to merge 2 commits into
Invoice-Liquidity-Network:mainfrom
newmattock:feat/invoice-token-conversion-ui

Conversation

@newmattock
Copy link
Copy Markdown

Fixes #70.

Summary

  • Add the missing submitter-facing /i/[id] invoice detail route that existing dashboard links already target.
  • Add ChangeInvoiceTokenModal with current-token display, allowlisted replacement-token selector, and the required denomination warning.
  • Show Change Token only when the connected wallet is the invoice freelancer and the invoice is still Pending; non-submitters get an explanatory restriction message.
  • Add buildConvertInvoiceTokenTransaction() for convert_invoice_token(invoice_id, new_token) and a small useTransaction helper for prepare/sign/submit state.
  • Optimistically update the invoice token display after a successful conversion.

Validation

  • npm test -- src/components/__tests__/ChangeInvoiceTokenModal.test.tsx 'app/i/[id]/__tests__/InvoiceDetailPage.test.tsx' --reporter verbose
  • npx eslint 'app/i/[id]/page.tsx' 'app/i/[id]/__tests__/InvoiceDetailPage.test.tsx' src/components/ChangeInvoiceTokenModal.tsx src/components/__tests__/ChangeInvoiceTokenModal.test.tsx src/hooks/useTransaction.ts vitest.config.ts
  • npm run build
  • git diff --check
  • Local route smoke: GET /i/1 returned HTTP 200 on the Next dev server.

Notes

  • src/utils/soroban.ts still has pre-existing lint errors elsewhere in the file on current main, so I did not treat full-file lint there as a clean gate for this PR.

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.

Implement invoice token conversion UI

1 participant