@subwallet/chain-list 0.0.24 → 0.0.25

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.
@@ -286,6 +286,13 @@
286
286
  srcChain: "astar",
287
287
  destChain: "polkadot",
288
288
  path: "XCM"
289
+ },
290
+ "pioneer-NATIVE-NEER___karura-LOCAL-NEER": {
291
+ srcAsset: "pioneer-NATIVE-NEER",
292
+ destAsset: "karura-LOCAL-NEER",
293
+ srcChain: "pioneer",
294
+ destChain: "karura",
295
+ path: "XCM"
289
296
  }
290
297
  };
291
298
 
@@ -965,7 +972,7 @@
965
972
  name: "Bobabase",
966
973
  symbol: "BOBA",
967
974
  decimals: 18,
968
- priceId: "bobabase-NATIVE-BOBA",
975
+ priceId: null,
969
976
  minAmount: "0",
970
977
  assetType: "NATIVE",
971
978
  metadata: null,
@@ -1698,7 +1705,7 @@
1698
1705
  slug: "sakura-NATIVE-SKU",
1699
1706
  name: "Sakura",
1700
1707
  symbol: "SKU",
1701
- decimals: 10,
1708
+ decimals: 18,
1702
1709
  priceId: "sakura",
1703
1710
  minAmount: "500",
1704
1711
  assetType: "NATIVE",
@@ -7090,7 +7097,7 @@
7090
7097
  slug: "kBTC-KintsugiWrappedBTC",
7091
7098
  originChainAsset: "kintsugi-LOCAL-kBTC",
7092
7099
  name: "Kintsugi Wrapped BTC",
7093
- symbol: "ikBTC",
7100
+ symbol: "kBTC",
7094
7101
  priceId: null,
7095
7102
  hasValue: true
7096
7103
  }
@@ -13,6 +13,6 @@ const packageInfo = {
13
13
  name: '@subwallet/chain-list',
14
14
  path: typeof __dirname === 'string' ? __dirname : 'auto',
15
15
  type: 'cjs',
16
- version: '0.0.24'
16
+ version: '0.0.25'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
@@ -280,5 +280,12 @@
280
280
  "srcChain": "astar",
281
281
  "destChain": "polkadot",
282
282
  "path": "XCM"
283
+ },
284
+ "pioneer-NATIVE-NEER___karura-LOCAL-NEER": {
285
+ "srcAsset": "pioneer-NATIVE-NEER",
286
+ "destAsset": "karura-LOCAL-NEER",
287
+ "srcChain": "pioneer",
288
+ "destChain": "karura",
289
+ "path": "XCM"
283
290
  }
284
291
  }
@@ -674,7 +674,7 @@
674
674
  "name": "Bobabase",
675
675
  "symbol": "BOBA",
676
676
  "decimals": 18,
677
- "priceId": "bobabase-NATIVE-BOBA",
677
+ "priceId": null,
678
678
  "minAmount": "0",
679
679
  "assetType": "NATIVE",
680
680
  "metadata": null,
@@ -1407,7 +1407,7 @@
1407
1407
  "slug": "sakura-NATIVE-SKU",
1408
1408
  "name": "Sakura",
1409
1409
  "symbol": "SKU",
1410
- "decimals": 10,
1410
+ "decimals": 18,
1411
1411
  "priceId": "sakura",
1412
1412
  "minAmount": "500",
1413
1413
  "assetType": "NATIVE",
@@ -139,7 +139,7 @@
139
139
  "slug": "kBTC-KintsugiWrappedBTC",
140
140
  "originChainAsset": "kintsugi-LOCAL-kBTC",
141
141
  "name": "Kintsugi Wrapped BTC",
142
- "symbol": "ikBTC",
142
+ "symbol": "kBTC",
143
143
  "priceId": null,
144
144
  "hasValue": true
145
145
  }
@@ -0,0 +1,15 @@
1
+ // Convert chain list
2
+
3
+ import fs from 'fs';
4
+
5
+ const ChainMap = JSON.parse(fs.readFileSync('../data/ChainInfo.json'));
6
+
7
+ const regex = /^https?:\/\/(.+)\.subscan\.io\//;
8
+ Object.entries(ChainMap).forEach(([slug, chain]) => {
9
+ const link = chain.substrateInfo?.blockExplorer || chain.evmInfo?.blockExplorer;
10
+ const match = link && link.match(regex);
11
+
12
+ if (match) {
13
+ console.log(slug, `'${match[1]}'`);
14
+ }
15
+ });
@@ -6,27 +6,51 @@ const CoinGeckoList = JSON.parse(fs.readFileSync('./CoinGeckoTokens.json'));
6
6
  const AssetMap = JSON.parse(fs.readFileSync('../data/ChainAsset.json'));
7
7
  const ChainMap = JSON.parse(fs.readFileSync('../data/ChainInfo.json'));
8
8
 
9
- const symbolMap = CoinGeckoList.reduce((map, item) => {
10
- if (map[item.symbol]) {
11
- map[item.symbol].push(item.id);
12
- } else {
13
- map[item.symbol] = [item.id];
14
- }
9
+ // const symbolMap = CoinGeckoList.reduce((map, item) => {
10
+ // if (map[item.symbol]) {
11
+ // map[item.symbol].push(item.id);
12
+ // } else {
13
+ // map[item.symbol] = [item.id];
14
+ // }
15
+ //
16
+ // return map;
17
+ // }, {});
18
+ //
19
+ // Object.entries(AssetMap).forEach(([slug, asset]) => {
20
+ // const lsym = (asset.symbol || '').toLowerCase();
21
+ //
22
+ // if (!asset.priceId && symbolMap[lsym]) {
23
+ // if (ChainMap[asset.originChain] && ChainMap[asset.originChain].isTestnet) {
24
+ // if (asset.priceId) {
25
+ // console.warn(slug);
26
+ // }
27
+ // return;
28
+ // }
29
+ //
30
+ // console.log(slug, asset.originChain, asset.symbol, symbolMap[lsym]);
31
+ // }
32
+ // });
33
+
34
+ // Check priceId not support by coingecko
35
+ const priceIdMap = CoinGeckoList.reduce((map, item) => {
36
+ map[item.id] = item.symbol.toLowerCase();
15
37
 
16
38
  return map;
17
39
  }, {});
18
40
 
19
41
  Object.entries(AssetMap).forEach(([slug, asset]) => {
20
- const lsym = (asset.symbol || '').toLowerCase();
21
-
22
- if (!asset.priceId && symbolMap[lsym]) {
23
- if (ChainMap[asset.originChain] && ChainMap[asset.originChain].isTestnet) {
24
- if (asset.priceId) {
25
- console.warn(slug)
26
- }
27
- return;
42
+ const priceId = asset.priceId;
43
+ const networkInfo = ChainMap[asset.originChain];
44
+
45
+ if (networkInfo.isTestnet || !priceId) {
46
+ if (priceId) {
47
+ console.error('error', slug);
28
48
  }
29
49
 
30
- console.log(slug, asset.originChain, asset.symbol, symbolMap[lsym]);
50
+ return;
51
+ }
52
+
53
+ if ((priceId && !priceIdMap[priceId]) || (asset.symbol.toLowerCase() !== priceIdMap[priceId])) {
54
+ console.log(slug, asset.priceId, priceIdMap[priceId]);
31
55
  }
32
56
  });
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "./cjs/detectPackage.js"
21
21
  ],
22
22
  "type": "module",
23
- "version": "0.0.24",
23
+ "version": "0.0.25",
24
24
  "main": "./cjs/index.js",
25
25
  "module": "./index.js",
26
26
  "types": "./index.d.ts",
@@ -251,6 +251,7 @@
251
251
  "./migrate/CoinGeckoTokens.json": "./migrate/CoinGeckoTokens.json",
252
252
  "./migrate/convert-change-list": "./migrate/convert-change-list.js",
253
253
  "./migrate/generate-native-tokens": "./migrate/generate-native-tokens.js",
254
+ "./migrate/subscan-support-map": "./migrate/subscan-support-map.js",
254
255
  "./migrate/update-price-symbol": "./migrate/update-price-symbol.js",
255
256
  "./migrate/validate-chainAsset": "./migrate/validate-chainAsset.js",
256
257
  "./package.json": "./package.json",
package/packageInfo.js CHANGED
@@ -7,5 +7,5 @@ export const packageInfo = {
7
7
  name: '@subwallet/chain-list',
8
8
  path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
9
9
  type: 'esm',
10
- version: '0.0.24'
10
+ version: '0.0.25'
11
11
  };