feat: add Stellar address validation and balance check to Transaction… - #635
Open
Benedict315 wants to merge 6 commits into
Open
feat: add Stellar address validation and balance check to Transaction…#635Benedict315 wants to merge 6 commits into
Benedict315 wants to merge 6 commits into
Conversation
|
@Benedict315 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! 🚀 |
Benedict315
force-pushed
the
feature/transactionpanel-validation
branch
2 times, most recently
from
August 29, 2026 20:48
7c29ec3 to
10325f8
Compare
Benedict315
force-pushed
the
feature/transactionpanel-validation
branch
from
August 29, 2026 21:13
6bd8408 to
14eabeb
Compare
Benedict315
force-pushed
the
feature/transactionpanel-validation
branch
from
August 29, 2026 21:21
47c2375 to
e895b59
Compare
Benedict315
force-pushed
the
feature/transactionpanel-validation
branch
3 times, most recently
from
August 29, 2026 21:46
c429059 to
8db74b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TransactionPanel had insufficient client-side validation before submission:
Solution
Added comprehensive client-side validation to prevent invalid submissions:
Changes Made
TransactionPanel.tsx:
balancesfrom useSorokit hook to access user's XLM balancehasSufficientBalancevalidation tocanSubmitguardmaxattribute to amount input (set to XLM balance)/^G[A-Z2-7]{55}$/TransactionPanel.test.tsx:
balancesarray with XLM balanceImplementation Details
The balance check works by:
balancesarray:balances.find((b) => b.asset === "XLM")?.balanceparsedAmount <= xlmBalanceNumberThe
maxattribute on the amount input provides browser-level validation as an additional safeguard.Acceptance Criteria
✅ Entering a non-G string in Destination shows an inline validation error (already implemented)
✅ Entering a string shorter or longer than 56 characters shows an inline error (already implemented)
✅ The Send button is disabled until the destination passes validation (already implemented)
✅ Entering an amount above the XLM balance shows an "Insufficient balance" error (newly implemented)
✅ Valid addresses and amounts do not trigger false errors (verified in tests)
✅ Network submission is only attempted when all client-side checks pass (verified via
canSubmitguard)Testing
Added comprehensive test coverage:
closes #587