@subwallet/extension-base 1.0.2-1b → 1.0.2-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 (122) hide show
  1. package/background/KoniTypes.d.ts +34 -16
  2. package/background/KoniTypes.js +7 -6
  3. package/background/errors/TransactionError.js +1 -21
  4. package/cjs/background/KoniTypes.js +7 -6
  5. package/cjs/background/errors/TransactionError.js +0 -20
  6. package/cjs/constants/index.js +26 -8
  7. package/cjs/koni/api/dotsama/balance.js +224 -49
  8. package/cjs/koni/api/dotsama/transfer.js +29 -30
  9. package/cjs/koni/api/nft/acala_nft/index.js +1 -4
  10. package/cjs/koni/api/nft/bit.country/index.js +1 -4
  11. package/cjs/koni/api/nft/evm_nft/index.js +3 -7
  12. package/cjs/koni/api/nft/index.js +6 -3
  13. package/cjs/koni/api/nft/karura_nft/index.js +1 -4
  14. package/cjs/koni/api/nft/rmrk_nft/index.js +1 -8
  15. package/cjs/koni/api/nft/statemine_nft/index.js +1 -4
  16. package/cjs/koni/api/nft/unique_nft/index.js +1 -6
  17. package/cjs/koni/api/nft/wasm_nft/index.js +111 -169
  18. package/cjs/koni/api/nft/wasm_nft/utils.js +7 -11
  19. package/cjs/koni/api/staking/bonding/amplitude.js +9 -13
  20. package/cjs/koni/api/staking/bonding/astar.js +13 -15
  21. package/cjs/koni/api/staking/bonding/index.js +10 -22
  22. package/cjs/koni/api/staking/bonding/paraChain.js +2 -85
  23. package/cjs/koni/api/staking/bonding/relayChain.js +16 -119
  24. package/cjs/koni/api/staking/bonding/utils.js +8 -27
  25. package/cjs/koni/api/tokens/wasm/index.js +4 -5
  26. package/cjs/koni/api/xcm/polkadotXcm.js +1 -1
  27. package/cjs/koni/api/xcm/utils.js +13 -18
  28. package/cjs/koni/api/xcm/xTokens.js +1 -1
  29. package/cjs/koni/api/xcm/xcmPallet.js +6 -9
  30. package/cjs/koni/background/cron.js +47 -150
  31. package/cjs/koni/background/handlers/Extension.js +64 -106
  32. package/cjs/koni/background/handlers/State.js +21 -19
  33. package/cjs/koni/background/handlers/Tabs.js +1 -8
  34. package/cjs/koni/background/subscription.js +29 -32
  35. package/cjs/packageInfo.js +1 -1
  36. package/cjs/services/chain-service/handler/SubstrateChainHandler.js +8 -13
  37. package/cjs/services/chain-service/handler/light-client/index.js +0 -2
  38. package/cjs/services/chain-service/index.js +7 -6
  39. package/cjs/services/event-service/index.js +1 -5
  40. package/cjs/services/event-service/types.js +1 -11
  41. package/cjs/services/history-service/index.js +10 -16
  42. package/cjs/services/history-service/subsquid-multi-chain-history.js +9 -12
  43. package/cjs/services/price-service/coingecko.js +1 -0
  44. package/cjs/services/price-service/index.js +3 -2
  45. package/cjs/services/request-service/handler/AuthRequestHandler.js +2 -6
  46. package/cjs/services/storage-service/DatabaseService.js +33 -52
  47. package/cjs/services/storage-service/db-stores/Nft.js +17 -4
  48. package/cjs/services/transaction-service/event-parser/index.js +48 -20
  49. package/cjs/services/transaction-service/index.js +14 -23
  50. package/cjs/utils/index.js +14 -7
  51. package/constants/index.d.ts +13 -7
  52. package/constants/index.js +13 -7
  53. package/koni/api/dotsama/balance.d.ts +1 -0
  54. package/koni/api/dotsama/balance.js +197 -22
  55. package/koni/api/dotsama/transfer.js +4 -5
  56. package/koni/api/nft/acala_nft/index.js +1 -3
  57. package/koni/api/nft/bit.country/index.js +1 -3
  58. package/koni/api/nft/evm_nft/index.js +3 -6
  59. package/koni/api/nft/index.d.ts +2 -1
  60. package/koni/api/nft/index.js +6 -3
  61. package/koni/api/nft/karura_nft/index.js +1 -3
  62. package/koni/api/nft/nft.d.ts +0 -1
  63. package/koni/api/nft/rmrk_nft/index.js +1 -8
  64. package/koni/api/nft/statemine_nft/index.js +1 -3
  65. package/koni/api/nft/unique_nft/index.js +1 -5
  66. package/koni/api/nft/wasm_nft/index.d.ts +2 -0
  67. package/koni/api/nft/wasm_nft/index.js +109 -167
  68. package/koni/api/nft/wasm_nft/utils.d.ts +5 -7
  69. package/koni/api/nft/wasm_nft/utils.js +5 -7
  70. package/koni/api/staking/bonding/amplitude.d.ts +1 -0
  71. package/koni/api/staking/bonding/amplitude.js +10 -15
  72. package/koni/api/staking/bonding/astar.js +6 -8
  73. package/koni/api/staking/bonding/index.d.ts +1 -4
  74. package/koni/api/staking/bonding/index.js +13 -23
  75. package/koni/api/staking/bonding/paraChain.d.ts +0 -3
  76. package/koni/api/staking/bonding/paraChain.js +5 -86
  77. package/koni/api/staking/bonding/relayChain.d.ts +1 -5
  78. package/koni/api/staking/bonding/relayChain.js +18 -118
  79. package/koni/api/staking/bonding/utils.d.ts +2 -3
  80. package/koni/api/staking/bonding/utils.js +9 -27
  81. package/koni/api/tokens/wasm/index.js +4 -5
  82. package/koni/api/xcm/polkadotXcm.js +2 -2
  83. package/koni/api/xcm/utils.d.ts +6 -5
  84. package/koni/api/xcm/utils.js +10 -15
  85. package/koni/api/xcm/xTokens.js +2 -2
  86. package/koni/api/xcm/xcmPallet.js +9 -10
  87. package/koni/background/cron.d.ts +1 -6
  88. package/koni/background/cron.js +48 -151
  89. package/koni/background/handlers/Extension.d.ts +2 -2
  90. package/koni/background/handlers/Extension.js +67 -108
  91. package/koni/background/handlers/State.d.ts +6 -5
  92. package/koni/background/handlers/State.js +21 -19
  93. package/koni/background/handlers/Tabs.js +1 -8
  94. package/koni/background/subscription.js +30 -31
  95. package/package.json +8 -13
  96. package/packageInfo.js +1 -1
  97. package/services/chain-service/handler/SubstrateChainHandler.js +9 -14
  98. package/services/chain-service/handler/light-client/index.d.ts +1 -17
  99. package/services/chain-service/handler/light-client/index.js +1 -1
  100. package/services/chain-service/helper/psp22_abi.json +881 -1041
  101. package/services/chain-service/helper/psp34_abi.json +1808 -2964
  102. package/services/chain-service/index.js +7 -6
  103. package/services/event-service/index.js +1 -5
  104. package/services/event-service/types.d.ts +9 -5
  105. package/services/event-service/types.js +1 -4
  106. package/services/history-service/index.d.ts +1 -1
  107. package/services/history-service/index.js +10 -16
  108. package/services/history-service/subsquid-multi-chain-history.js +11 -15
  109. package/services/price-service/coingecko.js +1 -0
  110. package/services/price-service/index.js +3 -2
  111. package/services/request-service/handler/AuthRequestHandler.js +2 -6
  112. package/services/storage-service/DatabaseService.d.ts +0 -1
  113. package/services/storage-service/DatabaseService.js +33 -52
  114. package/services/storage-service/db-stores/Nft.d.ts +2 -1
  115. package/services/storage-service/db-stores/Nft.js +16 -4
  116. package/services/transaction-service/event-parser/index.js +49 -21
  117. package/services/transaction-service/index.js +14 -23
  118. package/utils/index.d.ts +1 -1
  119. package/utils/index.js +12 -6
  120. package/cjs/koni/api/tokens/wasm/utils.js +0 -63
  121. package/koni/api/tokens/wasm/utils.d.ts +0 -6
  122. package/koni/api/tokens/wasm/utils.js +0 -54
@@ -422,6 +422,7 @@ export interface SWWarning {
422
422
  data?: unknown;
423
423
  }
424
424
  export declare enum BasicTxErrorType {
425
+ NOT_ENOUGH_FEE = "NOT_ENOUGH_FEE",
425
426
  NOT_ENOUGH_BALANCE = "NOT_ENOUGH_BALANCE",
426
427
  CHAIN_DISCONNECTED = "CHAIN_DISCONNECTED",
427
428
  INVALID_PARAMS = "INVALID_PARAMS",
@@ -435,11 +436,12 @@ export declare enum BasicTxErrorType {
435
436
  NOT_ENOUGH_EXISTENTIAL_DEPOSIT = "NOT_ENOUGH_EXISTENTIAL_DEPOSIT"
436
437
  }
437
438
  export declare enum StakingTxErrorType {
438
- NOT_ENOUGH_MIN_STAKE = "NOT_ENOUGH_MIN_STAKE",
439
- EXCEED_MAX_NOMINATIONS = "EXCEED_MAX_NOMINATIONS",
440
- EXIST_UNSTAKING_REQUEST = "EXIST_UNSTAKING_REQUEST",
441
- INVALID_ACTIVE_STAKE = "INVALID_ACTIVE_STAKE",
442
- EXCEED_MAX_UNSTAKING = "EXCEED_MAX_UNSTAKING"
439
+ STAKING_ERROR = "stakingError",
440
+ UN_STAKING_ERROR = "unStakingError",
441
+ WITHDRAW_STAKING_ERROR = "withdrawStakingError",
442
+ CLAIM_REWARD_ERROR = "claimRewardError",
443
+ CREATE_COMPOUND_ERROR = "createCompoundError",
444
+ CANCEL_COMPOUND_ERROR = "cancelCompoundError"
443
445
  }
444
446
  export declare enum TransferTxErrorType {
445
447
  NOT_ENOUGH_VALUE = "NOT_ENOUGH_VALUE",
@@ -1042,8 +1044,6 @@ export interface ChainStakingMetadata {
1042
1044
  inflation?: number;
1043
1045
  minJoinNominationPool?: string;
1044
1046
  minStake: string;
1045
- nominatorCount?: number;
1046
- minPoolBonding?: string;
1047
1047
  maxValidatorPerNominator: number;
1048
1048
  maxWithdrawalRequestPerValidator: number;
1049
1049
  allowCancelUnstaking: boolean;
@@ -1060,7 +1060,7 @@ export interface NominationInfo {
1060
1060
  }
1061
1061
  export interface PalletNominationPoolsBondedPoolInner {
1062
1062
  points: number;
1063
- state: 'Open' | 'Destroying' | 'Locked';
1063
+ state: 'Open' | 'Destroying';
1064
1064
  memberCounter: number;
1065
1065
  roles: {
1066
1066
  depositor: string;
@@ -1089,8 +1089,7 @@ export interface UnstakingInfo {
1089
1089
  export declare enum StakingStatus {
1090
1090
  EARNING_REWARD = "EARNING_REWARD",
1091
1091
  PARTIALLY_EARNING = "PARTIALLY_EARNING",
1092
- NOT_EARNING = "NOT_EARNING",
1093
- WAITING = "WAITING"
1092
+ NOT_EARNING = "NOT_EARNING"
1094
1093
  }
1095
1094
  export interface NominatorMetadata {
1096
1095
  chain: string;
@@ -1118,6 +1117,28 @@ export interface ValidatorInfo {
1118
1117
  icon?: string;
1119
1118
  isCrowded: boolean;
1120
1119
  }
1120
+ export interface NominationPoolMetadata {
1121
+ id: string;
1122
+ identity?: string;
1123
+ address: string;
1124
+ memberCount: number;
1125
+ bondedAmount: string;
1126
+ }
1127
+ export interface NominatorInfo {
1128
+ chain: string;
1129
+ address: string;
1130
+ isBondedBefore: boolean;
1131
+ bondedValidators: string[];
1132
+ bondedPool: string[];
1133
+ }
1134
+ export interface ChainBondingInfo {
1135
+ chain: string;
1136
+ estimatedReturn: number;
1137
+ activeNominatorCount: number;
1138
+ totalNominatorCount: number;
1139
+ unbondingPeriod: number;
1140
+ totalStake: string;
1141
+ }
1121
1142
  export interface BondingSubmitParams extends BaseRequestSign {
1122
1143
  chain: string;
1123
1144
  type: StakingType;
@@ -1332,9 +1353,6 @@ export interface Notification {
1332
1353
  };
1333
1354
  }
1334
1355
  export declare type NotificationParams = Omit<Notification, 'id'>;
1335
- export interface CronReloadRequest {
1336
- data: 'nft' | 'staking';
1337
- }
1338
1356
  export interface KoniRequestSignatures {
1339
1357
  'pri(staking.submitTuringCancelCompound)': [RequestTuringCancelStakeCompound, SWTransactionResponse];
1340
1358
  'pri(staking.submitTuringCompound)': [RequestTuringStakeCompound, SWTransactionResponse];
@@ -1372,7 +1390,7 @@ export interface KoniRequestSignatures {
1372
1390
  'pri(assetSetting.update)': [AssetSettingUpdateReq, boolean];
1373
1391
  'pri(evmNft.submitTransaction)': [NftTransactionRequest, SWTransactionResponse];
1374
1392
  'pri(evmNft.getTransaction)': [NftTransactionRequest, EvmNftTransaction];
1375
- 'pri(substrateNft.submitTransaction)': [NftTransactionRequest, SWTransactionResponse];
1393
+ 'pri(substrateNft.submitTransaction)': [RequestSubstrateNftSubmitTransaction, NftTransactionResponse];
1376
1394
  'pri(substrateNft.getTransaction)': [NftTransactionRequest, SubstrateNftTransaction];
1377
1395
  'pri(nft.getNft)': [null, NftJson];
1378
1396
  'pri(nft.getSubscription)': [RequestSubscribeNft, NftJson, NftJson];
@@ -1416,9 +1434,10 @@ export interface KoniRequestSignatures {
1416
1434
  'pri(accounts.subscribeWithCurrentAddress)': [RequestAccountSubscribe, AccountsWithCurrentAddress, AccountsWithCurrentAddress];
1417
1435
  'pri(accounts.subscribeAccountsInputAddress)': [RequestAccountSubscribe, string, OptionInputAddress];
1418
1436
  'pri(accounts.saveRecent)': [RequestSaveRecentAccount, SingleAddress];
1437
+ 'pri(accounts.triggerSubscription)': [null, boolean];
1419
1438
  'pri(accounts.get.meta)': [RequestAccountMeta, ResponseAccountMeta];
1420
1439
  'pri(accounts.updateCurrentAddress)': [string, boolean];
1421
- 'pri(currentAccount.saveAddress)': [RequestCurrentAccountAddress, CurrentAccountInfo];
1440
+ 'pri(currentAccount.saveAddress)': [RequestCurrentAccountAddress, boolean, CurrentAccountInfo];
1422
1441
  'pri(settings.changeBalancesVisibility)': [null, boolean, UiSettings];
1423
1442
  'pri(settings.subscribe)': [null, UiSettings, UiSettings];
1424
1443
  'pri(settings.saveAccountAllLogo)': [string, boolean, UiSettings];
@@ -1467,7 +1486,6 @@ export interface KoniRequestSignatures {
1467
1486
  'pri(transactions.getOne)': [RequestGetTransaction, SWTransactionResult];
1468
1487
  'pri(transactions.subscribe)': [null, Record<string, SWTransactionResult>, Record<string, SWTransactionResult>];
1469
1488
  'pri(notifications.subscribe)': [null, Notification[], Notification[]];
1470
- 'pri(cron.reload)': [CronReloadRequest, boolean];
1471
1489
  'mobile(ping)': [null, string];
1472
1490
  'mobile(cronAndSubscription.init)': [RequestInitCronAndSubscription, ActiveCronAndSubscriptionMap];
1473
1491
  'mobile(cronAndSubscription.activeService.subscribe)': [null, ActiveCronAndSubscriptionMap, ActiveCronAndSubscriptionMap];
@@ -90,6 +90,7 @@ export let ExtrinsicStatus;
90
90
  })(ExtrinsicStatus || (ExtrinsicStatus = {}));
91
91
  export let BasicTxErrorType;
92
92
  (function (BasicTxErrorType) {
93
+ BasicTxErrorType["NOT_ENOUGH_FEE"] = "NOT_ENOUGH_FEE";
93
94
  BasicTxErrorType["NOT_ENOUGH_BALANCE"] = "NOT_ENOUGH_BALANCE";
94
95
  BasicTxErrorType["CHAIN_DISCONNECTED"] = "CHAIN_DISCONNECTED";
95
96
  BasicTxErrorType["INVALID_PARAMS"] = "INVALID_PARAMS";
@@ -104,11 +105,12 @@ export let BasicTxErrorType;
104
105
  })(BasicTxErrorType || (BasicTxErrorType = {}));
105
106
  export let StakingTxErrorType;
106
107
  (function (StakingTxErrorType) {
107
- StakingTxErrorType["NOT_ENOUGH_MIN_STAKE"] = "NOT_ENOUGH_MIN_STAKE";
108
- StakingTxErrorType["EXCEED_MAX_NOMINATIONS"] = "EXCEED_MAX_NOMINATIONS";
109
- StakingTxErrorType["EXIST_UNSTAKING_REQUEST"] = "EXIST_UNSTAKING_REQUEST";
110
- StakingTxErrorType["INVALID_ACTIVE_STAKE"] = "INVALID_ACTIVE_STAKE";
111
- StakingTxErrorType["EXCEED_MAX_UNSTAKING"] = "EXCEED_MAX_UNSTAKING";
108
+ StakingTxErrorType["STAKING_ERROR"] = "stakingError";
109
+ StakingTxErrorType["UN_STAKING_ERROR"] = "unStakingError";
110
+ StakingTxErrorType["WITHDRAW_STAKING_ERROR"] = "withdrawStakingError";
111
+ StakingTxErrorType["CLAIM_REWARD_ERROR"] = "claimRewardError";
112
+ StakingTxErrorType["CREATE_COMPOUND_ERROR"] = "createCompoundError";
113
+ StakingTxErrorType["CANCEL_COMPOUND_ERROR"] = "cancelCompoundError";
112
114
  })(StakingTxErrorType || (StakingTxErrorType = {}));
113
115
  export let TransferTxErrorType;
114
116
  (function (TransferTxErrorType) {
@@ -207,7 +209,6 @@ export let StakingStatus;
207
209
  StakingStatus["EARNING_REWARD"] = "EARNING_REWARD";
208
210
  StakingStatus["PARTIALLY_EARNING"] = "PARTIALLY_EARNING";
209
211
  StakingStatus["NOT_EARNING"] = "NOT_EARNING";
210
- StakingStatus["WAITING"] = "WAITING";
211
212
  })(StakingStatus || (StakingStatus = {}));
212
213
  export let ChainEditStandard;
213
214
 
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { SWError } from '@subwallet/extension-base/background/errors/SWError';
5
- import { BasicTxErrorType, StakingTxErrorType } from '@subwallet/extension-base/background/KoniTypes';
5
+ import { BasicTxErrorType } from '@subwallet/extension-base/background/KoniTypes';
6
6
 
7
7
  // Todo: finish this map in the future
8
8
  const defaultErrorMap = {
@@ -49,26 +49,6 @@ const defaultErrorMap = {
49
49
  [BasicTxErrorType.UNSUPPORTED]: {
50
50
  message: 'This transaction is not supported',
51
51
  code: undefined
52
- },
53
- [StakingTxErrorType.NOT_ENOUGH_MIN_STAKE]: {
54
- message: 'Not enough min stake',
55
- code: undefined
56
- },
57
- [StakingTxErrorType.EXCEED_MAX_NOMINATIONS]: {
58
- message: 'Exceed max nominations',
59
- code: undefined
60
- },
61
- [StakingTxErrorType.EXIST_UNSTAKING_REQUEST]: {
62
- message: 'Exist unstaking request',
63
- code: undefined
64
- },
65
- [StakingTxErrorType.INVALID_ACTIVE_STAKE]: {
66
- message: 'Invalid active stake',
67
- code: undefined
68
- },
69
- [StakingTxErrorType.EXCEED_MAX_UNSTAKING]: {
70
- message: 'Exceed max unstaking',
71
- code: undefined
72
52
  }
73
53
  };
74
54
  export class TransactionError extends SWError {
@@ -95,6 +95,7 @@ exports.ExtrinsicStatus = ExtrinsicStatus;
95
95
  let BasicTxErrorType;
96
96
  exports.BasicTxErrorType = BasicTxErrorType;
97
97
  (function (BasicTxErrorType) {
98
+ BasicTxErrorType["NOT_ENOUGH_FEE"] = "NOT_ENOUGH_FEE";
98
99
  BasicTxErrorType["NOT_ENOUGH_BALANCE"] = "NOT_ENOUGH_BALANCE";
99
100
  BasicTxErrorType["CHAIN_DISCONNECTED"] = "CHAIN_DISCONNECTED";
100
101
  BasicTxErrorType["INVALID_PARAMS"] = "INVALID_PARAMS";
@@ -110,11 +111,12 @@ exports.BasicTxErrorType = BasicTxErrorType;
110
111
  let StakingTxErrorType;
111
112
  exports.StakingTxErrorType = StakingTxErrorType;
112
113
  (function (StakingTxErrorType) {
113
- StakingTxErrorType["NOT_ENOUGH_MIN_STAKE"] = "NOT_ENOUGH_MIN_STAKE";
114
- StakingTxErrorType["EXCEED_MAX_NOMINATIONS"] = "EXCEED_MAX_NOMINATIONS";
115
- StakingTxErrorType["EXIST_UNSTAKING_REQUEST"] = "EXIST_UNSTAKING_REQUEST";
116
- StakingTxErrorType["INVALID_ACTIVE_STAKE"] = "INVALID_ACTIVE_STAKE";
117
- StakingTxErrorType["EXCEED_MAX_UNSTAKING"] = "EXCEED_MAX_UNSTAKING";
114
+ StakingTxErrorType["STAKING_ERROR"] = "stakingError";
115
+ StakingTxErrorType["UN_STAKING_ERROR"] = "unStakingError";
116
+ StakingTxErrorType["WITHDRAW_STAKING_ERROR"] = "withdrawStakingError";
117
+ StakingTxErrorType["CLAIM_REWARD_ERROR"] = "claimRewardError";
118
+ StakingTxErrorType["CREATE_COMPOUND_ERROR"] = "createCompoundError";
119
+ StakingTxErrorType["CANCEL_COMPOUND_ERROR"] = "cancelCompoundError";
118
120
  })(StakingTxErrorType || (exports.StakingTxErrorType = StakingTxErrorType = {}));
119
121
  let TransferTxErrorType;
120
122
  exports.TransferTxErrorType = TransferTxErrorType;
@@ -215,7 +217,6 @@ exports.StakingStatus = StakingStatus;
215
217
  StakingStatus["EARNING_REWARD"] = "EARNING_REWARD";
216
218
  StakingStatus["PARTIALLY_EARNING"] = "PARTIALLY_EARNING";
217
219
  StakingStatus["NOT_EARNING"] = "NOT_EARNING";
218
- StakingStatus["WAITING"] = "WAITING";
219
220
  })(StakingStatus || (exports.StakingStatus = StakingStatus = {}));
220
221
  let ChainEditStandard; // ChainService
221
222
  // for custom network
@@ -54,26 +54,6 @@ const defaultErrorMap = {
54
54
  [_KoniTypes.BasicTxErrorType.UNSUPPORTED]: {
55
55
  message: 'This transaction is not supported',
56
56
  code: undefined
57
- },
58
- [_KoniTypes.StakingTxErrorType.NOT_ENOUGH_MIN_STAKE]: {
59
- message: 'Not enough min stake',
60
- code: undefined
61
- },
62
- [_KoniTypes.StakingTxErrorType.EXCEED_MAX_NOMINATIONS]: {
63
- message: 'Exceed max nominations',
64
- code: undefined
65
- },
66
- [_KoniTypes.StakingTxErrorType.EXIST_UNSTAKING_REQUEST]: {
67
- message: 'Exist unstaking request',
68
- code: undefined
69
- },
70
- [_KoniTypes.StakingTxErrorType.INVALID_ACTIVE_STAKE]: {
71
- message: 'Invalid active stake',
72
- code: undefined
73
- },
74
- [_KoniTypes.StakingTxErrorType.EXCEED_MAX_UNSTAKING]: {
75
- message: 'Exceed max unstaking',
76
- code: undefined
77
57
  }
78
58
  };
79
59
  class TransactionError extends _SWError.SWError {
@@ -5,16 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  var _exportNames = {
7
7
  CRON_REFRESH_PRICE_INTERVAL: true,
8
+ DOTSAMA_API_TIMEOUT: true,
9
+ DOTSAMA_AUTO_CONNECT_MS: true,
10
+ DOTSAMA_MAX_CONTINUE_RETRY: true,
8
11
  CRON_AUTO_RECOVER_DOTSAMA_INTERVAL: true,
9
12
  CRON_AUTO_RECOVER_WEB3_INTERVAL: true,
10
13
  ACALA_REFRESH_CROWDLOAN_INTERVAL: true,
14
+ ACALA_REFRESH_BALANCE_INTERVAL: true,
11
15
  ASTAR_REFRESH_BALANCE_INTERVAL: true,
12
16
  SUB_TOKEN_REFRESH_BALANCE_INTERVAL: true,
17
+ SUBSCRIBE_BALANCE_FAST_INTERVAL: true,
13
18
  CRON_REFRESH_NFT_INTERVAL: true,
14
19
  CRON_REFRESH_STAKING_REWARD_INTERVAL: true,
15
20
  CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL: true,
16
21
  CRON_REFRESH_HISTORY_INTERVAL: true,
17
22
  CRON_GET_API_MAP_STATUS: true,
23
+ CRON_REFRESH_STAKING_DATA: true,
18
24
  CRON_REFRESH_CHAIN_STAKING_METADATA: true,
19
25
  CRON_REFRESH_CHAIN_NOMINATOR_METADATA: true,
20
26
  ALL_ACCOUNT_KEY: true,
@@ -24,7 +30,7 @@ var _exportNames = {
24
30
  IGNORE_QR_SIGNER: true,
25
31
  DEFAULT_TIME_AUTO_LOCK: true
26
32
  };
27
- exports.SUB_TOKEN_REFRESH_BALANCE_INTERVAL = exports.IGNORE_QR_SIGNER = exports.IGNORE_GET_SUBSTRATE_FEATURES_LIST = exports.DEFAULT_TIME_AUTO_LOCK = exports.CRON_REFRESH_STAKING_REWARD_INTERVAL = exports.CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL = exports.CRON_REFRESH_PRICE_INTERVAL = exports.CRON_REFRESH_NFT_INTERVAL = exports.CRON_REFRESH_HISTORY_INTERVAL = exports.CRON_REFRESH_CHAIN_STAKING_METADATA = exports.CRON_REFRESH_CHAIN_NOMINATOR_METADATA = exports.CRON_GET_API_MAP_STATUS = exports.CRON_AUTO_RECOVER_WEB3_INTERVAL = exports.CRON_AUTO_RECOVER_DOTSAMA_INTERVAL = exports.ASTAR_REFRESH_BALANCE_INTERVAL = exports.ALL_NETWORK_KEY = exports.ALL_GENESIS_HASH = exports.ALL_ACCOUNT_KEY = exports.ACALA_REFRESH_CROWDLOAN_INTERVAL = void 0;
33
+ exports.SUB_TOKEN_REFRESH_BALANCE_INTERVAL = exports.SUBSCRIBE_BALANCE_FAST_INTERVAL = exports.IGNORE_QR_SIGNER = exports.IGNORE_GET_SUBSTRATE_FEATURES_LIST = exports.DOTSAMA_MAX_CONTINUE_RETRY = exports.DOTSAMA_AUTO_CONNECT_MS = exports.DOTSAMA_API_TIMEOUT = exports.DEFAULT_TIME_AUTO_LOCK = exports.CRON_REFRESH_STAKING_REWARD_INTERVAL = exports.CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL = exports.CRON_REFRESH_STAKING_DATA = exports.CRON_REFRESH_PRICE_INTERVAL = exports.CRON_REFRESH_NFT_INTERVAL = exports.CRON_REFRESH_HISTORY_INTERVAL = exports.CRON_REFRESH_CHAIN_STAKING_METADATA = exports.CRON_REFRESH_CHAIN_NOMINATOR_METADATA = exports.CRON_GET_API_MAP_STATUS = exports.CRON_AUTO_RECOVER_WEB3_INTERVAL = exports.CRON_AUTO_RECOVER_DOTSAMA_INTERVAL = exports.ASTAR_REFRESH_BALANCE_INTERVAL = exports.ALL_NETWORK_KEY = exports.ALL_GENESIS_HASH = exports.ALL_ACCOUNT_KEY = exports.ACALA_REFRESH_CROWDLOAN_INTERVAL = exports.ACALA_REFRESH_BALANCE_INTERVAL = void 0;
28
34
  var _staking = require("./staking");
29
35
  Object.keys(_staking).forEach(function (key) {
30
36
  if (key === "default" || key === "__esModule") return;
@@ -42,29 +48,41 @@ Object.keys(_staking).forEach(function (key) {
42
48
 
43
49
  const CRON_REFRESH_PRICE_INTERVAL = 30000;
44
50
  exports.CRON_REFRESH_PRICE_INTERVAL = CRON_REFRESH_PRICE_INTERVAL;
51
+ const DOTSAMA_API_TIMEOUT = 30000;
52
+ exports.DOTSAMA_API_TIMEOUT = DOTSAMA_API_TIMEOUT;
53
+ const DOTSAMA_AUTO_CONNECT_MS = 3000;
54
+ exports.DOTSAMA_AUTO_CONNECT_MS = DOTSAMA_AUTO_CONNECT_MS;
55
+ const DOTSAMA_MAX_CONTINUE_RETRY = 2;
56
+ exports.DOTSAMA_MAX_CONTINUE_RETRY = DOTSAMA_MAX_CONTINUE_RETRY;
45
57
  const CRON_AUTO_RECOVER_DOTSAMA_INTERVAL = 60000;
46
58
  exports.CRON_AUTO_RECOVER_DOTSAMA_INTERVAL = CRON_AUTO_RECOVER_DOTSAMA_INTERVAL;
47
59
  const CRON_AUTO_RECOVER_WEB3_INTERVAL = 90000;
48
60
  exports.CRON_AUTO_RECOVER_WEB3_INTERVAL = CRON_AUTO_RECOVER_WEB3_INTERVAL;
49
61
  const ACALA_REFRESH_CROWDLOAN_INTERVAL = 300000;
50
62
  exports.ACALA_REFRESH_CROWDLOAN_INTERVAL = ACALA_REFRESH_CROWDLOAN_INTERVAL;
51
- const ASTAR_REFRESH_BALANCE_INTERVAL = 60000;
63
+ const ACALA_REFRESH_BALANCE_INTERVAL = 30000;
64
+ exports.ACALA_REFRESH_BALANCE_INTERVAL = ACALA_REFRESH_BALANCE_INTERVAL;
65
+ const ASTAR_REFRESH_BALANCE_INTERVAL = 30000;
52
66
  exports.ASTAR_REFRESH_BALANCE_INTERVAL = ASTAR_REFRESH_BALANCE_INTERVAL;
53
- const SUB_TOKEN_REFRESH_BALANCE_INTERVAL = 60000;
67
+ const SUB_TOKEN_REFRESH_BALANCE_INTERVAL = 30000;
54
68
  exports.SUB_TOKEN_REFRESH_BALANCE_INTERVAL = SUB_TOKEN_REFRESH_BALANCE_INTERVAL;
55
- const CRON_REFRESH_NFT_INTERVAL = 7200000;
69
+ const SUBSCRIBE_BALANCE_FAST_INTERVAL = 9000;
70
+ exports.SUBSCRIBE_BALANCE_FAST_INTERVAL = SUBSCRIBE_BALANCE_FAST_INTERVAL;
71
+ const CRON_REFRESH_NFT_INTERVAL = 900000;
56
72
  exports.CRON_REFRESH_NFT_INTERVAL = CRON_REFRESH_NFT_INTERVAL;
57
73
  const CRON_REFRESH_STAKING_REWARD_INTERVAL = 900000;
58
74
  exports.CRON_REFRESH_STAKING_REWARD_INTERVAL = CRON_REFRESH_STAKING_REWARD_INTERVAL;
59
- const CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL = 300000;
75
+ const CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL = 10000;
60
76
  exports.CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL = CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL;
61
- const CRON_REFRESH_HISTORY_INTERVAL = 900000;
77
+ const CRON_REFRESH_HISTORY_INTERVAL = 90000;
62
78
  exports.CRON_REFRESH_HISTORY_INTERVAL = CRON_REFRESH_HISTORY_INTERVAL;
63
- const CRON_GET_API_MAP_STATUS = 10000;
79
+ const CRON_GET_API_MAP_STATUS = 5000;
64
80
  exports.CRON_GET_API_MAP_STATUS = CRON_GET_API_MAP_STATUS;
81
+ const CRON_REFRESH_STAKING_DATA = 30000;
82
+ exports.CRON_REFRESH_STAKING_DATA = CRON_REFRESH_STAKING_DATA;
65
83
  const CRON_REFRESH_CHAIN_STAKING_METADATA = 900000;
66
84
  exports.CRON_REFRESH_CHAIN_STAKING_METADATA = CRON_REFRESH_CHAIN_STAKING_METADATA;
67
- const CRON_REFRESH_CHAIN_NOMINATOR_METADATA = 1800000;
85
+ const CRON_REFRESH_CHAIN_NOMINATOR_METADATA = 900000;
68
86
  exports.CRON_REFRESH_CHAIN_NOMINATOR_METADATA = CRON_REFRESH_CHAIN_NOMINATOR_METADATA;
69
87
  const ALL_ACCOUNT_KEY = 'ALL';
70
88
  exports.ALL_ACCOUNT_KEY = ALL_ACCOUNT_KEY;