File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed
Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 99 },
1010 "scripts" : {
1111 "build" : " substrate-exec-rimraf build/ && substrate-exec-tsc" ,
12- "start" : " yarn build && node ./build/createRegistry.js" ,
12+ "start" : " yarn build && node ./build/src/ createRegistry.js" ,
1313 "lint" : " substrate-dev-run-lint" ,
1414 "lint:fix" : " substrate-dev-run-lint --fix" ,
1515 "deploy" : " yarn build && npm publish"
Original file line number Diff line number Diff line change @@ -20,8 +20,10 @@ import {
2020import type { EndpointOption } from '@polkadot/apps-config/endpoints/types' ;
2121import fetch from 'node-fetch' ;
2222
23+ import FinalRegistry from '../registry.json' ;
2324import type {
2425 AssetsInfo ,
26+ ChainInfoKeys ,
2527 ChainName ,
2628 ForeignAssetMetadata ,
2729 ForeignAssetsInfo ,
@@ -119,6 +121,12 @@ const createChainRegistryFromParas = async (
119121 endpoint . paraId as number
120122 ) ;
121123 if ( ! reliable ) {
124+ // Add to registry if it exists
125+ if ( FinalRegistry [ chainName ] [ endpoint . paraId as number ] ) {
126+ registry [ chainName ] [ `${ endpoint . paraId as number } ` ] = FinalRegistry [
127+ chainName
128+ ] [ endpoint . paraId as number ] as ChainInfoKeys ;
129+ }
122130 continue ;
123131 }
124132 const res = await fetchChainInfo ( endpoint ) ;
Original file line number Diff line number Diff line change @@ -9,14 +9,17 @@ export type TokenRegistry = {
99 rococo : ChainInfo ;
1010} ;
1111
12+ export type ChainInfoKeys = {
13+ tokens : string [ ] ;
14+ assetsInfo : AssetsInfo ;
15+ specName : string ;
16+ foreignAssetsInfo : ForeignAssetsInfo ;
17+ poolPairsInfo : PoolPairsInfo ;
18+ xcAssetsData ?: SanitizedXcAssetsData [ ] ;
19+ } ;
20+
1221export type ChainInfo = {
13- [ key : string ] : {
14- assetsInfo : AssetsInfo ;
15- specName : string ;
16- foreignAssetsInfo : ForeignAssetsInfo ;
17- poolPairsInfo : PoolPairsInfo ;
18- xcAssetsData ?: SanitizedXcAssetsData [ ] ;
19- } ;
22+ [ key : string ] : ChainInfoKeys ;
2023} ;
2124
2225export type PoolPairsInfo = {
You can’t perform that action at this time.
0 commit comments