Skip to content

feat(frontend): prevent self-streaming when recipient matches sender wallet in StreamCreationWizard - #1691

Open
aazminu wants to merge 3 commits into
LabsCrypt:mainfrom
aazminu:feat/issue-1632-prevent-identical-sender-recipient
Open

aazminu wants to merge 3 commits into
LabsCrypt:mainfrom
aazminu:feat/issue-1632-prevent-identical-sender-recipient

Conversation

@aazminu

@aazminu aazminu commented Oct 19, 2026

Copy link
Copy Markdown

Description

Prevents users from creating a payment stream to their own connected Stellar wallet address in RecipientStep (frontend/src/components/stream-creation/RecipientStep.tsx), StreamCreationWizard (frontend/src/components/stream-creation/StreamCreationWizard.tsx), and frontend/src/lib/stream-validation.ts.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test addition or update

Related Issues

Closes #1632
Fixes #1632
/claim #1632

Changes Made

  • Updated validateRecipient and validateStreamForm in frontend/src/lib/stream-validation.ts to accept an optional senderAddress parameter and return "Recipient address cannot be the same as your connected sender wallet" when the trimmed, case-normalized recipient matches the sender wallet address.
  • Updated RecipientStep (frontend/src/components/stream-creation/RecipientStep.tsx) to compare the recipient input against the connected sender wallet address and immediately display the inline validation error alert.
  • Updated StreamCreationWizard (frontend/src/components/stream-creation/StreamCreationWizard.tsx) to pass walletPublicKey to RecipientStep and disable the Next button on Step 2 when recipient validation fails.
  • Added unit tests in frontend/src/lib/__tests__/stream-validation.test.ts and frontend/src/__tests__/components.test.tsx covering exact, case-insensitive, and whitespace-padded self-stream detection.

Testing

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

Test Steps

  1. Run npx vitest run src/lib/__tests__/stream-validation.test.ts src/__tests__/components.test.tsx src/components/stream-creation/__tests__/StreamCreationWizard.test.tsx in frontend/ (118/118 tests pass).
  2. Run npx tsc --noEmit in frontend/ (0 errors).
  3. Run npx eslint src/lib/stream-validation.ts src/components/stream-creation/RecipientStep.tsx src/components/stream-creation/StreamCreationWizard.tsx src/lib/__tests__/stream-validation.test.ts src/__tests__/components.test.tsx in frontend/ (0 errors, 0 warnings).

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked for breaking changes and documented them if applicable

Additional Notes

Payout Details

  • USDT/USDC Receiving Wallet (EVM / ERC-20 / Polygon / Arbitrum / Optimism / Base / BSC): 0x9a51790aC01c54184bcFa067bC38f7F0E7C6F6B6

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.

[Frontend] Prevent or warn when sender and recipient Stellar addresses are identical in StreamCreationWizard

1 participant