Skip unfunded-destination warning for Soroban on Search address screen#2781
Merged
Conversation
#2778) * Skip unfunded-destination warning for Soroban on Search address screen PR #2720 removed the misleading "Blockaid unfunded destination" warning for pure Soroban custom tokens on the transaction Review step. The same warning still appeared one step earlier on the Search address screen (SendTo). This change consolidates the rule into a single helper so both surfaces agree by construction. - Add popup/helpers/sendWarnings.ts with two pure helpers: - shouldCheckUnfundedDestinationWarning (qualitative gate: classic asset + classic destination + non-collectible) - shouldShowAccountDoesntExistWarning (compound: gate + strict isFunded === false, matching Review-step semantics where isFunded is boolean | null) - SendTo/index.tsx: pull asset/isCollectible from transactionDataSelector and use the compound helper; delete the dead shouldAccountDoesntExistWarning export and unused baseReserve. - useSimulateTxData.tsx: refactor getExpectedToFailReason in-place to delegate the qualitative gate to the shared helper; thread destination and isCollectible (already available in the hook) into the single call site without widening the hook's public API. - Tests: - New sendWarnings.test.ts covers native, classic, SAC, pure Soroban, collectible, contract destination, null/undefined funding, and the early-return query-param hydration edge case. - useSimulateTxData.test.ts updated for the new params and gains collectible / contract-destination cases. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Import isContractId from @shared/api/helpers/soroban in sendWarnings.ts Addressed Copilot PR review suggestion: sendWarnings.ts only uses the isContractId predicate, so importing from the lightweight @shared source directly avoids pulling in the larger popup/helpers/soroban module. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CassioMG
added a commit
that referenced
this pull request
May 15, 2026
* v5.41.0 * Trigger CI * Skip unfunded-destination warning for Soroban on Search address screen (#2778) (#2781) * Skip unfunded-destination warning for Soroban on Search address screen PR #2720 removed the misleading "Blockaid unfunded destination" warning for pure Soroban custom tokens on the transaction Review step. The same warning still appeared one step earlier on the Search address screen (SendTo). This change consolidates the rule into a single helper so both surfaces agree by construction. - Add popup/helpers/sendWarnings.ts with two pure helpers: - shouldCheckUnfundedDestinationWarning (qualitative gate: classic asset + classic destination + non-collectible) - shouldShowAccountDoesntExistWarning (compound: gate + strict isFunded === false, matching Review-step semantics where isFunded is boolean | null) - SendTo/index.tsx: pull asset/isCollectible from transactionDataSelector and use the compound helper; delete the dead shouldAccountDoesntExistWarning export and unused baseReserve. - useSimulateTxData.tsx: refactor getExpectedToFailReason in-place to delegate the qualitative gate to the shared helper; thread destination and isCollectible (already available in the hook) into the single call site without widening the hook's public API. - Tests: - New sendWarnings.test.ts covers native, classic, SAC, pure Soroban, collectible, contract destination, null/undefined funding, and the early-return query-param hydration edge case. - useSimulateTxData.test.ts updated for the new params and gains collectible / contract-destination cases. * Import isContractId from @shared/api/helpers/soroban in sendWarnings.ts Addressed Copilot PR review suggestion: sendWarnings.ts only uses the isContractId predicate, so importing from the lightweight @shared source directly avoids pulling in the larger popup/helpers/soroban module. --------- Co-authored-by: Jake Urban <10968980+JakeUrban@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Cássio Marcos Goulart <cassiomgoulart@gmail.com> Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> Co-authored-by: Jake Urban <10968980+JakeUrban@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Backport this change from
mastertov5.41.0branch so we include it on thev5.41.0release.