Skip to content

Commit

Permalink
fix: add paseo to list of asset hub specnames
Browse files Browse the repository at this point in the history
  • Loading branch information
marshacb committed Oct 16, 2024
1 parent d26926e commit 50dcbdc
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 13 deletions.
55 changes: 52 additions & 3 deletions docs/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@
"50000007": "i1DOT",
"50000008": "GABI",
"50000009": "GABIC",
"50000010": "KUS"
"50000010": "KUS",
"50000011": "NNN"
},
"foreignAssetsInfo": {
"EQ": {
Expand Down Expand Up @@ -6291,6 +6292,8 @@
"862812": "CUBOT",
"863012": "VCOPT",
"1000000": "USDT_B",
"7340827": "TBC",
"8355067": "TBC",
"10000000": "MAGE",
"13700000": "DNT",
"15383158": "35153",
Expand Down Expand Up @@ -6652,8 +6655,54 @@
"tokens": [
"PAS"
],
"assetsInfo": {},
"foreignAssetsInfo": {},
"assetsInfo": {
"4": "VAR 2",
"5": "SYN",
"6": "lop",
"7": "Pol",
"8": "PEPE",
"27": "USDC",
"69": "BRA",
"100": "VAR",
"101": "PIGLET",
"149": "EDU",
"365": "IAO",
"404": "JET",
"1337": "USDC",
"1984": "USDt",
"7777": "USDT",
"50000000": "PETER"
},
"foreignAssetsInfo": {
"0x7b22706172656e7473223a2232222c22696e746572696f72223a7b225832223a5b7b22476c6f62616c436f6e73656e737573223a7b22457468657265756d223a7b22636861696e4964223a223131313535313131227d7d7d2c7b224163636f756e744b65793230223a7b226e6574776f726b223a6e756c6c2c226b6579223a22307832326531326564346536626364653635326137333535326464653334306663623937326565663839227d7d5d7d7d": {
"symbol": "",
"name": "",
"multiLocation": "{\"parents\":\"2\",\"interior\":{\"X2\":[{\"GlobalConsensus\":{\"Ethereum\":{\"chainId\":\"11155111\"}}},{\"AccountKey20\":{\"network\":null,\"key\":\"0x22e12ed4e6bcde652a73552dde340fcb972eef89\"}}]}}",
"assetHubReserveLocation": "{\"parents\":\"0\",\"interior\":{\"Here\":\"\"}}",
"originChainReserveLocation": "{\"parents\":\"2\",\"interior\":{\"X1\":{\"GlobalConsensus\":{\"Ethereum\":{\"chainId\":\"11155111\"}}}}}"
},
"0x7b22706172656e7473223a2232222c22696e746572696f72223a7b225832223a5b7b22476c6f62616c436f6e73656e737573223a7b22457468657265756d223a7b22636861696e4964223a223131313535313131227d7d7d2c7b224163636f756e744b65793230223a7b226e6574776f726b223a6e756c6c2c226b6579223a22307839396537343339363463303336626332383933316662353634383137646234323861613766373532227d7d5d7d7d": {
"symbol": "",
"name": "",
"multiLocation": "{\"parents\":\"2\",\"interior\":{\"X2\":[{\"GlobalConsensus\":{\"Ethereum\":{\"chainId\":\"11155111\"}}},{\"AccountKey20\":{\"network\":null,\"key\":\"0x99e743964c036bc28931fb564817db428aa7f752\"}}]}}",
"assetHubReserveLocation": "{\"parents\":\"0\",\"interior\":{\"Here\":\"\"}}",
"originChainReserveLocation": "{\"parents\":\"2\",\"interior\":{\"X1\":{\"GlobalConsensus\":{\"Ethereum\":{\"chainId\":\"11155111\"}}}}}"
},
"WETH": {
"symbol": "WETH",
"name": "Wrapped Ether",
"multiLocation": "{\"parents\":\"2\",\"interior\":{\"X2\":[{\"GlobalConsensus\":{\"Ethereum\":{\"chainId\":\"11155111\"}}},{\"AccountKey20\":{\"network\":null,\"key\":\"0xfff9976782d46cc05630d1f6ebab18b2324d6b14\"}}]}}",
"assetHubReserveLocation": "{\"parents\":\"0\",\"interior\":{\"Here\":\"\"}}",
"originChainReserveLocation": "{\"parents\":\"2\",\"interior\":{\"X1\":{\"GlobalConsensus\":{\"Ethereum\":{\"chainId\":\"11155111\"}}}}}"
},
"MYTH": {
"symbol": "MYTH",
"name": "Mythos",
"multiLocation": "{\"parents\":\"1\",\"interior\":{\"X1\":{\"Parachain\":\"3369\"}}}",
"assetHubReserveLocation": "{\"parents\":\"0\",\"interior\":{\"Here\":\"\"}}",
"originChainReserveLocation": "{\"parents\":\"1\",\"interior\":{\"X1\":{\"Parachain\":\"3369\"}}}"
}
},
"poolPairsInfo": {},
"specName": "asset-hub-paseo"
},
Expand Down
10 changes: 10 additions & 0 deletions src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,13 @@ export const TEST_REGISTRY_FILE_PATH = path.join(
'testHelpers',
'testRegistry.json',
);

export const ASSET_HUB_SPEC_NAMES = [
'statemint',
'statemine',
'westmint',
'asset-hub-polkadot',
'asset-hub-kusama',
'asset-hub-westend',
'asset-hub-paseo',
];
3 changes: 2 additions & 1 deletion src/createChainRegistryFromParas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

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

import FinalRegistry from '../docs/registry.json';
/* eslint-disable-next-line */
import FinalRegistry from '../docs/registry.json' assert { type: 'json' };
import { fetchChainInfo } from './fetchChainInfo.js';
import type {
ChainInfoKeys,
Expand Down
10 changes: 2 additions & 8 deletions src/fetchChainInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { EndpointOption } from '@polkadot/apps-config/endpoints/types.js';

import { ASSET_HUB_SPEC_NAMES } from './consts.js';
import { fetchSystemParachainAssetConversionPoolInfo } from './fetchSystemParachainAssetConversionPoolInfo.js';
import { fetchSystemParachainAssetInfo } from './fetchSystemParachainAssetInfo.js';
import { fetchSystemParachainForeignAssetInfo } from './fetchSystemParachainForeignAssetInfo.js';
Expand Down Expand Up @@ -48,14 +49,7 @@ export const fetchChainInfo = async (
let foreignAssetsInfo: ForeignAssetsInfo = {};
let poolPairsInfo: PoolPairsInfo = {};

if (
specNameStr === 'westmint' ||
specNameStr === 'asset-hub-westend' ||
specNameStr === 'statemine' ||
specNameStr === 'asset-hub-kusama' ||
specNameStr === 'statemint' ||
specNameStr === 'asset-hub-polkadot'
) {
if (ASSET_HUB_SPEC_NAMES.includes(specNameStr)) {
assetsInfo = await fetchSystemParachainAssetInfo(api);
foreignAssetsInfo = await fetchSystemParachainForeignAssetInfo(
api,
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import REGISTRY from '../docs/registry.json';
/* eslint-disable-next-line */
import REGISTRY from '../docs/registry.json' assert { type: 'json' };
import { PROD_REGISTRY_FILE_PATH } from './consts.js';
import { main } from './createRegistry.js';
import type { TokenRegistry } from './types.js';
Expand Down

0 comments on commit 50dcbdc

Please sign in to comment.