Skip to content

Commit 050dd3a

Browse files
Jon-edgexgram
authored andcommitted
Add Xgram swap support
1 parent 48e125e commit 050dd3a

File tree

7 files changed

+604
-2
lines changed

7 files changed

+604
-2
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pipeline {
2-
agent any
2+
agent { label 'build' }
33
tools { nodejs '22' }
44
options {
55
buildDiscarder logRotator(daysToKeepStr: '30', numToKeepStr: '5')

scripts/allSynchronizers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { makeSideShiftSynchronizer } from './synchronizers/sideshift/sideshiftSy
1919
import { makeSwapKitSynchronizer } from './synchronizers/swapkit/swapkitSynchronizer'
2020
import { makeSwapuzSynchronizer } from './synchronizers/swapuz/swapuzSynchronizer'
2121
import { makeThorchainSynchronizer } from './synchronizers/thorchain/thorchainSynchronizer'
22+
import { makeXgramSynchronizer } from './synchronizers/xgram/xgramSynchronizer'
2223
import { SwapSynchronizer } from './types'
2324

2425
export const synchronizers: SwapSynchronizer[] = [
@@ -33,5 +34,6 @@ export const synchronizers: SwapSynchronizer[] = [
3334
makeSideShiftSynchronizer(config),
3435
makeSwapKitSynchronizer(config),
3536
makeSwapuzSynchronizer(config),
36-
makeThorchainSynchronizer(config)
37+
makeThorchainSynchronizer(config),
38+
makeXgramSynchronizer(config)
3739
]

scripts/mappings/xgramMappings.ts

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import { EdgeCurrencyPluginId } from '../../src/util/edgeCurrencyPluginIds'
2+
3+
export const xgram = new Map<string, EdgeCurrencyPluginId | null>()
4+
// WARNING: Not included by the synchronizer synchronization
5+
xgram.set('ada', 'cardano')
6+
7+
// WARNING: Not included by the synchronizer synchronization
8+
xgram.set('ALGO', 'algorand')
9+
10+
// WARNING: Not included by the synchronizer synchronization
11+
xgram.set('ARBITRUM', 'arbitrum')
12+
13+
// WARNING: Not included by the synchronizer synchronization
14+
xgram.set('ATOM', 'cosmoshub')
15+
16+
// WARNING: Not included by the synchronizer synchronization
17+
xgram.set('AVAXC', 'avalanche')
18+
19+
// WARNING: Not included by the synchronizer synchronization
20+
xgram.set('BITCOINCASH', 'bitcoincash')
21+
22+
// WARNING: Not included by the synchronizer synchronization
23+
xgram.set('BSC', 'binancesmartchain')
24+
25+
// WARNING: Not included by the synchronizer synchronization
26+
xgram.set('BSV', 'bitcoinsv')
27+
28+
// WARNING: Not included by the synchronizer synchronization
29+
xgram.set('BTC', 'bitcoin')
30+
31+
// WARNING: Not included by the synchronizer synchronization
32+
xgram.set('CELO', 'celo')
33+
34+
// WARNING: Not included by the synchronizer synchronization
35+
xgram.set('DGB', 'digibyte')
36+
37+
// WARNING: Not included by the synchronizer synchronization
38+
xgram.set('DOGECOIN', 'dogecoin')
39+
40+
// WARNING: Not included by the synchronizer synchronization
41+
xgram.set('ETH', 'ethereum')
42+
43+
// WARNING: Not included by the synchronizer synchronization
44+
xgram.set('ETHEREUM CLASSIC', 'ethereumclassic')
45+
46+
// WARNING: Not included by the synchronizer synchronization
47+
xgram.set('ETHEREUMPOW', 'ethereumpow')
48+
49+
// WARNING: Not included by the synchronizer synchronization
50+
xgram.set('FIL', 'filecoin')
51+
52+
// WARNING: Not included by the synchronizer synchronization
53+
xgram.set('FIO', 'fio')
54+
55+
// WARNING: Not included by the synchronizer synchronization
56+
xgram.set('HBAR', 'hedera')
57+
58+
// WARNING: Not included by the synchronizer synchronization
59+
xgram.set('OPTIMISM', 'optimism')
60+
61+
// WARNING: Not included by the synchronizer synchronization
62+
xgram.set('OSMO', 'osmosis')
63+
64+
// WARNING: Not included by the synchronizer synchronization
65+
xgram.set('POL', 'polygon')
66+
67+
// WARNING: Not included by the synchronizer synchronization
68+
xgram.set('QTUM', 'qtum')
69+
70+
// WARNING: Not included by the synchronizer synchronization
71+
xgram.set('RVN', 'ravencoin')
72+
73+
// WARNING: Not included by the synchronizer synchronization
74+
xgram.set('SOL', 'solana')
75+
76+
// WARNING: Not included by the synchronizer synchronization
77+
xgram.set('SUI', 'sui')
78+
79+
// WARNING: Not included by the synchronizer synchronization
80+
xgram.set('TRX', 'tron')
81+
82+
// WARNING: Not included by the synchronizer synchronization
83+
xgram.set('WAX', 'wax')
84+
85+
// WARNING: Not included by the synchronizer synchronization
86+
xgram.set('XMR', 'monero')
87+
88+
// WARNING: Not included by the synchronizer synchronization
89+
xgram.set('XRP', 'ripple')
90+
91+
// WARNING: Not included by the synchronizer synchronization
92+
xgram.set('ZEC', 'zcash')
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { MapctlConfig } from '../../mapctlConfig'
2+
import { FetchChainCodeResult, SwapSynchronizer } from '../../types'
3+
import { getMappingFilePath, loadMappingFile } from '../../util/loadMappingFile'
4+
5+
const NAME = 'xgram'
6+
export const makeXgramSynchronizer = (
7+
_config: MapctlConfig
8+
): SwapSynchronizer => {
9+
return {
10+
name: NAME,
11+
get map() {
12+
return loadMappingFile(NAME)
13+
},
14+
mappingFilePath: getMappingFilePath(NAME),
15+
fetchChainCodes: async (): Promise<FetchChainCodeResult[]> => []
16+
}
17+
}

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { makeGodexPlugin } from './swap/central/godex'
99
import { makeLetsExchangePlugin } from './swap/central/letsexchange'
1010
import { makeSideshiftPlugin } from './swap/central/sideshift'
1111
import { makeSwapuzPlugin } from './swap/central/swapuz'
12+
import { makeXgramPlugin } from './swap/central/xgram'
1213
import { make0xGaslessPlugin } from './swap/defi/0x/0xGasless'
1314
import { makeBridgelessPlugin } from './swap/defi/bridgeless'
1415
import { makeCosmosIbcPlugin } from './swap/defi/cosmosIbc'
@@ -48,6 +49,7 @@ const plugins = {
4849
transfer: makeTransferPlugin,
4950
unizen: makeUnizenPlugin,
5051
velodrome: makeVelodromePlugin,
52+
xgram: makeXgramPlugin,
5153
xrpdex,
5254
fantomsonicupgrade: makeFantomSonicUpgradePlugin,
5355
'0xgasless': make0xGaslessPlugin

src/mappings/xgram.ts

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/**
2+
* ⚠️ AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY ⚠️
3+
*
4+
* This file is automatically generated from scripts/mappings/xgramMappings.ts
5+
* To regenerate this file, run: yarn mapctl update-mappings
6+
*
7+
* To edit mappings:
8+
* 1. Edit scripts/mappings/xgramMappings.ts
9+
* 2. Run: yarn mapctl update-mappings
10+
*
11+
* This file maps EdgeCurrencyPluginId -> synchronizer network identifier (or null)
12+
*/
13+
14+
import { EdgeCurrencyPluginId } from '../util/edgeCurrencyPluginIds'
15+
16+
export const xgram = new Map<EdgeCurrencyPluginId, string | null>()
17+
xgram.set('abstract', null)
18+
xgram.set('algorand', 'ALGO')
19+
xgram.set('amoy', null)
20+
xgram.set('arbitrum', 'ARBITRUM')
21+
xgram.set('avalanche', 'AVAXC')
22+
xgram.set('axelar', null)
23+
xgram.set('badcoin', null)
24+
xgram.set('base', null)
25+
xgram.set('binance', null)
26+
xgram.set('binancesmartchain', 'BSC')
27+
xgram.set('bitcoin', 'BTC')
28+
xgram.set('bitcoincash', 'BITCOINCASH')
29+
xgram.set('bitcoincashtestnet', null)
30+
xgram.set('bitcoingold', null)
31+
xgram.set('bitcoingoldtestnet', null)
32+
xgram.set('bitcoinsv', 'BSV')
33+
xgram.set('bitcointestnet', null)
34+
xgram.set('bitcointestnet4', null)
35+
xgram.set('bobevm', null)
36+
xgram.set('botanix', null)
37+
xgram.set('cacao', null)
38+
xgram.set('calibration', null)
39+
xgram.set('cardano', 'ada')
40+
xgram.set('cardanotestnet', null)
41+
xgram.set('celo', 'CELO')
42+
xgram.set('coreum', null)
43+
xgram.set('cosmoshub', 'ATOM')
44+
xgram.set('dash', null)
45+
xgram.set('digibyte', 'DGB')
46+
xgram.set('dogecoin', 'DOGECOIN')
47+
xgram.set('eboost', null)
48+
xgram.set('ecash', null)
49+
xgram.set('eos', null)
50+
xgram.set('ethDev', null)
51+
xgram.set('ethereum', 'ETH')
52+
xgram.set('ethereumclassic', 'ETHEREUM CLASSIC')
53+
xgram.set('ethereumpow', 'ETHEREUMPOW')
54+
xgram.set('fantom', null)
55+
xgram.set('feathercoin', null)
56+
xgram.set('filecoin', 'FIL')
57+
xgram.set('filecoinfevm', null)
58+
xgram.set('filecoinfevmcalibration', null)
59+
xgram.set('fio', 'FIO')
60+
xgram.set('groestlcoin', null)
61+
xgram.set('hedera', 'HBAR')
62+
xgram.set('holesky', null)
63+
xgram.set('hyperevm', null)
64+
xgram.set('liberland', null)
65+
xgram.set('liberlandtestnet', null)
66+
xgram.set('litecoin', null)
67+
xgram.set('mayachain', null)
68+
xgram.set('monad', null)
69+
xgram.set('monero', 'XMR')
70+
xgram.set('nym', null)
71+
xgram.set('opbnb', null)
72+
xgram.set('optimism', 'OPTIMISM')
73+
xgram.set('osmosis', 'OSMO')
74+
xgram.set('piratechain', null)
75+
xgram.set('pivx', null)
76+
xgram.set('polkadot', null)
77+
xgram.set('polygon', 'POL')
78+
xgram.set('pulsechain', null)
79+
xgram.set('qtum', 'QTUM')
80+
xgram.set('ravencoin', 'RVN')
81+
xgram.set('ripple', 'XRP')
82+
xgram.set('rsk', null)
83+
xgram.set('sepolia', null)
84+
xgram.set('smartcash', null)
85+
xgram.set('solana', 'SOL')
86+
xgram.set('sonic', null)
87+
xgram.set('stellar', null)
88+
xgram.set('sui', 'SUI')
89+
xgram.set('suitestnet', null)
90+
xgram.set('telos', null)
91+
xgram.set('tezos', null)
92+
xgram.set('thorchainrune', null)
93+
xgram.set('thorchainrunestagenet', null)
94+
xgram.set('ton', null)
95+
xgram.set('tron', 'TRX')
96+
xgram.set('ufo', null)
97+
xgram.set('vertcoin', null)
98+
xgram.set('wax', 'WAX')
99+
xgram.set('zano', null)
100+
xgram.set('zcash', 'ZEC')
101+
xgram.set('zcoin', null)
102+
xgram.set('zksync', null)

0 commit comments

Comments
 (0)