feat: show Stellar network/asset context before settlement and validate explorer links - #451
Conversation
…te explorer links Add pre-sign confirmation panel (mergepay#118) that displays the configured Stellar network, settlement asset, amount, and recipient before the user opens Freighter. Block signing when the API's intent network passphrase does not match the deployment configuration. Centralize network-aware explorer URL construction and validate all transaction identifiers before rendering as links (mergepay#121). Ensure malformed hashes and missing data fall back to plain text instead of producing broken external links. Closes mergepay#118 Closes mergepay#121 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
MergeKeeper review Scope: in scope for linked issue The pull request correctly implements pre-sign Stellar network and asset confirmation for settlements (#118) and robust test coverage for safe external explorer links (#121) following all repository guidelines. Reviewed commit: |
|
@Orah-dev 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! 🚀 |
|
MergeKeeper review unavailable AI provider review response did not contain valid JSON No approval or merge action was taken. |
|
MergeKeeper merge status Status: blocked Reason: One or more required CI checks failed. Failing checks:
Next steps:
|
Tests assumed CONFIGURED_NETWORK defaulted to "testnet" but the codebase defaults to "public", causing mismatch checks to fire in the wrong direction. Also updated the amount assertion to match the formatted "10.00 XLM" output and fixed the a11y test to match the actual aria-label. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The Money component renders "10.00 XLM" in both an aria-hidden span and an sr-only span, causing getByText to throw on multiple matches. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
Merged Merged with |
Summary
This PR addresses two issues in a single changeset:
Closes #118 — Show explicit Stellar network and asset context before settlement
Add a pre-sign confirmation panel that displays the configured Stellar network, settlement asset, amount, and recipient before the user opens Freighter. This prevents signing against an unintended environment and reduces settlement mistakes.
SettlementConfirmationcomponent — Shows network label (derived from configuration), asset badge (XLM/USDC), amount, recipient, and a network mismatch warning when the intent passphrase does not match the deployment configisNetworkMismatch()helper inuseSettlementFlow.tsxand a defense-in-depth check instellar.tsxblock signing when the API returns an envelope for the wrong networkWalletPrerequisiteNoticeCloses #121 — Safe external-link handling for Stellar transaction records
The existing
explorer.tsandTxLinkcomponent already implement safe link handling (validated URLs,rel="noopener noreferrer",sr-onlyaccessible names, plain-text fallback for invalid hashes). This PR adds comprehensive test coverage:Changes
src/components/settle/settlement-confirmation.tsxsrc/components/settle/settlement-confirmation.vitest.test.tsxsrc/components/settle/settle-dialog.tsxsrc/lib/useSettlementFlow.tsxsrc/lib/stellar.tsxsrc/lib/__tests__/explorer.test.tssrc/lib/__tests__/useSettlementFlow.test.tsVerification
tsc --noEmit— No type errorsnpm run lint— No ESLint warnings or errorsnpm run test— 755/755 tests passingnpm run build— Build succeeds🤖 Generated with Codebuff
Co-Authored-By: Codebuff noreply@codebuff.com