Skip to content

feat: add atomic swap proposal and acceptance UI - #1005

Merged
Chucks1093 merged 3 commits into
accesslayerorg:devfrom
zainabwahab-eth:feat/979-atomic-swap-ui
Sep 27, 2026
Merged

Chucks1093 merged 3 commits into
accesslayerorg:devfrom
zainabwahab-eth:feat/979-atomic-swap-ui

Conversation

@zainabwahab-eth

Copy link
Copy Markdown
Contributor

Closes #979

Summary

Implements atomic swap proposal and acceptance UI for direct key exchanges.

Features

  • Swap Proposal Form (AtomicSwapProposalForm): Create atomic swap proposals by selecting offered key/amount and desired key/amount with validation
  • Shareable Proposal Links: Generated URLs at /swap/:proposalId that can be shared with counterparties
  • Counterparty Review Page (AtomicSwapProposalReview): Clear display of both sides of the exchange (You receive / You give) with proposal status
  • Atomic Swap Acceptance: Accept action submits the atomic swap transaction with proper preconditions (not expired, not executed, correct counterparty)
  • Proposal Status Handling: Distinguishes pending, accepted, executed, expired, cancelled states
  • Portfolio History Integration (AtomicSwapHistory): Completed swaps appear in Profile page under new 'Atomic Swaps' tab

Files Added

  • src/types/atomicSwap.ts - Types and utilities for atomic swap proposals
  • src/services/atomicSwap.service.ts - Service for creating/fetching/accepting proposals and swap history
  • src/hooks/useAtomicSwap.ts - React Query hooks for atomic swap operations
  • src/components/common/AtomicSwapProposalForm.tsx - Proposal creation form with validation
  • src/components/common/AtomicSwapProposalReview.tsx - Counterparty review page
  • src/components/common/AtomicSwapHistory.tsx - Swap history table component
  • src/pages/AtomicSwapCreatePage.tsx - Create proposal page at /swap/create
  • src/pages/AtomicSwapProposalPage.tsx - Review/accept page at /swap/:proposalId

Files Modified

  • src/routes.tsx - Added new routes for swap pages
  • src/lib/queryKeys.ts - Added atomic swap query keys
  • src/pages/LandingPage.tsx - Added 'Create Atomic Swap' button in holdings section
  • src/pages/ProfilePage.tsx - Added 'Atomic Swaps' tab with history

Security

  • No private keys, seed phrases, or wallet secrets in URLs
  • Uses existing wallet signing flow via wagmi
  • Validates counterparty ownership before accepting
  • Proposal links contain only proposal ID (safe identifier)

Testing

  • Build passes (TypeScript + Vite)
  • Lint passes
  • Pre-existing portfolioValue test failures unrelated to this change

Notes

The implementation uses a mock/localStorage-based service layer (atomicSwap.service.ts) since the repository doesn't have existing contract/client infrastructure for atomic swaps. The service is structured to easily swap in real backend/contract calls when available.

@drips-wave

drips-wave Bot commented Sep 26, 2026

Copy link
Copy Markdown

@zainabwahab-eth 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! 🚀

Learn more about application limits

@Chucks1093

Copy link
Copy Markdown
Member

conflict

# Conflicts:
#	src/lib/queryKeys.ts
#	src/pages/ProfilePage.tsx
#	src/routes.tsx
@Chucks1093
Chucks1093 merged commit d49c19a into accesslayerorg:dev Sep 27, 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.

Implement atomic swap proposal and acceptance UI for direct key exchanges

2 participants