-
Notifications
You must be signed in to change notification settings - Fork 48
Add xgram support #405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add xgram support #405
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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('ada', 'cardano') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cardano network code uses inconsistent lowercase casingMedium Severity The Cardano network code Additional Locations (1)There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cardano network code uses inconsistent lowercase
|
||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('ALGO', 'algorand') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('ARBITRUM', 'arbitrum') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('ATOM', 'cosmoshub') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('AVAXC', 'avalanche') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('BITCOINCASH', 'bitcoincash') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('BSC', 'binancesmartchain') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('BSV', 'bitcoinsv') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('BTC', 'bitcoin') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('CELO', 'celo') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('DGB', 'digibyte') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('DOGECOIN', 'dogecoin') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('ETH', '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('FIL', 'filecoin') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('FIO', 'fio') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('HBAR', 'hedera') | ||
|
|
||
| // 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('POL', 'polygon') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('QTUM', 'qtum') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('RVN', 'ravencoin') | ||
|
|
||
| // 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('TRX', 'tron') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('WAX', 'wax') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('XMR', 'monero') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('XRP', 'ripple') | ||
|
|
||
| // WARNING: Not included by the synchronizer synchronization | ||
| xgram.set('ZEC', 'zcash') | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { MapctlConfig } from '../../mapctlConfig' | ||
| import { FetchChainCodeResult, SwapSynchronizer } from '../../types' | ||
| import { getMappingFilePath, loadMappingFile } from '../../util/loadMappingFile' | ||
|
|
||
| const NAME = 'xgram' | ||
| export const makeXgramSynchronizer = ( | ||
| _config: MapctlConfig | ||
| ): SwapSynchronizer => { | ||
| return { | ||
| name: NAME, | ||
| get map() { | ||
| return loadMappingFile(NAME) | ||
| }, | ||
| mappingFilePath: getMappingFilePath(NAME), | ||
| fetchChainCodes: async (): Promise<FetchChainCodeResult[]> => [] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| /** | ||
| * ⚠️ 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', 'ALGO') | ||
| xgram.set('amoy', null) | ||
| xgram.set('arbitrum', 'ARBITRUM') | ||
| xgram.set('avalanche', 'AVAXC') | ||
| xgram.set('axelar', null) | ||
| xgram.set('badcoin', null) | ||
| xgram.set('base', null) | ||
| xgram.set('binance', null) | ||
| xgram.set('binancesmartchain', 'BSC') | ||
| xgram.set('bitcoin', 'BTC') | ||
| xgram.set('bitcoincash', 'BITCOINCASH') | ||
| xgram.set('bitcoincashtestnet', null) | ||
| xgram.set('bitcoingold', null) | ||
| xgram.set('bitcoingoldtestnet', null) | ||
| xgram.set('bitcoinsv', 'BSV') | ||
| xgram.set('bitcointestnet', null) | ||
| xgram.set('bitcointestnet4', null) | ||
| xgram.set('bobevm', null) | ||
| xgram.set('botanix', null) | ||
| xgram.set('cacao', null) | ||
| xgram.set('calibration', null) | ||
| xgram.set('cardano', 'ada') | ||
| xgram.set('cardanotestnet', null) | ||
| xgram.set('celo', 'CELO') | ||
| xgram.set('coreum', null) | ||
| xgram.set('cosmoshub', 'ATOM') | ||
| xgram.set('dash', null) | ||
| xgram.set('digibyte', 'DGB') | ||
| xgram.set('dogecoin', 'DOGECOIN') | ||
| xgram.set('eboost', null) | ||
| xgram.set('ecash', null) | ||
| xgram.set('eos', null) | ||
| xgram.set('ethDev', null) | ||
| xgram.set('ethereum', 'ETH') | ||
| xgram.set('ethereumclassic', 'ETHEREUM CLASSIC') | ||
| xgram.set('ethereumpow', 'ETHEREUMPOW') | ||
| xgram.set('fantom', null) | ||
| xgram.set('feathercoin', null) | ||
| xgram.set('filecoin', 'FIL') | ||
| xgram.set('filecoinfevm', null) | ||
| xgram.set('filecoinfevmcalibration', null) | ||
| xgram.set('fio', 'FIO') | ||
| xgram.set('groestlcoin', null) | ||
| xgram.set('hedera', 'HBAR') | ||
| xgram.set('holesky', null) | ||
| xgram.set('hyperevm', null) | ||
| xgram.set('liberland', null) | ||
| xgram.set('liberlandtestnet', null) | ||
| xgram.set('litecoin', null) | ||
| xgram.set('mayachain', null) | ||
| xgram.set('monad', null) | ||
| xgram.set('monero', 'XMR') | ||
| xgram.set('nym', null) | ||
| xgram.set('opbnb', null) | ||
| xgram.set('optimism', 'OPTIMISM') | ||
| xgram.set('osmosis', 'OSMO') | ||
| xgram.set('piratechain', null) | ||
| xgram.set('pivx', null) | ||
| xgram.set('polkadot', null) | ||
| xgram.set('polygon', 'POL') | ||
| xgram.set('pulsechain', null) | ||
| xgram.set('qtum', 'QTUM') | ||
| xgram.set('ravencoin', 'RVN') | ||
| xgram.set('ripple', 'XRP') | ||
| 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', 'TRX') | ||
| xgram.set('ufo', null) | ||
| xgram.set('vertcoin', null) | ||
| xgram.set('wax', 'WAX') | ||
| xgram.set('zano', null) | ||
| xgram.set('zcash', 'ZEC') | ||
| xgram.set('zcoin', null) | ||
| xgram.set('zksync', null) |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cardano network identifier uses inconsistent lowercase casing
Medium Severity
The Cardano network identifier is
'ada'(lowercase) while every other identifier in the mapping uses uppercase ('BTC','ETH','BSC','ALGO', etc.). If the Xgram API is case-sensitive, Cardano swaps will fail because the API receives'ada'instead of'ADA'. The reverse mapping insrc/mappings/xgram.tspropagates the same inconsistency.Additional Locations (1)
src/mappings/xgram.ts#L38-L39