From dbd0cca577a1b9b663b904a0e67b3526bd8118b0 Mon Sep 17 00:00:00 2001 From: CieloChiara Date: Tue, 17 May 2022 11:06:31 +0900 Subject: [PATCH] Performance improvement. (Temporary) issue #22 --- .../src/background/KoniTypes.ts | 1 + .../build-cjs/api/dotsama/api.js | 13 ++---- .../build-cjs/api/dotsama/index.js | 15 ++++--- .../build-cjs/api/endpoints.js | 18 +++++--- .../build-cjs/api/subquery/crowdloan.js | 10 +++++ .../build-cjs/api/subquery/history.js | 42 +++++++++---------- .../build-cjs/background/handlers/index.js | 4 ++ .../src/api/dotsama/api.ts | 15 +++---- .../src/api/dotsama/index.ts | 19 +++++++-- .../extension-koni-base/src/api/endpoints.ts | 18 +++++--- .../src/api/subquery/crowdloan.ts | 8 ++++ .../src/api/subquery/history.ts | 40 +++++++++--------- .../src/background/handlers/index.ts | 4 ++ 13 files changed, 127 insertions(+), 80 deletions(-) diff --git a/packages/extension-base/src/background/KoniTypes.ts b/packages/extension-base/src/background/KoniTypes.ts index 872f5ee84b..3384b21841 100644 --- a/packages/extension-base/src/background/KoniTypes.ts +++ b/packages/extension-base/src/background/KoniTypes.ts @@ -240,6 +240,7 @@ export interface NetWorkInfo { nativeToken?: string; crowdloanUrl?: string; decimals?: number; + isSubscribe?: boolean; } export interface DonateInfo { diff --git a/packages/extension-koni-base/build-cjs/api/dotsama/api.js b/packages/extension-koni-base/build-cjs/api/dotsama/api.js index bbd9272d82..6f8b15e118 100644 --- a/packages/extension-koni-base/build-cjs/api/dotsama/api.js +++ b/packages/extension-koni-base/build-cjs/api/dotsama/api.js @@ -180,28 +180,23 @@ function initApi(networkKey, apiUrl) { }; api.on('connected', () => { - console.log('DotSamaAPI connected to', apiUrl); + console.log('Arth DotSamaAPI connected to', apiUrl); result.apiRetry = 0; - - if (result.isApiReadyOnce) { - result.isApiReady = true; - } - result.isApiConnected = true; }); api.on('disconnected', () => { result.isApiConnected = false; result.isApiReady = false; result.apiRetry = (result.apiRetry || 0) + 1; - console.log(`DotSamaAPI disconnected from ${JSON.stringify(apiUrl)} ${JSON.stringify(result.apiRetry)} times`); + console.log(`Arth DotSamaAPI disconnected from ${JSON.stringify(apiUrl)} ${JSON.stringify(result.apiRetry)} times`); if (result.apiRetry > _constants.DOTSAMA_MAX_CONTINUE_RETRY) { - console.log(`Discontinue to use ${JSON.stringify(apiUrl)} because max retry`); + console.log(`Arth Discontinue to use ${JSON.stringify(apiUrl)} because max retry`); provider.disconnect().then(console.log).catch(console.error); } }); api.on('ready', () => { - console.log('DotSamaAPI ready with', apiUrl); + console.log('Arth DotSamaAPI ready with', apiUrl); loadOnReady(registry, api).then(rs => { (0, _util.objectSpread)(result, rs); }).catch(error => { diff --git a/packages/extension-koni-base/build-cjs/api/dotsama/index.js b/packages/extension-koni-base/build-cjs/api/dotsama/index.js index 788fa8c01f..a1bbb457d9 100644 --- a/packages/extension-koni-base/build-cjs/api/dotsama/index.js +++ b/packages/extension-koni-base/build-cjs/api/dotsama/index.js @@ -46,14 +46,19 @@ function connectDotSamaApis() { let networks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _endpoints.default; const apisMap = {}; Object.keys(networks).forEach(networkKey => { - const network = networks[networkKey]; + //console.log('Arth networkKey: ', networkKey); + //console.log('Arth networks[networkKey].isSubscribe: ', networks[networkKey].isSubscribe); + if (networks[networkKey].isSubscribe) { + const network = networks[networkKey]; //console.log('Arth networks: ', networks); - if (!network.genesisHash || network.genesisHash.toLowerCase() === 'unknown' || !network.provider) { - return; - } + if (!network.genesisHash || network.genesisHash.toLowerCase() === 'unknown' || !network.provider) { + return; + } - apisMap[networkKey] = (0, _api.initApi)(networkKey, network.provider); + apisMap[networkKey] = (0, _api.initApi)(networkKey, network.provider); + } }); + console.log('Arth apisMap: ', apisMap); return apisMap; } diff --git a/packages/extension-koni-base/build-cjs/api/endpoints.js b/packages/extension-koni-base/build-cjs/api/endpoints.js index 16e4e86a8a..6d99241d47 100644 --- a/packages/extension-koni-base/build-cjs/api/endpoints.js +++ b/packages/extension-koni-base/build-cjs/api/endpoints.js @@ -18,7 +18,8 @@ const NETWORKS = { provider: 'wss://polkadot.api.onfinality.io/public-ws', groups: ['RELAY_CHAIN'], nativeToken: 'DOT', - decimals: 10 + decimals: 10, + isSubscribe: true }, kusama: { chain: 'Kusama Relay Chain', @@ -28,7 +29,8 @@ const NETWORKS = { provider: 'wss://kusama.api.onfinality.io/public-ws', groups: ['RELAY_CHAIN'], nativeToken: 'KSM', - decimals: 12 + decimals: 12, + isSubscribe: true }, westend: { chain: 'Westend Relay Chain', @@ -99,7 +101,8 @@ const NETWORKS = { paraId: 2006, nativeToken: 'ASTR', crowdloanUrl: 'https://crowdloan.astar.network/#/', - decimals: 18 + decimals: 18, + isSubscribe: true }, astarEvm: { chain: 'Astar - EVM', @@ -111,7 +114,8 @@ const NETWORKS = { groups: ['POLKADOT_PARACHAIN', 'ASTAR_MAINNET'], isEthereum: true, nativeToken: 'ASTR', - decimals: 18 + decimals: 18, + isSubscribe: true }, parallel: { chain: 'Parallel', @@ -392,7 +396,8 @@ const NETWORKS = { groups: ['KUSAMA_PARACHAIN'], paraId: 2007, nativeToken: 'SDN', - crowdloanUrl: 'https://polkadot.js.org/apps/#/parachains/crowdloan' + crowdloanUrl: 'https://polkadot.js.org/apps/#/parachains/crowdloan', + isSubscribe: true }, shidenEvm: { chain: 'Shiden - EVM', @@ -401,7 +406,8 @@ const NETWORKS = { provider: 'wss://rpc.shiden.astar.network', groups: ['KUSAMA_PARACHAIN'], nativeToken: 'SDN', - isEthereum: true + isEthereum: true, + isSubscribe: true }, khala: { chain: 'Khala', diff --git a/packages/extension-koni-base/build-cjs/api/subquery/crowdloan.js b/packages/extension-koni-base/build-cjs/api/subquery/crowdloan.js index dccfe66ab2..ed3f38db4b 100644 --- a/packages/extension-koni-base/build-cjs/api/subquery/crowdloan.js +++ b/packages/extension-koni-base/build-cjs/api/subquery/crowdloan.js @@ -77,6 +77,11 @@ const fetchDotSamaCrowdloan = async () => { const paraList = []; polkadotCrowdloan === null || polkadotCrowdloan === void 0 ? void 0 : (_polkadotCrowdloan$da = polkadotCrowdloan.data) === null || _polkadotCrowdloan$da === void 0 ? void 0 : (_polkadotCrowdloan$da2 = _polkadotCrowdloan$da.crowdloans) === null || _polkadotCrowdloan$da2 === void 0 ? void 0 : _polkadotCrowdloan$da2.nodes.forEach(node => { let parachainId = node === null || node === void 0 ? void 0 : node.parachainId.substring(0, 4); + + if (parachainId !== '2006') { + return; + } + parachainId = parachainId ? `polkadot-${parachainId}` : ''; paraList.push(parachainId); @@ -89,6 +94,11 @@ const fetchDotSamaCrowdloan = async () => { }); kusamaCrowdloan === null || kusamaCrowdloan === void 0 ? void 0 : (_kusamaCrowdloan$data = kusamaCrowdloan.data) === null || _kusamaCrowdloan$data === void 0 ? void 0 : (_kusamaCrowdloan$data2 = _kusamaCrowdloan$data.crowdloans) === null || _kusamaCrowdloan$data2 === void 0 ? void 0 : _kusamaCrowdloan$data2.nodes.forEach(node => { let parachainId = node === null || node === void 0 ? void 0 : node.parachainId.substring(0, 4); + + if (parachainId !== '2007') { + return; + } + parachainId = parachainId ? `kusama-${parachainId}` : ''; paraList.push(parachainId); diff --git a/packages/extension-koni-base/build-cjs/api/subquery/history.js b/packages/extension-koni-base/build-cjs/api/subquery/history.js index 25dd4e2c74..794dbd22c0 100644 --- a/packages/extension-koni-base/build-cjs/api/subquery/history.js +++ b/packages/extension-koni-base/build-cjs/api/subquery/history.js @@ -22,28 +22,28 @@ var _utils = require("@polkadot/extension-koni-base/utils/utils"); const HistoryApiMap = { polkadot: 'https://api.subquery.network/sq/nova-wallet/nova-westend', kusama: 'https://api.subquery.network/sq/nova-wallet/nova-kusama', - westend: 'https://api.subquery.network/sq/nova-wallet/nova-westend', - picasso: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-picasso', - calamari: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-calamari', - khala: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-khala', - parallel: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-parallel', - bifrost: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-bifrost', - clover: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-clover', - basilisk: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-basilisk', - acala: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-acala', + // westend: 'https://api.subquery.network/sq/nova-wallet/nova-westend', + // picasso: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-picasso', + // calamari: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-calamari', + // khala: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-khala', + // parallel: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-parallel', + // bifrost: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-bifrost', + // clover: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-clover', + // basilisk: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-basilisk', + // acala: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-acala', astar: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-astar', - karura: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-karura', - altair: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-altair', - kilt: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-kilt', - robonomics: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-robonomics', - statemint: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-statemint', - quartz: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-quartz', - zeigeist: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-zeitgeist', - shiden: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-shiden', - statemine: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-statemine', - moonbeam: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-moonbeam', - moonriver: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-moonriver', - pioneer: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-bit-country' + // karura: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-karura', + // altair: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-altair', + // kilt: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-kilt', + // robonomics: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-robonomics', + // statemint: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-statemint', + // quartz: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-quartz', + // zeigeist: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-zeitgeist', + shiden: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-shiden' // statemine: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-statemine', + // moonbeam: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-moonbeam', + // moonriver: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-moonriver', + // pioneer: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-bit-country' + }; exports.HistoryApiMap = HistoryApiMap; diff --git a/packages/extension-koni-base/build-cjs/background/handlers/index.js b/packages/extension-koni-base/build-cjs/background/handlers/index.js index c059b9115b..e67b1d0e41 100644 --- a/packages/extension-koni-base/build-cjs/background/handlers/index.js +++ b/packages/extension-koni-base/build-cjs/background/handlers/index.js @@ -46,6 +46,10 @@ function getRpcsMap() { Object.keys(_endpoints.default).forEach(networkKey => { const networkInfo = _endpoints.default[networkKey]; + if (!networkInfo.isSubscribe) { + return; + } + if (!networkInfo.genesisHash || networkInfo.genesisHash.toLowerCase() === 'unknown') { return; } diff --git a/packages/extension-koni-base/src/api/dotsama/api.ts b/packages/extension-koni-base/src/api/dotsama/api.ts index 2c0682f304..4251ef6c36 100644 --- a/packages/extension-koni-base/src/api/dotsama/api.ts +++ b/packages/extension-koni-base/src/api/dotsama/api.ts @@ -102,6 +102,7 @@ async function loadOnReady (registry: Registry, api: ApiPromise): Promise { - console.log('DotSamaAPI connected to', apiUrl); + console.log('Arth DotSamaAPI connected to', apiUrl); result.apiRetry = 0; - - if (result.isApiReadyOnce) { - result.isApiReady = true; - } - result.isApiConnected = true; }); @@ -184,10 +180,10 @@ export function initApi (networkKey: string, apiUrl: string): ApiProps { result.isApiReady = false; result.apiRetry = (result.apiRetry || 0) + 1; - console.log(`DotSamaAPI disconnected from ${JSON.stringify(apiUrl)} ${JSON.stringify(result.apiRetry)} times`); + console.log(`Arth DotSamaAPI disconnected from ${JSON.stringify(apiUrl)} ${JSON.stringify(result.apiRetry)} times`); if (result.apiRetry > DOTSAMA_MAX_CONTINUE_RETRY) { - console.log(`Discontinue to use ${JSON.stringify(apiUrl)} because max retry`); + console.log(`Arth Discontinue to use ${JSON.stringify(apiUrl)} because max retry`); provider.disconnect() .then(console.log) .catch(console.error); @@ -195,7 +191,7 @@ export function initApi (networkKey: string, apiUrl: string): ApiProps { }); api.on('ready', () => { - console.log('DotSamaAPI ready with', apiUrl); + console.log('Arth DotSamaAPI ready with', apiUrl); loadOnReady(registry, api) .then((rs) => { objectSpread(result, rs); @@ -206,4 +202,5 @@ export function initApi (networkKey: string, apiUrl: string): ApiProps { }); return result; + } diff --git a/packages/extension-koni-base/src/api/dotsama/index.ts b/packages/extension-koni-base/src/api/dotsama/index.ts index 22ecca7686..52eabf5e63 100644 --- a/packages/extension-koni-base/src/api/dotsama/index.ts +++ b/packages/extension-koni-base/src/api/dotsama/index.ts @@ -24,15 +24,26 @@ export function connectDotSamaApis (networks = NETWORKS): Record = {}; Object.keys(networks).forEach((networkKey) => { - const network = networks[networkKey]; - if (!network.genesisHash || network.genesisHash.toLowerCase() === 'unknown' || !network.provider) { - return; + //console.log('Arth networkKey: ', networkKey); + //console.log('Arth networks[networkKey].isSubscribe: ', networks[networkKey].isSubscribe); + + if (networks[networkKey].isSubscribe) { + + const network = networks[networkKey]; + //console.log('Arth networks: ', networks); + + if (!network.genesisHash || network.genesisHash.toLowerCase() === 'unknown' || !network.provider) { + return; + } + + apisMap[networkKey] = initApi(networkKey, network.provider); } - apisMap[networkKey] = initApi(networkKey, network.provider); }); + console.log('Arth apisMap: ', apisMap); + return apisMap; } diff --git a/packages/extension-koni-base/src/api/endpoints.ts b/packages/extension-koni-base/src/api/endpoints.ts index 98c1b7b431..f2d3959400 100644 --- a/packages/extension-koni-base/src/api/endpoints.ts +++ b/packages/extension-koni-base/src/api/endpoints.ts @@ -13,7 +13,8 @@ const NETWORKS: Record = { provider: 'wss://polkadot.api.onfinality.io/public-ws', groups: ['RELAY_CHAIN'], nativeToken: 'DOT', - decimals: 10 + decimals: 10, + isSubscribe: true }, kusama: { chain: 'Kusama Relay Chain', @@ -23,7 +24,8 @@ const NETWORKS: Record = { provider: 'wss://kusama.api.onfinality.io/public-ws', groups: ['RELAY_CHAIN'], nativeToken: 'KSM', - decimals: 12 + decimals: 12, + isSubscribe: true }, westend: { chain: 'Westend Relay Chain', @@ -94,7 +96,8 @@ const NETWORKS: Record = { paraId: 2006, nativeToken: 'ASTR', crowdloanUrl: 'https://crowdloan.astar.network/#/', - decimals: 18 + decimals: 18, + isSubscribe: true }, astarEvm: { chain: 'Astar - EVM', @@ -106,7 +109,8 @@ const NETWORKS: Record = { groups: ['POLKADOT_PARACHAIN', 'ASTAR_MAINNET'], isEthereum: true, nativeToken: 'ASTR', - decimals: 18 + decimals: 18, + isSubscribe: true }, parallel: { chain: 'Parallel', @@ -387,7 +391,8 @@ const NETWORKS: Record = { groups: ['KUSAMA_PARACHAIN'], paraId: 2007, nativeToken: 'SDN', - crowdloanUrl: 'https://polkadot.js.org/apps/#/parachains/crowdloan' + crowdloanUrl: 'https://polkadot.js.org/apps/#/parachains/crowdloan', + isSubscribe: true }, shidenEvm: { chain: 'Shiden - EVM', @@ -396,7 +401,8 @@ const NETWORKS: Record = { provider: 'wss://rpc.shiden.astar.network', groups: ['KUSAMA_PARACHAIN'], nativeToken: 'SDN', - isEthereum: true + isEthereum: true, + isSubscribe: true }, khala: { chain: 'Khala', diff --git a/packages/extension-koni-base/src/api/subquery/crowdloan.ts b/packages/extension-koni-base/src/api/subquery/crowdloan.ts index 0d95aa9fb7..d0c3fd4477 100644 --- a/packages/extension-koni-base/src/api/subquery/crowdloan.ts +++ b/packages/extension-koni-base/src/api/subquery/crowdloan.ts @@ -75,6 +75,10 @@ export const fetchDotSamaCrowdloan = async () => { polkadotCrowdloan?.data?.crowdloans?.nodes.forEach((node) => { let parachainId = node?.parachainId.substring(0, 4); + if (parachainId !== '2006') { + return; + } + parachainId = parachainId ? `polkadot-${parachainId}` : ''; paraList.push(parachainId); @@ -88,6 +92,10 @@ export const fetchDotSamaCrowdloan = async () => { kusamaCrowdloan?.data?.crowdloans?.nodes.forEach((node) => { let parachainId = node?.parachainId.substring(0, 4); + if (parachainId !== '2007') { + return; + } + parachainId = parachainId ? `kusama-${parachainId}` : ''; paraList.push(parachainId); diff --git a/packages/extension-koni-base/src/api/subquery/history.ts b/packages/extension-koni-base/src/api/subquery/history.ts index ab90093669..54c930134e 100644 --- a/packages/extension-koni-base/src/api/subquery/history.ts +++ b/packages/extension-koni-base/src/api/subquery/history.ts @@ -17,28 +17,28 @@ import { isAccountAll, reformatAddress } from '@polkadot/extension-koni-base/uti export const HistoryApiMap: Record = { polkadot: 'https://api.subquery.network/sq/nova-wallet/nova-westend', kusama: 'https://api.subquery.network/sq/nova-wallet/nova-kusama', - westend: 'https://api.subquery.network/sq/nova-wallet/nova-westend', - picasso: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-picasso', - calamari: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-calamari', - khala: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-khala', - parallel: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-parallel', - bifrost: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-bifrost', - clover: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-clover', - basilisk: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-basilisk', - acala: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-acala', +// westend: 'https://api.subquery.network/sq/nova-wallet/nova-westend', +// picasso: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-picasso', +// calamari: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-calamari', +// khala: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-khala', +// parallel: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-parallel', +// bifrost: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-bifrost', +// clover: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-clover', +// basilisk: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-basilisk', +// acala: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-acala', astar: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-astar', - karura: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-karura', - altair: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-altair', - kilt: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-kilt', - robonomics: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-robonomics', - statemint: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-statemint', - quartz: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-quartz', - zeigeist: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-zeitgeist', +// karura: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-karura', +// altair: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-altair', +// kilt: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-kilt', +// robonomics: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-robonomics', +// statemint: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-statemint', +// quartz: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-quartz', +// zeigeist: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-zeitgeist', shiden: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-shiden', - statemine: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-statemine', - moonbeam: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-moonbeam', - moonriver: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-moonriver', - pioneer: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-bit-country' +// statemine: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-statemine', +// moonbeam: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-moonbeam', +// moonriver: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-moonriver', +// pioneer: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-bit-country' }; function getApolloClient (networkKey: string) { diff --git a/packages/extension-koni-base/src/background/handlers/index.ts b/packages/extension-koni-base/src/background/handlers/index.ts index ad244e8d62..0c588a005c 100644 --- a/packages/extension-koni-base/src/background/handlers/index.ts +++ b/packages/extension-koni-base/src/background/handlers/index.ts @@ -25,6 +25,10 @@ function getRpcsMap (): Record { Object.keys(NETWORKS).forEach((networkKey) => { const networkInfo = NETWORKS[networkKey]; + if (!networkInfo.isSubscribe) { + return; + } + if (!networkInfo.genesisHash || networkInfo.genesisHash.toLowerCase() === 'unknown') { return; }