Skip to content

Commit def9cd2

Browse files
authored
fix: rewrite path to registry (#102)
1 parent df5f480 commit def9cd2

File tree

4 files changed

+130
-5
lines changed

4 files changed

+130
-5
lines changed

docs/registry.json

Lines changed: 115 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@
4141
"777": "777",
4242
"999": "gold",
4343
"1000": "BRZ",
44+
"1230": "HAM",
4445
"1337": "USDC",
4546
"1984": "USDt",
4647
"2023": "dot",
4748
"2024": "WOOD",
4849
"30035": "DED",
50+
"660301": "GRL",
4951
"862812": "CUBO",
5052
"868367": "VSC",
5153
"20090103": "BTC"
@@ -110,6 +112,16 @@
110112
"ForeignAsset": "12"
111113
}
112114
},
115+
{
116+
"paraID": 1000,
117+
"nativeChainID": "statemint",
118+
"symbol": "PINK",
119+
"decimals": 10,
120+
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":1000},{\"palletInstance\":50},{\"generalIndex\":23}]}}}",
121+
"asset": {
122+
"ForeignAsset": "13"
123+
}
124+
},
113125
{
114126
"paraID": 1000,
115127
"nativeChainID": "statemint",
@@ -265,6 +277,14 @@
265277
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":1000},{\"palletInstance\":50},{\"generalIndex\":1984}]}}}",
266278
"asset": "311091173110107856861649819128533077277"
267279
},
280+
{
281+
"paraID": 1000,
282+
"nativeChainID": "statemint",
283+
"symbol": "PINK",
284+
"decimals": 10,
285+
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":1000},{\"palletInstance\":50},{\"generalIndex\":23}]}}}",
286+
"asset": "64174511183114006009298114091987195453"
287+
},
268288
{
269289
"paraID": 2000,
270290
"nativeChainID": "acala",
@@ -323,41 +343,47 @@
323343
},
324344
{
325345
"paraID": 2019,
346+
"nativeChainID": "composableFinance",
326347
"symbol": "ibcMOVR",
327348
"decimals": 18,
328349
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":2019},{\"palletInstance\":59},{\"generalIndex\":\"0x00000001000000000000000000000017\"}]}}}",
329350
"asset": "78407957940239408223554844611219482002"
330351
},
331352
{
332353
"paraID": 2019,
354+
"nativeChainID": "composableFinance",
333355
"symbol": "ibcTIA",
334356
"decimals": 6,
335357
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":2019},{\"palletInstance\":59},{\"generalIndex\":\"0x00000001000000000000000000000013\"}]}}}",
336358
"asset": "133307414193833606001516599592873928539"
337359
},
338360
{
339361
"paraID": 2019,
362+
"nativeChainID": "composableFinance",
340363
"symbol": "ibcIST",
341364
"decimals": 6,
342365
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":2019},{\"palletInstance\":59},{\"generalIndex\":\"0x00000001000000000000000000000019\"}]}}}",
343366
"asset": "141196559012917796508928734717797136690"
344367
},
345368
{
346369
"paraID": 2019,
370+
"nativeChainID": "composableFinance",
347371
"symbol": "ibcBLD",
348372
"decimals": 6,
349373
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":2019},{\"palletInstance\":59},{\"generalIndex\":\"0x00000001000000000000000000000012\"}]}}}",
350374
"asset": "199907282886248358976504623107230837230"
351375
},
352376
{
353377
"paraID": 2019,
378+
"nativeChainID": "composableFinance",
354379
"symbol": "ibcATOM",
355380
"decimals": 6,
356381
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":2019},{\"palletInstance\":59},{\"generalIndex\":\"0x00000001000000000000000000000007\"}]}}}",
357382
"asset": "138280378441551394289980644963240827219"
358383
},
359384
{
360385
"paraID": 2019,
386+
"nativeChainID": "composableFinance",
361387
"symbol": "ibcPICA",
362388
"decimals": 12,
363389
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":2019},{\"palletInstance\":59},{\"generalIndex\":\"0x00000001000000000000000000000001\"}]}}}",
@@ -542,6 +568,14 @@
542568
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":1000},{\"palletInstance\":50},{\"generalIndex\":1984}]}}}",
543569
"asset": "4294969280"
544570
},
571+
{
572+
"paraID": 1000,
573+
"nativeChainID": "statemint",
574+
"symbol": "PINK",
575+
"decimals": 10,
576+
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":1000},{\"palletInstance\":50},{\"generalIndex\":23}]}}}",
577+
"asset": "18446744073709551633"
578+
},
545579
{
546580
"paraID": 2000,
547581
"nativeChainID": "acala",
@@ -912,6 +946,16 @@
912946
"Token2": "5"
913947
}
914948
},
949+
{
950+
"paraID": 1000,
951+
"nativeChainID": "statemint",
952+
"symbol": "PINK",
953+
"decimals": 10,
954+
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":1000},{\"palletInstance\":50},{\"generalIndex\":23}]}}}",
955+
"asset": {
956+
"Token2": "10"
957+
}
958+
},
915959
{
916960
"paraID": 2004,
917961
"nativeChainID": "moonbeam",
@@ -972,6 +1016,16 @@
9721016
"VToken2": "3"
9731017
}
9741018
},
1019+
{
1020+
"paraID": 2030,
1021+
"nativeChainID": "bifrost",
1022+
"symbol": "BNC",
1023+
"decimals": 12,
1024+
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x2\":[{\"parachain\":2030},{\"generalKey\":\"0x0001\"}]}}}",
1025+
"asset": {
1026+
"Native": "BNC"
1027+
}
1028+
},
9751029
{
9761030
"paraID": 2030,
9771031
"nativeChainID": "bifrost",
@@ -1093,6 +1147,16 @@
10931147
"ForeignAsset": "100,003"
10941148
}
10951149
},
1150+
{
1151+
"paraID": 2031,
1152+
"nativeChainID": "centrifuge",
1153+
"symbol": "LpFRAX",
1154+
"decimals": 18,
1155+
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x4\":[{\"parachain\":2031},{\"palletInstance\":103},{\"globalConsensus\":{\"ethereum\":{\"chainId\":1}}},{\"accountKey20\":{\"network\":null,\"key\":\"0x853d955acef822db058eb8505911ed77f175b99e\"}}]}}}",
1156+
"asset": {
1157+
"ForeignAsset": "100,005"
1158+
}
1159+
},
10961160
{
10971161
"paraID": 2031,
10981162
"nativeChainID": "centrifuge",
@@ -1388,6 +1452,14 @@
13881452
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x1\":{\"parachain\":2006}}}}",
13891453
"asset": "9"
13901454
},
1455+
{
1456+
"paraID": 2026,
1457+
"nativeChainID": "nodle",
1458+
"symbol": "NODL",
1459+
"decimals": 11,
1460+
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x2\":[{\"parachain\":2026},{\"palletInstance\":2}]}}}",
1461+
"asset": "26"
1462+
},
13911463
{
13921464
"paraID": 2030,
13931465
"nativeChainID": "bifrost",
@@ -1438,6 +1510,7 @@
14381510
},
14391511
{
14401512
"paraID": 2037,
1513+
"nativeChainID": "unique",
14411514
"symbol": "UNQ",
14421515
"decimals": 18,
14431516
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x1\":{\"parachain\":2037}}}}",
@@ -1478,6 +1551,14 @@
14781551
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"here\":null}}}",
14791552
"asset": "0"
14801553
},
1554+
{
1555+
"paraID": 1000,
1556+
"nativeChainID": "statemint",
1557+
"symbol": "PINK",
1558+
"decimals": 10,
1559+
"xcmV1MultiLocation": "{\"v1\":{\"parents\":1,\"interior\":{\"x3\":[{\"parachain\":1000},{\"palletInstance\":50},{\"generalIndex\":23}]}}}",
1560+
"asset": "12"
1561+
},
14811562
{
14821563
"paraID": 2000,
14831564
"nativeChainID": "acala",
@@ -1668,6 +1749,15 @@
16681749
"poolPairsInfo": {},
16691750
"specName": "zeitgeist"
16701751
},
1752+
"2093": {
1753+
"tokens": [
1754+
"HASH"
1755+
],
1756+
"assetsInfo": {},
1757+
"foreignAssetsInfo": {},
1758+
"poolPairsInfo": {},
1759+
"specName": "luhn"
1760+
},
16711761
"2094": {
16721762
"tokens": [
16731763
"PEN"
@@ -1823,7 +1913,6 @@
18231913
"841": "YAYOI",
18241914
"888": "LUCK",
18251915
"911": "911",
1826-
"969": "WGTL",
18271916
"999": "CBDC",
18281917
"1000": "SPARK",
18291918
"1107": "HOLIC",
@@ -1878,6 +1967,7 @@
18781967
"777777": "DEFI",
18791968
"862812": "CUBO",
18801969
"863012": "VCOP",
1970+
"2284739": "ETAR",
18811971
"4206969": "SHIB",
18821972
"5201314": "belove",
18831973
"5797867": "TAKE",
@@ -1894,6 +1984,11 @@
18941984
"symbol": "TNKR",
18951985
"name": "Tinkernet",
18961986
"multiLocation": "{\"parents\":\"1\",\"interior\":{\"X2\":[{\"Parachain\":\"2125\"},{\"GeneralIndex\":\"0\"}]}}"
1987+
},
1988+
"FREN": {
1989+
"symbol": "FREN",
1990+
"name": "FREN",
1991+
"multiLocation": "{\"parents\":\"1\",\"interior\":{\"X1\":{\"Parachain\":\"2123\"}}}"
18971992
}
18981993
},
18991994
"poolPairsInfo": {
@@ -1924,6 +2019,10 @@
19242019
"6": {
19252020
"lpToken": "6",
19262021
"pairInfo": "[[{\"parents\":\"1\",\"interior\":\"Here\"},{\"parents\":\"0\",\"interior\":{\"X2\":[{\"PalletInstance\":\"50\"},{\"GeneralIndex\":\"756\"}]}}]]"
2022+
},
2023+
"7": {
2024+
"lpToken": "7",
2025+
"pairInfo": "[[{\"parents\":\"1\",\"interior\":\"Here\"},{\"parents\":\"1\",\"interior\":{\"X1\":{\"Parachain\":\"2123\"}}}]]"
19272026
}
19282027
},
19292028
"specName": "statemine"
@@ -4304,6 +4403,11 @@
43044403
"symbol": "WND",
43054404
"name": "Westend",
43064405
"multiLocation": "{\"parents\":\"2\",\"interior\":{\"X1\":{\"GlobalConsensus\":\"Westend\"}}}"
4406+
},
4407+
"0x7b22706172656e7473223a2232222c22696e746572696f72223a7b225832223a5b7b22476c6f62616c436f6e73656e737573223a7b22457468657265756d223a7b22636861696e4964223a223131313535313131227d7d7d2c7b224163636f756e744b65793230223a7b226e6574776f726b223a6e756c6c2c226b6579223a22307866666639393736373832643436636330353633306431663665626162313862323332346436623134227d7d5d7d7d": {
4408+
"symbol": "",
4409+
"name": "",
4410+
"multiLocation": "{\"parents\":\"2\",\"interior\":{\"X2\":[{\"GlobalConsensus\":{\"Ethereum\":{\"chainId\":\"11155111\"}}},{\"AccountKey20\":{\"network\":null,\"key\":\"0xfff9976782d46cc05630d1f6ebab18b2324d6b14\"}}]}}"
43074411
}
43084412
},
43094413
"poolPairsInfo": {
@@ -4423,7 +4527,7 @@
44234527
"assetsInfo": {},
44244528
"foreignAssetsInfo": {},
44254529
"poolPairsInfo": {},
4426-
"specName": "statemine"
4530+
"specName": "bridge-hub-rococo"
44274531
},
44284532
"2004": {
44294533
"tokens": [
@@ -4541,6 +4645,15 @@
45414645
"poolPairsInfo": {},
45424646
"specName": "Pangolin2"
45434647
},
4648+
"2110": {
4649+
"tokens": [
4650+
"MGAT"
4651+
],
4652+
"assetsInfo": {},
4653+
"foreignAssetsInfo": {},
4654+
"poolPairsInfo": {},
4655+
"specName": "mangata-parachain"
4656+
},
45444657
"2114": {
45454658
"tokens": [
45464659
"TUR"

src/consts.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const DEFAULT_REGISTRY: TokenRegistry = {
3030
export const PROD_REGISTRY_FILE_PATH = path.join(
3131
__dirname,
3232
'..',
33+
'..',
3334
'docs',
3435
'registry.json',
3536
);

src/createChainRegistryFromParas.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import type { EndpointOption } from '@polkadot/apps-config/endpoints/types';
44

5+
import FinalRegistry from '../docs/registry.json';
56
import { fetchChainInfo } from './fetchChainInfo';
67
import type { ChainName, ParaIds, TokenRegistry } from './types';
78
import { logWithDate, twirlTimer } from './util';
@@ -32,11 +33,12 @@ export const createChainRegistryFromParas = async (
3233
if (!reliable) {
3334
// Add to registry if it exists
3435
if (
35-
registry[chainName] &&
36-
registry[chainName][endpoint.paraId as number]
36+
FinalRegistry[chainName] &&
37+
FinalRegistry[chainName][endpoint.paraId as number]
3738
) {
39+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3840
registry[chainName][`${endpoint.paraId as number}`] =
39-
registry[chainName][endpoint.paraId as number];
41+
FinalRegistry[chainName][endpoint.paraId as number];
4042
}
4143
continue;
4244
}

src/startApi.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import { ApiPromise, WsProvider } from '@polkadot/api';
44

55
import { getProvider } from './getProvider';
6+
7+
const blackListedApis = ['wss://rpc.parallel.fi'];
8+
69
/**
710
* This intakes an array of endpoints and returns a list of viable endpoints
811
* ready to be connected to.
@@ -17,6 +20,12 @@ export const startApi = async (
1720

1821
if (wsProviders === undefined) {
1922
return;
23+
} else {
24+
for (let i = 0; i < blackListedApis.length; i++) {
25+
if (wsProviders.includes(blackListedApis[i])) {
26+
return;
27+
}
28+
}
2029
}
2130

2231
const providers = new WsProvider(wsProviders);

0 commit comments

Comments
 (0)