refactor: consolidate stream validation logic into a shared utility w… - #1421
Merged
K1NGD4VID merged 3 commits intoSep 1, 2026
Merged
Conversation
…ith full test coverage and integrate into all creation entry points.
- Remove TypeScript syntax (type import, satisfies) from .mjs file - Rename unused resetForm destructure to _resetForm
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.
Description
Resolves audit issue: [Audit] Three divergent implementations of "create a stream"
Previously, stream creation logic had three separate implementations across the codebase (
StreamCreationWizard,CreateStreamContent, andDashboardViewinline settings form). These entry points enforced divergent validation rules:Key Changes
useStreamFormintoDashboardViewinline stream creation form (dashboard-view.tsx) and passedwalletBalancetovalidateStreamForm. All three entry points now enforce identical validation rules (recipient Stellar public key format viaisValidStellarPublicKey, token selection, positive amount, maximum precision of 7 decimal places, available wallet balance check, and valid duration).saveDraftinuseStreamForm.tsso pristine forms with empty recipient and amount fields do not save unwanted draft entries when default initial data is set.flowfi.stream.templates.v1.Verification
39test files,367tests passing,0failing).npm run lintacross thefrontendworkspace with0errors.Closes #1263