Repository navigation
Wire MoonPay Trade swap provider - #6128
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
peachbits
left a comment
There was a problem hiding this comment.
Missing CategoriesActions and MerchantContacts entries. May also be missing the SwapVerifyTerms entry, if applicable
|
Added both missing entries in a fixup on
No The icon itself still 403s on content.edge.app for both Also added a |
ff855a9 to
50ec11c
Compare
50ec11c to
61f2066
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 61f2066. Configure here.
221cffd to
792a189
Compare
2232ce7 to
f10246b
Compare
peachbits
left a comment
There was a problem hiding this comment.
Wiring reviewed at f10246b: MPTRADE_INIT mirrors SWAPTER_INIT (missing key → false, so the registrations stay off until env.json carries it), both ids sit in the right swapPlugins blocks sharing the one init, pluginIdIcons and MERCHANT_CONTACTS cover both display names, and both CDN icons return 200. The 2026-08-03 asks (CategoriesActions, MerchantContacts) are in; no SwapVerifyTermsModal entry is right for a provider that screens pre-quote. Previous provider additions (swapter, nexchange, nym) touched fewer files than this, so the checklist in AGENTS.md is a net gain.
Two notes, neither blocking:
Note the swap provider integration points in AGENTS.mdis 54 chars; the limit is 50. SuggestDocument swap provider wiring points in AGENTS.md(49) at squash.- As the description says, this lands only after edge-exchange-plugins publishes with
mptrade/mptradedefiand this branch bumps the dependency;^2.55.0resolves both ids to nothing today. - CHANGELOG: this branch creates the
## 4.51.2 (staging)header itself. Every(staging)header in this repo so far has come from the version-bump commit (v4.51.0 in 45cf042, 4.51.1 in 5b8686a), with feature PRs adding their line under whichever header already exists. Keep the entry, but expect the header to be reconciled with the bump at land, since develop now reads## 4.51.1 (2026-09-23)where this hunk expects## 4.51.0 (staging).
f10246b to
15c7a41
Compare
|
All three notes are handled at land, which starts now that both PRs are approved:
|
Add MPTRADE_INIT core plugin init (envConfig) and register the mptrade swap plugin in corePlugins so the app initializes the new edge-exchange-plugins MoonPay Trade provider from env.json MPTRADE_INIT.apiKey. Requires a published edge-exchange-plugins containing the mptrade plugin plus a dependency bump before it is functional.
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 MoonPay Trade 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.
edge-exchange-plugins ships MoonPay Trade as two registrations that share one API key: mptrade (centralized) and mptradedefi (DEX). Register the second one in the Defi block, reusing MPTRADE_INIT, and give its id and display name their own icon and merchant thumbnail. Its routes are Solana-to-Solana today; the id is venue-generic so the set can grow without a new one.
15c7a41 to
ff2d93e
Compare

CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
The entry sits under a new
## 4.51.2 (staging)section, since the task targets the 4.51.2 patch release rather than the next minor.Dependencies
Depends on EdgeApp/edge-exchange-plugins#480 (the MoonPay Trade plugin). This PR is open for review now: it compiles and passes CI standalone. It should only MERGE after EdgeApp/edge-exchange-plugins#480 merges, edge-exchange-plugins publishes a version containing the
mptradeandmptradedefiplugins, and this branch bumpsedge-exchange-pluginsto it. Without that bump the registration resolves to no plugin at runtime.Requirements
No visual changes (env/config wiring only).
Description
Wire the new MoonPay Trade swap provider so the app initializes it. edge-exchange-plugins ships it as TWO registrations sharing one API key:
mptrade, displayed as "MoonPay Trade (Centralized)", andmptradedefi, displayed as "MoonPay Trade (DeFi)" (DEX, Solana-to-Solana routes only); both are wired here:src/envConfig.ts: addMPTRADE_INITcore plugin init (apiKey).src/util/corePlugins.ts: registermptrade: ENV.MPTRADE_INITin the Centralized Swaps block ofswapPlugins, andmptradedefi: ENV.MPTRADE_INITin the Defi Swaps block (same provider and credentials; the DEX half).src/actions/CategoriesActions.ts:pluginIdIconsentries for both ids so swap transactions carry the provider icon.src/constants/MerchantContacts.ts:MERCHANT_CONTACTSentries keyed on each registration'sswapInfo.displayName(MoonPay Trade (Centralized),MoonPay Trade (DeFi)) for the transaction-list thumbnail.AGENTS.md(separate commit): aSwap Provider Integrationsection listing every wiring point a new swappluginIdneeds, since each one fails silently when missed.No
SwapVerifyTermsModalentry.mptradeis 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; MoonPay Trade screens pre-quote and simply refuses a route it will not serve, so there is nothing to accept. The provider icons are live on content.edge.app at/exchangeIcons/mptrade/icon.pngand/exchangeIcons/mptradedefi/icon.png.The runtime key is supplied via
env.jsonMPTRADE_INIT.apiKey. With a published edge-exchange-plugins containing the plugin, the app then offers MoonPay Trade quotes.Verified in-app on the iOS sim (with the plugin linked via updot and the key in env.json): a real Base ETH to USDC swap executed through MoonPay Trade to the success scene, and a real SOL to USDC (Solana) swap executed through the DEX registration to the success scene (1.501804 USDC received against a 1.493 floor), while a SOL to Base USDC quote still routed through the Centralized entry. After the rename, the same Solana pair quoted as "Powered by MoonPay Trade (DeFi)", the provider sheet listed "MoonPay Trade (DeFi)" labeled DEX under both Selected Quote and Fixed Quotes, a real 0.014415 SOL to USDC (Solana) swap reached the Congratulations scene with Exchange Details naming the service "MoonPay Trade (DeFi)", and a USDC (Solana) to USDC (Base) route quoted as "Powered by MoonPay Trade (Centralized)". With the icons live, a USDC to SOL (Solana) quote shows the MoonPay icon in the "Powered by MoonPay Trade (DeFi)" card (frame 42). Swap transaction rows and details resolve their icon from the same pluginIds (
pluginIdIcons) and displayNames (MERCHANT_CONTACTS), so no further gui surface needs the rename. Evidence is in the Test evidence table below and on EdgeApp/edge-exchange-plugins#480.Asana: 1217036054017879
Note
Medium Risk
Enables a new third-party swap path and API-key-backed plugin init; changes are config wiring only but affect exchange routing and user funds once the dependency is published.
Overview
Wires MoonPay Trade into the app as two swap registrations that share
MPTRADE_INIT(apiKeyinenv.json):mptrade(centralized) andmptradedefi(DEX, same credentials).Adds the usual integration touchpoints—
envConfig,swapPluginsincorePlugins.ts,pluginIdIcons, andMERCHANT_CONTACTSfor transaction-list thumbnails—plus a CHANGELOG entry. AGENTS.md now documents every swappluginIdwiring step so missed hooks fail silently.There is no
SwapVerifyTermsModalentry (MoonPay Trade does not use in-app terms acceptance). Runtime quotes depend on bumpingedge-exchange-pluginsafter the plugin ships.Reviewed by Cursor Bugbot for commit ff2d93e. Bugbot is set up for automated code reviews on this repo. Configure here.
Test evidence
(earlier)Wire swaps.xyz swap provider
2. swap success
4. tx list row
18. solana dex quote
19. provider sheet dex label
20. solana dex swap success
21. solana crosschain stays centralized
22. defi quote moonpay trade name
23. provider sheet defi label
24. defi swap success
25. exchange details service name
26. centralized quote moonpay trade name
30. defi quote after rebase
31. defi swap success after rebase
40. mptradedefi quote after rename
41. mptradedefi swap success after rename
792a189Wire the MoonPay Trade DEX registration
2026-09-18
42. mptradedefi powered by icon