@subwallet/extension-base 1.3.52-0 → 1.3.54-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.
Files changed (59) hide show
  1. package/background/KoniTypes.d.ts +10 -3
  2. package/cjs/koni/background/handlers/Extension.js +4 -4
  3. package/cjs/koni/background/handlers/State.js +1 -0
  4. package/cjs/packageInfo.js +1 -1
  5. package/cjs/services/balance-service/transfer/xcm/snowBridge.js +21 -10
  6. package/cjs/services/chain-online-service/index.js +168 -15
  7. package/cjs/services/chain-service/index.js +39 -10
  8. package/cjs/services/chain-service/utils/patch.js +2 -2
  9. package/cjs/services/earning-service/constants/chains.js +2 -4
  10. package/cjs/services/earning-service/handlers/base.js +1 -1
  11. package/cjs/services/earning-service/handlers/native-staking/base.js +4 -2
  12. package/cjs/services/earning-service/handlers/native-staking/dtao.js +9 -3
  13. package/cjs/services/earning-service/handlers/native-staking/relay-chain.js +1 -10
  14. package/cjs/services/earning-service/handlers/native-staking/tao.js +24 -14
  15. package/cjs/services/earning-service/service.js +2 -2
  16. package/cjs/services/keyring-service/context/handlers/Json.js +28 -3
  17. package/cjs/services/migration-service/scripts/MigrateTransactionHistoryBySymbol.js +6 -2
  18. package/cjs/services/migration-service/scripts/databases/MigrateAssetSetting.js +6 -2
  19. package/cjs/services/migration-service/scripts/index.js +2 -2
  20. package/cjs/services/swap-service/index.js +24 -18
  21. package/cjs/services/transaction-service/utils.js +25 -16
  22. package/cjs/services/wallet-connect-service/constants.js +6 -2
  23. package/cjs/services/wallet-connect-service/index.js +62 -45
  24. package/koni/background/handlers/Extension.d.ts +1 -1
  25. package/koni/background/handlers/Extension.js +4 -4
  26. package/koni/background/handlers/State.js +1 -0
  27. package/package.json +30 -29
  28. package/packageInfo.js +1 -1
  29. package/services/balance-service/transfer/xcm/snowBridge.js +21 -10
  30. package/services/chain-online-service/index.d.ts +4 -1
  31. package/services/chain-online-service/index.js +168 -15
  32. package/services/chain-service/index.js +39 -10
  33. package/services/chain-service/utils/patch.d.ts +1 -1
  34. package/services/chain-service/utils/patch.js +2 -2
  35. package/services/earning-service/constants/chains.d.ts +0 -1
  36. package/services/earning-service/constants/chains.js +1 -2
  37. package/services/earning-service/handlers/base.d.ts +3 -3
  38. package/services/earning-service/handlers/base.js +1 -1
  39. package/services/earning-service/handlers/native-staking/base.js +4 -2
  40. package/services/earning-service/handlers/native-staking/dtao.d.ts +4 -3
  41. package/services/earning-service/handlers/native-staking/dtao.js +9 -3
  42. package/services/earning-service/handlers/native-staking/relay-chain.d.ts +0 -2
  43. package/services/earning-service/handlers/native-staking/relay-chain.js +2 -11
  44. package/services/earning-service/handlers/native-staking/tao.d.ts +1 -0
  45. package/services/earning-service/handlers/native-staking/tao.js +24 -14
  46. package/services/earning-service/service.d.ts +3 -3
  47. package/services/earning-service/service.js +2 -2
  48. package/services/keyring-service/context/handlers/Json.js +28 -3
  49. package/services/migration-service/scripts/MigrateTransactionHistoryBySymbol.js +6 -2
  50. package/services/migration-service/scripts/databases/MigrateAssetSetting.js +6 -2
  51. package/services/migration-service/scripts/index.js +2 -2
  52. package/services/swap-service/index.js +24 -18
  53. package/services/transaction-service/utils.js +25 -16
  54. package/services/wallet-connect-service/constants.d.ts +2 -0
  55. package/services/wallet-connect-service/constants.js +3 -1
  56. package/services/wallet-connect-service/index.js +50 -33
  57. package/types/yield/actions/join/submit.d.ts +5 -0
  58. package/types/yield/actions/others.d.ts +7 -2
  59. package/types/yield/info/account/info.d.ts +1 -0
@@ -41,7 +41,7 @@ export default class SubnetTaoStakingPoolHandler extends TaoNativeStakingPoolHan
41
41
  canHandleSlug(slug) {
42
42
  return slug.startsWith(`${this.slug}__`);
43
43
  }
44
- async getEarningSlippage(params) {
44
+ async getEarningImpact(params) {
45
45
  const substrateApi = await this.substrateApi.isReady;
46
46
  const subnetInfo = (await substrateApi.api.call.subnetInfoRuntimeApi.getDynamicInfo(params.netuid)).toJSON();
47
47
  const alphaIn = new BigN((subnetInfo === null || subnetInfo === void 0 ? void 0 : subnetInfo.alphaIn) || 0);
@@ -49,15 +49,18 @@ export default class SubnetTaoStakingPoolHandler extends TaoNativeStakingPoolHan
49
49
  const k = alphaIn.multipliedBy(taoIn);
50
50
  const value = new BigN(params.value);
51
51
  const rate = taoIn.dividedBy(alphaIn);
52
+ const feeRate = await this.bittensorCache.fetchSubnetFeeRate(params.netuid);
52
53
  if (params.type === ExtrinsicType.STAKING_BOND) {
53
54
  const newTaoIn = taoIn.plus(value);
54
55
  const newAlphaIn = k.dividedBy(newTaoIn);
55
56
  const alphaReturned = alphaIn.minus(newAlphaIn);
56
57
  const alphaIdeal = value.multipliedBy(alphaIn).dividedBy(taoIn);
57
58
  const slippage = alphaIdeal.minus(alphaReturned).dividedBy(alphaIdeal);
59
+ const bnStakingTaoFee = value.multipliedBy(feeRate);
58
60
  return {
59
61
  slippage: slippage.plus(0.0001).toNumber(),
60
- rate: rate.toNumber()
62
+ rate: rate.toNumber(),
63
+ stakingTaoFee: bnStakingTaoFee.toString()
61
64
  };
62
65
  } else if (params.type === ExtrinsicType.STAKING_UNBOND) {
63
66
  const newAlphaIn = alphaIn.plus(value);
@@ -65,9 +68,12 @@ export default class SubnetTaoStakingPoolHandler extends TaoNativeStakingPoolHan
65
68
  const taoReturned = taoIn.minus(newTaoReserve);
66
69
  const taoIdeal = value.multipliedBy(taoIn).dividedBy(alphaIn);
67
70
  const slippage = taoIdeal.minus(taoReturned).dividedBy(taoIdeal);
71
+ const taoAmount = value.multipliedBy(rate);
72
+ const bnStakingTaoFee = taoAmount.multipliedBy(feeRate);
68
73
  return {
69
74
  slippage: slippage.plus(0.0001).toNumber(),
70
- rate: rate.toNumber()
75
+ rate: rate.toNumber(),
76
+ stakingTaoFee: bnStakingTaoFee.toString()
71
77
  };
72
78
  }
73
79
  return {
@@ -2,14 +2,12 @@
2
2
  import { _ChainInfo } from '@subwallet/chain-list/types';
3
3
  import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError';
4
4
  import { ExtrinsicType, NominationInfo, UnstakingInfo } from '@subwallet/extension-base/background/KoniTypes';
5
- import KoniState from '@subwallet/extension-base/koni/background/handlers/State';
6
5
  import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types';
7
6
  import { BaseYieldPositionInfo, OptimalYieldPath, PalletStakingNominations, PalletStakingStakingLedger, StakeCancelWithdrawalParams, SubmitChangeValidatorStaking, SubmitJoinNativeStaking, SubmitYieldJoinData, TransactionData, ValidatorInfo, YieldPoolInfo, YieldPoolMethodInfo, YieldPositionInfo, YieldTokenBaseInfo } from '@subwallet/extension-base/types';
8
7
  import { BN } from '@polkadot/util';
9
8
  import BaseNativeStakingPoolHandler from './base';
10
9
  export default class RelayNativeStakingPoolHandler extends BaseNativeStakingPoolHandler {
11
10
  availableMethod: YieldPoolMethodInfo;
12
- constructor(state: KoniState, chain: string);
13
11
  subscribePoolInfo(callback: (data: YieldPoolInfo) => void): Promise<VoidFunction>;
14
12
  parseNominatorMetadata(chainInfo: _ChainInfo, address: string, substrateApi: _SubstrateApi, ledger: PalletStakingStakingLedger, currentEra: string, minStake: BN): Promise<Omit<YieldPositionInfo, keyof BaseYieldPositionInfo>>;
15
13
  handleNominationsList(substrateApi: _SubstrateApi, chain: string, nominations: PalletStakingNominations, currentEra: string, address: string, maxNominatorRewardedPerValidator: number | undefined): Promise<NominationInfo[]>;
@@ -6,7 +6,7 @@ import { ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
6
6
  import { calculateAlephZeroValidatorReturn, calculateChainStakedReturnV2, calculateInflation, calculateTernoaValidatorReturn, calculateValidatorStakedReturn, getAvgValidatorEraReward, getCommission, getMaxValidatorErrorMessage, getMinStakeErrorMessage, getRelayBlockedValidatorList, getRelayEraRewardMap, getRelayMaxNominations, getRelayTopValidatorByPoints, getRelayValidatorPointsMap, getRelayWaitingValidatorList, getSupportedDaysByHistoryDepth } from '@subwallet/extension-base/koni/api/staking/bonding/utils';
7
7
  import { _STAKING_ERA_LENGTH_MAP } from '@subwallet/extension-base/services/chain-service/constants';
8
8
  import { _getChainSubstrateAddressPrefix } from '@subwallet/extension-base/services/chain-service/utils';
9
- import { _STAKING_CHAIN_GROUP, _SUPPORT_CHANGE_VALIDATOR_CHAIN, MaxEraRewardPointsEras } from '@subwallet/extension-base/services/earning-service/constants';
9
+ import { _STAKING_CHAIN_GROUP, MaxEraRewardPointsEras } from '@subwallet/extension-base/services/earning-service/constants';
10
10
  import { applyDecimal, parseIdentity } from '@subwallet/extension-base/services/earning-service/utils';
11
11
  import { BasicTxErrorType, EarningStatus, StakingTxErrorType, UnstakingStatus } from '@subwallet/extension-base/types';
12
12
  import { balanceFormatter, formatNumber, reformatAddress } from '@subwallet/extension-base/utils';
@@ -22,17 +22,8 @@ export default class RelayNativeStakingPoolHandler extends BaseNativeStakingPool
22
22
  cancelUnstake: true,
23
23
  withdraw: true,
24
24
  claimReward: false,
25
- changeValidator: false
25
+ changeValidator: true
26
26
  };
27
- constructor(state, chain) {
28
- super(state, chain);
29
- if (_SUPPORT_CHANGE_VALIDATOR_CHAIN.includes(chain)) {
30
- this.availableMethod = {
31
- ...this.availableMethod,
32
- changeValidator: true
33
- };
34
- }
35
- }
36
27
  /* Subscribe pool info */
37
28
 
38
29
  async subscribePoolInfo(callback) {
@@ -80,6 +80,7 @@ export declare class BittensorCache {
80
80
  get(): Promise<ValidatorResponse>;
81
81
  private fetchData;
82
82
  fetchApr(netuid: number): Promise<ValidatorAprResponse>;
83
+ fetchSubnetFeeRate(netuid: number): Promise<string>;
83
84
  }
84
85
  export declare const getAlphaToTaoRate: (substrateApi: _SubstrateApi, netuid: number) => Promise<string>;
85
86
  export default class TaoNativeStakingPoolHandler extends BaseParaStakingPoolHandler {
@@ -10,6 +10,7 @@ import BaseParaStakingPoolHandler from '@subwallet/extension-base/services/earni
10
10
  import { BasicTxErrorType, EarningStatus, StakingTxErrorType, YieldPoolType } from '@subwallet/extension-base/types';
11
11
  import { ProxyServiceRoute } from '@subwallet/extension-base/types/environment';
12
12
  import { fetchFromProxyService, formatNumber, reformatAddress } from '@subwallet/extension-base/utils';
13
+ import { fetchStaticCache } from '@subwallet/extension-base/utils/fetchStaticCache';
13
14
  import BigN from 'bignumber.js';
14
15
  import { t } from 'i18next';
15
16
  import { BehaviorSubject, combineLatest } from 'rxjs';
@@ -44,21 +45,12 @@ export class BittensorCache {
44
45
  }
45
46
  async fetchData() {
46
47
  try {
47
- const resp = await fetchFromProxyService(ProxyServiceRoute.BITTENSOR, '/dtao/validator/latest/v1?limit=100', {
48
- method: 'GET',
49
- headers: {
50
- 'Content-Type': 'application/json'
51
- }
48
+ const fetchData = await fetchStaticCache('earning/dtao/validator.json', {
49
+ data: {}
52
50
  });
53
- if (!resp.ok) {
54
- console.error('Fetch bittensor delegates fail:', resp.status);
55
- return this.cache || {
56
- data: []
57
- };
58
- }
59
- const rawData = await resp.json();
51
+ const validators = Object.values(fetchData.data);
60
52
  const data = {
61
- data: rawData.data.filter(validator => parseFloat(validator.root_stake) > 0)
53
+ data: validators.filter(validator => parseFloat(validator.root_stake) > 0)
62
54
  };
63
55
  this.cache = data;
64
56
  this.promise = null;
@@ -71,7 +63,8 @@ export class BittensorCache {
71
63
  this.cache = newData;
72
64
  }
73
65
  }).catch(console.error);
74
- }, 60 * 2000);
66
+ }, 60 * 1000); // Cache 1 minute
67
+
75
68
  return data;
76
69
  } catch (error) {
77
70
  console.error(error);
@@ -102,6 +95,23 @@ export class BittensorCache {
102
95
  };
103
96
  }
104
97
  }
98
+ async fetchSubnetFeeRate(netuid) {
99
+ try {
100
+ var _subnet$fee_rate;
101
+ const resp = await fetchFromProxyService(ProxyServiceRoute.BITTENSOR, '/subnet/latest/v1', {
102
+ method: 'GET',
103
+ headers: {
104
+ 'Content-Type': 'application/json'
105
+ }
106
+ });
107
+ const rawData = await resp.json();
108
+ const subnet = rawData.data.find(item => item.netuid === netuid);
109
+ return (_subnet$fee_rate = subnet === null || subnet === void 0 ? void 0 : subnet.fee_rate) !== null && _subnet$fee_rate !== void 0 ? _subnet$fee_rate : '0.0005';
110
+ } catch (error) {
111
+ console.error(error);
112
+ return '0.0005'; // Default fee rate if fetch fails
113
+ }
114
+ }
105
115
  }
106
116
 
107
117
  // export async function fetchTaoDelegateState (address: string): Promise<RawDelegateState> {
@@ -3,10 +3,10 @@ import { TransactionError } from '@subwallet/extension-base/background/errors/Tr
3
3
  import { ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
4
4
  import KoniState from '@subwallet/extension-base/koni/background/handlers/State';
5
5
  import { PersistDataServiceInterface, ServiceStatus, StoppableServiceInterface } from '@subwallet/extension-base/services/base/types';
6
- import { EarningRewardHistoryItem, EarningRewardItem, EarningRewardJson, HandleYieldStepData, HandleYieldStepParams, OptimalYieldPath, OptimalYieldPathParams, RequestEarlyValidateYield, RequestEarningSlippage, RequestStakeCancelWithdrawal, RequestStakeClaimReward, RequestYieldLeave, RequestYieldWithdrawal, ResponseEarlyValidateYield, SubmitChangeValidatorStaking, TransactionData, ValidateYieldProcessParams, YieldPoolInfo, YieldPoolTarget, YieldPositionInfo } from '@subwallet/extension-base/types';
6
+ import { EarningRewardHistoryItem, EarningRewardItem, EarningRewardJson, HandleYieldStepData, HandleYieldStepParams, OptimalYieldPath, OptimalYieldPathParams, RequestEarlyValidateYield, RequestEarningImpact, RequestStakeCancelWithdrawal, RequestStakeClaimReward, RequestYieldLeave, RequestYieldWithdrawal, ResponseEarlyValidateYield, SubmitChangeValidatorStaking, TransactionData, ValidateYieldProcessParams, YieldPoolInfo, YieldPoolTarget, YieldPositionInfo } from '@subwallet/extension-base/types';
7
7
  import { PromiseHandler } from '@subwallet/extension-base/utils';
8
8
  import { BehaviorSubject } from 'rxjs';
9
- import { EarningSlippageResult } from './handlers/native-staking/dtao';
9
+ import { EarningImpactResult } from './handlers/native-staking/dtao';
10
10
  import { BasePoolHandler } from './handlers';
11
11
  export declare const fetchPoolsData: () => Promise<Record<string, YieldPoolInfo>>;
12
12
  export default class EarningService implements StoppableServiceInterface, PersistDataServiceInterface {
@@ -107,7 +107,7 @@ export default class EarningService implements StoppableServiceInterface, Persis
107
107
  handleYieldWithdraw(params: RequestYieldWithdrawal): Promise<TransactionData>;
108
108
  handleYieldCancelUnstake(params: RequestStakeCancelWithdrawal): Promise<TransactionData>;
109
109
  handleYieldClaimReward(params: RequestStakeClaimReward): Promise<TransactionData>;
110
- yieldGetEarningSlippage(params: RequestEarningSlippage): Promise<EarningSlippageResult>;
110
+ yieldGetEarningImpact(params: RequestEarningImpact): Promise<EarningImpactResult>;
111
111
  handleYieldChangeValidator(params: SubmitChangeValidatorStaking): Promise<TransactionData>;
112
112
  resetWallet(): Promise<void>;
113
113
  }
@@ -947,14 +947,14 @@ export default class EarningService {
947
947
  return Promise.reject(new TransactionError(BasicTxErrorType.INTERNAL_ERROR));
948
948
  }
949
949
  }
950
- async yieldGetEarningSlippage(params) {
950
+ async yieldGetEarningImpact(params) {
951
951
  await this.eventService.waitChainReady;
952
952
  const {
953
953
  slug
954
954
  } = params;
955
955
  const handler = this.getPoolHandler(slug);
956
956
  if (handler) {
957
- return handler.getEarningSlippage(params);
957
+ return handler.getEarningImpact(params);
958
958
  } else {
959
959
  return Promise.reject(new TransactionError(BasicTxErrorType.INTERNAL_ERROR));
960
960
  }
@@ -154,7 +154,17 @@ export class AccountJsonHandler extends AccountBaseHandler {
154
154
  accountProxies,
155
155
  modifyPairs
156
156
  } = json;
157
- const pairs = jsons.map(pair => keyring.createFromJson(pair));
157
+ const pairs = jsons.reduce((rs, pair) => {
158
+ try {
159
+ rs.push(keyring.createFromJson(pair));
160
+ } catch (e) {
161
+ console.error(e);
162
+ }
163
+ return rs;
164
+ }, []);
165
+ if (!(pairs !== null && pairs !== void 0 && pairs.length)) {
166
+ throw new Error(t('No valid accounts found to import'));
167
+ }
158
168
  const accountProxyMap = combineAccountsWithKeyPair(pairs, modifyPairs, accountProxies);
159
169
  const result = Object.values(accountProxyMap).map(proxy => {
160
170
  const rs = {
@@ -196,9 +206,24 @@ export class AccountJsonHandler extends AccountBaseHandler {
196
206
  try {
197
207
  const {
198
208
  accountProxies,
199
- modifyPairs
209
+ modifyPairs: modifyPairsRestored
200
210
  } = file;
201
- const pairs = jsons.map(pair => keyring.createFromJson(pair));
211
+ const modifyPairs = {};
212
+ const pairs = jsons.reduce((rs, pairJson) => {
213
+ try {
214
+ const pair = keyring.createFromJson(pairJson);
215
+ if (modifyPairsRestored !== null && modifyPairsRestored !== void 0 && modifyPairsRestored[pair.address]) {
216
+ modifyPairs[pair.address] = modifyPairsRestored[pair.address];
217
+ }
218
+ rs.push(pair);
219
+ } catch (e) {
220
+ console.error(e);
221
+ }
222
+ return rs;
223
+ }, []);
224
+ if (!(pairs !== null && pairs !== void 0 && pairs.length)) {
225
+ throw new Error(t('No valid accounts found to import'));
226
+ }
202
227
  const accountProxyMap = combineAccountsWithKeyPair(pairs, modifyPairs, accountProxies);
203
228
  const rawProxyIds = _proxyIds && _proxyIds.length ? _proxyIds : Object.keys(accountProxyMap);
204
229
  let _exists;
@@ -7,8 +7,12 @@ export default class MigrateTransactionHistoryBySymbol extends BaseMigrationJob
7
7
  const state = this.state;
8
8
  try {
9
9
  const changeSlugsMap = {
10
- 'polygon-NATIVE-MATIC': 'polygon-NATIVE-POL',
11
- '5irechain_mainnet-NATIVE-5IRE': '5irechain_mainnet-NATIVE-5ire'
10
+ 'bifrost_testnet-NATIVE-BNC': 'bifrost_testnet-NATIVE-BFC',
11
+ 'energy_web_x_rococo-NATIVE-VT': 'energy_web_x_rococo-NATIVE-EWT',
12
+ 'chainflip_dot-NATIVE-DOT': 'chainflip_dot-NATIVE-Unit',
13
+ 'autonomys_taurus-NATIVE-AI3': 'autonomys_taurus-NATIVE-tAI3',
14
+ 'fraxtal-NATIVE-frxETH': 'fraxtal-ERC20-frxETH-0xFC00000000000000000000000000000000000006',
15
+ 'arbitrum_one-ERC20-USDT-0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9': 'arbitrum_one-ERC20-USD₮0-0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'
12
16
  };
13
17
  const allTxs = [];
14
18
  await Promise.all(Object.entries(changeSlugsMap).map(async ([oldSlug, newSlug], i) => {
@@ -6,8 +6,12 @@ export default class MigrateAssetSetting extends BaseMigrationJob {
6
6
  async run() {
7
7
  try {
8
8
  const changeSlugsMap = {
9
- 'polygon-NATIVE-MATIC': 'polygon-NATIVE-POL',
10
- '5irechain_mainnet-NATIVE-5IRE': '5irechain_mainnet-NATIVE-5ire'
9
+ 'bifrost_testnet-NATIVE-BNC': 'bifrost_testnet-NATIVE-BFC',
10
+ 'energy_web_x_rococo-NATIVE-VT': 'energy_web_x_rococo-NATIVE-EWT',
11
+ 'chainflip_dot-NATIVE-DOT': 'chainflip_dot-NATIVE-Unit',
12
+ 'autonomys_taurus-NATIVE-AI3': 'autonomys_taurus-NATIVE-tAI3',
13
+ 'fraxtal-NATIVE-frxETH': 'fraxtal-ERC20-frxETH-0xFC00000000000000000000000000000000000006',
14
+ 'arbitrum_one-ERC20-USDT-0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9': 'arbitrum_one-ERC20-USD₮0-0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'
11
15
  };
12
16
  const assetSetting = await this.state.chainService.getAssetSettings();
13
17
  const migratedAssetSetting = {};
@@ -54,8 +54,8 @@ export default {
54
54
  '1.1.33-01': MigrateLedgerAccountV2,
55
55
  '1.1.41-01': DeleteChainStaking,
56
56
  // '1.1.46-01': AutoEnableSomeTokens,
57
- '1.2.28-01': MigrateAssetSetting,
58
- '1.2.28-02': MigrateTransactionHistoryBySymbol,
57
+ '1.3.53-01': MigrateAssetSetting,
58
+ '1.3.53-02': MigrateTransactionHistoryBySymbol,
59
59
  '1.2.69-01': MigrateRemoveGenesisHash,
60
60
  '1.2.13-01': ReloadMetadata,
61
61
  '1.2.32-01': MigratePairData,
@@ -43,24 +43,30 @@ export class SwapService {
43
43
  ..._request,
44
44
  isSupportKyberVersion: true
45
45
  };
46
- const quotes = await subwalletApiSdk.swapApi.fetchSwapQuoteData(request);
47
- if (Array.isArray(quotes)) {
48
- quotes.forEach(quoteData => {
49
- if (!_SUPPORTED_SWAP_PROVIDERS.includes(quoteData.provider)) {
50
- return;
51
- }
52
- if (!quoteData.quote || Object.keys(quoteData.quote).length === 0) {
53
- return;
54
- }
55
- if (!('errorClass' in quoteData.quote)) {
56
- availableQuotes.push({
57
- quote: quoteData.quote
58
- });
59
- } else {
60
- availableQuotes.push({
61
- error: new SwapError(quoteData.quote.errorType, quoteData.quote.message)
62
- });
63
- }
46
+ try {
47
+ const quotes = await subwalletApiSdk.swapApi.fetchSwapQuoteData(request);
48
+ if (Array.isArray(quotes)) {
49
+ quotes.forEach(quoteData => {
50
+ if (!_SUPPORTED_SWAP_PROVIDERS.includes(quoteData.provider)) {
51
+ return;
52
+ }
53
+ if (!quoteData.quote || Object.keys(quoteData.quote).length === 0) {
54
+ return;
55
+ }
56
+ if (!('errorClass' in quoteData.quote)) {
57
+ availableQuotes.push({
58
+ quote: quoteData.quote
59
+ });
60
+ } else {
61
+ availableQuotes.push({
62
+ error: new SwapError(quoteData.quote.errorType, quoteData.quote.message)
63
+ });
64
+ }
65
+ });
66
+ }
67
+ } catch (err) {
68
+ availableQuotes.push({
69
+ error: new SwapError(SwapErrorType.ASSET_NOT_SUPPORTED)
64
70
  });
65
71
  }
66
72
  return availableQuotes;
@@ -16,6 +16,21 @@ function getBlockExplorerAccountRoute(explorerLink) {
16
16
  if (explorerLink.includes('explorer.subspace.network')) {
17
17
  return 'accounts';
18
18
  }
19
+ if (explorerLink.includes('edgscan.ink')) {
20
+ return 'accounts';
21
+ }
22
+ if (explorerLink.includes('devnet-explorer.mosaicchain.io')) {
23
+ return 'accounts';
24
+ }
25
+ if (explorerLink.includes('statescan.io')) {
26
+ return '#/accounts';
27
+ }
28
+ if (explorerLink.includes('explorer.joystream.org')) {
29
+ return '#/accounts';
30
+ }
31
+ if (explorerLink.includes('explorer.gen6.app')) {
32
+ return '#/accounts';
33
+ }
19
34
  if (explorerLink.includes('deeperscan.io')) {
20
35
  return 'account';
21
36
  }
@@ -25,24 +40,18 @@ function getBlockExplorerAccountRoute(explorerLink) {
25
40
  if (explorerLink.includes('3dpscan.io')) {
26
41
  return 'account';
27
42
  }
28
- if (explorerLink.includes('statescan.io')) {
29
- return '#/accounts';
30
- }
31
- if (explorerLink.includes('explorer.gen6.app')) {
32
- return '#/accounts';
33
- }
34
- if (explorerLink.includes('astral.autonomys')) {
35
- return 'accounts';
43
+ if (explorerLink.includes('main.dentnet.io')) {
44
+ return 'account';
36
45
  }
37
46
  if (explorerLink.includes('taostats.io')) {
38
47
  return 'account';
39
48
  }
49
+ if (explorerLink.includes('uniquescan.io')) {
50
+ return 'account';
51
+ }
40
52
  if (explorerLink.includes('tonviewer.com')) {
41
53
  return '';
42
54
  }
43
- if (explorerLink.includes('devnet-explorer.mosaicchain.io')) {
44
- return 'accounts';
45
- }
46
55
  if (explorerLink.includes('pdexmon.com')) {
47
56
  return 'holders';
48
57
  }
@@ -52,7 +61,7 @@ function getBlockExplorerTxRoute(chainInfo) {
52
61
  if (_isPureEvmChain(chainInfo) || _isPureBitcoinChain(chainInfo)) {
53
62
  return 'tx';
54
63
  }
55
- if (['moonbeam'].includes(chainInfo.slug)) {
64
+ if (['moonbeam', 'crabParachain'].includes(chainInfo.slug)) {
56
65
  return 'tx';
57
66
  }
58
67
  if (_isPureCardanoChain(chainInfo) || _isPureTonChain(chainInfo)) {
@@ -61,15 +70,15 @@ function getBlockExplorerTxRoute(chainInfo) {
61
70
  if (['aventus', 'deeper_network'].includes(chainInfo.slug)) {
62
71
  return 'transaction';
63
72
  }
64
- if (['gen6_public'].includes(chainInfo.slug)) {
73
+ if (['gen6_public', 'joystream'].includes(chainInfo.slug)) {
65
74
  return '#/extrinsics';
66
75
  }
76
+ if (['edgeware'].includes(chainInfo.slug)) {
77
+ return 'extrinsics';
78
+ }
67
79
  if (['mosaicTest', 'polkadex'].includes(chainInfo.slug)) {
68
80
  return 'transactions';
69
81
  }
70
- if (['autonomys'].includes(chainInfo.slug)) {
71
- return 'extrinsics';
72
- }
73
82
  const explorerLink = _getBlockExplorerFromChain(chainInfo);
74
83
  if (explorerLink && explorerLink.includes('statescan.io')) {
75
84
  return '#/extrinsics';
@@ -3,6 +3,7 @@ import { SignClientTypes } from '@walletconnect/types';
3
3
  export declare const PROJECT_ID_EXTENSION = "6da34c0b48164d27681924dd9a46d6be";
4
4
  export declare const PROJECT_ID_MOBILE = "6da34c0b48164d27681924dd9a46d6be";
5
5
  export declare const RELAY_URL = "wss://relay.walletconnect.com";
6
+ export declare const RELAY_FALLBACK_URL = "wss://relay.walletconnect.org";
6
7
  export declare const DEFAULT_WALLET_CONNECT_OPTIONS: SignClientTypes.Options;
7
8
  export declare const ALL_WALLET_CONNECT_EVENT: SignClientTypes.Event[];
8
9
  export declare const WALLET_CONNECT_SUPPORTED_METHODS: WalletConnectSigningMethod[];
@@ -10,3 +11,4 @@ export declare const WALLET_CONNECT_REQUEST_KEY = "wallet-connect";
10
11
  export declare const WALLET_CONNECT_EIP155_NAMESPACE = "eip155";
11
12
  export declare const WALLET_CONNECT_POLKADOT_NAMESPACE = "polkadot";
12
13
  export declare const WALLET_CONNECT_SUPPORT_NAMESPACES: string[];
14
+ export declare const WALLET_CONNECT_SESSION_TIMEOUT = 20000;
@@ -6,6 +6,7 @@ import { targetIsMobile } from '@subwallet/extension-base/utils';
6
6
  export const PROJECT_ID_EXTENSION = '6da34c0b48164d27681924dd9a46d6be';
7
7
  export const PROJECT_ID_MOBILE = '6da34c0b48164d27681924dd9a46d6be';
8
8
  export const RELAY_URL = 'wss://relay.walletconnect.com';
9
+ export const RELAY_FALLBACK_URL = 'wss://relay.walletconnect.org';
9
10
  export const DEFAULT_WALLET_CONNECT_OPTIONS = {
10
11
  logger: 'error',
11
12
  projectId: targetIsMobile ? PROJECT_ID_MOBILE : PROJECT_ID_EXTENSION,
@@ -22,4 +23,5 @@ export const WALLET_CONNECT_SUPPORTED_METHODS = [POLKADOT_SIGNING_METHODS.POLKAD
22
23
  export const WALLET_CONNECT_REQUEST_KEY = 'wallet-connect';
23
24
  export const WALLET_CONNECT_EIP155_NAMESPACE = 'eip155';
24
25
  export const WALLET_CONNECT_POLKADOT_NAMESPACE = 'polkadot';
25
- export const WALLET_CONNECT_SUPPORT_NAMESPACES = [WALLET_CONNECT_EIP155_NAMESPACE, WALLET_CONNECT_POLKADOT_NAMESPACE];
26
+ export const WALLET_CONNECT_SUPPORT_NAMESPACES = [WALLET_CONNECT_EIP155_NAMESPACE, WALLET_CONNECT_POLKADOT_NAMESPACE];
27
+ export const WALLET_CONNECT_SESSION_TIMEOUT = 20000; // 20 seconds
@@ -6,11 +6,12 @@ import _classPrivateFieldLooseKey from "@babel/runtime/helpers/esm/classPrivateF
6
6
  import { formatJsonRpcError } from '@json-rpc-tools/utils';
7
7
  import Eip155RequestHandler from '@subwallet/extension-base/services/wallet-connect-service/handler/Eip155RequestHandler';
8
8
  import { SWStorage } from '@subwallet/extension-base/storage';
9
+ import { wait } from '@subwallet/extension-base/utils';
9
10
  import SignClient from '@walletconnect/sign-client';
10
11
  import { getInternalError, getSdkError } from '@walletconnect/utils';
11
12
  import { BehaviorSubject } from 'rxjs';
12
13
  import PolkadotRequestHandler from "./handler/PolkadotRequestHandler.js";
13
- import { ALL_WALLET_CONNECT_EVENT, DEFAULT_WALLET_CONNECT_OPTIONS, WALLET_CONNECT_EIP155_NAMESPACE, WALLET_CONNECT_SUPPORTED_METHODS } from "./constants.js";
14
+ import { ALL_WALLET_CONNECT_EVENT, DEFAULT_WALLET_CONNECT_OPTIONS, RELAY_FALLBACK_URL, RELAY_URL, WALLET_CONNECT_EIP155_NAMESPACE, WALLET_CONNECT_SESSION_TIMEOUT, WALLET_CONNECT_SUPPORTED_METHODS } from "./constants.js";
14
15
  import { convertConnectRequest, convertNotSupportRequest, isSupportWalletConnectChain } from "./helpers.js";
15
16
  import { EIP155_SIGNING_METHODS, POLKADOT_SIGNING_METHODS } from "./types.js";
16
17
  const storage = SWStorage.instance;
@@ -116,7 +117,19 @@ export default class WalletConnectService {
116
117
  async initClient(force) {
117
118
  _classPrivateFieldLooseBase(this, _removeListener)[_removeListener]();
118
119
  if (force || (await this.haveData())) {
119
- _classPrivateFieldLooseBase(this, _client)[_client] = await SignClient.init(_classPrivateFieldLooseBase(this, _option)[_option]);
120
+ try {
121
+ _classPrivateFieldLooseBase(this, _client)[_client] = await SignClient.init(_classPrivateFieldLooseBase(this, _option)[_option]);
122
+ } catch (e) {
123
+ if (_classPrivateFieldLooseBase(this, _option)[_option].relayUrl === RELAY_URL) {
124
+ _classPrivateFieldLooseBase(this, _option)[_option] = {
125
+ ..._classPrivateFieldLooseBase(this, _option)[_option],
126
+ relayUrl: RELAY_FALLBACK_URL
127
+ };
128
+ _classPrivateFieldLooseBase(this, _client)[_client] = await SignClient.init(_classPrivateFieldLooseBase(this, _option)[_option]);
129
+ } else {
130
+ throw e;
131
+ }
132
+ }
120
133
  }
121
134
  _classPrivateFieldLooseBase(this, _updateSessions)[_updateSessions]();
122
135
  _classPrivateFieldLooseBase(this, _createListener)[_createListener]();
@@ -139,17 +152,21 @@ export default class WalletConnectService {
139
152
  await this.initClient();
140
153
  }
141
154
  async connect(uri) {
142
- var _classPrivateFieldLoo3;
143
- if (!(await this.haveData())) {
155
+ var _classPrivateFieldLoo3, _classPrivateFieldLoo4;
156
+ if (!(await this.haveData()) || !((_classPrivateFieldLoo3 = _classPrivateFieldLooseBase(this, _client)[_client]) !== null && _classPrivateFieldLoo3 !== void 0 && _classPrivateFieldLoo3.core.relayer.connected)) {
144
157
  await this.initClient(true);
145
158
  }
146
159
  _classPrivateFieldLooseBase(this, _checkClient)[_checkClient]();
147
- await ((_classPrivateFieldLoo3 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo3 === void 0 ? void 0 : _classPrivateFieldLoo3.pair({
160
+
161
+ // The purpose of designing a timeout for pairing is to prevent the promise from not being resolved if there are issues during the pairing process.
162
+ await Promise.race([(_classPrivateFieldLoo4 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo4 === void 0 ? void 0 : _classPrivateFieldLoo4.pair({
148
163
  uri
149
- }));
164
+ }), wait(WALLET_CONNECT_SESSION_TIMEOUT).then(() => {
165
+ throw new Error(getInternalError('EXPIRED').message);
166
+ })]);
150
167
  }
151
168
  async approveSession(result) {
152
- var _classPrivateFieldLoo4;
169
+ var _classPrivateFieldLoo5;
153
170
  _classPrivateFieldLooseBase(this, _checkClient)[_checkClient]();
154
171
  Object.entries(result.namespaces).forEach(([namespace, {
155
172
  methods
@@ -157,32 +174,32 @@ export default class WalletConnectService {
157
174
  methods = [...methods, ...this.findMethodsMissing(WALLET_CONNECT_EIP155_NAMESPACE === namespace ? methodEVMRequire : methodDOTRequire, methods)];
158
175
  result.namespaces[namespace].methods = methods;
159
176
  });
160
- await ((_classPrivateFieldLoo4 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo4 === void 0 ? void 0 : _classPrivateFieldLoo4.approve(result));
177
+ await ((_classPrivateFieldLoo5 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo5 === void 0 ? void 0 : _classPrivateFieldLoo5.approve(result));
161
178
  _classPrivateFieldLooseBase(this, _updateSessions)[_updateSessions]();
162
179
  }
163
180
  async rejectSession(id) {
164
- var _classPrivateFieldLoo5;
181
+ var _classPrivateFieldLoo6;
165
182
  _classPrivateFieldLooseBase(this, _checkClient)[_checkClient]();
166
- await ((_classPrivateFieldLoo5 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo5 === void 0 ? void 0 : _classPrivateFieldLoo5.reject({
183
+ await ((_classPrivateFieldLoo6 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo6 === void 0 ? void 0 : _classPrivateFieldLoo6.reject({
167
184
  id: id,
168
185
  reason: getSdkError('USER_REJECTED')
169
186
  }));
170
187
  }
171
188
  async responseRequest(response) {
172
- var _classPrivateFieldLoo6;
189
+ var _classPrivateFieldLoo7;
173
190
  _classPrivateFieldLooseBase(this, _checkClient)[_checkClient]();
174
- await ((_classPrivateFieldLoo6 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo6 === void 0 ? void 0 : _classPrivateFieldLoo6.respond(response));
191
+ await ((_classPrivateFieldLoo7 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo7 === void 0 ? void 0 : _classPrivateFieldLoo7.respond(response));
175
192
  }
176
193
  async resetWallet(resetAll) {
177
- var _classPrivateFieldLoo7, _classPrivateFieldLoo9, _classPrivateFieldLoo11;
194
+ var _classPrivateFieldLoo8, _classPrivateFieldLoo10, _classPrivateFieldLoo12;
178
195
  _classPrivateFieldLooseBase(this, _removeListener)[_removeListener]();
179
196
 
180
197
  // Disconnect session
181
- const sessions = ((_classPrivateFieldLoo7 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo7 === void 0 ? void 0 : _classPrivateFieldLoo7.session.values) || [];
198
+ const sessions = ((_classPrivateFieldLoo8 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo8 === void 0 ? void 0 : _classPrivateFieldLoo8.session.values) || [];
182
199
  for (const session of sessions) {
183
200
  try {
184
- var _classPrivateFieldLoo8;
185
- await ((_classPrivateFieldLoo8 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo8 === void 0 ? void 0 : _classPrivateFieldLoo8.disconnect({
201
+ var _classPrivateFieldLoo9;
202
+ await ((_classPrivateFieldLoo9 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo9 === void 0 ? void 0 : _classPrivateFieldLoo9.disconnect({
186
203
  topic: session.topic,
187
204
  reason: getSdkError('USER_DISCONNECTED')
188
205
  }));
@@ -192,11 +209,11 @@ export default class WalletConnectService {
192
209
  }
193
210
 
194
211
  // Disconnect pair
195
- const pairs = ((_classPrivateFieldLoo9 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo9 === void 0 ? void 0 : _classPrivateFieldLoo9.pairing.values) || [];
212
+ const pairs = ((_classPrivateFieldLoo10 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo10 === void 0 ? void 0 : _classPrivateFieldLoo10.pairing.values) || [];
196
213
  for (const pair of pairs) {
197
214
  try {
198
- var _classPrivateFieldLoo10;
199
- await ((_classPrivateFieldLoo10 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo10 === void 0 ? void 0 : _classPrivateFieldLoo10.disconnect({
215
+ var _classPrivateFieldLoo11;
216
+ await ((_classPrivateFieldLoo11 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo11 === void 0 ? void 0 : _classPrivateFieldLoo11.disconnect({
200
217
  topic: pair.topic,
201
218
  reason: getSdkError('USER_DISCONNECTED')
202
219
  }));
@@ -204,12 +221,12 @@ export default class WalletConnectService {
204
221
  console.error(e);
205
222
  }
206
223
  }
207
- const keys = (await ((_classPrivateFieldLoo11 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo11 === void 0 ? void 0 : _classPrivateFieldLoo11.core.storage.getKeys())) || [];
224
+ const keys = (await ((_classPrivateFieldLoo12 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo12 === void 0 ? void 0 : _classPrivateFieldLoo12.core.storage.getKeys())) || [];
208
225
  const deleteKeys = resetAll ? keys : keys.filter(key => key.startsWith('wc@'));
209
226
  for (const key of deleteKeys) {
210
227
  try {
211
- var _classPrivateFieldLoo12;
212
- await ((_classPrivateFieldLoo12 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo12 === void 0 ? void 0 : _classPrivateFieldLoo12.core.storage.removeItem(key));
228
+ var _classPrivateFieldLoo13;
229
+ await ((_classPrivateFieldLoo13 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo13 === void 0 ? void 0 : _classPrivateFieldLoo13.core.storage.removeItem(key));
213
230
  } catch (e) {
214
231
  console.error(e);
215
232
  }
@@ -218,8 +235,8 @@ export default class WalletConnectService {
218
235
  _classPrivateFieldLooseBase(this, _updateSessions)[_updateSessions]();
219
236
  }
220
237
  async disconnect(topic) {
221
- var _classPrivateFieldLoo13;
222
- await ((_classPrivateFieldLoo13 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo13 === void 0 ? void 0 : _classPrivateFieldLoo13.disconnect({
238
+ var _classPrivateFieldLoo14;
239
+ await ((_classPrivateFieldLoo14 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo14 === void 0 ? void 0 : _classPrivateFieldLoo14.disconnect({
223
240
  topic: topic,
224
241
  reason: getSdkError('USER_DISCONNECTED')
225
242
  }));
@@ -326,18 +343,18 @@ async function _onPingReply2({
326
343
  }
327
344
  }
328
345
  function _createListener2() {
329
- var _classPrivateFieldLoo14, _classPrivateFieldLoo15, _classPrivateFieldLoo16, _classPrivateFieldLoo17, _classPrivateFieldLoo18, _classPrivateFieldLoo19;
330
- (_classPrivateFieldLoo14 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo14 === void 0 ? void 0 : _classPrivateFieldLoo14.on('session_proposal', _classPrivateFieldLooseBase(this, _onSessionProposal)[_onSessionProposal].bind(this));
331
- (_classPrivateFieldLoo15 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo15 === void 0 ? void 0 : _classPrivateFieldLoo15.on('session_request', _classPrivateFieldLooseBase(this, _onSessionRequest)[_onSessionRequest].bind(this));
332
- (_classPrivateFieldLoo16 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo16 === void 0 ? void 0 : _classPrivateFieldLoo16.on('session_ping', _classPrivateFieldLooseBase(this, _onPingReply)[_onPingReply].bind(this));
333
- (_classPrivateFieldLoo17 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo17 === void 0 ? void 0 : _classPrivateFieldLoo17.on('session_event', data => console.log('event', data));
334
- (_classPrivateFieldLoo18 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo18 === void 0 ? void 0 : _classPrivateFieldLoo18.on('session_update', data => console.log('update', data));
335
- (_classPrivateFieldLoo19 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo19 === void 0 ? void 0 : _classPrivateFieldLoo19.on('session_delete', _classPrivateFieldLooseBase(this, _updateSessions)[_updateSessions].bind(this));
346
+ var _classPrivateFieldLoo15, _classPrivateFieldLoo16, _classPrivateFieldLoo17, _classPrivateFieldLoo18, _classPrivateFieldLoo19, _classPrivateFieldLoo20;
347
+ (_classPrivateFieldLoo15 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo15 === void 0 ? void 0 : _classPrivateFieldLoo15.on('session_proposal', _classPrivateFieldLooseBase(this, _onSessionProposal)[_onSessionProposal].bind(this));
348
+ (_classPrivateFieldLoo16 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo16 === void 0 ? void 0 : _classPrivateFieldLoo16.on('session_request', _classPrivateFieldLooseBase(this, _onSessionRequest)[_onSessionRequest].bind(this));
349
+ (_classPrivateFieldLoo17 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo17 === void 0 ? void 0 : _classPrivateFieldLoo17.on('session_ping', _classPrivateFieldLooseBase(this, _onPingReply)[_onPingReply].bind(this));
350
+ (_classPrivateFieldLoo18 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo18 === void 0 ? void 0 : _classPrivateFieldLoo18.on('session_event', data => console.log('event', data));
351
+ (_classPrivateFieldLoo19 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo19 === void 0 ? void 0 : _classPrivateFieldLoo19.on('session_update', data => console.log('update', data));
352
+ (_classPrivateFieldLoo20 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo20 === void 0 ? void 0 : _classPrivateFieldLoo20.on('session_delete', _classPrivateFieldLooseBase(this, _updateSessions)[_updateSessions].bind(this));
336
353
  }
337
354
  function _removeListener2() {
338
355
  ALL_WALLET_CONNECT_EVENT.forEach(event => {
339
- var _classPrivateFieldLoo20;
340
- (_classPrivateFieldLoo20 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo20 === void 0 ? void 0 : _classPrivateFieldLoo20.removeAllListeners(event);
356
+ var _classPrivateFieldLoo21;
357
+ (_classPrivateFieldLoo21 = _classPrivateFieldLooseBase(this, _client)[_client]) === null || _classPrivateFieldLoo21 === void 0 ? void 0 : _classPrivateFieldLoo21.removeAllListeners(event);
341
358
  });
342
359
  }
343
360
  function _checkClient2() {