@subwallet/chain-list 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle-subwallet-chain-list.js +1620 -157
- package/cjs/packageInfo.js +1 -1
- package/data/AssetRef.json +7 -0
- package/data/ChainAsset.json +1392 -17
- package/data/ChainInfo.json +4 -4
- package/data/MultiChainAsset.json +81 -1
- package/migrate/add-ED.js +2230 -2227
- package/migrate/add-decimals.js +3748 -3745
- package/migrate/convert-change-list.js +96 -93
- package/migrate/generate-native-tokens.js +3744 -3738
- package/migrate/subscan-support-map.js +15 -0
- package/migrate/update-price-symbol.js +42 -15
- package/migrate/validate-chainAsset.js +3 -0
- package/package.json +2 -1
- package/packageInfo.js +1 -1
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
// Copyright 2017-2023 @subwallet/chain-list authors & contributors
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
1
4
|
// Convert chain list
|
|
2
5
|
|
|
3
6
|
const ContractType = {
|
|
4
7
|
wasm: 'wasm',
|
|
5
8
|
evm: 'evm'
|
|
6
|
-
}
|
|
9
|
+
};
|
|
7
10
|
|
|
8
11
|
const inputMap = {
|
|
9
12
|
polkadot: {
|
|
@@ -2779,87 +2782,87 @@ const inputMap = {
|
|
|
2779
2782
|
nativeToken: 'JOY',
|
|
2780
2783
|
decimals: 10
|
|
2781
2784
|
}
|
|
2782
|
-
}
|
|
2785
|
+
};
|
|
2783
2786
|
|
|
2784
2787
|
const subscanExplorerMap = {
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
}
|
|
2788
|
+
polkadot: 'https://polkadot.subscan.io/',
|
|
2789
|
+
acala: 'https://acala.subscan.io/',
|
|
2790
|
+
astar: 'https://astar.subscan.io/',
|
|
2791
|
+
bifrost: 'https://bifrost.subscan.io/',
|
|
2792
|
+
centrifuge: 'https://centrifuge.subscan.io/',
|
|
2793
|
+
clv: 'https://clv.subscan.io/',
|
|
2794
|
+
composable: 'https://composable.subscan.io/',
|
|
2795
|
+
'crust-parachain': 'https://crust-parachain.subscan.io/',
|
|
2796
|
+
'darwinia-parachain': 'https://darwinia-parachain.subscan.io/',
|
|
2797
|
+
efinity: 'https://efinity.subscan.io/',
|
|
2798
|
+
equilibrium: 'https://equilibrium.subscan.io/',
|
|
2799
|
+
hydradx: 'https://hydradx.subscan.io/',
|
|
2800
|
+
interlay: 'https://interlay.subscan.io/',
|
|
2801
|
+
spiritnet: 'https://spiritnet.subscan.io/',
|
|
2802
|
+
moonbeam: 'https://moonbeam.subscan.io/',
|
|
2803
|
+
nodle: 'https://nodle.subscan.io/',
|
|
2804
|
+
origintrail: 'https://origintrail.subscan.io/',
|
|
2805
|
+
parallel: 'https://parallel.subscan.io/',
|
|
2806
|
+
phala: 'https://phala.subscan.io/',
|
|
2807
|
+
statemint: 'https://statemint.subscan.io/',
|
|
2808
|
+
unique: 'https://unique.subscan.io/',
|
|
2809
|
+
zeitgeist: 'https://zeitgeist.subscan.io/',
|
|
2810
|
+
kusama: 'https://kusama.subscan.io/',
|
|
2811
|
+
altair: 'https://altair.subscan.io/',
|
|
2812
|
+
bajun: 'https://bajun.subscan.io/',
|
|
2813
|
+
basilisk: 'https://basilisk.subscan.io/',
|
|
2814
|
+
'bifrost-kusama': 'https://bifrost-kusama.subscan.io/',
|
|
2815
|
+
calamari: 'https://calamari.subscan.io/',
|
|
2816
|
+
crab: 'https://crab.subscan.io/',
|
|
2817
|
+
datahighway: 'https://datahighway.subscan.io/',
|
|
2818
|
+
encointer: 'https://encointer.subscan.io/',
|
|
2819
|
+
'parallel-heiko': 'https://parallel-heiko.subscan.io/',
|
|
2820
|
+
integritee: 'https://integritee.subscan.io/',
|
|
2821
|
+
karura: 'https://karura.subscan.io/',
|
|
2822
|
+
khala: 'https://khala.subscan.io/',
|
|
2823
|
+
kintsugi: 'https://kintsugi.subscan.io/',
|
|
2824
|
+
mangatax: 'https://mangatax.subscan.io/',
|
|
2825
|
+
moonriver: 'https://moonriver.subscan.io/',
|
|
2826
|
+
picasso: 'https://picasso.subscan.io/',
|
|
2827
|
+
pioneer: 'https://pioneer.subscan.io/',
|
|
2828
|
+
quartz: 'https://quartz.subscan.io/',
|
|
2829
|
+
robonomics: 'https://robonomics.subscan.io/',
|
|
2830
|
+
shadow: 'https://shadow.subscan.io/',
|
|
2831
|
+
shiden: 'https://shiden.subscan.io/',
|
|
2832
|
+
snow: 'https://snow.subscan.io/',
|
|
2833
|
+
statemine: 'https://statemine.subscan.io/',
|
|
2834
|
+
turing: 'https://turing.subscan.io/',
|
|
2835
|
+
darwinia: 'https://darwinia.subscan.io/',
|
|
2836
|
+
alephzero: 'https://alephzero.subscan.io/',
|
|
2837
|
+
clover: 'https://clover.subscan.io/',
|
|
2838
|
+
crust: 'https://crust.subscan.io/',
|
|
2839
|
+
dbc: 'https://dbc.subscan.io/',
|
|
2840
|
+
dock: 'https://dock.subscan.io/',
|
|
2841
|
+
edgeware: 'https://edgeware.subscan.io/',
|
|
2842
|
+
genshiro: 'https://genshiro.subscan.io/',
|
|
2843
|
+
polkadex: 'https://polkadex.subscan.io/',
|
|
2844
|
+
polymesh: 'https://polymesh.subscan.io/',
|
|
2845
|
+
reef: 'https://reef.subscan.io/',
|
|
2846
|
+
sakura: 'https://sakura.subscan.io/',
|
|
2847
|
+
sora: 'https://sora.subscan.io/',
|
|
2848
|
+
stafi: 'https://stafi.subscan.io/',
|
|
2849
|
+
rococo: 'https://rococo.subscan.io/',
|
|
2850
|
+
'bifrost-testnet': 'https://bifrost-testnet.subscan.io/',
|
|
2851
|
+
dali: 'https://dali.subscan.io/',
|
|
2852
|
+
dolphin: 'https://dolphin.subscan.io/',
|
|
2853
|
+
'origintrail-testnet': 'https://origintrail-testnet.subscan.io/',
|
|
2854
|
+
rockmine: 'https://rockmine.subscan.io/',
|
|
2855
|
+
westend: 'https://westend.subscan.io/',
|
|
2856
|
+
'acala-testnet': 'https://acala-testnet.subscan.io/',
|
|
2857
|
+
arctic: 'https://arctic.subscan.io/',
|
|
2858
|
+
'clover-testnet': 'https://clover-testnet.subscan.io/',
|
|
2859
|
+
'kilt-testnet': 'https://kilt-testnet.subscan.io/',
|
|
2860
|
+
moonbase: 'https://moonbase.subscan.io/',
|
|
2861
|
+
pangoro: 'https://pangoro.subscan.io/',
|
|
2862
|
+
'polymesh-testnet': 'https://polymesh-testnet.subscan.io/',
|
|
2863
|
+
shibuya: 'https://shibuya.subscan.io/',
|
|
2864
|
+
subspace: 'https://subspace.subscan.io/'
|
|
2865
|
+
};
|
|
2863
2866
|
const evmExplorerMap = {
|
|
2864
2867
|
moonbeam: 'https://moonbeam.moonscan.io',
|
|
2865
2868
|
moonriver: 'https://moonriver.moonscan.io',
|
|
@@ -2873,13 +2876,13 @@ const evmExplorerMap = {
|
|
|
2873
2876
|
bobabeam: 'https://blockexplorer.bobabeam.boba.network'
|
|
2874
2877
|
};
|
|
2875
2878
|
|
|
2876
|
-
const useSubscanMap = Object.fromEntries(Object.keys(subscanExplorerMap).map(k => [k, false]));
|
|
2879
|
+
const useSubscanMap = Object.fromEntries(Object.keys(subscanExplorerMap).map((k) => [k, false]));
|
|
2877
2880
|
|
|
2878
2881
|
// Convert inputMap to outputMap
|
|
2879
2882
|
const outputMap = Object.keys(inputMap).reduce((acc, k) => {
|
|
2880
2883
|
const value = inputMap[k];
|
|
2881
2884
|
// Extract all the values from the value
|
|
2882
|
-
const {
|
|
2885
|
+
const { abiExplorer, active, apiStatus, blockExplorer, chain, chainType, coinGeckoKey, crowdloanUrl, currentProvider, currentProviderMode, customProviders, decimals, dependencies, evmChainId, genesisHash, getStakingOnChain, groups, icon, isEthereum, isHybrid, key, nativeToken, nftProvider, paraId, providers, requestId, ss58Format, supportBonding, supportSmartContract } = value;
|
|
2883
2886
|
|
|
2884
2887
|
const newItem = {
|
|
2885
2888
|
slug: key,
|
|
@@ -2888,11 +2891,11 @@ const outputMap = Object.keys(inputMap).reduce((acc, k) => {
|
|
|
2888
2891
|
providers,
|
|
2889
2892
|
isTestnet: groups.includes('TEST_NET'),
|
|
2890
2893
|
substrateInfo: null,
|
|
2891
|
-
evmInfo: null
|
|
2892
|
-
}
|
|
2894
|
+
evmInfo: null
|
|
2895
|
+
};
|
|
2893
2896
|
|
|
2894
2897
|
if (subscanExplorerMap[k]) {
|
|
2895
|
-
useSubscanMap[k] = true
|
|
2898
|
+
useSubscanMap[k] = true;
|
|
2896
2899
|
}
|
|
2897
2900
|
|
|
2898
2901
|
if (isEthereum || currentProviderMode === 'http') {
|
|
@@ -2901,19 +2904,18 @@ const outputMap = Object.keys(inputMap).reduce((acc, k) => {
|
|
|
2901
2904
|
|
|
2902
2905
|
newItem.evmInfo = {
|
|
2903
2906
|
evmChainId,
|
|
2904
|
-
blockExplorer: subscanExplorerMap[k] || evmExplorerMap[k]|| blockExplorer,
|
|
2907
|
+
blockExplorer: subscanExplorerMap[k] || evmExplorerMap[k] || blockExplorer,
|
|
2905
2908
|
symbol: nativeToken,
|
|
2906
2909
|
decimals,
|
|
2907
2910
|
existentialDeposit: '0',
|
|
2908
|
-
supportSmartContract: ['ERC20', 'ERC721']
|
|
2909
|
-
}
|
|
2911
|
+
supportSmartContract: ['ERC20', 'ERC721']
|
|
2912
|
+
};
|
|
2910
2913
|
}
|
|
2911
2914
|
|
|
2912
2915
|
if (currentProviderMode === 'ws') {
|
|
2913
2916
|
// set prop substrateInfo with these field:
|
|
2914
2917
|
// paraId, relaySlug, genesisHash, addressPrefix, crowdloanUrl, chainType, blockExplorer, symbol, existentialDeposit, decimals, hasNativeNft, supportStaking, supportSmartContract
|
|
2915
2918
|
|
|
2916
|
-
|
|
2917
2919
|
newItem.substrateInfo = {
|
|
2918
2920
|
paraId: paraId || null,
|
|
2919
2921
|
relaySlug: null,
|
|
@@ -2927,13 +2929,14 @@ const outputMap = Object.keys(inputMap).reduce((acc, k) => {
|
|
|
2927
2929
|
decimals,
|
|
2928
2930
|
supportStaking: supportBonding || false,
|
|
2929
2931
|
hasNativeNft: false,
|
|
2930
|
-
supportSmartContract: supportSmartContract && supportSmartContract.filter(i => (i !== 'ERC20' && i !== 'ERC721')) || null
|
|
2931
|
-
}
|
|
2932
|
+
supportSmartContract: supportSmartContract && supportSmartContract.filter((i) => (i !== 'ERC20' && i !== 'ERC721')) || null
|
|
2933
|
+
};
|
|
2932
2934
|
|
|
2933
2935
|
if (groups.includes('POLKADOT_PARACHAIN') && paraId) {
|
|
2934
2936
|
newItem.substrateInfo.relaySlug = 'polkadot';
|
|
2935
2937
|
newItem.substrateInfo.chainType = 'PARACHAIN';
|
|
2936
2938
|
}
|
|
2939
|
+
|
|
2937
2940
|
if (groups.includes('KUSAMA_PARACHAIN') && paraId) {
|
|
2938
2941
|
newItem.substrateInfo.relaySlug = 'kusama';
|
|
2939
2942
|
newItem.substrateInfo.chainType = 'PARACHAIN';
|
|
@@ -2941,6 +2944,7 @@ const outputMap = Object.keys(inputMap).reduce((acc, k) => {
|
|
|
2941
2944
|
}
|
|
2942
2945
|
|
|
2943
2946
|
acc[k] = newItem;
|
|
2947
|
+
|
|
2944
2948
|
return acc;
|
|
2945
2949
|
}, {});
|
|
2946
2950
|
|
|
@@ -2972,12 +2976,11 @@ const migrated = [
|
|
|
2972
2976
|
'amplitude',
|
|
2973
2977
|
'amplitude_test',
|
|
2974
2978
|
'bobabase'
|
|
2975
|
-
]
|
|
2979
|
+
];
|
|
2976
2980
|
|
|
2977
2981
|
for (const key of migrated) {
|
|
2978
2982
|
delete outputMap[key];
|
|
2979
2983
|
}
|
|
2980
2984
|
|
|
2981
|
-
|
|
2982
2985
|
// console.log(useSubscanMap);
|
|
2983
2986
|
console.log(JSON.stringify(outputMap));
|