Skip to content

Wire swaps.xyz swap provider - #6128

Open
j0ntz wants to merge 3 commits into
developfrom
jon/1217036054017879
Open

Wire swaps.xyz swap provider#6128
j0ntz wants to merge 3 commits into
developfrom
jon/1217036054017879

Conversation

@j0ntz

@j0ntz j0ntz commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

Depends on EdgeApp/edge-exchange-plugins#480 (the swaps.xyz plugin). This PR is open for review now: it compiles and passes CI standalone. It should only MERGE after #480 merges, edge-exchange-plugins publishes a version containing the swapsxyz plugin, and this branch bumps edge-exchange-plugins to it. Without that bump the registration resolves to no plugin at runtime.

Requirements

No visual changes (env/config wiring only).

Description

Wire the new swaps.xyz swap provider so the app initializes it:

  • src/envConfig.ts — add SWAPSXYZ_INIT core plugin init (apiKey).
  • src/util/corePlugins.ts — register swapsxyz: ENV.SWAPSXYZ_INIT in the Centralized Swaps block of swapPlugins.
  • src/actions/CategoriesActions.tspluginIdIcons entry so swap transactions carry the provider icon.
  • src/constants/MerchantContacts.tsMERCHANT_CONTACTS entry keyed on the plugin's swapInfo.displayName (swaps.xyz) for the transaction-list thumbnail.
  • AGENTS.md (separate commit) — a Swap Provider Integration section listing every wiring point a new swap pluginId needs, since each one fails silently when missed.

No SwapVerifyTermsModal entry. swapsxyz is centralized (isDex: false, see EdgeApp/edge-exchange-plugins#480), but that modal is for providers whose gate is a terms acceptance the user completes in-app; swaps.xyz screens pre-quote and simply refuses a route it will not serve, so there is nothing to accept. The icon asset still needs uploading to content.edge.app at /exchangeIcons/swapsxyz/icon.png.

The runtime key is supplied via env.json SWAPSXYZ_INIT.apiKey. With a published edge-exchange-plugins containing the plugin, the app then offers swaps.xyz quotes.

Verified in-app on the iOS sim (with the plugin linked via updot and the key in env.json): a real Base ETH → USDC swap executed through swaps.xyz to the success scene. Evidence is attached to the plugin PR EdgeApp/edge-exchange-plugins#480.

Asana: https://app.asana.com/0/1215088146871429/1217036054017879


Note

Low Risk
Standard env and registration wiring with no auth or payment logic changes; swap behavior depends on the external plugin package version.

Overview
Registers the swaps.xyz centralized swap provider (swapsxyz) using the same wiring pattern as providers like Swapuz and n.exchange.

Runtime init: SWAPSXYZ_INIT in envConfig (optional apiKey from env.json) and swapsxyz: ENV.SWAPSXYZ_INIT in swapPlugins so the core can load the plugin from edge-exchange-plugins.

UI: Swap provider icon in pluginIdIcons and a MERCHANT_CONTACTS row with displayName swaps.xyz so transaction history shows the correct thumbnail.

Docs: AGENTS.md now documents the full swap-provider checklist (env, corePlugins, icons, merchant contacts, terms modal when needed).

Quotes only appear after edge-exchange-plugins is bumped to a release that includes the swapsxyz plugin; this PR does not bump that dependency.

Reviewed by Cursor Bugbot for commit a737b38. Bugbot is set up for automated code reviews on this repo. Configure here.

Add SWAPSXYZ_INIT core plugin init (envConfig) and register the swapsxyz
swap plugin in corePlugins so the app initializes the new
edge-exchange-plugins swaps.xyz provider from env.json SWAPSXYZ_INIT.apiKey.
Requires a published edge-exchange-plugins containing the swapsxyz plugin
plus a dependency bump before it is functional.
@j0ntz
j0ntz marked this pull request as ready for review August 3, 2026 21:37
@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.

@peachbits peachbits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing CategoriesActions and MerchantContacts entries. May also be missing the SwapVerifyTerms entry, if applicable

j0ntz added 2 commits August 3, 2026 16:06
Registering a swap pluginId needs four or five separate entries in this repo,
and every one of them fails silently when missed: a missing pluginIdIcons or
MERCHANT_CONTACTS row renders a blank icon rather than erroring. The swaps.xyz
wiring shipped without two of them and the omission only surfaced in review.
List the touch points by path, note that MERCHANT_CONTACTS matches on the
plugin's swapInfo.displayName string, and record that SwapVerifyTerms applies
to centralized providers only.
@j0ntz

j0ntz commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Added both missing entries in a fixup on Wire swaps.xyz swap provider:

  • src/actions/CategoriesActions.ts pluginIdIcons: swapsxyz/exchangeIcons/swapsxyz/icon.png
  • src/constants/MerchantContacts.ts: { displayName: 'swaps.xyz' }, matching the plugin's swapInfo.displayName, same icon path

No SwapVerifyTermsModal entry: swapsxyz is isDex: true, and that modal's pluginData covers centralized providers with terms/KYC to accept (changenow, changelly, exolix, sideshift, swapuz, xgram). No DEX plugin (lifi, rango, thorchain, unizen, 0xgasless) has one.

The icon itself still 403s on content.edge.app for both /exchangeIcons/swapsxyz/icon.png and /swapsxyz.png, so the asset needs uploading to the content server separately.

Also added a ## Swap Provider Integration section to AGENTS.md as its own commit, listing every wiring point a new swap pluginId needs and noting that each fails silently when missed.

@j0ntz

j0ntz commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence (after review fixes): swap executed with the swapsxyz wiring, tx row rendered

swap success

swap success

tx list row

tx list row

Captured by the agent's in-app test run (build-and-test).

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