Skip to content

Disable swap assets per provider - #6228

Open
j0ntz wants to merge 3 commits into
developfrom
jon/swap-disable-assets-by-provider
Open

j0ntz wants to merge 3 commits into
developfrom
jon/swap-disable-assets-by-provider

Conversation

@j0ntz

@j0ntz j0ntz commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

Asana task

Swap asset bans can now target a single provider. The app reads exchangeInfo.swap.disableAssetsByPlugin from the info server (schema in EdgeApp/edge-info-server#165): a map from swap pluginId to the same {source, destination} lists disableAssets uses. When a quote request's source or destination matches a provider's lists, that provider joins the request's disabled map and the other providers still quote.

  • The check runs in SwapProcessingScene, the only fetchSwapQuotes call in the swap flow, so it covers the first quote and the requote from the confirmation scene.
  • exchangeInfo is parsed from infoServerData.rollupRaw: asInfoRollup in edge-info-server 3.12.0 drops the new key, so this ships without a package bump.
  • Separate commit: mainnet bans never matched. The info server omits tokenId on a mainnet entry (undefined), and the swap scene compared it to a null tokenId. isAssetDisabled now treats a missing tokenId as null.

Behavior change on the live info server: the global disableAssets lists the mainnet entries bitcoinsv, ravencoin and zano. They have been no-ops because of the mismatch above. With this PR they take effect, so those assets become unswappable in the app. Remove them from the info server first if that is not intended.

Tested on the iOS simulator with a local, uncommitted ban changenow: { destination: [{ pluginId: 'bitcoin' }] } injected into the raw rollup (evidence table below):

  • 01, 02: baseline 10 FIL to BTC quotes through ChangeNow, the only provider offered.
  • 03: with the ban, the same request drops ChangeNow and the next provider returns its min-limit error.
  • 04, 05: with the ban still on, 9 FIL to LTC quotes through ChangeNow and executes to the success scene, so the ban is scoped to the one asset and provider.
  • 06, 07: same pair and destination (40 XLM to My Bitcoin 3): ChangeNow quotes without the ban and is absent with it.

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Note

Cursor Bugbot is generating a summary for commit cafb5cb. Configure here.

Test evidence

cafb5cb
Disable swap assets per provider
2026-09-30

1. baseline fil btc changenow

2. baseline provider sheet

3. banned fil btc no changenow

4. banned fil ltc changenow quote

5. swap success

6. noban xlm btc changenow

7. banned xlm btc no changenow

The info server leaves tokenId off a mainnet entry, so the cleaned
value is undefined, but the swap scene has compared it to a null
tokenId since the move from GuiCurrencyInfo to tokenId. Mainnet bans
such as { pluginId: 'bitcoinsv' } have not applied since then.

Move the check into a pure isAssetDisabled helper that treats a
missing tokenId as null, and test it.
Read exchangeInfo.swap.disableAssetsByPlugin from the info server. It
uses the disableAssets list shape, keyed by swap pluginId. When the
source or destination asset of a quote request matches a provider's
lists, that provider joins the request's disabled map, and the other
providers still quote.

The check runs in SwapProcessingScene, the only place the swap flow
fetches quotes, so it covers both the first quote and the requote
from the confirmation scene.

exchangeInfo is parsed from the raw rollup because asInfoRollup in
edge-info-server 3.12.0 drops the new key.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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