Skip to content

Skip unfunded-destination warning for Soroban on Search address screen#2781

Merged
CassioMG merged 1 commit into
v5.41.0from
bugfix/port-2778-from-master
May 15, 2026
Merged

Skip unfunded-destination warning for Soroban on Search address screen#2781
CassioMG merged 1 commit into
v5.41.0from
bugfix/port-2778-from-master

Conversation

@CassioMG
Copy link
Copy Markdown
Contributor

Backport this change from master to v5.41.0 branch so we include it on the v5.41.0 release.

#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 CassioMG requested review from JakeUrban and leofelix077 May 15, 2026 18:16
@CassioMG CassioMG merged commit d5568ac into v5.41.0 May 15, 2026
3 checks passed
@CassioMG CassioMG deleted the bugfix/port-2778-from-master branch May 15, 2026 18:17
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>
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.

2 participants