Skip to content

fix: complete token-aware address converter (#19) - #36

Open
salemkode wants to merge 4 commits into
mainfrom
fix/19-token-address-converter
Open

salemkode wants to merge 4 commits into
mainfrom
fix/19-token-address-converter

Conversation

@salemkode

@salemkode salemkode commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Fixes #19.

The converter already offered token, regular, and legacy strings, but its apparent cross-check called the same Libauth routines twice. P2SH32 silently lost its legacy row, the output network was implicit, and the page had no QR output or clipboard-failure guidance.

This change uses one local conversion path backed by Libauth, makes the output network explicit, and separates token-aware and regular BCH outputs with exact copy and QR controls. A token-aware address signals support; converting an address never makes a wallet token-compatible. P2SH32 now explains why legacy output is unavailable. Empty, malformed, mixed-case, and unsupported-prefix input produces guidance without stale outputs or exceptions.

Based on cleanup PR #32; merge #32 first

Cleanup dependency: #32. This PR targets main as requested and currently includes cleanup ancestry. Its prepared base was exactly 4cd0fb6c2fe09a60dfbf6889fa7b67d72c23a949, with one issue-specific commit on top.

Focused review: chore/dependency-upgrades-cleanup...fix/19-token-address-converter

Acceptance

  • Accept regular/token-aware CashAddr, prefixless CashAddr, and supported legacy inputs.
  • Preserve P2PKH, P2SH20, and P2SH32 receiver scripts and the BCH/token-support distinction.
  • Mainnet outputs use bitcoincash: and mainnet Base58 versions; Chipnet outputs use bchtest: and testnet versions. Copy explains that test chains share encodings and conversion does not move funds.
  • Trim surrounding whitespace; accept uppercase CashAddr; reject mixed case, malformed/unsupported prefixes, and invalid checksums without throwing.
  • Clearing or invalidating input removes results; P2SH32 shows no legacy Copy/QR control and an explicit explanation.
  • Copy and QR use full corresponding addresses, including CashAddr prefixes. Clipboard denial shows manual-copy guidance without claiming success.
  • Remove the duplicate Libauth conversions and fake cross-check.
  • Preserve existing responsive light/dark styling, reuse the QR component, and provide keyboard focus, live validation, and native keyboard-operable QR disclosures.
  • Add behavior regressions and usage/manual verification instructions in docs/address-converter.md.

The output cards use existing slate/zinc/emerald tokens. Visible format explanations and full wrapping addresses keep the destination and token-support signal clear; QR disclosures keep long output lists compact. No packages, shared address helpers, query schema, generated schema snapshot, or unrelated settings were changed.

Verification

All passed in the isolated worktree:

  • bun install --frozen-lockfile
  • bun run lint (22 informational component-name notices, no errors)
  • bun run test — 191 passing tests, 0 failures; 148 converter cases include fixed vectors and decoding assertions for script bytes, network prefixes/versions, and token flags.
  • bun run lint:type — checked-in-schema codegen and Nuxt typecheck
  • bun run build — generated .output/public, including /converter; the first attempt correctly refused to run alongside this worktree's preview server, then passed after stopping that server.
  • git diff --check

Standard built-in browser checks passed for token input, network switching, prefixless P2SH32, exact clipboard contents, QR contents/rendering, malformed-prefix rejection, clearing stale output, clipboard denial, Tab/Enter operation and focus outlines, and light/dark layouts at 320/360px with no horizontal page overflow. The owned preview tab and dev server were closed after verification.

Limits

The regression suite and converter both rely on Libauth; there is no claim of an independent addressing implementation. Browser checks verified QR contents and rendered SVGs, but did not scan them with a real wallet or send funds. Payment URIs and prefixes outside bitcoincash:/bchtest: are intentionally rejected. The existing Alpha feature flag is preserved. Repository hooks emitted the existing “Can't find lefthook in PATH” messages; hooks were not bypassed.

Parent review follow-up: the output-network selector now stays local to the converter; trying Chipnet does not change the explorer browsing network. The 148 conversion cases, lint, and Nuxt typecheck passed after this change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T20:10:47.021970Z 9f7f8ff 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.

@netlify

netlify Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for explorer-cash failed.

Name Link
🔨 Latest commit a9eab06
🔍 Latest deploy log https://app.netlify.com/projects/explorer-cash/deploys/6af8c179c3c8ba0f8c1188fd

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
explorer a9eab06 Nov 14 2026, 08:24 PM

This branch has not been deployed

No deployments
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.

Address converter Page support cash token address

1 participant