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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- added: NYM centralized swap integration (testnet)

## 2.46.0 (2026-04-18)

- changed: Migrate Thorchain swap endpoints off NineRealms (thornode, tx tracker, Midgard sync fallback).
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { makeExolixPlugin } from './swap/central/exolix'
import { makeGodexPlugin } from './swap/central/godex'
import { makeLetsExchangePlugin } from './swap/central/letsexchange'
import { makeNexchangePlugin } from './swap/central/nexchange'
import { makeNymPlugin } from './swap/central/nym'
import { makeSideshiftPlugin } from './swap/central/sideshift'
import { makeSwapuzPlugin } from './swap/central/swapuz'
import { makeXgramPlugin } from './swap/central/xgram'
Expand Down Expand Up @@ -39,6 +40,7 @@ const plugins = {
letsexchange: makeLetsExchangePlugin,
lifi: makeLifiPlugin,
nexchange: makeNexchangePlugin,
nymswap: makeNymPlugin,
rango: makeRangoPlugin,
sideshift: makeSideshiftPlugin,
spookySwap: makeSpookySwapPlugin,
Expand Down
38 changes: 38 additions & 0 deletions src/mappings/nym.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* NYM Exchange Plugin Chain Mapping
*
* Maps EdgeCurrencyPluginId -> NYM `chainNetwork` identifier (or null when the
* chain is not offered by NYM).
*
* NYM exposes an "Edge Partner API" whose asset references mirror Edge's own
* model: a `chainNetwork` string, an optional EVM `chainId`, and an optional
* `tokenId` (the 0x contract address). `chainNetwork` is the network *family*
* name; for EVM chains the `chainId` (taken from the wallet's `evmChainId` at
* quote time) distinguishes mainnet from testnet. On the current testnet API,
* Sepolia is therefore `chainNetwork: 'ethereum'` + `chainId: 11155111`, which
* is why the Edge `sepolia` pluginId maps to `'ethereum'` below.
*
* Every NYM swap must have the NYM asset (`chainNetwork: 'sandbox'`, Edge
* pluginId `nym`) on one side; this is enforced in ../swap/central/nym.ts.
*
* NYM is testnet-only for now. The authoritative list of supported assets is
* `GET /api/partner/v1/currencies`; the entries below reflect that testnet list
* (BTC, LTC, ZEC, DASH, Sepolia ETH/USDC, ADA, NYM) and should be expanded
* (including mainnet `ethereum` with chainId 1) when NYM launches mainnet.
*
* See https://nym-swap-testnet-api.nymte.ch/api/docs/ for the API docs.
*/

import { EdgeCurrencyPluginId } from '../util/edgeCurrencyPluginIds'

export const nym = new Map<EdgeCurrencyPluginId, string | null>()
nym.set('bitcoin', 'bitcoin')
nym.set('cardano', 'cardano')
nym.set('dash', 'dash')
nym.set('litecoin', 'litecoin')
// The NYM asset itself (testnet "sandbox" network).
nym.set('nym', 'sandbox')
// Sepolia is the only EVM testnet NYM supports; chainId 11155111 is supplied
// from the wallet's evmChainId at quote time.
nym.set('sepolia', 'ethereum')
nym.set('zcash', 'zcash')
Loading
Loading