@subwallet/extension-base 1.3.60-1 → 1.3.62-0

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.
@@ -396,7 +396,7 @@ function getEarningStatusByNominations(bnTotalActiveStake, nominationList) {
396
396
  function getValidatorLabel(chain) {
397
397
  if (_constants2._STAKING_CHAIN_GROUP.astar.includes(chain)) {
398
398
  return 'dApp';
399
- } else if (_constants2._STAKING_CHAIN_GROUP.relay.includes(chain) || _constants2._STAKING_CHAIN_GROUP.bittensor.includes(chain)) {
399
+ } else if (_constants2.RELAY_HANDLER_DIRECT_STAKING_CHAINS.includes(chain) || _constants2._STAKING_CHAIN_GROUP.bittensor.includes(chain)) {
400
400
  return 'Validator';
401
401
  }
402
402
  return 'Collator';
@@ -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.3.60-1'
16
+ version: '1.3.62-0'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
@@ -41,7 +41,7 @@ const _BALANCE_CHAIN_GROUP = {
41
41
  genshiro: ['genshiro_testnet', 'genshiro'],
42
42
  equilibrium_parachain: ['equilibrium_parachain'],
43
43
  bifrost: ['bifrost', 'acala', 'karura', 'acala_testnet', 'pioneer', 'bitcountry', 'bifrost_dot', 'hydradx_main', 'hydradx_rococo', 'pendulum', 'amplitude', 'continuum_network', 'truth_network', 'jamton', 'hydradx_hollarnet'],
44
- statemine: ['statemine', 'astar', 'shiden', 'statemint', 'crabParachain', 'darwinia2', 'parallel', 'calamari', 'manta_network', 'rococo_assethub', 'liberlandTest', 'liberland', 'dentnet', 'pangolin', 'crust', 'phala', 'shibuya', 'dbcchain', 'westend_assethub', 'chainflip_assethub', 'origintrail', 'xode'],
44
+ statemine: ['statemine', 'astar', 'shiden', 'statemint', 'crabParachain', 'darwinia2', 'parallel', 'calamari', 'manta_network', 'rococo_assethub', 'liberlandTest', 'liberland', 'dentnet', 'pangolin', 'crust', 'phala', 'shibuya', 'dbcchain', 'westend_assethub', 'chainflip_assethub', 'origintrail', 'xode', 'paseo_assethub'],
45
45
  kusama: ['kusama', 'kintsugi', 'kintsugi_test', 'interlay', 'acala', 'statemint', 'karura', 'bifrost'],
46
46
  // perhaps there are some runtime updates
47
47
  centrifuge: ['centrifuge'],
@@ -283,7 +283,7 @@ const _TRANSFER_CHAIN_GROUP = {
283
283
  genshiro: ['genshiro_testnet', 'genshiro', 'equilibrium_parachain'],
284
284
  // crab: ['crab', 'pangolin'],
285
285
  bitcountry: ['pioneer', 'bitcountry'],
286
- statemine: ['statemint', 'statemine', 'darwinia2', 'astar', 'shiden', 'shibuya', 'parallel', 'liberland', 'liberlandTest', 'dentnet', 'dbcchain', 'westend_assethub', 'chainflip_assethub', 'origintrail', 'xode'],
286
+ statemine: ['statemint', 'statemine', 'darwinia2', 'astar', 'shiden', 'shibuya', 'parallel', 'liberland', 'liberlandTest', 'dentnet', 'dbcchain', 'westend_assethub', 'chainflip_assethub', 'origintrail', 'xode', 'paseo_assethub'],
287
287
  riochain: ['riochain'],
288
288
  sora_substrate: ['sora_substrate'],
289
289
  avail: ['kate', 'goldberg_testnet'],
@@ -12,7 +12,7 @@ const PRODUCTION_BRANCHES = ['master', 'webapp', 'webapp-dev'];
12
12
  const branchName = process.env.BRANCH_NAME || 'subwallet-dev';
13
13
  const fetchDomain = process.env.PATCH_CHAIN_LIST_URL || (PRODUCTION_BRANCHES.indexOf(branchName) > -1 ? 'https://chain-list-assets.subwallet.app' : 'https://dev.sw-chain-list-assets.pages.dev');
14
14
  const fetchFile = PRODUCTION_BRANCHES.indexOf(branchName) > -1 ? 'list.json' : 'preview.json';
15
- const ChainListVersion = '0.2.117'; // update this when build chain-list
15
+ const ChainListVersion = '0.2.118'; // update this when build chain-list
16
16
 
17
17
  // todo: move this interface to chainlist
18
18
  exports.ChainListVersion = ChainListVersion;
@@ -23,7 +23,7 @@ async function fetchPatchData() {
23
23
  const id = setTimeout(() => {
24
24
  clearTimeout(id);
25
25
  resolve(null);
26
- }, 1000);
26
+ }, 2000);
27
27
  });
28
28
  const rs = await Promise.race([timeout, fetchPromise]);
29
29
  if (!rs) {
@@ -3,18 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports._STAKING_CHAIN_GROUP = exports.TON_CHAINS = exports.ST_LIQUID_TOKEN_ABI = exports.STAKING_IDENTITY_API_SLUG = exports.MaxEraRewardPointsEras = exports.MANTA_VALIDATOR_POINTS_PER_BLOCK = exports.MANTA_MIN_DELEGATION = exports.CHANNEL_ID = void 0;
6
+ exports._STAKING_CHAIN_GROUP = exports.TON_CHAINS = exports.ST_LIQUID_TOKEN_ABI = exports.STAKING_IDENTITY_API_SLUG = exports.RELAY_HANDLER_DIRECT_STAKING_CHAINS = exports.MaxEraRewardPointsEras = exports.MANTA_VALIDATOR_POINTS_PER_BLOCK = exports.MANTA_MIN_DELEGATION = exports.CHANNEL_ID = void 0;
7
7
  // Copyright 2019-2022 @subwallet/extension-base
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', 'avail_mainnet', 'vara_testnet', 'dentnet', 'cere', 'statemine', 'statemint', 'westend_assethub', 'zkverify', 'zkverify_testnet'],
12
- assetHub: ['statemine', 'statemint', 'westend_assethub'],
11
+ relay: ['polkadot', 'kusama', 'aleph', 'polkadex', 'ternoa', 'alephTest', 'polkadexTest', 'westend', 'kate', 'edgeware', 'creditcoin', 'vara_network', 'goldberg_testnet', 'availTuringTest', 'avail_mainnet', 'vara_testnet', 'dentnet', 'cere', 'zkverify', 'zkverify_testnet', 'paseoTest'],
12
+ assetHub: ['statemine', 'statemint', 'westend_assethub', 'paseo_assethub'],
13
13
  para: ['moonbeam', 'moonriver', 'moonbase', 'turing', 'turingStaging', 'bifrost', 'bifrost_testnet', 'calamari_test', 'calamari', 'manta_network', 'polimec'],
14
14
  astar: ['astar', 'shiden', 'shibuya'],
15
15
  amplitude: ['amplitude', 'amplitude_test', 'pendulum', 'krest_network'],
16
16
  // amplitude and kilt only share some common logic
17
- nominationPool: ['polkadot', 'kusama', 'westend', 'alephTest', 'aleph', 'kate', 'vara_network', 'goldberg_testnet', 'availTuringTest', 'avail_mainnet', 'vara_testnet', 'cere', 'analog_timechain'],
17
+ nominationPool: ['polkadot', 'kusama', 'westend', 'alephTest', 'aleph', 'kate', 'vara_network', 'goldberg_testnet', 'availTuringTest', 'avail_mainnet', 'vara_testnet', 'cere', 'analog_timechain', 'paseoTest'],
18
18
  bifrost: ['bifrost', 'bifrost_testnet'],
19
19
  aleph: ['aleph', 'alephTest'],
20
20
  // A0 has distinct tokenomics
@@ -28,6 +28,8 @@ const _STAKING_CHAIN_GROUP = {
28
28
  mythos: ['mythos', 'muse_testnet']
29
29
  };
30
30
  exports._STAKING_CHAIN_GROUP = _STAKING_CHAIN_GROUP;
31
+ const RELAY_HANDLER_DIRECT_STAKING_CHAINS = [..._STAKING_CHAIN_GROUP.relay, ..._STAKING_CHAIN_GROUP.assetHub];
32
+ exports.RELAY_HANDLER_DIRECT_STAKING_CHAINS = RELAY_HANDLER_DIRECT_STAKING_CHAINS;
31
33
  const TON_CHAINS = ['ton', 'ton_testnet'];
32
34
  exports.TON_CHAINS = TON_CHAINS;
33
35
  const MaxEraRewardPointsEras = 14;
@@ -43,7 +45,9 @@ exports.MANTA_MIN_DELEGATION = MANTA_MIN_DELEGATION;
43
45
  const CHANNEL_ID = 7;
44
46
  exports.CHANNEL_ID = CHANNEL_ID;
45
47
  const STAKING_IDENTITY_API_SLUG = {
48
+ // @TODO: Remove polkadot then migrate
46
49
  polkadot: 'polkadot_people',
47
- kusama: 'peopleKusama'
50
+ statemine: 'peopleKusama',
51
+ statemint: 'polkadot_people'
48
52
  };
49
53
  exports.STAKING_IDENTITY_API_SLUG = STAKING_IDENTITY_API_SLUG;
@@ -64,24 +64,29 @@ class EarningService {
64
64
  }
65
65
  }
66
66
  const minAmountPercent = {};
67
- const ahMapChain = await this.state.chainService.fetchAhMapChain();
67
+ const ahMigratedChainMap = await this.state.chainService.fetchAhMapChain();
68
+ const ahMigratedChains = Object.values(ahMigratedChainMap);
68
69
  for (const chain of chains) {
69
70
  const handlers = [];
70
71
  const chainInfo = this.state.getChainInfo(chain);
71
72
  const symbol = (0, _utils._getChainSubstrateTokenSymbol)(chainInfo);
72
73
  if (_constants2._STAKING_CHAIN_GROUP.relay.includes(chain)) {
73
- if (_constants2._STAKING_CHAIN_GROUP.assetHub.includes(chain)) {
74
- continue;
75
- }
76
- const ahChain = ahMapChain[chain];
77
- if (ahChain) {
78
- handlers.push(new _handlers.RelayNativeStakingPoolHandler(this.state, ahChain));
74
+ const ahMigratedChain = ahMigratedChainMap[chain];
75
+ if (ahMigratedChain) {
79
76
  const relaySlug = _handlers.RelayNativeStakingPoolHandler.generateSlug(symbol, chain);
80
77
  this.inactivePoolSlug.add(relaySlug);
81
78
  } else {
82
79
  handlers.push(new _handlers.RelayNativeStakingPoolHandler(this.state, chain));
83
80
  }
84
81
  }
82
+ if (_constants2._STAKING_CHAIN_GROUP.assetHub.includes(chain)) {
83
+ // define list of migrating asset hub
84
+ if (ahMigratedChains.includes(chain)) {
85
+ // check if chain migrate with online data
86
+ handlers.push(new _handlers.RelayNativeStakingPoolHandler(this.state, chain));
87
+ handlers.push(new _handlers.NominationPoolHandler(this.state, chain));
88
+ }
89
+ }
85
90
  if (_constants2._STAKING_CHAIN_GROUP.para.includes(chain)) {
86
91
  handlers.push(new _handlers.ParaNativeStakingPoolHandler(this.state, chain));
87
92
  }
@@ -104,9 +109,8 @@ class EarningService {
104
109
  handlers.push(new _handlers.EnergyNativeStakingPoolHandler(this.state, chain));
105
110
  }
106
111
  if (_constants2._STAKING_CHAIN_GROUP.nominationPool.includes(chain)) {
107
- const ahChain = ahMapChain[chain];
108
- if (ahChain) {
109
- handlers.push(new _handlers.NominationPoolHandler(this.state, ahChain));
112
+ const ahMigratedChain = ahMigratedChainMap[chain];
113
+ if (ahMigratedChain) {
110
114
  const relaySlug = _handlers.NominationPoolHandler.generateSlug(symbol, chain);
111
115
  this.inactivePoolSlug.add(relaySlug);
112
116
  } else {
@@ -32,7 +32,18 @@ async function getAssetHubTokensCanPayFee(request) {
32
32
 
33
33
  // ensure nativeTokenInfo and localTokenInfo have multi-location metadata beforehand to improve performance.
34
34
  const tokensHasBalanceSlug = Object.keys(tokensHasBalanceInfoMap);
35
- const tokenInfos = tokensHasBalanceSlug.map(tokenSlug => chainService.getAssetBySlug(tokenSlug)).filter(token => token.originChain === substrateApi.chainSlug && token.assetType !== _types._AssetType.NATIVE && token.metadata && token.metadata.multilocation);
35
+ const tokenInfos = tokensHasBalanceSlug.map(tokenSlug => {
36
+ const token = chainService.getAssetBySlug(tokenSlug);
37
+ if (!token) {
38
+ console.error(`[getAssetHubTokensCanPayFee] Token not found for slug: ${tokenSlug}`);
39
+ }
40
+ return token;
41
+ }).filter(token => {
42
+ if (!token) {
43
+ return false;
44
+ }
45
+ return token.originChain === substrateApi.chainSlug && token.assetType !== _types._AssetType.NATIVE && token.metadata && token.metadata.multilocation;
46
+ });
36
47
  await Promise.all(tokenInfos.map(async tokenInfo => {
37
48
  try {
38
49
  const tokenSlug = tokenInfo.slug;
@@ -80,7 +91,19 @@ async function getHydrationTokensCanPayFee(request) {
80
91
  if (!nativePriceId) {
81
92
  return tokensList;
82
93
  }
83
- const tokenInfos = Object.keys(tokensHasBalanceInfoMap).map(tokenSlug => chainService.getAssetBySlug(tokenSlug)).filter(token => token.originChain === substrateApi.chainSlug && token.assetType !== _types._AssetType.NATIVE && !!token.metadata && !!token.metadata.assetId);
94
+ const tokenInfos = Object.keys(tokensHasBalanceInfoMap).map(tokenSlug => {
95
+ const token = chainService.getAssetBySlug(tokenSlug);
96
+ if (!token) {
97
+ console.error(`[getHydrationTokensCanPayFee] Token not found for slug: ${tokenSlug}`);
98
+ }
99
+ return token;
100
+ }).filter(token => {
101
+ var _token$metadata;
102
+ if (!token) {
103
+ return false;
104
+ }
105
+ return token.originChain === substrateApi.chainSlug && token.assetType !== _types._AssetType.NATIVE && !!((_token$metadata = token.metadata) !== null && _token$metadata !== void 0 && _token$metadata.assetId);
106
+ });
84
107
  await Promise.all(tokenInfos.map(async tokenInfo => {
85
108
  const priceId = (0, _utils._getAssetPriceId)(tokenInfo);
86
109
  const rate = await getHydrationRate(address, nativeTokenInfo, tokenInfo);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _Base = _interopRequireDefault(require("@subwallet/extension-base/services/migration-service/Base"));
9
+ // Copyright 2019-2022 @subwallet/extension-koni authors & contributors
10
+ // SPDX-License-Identifier: Apache-2.0
11
+
12
+ class DeleteEarningData20251010 extends _Base.default {
13
+ async run() {
14
+ try {
15
+ await this.state.dbService.deleteYieldPoolInfo(['KSM___native_staking___kusama', 'KSM___nomination_pool___kusama']);
16
+ } catch (e) {
17
+ console.error(e);
18
+ }
19
+ }
20
+ }
21
+ exports.default = DeleteEarningData20251010;
@@ -22,6 +22,7 @@ var _MigratePolygonUSDCProvider = _interopRequireDefault(require("./tokens/Migra
22
22
  var _DeleteChain = _interopRequireDefault(require("./DeleteChain"));
23
23
  var _DeleteChainStaking = _interopRequireDefault(require("./DeleteChainStaking"));
24
24
  var _DeleteEarningData = _interopRequireDefault(require("./DeleteEarningData"));
25
+ var _DeleteEarningData2 = _interopRequireDefault(require("./DeleteEarningData20251010"));
25
26
  var _DisableZeroBalanceTokens = _interopRequireDefault(require("./DisableZeroBalanceTokens"));
26
27
  var _EnableVaraChain = _interopRequireDefault(require("./EnableVaraChain"));
27
28
  var _MigrateAuthUrls = _interopRequireDefault(require("./MigrateAuthUrls"));
@@ -76,6 +77,7 @@ var _default = {
76
77
  // [`${EVERYTIME}-1.1.42-02`]: MigrateTransactionHistoryBySymbol
77
78
  // [`${EVERYTIME}-1`]: AutoEnableChainsTokens
78
79
  '1.3.42-01': _MigrateNewUnifiedAccount.default,
79
- '1.3.54-01': _MigrateChainPatrol.default
80
+ '1.3.54-01': _MigrateChainPatrol.default,
81
+ '1.3.62-01': _DeleteEarningData2.default
80
82
  };
81
83
  exports.default = _default;
@@ -107,6 +107,7 @@ const calculateTransferMaxTransferable = async (id, request, freeBalance, fee) =
107
107
  let feeOptions;
108
108
  let maxTransferable;
109
109
  let error;
110
+ let isEvmRpcError = false;
110
111
  const fakeAddress = '5DRewsYzhJqZXU3SRaWy1FSt5iDr875ao91aw5fjrJmDG4Ap'; // todo: move this
111
112
  const substrateAddress = fakeAddress; // todo: move this
112
113
  const evmAddress = (0, _util.u8aToHex)((0, _utilCrypto.addressToEvm)(fakeAddress)); // todo: move this
@@ -131,6 +132,9 @@ const calculateTransferMaxTransferable = async (id, request, freeBalance, fee) =
131
132
  value,
132
133
  fallbackFee: true
133
134
  });
135
+ if (error) {
136
+ isEvmRpcError = true;
137
+ }
134
138
  } else {
135
139
  [transaction,, error] = await (0, _smartContract.getEVMTransactionObject)({
136
140
  chain: srcChain.slug,
@@ -144,6 +148,9 @@ const calculateTransferMaxTransferable = async (id, request, freeBalance, fee) =
144
148
  value,
145
149
  fallbackFee: true
146
150
  });
151
+ if (error) {
152
+ isEvmRpcError = true;
153
+ }
147
154
  }
148
155
  } else if ((0, _keyring.isTonAddress)(address) && (0, _utils2._isTokenTransferredByTon)(srcToken)) {
149
156
  [transaction] = await (0, _tonTransfer.createTonTransaction)({
@@ -318,7 +325,8 @@ const calculateTransferMaxTransferable = async (id, request, freeBalance, fee) =
318
325
  feeOptions: feeOptions,
319
326
  feeType: feeChainType,
320
327
  id: id,
321
- error
328
+ error,
329
+ isEvmRpcError: isEvmRpcError
322
330
  };
323
331
  };
324
332
  exports.calculateTransferMaxTransferable = calculateTransferMaxTransferable;
@@ -5,7 +5,7 @@ import { StakingType } from '@subwallet/extension-base/background/KoniTypes';
5
5
  import { getAstarWithdrawable } from '@subwallet/extension-base/koni/api/staking/bonding/astar';
6
6
  import { _KNOWN_CHAIN_INFLATION_PARAMS, _SUBSTRATE_DEFAULT_INFLATION_PARAMS } from '@subwallet/extension-base/services/chain-service/constants';
7
7
  import { _getChainNativeTokenBasicInfo } from '@subwallet/extension-base/services/chain-service/utils';
8
- import { _STAKING_CHAIN_GROUP } from '@subwallet/extension-base/services/earning-service/constants';
8
+ import { _STAKING_CHAIN_GROUP, RELAY_HANDLER_DIRECT_STAKING_CHAINS } from '@subwallet/extension-base/services/earning-service/constants';
9
9
  import { EarningStatus, UnstakingStatus, YieldPoolType } from '@subwallet/extension-base/types';
10
10
  import { detectTranslate, parseRawNumber, reformatAddress } from '@subwallet/extension-base/utils';
11
11
  import { balanceFormatter, formatNumber } from '@subwallet/extension-base/utils/number';
@@ -352,7 +352,7 @@ export function getEarningStatusByNominations(bnTotalActiveStake, nominationList
352
352
  export function getValidatorLabel(chain) {
353
353
  if (_STAKING_CHAIN_GROUP.astar.includes(chain)) {
354
354
  return 'dApp';
355
- } else if (_STAKING_CHAIN_GROUP.relay.includes(chain) || _STAKING_CHAIN_GROUP.bittensor.includes(chain)) {
355
+ } else if (RELAY_HANDLER_DIRECT_STAKING_CHAINS.includes(chain) || _STAKING_CHAIN_GROUP.bittensor.includes(chain)) {
356
356
  return 'Validator';
357
357
  }
358
358
  return 'Collator';
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "./cjs/detectPackage.js"
18
18
  ],
19
19
  "type": "module",
20
- "version": "1.3.60-1",
20
+ "version": "1.3.62-0",
21
21
  "main": "./cjs/index.js",
22
22
  "module": "./index.js",
23
23
  "types": "./index.d.ts",
@@ -1511,6 +1511,11 @@
1511
1511
  "require": "./cjs/services/migration-service/scripts/DeleteEarningData.js",
1512
1512
  "default": "./services/migration-service/scripts/DeleteEarningData.js"
1513
1513
  },
1514
+ "./services/migration-service/scripts/DeleteEarningData20251010": {
1515
+ "types": "./services/migration-service/scripts/DeleteEarningData20251010.d.ts",
1516
+ "require": "./cjs/services/migration-service/scripts/DeleteEarningData20251010.js",
1517
+ "default": "./services/migration-service/scripts/DeleteEarningData20251010.js"
1518
+ },
1514
1519
  "./services/migration-service/scripts/DisableZeroBalanceTokens": {
1515
1520
  "types": "./services/migration-service/scripts/DisableZeroBalanceTokens.d.ts",
1516
1521
  "require": "./cjs/services/migration-service/scripts/DisableZeroBalanceTokens.js",
@@ -2878,11 +2883,11 @@
2878
2883
  "@sora-substrate/type-definitions": "^1.17.7",
2879
2884
  "@substrate/connect": "^0.8.9",
2880
2885
  "@subwallet-monorepos/subwallet-services-sdk": "^0.1.8",
2881
- "@subwallet/chain-list": "0.2.117",
2882
- "@subwallet/extension-base": "^1.3.60-1",
2883
- "@subwallet/extension-chains": "^1.3.60-1",
2884
- "@subwallet/extension-dapp": "^1.3.60-1",
2885
- "@subwallet/extension-inject": "^1.3.60-1",
2886
+ "@subwallet/chain-list": "0.2.118",
2887
+ "@subwallet/extension-base": "^1.3.62-0",
2888
+ "@subwallet/extension-chains": "^1.3.62-0",
2889
+ "@subwallet/extension-dapp": "^1.3.62-0",
2890
+ "@subwallet/extension-inject": "^1.3.62-0",
2886
2891
  "@subwallet/keyring": "^0.1.13",
2887
2892
  "@subwallet/ui-keyring": "^0.1.13",
2888
2893
  "@ton/core": "^0.56.3",
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.3.60-1'
10
+ version: '1.3.62-0'
11
11
  };
@@ -30,7 +30,7 @@ export const _BALANCE_CHAIN_GROUP = {
30
30
  genshiro: ['genshiro_testnet', 'genshiro'],
31
31
  equilibrium_parachain: ['equilibrium_parachain'],
32
32
  bifrost: ['bifrost', 'acala', 'karura', 'acala_testnet', 'pioneer', 'bitcountry', 'bifrost_dot', 'hydradx_main', 'hydradx_rococo', 'pendulum', 'amplitude', 'continuum_network', 'truth_network', 'jamton', 'hydradx_hollarnet'],
33
- statemine: ['statemine', 'astar', 'shiden', 'statemint', 'crabParachain', 'darwinia2', 'parallel', 'calamari', 'manta_network', 'rococo_assethub', 'liberlandTest', 'liberland', 'dentnet', 'pangolin', 'crust', 'phala', 'shibuya', 'dbcchain', 'westend_assethub', 'chainflip_assethub', 'origintrail', 'xode'],
33
+ statemine: ['statemine', 'astar', 'shiden', 'statemint', 'crabParachain', 'darwinia2', 'parallel', 'calamari', 'manta_network', 'rococo_assethub', 'liberlandTest', 'liberland', 'dentnet', 'pangolin', 'crust', 'phala', 'shibuya', 'dbcchain', 'westend_assethub', 'chainflip_assethub', 'origintrail', 'xode', 'paseo_assethub'],
34
34
  kusama: ['kusama', 'kintsugi', 'kintsugi_test', 'interlay', 'acala', 'statemint', 'karura', 'bifrost'],
35
35
  // perhaps there are some runtime updates
36
36
  centrifuge: ['centrifuge'],
@@ -265,7 +265,7 @@ export const _TRANSFER_CHAIN_GROUP = {
265
265
  genshiro: ['genshiro_testnet', 'genshiro', 'equilibrium_parachain'],
266
266
  // crab: ['crab', 'pangolin'],
267
267
  bitcountry: ['pioneer', 'bitcountry'],
268
- statemine: ['statemint', 'statemine', 'darwinia2', 'astar', 'shiden', 'shibuya', 'parallel', 'liberland', 'liberlandTest', 'dentnet', 'dbcchain', 'westend_assethub', 'chainflip_assethub', 'origintrail', 'xode'],
268
+ statemine: ['statemint', 'statemine', 'darwinia2', 'astar', 'shiden', 'shibuya', 'parallel', 'liberland', 'liberlandTest', 'dentnet', 'dbcchain', 'westend_assethub', 'chainflip_assethub', 'origintrail', 'xode', 'paseo_assethub'],
269
269
  riochain: ['riochain'],
270
270
  sora_substrate: ['sora_substrate'],
271
271
  avail: ['kate', 'goldberg_testnet'],
@@ -1,5 +1,5 @@
1
1
  import { _ChainAsset, _ChainInfo, _MultiChainAsset } from '@subwallet/chain-list/types';
2
- export declare const ChainListVersion = "0.2.117";
2
+ export declare const ChainListVersion = "0.2.118";
3
3
  export interface PatchInfo {
4
4
  patchVersion: string;
5
5
  appliedVersion: string;
@@ -5,7 +5,7 @@ const PRODUCTION_BRANCHES = ['master', 'webapp', 'webapp-dev'];
5
5
  const branchName = process.env.BRANCH_NAME || 'subwallet-dev';
6
6
  const fetchDomain = process.env.PATCH_CHAIN_LIST_URL || (PRODUCTION_BRANCHES.indexOf(branchName) > -1 ? 'https://chain-list-assets.subwallet.app' : 'https://dev.sw-chain-list-assets.pages.dev');
7
7
  const fetchFile = PRODUCTION_BRANCHES.indexOf(branchName) > -1 ? 'list.json' : 'preview.json';
8
- export const ChainListVersion = '0.2.117'; // update this when build chain-list
8
+ export const ChainListVersion = '0.2.118'; // update this when build chain-list
9
9
 
10
10
  // todo: move this interface to chainlist
11
11
 
@@ -16,7 +16,7 @@ export async function fetchPatchData() {
16
16
  const id = setTimeout(() => {
17
17
  clearTimeout(id);
18
18
  resolve(null);
19
- }, 1000);
19
+ }, 2000);
20
20
  });
21
21
  const rs = await Promise.race([timeout, fetchPromise]);
22
22
  if (!rs) {
@@ -16,6 +16,7 @@ export declare const _STAKING_CHAIN_GROUP: {
16
16
  energy: string[];
17
17
  mythos: string[];
18
18
  };
19
+ export declare const RELAY_HANDLER_DIRECT_STAKING_CHAINS: string[];
19
20
  export declare const TON_CHAINS: string[];
20
21
  export declare const MaxEraRewardPointsEras = 14;
21
22
  export declare const ST_LIQUID_TOKEN_ABI: Record<string, any>;
@@ -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', 'avail_mainnet', 'vara_testnet', 'dentnet', 'cere', 'statemine', 'statemint', 'westend_assethub', 'zkverify', 'zkverify_testnet'],
6
- assetHub: ['statemine', 'statemint', 'westend_assethub'],
5
+ relay: ['polkadot', 'kusama', 'aleph', 'polkadex', 'ternoa', 'alephTest', 'polkadexTest', 'westend', 'kate', 'edgeware', 'creditcoin', 'vara_network', 'goldberg_testnet', 'availTuringTest', 'avail_mainnet', 'vara_testnet', 'dentnet', 'cere', 'zkverify', 'zkverify_testnet', 'paseoTest'],
6
+ assetHub: ['statemine', 'statemint', 'westend_assethub', 'paseo_assethub'],
7
7
  para: ['moonbeam', 'moonriver', 'moonbase', 'turing', 'turingStaging', 'bifrost', 'bifrost_testnet', 'calamari_test', 'calamari', 'manta_network', 'polimec'],
8
8
  astar: ['astar', 'shiden', 'shibuya'],
9
9
  amplitude: ['amplitude', 'amplitude_test', 'pendulum', 'krest_network'],
10
10
  // amplitude and kilt only share some common logic
11
- nominationPool: ['polkadot', 'kusama', 'westend', 'alephTest', 'aleph', 'kate', 'vara_network', 'goldberg_testnet', 'availTuringTest', 'avail_mainnet', 'vara_testnet', 'cere', 'analog_timechain'],
11
+ nominationPool: ['polkadot', 'kusama', 'westend', 'alephTest', 'aleph', 'kate', 'vara_network', 'goldberg_testnet', 'availTuringTest', 'avail_mainnet', 'vara_testnet', 'cere', 'analog_timechain', 'paseoTest'],
12
12
  bifrost: ['bifrost', 'bifrost_testnet'],
13
13
  aleph: ['aleph', 'alephTest'],
14
14
  // A0 has distinct tokenomics
@@ -21,6 +21,7 @@ export const _STAKING_CHAIN_GROUP = {
21
21
  energy: ['energy_web_x_testnet', 'energy_web_x'],
22
22
  mythos: ['mythos', 'muse_testnet']
23
23
  };
24
+ export const RELAY_HANDLER_DIRECT_STAKING_CHAINS = [..._STAKING_CHAIN_GROUP.relay, ..._STAKING_CHAIN_GROUP.assetHub];
24
25
  export const TON_CHAINS = ['ton', 'ton_testnet'];
25
26
  export const MaxEraRewardPointsEras = 14;
26
27
 
@@ -30,6 +31,8 @@ export const MANTA_VALIDATOR_POINTS_PER_BLOCK = 20;
30
31
  export const MANTA_MIN_DELEGATION = 500;
31
32
  export const CHANNEL_ID = 7;
32
33
  export const STAKING_IDENTITY_API_SLUG = {
34
+ // @TODO: Remove polkadot then migrate
33
35
  polkadot: 'polkadot_people',
34
- kusama: 'peopleKusama'
36
+ statemine: 'peopleKusama',
37
+ statemint: 'polkadot_people'
35
38
  };
@@ -56,24 +56,29 @@ export default class EarningService {
56
56
  }
57
57
  }
58
58
  const minAmountPercent = {};
59
- const ahMapChain = await this.state.chainService.fetchAhMapChain();
59
+ const ahMigratedChainMap = await this.state.chainService.fetchAhMapChain();
60
+ const ahMigratedChains = Object.values(ahMigratedChainMap);
60
61
  for (const chain of chains) {
61
62
  const handlers = [];
62
63
  const chainInfo = this.state.getChainInfo(chain);
63
64
  const symbol = _getChainSubstrateTokenSymbol(chainInfo);
64
65
  if (_STAKING_CHAIN_GROUP.relay.includes(chain)) {
65
- if (_STAKING_CHAIN_GROUP.assetHub.includes(chain)) {
66
- continue;
67
- }
68
- const ahChain = ahMapChain[chain];
69
- if (ahChain) {
70
- handlers.push(new RelayNativeStakingPoolHandler(this.state, ahChain));
66
+ const ahMigratedChain = ahMigratedChainMap[chain];
67
+ if (ahMigratedChain) {
71
68
  const relaySlug = RelayNativeStakingPoolHandler.generateSlug(symbol, chain);
72
69
  this.inactivePoolSlug.add(relaySlug);
73
70
  } else {
74
71
  handlers.push(new RelayNativeStakingPoolHandler(this.state, chain));
75
72
  }
76
73
  }
74
+ if (_STAKING_CHAIN_GROUP.assetHub.includes(chain)) {
75
+ // define list of migrating asset hub
76
+ if (ahMigratedChains.includes(chain)) {
77
+ // check if chain migrate with online data
78
+ handlers.push(new RelayNativeStakingPoolHandler(this.state, chain));
79
+ handlers.push(new NominationPoolHandler(this.state, chain));
80
+ }
81
+ }
77
82
  if (_STAKING_CHAIN_GROUP.para.includes(chain)) {
78
83
  handlers.push(new ParaNativeStakingPoolHandler(this.state, chain));
79
84
  }
@@ -96,9 +101,8 @@ export default class EarningService {
96
101
  handlers.push(new EnergyNativeStakingPoolHandler(this.state, chain));
97
102
  }
98
103
  if (_STAKING_CHAIN_GROUP.nominationPool.includes(chain)) {
99
- const ahChain = ahMapChain[chain];
100
- if (ahChain) {
101
- handlers.push(new NominationPoolHandler(this.state, ahChain));
104
+ const ahMigratedChain = ahMigratedChainMap[chain];
105
+ if (ahMigratedChain) {
102
106
  const relaySlug = NominationPoolHandler.generateSlug(symbol, chain);
103
107
  this.inactivePoolSlug.add(relaySlug);
104
108
  } else {
@@ -22,7 +22,18 @@ export async function getAssetHubTokensCanPayFee(request) {
22
22
 
23
23
  // ensure nativeTokenInfo and localTokenInfo have multi-location metadata beforehand to improve performance.
24
24
  const tokensHasBalanceSlug = Object.keys(tokensHasBalanceInfoMap);
25
- const tokenInfos = tokensHasBalanceSlug.map(tokenSlug => chainService.getAssetBySlug(tokenSlug)).filter(token => token.originChain === substrateApi.chainSlug && token.assetType !== _AssetType.NATIVE && token.metadata && token.metadata.multilocation);
25
+ const tokenInfos = tokensHasBalanceSlug.map(tokenSlug => {
26
+ const token = chainService.getAssetBySlug(tokenSlug);
27
+ if (!token) {
28
+ console.error(`[getAssetHubTokensCanPayFee] Token not found for slug: ${tokenSlug}`);
29
+ }
30
+ return token;
31
+ }).filter(token => {
32
+ if (!token) {
33
+ return false;
34
+ }
35
+ return token.originChain === substrateApi.chainSlug && token.assetType !== _AssetType.NATIVE && token.metadata && token.metadata.multilocation;
36
+ });
26
37
  await Promise.all(tokenInfos.map(async tokenInfo => {
27
38
  try {
28
39
  const tokenSlug = tokenInfo.slug;
@@ -70,7 +81,19 @@ export async function getHydrationTokensCanPayFee(request) {
70
81
  if (!nativePriceId) {
71
82
  return tokensList;
72
83
  }
73
- const tokenInfos = Object.keys(tokensHasBalanceInfoMap).map(tokenSlug => chainService.getAssetBySlug(tokenSlug)).filter(token => token.originChain === substrateApi.chainSlug && token.assetType !== _AssetType.NATIVE && !!token.metadata && !!token.metadata.assetId);
84
+ const tokenInfos = Object.keys(tokensHasBalanceInfoMap).map(tokenSlug => {
85
+ const token = chainService.getAssetBySlug(tokenSlug);
86
+ if (!token) {
87
+ console.error(`[getHydrationTokensCanPayFee] Token not found for slug: ${tokenSlug}`);
88
+ }
89
+ return token;
90
+ }).filter(token => {
91
+ var _token$metadata;
92
+ if (!token) {
93
+ return false;
94
+ }
95
+ return token.originChain === substrateApi.chainSlug && token.assetType !== _AssetType.NATIVE && !!((_token$metadata = token.metadata) !== null && _token$metadata !== void 0 && _token$metadata.assetId);
96
+ });
74
97
  await Promise.all(tokenInfos.map(async tokenInfo => {
75
98
  const priceId = _getAssetPriceId(tokenInfo);
76
99
  const rate = await getHydrationRate(address, nativeTokenInfo, tokenInfo);
@@ -0,0 +1,4 @@
1
+ import BaseMigrationJob from '@subwallet/extension-base/services/migration-service/Base';
2
+ export default class DeleteEarningData20251010 extends BaseMigrationJob {
3
+ run(): Promise<void>;
4
+ }
@@ -0,0 +1,13 @@
1
+ // Copyright 2019-2022 @subwallet/extension-koni authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import BaseMigrationJob from '@subwallet/extension-base/services/migration-service/Base';
5
+ export default class DeleteEarningData20251010 extends BaseMigrationJob {
6
+ async run() {
7
+ try {
8
+ await this.state.dbService.deleteYieldPoolInfo(['KSM___native_staking___kusama', 'KSM___nomination_pool___kusama']);
9
+ } catch (e) {
10
+ console.error(e);
11
+ }
12
+ }
13
+ }
@@ -18,6 +18,7 @@ import MigratePolygonUSDCProvider from "./tokens/MigratePolygonUSDCProvider.js";
18
18
  import DeleteChain from "./DeleteChain.js";
19
19
  import DeleteChainStaking from "./DeleteChainStaking.js";
20
20
  import DeleteEarningData from "./DeleteEarningData.js";
21
+ import DeleteEarningData20251010 from "./DeleteEarningData20251010.js";
21
22
  import DisableZeroBalanceTokens from "./DisableZeroBalanceTokens.js";
22
23
  import EnableVaraChain from "./EnableVaraChain.js";
23
24
  import MigrateAuthUrls from "./MigrateAuthUrls.js";
@@ -67,5 +68,6 @@ export default {
67
68
  // [`${EVERYTIME}-1.1.42-02`]: MigrateTransactionHistoryBySymbol
68
69
  // [`${EVERYTIME}-1`]: AutoEnableChainsTokens
69
70
  '1.3.42-01': MigrateNewUnifiedAccount,
70
- '1.3.54-01': MigrateChainPatrol
71
+ '1.3.54-01': MigrateChainPatrol,
72
+ '1.3.62-01': DeleteEarningData20251010
71
73
  };
@@ -17,6 +17,7 @@ export interface ResponseSubscribeTransfer {
17
17
  feeType: FeeChainType;
18
18
  feePercentageSpecialCase?: number;
19
19
  error?: string;
20
+ isEvmRpcError?: boolean;
20
21
  }
21
22
  export interface RequestSubmitTransferWithId extends RequestSubmitTransfer {
22
23
  id?: string;
@@ -96,6 +96,7 @@ export const calculateTransferMaxTransferable = async (id, request, freeBalance,
96
96
  let feeOptions;
97
97
  let maxTransferable;
98
98
  let error;
99
+ let isEvmRpcError = false;
99
100
  const fakeAddress = '5DRewsYzhJqZXU3SRaWy1FSt5iDr875ao91aw5fjrJmDG4Ap'; // todo: move this
100
101
  const substrateAddress = fakeAddress; // todo: move this
101
102
  const evmAddress = u8aToHex(addressToEvm(fakeAddress)); // todo: move this
@@ -120,6 +121,9 @@ export const calculateTransferMaxTransferable = async (id, request, freeBalance,
120
121
  value,
121
122
  fallbackFee: true
122
123
  });
124
+ if (error) {
125
+ isEvmRpcError = true;
126
+ }
123
127
  } else {
124
128
  [transaction,, error] = await getEVMTransactionObject({
125
129
  chain: srcChain.slug,
@@ -133,6 +137,9 @@ export const calculateTransferMaxTransferable = async (id, request, freeBalance,
133
137
  value,
134
138
  fallbackFee: true
135
139
  });
140
+ if (error) {
141
+ isEvmRpcError = true;
142
+ }
136
143
  }
137
144
  } else if (isTonAddress(address) && _isTokenTransferredByTon(srcToken)) {
138
145
  [transaction] = await createTonTransaction({
@@ -307,7 +314,8 @@ export const calculateTransferMaxTransferable = async (id, request, freeBalance,
307
314
  feeOptions: feeOptions,
308
315
  feeType: feeChainType,
309
316
  id: id,
310
- error
317
+ error,
318
+ isEvmRpcError: isEvmRpcError
311
319
  };
312
320
  };
313
321
  export const calculateXcmMaxTransferable = async (id, request, freeBalance, fee) => {
@@ -1 +1,6 @@
1
- {}
1
+ {
2
+ "westend": "westend_assethub",
3
+ "paseoTest": "paseo_assethub",
4
+ "kusama": "statemine",
5
+ "polkadot": "statemint"
6
+ }