feat: add wallet-safe pay-to address display, copy button, and test c…#106
feat: add wallet-safe pay-to address display, copy button, and test c…#106TheWeirdDee wants to merge 4 commits into
Conversation
|
@TheWeirdDee is attempting to deploy a commit to the emrekayat's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@TheWeirdDee Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Thanks for the PR. I rechecked the merge ref from the maintainer account. The focused checks pass: git diff --check main...pr-106-merge
npm run test --workspace @query402/api -- src/routes/public.test.ts src/lib/storage/memory.test.ts
npm run test --workspace @query402/agent-client -- src/cli.test.ts
npm run typecheck --workspace @query402/api
npm run typecheck --workspace @query402/web
npm run typecheck --workspace @query402/agent-clientResults: API tests pass (20), agent CLI tests pass (3), and all three typechecks pass. I still cannot merge this exact branch because the missing-address UI change also weakens payment configuration at runtime. The PR makes For #90, please expose a safe public |
|
Rechecked: after the other PRs were merged this one now has merge conflicts with |
Resolves conflicts: - memory.test.ts: take upstream cross-platform path assertions - ControlDeckPage.tsx: keep upstream fetchHealth/fetchSponsorshipEnabled bootstrap, layer pay-to diagnostics on top; dedupe lucide icon imports - styles.css: keep both pay-to display styles and payment banner styles - types.ts: extend HealthResponse with network + diagnostics for the pay-to display Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per review feedback on emrekayat#106: keep X402_PAY_TO_ADDRESS optional so the server can boot for display/diagnostics, but never generate payment requirements, evidence, or persisted payment attempts with an empty pay-to address. - add requirePayToAddress() which throws when the address is missing - real (non-demo) x402 middleware now fails at startup if paid routes are enabled without a pay-to address - demo-mode /x402/* requests return 503 instead of advertising empty payTo requirements or recording empty-payTo demo evidence - demo evidence and payment-attempt persistence use requirePayToAddress instead of falling back to "" - add tests for the 503 demo-mode behavior and the startup failure Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- pricing.test.ts: add the missing closing brace for the "x402 cross-layer price consistency" describe block; the file did not parse, which broke typecheck and vitest for the whole API workspace - urlSafety.test.ts: import vitest globals and use an explicit .js extension so the file compiles under NodeNext module resolution - urlSafety.ts: strip the brackets Node's URL.hostname keeps around IPv6 hosts before prefix checks, so IPv6 link-local/ULA addresses (e.g. fe80::) are actually blocked as the tests expect Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resolves #90
This PR adds a wallet-safe, compact pay-to public Stellar address display to the Control Deck page and query signals output next to paid-query evidence and provider pricing.
Key Changes
payToAddress(Stellar public key) in theConfigSnapshotreturned by/healthwithout leaking credentials. Made the API env schema forX402_PAY_TO_ADDRESSoptional to prevent server launch failure when missing.Testnetlabel if Stellar testnet is active.trace-boxnext to payment transaction details.⚠️ Missing pay-to addressin both sections if the payee address configuration is not found on the server, avoiding blank states.payToAddressconfigurations and resolving pre-existing test runner environment timing/path format issues on Windows.Verification
/healthwith both configured and missing payee address states.146tests in shared, api, and agent-client workspaces).