Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
- `npm run precommit` - Full pre-commit check (localize, lint-staged, tsc, test)
- `tsc` - TypeScript type checking (via package.json script)

## Swap Provider Integration

The plugin itself lives in `edge-exchange-plugins`; this repo only wires it up, and every wiring point below fails SILENTLY when missed (no error, just a blank icon or a provider that never initializes). Registering a new swap `pluginId` means all of:

- `src/envConfig.ts` - `<NAME>_INIT` via `asCorePluginInit`, when the plugin takes init options (an `apiKey`)
- `src/util/corePlugins.ts` - `swapPlugins` entry mapping the `pluginId` to that init (or `true` when it needs none)
- `src/actions/CategoriesActions.ts` - `pluginIdIcons` entry, or swap transactions render without a provider icon
- `src/constants/MerchantContacts.ts` - `MERCHANT_CONTACTS` entry whose `displayName` matches the plugin's `swapInfo.displayName` exactly, since the tx list matches thumbnails by that string
- `src/components/modals/SwapVerifyTermsModal.tsx` - `pluginData` entry ONLY for centralized providers with terms/KYC to accept; DEX plugins (`isDex: true`) take none

New swap icons live at `https://content.edge.app/exchangeIcons/<pluginId>/icon.png` (`getSwapPluginIconUri` in `src/util/CdnUris.ts`) and must be uploaded to the content server separately, or the URL 403s. The wiring stays inert until `package.json` bumps `edge-exchange-plugins` to a published version containing the plugin.

## Code Style Guidelines

- **Formatting**: Prettier with single quotes, no semicolons, no trailing commas, 80 char width
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased (develop)

- added: swaps.xyz swap provider wiring (SWAPSXYZ_INIT core plugin init and registration).
- added: Verbose logging for exchange rate queries: the request body, resolved/rate-less counts, and errors are captured when the Verbose Logging setting is enabled.
- added: Exchange-rate cache snapshot in the support log output, plus a `rates-cache-replay` script that re-runs those queries against the rates server and reports the result for each pair.
- added: "-m" tag on the version number in the Help scene for Maestro test builds
Expand Down
1 change: 1 addition & 0 deletions src/actions/CategoriesActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ export const pluginIdIcons: Record<string, string> = {
rango: EDGE_CONTENT_SERVER_URI + '/rango.png',
sideshift: EDGE_CONTENT_SERVER_URI + '/sideshift-logo.png',
simplex: EDGE_CONTENT_SERVER_URI + '/simplex.png',
swapsxyz: EDGE_CONTENT_SERVER_URI + '/exchangeIcons/swapsxyz/icon.png',
swapuz: EDGE_CONTENT_SERVER_URI + '/swapuz.png',
thorchain: EDGE_CONTENT_SERVER_URI + '/thorchain.png',
unizen: EDGE_CONTENT_SERVER_URI + '/unizen.png',
Expand Down
4 changes: 4 additions & 0 deletions src/constants/MerchantContacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export const MERCHANT_CONTACTS: MerchantContact[] = [
displayName: 'Simplex',
thumbnailPath: `${EDGE_CONTENT_SERVER_URI}/simplex.png`
},
{
displayName: 'swaps.xyz',
thumbnailPath: `${EDGE_CONTENT_SERVER_URI}/exchangeIcons/swapsxyz/icon.png`
},
{
displayName: 'Swapuz',
thumbnailPath: `${EDGE_CONTENT_SERVER_URI}/swapuz.png`
Expand Down
5 changes: 5 additions & 0 deletions src/envConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ export const asEnvConfig = asObject({
quiknodeApiKey: asOptional(asString, '')
}).withRest
),
SWAPSXYZ_INIT: asCorePluginInit(
asObject({
apiKey: asOptional(asString, '')
}).withRest
),
SWAPUZ_INIT: asCorePluginInit(
asObject({
apiKey: asOptional(asString, '')
Expand Down
1 change: 1 addition & 0 deletions src/util/corePlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const swapPlugins = {
letsexchange: ENV.LETSEXCHANGE_INIT,
nexchange: ENV.NEXCHANGE_INIT,
sideshift: ENV.SIDESHIFT_INIT,
swapsxyz: ENV.SWAPSXYZ_INIT,
swapuz: ENV.SWAPUZ_INIT,
xgram: ENV.XGRAM_INIT,
nymswap: ENV.NYM_SWAP_INIT,
Expand Down
Loading