Skip to content

feat(deposit): QR shows the bare address by default, advanced toggle for the full URI - #114

Merged
shawnmuggle merged 1 commit into
masterfrom
feat/deposit-qr-address-default
Oct 31, 2026
Merged

shawnmuggle merged 1 commit into
masterfrom
feat/deposit-qr-address-default

Conversation

@shawnmuggle

Copy link
Copy Markdown
Member

Why

Founder decision 2026-10-31: "default is only show address. advanced show the advance qr". Exchange withdraw screens (Binance, OKX) reject EIP-681 / Solana Pay URIs, and many checkout payers withdraw from an exchange. checkout.rozo.ai already defaults to the bare address with an EIP-681 checkbox; the SDK deposit modal (invoice.rozo.ai) encoded the full URI with no choice.

What

  • depositQrValue / depositQrHasAdvanced in WaitingDepositAddress: default QR = bare address; checkbox "Advanced QR: include network and amount (self-custody wallets)" switches to the full URI.
  • Orders with a memo (Stellar Classic, Solana memo) keep the full URI and show no toggle: scanning only the address would drop the memo and lose the payment.
  • Amount, address and network stay visible as copyable text below, unchanged.

Tests

  • 2 new tests (default/advanced values, memo orders keep the full URI and no toggle).
  • vitest run in connectkit: 228/228. pnpm run build ok.

🤖 Generated with Claude Code

…for the full URI

Exchange withdraw screens cannot read EIP-681 / Solana Pay URIs, and many
payers withdraw from an exchange. The deposit QR now encodes the bare
address by default; an 'Advanced QR' checkbox switches to the full payment
URI (network, token, amount) for self-custody wallets. Orders with a memo
keep the full URI and get no toggle, since a bare-address scan would drop
the memo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
intent-example Ignored Ignored Oct 31, 2026 9:46pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T21:47:42.034585Z 7389b89 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@shawnmuggle

Copy link
Copy Markdown
Member Author

Peer review (codex, GPT): no defects found, no P0; default bare-address QR, advanced URI toggle and memo guard are consistent. Its sandbox could not run vitest (EPERM on .vite-temp); locally connectkit vitest 228/228 and build ok.

Comment on lines +82 to +83
export function depositQrHasAdvanced(depAddr: Pick<DepositAddr, "address" | "uri" | "memo">): boolean {
return !!depAddr.address && !!depAddr.uri && depAddr.uri !== depAddr.address && !depAddr.memo;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 (non-blocking) — latent assumption worth a note. This correctly keeps the full URI whenever memo is set, which covers every case that exists today: generateSolanaDeepLink/generateStellarDeepLink surface their only required extra via order.memo, and EVM/Tron deposits need no extra field. The implicit invariant is "the bare address is a safe scan iff no memo." If a future deposit URI ever carries required data in some other field (e.g. a Solana Pay reference, or an XRP/Cosmos destination tag not mapped to memo), the default bare-address QR would silently drop it. Not a bug now — just worth a one-line comment pinning that invariant so the next chain integration doesn't miss it.

Verified: depositQrValue falls back to uri ?? address when !hasAdvanced, so undefined-uri orders now render the address instead of the previous empty QR — a strict improvement. Type is safe (CustomQRCode.value?: string).

@claude

claude Bot commented Oct 31, 2026

Copy link
Copy Markdown

Review — PR #114: deposit QR defaults to bare address

Verdict: no blocking issues (0 × P0, 0 × P1). Clean, well-scoped, well-tested change. Reviewed the full diff plus surrounding context in WaitingDepositAddress/index.tsx.

What I checked

  • Payment-safety invariant (the important one): memo orders (Stellar Classic G-address, Solana memo) always keep the full URI and hide the toggle — depositQrHasAdvanced returns false when memo is set. A bare-address scan can never drop a memo and lose funds. ✅ Confirmed against both depAddr construction sites (underpayment branch L324–369 and the normal payWithDepositAddress branch L476–493); both set memo: order.memo || undefined.
  • No lost data on the default QR: the only thing the bare-address default drops vs. the old EIP-681/Solana-Pay URI is network+amount, which the founder explicitly chose (exchange withdraw screens reject those URIs) and which stays visible as copyable text below. For EVM, wrong-chain/wrong-token sends are already handled by Rozo's auto-detect ("Already sent … on another chain? … We detect it automatically").
  • No regressions / type safety: CustomQRCode.value is string | undefined, so depositQrValue's string | undefined return is safe; undefined-uri orders now render the address instead of an empty QR (improvement). Change is self-contained — no callers outside this file and its test.
  • Toggle state: advancedQr resets correctly on option switch (parent nulls depAddr between options → DepositAddressInfo remounts with fresh useState(false)), so no sticky-state carryover.
  • Tests: 2 new tests cover default/advanced values and the memo-forces-full-URI path, including the DOM-level assertion that the toggle is hidden for memo orders.

Non-blocking

  • One P2 inline note on depositQrHasAdvanced: the "bare address is safe iff no memo" invariant is correct today but implicit; worth a comment so a future chain whose URI carries required data in a non-memo field doesn't silently regress.

Not approving/merging per instructions — leaving the verdict to the automated step.

🤖 Generated with Claude Code

@shawnmuggle
shawnmuggle merged commit ff2739b into master Oct 31, 2026
7 checks passed
@shawnmuggle
shawnmuggle deleted the feat/deposit-qr-address-default branch October 31, 2026 21:50
@shawnmuggle shawnmuggle mentioned this pull request Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant