Skip to content

feat(frontend): wire cross-asset payment ui integration#171

Merged
Wilfred007 merged 3 commits intoGildado:mainfrom
CMI-James-OD:codex/issue-148-cross-asset-ui
Feb 26, 2026
Merged

feat(frontend): wire cross-asset payment ui integration#171
Wilfred007 merged 3 commits intoGildado:mainfrom
CMI-James-OD:codex/issue-148-cross-asset-ui

Conversation

@CMI-James
Copy link
Contributor

Description

Fully wire CrossAssetPayment UI to backend pathfinding flow and wallet-signed Soroban contract submission.

Closes #148

Changes proposed

What were you told to do?

I was tasked with integrating CrossAssetPayment.tsx so it:

  • Requests pathfinding data from backend when asset/amount changes (debounced)
  • Renders selectable conversion paths with rates
  • Shows settlement preview (fee, slippage, expected delivery)
  • Submits cross-asset payment through simulation + wallet-signed contract invocation
  • Shows live status updates after submission via existing socket provider

What did I do?

Reworked CrossAssetPayment page into a contract-backed flow

Updated frontend/src/pages/CrossAssetPayment.tsx to:

  • Replace mock quote/initiate logic with real path-selection + contract submission flow
  • Add wallet integration (useWallet, useWalletSigning) for signed on-chain transactions
  • Add socket integration (useSocket) for post-submit real-time status updates

Added debounced backend pathfinding integration

Implemented path request trigger on amount/asset changes with debounce:

  • Calls backend proxy endpoint shape (POST /api/v1/payments/pathfind)
  • Handles loading states and path option rendering
  • Includes resilient fallback paths when backend endpoint is unavailable

Added selectable conversion paths and settlement preview

Page now renders:

  • Multiple conversion path options with hops and effective rates
  • Route-level fee and slippage details
  • Settlement preview showing expected delivery amount, fee, and slippage

Added simulate + sign + submit contract invocation

Created frontend/src/services/crossAssetPayment.ts with:

  • Soroban contract tx builder for cross-asset execution call
  • Mandatory pre-flight simulateTransaction before submit
  • Wallet signature integration and RPC submission
  • tx hash return for live tracking

Added live status updates via SocketProvider

After successful submission, page now:

  • Subscribes to tx-related socket channels
  • Listens for status events and updates status timeline in UI
  • Displays submitted transaction hash for tracking/debugging

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

Screenshots / Testing Evidence

  • npm run lint was not executable in this environment because frontend dependencies are not installed (eslint unavailable)
  • npm run build was not fully executable in this environment due missing node_modules/type packages
  • Integration behavior validated through static inspection of debounce flow, simulation gate, signing path, and socket event wiring

@Wilfred007 Wilfred007 merged commit ab7f7af into Gildado:main Feb 26, 2026
1 check passed
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.

#075: Cross-Asset Payment UI Integration

2 participants