@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.
- package/bundle-subwallet-chain-list.js +10 -3
- package/cjs/packageInfo.js +1 -1
- package/data/AssetRef.json +7 -0
- package/data/ChainAsset.json +2 -2
- package/data/MultiChainAsset.json +1 -1
- package/migrate/subscan-support-map.js +15 -0
- package/migrate/update-price-symbol.js +39 -15
- package/package.json +2 -1
- package/packageInfo.js +1 -1
|
@@ -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:
|
|
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:
|
|
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: "
|
|
7100
|
+
symbol: "kBTC",
|
|
7094
7101
|
priceId: null,
|
|
7095
7102
|
hasValue: true
|
|
7096
7103
|
}
|
package/cjs/packageInfo.js
CHANGED
package/data/AssetRef.json
CHANGED
|
@@ -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
|
}
|
package/data/ChainAsset.json
CHANGED
|
@@ -674,7 +674,7 @@
|
|
|
674
674
|
"name": "Bobabase",
|
|
675
675
|
"symbol": "BOBA",
|
|
676
676
|
"decimals": 18,
|
|
677
|
-
"priceId":
|
|
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":
|
|
1410
|
+
"decimals": 18,
|
|
1411
1411
|
"priceId": "sakura",
|
|
1412
1412
|
"minAmount": "500",
|
|
1413
1413
|
"assetType": "NATIVE",
|
|
@@ -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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
10
|
+
version: '0.0.25'
|
|
11
11
|
};
|