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
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"@unizen-io/unizen-contract-addresses": "^0.0.15",
"biggystring": "^4.2.3",
"cleaners": "^0.3.13",
"edge-exchange-plugins": "^2.46.0",
"ethers": "^5.7.0",
"regenerator-runtime": "0.13.11",
"xrpl": "^2.10.0"
Expand Down Expand Up @@ -95,7 +96,8 @@
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"sucrase": "^3.9.5",
"typescript": "~4.9.5",
"ts-node": "^10.9.2",
"typescript": "^6.0.3",
"url": "^0.11.3",
"webpack": "^5.28.0",
"webpack-cli": "^4.6.0",
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { makeGodexPlugin } from './swap/central/godex'
import { makeLetsExchangePlugin } from './swap/central/letsexchange'
import { makeNexchangePlugin } from './swap/central/nexchange'
import { makeSideshiftPlugin } from './swap/central/sideshift'
import { makeSwapterPlugin } from './swap/central/swapter'
import { makeSwapuzPlugin } from './swap/central/swapuz'
import { makeXgramPlugin } from './swap/central/xgram'
import { make0xGaslessPlugin } from './swap/defi/0x/0xGasless'
Expand All @@ -35,6 +36,7 @@ const plugins = {
changenow: makeChangeNowPlugin,
cosmosibc: makeCosmosIbcPlugin,
exolix: makeExolixPlugin,
swapter: makeSwapterPlugin,
godex: makeGodexPlugin,
letsexchange: makeLetsExchangePlugin,
lifi: makeLifiPlugin,
Expand Down
115 changes: 115 additions & 0 deletions src/mappings/swapter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/**
* Swapter Exchange Plugin Chain Mapping
*
* See https://docs.swapter.io/ for API documentation
* Currency list endpoint:
*
* curl -X GET 'https://api.swapter.io/data/coins' \
* -H 'X-API-KEY: <your-api-key>'
*
* This file maps EdgeCurrencyPluginId -> Swapter network identifier
*
* Notes:
* - Only networks confirmed from `/data/coins` are mapped.
* - Unsupported or unverified chains are set to `null`.
* - Swapter uses custom network identifiers for some chains:
* - Avalanche C-Chain -> AVAX_C
* - Binance Smart Chain -> BSC
* - Solana -> SOLANA
* - Tron -> TRX
* - zkSync Era -> ZKS20
* - WAX -> WAXP
* - Some Edge plugin IDs intentionally differ from Swapter naming.
* - EVM chains are mapped directly because Swapter identifies them
* by network name instead of chain ID.
*/

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

export const swapter = new Map<EdgeCurrencyPluginId, string | null>()

swapter.set('abstract', null)
swapter.set('algorand', 'ALGO')
swapter.set('amoy', null)
swapter.set('arbitrum', 'ARBITRUM')
swapter.set('avalanche', 'AVAX_C')
swapter.set('axelar', null)
swapter.set('badcoin', null)
swapter.set('base', 'BASE')
swapter.set('binance', null)
swapter.set('binancesmartchain', 'BSC')
swapter.set('bitcoin', 'BTC')
swapter.set('bitcoincash', 'BCH')
swapter.set('bitcoincashtestnet', null)
swapter.set('bitcoingold', null)
swapter.set('bitcoingoldtestnet', null)
swapter.set('bitcoinsv', 'BSV')
swapter.set('bitcointestnet', null)
swapter.set('bitcointestnet4', null)
swapter.set('bobevm', null)
swapter.set('botanix', null)
swapter.set('calibration', null)
swapter.set('cardano', 'ADA')
swapter.set('cardanotestnet', null)
swapter.set('celo', 'CELO')
swapter.set('coreum', 'CORE')
swapter.set('cosmoshub', 'ATOM')
swapter.set('dash', 'DASH')
swapter.set('digibyte', 'DGB')
swapter.set('dogecoin', 'DOGE')
swapter.set('eboost', null)
swapter.set('ecash', 'XEC')
swapter.set('eos', 'EOS')
swapter.set('ethDev', null)
swapter.set('ethereum', 'ETH')
swapter.set('ethereumclassic', 'ETC')
swapter.set('ethereumpow', 'ETHW')
swapter.set('fantom', null)
swapter.set('feathercoin', null)
swapter.set('filecoin', 'FIL')
swapter.set('filecoinfevm', null)
swapter.set('filecoinfevmcalibration', null)
swapter.set('fio', 'FIO')
swapter.set('groestlcoin', null)
swapter.set('hedera', 'HBAR')
swapter.set('holesky', null)
swapter.set('hyperevm', null)
swapter.set('liberland', null)
swapter.set('liberlandtestnet', null)
swapter.set('litecoin', 'LTC')
swapter.set('mayachain', null)
swapter.set('monad', null)
swapter.set('monero', 'XMR')
swapter.set('nym', null)
swapter.set('opbnb', null)
swapter.set('optimism', 'OPTIMISM')
swapter.set('osmosis', 'OSMO')
swapter.set('piratechain', null)
swapter.set('pivx', null)
swapter.set('polkadot', 'DOT')
swapter.set('polygon', 'POLYGON')
swapter.set('pulsechain', null)
swapter.set('qtum', 'QTUM')
swapter.set('ravencoin', 'RVN')
swapter.set('ripple', 'XRP')
swapter.set('rsk', null)
swapter.set('sepolia', null)
swapter.set('smartcash', null)
swapter.set('solana', 'SOLANA')
swapter.set('sonic', 'SONIC')
swapter.set('stellar', 'XLM')
swapter.set('sui', 'SUI')
swapter.set('suitestnet', null)
swapter.set('telos', 'TELOS')
swapter.set('tezos', 'XTZ')
swapter.set('thorchainrune', null)
swapter.set('thorchainrunestagenet', null)
swapter.set('ton', 'TON')
swapter.set('tron', 'TRX')
swapter.set('ufo', null)
swapter.set('vertcoin', null)
swapter.set('wax', 'WAXP')
swapter.set('zano', null)
swapter.set('zcash', 'ZEC')
swapter.set('zcoin', null)
swapter.set('zksync', 'ZKS20')
Loading