@subwallet/extension-base 1.1.60-1 → 1.1.61-1

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.
@@ -13,6 +13,6 @@ const packageInfo = {
13
13
  name: '@subwallet/extension-base',
14
14
  path: typeof __dirname === 'string' ? __dirname : 'auto',
15
15
  type: 'cjs',
16
- version: '1.1.60-1'
16
+ version: '1.1.61-1'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
@@ -19,7 +19,7 @@ exports.API_MAX_RETRY = API_MAX_RETRY;
19
19
  const _API_OPTIONS_CHAIN_GROUP = {
20
20
  acala: ['acala', 'karura', 'origintrail', 'kintsugi'],
21
21
  turing: ['turingStaging', 'turing'],
22
- avail: ['kate', 'availTuringTest'],
22
+ avail: ['kate', 'availTuringTest', 'avail_mainnet'],
23
23
  goldberg: ['goldberg_testnet']
24
24
  };
25
25
  exports._API_OPTIONS_CHAIN_GROUP = _API_OPTIONS_CHAIN_GROUP;
@@ -104,7 +104,8 @@ const _STAKING_ERA_LENGTH_MAP = {
104
104
  krest_network: 4,
105
105
  polimec: 6,
106
106
  enjin_relaychain: 24,
107
- availTuringTest: 24
107
+ availTuringTest: 24,
108
+ avail_mainnet: 24
108
109
  };
109
110
  exports._STAKING_ERA_LENGTH_MAP = _STAKING_ERA_LENGTH_MAP;
110
111
  const _EXPECTED_BLOCK_TIME = {
@@ -135,7 +136,8 @@ const _EXPECTED_BLOCK_TIME = {
135
136
  calamari_test: 12,
136
137
  manta_network: 12,
137
138
  enjin_relaychain: 6,
138
- availTuringTest: 20
139
+ availTuringTest: 20,
140
+ avail_mainnet: 20
139
141
  };
140
142
  exports._EXPECTED_BLOCK_TIME = _EXPECTED_BLOCK_TIME;
141
143
  const _PARACHAIN_INFLATION_DISTRIBUTION = {
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -20,7 +19,6 @@ var _api3 = require("@polkadot/apps-config/api");
20
19
  var _create = require("@polkadot/types/create");
21
20
  var _util = require("@polkadot/util");
22
21
  var _defaults = require("@polkadot/util-crypto/address/defaults");
23
- var _goldberg = _interopRequireDefault(require("./chain-spec/goldberg"));
24
22
  // Copyright 2019-2022 @subwallet/extension-base authors & contributors
25
23
  // SPDX-License-Identifier: Apache-2.0
26
24
 
@@ -100,9 +98,9 @@ class SubstrateApi {
100
98
  } else if (_constants._API_OPTIONS_CHAIN_GROUP.goldberg.includes(this.chainSlug)) {
101
99
  api = new _api2.ApiPromise({
102
100
  provider,
103
- rpc: _goldberg.default.rpc,
104
- types: _goldberg.default.types,
105
- signedExtensions: _goldberg.default.signedExtensions,
101
+ rpc: _availJsSdk.goldbergRpc,
102
+ types: _availJsSdk.goldbergTypes,
103
+ signedExtensions: _availJsSdk.spec.signedExtensions,
106
104
  noInitWarn: true
107
105
  });
108
106
  } else {
@@ -645,6 +645,14 @@ class ChainService {
645
645
  endpoint,
646
646
  providerName
647
647
  } = this.getChainCurrentProviderByKey(chainInfo.slug);
648
+
649
+ /**
650
+ * Disable chain if not found provider
651
+ * */
652
+ if (!endpoint && !providerName) {
653
+ this.disableChain(chainInfo.slug);
654
+ return;
655
+ }
648
656
  const onUpdateStatus = status => {
649
657
  const slug = chainInfo.slug;
650
658
  this.updateChainConnectionStatus(slug, status);
@@ -624,6 +624,10 @@ function updateLatestChainInfo(currentDataMap, latestChainInfoList) {
624
624
  if (currentChainInfo) {
625
625
  needUpdate = true;
626
626
  currentChainInfo.extraInfo = latestChainInfo.extraInfo;
627
+ currentChainInfo.chainStatus = latestChainInfo.chainStatus;
628
+ if (Object.keys(currentChainInfo.providers).length === 0) {
629
+ currentChainInfo.chainStatus = _types._ChainStatus.INACTIVE;
630
+ }
627
631
  }
628
632
  if (needUpdate) {
629
633
  storedChainInfoList.push({
@@ -12,7 +12,7 @@ var _crossFetch = _interopRequireDefault(require("cross-fetch"));
12
12
  const PRODUCTION_BRANCHES = ['master', 'webapp', 'webapp-dev'];
13
13
  const branchName = process.env.BRANCH_NAME || 'subwallet-dev';
14
14
  const fetchDomain = PRODUCTION_BRANCHES.indexOf(branchName) > -1 ? 'https://chain-list-assets.subwallet.app' : 'https://dev.sw-chain-list-assets.pages.dev';
15
- const ChainListVersion = '0.2.57';
15
+ const ChainListVersion = '0.2.59';
16
16
  async function fetchPatchData(slug) {
17
17
  try {
18
18
  const fetchPromise = (0, _crossFetch.default)(`${fetchDomain}/patch/${ChainListVersion}/${slug}`);
@@ -8,13 +8,13 @@ exports._STAKING_CHAIN_GROUP = exports.ST_LIQUID_TOKEN_ABI = exports.MaxEraRewar
8
8
  // SPDX-License-Identifier: Apache-2.0
9
9
 
10
10
  const _STAKING_CHAIN_GROUP = {
11
- relay: ['polkadot', 'kusama', 'aleph', 'polkadex', 'ternoa', 'alephTest', 'polkadexTest', 'westend', 'kate', 'edgeware', 'creditcoin', 'vara_network', 'goldberg_testnet', 'availTuringTest'],
11
+ relay: ['polkadot', 'kusama', 'aleph', 'polkadex', 'ternoa', 'alephTest', 'polkadexTest', 'westend', 'kate', 'edgeware', 'creditcoin', 'vara_network', 'goldberg_testnet', 'availTuringTest', 'avail_mainnet'],
12
12
  para: ['moonbeam', 'moonriver', 'moonbase', 'turing', 'turingStaging', 'bifrost', 'bifrost_testnet', 'calamari_test', 'calamari', 'manta_network', 'polimec'],
13
13
  astar: ['astar', 'shiden', 'shibuya'],
14
14
  amplitude: ['amplitude', 'amplitude_test', 'kilt', 'kilt_peregrine', 'pendulum', 'krest_network'],
15
15
  // amplitude and kilt only share some common logic
16
16
  kilt: ['kilt', 'kilt_peregrine'],
17
- nominationPool: ['polkadot', 'kusama', 'westend', 'alephTest', 'aleph', 'kate', 'vara_network', 'goldberg_testnet', 'availTuringTest'],
17
+ nominationPool: ['polkadot', 'kusama', 'westend', 'alephTest', 'aleph', 'kate', 'vara_network', 'goldberg_testnet', 'availTuringTest', 'avail_mainnet'],
18
18
  bifrost: ['bifrost', 'bifrost_testnet'],
19
19
  aleph: ['aleph', 'alephTest'],
20
20
  // A0 has distinct tokenomics
@@ -151,7 +151,7 @@ class RelayNativeStakingPoolHandler extends _base.default {
151
151
  let nominationStatus = _types.EarningStatus.NOT_EARNING;
152
152
  let eraStakerOtherList = [];
153
153
  let identity;
154
- if (['kusama', 'polkadot', 'westend', 'availTuringTest'].includes(this.chain)) {
154
+ if (['kusama', 'polkadot', 'westend', 'availTuringTest', 'avail_mainnet'].includes(this.chain)) {
155
155
  // todo: review all relaychains later
156
156
  const [[_identity], _eraStaker] = await Promise.all([(0, _utils3.parseIdentity)(substrateApi, validatorAddress), substrateApi.api.query.staking.erasStakersPaged.entries(currentEra, validatorAddress)]);
157
157
  identity = _identity;
@@ -303,9 +303,9 @@ class RelayNativeStakingPoolHandler extends _base.default {
303
303
  const validatorInfoList = [];
304
304
  const maxEraRewardPointsEras = _constants2.MaxEraRewardPointsEras;
305
305
  const endEraForPoints = parseInt(activeEra) - 1;
306
- let startEraForPoints = endEraForPoints - maxEraRewardPointsEras + 1;
306
+ let startEraForPoints = Math.max(endEraForPoints - maxEraRewardPointsEras + 1, 0);
307
307
  let _eraStakersPromise;
308
- if (['kusama', 'polkadot', 'westend', 'availTuringTest'].includes(this.chain)) {
308
+ if (['kusama', 'polkadot', 'westend', 'availTuringTest', 'avail_mainnet'].includes(this.chain)) {
309
309
  // todo: review all relaychains later
310
310
  _eraStakersPromise = chainApi.api.query.staking.erasStakersOverview.entries(parseInt(currentEra));
311
311
  } else {
@@ -167,7 +167,7 @@ class NominationPoolHandler extends _base.default {
167
167
  const validatorList = nominations.targets;
168
168
  await Promise.all(validatorList.map(async validatorAddress => {
169
169
  let eraStakerOtherList = [];
170
- if (['kusama', 'polkadot', 'westend', 'availTuringTest'].includes(this.chain)) {
170
+ if (['kusama', 'polkadot', 'westend', 'availTuringTest', 'avail_mainnet'].includes(this.chain)) {
171
171
  // todo: review all relaychains later
172
172
  const _eraStaker = await substrateApi.api.query.staking.erasStakersPaged.entries(currentEra, validatorAddress);
173
173
  eraStakerOtherList = _eraStaker.flatMap(paged => paged[1].toPrimitive().others);
@@ -55,6 +55,9 @@ const balanceFormatter = (input, metadata) => {
55
55
  }
56
56
  return int;
57
57
  }
58
+ if (!decimal) {
59
+ return int;
60
+ }
58
61
 
59
62
  // Get only minNumberFormat number at decimal
60
63
  if (decimal.length <= minNumberFormat) {
@@ -136,6 +139,10 @@ const balanceNoPrefixFormater = (input, metadata) => {
136
139
  const maxNumberFormat = (metadata === null || metadata === void 0 ? void 0 : metadata.maxNumberFormat) || 6;
137
140
  let _decimal = '';
138
141
  if (absGteOne) {
142
+ if (!decimal) {
143
+ return intToLocaleString(int, thousandSeparator);
144
+ }
145
+
139
146
  // Get only minNumberFormat number at decimal
140
147
  if (decimal.length <= minNumberFormat) {
141
148
  _decimal = decimal;
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "./cjs/detectPackage.js"
18
18
  ],
19
19
  "type": "module",
20
- "version": "1.1.60-1",
20
+ "version": "1.1.61-1",
21
21
  "main": "./cjs/index.js",
22
22
  "module": "./index.js",
23
23
  "types": "./index.d.ts",
@@ -625,11 +625,6 @@
625
625
  "require": "./cjs/services/chain-service/handler/AbstractChainHandler.js",
626
626
  "default": "./services/chain-service/handler/AbstractChainHandler.js"
627
627
  },
628
- "./services/chain-service/handler/chain-spec/goldberg": {
629
- "types": "./services/chain-service/handler/chain-spec/goldberg.d.ts",
630
- "require": "./cjs/services/chain-service/handler/chain-spec/goldberg.js",
631
- "default": "./services/chain-service/handler/chain-spec/goldberg.js"
632
- },
633
628
  "./services/chain-service/handler/EvmApi": {
634
629
  "types": "./services/chain-service/handler/EvmApi.d.ts",
635
630
  "require": "./cjs/services/chain-service/handler/EvmApi.js",
@@ -1874,17 +1869,17 @@
1874
1869
  "@reduxjs/toolkit": "^1.9.1",
1875
1870
  "@sora-substrate/type-definitions": "^1.17.7",
1876
1871
  "@substrate/connect": "^0.8.9",
1877
- "@subwallet/chain-list": "0.2.58",
1878
- "@subwallet/extension-base": "^1.1.60-1",
1879
- "@subwallet/extension-chains": "^1.1.60-1",
1880
- "@subwallet/extension-dapp": "^1.1.60-1",
1881
- "@subwallet/extension-inject": "^1.1.60-1",
1872
+ "@subwallet/chain-list": "0.2.59",
1873
+ "@subwallet/extension-base": "^1.1.61-1",
1874
+ "@subwallet/extension-chains": "^1.1.61-1",
1875
+ "@subwallet/extension-dapp": "^1.1.61-1",
1876
+ "@subwallet/extension-inject": "^1.1.61-1",
1882
1877
  "@subwallet/keyring": "^0.1.5",
1883
1878
  "@subwallet/ui-keyring": "^0.1.5",
1884
1879
  "@walletconnect/sign-client": "^2.8.4",
1885
1880
  "@walletconnect/types": "^2.8.4",
1886
1881
  "@walletconnect/utils": "^2.8.4",
1887
- "avail-js-sdk": "^0.2.11",
1882
+ "avail-js-sdk": "^0.2.12",
1888
1883
  "axios": "^1.6.2",
1889
1884
  "bignumber.js": "^9.1.1",
1890
1885
  "bn.js": "^5.2.1",
package/packageInfo.js CHANGED
@@ -7,5 +7,5 @@ export const packageInfo = {
7
7
  name: '@subwallet/extension-base',
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: '1.1.60-1'
10
+ version: '1.1.61-1'
11
11
  };
@@ -10,7 +10,7 @@ export const API_MAX_RETRY = 2;
10
10
  export const _API_OPTIONS_CHAIN_GROUP = {
11
11
  acala: ['acala', 'karura', 'origintrail', 'kintsugi'],
12
12
  turing: ['turingStaging', 'turing'],
13
- avail: ['kate', 'availTuringTest'],
13
+ avail: ['kate', 'availTuringTest', 'avail_mainnet'],
14
14
  goldberg: ['goldberg_testnet']
15
15
  };
16
16
  export const _PREDEFINED_SINGLE_MODES = {
@@ -91,7 +91,8 @@ export const _STAKING_ERA_LENGTH_MAP = {
91
91
  krest_network: 4,
92
92
  polimec: 6,
93
93
  enjin_relaychain: 24,
94
- availTuringTest: 24
94
+ availTuringTest: 24,
95
+ avail_mainnet: 24
95
96
  };
96
97
  export const _EXPECTED_BLOCK_TIME = {
97
98
  // in seconds
@@ -121,7 +122,8 @@ export const _EXPECTED_BLOCK_TIME = {
121
122
  calamari_test: 12,
122
123
  manta_network: 12,
123
124
  enjin_relaychain: 6,
124
- availTuringTest: 20
125
+ availTuringTest: 20,
126
+ avail_mainnet: 20
125
127
  };
126
128
  export const _PARACHAIN_INFLATION_DISTRIBUTION = {
127
129
  moonbeam: {
@@ -9,14 +9,13 @@ import { getSubstrateConnectProvider } from '@subwallet/extension-base/services/
9
9
  import { DEFAULT_AUX } from '@subwallet/extension-base/services/chain-service/handler/SubstrateChainHandler';
10
10
  import { _ChainConnectionStatus } from '@subwallet/extension-base/services/chain-service/types';
11
11
  import { createPromiseHandler } from '@subwallet/extension-base/utils/promise';
12
- import { spec as availSpec } from 'avail-js-sdk';
12
+ import { goldbergRpc, goldbergTypes, spec as availSpec } from 'avail-js-sdk';
13
13
  import { BehaviorSubject } from 'rxjs';
14
14
  import { ApiPromise, WsProvider } from '@polkadot/api';
15
15
  import { typesBundle } from '@polkadot/apps-config/api';
16
16
  import { TypeRegistry } from '@polkadot/types/create';
17
17
  import { formatBalance } from '@polkadot/util';
18
18
  import { defaults as addressDefaults } from '@polkadot/util-crypto/address/defaults';
19
- import goldbergSpec from "./chain-spec/goldberg.js";
20
19
  export class SubstrateApi {
21
20
  useLightClient = false;
22
21
  isApiReady = false;
@@ -93,9 +92,9 @@ export class SubstrateApi {
93
92
  } else if (_API_OPTIONS_CHAIN_GROUP.goldberg.includes(this.chainSlug)) {
94
93
  api = new ApiPromise({
95
94
  provider,
96
- rpc: goldbergSpec.rpc,
97
- types: goldbergSpec.types,
98
- signedExtensions: goldbergSpec.signedExtensions,
95
+ rpc: goldbergRpc,
96
+ types: goldbergTypes,
97
+ signedExtensions: availSpec.signedExtensions,
99
98
  noInitWarn: true
100
99
  });
101
100
  } else {
@@ -623,6 +623,14 @@ export class ChainService {
623
623
  endpoint,
624
624
  providerName
625
625
  } = this.getChainCurrentProviderByKey(chainInfo.slug);
626
+
627
+ /**
628
+ * Disable chain if not found provider
629
+ * */
630
+ if (!endpoint && !providerName) {
631
+ this.disableChain(chainInfo.slug);
632
+ return;
633
+ }
626
634
  const onUpdateStatus = status => {
627
635
  const slug = chainInfo.slug;
628
636
  this.updateChainConnectionStatus(slug, status);
@@ -455,6 +455,10 @@ export function updateLatestChainInfo(currentDataMap, latestChainInfoList) {
455
455
  if (currentChainInfo) {
456
456
  needUpdate = true;
457
457
  currentChainInfo.extraInfo = latestChainInfo.extraInfo;
458
+ currentChainInfo.chainStatus = latestChainInfo.chainStatus;
459
+ if (Object.keys(currentChainInfo.providers).length === 0) {
460
+ currentChainInfo.chainStatus = _ChainStatus.INACTIVE;
461
+ }
458
462
  }
459
463
  if (needUpdate) {
460
464
  storedChainInfoList.push({
@@ -5,7 +5,7 @@ import fetch from 'cross-fetch';
5
5
  const PRODUCTION_BRANCHES = ['master', 'webapp', 'webapp-dev'];
6
6
  const branchName = process.env.BRANCH_NAME || 'subwallet-dev';
7
7
  const fetchDomain = PRODUCTION_BRANCHES.indexOf(branchName) > -1 ? 'https://chain-list-assets.subwallet.app' : 'https://dev.sw-chain-list-assets.pages.dev';
8
- const ChainListVersion = '0.2.57';
8
+ const ChainListVersion = '0.2.59';
9
9
  export async function fetchPatchData(slug) {
10
10
  try {
11
11
  const fetchPromise = fetch(`${fetchDomain}/patch/${ChainListVersion}/${slug}`);
@@ -2,13 +2,13 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  export const _STAKING_CHAIN_GROUP = {
5
- relay: ['polkadot', 'kusama', 'aleph', 'polkadex', 'ternoa', 'alephTest', 'polkadexTest', 'westend', 'kate', 'edgeware', 'creditcoin', 'vara_network', 'goldberg_testnet', 'availTuringTest'],
5
+ relay: ['polkadot', 'kusama', 'aleph', 'polkadex', 'ternoa', 'alephTest', 'polkadexTest', 'westend', 'kate', 'edgeware', 'creditcoin', 'vara_network', 'goldberg_testnet', 'availTuringTest', 'avail_mainnet'],
6
6
  para: ['moonbeam', 'moonriver', 'moonbase', 'turing', 'turingStaging', 'bifrost', 'bifrost_testnet', 'calamari_test', 'calamari', 'manta_network', 'polimec'],
7
7
  astar: ['astar', 'shiden', 'shibuya'],
8
8
  amplitude: ['amplitude', 'amplitude_test', 'kilt', 'kilt_peregrine', 'pendulum', 'krest_network'],
9
9
  // amplitude and kilt only share some common logic
10
10
  kilt: ['kilt', 'kilt_peregrine'],
11
- nominationPool: ['polkadot', 'kusama', 'westend', 'alephTest', 'aleph', 'kate', 'vara_network', 'goldberg_testnet', 'availTuringTest'],
11
+ nominationPool: ['polkadot', 'kusama', 'westend', 'alephTest', 'aleph', 'kate', 'vara_network', 'goldberg_testnet', 'availTuringTest', 'avail_mainnet'],
12
12
  bifrost: ['bifrost', 'bifrost_testnet'],
13
13
  aleph: ['aleph', 'alephTest'],
14
14
  // A0 has distinct tokenomics
@@ -144,7 +144,7 @@ export default class RelayNativeStakingPoolHandler extends BaseNativeStakingPool
144
144
  let nominationStatus = EarningStatus.NOT_EARNING;
145
145
  let eraStakerOtherList = [];
146
146
  let identity;
147
- if (['kusama', 'polkadot', 'westend', 'availTuringTest'].includes(this.chain)) {
147
+ if (['kusama', 'polkadot', 'westend', 'availTuringTest', 'avail_mainnet'].includes(this.chain)) {
148
148
  // todo: review all relaychains later
149
149
  const [[_identity], _eraStaker] = await Promise.all([parseIdentity(substrateApi, validatorAddress), substrateApi.api.query.staking.erasStakersPaged.entries(currentEra, validatorAddress)]);
150
150
  identity = _identity;
@@ -296,9 +296,9 @@ export default class RelayNativeStakingPoolHandler extends BaseNativeStakingPool
296
296
  const validatorInfoList = [];
297
297
  const maxEraRewardPointsEras = MaxEraRewardPointsEras;
298
298
  const endEraForPoints = parseInt(activeEra) - 1;
299
- let startEraForPoints = endEraForPoints - maxEraRewardPointsEras + 1;
299
+ let startEraForPoints = Math.max(endEraForPoints - maxEraRewardPointsEras + 1, 0);
300
300
  let _eraStakersPromise;
301
- if (['kusama', 'polkadot', 'westend', 'availTuringTest'].includes(this.chain)) {
301
+ if (['kusama', 'polkadot', 'westend', 'availTuringTest', 'avail_mainnet'].includes(this.chain)) {
302
302
  // todo: review all relaychains later
303
303
  _eraStakersPromise = chainApi.api.query.staking.erasStakersOverview.entries(parseInt(currentEra));
304
304
  } else {
@@ -159,7 +159,7 @@ export default class NominationPoolHandler extends BasePoolHandler {
159
159
  const validatorList = nominations.targets;
160
160
  await Promise.all(validatorList.map(async validatorAddress => {
161
161
  let eraStakerOtherList = [];
162
- if (['kusama', 'polkadot', 'westend', 'availTuringTest'].includes(this.chain)) {
162
+ if (['kusama', 'polkadot', 'westend', 'availTuringTest', 'avail_mainnet'].includes(this.chain)) {
163
163
  // todo: review all relaychains later
164
164
  const _eraStaker = await substrateApi.api.query.staking.erasStakersPaged.entries(currentEra, validatorAddress);
165
165
  eraStakerOtherList = _eraStaker.flatMap(paged => paged[1].toPrimitive().others);
package/utils/number.js CHANGED
@@ -44,6 +44,9 @@ export const balanceFormatter = (input, metadata) => {
44
44
  }
45
45
  return int;
46
46
  }
47
+ if (!decimal) {
48
+ return int;
49
+ }
47
50
 
48
51
  // Get only minNumberFormat number at decimal
49
52
  if (decimal.length <= minNumberFormat) {
@@ -124,6 +127,10 @@ export const balanceNoPrefixFormater = (input, metadata) => {
124
127
  const maxNumberFormat = (metadata === null || metadata === void 0 ? void 0 : metadata.maxNumberFormat) || 6;
125
128
  let _decimal = '';
126
129
  if (absGteOne) {
130
+ if (!decimal) {
131
+ return intToLocaleString(int, thousandSeparator);
132
+ }
133
+
127
134
  // Get only minNumberFormat number at decimal
128
135
  if (decimal.length <= minNumberFormat) {
129
136
  _decimal = decimal;
@@ -1,190 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- // Copyright 2019-2022 @subwallet/extension-base authors & contributors
8
- // SPDX-License-Identifier: Apache-2.0
9
-
10
- const chainSpec = {
11
- types: {
12
- AppId: 'Compact<u32>',
13
- DataLookupIndexItem: {
14
- appId: 'AppId',
15
- start: 'Compact<u32>'
16
- },
17
- DataLookup: {
18
- size: 'Compact<u32>',
19
- index: 'Vec<DataLookupIndexItem>'
20
- },
21
- KateCommitment: {
22
- rows: 'Compact<u16>',
23
- cols: 'Compact<u16>',
24
- commitment: 'Vec<u8>',
25
- dataRoot: 'H256'
26
- },
27
- V1HeaderExtension: {
28
- appLookup: 'DataLookup',
29
- commitment: 'KateCommitment'
30
- },
31
- V2HeaderExtension: {
32
- appLookup: 'DataLookup',
33
- commitment: 'KateCommitment'
34
- },
35
- V3HeaderExtension: {
36
- appLookup: 'DataLookup',
37
- commitment: 'KateCommitment'
38
- },
39
- VTHeaderExtension: {
40
- newField: 'Vec<u8>',
41
- commitment: 'KateCommitment',
42
- appLookup: 'DataLookup'
43
- },
44
- HeaderExtension: {
45
- _enum: {
46
- V1: 'V1HeaderExtension',
47
- V2: 'V2HeaderExtension',
48
- V3: 'V3HeaderExtension',
49
- VTest: 'VTHeaderExtension'
50
- }
51
- },
52
- DaHeader: {
53
- parentHash: 'Hash',
54
- number: 'Compact<BlockNumber>',
55
- stateRoot: 'Hash',
56
- extrinsicsRoot: 'Hash',
57
- digest: 'Digest',
58
- extension: 'HeaderExtension'
59
- },
60
- Header: 'DaHeader',
61
- CheckAppIdExtra: {
62
- appId: 'AppId'
63
- },
64
- CheckAppIdTypes: {},
65
- CheckAppId: {
66
- extra: 'CheckAppIdExtra',
67
- types: 'CheckAppIdTypes'
68
- },
69
- BlockLengthColumns: 'Compact<u32>',
70
- BlockLengthRows: 'Compact<u32>',
71
- BlockLength: {
72
- max: 'PerDispatchClass',
73
- cols: 'BlockLengthColumns',
74
- rows: 'BlockLengthRows',
75
- chunkSize: 'Compact<u32>'
76
- },
77
- PerDispatchClass: {
78
- normal: 'u32',
79
- operational: 'u32',
80
- mandatory: 'u32'
81
- },
82
- DataProof: {
83
- root: 'H256',
84
- proof: 'Vec<H256>',
85
- numberOfLeaves: 'Compact<u32>',
86
- leafIndex: 'Compact<u32>',
87
- leaf: 'H256'
88
- },
89
- DataProofV2: {
90
- dataRoot: 'H256',
91
- blobRoot: 'H256',
92
- bridgeRoot: 'H256',
93
- proof: 'Vec<H256>',
94
- numberOfLeaves: 'Compact<u32>',
95
- leafIndex: 'Compact<u32>',
96
- leaf: 'H256'
97
- },
98
- ProofResponse: {
99
- dataProof: 'DataProofV2',
100
- message: 'Option<Message>'
101
- },
102
- Message: {
103
- messageType: 'MessageType',
104
- from: 'H256',
105
- to: 'H256',
106
- originDomain: 'u32',
107
- destinationDomain: 'u32',
108
- data: 'Vec<u8>',
109
- id: 'u64'
110
- },
111
- MessageType: {
112
- _enum: ['ArbitraryMessage', 'FungibleToken']
113
- },
114
- Cell: {
115
- row: 'BlockLengthRows',
116
- col: 'BlockLengthColumns'
117
- }
118
- },
119
- rpc: {
120
- kate: {
121
- blockLength: {
122
- description: 'Get Block Length',
123
- params: [{
124
- name: 'at',
125
- type: 'Hash',
126
- isOptional: true
127
- }],
128
- type: 'BlockLength'
129
- },
130
- queryProof: {
131
- description: 'Generate the kate proof for the given `cells`',
132
- params: [{
133
- name: 'cells',
134
- type: 'Vec<Cell>'
135
- }, {
136
- name: 'at',
137
- type: 'Hash',
138
- isOptional: true
139
- }],
140
- type: 'Vec<u8>'
141
- },
142
- queryAppData: {
143
- description: 'Fetches app data rows for the given app',
144
- params: [{
145
- name: 'app_id',
146
- type: 'AppId'
147
- }, {
148
- name: 'at',
149
- type: 'Hash',
150
- isOptional: true
151
- }],
152
- type: 'Vec<Option<Vec<u8>>>'
153
- },
154
- queryDataProof: {
155
- description: 'Generate the data proof for the given `transaction_index`',
156
- params: [{
157
- name: 'transaction_index',
158
- type: 'u32'
159
- }, {
160
- name: 'at',
161
- type: 'Hash',
162
- isOptional: true
163
- }],
164
- type: 'DataProof'
165
- },
166
- queryDataProofV2: {
167
- description: 'Generate the data proof for the given `transaction_index`',
168
- params: [{
169
- name: 'transaction_index',
170
- type: 'u32'
171
- }, {
172
- name: 'at',
173
- type: 'Hash',
174
- isOptional: true
175
- }],
176
- type: 'ProofResponse'
177
- }
178
- }
179
- },
180
- signedExtensions: {
181
- CheckAppId: {
182
- extrinsic: {
183
- appId: 'AppId'
184
- },
185
- payload: {}
186
- }
187
- }
188
- };
189
- var _default = chainSpec;
190
- exports.default = _default;
@@ -1,184 +0,0 @@
1
- declare const chainSpec: {
2
- types: {
3
- AppId: string;
4
- DataLookupIndexItem: {
5
- appId: string;
6
- start: string;
7
- };
8
- DataLookup: {
9
- size: string;
10
- index: string;
11
- };
12
- KateCommitment: {
13
- rows: string;
14
- cols: string;
15
- commitment: string;
16
- dataRoot: string;
17
- };
18
- V1HeaderExtension: {
19
- appLookup: string;
20
- commitment: string;
21
- };
22
- V2HeaderExtension: {
23
- appLookup: string;
24
- commitment: string;
25
- };
26
- V3HeaderExtension: {
27
- appLookup: string;
28
- commitment: string;
29
- };
30
- VTHeaderExtension: {
31
- newField: string;
32
- commitment: string;
33
- appLookup: string;
34
- };
35
- HeaderExtension: {
36
- _enum: {
37
- V1: string;
38
- V2: string;
39
- V3: string;
40
- VTest: string;
41
- };
42
- };
43
- DaHeader: {
44
- parentHash: string;
45
- number: string;
46
- stateRoot: string;
47
- extrinsicsRoot: string;
48
- digest: string;
49
- extension: string;
50
- };
51
- Header: string;
52
- CheckAppIdExtra: {
53
- appId: string;
54
- };
55
- CheckAppIdTypes: {};
56
- CheckAppId: {
57
- extra: string;
58
- types: string;
59
- };
60
- BlockLengthColumns: string;
61
- BlockLengthRows: string;
62
- BlockLength: {
63
- max: string;
64
- cols: string;
65
- rows: string;
66
- chunkSize: string;
67
- };
68
- PerDispatchClass: {
69
- normal: string;
70
- operational: string;
71
- mandatory: string;
72
- };
73
- DataProof: {
74
- root: string;
75
- proof: string;
76
- numberOfLeaves: string;
77
- leafIndex: string;
78
- leaf: string;
79
- };
80
- DataProofV2: {
81
- dataRoot: string;
82
- blobRoot: string;
83
- bridgeRoot: string;
84
- proof: string;
85
- numberOfLeaves: string;
86
- leafIndex: string;
87
- leaf: string;
88
- };
89
- ProofResponse: {
90
- dataProof: string;
91
- message: string;
92
- };
93
- Message: {
94
- messageType: string;
95
- from: string;
96
- to: string;
97
- originDomain: string;
98
- destinationDomain: string;
99
- data: string;
100
- id: string;
101
- };
102
- MessageType: {
103
- _enum: string[];
104
- };
105
- Cell: {
106
- row: string;
107
- col: string;
108
- };
109
- };
110
- rpc: {
111
- kate: {
112
- blockLength: {
113
- description: string;
114
- params: {
115
- name: string;
116
- type: string;
117
- isOptional: boolean;
118
- }[];
119
- type: string;
120
- };
121
- queryProof: {
122
- description: string;
123
- params: ({
124
- name: string;
125
- type: string;
126
- isOptional?: undefined;
127
- } | {
128
- name: string;
129
- type: string;
130
- isOptional: boolean;
131
- })[];
132
- type: string;
133
- };
134
- queryAppData: {
135
- description: string;
136
- params: ({
137
- name: string;
138
- type: string;
139
- isOptional?: undefined;
140
- } | {
141
- name: string;
142
- type: string;
143
- isOptional: boolean;
144
- })[];
145
- type: string;
146
- };
147
- queryDataProof: {
148
- description: string;
149
- params: ({
150
- name: string;
151
- type: string;
152
- isOptional?: undefined;
153
- } | {
154
- name: string;
155
- type: string;
156
- isOptional: boolean;
157
- })[];
158
- type: string;
159
- };
160
- queryDataProofV2: {
161
- description: string;
162
- params: ({
163
- name: string;
164
- type: string;
165
- isOptional?: undefined;
166
- } | {
167
- name: string;
168
- type: string;
169
- isOptional: boolean;
170
- })[];
171
- type: string;
172
- };
173
- };
174
- };
175
- signedExtensions: {
176
- CheckAppId: {
177
- extrinsic: {
178
- appId: string;
179
- };
180
- payload: {};
181
- };
182
- };
183
- };
184
- export default chainSpec;
@@ -1,183 +0,0 @@
1
- // Copyright 2019-2022 @subwallet/extension-base authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- const chainSpec = {
5
- types: {
6
- AppId: 'Compact<u32>',
7
- DataLookupIndexItem: {
8
- appId: 'AppId',
9
- start: 'Compact<u32>'
10
- },
11
- DataLookup: {
12
- size: 'Compact<u32>',
13
- index: 'Vec<DataLookupIndexItem>'
14
- },
15
- KateCommitment: {
16
- rows: 'Compact<u16>',
17
- cols: 'Compact<u16>',
18
- commitment: 'Vec<u8>',
19
- dataRoot: 'H256'
20
- },
21
- V1HeaderExtension: {
22
- appLookup: 'DataLookup',
23
- commitment: 'KateCommitment'
24
- },
25
- V2HeaderExtension: {
26
- appLookup: 'DataLookup',
27
- commitment: 'KateCommitment'
28
- },
29
- V3HeaderExtension: {
30
- appLookup: 'DataLookup',
31
- commitment: 'KateCommitment'
32
- },
33
- VTHeaderExtension: {
34
- newField: 'Vec<u8>',
35
- commitment: 'KateCommitment',
36
- appLookup: 'DataLookup'
37
- },
38
- HeaderExtension: {
39
- _enum: {
40
- V1: 'V1HeaderExtension',
41
- V2: 'V2HeaderExtension',
42
- V3: 'V3HeaderExtension',
43
- VTest: 'VTHeaderExtension'
44
- }
45
- },
46
- DaHeader: {
47
- parentHash: 'Hash',
48
- number: 'Compact<BlockNumber>',
49
- stateRoot: 'Hash',
50
- extrinsicsRoot: 'Hash',
51
- digest: 'Digest',
52
- extension: 'HeaderExtension'
53
- },
54
- Header: 'DaHeader',
55
- CheckAppIdExtra: {
56
- appId: 'AppId'
57
- },
58
- CheckAppIdTypes: {},
59
- CheckAppId: {
60
- extra: 'CheckAppIdExtra',
61
- types: 'CheckAppIdTypes'
62
- },
63
- BlockLengthColumns: 'Compact<u32>',
64
- BlockLengthRows: 'Compact<u32>',
65
- BlockLength: {
66
- max: 'PerDispatchClass',
67
- cols: 'BlockLengthColumns',
68
- rows: 'BlockLengthRows',
69
- chunkSize: 'Compact<u32>'
70
- },
71
- PerDispatchClass: {
72
- normal: 'u32',
73
- operational: 'u32',
74
- mandatory: 'u32'
75
- },
76
- DataProof: {
77
- root: 'H256',
78
- proof: 'Vec<H256>',
79
- numberOfLeaves: 'Compact<u32>',
80
- leafIndex: 'Compact<u32>',
81
- leaf: 'H256'
82
- },
83
- DataProofV2: {
84
- dataRoot: 'H256',
85
- blobRoot: 'H256',
86
- bridgeRoot: 'H256',
87
- proof: 'Vec<H256>',
88
- numberOfLeaves: 'Compact<u32>',
89
- leafIndex: 'Compact<u32>',
90
- leaf: 'H256'
91
- },
92
- ProofResponse: {
93
- dataProof: 'DataProofV2',
94
- message: 'Option<Message>'
95
- },
96
- Message: {
97
- messageType: 'MessageType',
98
- from: 'H256',
99
- to: 'H256',
100
- originDomain: 'u32',
101
- destinationDomain: 'u32',
102
- data: 'Vec<u8>',
103
- id: 'u64'
104
- },
105
- MessageType: {
106
- _enum: ['ArbitraryMessage', 'FungibleToken']
107
- },
108
- Cell: {
109
- row: 'BlockLengthRows',
110
- col: 'BlockLengthColumns'
111
- }
112
- },
113
- rpc: {
114
- kate: {
115
- blockLength: {
116
- description: 'Get Block Length',
117
- params: [{
118
- name: 'at',
119
- type: 'Hash',
120
- isOptional: true
121
- }],
122
- type: 'BlockLength'
123
- },
124
- queryProof: {
125
- description: 'Generate the kate proof for the given `cells`',
126
- params: [{
127
- name: 'cells',
128
- type: 'Vec<Cell>'
129
- }, {
130
- name: 'at',
131
- type: 'Hash',
132
- isOptional: true
133
- }],
134
- type: 'Vec<u8>'
135
- },
136
- queryAppData: {
137
- description: 'Fetches app data rows for the given app',
138
- params: [{
139
- name: 'app_id',
140
- type: 'AppId'
141
- }, {
142
- name: 'at',
143
- type: 'Hash',
144
- isOptional: true
145
- }],
146
- type: 'Vec<Option<Vec<u8>>>'
147
- },
148
- queryDataProof: {
149
- description: 'Generate the data proof for the given `transaction_index`',
150
- params: [{
151
- name: 'transaction_index',
152
- type: 'u32'
153
- }, {
154
- name: 'at',
155
- type: 'Hash',
156
- isOptional: true
157
- }],
158
- type: 'DataProof'
159
- },
160
- queryDataProofV2: {
161
- description: 'Generate the data proof for the given `transaction_index`',
162
- params: [{
163
- name: 'transaction_index',
164
- type: 'u32'
165
- }, {
166
- name: 'at',
167
- type: 'Hash',
168
- isOptional: true
169
- }],
170
- type: 'ProofResponse'
171
- }
172
- }
173
- },
174
- signedExtensions: {
175
- CheckAppId: {
176
- extrinsic: {
177
- appId: 'AppId'
178
- },
179
- payload: {}
180
- }
181
- }
182
- };
183
- export default chainSpec;