@subwallet/extension-base 1.0.2-1 → 1.0.2-1b

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