Skip to content

fix(swap-widget): restore redirect-only chains in the asset selector - #12588

Merged
kaladinlight merged 1 commit into
developfrom
fix/swap-widget-redirect-chain-assets
Aug 14, 2026
Merged

fix(swap-widget): restore redirect-only chains in the asset selector#12588
kaladinlight merged 1 commit into
developfrom
fix/swap-widget-redirect-chain-assets

Conversation

@kaladinlight

@kaladinlight kaladinlight commented Aug 13, 2026

Copy link
Copy Markdown
Member

Description

The redirect-only chain support added in #12435 shipped with its chains filtered out one layer upstream, so it has never actually been reachable for the six chains it was built for.

TokenSelectModal gates on isWidgetSupportedChainId and only narrows to executable chains when the redirect is off — that part is correct. But its input comes from useAssets, which filters through BASE_ASSETS_BY_CHAIN_ID in constants/chains.ts, and that map never gained the chains REDIRECT_ONLY_CHAIN_IDS introduced in types/index.ts. Assets were dropped before the redirect-aware filter ever saw them.

Zcash, Tron, Sui, TON, NEAR and Starknet were therefore unselectable, leaving the redirect reachable only for the cosmos chains. This adds their base assets so the modal's existing filter can do its job.

Issue (if applicable)

closes #

Risk

Low.

Purely additive — five new entries in a lookup map plus zcash, and no change to any existing entry, filter, or execution path. Everything downstream of the picker already handled these chains; they just never arrived. No on-chain transaction is introduced or modified: these chains are redirect-only by definition, and selecting one hands off to app.shapeshift.com rather than signing in the widget.

What protocols, transaction types, wallets or contract interactions might be affected by this PR?

None. No swapper, signing, or broadcast code is touched.

Testing

Engineering

Run the widget and open the asset selector with the redirect enabled — Zcash, Tron, Sui, TON, NEAR and Starknet now appear and are selectable, and selecting one routes to the app redirect rather than the in-widget swap flow. With the redirect disabled they remain hidden, as before.

Verified locally by asserting the invariant directly: every chain in EVM_CHAIN_IDS, UTXO_CHAIN_IDS, COSMOS_CHAIN_IDS, OTHER_CHAIN_IDS and REDIRECT_ONLY_CHAIN_IDS resolves through both isSupportedChainId and getBaseAsset — 27/27 pass with this change. Reverting the six entries makes 5 of the 6 redirect chains fail on the isSupportedChainId line specifically, confirming that map is the layer that was eating them.

Operations

  • 🏁 My feature is behind a flag and doesn't require operations testing (yet)

The redirect itself is already gated. With it on, confirm the six chains are offered in the asset picker and that picking one opens app.shapeshift.com with the swap pre-filled.

Screenshots (if applicable)

n/a

Summary by CodeRabbit

  • New Features
    • Added support for Near, Starknet, Sui, Ton, Tron, and Zcash assets in the swap widget.

The redirect shipped with its chains filtered out one layer upstream.
TokenSelectModal gates on isWidgetSupportedChainId and only narrows to
executable chains when the redirect is off, but its input comes from useAssets,
which filters through BASE_ASSETS_BY_CHAIN_ID - and that map never gained the
six chains REDIRECT_ONLY_CHAIN_IDS added.

Zcash, Tron, Sui, TON, NEAR and Starknet were therefore unselectable, leaving
the redirect reachable only for the cosmos chains. Add their base assets so the
modal's redirect-aware filter sees them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kaladinlight
kaladinlight requested a review from a team as a code owner August 13, 2026 20:41
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b5855ce-7bef-469f-bc22-b4452f5eddf8

📥 Commits

Reviewing files that changed from the base of the PR and between c0d8cb5 and 6dfb524.

📒 Files selected for processing (1)
  • packages/swap-widget/src/constants/chains.ts

📝 Walkthrough

Walkthrough

The swap widget now imports and registers Near, Starknet, Sui, Ton, Tron, and Zcash in its base-asset chain mapping.

Changes

Swap Widget Chain Support

Layer / File(s) Summary
Chain asset imports and lookup mapping
packages/swap-widget/src/constants/chains.ts
The file imports six chain assets and registers them in BASE_ASSETS_BY_CHAIN_ID.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Mergeability Score: ⚪ Minimal · up to 6dfb5

The PR restores asset-selector visibility for six redirect-only chains without changing swap execution or transaction behavior. No actionable merge-blocking risk remains beyond normal checks and review.

Possibly related issues

Possibly related PRs

Suggested reviewers: 0xapotheosis

Poem

A rabbit hops through chains anew,
With Near and Starknet in the queue.
Sui, Ton, Tron, and Zcash align,
In one neat mapping, row by line.
“The swap path grows!” the rabbit sings.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes restoring redirect-only chains in the swap widget asset selector, which matches the primary change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/swap-widget-redirect-chain-assets

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kaladinlight
kaladinlight merged commit aa5d52c into develop Aug 14, 2026
4 checks passed
@kaladinlight
kaladinlight deleted the fix/swap-widget-redirect-chain-assets branch August 14, 2026 15:47
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.

1 participant