@subwallet/extension-base 1.2.24-0 → 1.2.24-2

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.
Files changed (61) hide show
  1. package/cjs/core/substrate/assets-pallet.js +35 -0
  2. package/cjs/core/substrate/foreign-asset-pallet.js +13 -3
  3. package/cjs/core/substrate/nominationpools-pallet.js +4 -6
  4. package/cjs/core/substrate/ormlTokens-pallet.js +24 -0
  5. package/cjs/core/substrate/system-pallet.js +18 -18
  6. package/cjs/core/substrate/tokens-pallet.js +24 -0
  7. package/cjs/core/substrate/types.js +19 -0
  8. package/cjs/core/substrate/xcm-parser.js +16 -2
  9. package/cjs/core/utils.js +25 -0
  10. package/cjs/koni/background/handlers/Extension.js +1 -1
  11. package/cjs/packageInfo.js +1 -1
  12. package/cjs/services/balance-service/helpers/subscribe/substrate/equilibrium.js +2 -2
  13. package/cjs/services/balance-service/helpers/subscribe/substrate/index.js +120 -133
  14. package/cjs/services/balance-service/transfer/xcm/index.js +2 -1
  15. package/cjs/services/balance-service/transfer/xcm/polkadotXcm.js +1 -1
  16. package/cjs/services/balance-service/transfer/xcm/utils.js +3 -2
  17. package/cjs/services/chain-service/constants.js +1 -1
  18. package/cjs/services/chain-service/handler/SubstrateApi.js +128 -34
  19. package/cjs/services/chain-service/handler/SubstrateChainHandler.js +26 -9
  20. package/cjs/services/chain-service/utils/index.js +5 -0
  21. package/core/substrate/assets-pallet.d.ts +4 -0
  22. package/core/substrate/assets-pallet.js +28 -0
  23. package/core/substrate/foreign-asset-pallet.d.ts +4 -8
  24. package/core/substrate/foreign-asset-pallet.js +13 -3
  25. package/core/substrate/nominationpools-pallet.d.ts +4 -10
  26. package/core/substrate/nominationpools-pallet.js +4 -5
  27. package/core/substrate/ormlTokens-pallet.d.ts +4 -0
  28. package/core/substrate/ormlTokens-pallet.js +17 -0
  29. package/core/substrate/system-pallet.d.ts +4 -24
  30. package/core/substrate/system-pallet.js +18 -21
  31. package/core/substrate/tokens-pallet.d.ts +5 -0
  32. package/core/substrate/tokens-pallet.js +16 -0
  33. package/core/substrate/types.d.ts +43 -0
  34. package/core/substrate/types.js +12 -0
  35. package/core/substrate/xcm-parser.d.ts +1 -0
  36. package/core/substrate/xcm-parser.js +15 -2
  37. package/core/utils.d.ts +4 -0
  38. package/core/utils.js +17 -0
  39. package/koni/api/staking/bonding/relayChain.d.ts +1 -1
  40. package/koni/background/handlers/Extension.js +1 -1
  41. package/koni/background/handlers/State.d.ts +2 -2
  42. package/package.json +31 -6
  43. package/packageInfo.js +1 -1
  44. package/services/balance-service/helpers/subscribe/substrate/equilibrium.js +2 -2
  45. package/services/balance-service/helpers/subscribe/substrate/index.js +109 -121
  46. package/services/balance-service/transfer/xcm/index.d.ts +1 -1
  47. package/services/balance-service/transfer/xcm/index.js +2 -1
  48. package/services/balance-service/transfer/xcm/polkadotXcm.js +1 -1
  49. package/services/balance-service/transfer/xcm/utils.d.ts +1 -1
  50. package/services/balance-service/transfer/xcm/utils.js +3 -2
  51. package/services/chain-service/constants.js +1 -1
  52. package/services/chain-service/handler/SubstrateApi.d.ts +5 -7
  53. package/services/chain-service/handler/SubstrateApi.js +128 -35
  54. package/services/chain-service/handler/SubstrateChainHandler.d.ts +5 -6
  55. package/services/chain-service/handler/SubstrateChainHandler.js +26 -9
  56. package/services/chain-service/index.d.ts +3 -3
  57. package/services/chain-service/types.d.ts +22 -5
  58. package/services/chain-service/utils/index.d.ts +1 -0
  59. package/services/chain-service/utils/index.js +3 -0
  60. package/services/earning-service/handlers/nomination-pool/index.d.ts +1 -1
  61. package/types/balance/index.d.ts +2 -3
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports._getAssetsPalletLockedBalance = _getAssetsPalletLockedBalance;
7
+ exports._getAssetsPalletTransferable = _getAssetsPalletTransferable;
8
+ var _types = require("@subwallet/extension-base/core/substrate/types");
9
+ var _utils = require("@subwallet/extension-base/core/utils");
10
+ // Copyright 2019-2022 @subwallet/extension-base
11
+ // SPDX-License-Identifier: Apache-2.0
12
+
13
+ function _getAssetsPalletTransferable(accountInfo, existentialDeposit, extrinsicType) {
14
+ const strictMode = (0, _utils.getStrictMode)(_types.BalanceAccountType.PalletAssetsAssetAccount, extrinsicType);
15
+ const bnAppliedExistentialDeposit = (0, _utils._getAppliedExistentialDeposit)(existentialDeposit, strictMode);
16
+ let bnTransferable = BigInt(0);
17
+ if (!accountInfo) {
18
+ return BigInt(0);
19
+ }
20
+ if (['Liquid'].includes(accountInfo.status)) {
21
+ bnTransferable = BigInt(accountInfo.balance) - bnAppliedExistentialDeposit;
22
+ }
23
+ return bnTransferable;
24
+ }
25
+ function _getAssetsPalletLockedBalance(accountInfo) {
26
+ let bnLocked = BigInt(0);
27
+ if (!accountInfo) {
28
+ return bnLocked;
29
+ }
30
+ if (!['Liquid'].includes(accountInfo.status)) {
31
+ // todo: check case accountInfo has isFrozen?
32
+ bnLocked = BigInt(accountInfo.balance);
33
+ }
34
+ return bnLocked;
35
+ }
@@ -5,12 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports._getForeignAssetPalletLockedBalance = _getForeignAssetPalletLockedBalance;
7
7
  exports._getForeignAssetPalletTransferable = _getForeignAssetPalletTransferable;
8
+ var _types = require("@subwallet/extension-base/core/substrate/types");
9
+ var _utils = require("@subwallet/extension-base/core/utils");
8
10
  // Copyright 2019-2022 @subwallet/extension-base
9
11
  // SPDX-License-Identifier: Apache-2.0
10
12
 
11
- function _getForeignAssetPalletTransferable(accountInfo) {
12
- return accountInfo.status !== 'Liquid' ? BigInt(0) : BigInt(accountInfo.balance);
13
+ function _getForeignAssetPalletTransferable(accountInfo, existentialDeposit, extrinsicType) {
14
+ const strictMode = (0, _utils.getStrictMode)(_types.BalanceAccountType.PalletAssetsAssetAccount, extrinsicType);
15
+ if (!accountInfo || accountInfo.status !== 'Liquid') {
16
+ return BigInt(0);
17
+ }
18
+ const bnAppliedExistentialDeposit = (0, _utils._getAppliedExistentialDeposit)(existentialDeposit, strictMode);
19
+ return BigInt(accountInfo.balance) - bnAppliedExistentialDeposit;
13
20
  }
14
21
  function _getForeignAssetPalletLockedBalance(accountInfo) {
15
- return accountInfo.status === 'Liquid' ? BigInt(0) : BigInt(accountInfo.balance);
22
+ if (!accountInfo || accountInfo.status === 'Liquid') {
23
+ return BigInt(0);
24
+ }
25
+ return BigInt(accountInfo.balance);
16
26
  }
@@ -1,23 +1,21 @@
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
  });
7
6
  exports._getActiveStakeInNominationPool = _getActiveStakeInNominationPool;
8
7
  exports._getTotalStakeInNominationPool = _getTotalStakeInNominationPool;
9
8
  exports._getUnbondingStakeInNominationPool = _getUnbondingStakeInNominationPool;
10
- var _bignumber = _interopRequireDefault(require("bignumber.js"));
11
9
  // Copyright 2019-2022 @subwallet/extension-base
12
10
  // SPDX-License-Identifier: Apache-2.0
13
11
 
14
12
  function _getActiveStakeInNominationPool(memberInfo) {
15
- return new _bignumber.default(memberInfo.points.toString());
13
+ return BigInt(memberInfo.points);
16
14
  }
17
15
  function _getUnbondingStakeInNominationPool(memberInfo) {
18
- const unbondingValues = Object.values(memberInfo.unbondingEras).map(unbonding => new _bignumber.default(unbonding));
19
- return new _bignumber.default(Object.values(unbondingValues).reduce((a, b) => a.plus(b), new _bignumber.default(0)));
16
+ const unbondingValues = Object.values(memberInfo.unbondingEras).map(unbonding => BigInt(unbonding));
17
+ return unbondingValues.reduce((a, b) => a + b, BigInt(0));
20
18
  }
21
19
  function _getTotalStakeInNominationPool(memberInfo) {
22
- return _getActiveStakeInNominationPool(memberInfo).plus(_getUnbondingStakeInNominationPool(memberInfo));
20
+ return _getActiveStakeInNominationPool(memberInfo) + _getUnbondingStakeInNominationPool(memberInfo);
23
21
  }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports._getOrmlTokensPalletLockedBalance = _getOrmlTokensPalletLockedBalance;
7
+ exports._getOrmlTokensPalletTransferable = _getOrmlTokensPalletTransferable;
8
+ var _types = require("@subwallet/extension-base/core/substrate/types");
9
+ var _utils = require("@subwallet/extension-base/core/utils");
10
+ // Copyright 2019-2022 @subwallet/extension-base
11
+ // SPDX-License-Identifier: Apache-2.0
12
+
13
+ function _getOrmlTokensPalletTransferable(accountInfo, existentialDeposit, extrinsicType) {
14
+ const strictMode = (0, _utils.getStrictMode)(_types.BalanceAccountType.OrmlTokensAccountData, extrinsicType);
15
+ const bnAppliedExistentialDeposit = (0, _utils._getAppliedExistentialDeposit)(existentialDeposit, strictMode);
16
+ const bnFrozen = BigInt(accountInfo.frozen);
17
+ const bnFree = BigInt(accountInfo.free);
18
+ return bnFree - (0, _utils.getMaxBigInt)(bnFrozen, bnAppliedExistentialDeposit);
19
+ }
20
+ function _getOrmlTokensPalletLockedBalance(accountInfo) {
21
+ const bnFrozen = BigInt(accountInfo.frozen);
22
+ const bnReserved = BigInt(accountInfo.reserved);
23
+ return bnReserved + bnFrozen;
24
+ }
@@ -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
  });
@@ -9,8 +8,8 @@ exports._getAppliedExistentialDepositWithExtrinsicType = _getAppliedExistentialD
9
8
  exports._getSystemPalletTotalBalance = _getSystemPalletTotalBalance;
10
9
  exports._getSystemPalletTransferable = _getSystemPalletTransferable;
11
10
  exports._isAccountActive = _isAccountActive;
12
- var _KoniTypes = require("@subwallet/extension-base/background/KoniTypes");
13
- var _bignumber = _interopRequireDefault(require("bignumber.js"));
11
+ var _types = require("@subwallet/extension-base/core/substrate/types");
12
+ var _utils = require("@subwallet/extension-base/core/utils");
14
13
  // Copyright 2019-2022 @subwallet/extension-base
15
14
  // SPDX-License-Identifier: Apache-2.0
16
15
 
@@ -18,7 +17,7 @@ function isV1(accountInfo) {
18
17
  return accountInfo.data.miscFrozen !== undefined && accountInfo.data.feeFrozen !== undefined;
19
18
  }
20
19
  function _getSystemPalletTransferable(accountInfo, existentialDeposit, extrinsicType) {
21
- const strictMode = !extrinsicType || ![_KoniTypes.ExtrinsicType.TRANSFER_BALANCE].includes(extrinsicType); // always apply strict mode to keep account alive unless explicitly specified otherwise
20
+ const strictMode = (0, _utils.getStrictMode)(_types.BalanceAccountType.FrameSystemAccountInfo, extrinsicType); // always apply strict mode to keep account alive unless explicitly specified otherwise
22
21
 
23
22
  if (isV1(accountInfo)) {
24
23
  return _getSystemPalletTransferableV1(accountInfo, existentialDeposit, strictMode);
@@ -41,7 +40,7 @@ function _getSystemPalletTotalBalance(accountInfo) {
41
40
  }
42
41
  }
43
42
  function _getAppliedExistentialDepositWithExtrinsicType(accountInfo, existentialDeposit, extrinsicType) {
44
- const strictMode = !extrinsicType || ![_KoniTypes.ExtrinsicType.TRANSFER_BALANCE].includes(extrinsicType); // always apply strict mode to keep account alive unless explicitly specified otherwise
43
+ const strictMode = (0, _utils.getStrictMode)(_types.BalanceAccountType.FrameSystemAccountInfo, extrinsicType); // always apply strict mode to keep account alive unless explicitly specified otherwise
45
44
 
46
45
  return _getAppliedExistentialDeposit(accountInfo, existentialDeposit, strictMode);
47
46
  }
@@ -49,29 +48,30 @@ function _getAppliedExistentialDepositWithExtrinsicType(accountInfo, existential
49
48
  // ----------------------------------------------------------------------
50
49
 
51
50
  function _getAppliedExistentialDeposit(accountInfo, existentialDeposit, strictMode) {
51
+ const bnExistentialDeposit = BigInt(existentialDeposit);
52
+
52
53
  // strict mode will always apply existential deposit to keep account alive
53
54
  if (strictMode) {
54
- return existentialDeposit;
55
+ return bnExistentialDeposit;
55
56
  }
56
- return _canAccountBeReaped(accountInfo) ? '0' : existentialDeposit; // account for ED here will go better with max transfer logic
57
+ return _canAccountBeReaped(accountInfo) ? BigInt(0) : bnExistentialDeposit; // account for ED here will go better with max transfer logic
57
58
  }
58
59
 
59
60
  function _getSystemPalletTransferableV2(accountInfo, existentialDeposit, strictMode) {
60
- const bnFree = new _bignumber.default(accountInfo.data.free);
61
- const bnLocked = new _bignumber.default(accountInfo.data.frozen).minus(accountInfo.data.reserved); // locked can go below 0 but this shouldn't matter
62
- const bnAppliedExistentialDeposit = new _bignumber.default(_getAppliedExistentialDeposit(accountInfo, existentialDeposit, strictMode));
63
- const bnTransferableBalance = bnFree.minus(_bignumber.default.max(bnLocked, bnAppliedExistentialDeposit));
64
- return _bignumber.default.max(bnTransferableBalance, 0).toFixed();
61
+ const bnLocked = BigInt(accountInfo.data.frozen) - BigInt(accountInfo.data.reserved); // locked can go below 0 but this shouldn't matter
62
+ const bnAppliedExistentialDeposit = _getAppliedExistentialDeposit(accountInfo, existentialDeposit, strictMode);
63
+ const bnTransferable = BigInt(accountInfo.data.free) - (0, _utils.getMaxBigInt)(bnLocked, bnAppliedExistentialDeposit);
64
+ return (0, _utils.getMaxBigInt)(bnTransferable, BigInt(0));
65
65
  }
66
66
  function _getSystemPalletTotalBalanceV2(accountInfo) {
67
- return new _bignumber.default(accountInfo.data.free).plus(accountInfo.data.reserved).toFixed();
67
+ return BigInt(accountInfo.data.free) + BigInt(accountInfo.data.reserved);
68
68
  }
69
69
  function _getSystemPalletTransferableV1(accountInfo, existentialDeposit, strictMode) {
70
- const bnAppliedExistentialDeposit = new _bignumber.default(_getAppliedExistentialDeposit(accountInfo, existentialDeposit, strictMode));
71
- const bnAppliedFrozen = _bignumber.default.max(accountInfo.data.feeFrozen, accountInfo.data.miscFrozen);
72
- const bnTransferableBalance = new _bignumber.default(accountInfo.data.free).minus(_bignumber.default.max(bnAppliedFrozen, bnAppliedExistentialDeposit));
73
- return _bignumber.default.max(bnTransferableBalance, 0).toFixed();
70
+ const bnAppliedExistentialDeposit = BigInt(_getAppliedExistentialDeposit(accountInfo, existentialDeposit, strictMode));
71
+ const bnAppliedFrozen = (0, _utils.getMaxBigInt)(BigInt(accountInfo.data.feeFrozen), BigInt(accountInfo.data.miscFrozen));
72
+ const bnTransferable = BigInt(accountInfo.data.free) - (0, _utils.getMaxBigInt)(bnAppliedFrozen, bnAppliedExistentialDeposit);
73
+ return (0, _utils.getMaxBigInt)(bnTransferable, BigInt(0));
74
74
  }
75
75
  function _getSystemPalletTotalBalanceV1(accountInfo) {
76
- return new _bignumber.default(accountInfo.data.free).plus(accountInfo.data.reserved).toFixed();
76
+ return BigInt(accountInfo.data.free) + BigInt(accountInfo.data.reserved);
77
77
  }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports._getTokensPalletLocked = _getTokensPalletLocked;
7
+ exports._getTokensPalletTotalBalance = _getTokensPalletTotalBalance;
8
+ exports._getTokensPalletTransferable = _getTokensPalletTransferable;
9
+ var _types = require("@subwallet/extension-base/core/substrate/types");
10
+ var _utils = require("@subwallet/extension-base/core/utils");
11
+ // Copyright 2019-2022 @subwallet/extension-base
12
+ // SPDX-License-Identifier: Apache-2.0
13
+
14
+ function _getTokensPalletTransferable(accountInfo, existentialDeposit, extrinsicType) {
15
+ const strictMode = (0, _utils.getStrictMode)(_types.BalanceAccountType.OrmlTokensAccountData, extrinsicType);
16
+ const bnAppliedExistentialDeposit = (0, _utils._getAppliedExistentialDeposit)(existentialDeposit, strictMode);
17
+ return BigInt(accountInfo.free) - (0, _utils.getMaxBigInt)(BigInt(accountInfo.frozen), bnAppliedExistentialDeposit);
18
+ }
19
+ function _getTokensPalletLocked(accountInfo) {
20
+ return BigInt(accountInfo.reserved) + BigInt(accountInfo.frozen);
21
+ }
22
+ function _getTokensPalletTotalBalance(accountInfo) {
23
+ return BigInt(accountInfo.free) + BigInt(accountInfo.reserved);
24
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BalanceAccountType = void 0;
7
+ // Copyright 2019-2022 @subwallet/extension-base
8
+ // SPDX-License-Identifier: Apache-2.0
9
+
10
+ // https://crates.parity.io/frame_system/struct.AccountInfo.html
11
+ // https://wiki.polkadot.network/docs/learn-account-balances
12
+
13
+ // export type BalanceAccountType = 'FrameSystemAccountInfo' | 'OrmlTokensAccountData' | 'PalletAssetsAssetAccount' | 'PalletNominationPoolsPoolMember';
14
+ const BalanceAccountType = {
15
+ FrameSystemAccountInfo: 'FrameSystemAccountInfo',
16
+ OrmlTokensAccountData: 'OrmlTokensAccountData',
17
+ PalletAssetsAssetAccount: 'PalletAssetsAssetAccount'
18
+ };
19
+ exports.BalanceAccountType = BalanceAccountType;
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports._adaptX1Interior = _adaptX1Interior;
6
7
  exports._getXcmBeneficiary = _getXcmBeneficiary;
7
8
  exports._getXcmDestWeight = _getXcmDestWeight;
8
9
  exports._getXcmMultiAssets = _getXcmMultiAssets;
@@ -204,15 +205,28 @@ function _getRecipientLocation(destChainInfo, recipient, version) {
204
205
  };
205
206
  }
206
207
  function _getAssetIdentifier(tokenInfo, version) {
207
- const assetIdentifier = (0, _utils._getXcmAssetMultilocation)(tokenInfo);
208
- if (!assetIdentifier) {
208
+ const _assetIdentifier = (0, _utils._getXcmAssetMultilocation)(tokenInfo);
209
+ if (!_assetIdentifier) {
209
210
  throw new Error('Asset must have multilocation');
210
211
  }
212
+ const assetIdentifier = _adaptX1Interior(structuredClone(_assetIdentifier), version);
211
213
  return version >= 4 // from V4, Concrete is removed
212
214
  ? assetIdentifier : {
213
215
  Concrete: assetIdentifier
214
216
  };
215
217
  }
218
+ function _adaptX1Interior(assetIdentifier, version) {
219
+ const interior = assetIdentifier.interior;
220
+ const isInteriorObj = typeof interior === 'object' && interior !== null;
221
+ const isX1 = isInteriorObj && 'X1' in interior;
222
+ const needModifyX1 = version <= 4 && Array.isArray(interior.X1);
223
+ if (isInteriorObj && isX1 && needModifyX1) {
224
+ // X1 is an object for version < 4. From V4, it's an array
225
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access
226
+ interior.X1 = interior.X1[0];
227
+ }
228
+ return assetIdentifier;
229
+ }
216
230
  function _getNetworkByVersion(version) {
217
231
  switch (version) {
218
232
  case 1:
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports._getAppliedExistentialDeposit = _getAppliedExistentialDeposit;
7
+ exports.getMaxBigInt = getMaxBigInt;
8
+ exports.getStrictMode = getStrictMode;
9
+ var _KoniTypes = require("@subwallet/extension-base/background/KoniTypes");
10
+ var _types = require("@subwallet/extension-base/core/substrate/types");
11
+ // Copyright 2019-2022 @subwallet/extension-base
12
+ // SPDX-License-Identifier: Apache-2.0
13
+
14
+ function getStrictMode(type, extrinsicType) {
15
+ if (type === _types.BalanceAccountType.FrameSystemAccountInfo) {
16
+ return !extrinsicType || ![_KoniTypes.ExtrinsicType.TRANSFER_BALANCE].includes(extrinsicType);
17
+ }
18
+ return false;
19
+ }
20
+ function _getAppliedExistentialDeposit(existentialDeposit, strictMode) {
21
+ return strictMode ? BigInt(existentialDeposit) : BigInt(0);
22
+ }
23
+ function getMaxBigInt(a, b) {
24
+ return a > b ? a : b;
25
+ }
@@ -2001,7 +2001,7 @@ class KoniExtension {
2001
2001
  if (destinationTokenInfo) {
2002
2002
  const [bnMockFee, {
2003
2003
  value
2004
- }] = await Promise.all([(0, _xcm.getXcmMockTxFee)(substrateApi, chainInfoMap, address, originTokenInfo, destinationTokenInfo), this.getAddressTransferableBalance({
2004
+ }] = await Promise.all([(0, _xcm.getXcmMockTxFee)(substrateApi, chainInfoMap, originTokenInfo, destinationTokenInfo), this.getAddressTransferableBalance({
2005
2005
  extrinsicType: _KoniTypes.ExtrinsicType.TRANSFER_XCM,
2006
2006
  address,
2007
2007
  networkKey: originTokenInfo.originChain,
@@ -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.2.24-0'
16
+ version: '1.2.24-2'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
@@ -27,7 +27,7 @@ const subscribeEquilibriumTokenBalance = async _ref => {
27
27
  const tokenTypes = includeNativeToken ? [_types._AssetType.NATIVE, _types._AssetType.LOCAL] : [_types._AssetType.LOCAL];
28
28
  const tokenMap = (0, _utils2.filterAssetsByChainAndType)(assetMap, chain, tokenTypes);
29
29
  try {
30
- const unsub = await substrateApi.query.system.account.multi(addresses, balances => {
30
+ const unsub = await substrateApi.api.query.system.account.multi(addresses, balances => {
31
31
  // Equilibrium customizes the SystemAccount pallet
32
32
  Object.values(tokenMap).forEach(tokenInfo => {
33
33
  const assetId = (0, _utils._getTokenOnChainAssetId)(tokenInfo);
@@ -91,7 +91,7 @@ const subscribeEqBalanceAccountPallet = async _ref2 => {
91
91
  const unsubList = Object.values(tokenMap).map(async tokenInfo => {
92
92
  try {
93
93
  const assetId = (0, _utils._getTokenOnChainAssetId)(tokenInfo);
94
- const unsub = await substrateApi.query.eqBalances.account.multi(addresses.map(address => [address, [assetId]]), balances => {
94
+ const unsub = await substrateApi.api.query.eqBalances.account.multi(addresses.map(address => [address, [assetId]]), balances => {
95
95
  const items = balances.map((balance, index) => {
96
96
  return {
97
97
  address: addresses[index],