Skip to content

Hide chains without deposit-address support (incl. TON) from origin selector unless VM has wallet support#1067

Merged
ted-palmer merged 2 commits into
mainfrom
fix/from-selector-deposit-address-vms
Jul 8, 2026
Merged

Hide chains without deposit-address support (incl. TON) from origin selector unless VM has wallet support#1067
ted-palmer merged 2 commits into
mainfrom
fix/from-selector-deposit-address-vms

Conversation

@ted-palmer

Copy link
Copy Markdown
Collaborator

No description provided.

@ted-palmer ted-palmer requested a review from pedromcunha July 7, 2026 20:52
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
relay-sdk-demo Ready Ready Preview, Comment Jul 7, 2026 8:55pm

Request Review

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Claude finished @ted-palmer's task in 49s —— View job


Code Review

  • Gather context (diff, commits, surrounding code)
  • Review changed files
  • Post review

Code Review — No issues found.

Reviewed 3 files, ~18 lines changed. Checked for correctness, security, error handling, and repo guidelines compliance.

Notes on what I verified:

  • The new context === 'from' filter correctly keeps a chain only when it either supports deposit addresses (!UnsupportedDepositAddressChainIds.includes(chain.id)) or has connectable wallet support for its VM (supportedWalletVMs?.some(...)). This matches the stated intent.
  • Using .some((vm) => vm === chain.vmType) rather than .includes(chain.vmType) avoids the TS mismatch between Omit<ChainVM, 'hypevm' | 'lvm'>[] and chain.vmType: ChainVM — sensible.
  • Undefined/empty supportedWalletVMs correctly resolves to false (chain hidden), including the OnrampWidget case that passes [].
  • supportedWalletVMs is properly added to the useMemo dependency array.
  • The EVM chains already in UnsupportedDepositAddressChainIds (xai, sanko, story, powerloom) remain visible when EVM wallet support is present, so no regression for the existing EVM-only path.
  • depositAddresses.ts addition of TON (224235520) follows the existing formatting/comment convention, and the changeset is appropriately scoped as a patch.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Claude finished @ted-palmer's task in 1m 31s —— View job


📝 Docs Drift Check — Confidence: MEDIUM

What changed: The SwapWidget's origin (from) token selector now hides chains that don't support the deposit-address flow (including TON) unless their VM is included in the widget's supportedWalletVMs. This narrows which chains a user can pick as the source of a swap.

Docs impact: The swap-widget reference documents supportedWalletVMs only in terms of the deposit-address fallback for the destination side. It doesn't mention that this prop now also governs which origin chains are shown, so an integrator wondering why a chain like TON no longer appears as a source has no documented answer.

Affected pages (paths inside relayprotocol/relay-docs):

  • references/relay-kit/ui/swap-widget.mdx — update

Draft:

> Insert after: the `## Parameters` table (immediately before `## Usage`)

<Info>
  In the origin (from) token selector, chains that don't support the
  deposit-address flow (such as TON) are hidden unless their VM is included in
  **`supportedWalletVMs`**. A user can only choose an origin chain that either
  supports deposit addresses or has connectable wallet support for its VM.
</Info>

Needs human input:

  • I intentionally did not enumerate the specific set of chains excluded from the deposit-address flow — that list is an internal implementation detail likely to change over time, so the callout uses TON only as the representative example named in the change. Confirm this framing is the level of detail you want.
  • Consider whether the existing supportedWalletVMs row description should also be reworded to reference this origin-selector behavior, rather than keeping it as a separate callout. I left the row as-is to avoid rewriting a large shared table cell.

To publish as a draft PR in relayprotocol/relay-docs, reply on this PR with:

/publish-docs-pr

A separate workflow will open a draft PR attributed to you. Edit the draft freely before marking it ready for review.

@ted-palmer ted-palmer merged commit 4ac9782 into main Jul 8, 2026
6 checks passed
@ted-palmer ted-palmer deleted the fix/from-selector-deposit-address-vms branch July 8, 2026 13:15
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