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 scripts/mapctl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { makeSideShiftSynchronizer } from './synchronizers/sideshift/sideshiftSy
import { makeSwapKitSynchronizer } from './synchronizers/swapkit/swapkitSynchronizer'
import { makeSwapuzSynchronizer } from './synchronizers/swapuz/swapuzSynchronizer'
import { makeThorchainSynchronizer } from './synchronizers/thorchain/thorchainSynchronizer'
import { makeXgramSynchronizer } from './synchronizers/xgram/xgramSynchronizer'
import { SwapSynchronizer } from './types'
import { findSimilar } from './util/stringSimilarity'

Expand Down Expand Up @@ -47,6 +48,7 @@ async function main(): Promise<void> {
makeSideShiftSynchronizer(config),
makeSwapKitSynchronizer(config),
makeSwapuzSynchronizer(config),
makeXgramSynchronizer(config),
makeThorchainSynchronizer(config)
]

Expand Down
92 changes: 92 additions & 0 deletions scripts/mappings/xgramMappings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import { EdgeCurrencyPluginId } from '../../src/util/edgeCurrencyPluginIds'

export const xgram = new Map<string, EdgeCurrencyPluginId | null>()
// WARNING: Not included by the synchronizer synchronization
xgram.set('algorand', 'algorand')

// WARNING: Not included by the synchronizer synchronization
xgram.set('arbitrum', 'arbitrum')

// WARNING: Not included by the synchronizer synchronization
xgram.set('avax', 'avalanche')

// WARNING: Not included by the synchronizer synchronization
xgram.set('bep20', 'binance')

// WARNING: Not included by the synchronizer synchronization
xgram.set('bitcoin', 'bitcoin')

// WARNING: Not included by the synchronizer synchronization
xgram.set('Bitcoin SV', 'bitcoinsv')

// WARNING: Not included by the synchronizer synchronization
xgram.set('bitcoincash', 'bitcoincash')

// WARNING: Not included by the synchronizer synchronization
xgram.set('cardano', 'cardano')

// WARNING: Not included by the synchronizer synchronization
xgram.set('celo', 'celo')

// WARNING: Not included by the synchronizer synchronization
xgram.set('cosmos', 'cosmoshub')

// WARNING: Not included by the synchronizer synchronization
xgram.set('digibyte', 'digibyte')

// WARNING: Not included by the synchronizer synchronization
xgram.set('dogecoin', 'dogecoin')

// WARNING: Not included by the synchronizer synchronization
xgram.set('erc20', 'ethereum')

// WARNING: Not included by the synchronizer synchronization
xgram.set('ethereum classic', 'ethereumclassic')

// WARNING: Not included by the synchronizer synchronization
xgram.set('ethereumpow', 'ethereumpow')

// WARNING: Not included by the synchronizer synchronization
xgram.set('filecoin', 'filecoin')

// WARNING: Not included by the synchronizer synchronization
xgram.set('fio', 'fio')

// WARNING: Not included by the synchronizer synchronization
xgram.set('hedera', 'hedera')

// WARNING: Not included by the synchronizer synchronization
xgram.set('monero', 'monero')

// WARNING: Not included by the synchronizer synchronization
xgram.set('optimism', 'optimism')

// WARNING: Not included by the synchronizer synchronization
xgram.set('osmo', 'osmosis')

// WARNING: Not included by the synchronizer synchronization
xgram.set('polygon', 'polygon')

// WARNING: Not included by the synchronizer synchronization
xgram.set('quantum', 'qtum')

// WARNING: Not included by the synchronizer synchronization
xgram.set('ravencoin', 'ravencoin')

// WARNING: Not included by the synchronizer synchronization
xgram.set('ripple', 'ripple')

// WARNING: Not included by the synchronizer synchronization
xgram.set('sol', 'solana')

// WARNING: Not included by the synchronizer synchronization
xgram.set('sui', 'sui')

// WARNING: Not included by the synchronizer synchronization
xgram.set('trc20', 'tron')

// WARNING: Not included by the synchronizer synchronization
xgram.set('wax', 'wax')

// WARNING: Not included by the synchronizer synchronization
xgram.set('zcash', 'zcash')
31 changes: 31 additions & 0 deletions scripts/synchronizers/xgram/xgramSynchronizer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import fs from 'fs'
import path from 'path'

import { EdgeCurrencyPluginId } from '../../../src/util/edgeCurrencyPluginIds'
import { MapctlConfig } from '../../mapctlConfig'
import { FetchChainCodeResult, SwapSynchronizer } from '../../types'

const MAPPING_FILE_PATH = path.join(
__dirname,
'../../mappings/xgramMappings.ts'
)

export const makeXgramSynchronizer = (
_config: MapctlConfig
): SwapSynchronizer => {
return {
name: 'xgram',
get map(): Map<string, EdgeCurrencyPluginId | null> {
if (fs.existsSync(MAPPING_FILE_PATH)) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { xgram } = require('../../mappings/xgramMappings')
return xgram
}
return new Map()
},
mappingFilePath: MAPPING_FILE_PATH,
fetchChainCodes: async (): Promise<FetchChainCodeResult[]> => {
return []
}
}
}
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 { makeSideshiftPlugin } from './swap/central/sideshift'
import { makeSwapuzPlugin } from './swap/central/swapuz'
import { makeXgramPlugin } from './swap/central/xgram'
import { make0xGaslessPlugin } from './swap/defi/0x/0xGasless'
import { makeBridgelessPlugin } from './swap/defi/bridgeless'
import { makeCosmosIbcPlugin } from './swap/defi/cosmosIbc'
Expand All @@ -30,6 +31,7 @@ const plugins = {
bridgeless: makeBridgelessPlugin,
changehero: makeChangeHeroPlugin,
changenow: makeChangeNowPlugin,
xgram: makeXgramPlugin,
cosmosibc: makeCosmosIbcPlugin,
exolix: makeExolixPlugin,
godex: makeGodexPlugin,
Expand Down
97 changes: 97 additions & 0 deletions src/mappings/xgram.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/**
* ⚠️ AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY ⚠️
*
* This file is automatically generated from scripts/mappings/xgramMappings.ts
* To regenerate this file, run: yarn mapctl update-mappings
*
* To edit mappings:
* 1. Edit scripts/mappings/xgramMappings.ts
* 2. Run: yarn mapctl update-mappings
*
* This file maps EdgeCurrencyPluginId -> synchronizer network identifier (or null)
*/

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

export const xgram = new Map<EdgeCurrencyPluginId, string | null>()
xgram.set('abstract', null)
xgram.set('algorand', 'algorand')
xgram.set('amoy', null)
xgram.set('arbitrum', 'arbitrum')
xgram.set('avalanche', 'avax')
xgram.set('axelar', null)
xgram.set('badcoin', null)
xgram.set('base', null)
xgram.set('binance', 'bep20')
xgram.set('binancesmartchain', null)
xgram.set('bitcoin', 'bitcoin')
xgram.set('bitcoincash', 'bitcoincash')
xgram.set('bitcoincashtestnet', null)
xgram.set('bitcoingold', null)
xgram.set('bitcoingoldtestnet', null)
xgram.set('bitcoinsv', 'Bitcoin SV')
xgram.set('bitcointestnet', null)
xgram.set('bitcointestnet4', null)
xgram.set('bobevm', null)
xgram.set('botanix', null)
xgram.set('calibration', null)
xgram.set('cardano', 'cardano')
xgram.set('cardanotestnet', null)
xgram.set('celo', 'celo')
xgram.set('coreum', null)
xgram.set('cosmoshub', 'cosmos')
xgram.set('dash', null)
xgram.set('digibyte', 'digibyte')
xgram.set('dogecoin', 'dogecoin')
xgram.set('eboost', null)
xgram.set('ecash', null)
xgram.set('eos', null)
xgram.set('ethDev', null)
xgram.set('ethereum', 'erc20')
xgram.set('ethereumclassic', 'ethereum classic')
xgram.set('ethereumpow', 'ethereumpow')
xgram.set('fantom', null)
xgram.set('feathercoin', null)
xgram.set('filecoin', 'filecoin')
xgram.set('filecoinfevm', null)
xgram.set('filecoinfevmcalibration', null)
xgram.set('fio', 'fio')
xgram.set('groestlcoin', null)
xgram.set('hedera', 'hedera')
xgram.set('holesky', null)
xgram.set('hyperevm', null)
xgram.set('liberland', null)
xgram.set('liberlandtestnet', null)
xgram.set('litecoin', null)
xgram.set('monero', 'monero')
xgram.set('optimism', 'optimism')
xgram.set('osmosis', 'osmo')
xgram.set('piratechain', null)
xgram.set('pivx', null)
xgram.set('polkadot', null)
xgram.set('polygon', 'polygon')
xgram.set('pulsechain', null)
xgram.set('qtum', 'quantum')
xgram.set('ravencoin', 'ravencoin')
xgram.set('ripple', 'ripple')
xgram.set('rsk', null)
xgram.set('sepolia', null)
xgram.set('smartcash', null)
xgram.set('solana', 'sol')
xgram.set('sonic', null)
xgram.set('stellar', null)
xgram.set('sui', 'sui')
xgram.set('suitestnet', null)
xgram.set('telos', null)
xgram.set('tezos', null)
xgram.set('thorchainrune', null)
xgram.set('thorchainrunestagenet', null)
xgram.set('ton', null)
xgram.set('tron', 'trc20')
xgram.set('ufo', null)
xgram.set('vertcoin', null)
xgram.set('wax', 'wax')
xgram.set('zano', null)
xgram.set('zcash', 'zcash')
xgram.set('zcoin', null)
xgram.set('zksync', null)
Loading