@subwallet/extension-base 1.3.54-1 → 1.3.55-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 (129) hide show
  1. package/background/errors/BalanceError.js +4 -4
  2. package/background/errors/BitcoinProviderError.js +7 -7
  3. package/background/errors/EvmProviderError.js +8 -8
  4. package/background/errors/ProviderError.js +6 -5
  5. package/background/errors/SwapError.js +14 -13
  6. package/background/errors/TransactionError.js +22 -22
  7. package/background/warnings/TransactionWarning.js +2 -2
  8. package/cjs/background/errors/BalanceError.js +4 -4
  9. package/cjs/background/errors/BitcoinProviderError.js +7 -7
  10. package/cjs/background/errors/EvmProviderError.js +8 -8
  11. package/cjs/background/errors/ProviderError.js +6 -5
  12. package/cjs/background/errors/SwapError.js +14 -13
  13. package/cjs/background/errors/TransactionError.js +22 -22
  14. package/cjs/background/warnings/TransactionWarning.js +2 -2
  15. package/cjs/core/logic-validation/index.js +15 -3
  16. package/cjs/core/logic-validation/request.js +37 -37
  17. package/cjs/core/logic-validation/transfer.js +21 -17
  18. package/cjs/koni/api/dotsama/parseTransaction.js +1 -1
  19. package/cjs/koni/api/staking/bonding/relayChain.js +1 -1
  20. package/cjs/koni/api/staking/bonding/utils.js +16 -16
  21. package/cjs/koni/api/staking/paraChain.js +1 -1
  22. package/cjs/koni/background/handlers/Extension.js +28 -26
  23. package/cjs/koni/background/handlers/State.js +19 -14
  24. package/cjs/koni/background/handlers/Tabs.js +23 -1
  25. package/cjs/packageInfo.js +1 -1
  26. package/cjs/services/balance-service/index.js +3 -3
  27. package/cjs/services/balance-service/transfer/smart-contract.js +1 -1
  28. package/cjs/services/balance-service/transfer/xcm/index.js +7 -1
  29. package/cjs/services/balance-service/transfer/xcm/utils.js +24 -18
  30. package/cjs/services/chain-service/constants.js +2 -2
  31. package/cjs/services/chain-service/handler/types.js +1 -0
  32. package/cjs/services/chain-service/utils/patch.js +1 -1
  33. package/cjs/services/earning-service/constants/chains.js +1 -2
  34. package/cjs/services/earning-service/handlers/base.js +2 -1
  35. package/cjs/services/earning-service/handlers/lending/base.js +3 -3
  36. package/cjs/services/earning-service/handlers/liquid-staking/base.js +3 -3
  37. package/cjs/services/earning-service/handlers/native-staking/amplitude.js +1 -1
  38. package/cjs/services/earning-service/handlers/native-staking/base-para.js +1 -1
  39. package/cjs/services/earning-service/handlers/native-staking/relay-chain.js +2 -2
  40. package/cjs/services/earning-service/handlers/native-staking/tao.js +26 -6
  41. package/cjs/services/earning-service/handlers/nomination-pool/index.js +2 -2
  42. package/cjs/services/earning-service/handlers/special.js +12 -9
  43. package/cjs/services/keyring-service/context/handlers/Derive.js +1 -1
  44. package/cjs/services/keyring-service/context/handlers/Json.js +11 -11
  45. package/cjs/services/keyring-service/context/handlers/Ledger.js +3 -3
  46. package/cjs/services/keyring-service/context/handlers/Mnemonic.js +10 -10
  47. package/cjs/services/keyring-service/context/handlers/Modify.js +3 -3
  48. package/cjs/services/keyring-service/context/handlers/Secret.js +7 -7
  49. package/cjs/services/migration-service/scripts/DeleteEarningData.js +1 -1
  50. package/cjs/services/migration-service/scripts/MigrateTransactionHistoryBySymbol.js +1 -6
  51. package/cjs/services/migration-service/scripts/databases/MigrateAssetSetting.js +1 -6
  52. package/cjs/services/migration-service/scripts/index.js +3 -3
  53. package/cjs/services/request-service/handler/BitcoinRequestHandler.js +1 -1
  54. package/cjs/services/request-service/handler/CardanoRequestHandler.js +2 -2
  55. package/cjs/services/request-service/handler/EvmRequestHandler.js +5 -5
  56. package/cjs/services/request-service/handler/TonRequestHandler.js +2 -2
  57. package/cjs/services/setting-service/i18n/extend.js +1 -1
  58. package/cjs/services/swap-service/handler/base-handler.js +123 -11
  59. package/cjs/services/swap-service/index.js +1 -1
  60. package/cjs/services/transaction-service/index.js +12 -12
  61. package/cjs/services/transaction-service/utils.js +4 -1
  62. package/cjs/types/account/error/common.js +5 -4
  63. package/cjs/types/account/error/derive.js +8 -7
  64. package/cjs/utils/account/derive/info/solo.js +2 -2
  65. package/cjs/utils/eth/parseTransaction/index.js +1 -1
  66. package/cjs/utils/fee/transfer.js +8 -3
  67. package/cjs/utils/index.js +1 -1
  68. package/core/logic-validation/index.js +15 -3
  69. package/core/logic-validation/request.js +37 -37
  70. package/core/logic-validation/transfer.js +21 -17
  71. package/koni/api/dotsama/parseTransaction.js +1 -1
  72. package/koni/api/staking/bonding/relayChain.js +1 -1
  73. package/koni/api/staking/bonding/utils.js +16 -16
  74. package/koni/api/staking/paraChain.js +1 -1
  75. package/koni/background/handlers/Extension.js +28 -26
  76. package/koni/background/handlers/State.d.ts +1 -0
  77. package/koni/background/handlers/State.js +19 -14
  78. package/koni/background/handlers/Tabs.js +23 -1
  79. package/package.json +6 -6
  80. package/packageInfo.js +1 -1
  81. package/services/balance-service/index.js +3 -3
  82. package/services/balance-service/transfer/smart-contract.js +1 -1
  83. package/services/balance-service/transfer/xcm/index.js +7 -1
  84. package/services/balance-service/transfer/xcm/utils.d.ts +6 -0
  85. package/services/balance-service/transfer/xcm/utils.js +24 -18
  86. package/services/chain-service/constants.js +2 -2
  87. package/services/chain-service/handler/types.d.ts +2 -1
  88. package/services/chain-service/handler/types.js +1 -0
  89. package/services/chain-service/utils/patch.d.ts +1 -1
  90. package/services/chain-service/utils/patch.js +1 -1
  91. package/services/earning-service/constants/chains.d.ts +0 -1
  92. package/services/earning-service/constants/chains.js +1 -2
  93. package/services/earning-service/handlers/base.js +3 -2
  94. package/services/earning-service/handlers/lending/base.js +3 -3
  95. package/services/earning-service/handlers/liquid-staking/base.js +3 -3
  96. package/services/earning-service/handlers/native-staking/amplitude.js +1 -1
  97. package/services/earning-service/handlers/native-staking/base-para.js +1 -1
  98. package/services/earning-service/handlers/native-staking/relay-chain.js +2 -2
  99. package/services/earning-service/handlers/native-staking/tao.js +26 -6
  100. package/services/earning-service/handlers/nomination-pool/index.js +2 -2
  101. package/services/earning-service/handlers/special.js +12 -9
  102. package/services/keyring-service/context/handlers/Derive.js +1 -1
  103. package/services/keyring-service/context/handlers/Json.js +11 -11
  104. package/services/keyring-service/context/handlers/Ledger.js +3 -3
  105. package/services/keyring-service/context/handlers/Mnemonic.js +10 -10
  106. package/services/keyring-service/context/handlers/Modify.js +3 -3
  107. package/services/keyring-service/context/handlers/Secret.js +7 -7
  108. package/services/migration-service/scripts/DeleteEarningData.js +1 -1
  109. package/services/migration-service/scripts/MigrateTransactionHistoryBySymbol.js +1 -6
  110. package/services/migration-service/scripts/databases/MigrateAssetSetting.js +1 -6
  111. package/services/migration-service/scripts/index.js +3 -3
  112. package/services/request-service/handler/BitcoinRequestHandler.js +1 -1
  113. package/services/request-service/handler/CardanoRequestHandler.js +2 -2
  114. package/services/request-service/handler/EvmRequestHandler.js +5 -5
  115. package/services/request-service/handler/TonRequestHandler.js +2 -2
  116. package/services/setting-service/i18n/extend.js +1 -1
  117. package/services/swap-service/handler/base-handler.d.ts +2 -1
  118. package/services/swap-service/handler/base-handler.js +124 -12
  119. package/services/swap-service/index.js +1 -1
  120. package/services/transaction-service/index.js +12 -12
  121. package/services/transaction-service/utils.js +4 -1
  122. package/types/account/error/common.js +5 -4
  123. package/types/account/error/derive.js +8 -7
  124. package/types/balance/transfer.d.ts +1 -0
  125. package/utils/account/derive/info/solo.js +2 -2
  126. package/utils/eth/parseTransaction/index.js +1 -1
  127. package/utils/fee/transfer.d.ts +3 -1
  128. package/utils/fee/transfer.js +5 -1
  129. package/utils/index.js +1 -1
@@ -11,4 +11,5 @@ export let _CHAIN_VALIDATION_ERROR;
11
11
  _CHAIN_VALIDATION_ERROR["NONE"] = "none";
12
12
  _CHAIN_VALIDATION_ERROR["CONNECTION_FAILURE"] = "connectionFailure";
13
13
  _CHAIN_VALIDATION_ERROR["PROVIDER_NOT_SAME_CHAIN"] = "providerNotSameChain";
14
+ _CHAIN_VALIDATION_ERROR["UNSUPPORTED_CHAIN_CANNOT_ADD"] = "unsupportedChainCannotAdd";
14
15
  })(_CHAIN_VALIDATION_ERROR || (_CHAIN_VALIDATION_ERROR = {}));
@@ -1,5 +1,5 @@
1
1
  import { _ChainAsset, _ChainInfo, _MultiChainAsset } from '@subwallet/chain-list/types';
2
- export declare const ChainListVersion = "0.2.112";
2
+ export declare const ChainListVersion = "0.2.113";
3
3
  export interface PatchInfo {
4
4
  patchVersion: string;
5
5
  appliedVersion: string;
@@ -5,7 +5,7 @@ const PRODUCTION_BRANCHES = ['master', 'webapp', 'webapp-dev'];
5
5
  const branchName = process.env.BRANCH_NAME || 'subwallet-dev';
6
6
  const fetchDomain = process.env.PATCH_CHAIN_LIST_URL || (PRODUCTION_BRANCHES.indexOf(branchName) > -1 ? 'https://chain-list-assets.subwallet.app' : 'https://dev.sw-chain-list-assets.pages.dev');
7
7
  const fetchFile = PRODUCTION_BRANCHES.indexOf(branchName) > -1 ? 'list.json' : 'preview.json';
8
- export const ChainListVersion = '0.2.112'; // update this when build chain-list
8
+ export const ChainListVersion = '0.2.113'; // update this when build chain-list
9
9
 
10
10
  // todo: move this interface to chainlist
11
11
 
@@ -4,7 +4,6 @@ export declare const _STAKING_CHAIN_GROUP: {
4
4
  para: string[];
5
5
  astar: string[];
6
6
  amplitude: string[];
7
- kilt: string[];
8
7
  nominationPool: string[];
9
8
  bifrost: string[];
10
9
  aleph: string[];
@@ -6,9 +6,8 @@ export const _STAKING_CHAIN_GROUP = {
6
6
  assetHub: ['statemine', 'statemint', 'westend_assethub'],
7
7
  para: ['moonbeam', 'moonriver', 'moonbase', 'turing', 'turingStaging', 'bifrost', 'bifrost_testnet', 'calamari_test', 'calamari', 'manta_network', 'polimec'],
8
8
  astar: ['astar', 'shiden', 'shibuya'],
9
- amplitude: ['amplitude', 'amplitude_test', 'kilt', 'kilt_peregrine', 'pendulum', 'krest_network'],
9
+ amplitude: ['amplitude', 'amplitude_test', 'pendulum', 'krest_network'],
10
10
  // amplitude and kilt only share some common logic
11
- kilt: ['kilt', 'kilt_peregrine'],
12
11
  nominationPool: ['polkadot', 'kusama', 'westend', 'alephTest', 'aleph', 'kate', 'vara_network', 'goldberg_testnet', 'availTuringTest', 'avail_mainnet', 'vara_testnet', 'cere', 'analog_timechain'],
13
12
  bifrost: ['bifrost', 'bifrost_testnet'],
14
13
  aleph: ['aleph', 'alephTest'],
@@ -1,7 +1,7 @@
1
1
  // Copyright 2019-2022 @subwallet/extension-base
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { ChainType } from '@subwallet/extension-base/background/KoniTypes';
4
+ import { ChainType, ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
5
5
  import { ALL_ACCOUNT_KEY } from '@subwallet/extension-base/constants';
6
6
  import { DEFAULT_YIELD_FIRST_STEP, STAKING_IDENTITY_API_SLUG } from '@subwallet/extension-base/services/earning-service/constants';
7
7
  import { createClaimNotification, createWithdrawNotifications } from '@subwallet/extension-base/services/inapp-notification-service/utils';
@@ -153,7 +153,8 @@ export default class BasePoolHandler {
153
153
  };
154
154
  }
155
155
  const nativeTokenInfo = this.state.chainService.getNativeTokenInfo(this.chain);
156
- const nativeTokenBalance = await this.state.balanceService.getTransferableBalance(request.address, this.chain);
156
+ // Use TRANSFER_BALANCE extrinsic in order to get transferable balanace without minus ED
157
+ const nativeTokenBalance = await this.state.balanceService.getTransferableBalance(request.address, this.chain, undefined, ExtrinsicType.TRANSFER_BALANCE);
157
158
  const bnNativeTokenBalance = new BN(nativeTokenBalance.value);
158
159
  const bnMinBalanceToJoin = new BN(((_poolInfo$statistic2 = poolInfo.statistic) === null || _poolInfo$statistic2 === void 0 ? void 0 : (_poolInfo$statistic2$ = _poolInfo$statistic2.earningThreshold) === null || _poolInfo$statistic2$ === void 0 ? void 0 : _poolInfo$statistic2$.join) || '0').add(new BN(poolInfo.metadata.maintainBalance));
159
160
  if (bnNativeTokenBalance.lte(bnMinBalanceToJoin)) {
@@ -37,11 +37,11 @@ export default class BaseLendingPoolHandler extends BaseSpecialStakingPoolHandle
37
37
  const maxUnstakeRequest = poolInfo.statistic.maxWithdrawalRequestPerFarmer;
38
38
  const derivativeTokenInfo = this.state.getAssetBySlug(this.derivativeAssets[0]);
39
39
  if (bnAmount.lte(BN_ZERO)) {
40
- return [new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('Amount must be greater than 0'))];
40
+ return [new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('bg.EARNING.services.service.earning.lending.amountMustBeGreaterThanZero'))];
41
41
  }
42
42
  if (bnAmount.lt(minUnstake)) {
43
43
  const minUnstakeStr = formatNumber(minUnstake.toString(), derivativeTokenInfo.decimals || 0);
44
- errors.push(new TransactionError(StakingTxErrorType.NOT_ENOUGH_MIN_UNSTAKE, t('You need to unstake at least {{amount}} {{token}}', {
44
+ errors.push(new TransactionError(StakingTxErrorType.NOT_ENOUGH_MIN_UNSTAKE, t('bg.EARNING.services.service.earning.lending.unstakeMinimumAmount', {
45
45
  replace: {
46
46
  amount: minUnstakeStr,
47
47
  token: derivativeTokenInfo.symbol
@@ -54,7 +54,7 @@ export default class BaseLendingPoolHandler extends BaseSpecialStakingPoolHandle
54
54
  }
55
55
 
56
56
  if (poolPosition.unstakings.length > maxUnstakeRequest) {
57
- errors.push(new TransactionError(StakingTxErrorType.EXCEED_MAX_UNSTAKING, t('You cannot unstake more than {{number}} times', {
57
+ errors.push(new TransactionError(StakingTxErrorType.EXCEED_MAX_UNSTAKING, t('bg.EARNING.services.service.earning.lending.maxUnstakeTimes', {
58
58
  replace: {
59
59
  number: maxUnstakeRequest
60
60
  }
@@ -54,11 +54,11 @@ export default class BaseLiquidStakingPoolHandler extends BaseSpecialStakingPool
54
54
  const maxUnstakeRequest = poolInfo.statistic.maxWithdrawalRequestPerFarmer;
55
55
  const derivativeTokenInfo = this.state.getAssetBySlug(this.derivativeAssets[0]);
56
56
  if (bnAmount.lte(BN_ZERO)) {
57
- return [new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('Amount must be greater than 0'))];
57
+ return [new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('bg.EARNING.services.service.earning.liquidStaking.amountMustBeGreaterThanZero'))];
58
58
  }
59
59
  if (bnAmount.lt(minUnstake)) {
60
60
  const minUnstakeStr = formatNumber(minUnstake.toString(), derivativeTokenInfo.decimals || 0);
61
- errors.push(new TransactionError(StakingTxErrorType.NOT_ENOUGH_MIN_UNSTAKE, t('You need to unstake at least {{amount}} {{token}}', {
61
+ errors.push(new TransactionError(StakingTxErrorType.NOT_ENOUGH_MIN_UNSTAKE, t('bg.EARNING.services.service.earning.liquidStaking.unstakeMinimumAmount', {
62
62
  replace: {
63
63
  amount: minUnstakeStr,
64
64
  token: derivativeTokenInfo.symbol
@@ -71,7 +71,7 @@ export default class BaseLiquidStakingPoolHandler extends BaseSpecialStakingPool
71
71
  }
72
72
 
73
73
  if (poolPosition.unstakings.length > maxUnstakeRequest) {
74
- errors.push(new TransactionError(StakingTxErrorType.EXCEED_MAX_UNSTAKING, t('You cannot unstake more than {{number}} times', {
74
+ errors.push(new TransactionError(StakingTxErrorType.EXCEED_MAX_UNSTAKING, t('bg.EARNING.services.service.earning.liquidStaking.maxUnstakeTimes', {
75
75
  replace: {
76
76
  number: maxUnstakeRequest
77
77
  }
@@ -272,7 +272,7 @@ export default class AmplitudeNativeStakingPoolHandler extends BaseParaNativeSta
272
272
  let cancel = false;
273
273
  const substrateApi = this.substrateApi;
274
274
  await substrateApi.isReady;
275
- if (!_STAKING_CHAIN_GROUP.kilt.includes(this.chain) && !_STAKING_CHAIN_GROUP.krest_network.includes(this.chain)) {
275
+ if (!_STAKING_CHAIN_GROUP.krest_network.includes(this.chain)) {
276
276
  await Promise.all(useAddresses.map(async address => {
277
277
  const _unclaimedReward = await substrateApi.api.query.parachainStaking.rewards(address);
278
278
  if (cancel) {
@@ -107,7 +107,7 @@ export default class BaseParaNativeStakingPoolHandler extends BaseNativeStakingP
107
107
  }
108
108
  const bnAmount = new BN(amount);
109
109
  if (bnAmount.lte(BN_ZERO)) {
110
- errors.push(new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('Amount must be greater than 0')));
110
+ errors.push(new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('bg.EARNING.services.service.earning.nativeStakingPara.amountMustBeGreaterThanZero')));
111
111
  }
112
112
  let targetNomination;
113
113
  for (const nomination of poolPosition.nominations) {
@@ -627,7 +627,7 @@ export default class RelayNativeStakingPoolHandler extends BaseNativeStakingPool
627
627
  }
628
628
  const bnAmount = new BN(amount);
629
629
  if (bnAmount.lte(BN_ZERO)) {
630
- errors.push(new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('Amount must be greater than 0')));
630
+ errors.push(new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('bg.EARNING.services.service.earning.nativeStakingRelay.amountMustBeGreaterThanZero')));
631
631
  }
632
632
  const bnActiveStake = new BN(poolPosition.activeStake);
633
633
  const bnRemainingStake = bnActiveStake.sub(new BN(amount));
@@ -637,7 +637,7 @@ export default class RelayNativeStakingPoolHandler extends BaseNativeStakingPool
637
637
  errors.push(new TransactionError(StakingTxErrorType.INVALID_ACTIVE_STAKE));
638
638
  }
639
639
  if (poolPosition.unstakings.length > maxUnstake) {
640
- errors.push(new TransactionError(StakingTxErrorType.EXCEED_MAX_UNSTAKING, t('You cannot unstake more than {{number}} times', {
640
+ errors.push(new TransactionError(StakingTxErrorType.EXCEED_MAX_UNSTAKING, t('bg.EARNING.services.service.earning.nativeStakingRelay.maxUnstakeTimes', {
641
641
  replace: {
642
642
  number: maxUnstake
643
643
  }
@@ -526,7 +526,12 @@ export default class TaoNativeStakingPoolHandler extends BaseParaStakingPoolHand
526
526
  } = data;
527
527
  const bnMinStake = await this.getMinBond(subnetData === null || subnetData === void 0 ? void 0 : subnetData.netuid);
528
528
  if (new BigN(amount).lt(bnMinStake)) {
529
- return [new TransactionError(BasicTxErrorType.INVALID_PARAMS, t(`Insufficient stake. You need to stake at least ${formatNumber(bnMinStake, _getAssetDecimals(this.nativeToken))} ${_getAssetSymbol(this.nativeToken)} to earn rewards`))];
529
+ return [new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('bg.EARNING.services.service.earning.nativeStaking.tao.insufficientStakeToEarn', {
530
+ replace: {
531
+ bnMinStake: formatNumber(bnMinStake, _getAssetDecimals(this.nativeToken)),
532
+ symbol: _getAssetSymbol(this.nativeToken)
533
+ }
534
+ }))];
530
535
  }
531
536
  return baseErrors;
532
537
  }
@@ -562,7 +567,12 @@ export default class TaoNativeStakingPoolHandler extends BaseParaStakingPoolHand
562
567
  const minUnstake = minDelegatorStake.dividedBy(alphaToTaoPrice);
563
568
  if (new BigN(amount).lt(minUnstake)) {
564
569
  var _poolInfo$metadata$su2;
565
- return [new TransactionError(BasicTxErrorType.INVALID_PARAMS, t(`Amount too low. You need to unstake at least ${formatNumber(minUnstake, _getAssetDecimals(this.nativeToken))} ${((_poolInfo$metadata$su2 = poolInfo.metadata.subnetData) === null || _poolInfo$metadata$su2 === void 0 ? void 0 : _poolInfo$metadata$su2.subnetSymbol) || _getAssetSymbol(this.nativeToken)}`))];
570
+ return [new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('bg.EARNING.services.service.earning.nativeStaking.tao.unstakeAmountTooLow', {
571
+ replace: {
572
+ bnMinUnstake: formatNumber(minUnstake, _getAssetDecimals(this.nativeToken)),
573
+ symbol: ((_poolInfo$metadata$su2 = poolInfo.metadata.subnetData) === null || _poolInfo$metadata$su2 === void 0 ? void 0 : _poolInfo$metadata$su2.subnetSymbol) || _getAssetSymbol(this.nativeToken)
574
+ }
575
+ }))];
566
576
  }
567
577
  return baseErrors;
568
578
  }
@@ -587,10 +597,10 @@ export default class TaoNativeStakingPoolHandler extends BaseParaStakingPoolHand
587
597
  const selectedValidatorInfo = targetValidators[0];
588
598
  const destValidator = selectedValidatorInfo.address;
589
599
  if (new BigN(amount).lte(0)) {
590
- return Promise.reject(new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('Amount must be greater than 0')));
600
+ return Promise.reject(new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('bg.EARNING.services.service.earning.nativeStaking.tao.amountMustBeGreaterThanZero')));
591
601
  }
592
602
  if (originValidator === destValidator) {
593
- return Promise.reject(new TransactionError(BasicTxErrorType.INVALID_PARAMS, 'From validator is the same with to validator'));
603
+ return Promise.reject(new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('bg.EARNING.services.service.earning.nativeStaking.tao.fromValidatorSameAsTo')));
594
604
  }
595
605
  const alphaToTaoPrice = new BigN(await getAlphaToTaoRate(this.substrateApi, netuid));
596
606
  const bnMinStake = await this.getMinBond(netuid);
@@ -598,12 +608,22 @@ export default class TaoNativeStakingPoolHandler extends BaseParaStakingPoolHand
598
608
  const formattedMinUnstake = minUnstake.dividedBy(1000000).integerValue(BigN.ROUND_CEIL).dividedBy(1000);
599
609
  const bnMinMoveStake = formattedMinUnstake.multipliedBy(10 ** _getAssetDecimals(this.nativeToken));
600
610
  if (new BigN(amount).lt(bnMinMoveStake)) {
601
- return Promise.reject(new TransactionError(BasicTxErrorType.INVALID_PARAMS, t(`Amount too low. You need to move at least ${formattedMinUnstake.toString()} ${(metadata === null || metadata === void 0 ? void 0 : metadata.subnetSymbol) || ''}`)));
611
+ return Promise.reject(new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('bg.EARNING.services.service.earning.nativeStaking.tao.moveStakeAmountTooLow', {
612
+ replace: {
613
+ bnMinMoveStake: formattedMinUnstake.toString(),
614
+ symbol: (metadata === null || metadata === void 0 ? void 0 : metadata.subnetSymbol) || ''
615
+ }
616
+ })));
602
617
  }
603
618
 
604
619
  // Avoid remaining amount too low -> can't do anything with that amount
605
620
  if (!(maxAmount === amount) && new BigN(maxAmount).minus(new BigN(amount)).lt(bnMinMoveStake)) {
606
- return Promise.reject(new TransactionError(StakingTxErrorType.REMAINING_AMOUNT_TOO_LOW, t(`Your remaining stake on the initial validator will fall below minimum active stake and cannot be unstaked if you proceed with the chosen amount. Hit "Move all" to move all ${formatNumber(maxAmount, _getAssetDecimals(this.nativeToken))} ${(metadata === null || metadata === void 0 ? void 0 : metadata.subnetSymbol) || _getAssetSymbol(this.nativeToken)} to the new validator, or "Cancel" and lower the amount, then try again`)));
621
+ return Promise.reject(new TransactionError(StakingTxErrorType.REMAINING_AMOUNT_TOO_LOW, t('bg.EARNING.services.service.earning.nativeStaking.tao.remainingStakeBelowMinimumWarning', {
622
+ replace: {
623
+ maxAmount: formatNumber(maxAmount, _getAssetDecimals(this.nativeToken)),
624
+ subnetSymbol: (metadata === null || metadata === void 0 ? void 0 : metadata.subnetSymbol) || _getAssetSymbol(this.nativeToken)
625
+ }
626
+ })));
607
627
  }
608
628
  const extrinsic = chainApi.api.tx.subtensorModule.moveStake(originValidator, destValidator, netuid, netuid, amount);
609
629
  return extrinsic;
@@ -514,7 +514,7 @@ export default class NominationPoolHandler extends BasePoolHandler {
514
514
  }
515
515
  const bnAmount = new BN(amount);
516
516
  if (bnAmount.lte(BN_ZERO)) {
517
- errors.push(new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('Amount must be greater than 0')));
517
+ errors.push(new TransactionError(BasicTxErrorType.INVALID_PARAMS, t('bg.EARNING.services.service.earning.nominationPool.amountMustBeGreaterThanZero')));
518
518
  }
519
519
  const bnActiveStake = new BN(poolPosition.activeStake);
520
520
  const bnRemainingStake = bnActiveStake.sub(new BN(amount));
@@ -524,7 +524,7 @@ export default class NominationPoolHandler extends BasePoolHandler {
524
524
  errors.push(new TransactionError(StakingTxErrorType.INVALID_ACTIVE_STAKE));
525
525
  }
526
526
  if (poolPosition.unstakings.length > maxUnstake) {
527
- errors.push(new TransactionError(StakingTxErrorType.EXCEED_MAX_UNSTAKING, t('You cannot unstake more than {{number}} times', {
527
+ errors.push(new TransactionError(StakingTxErrorType.EXCEED_MAX_UNSTAKING, t('bg.EARNING.services.service.earning.nominationPool.maxUnstakeTimes', {
528
528
  replace: {
529
529
  number: maxUnstake
530
530
  }
@@ -92,7 +92,11 @@ export default class BaseSpecialStakingPoolHandler extends BasePoolHandler {
92
92
  const altName = altChain.name;
93
93
  const parsedMinJoinPool = formatNumber(missingAmount.toString(), inputAssetInfo.decimals || 0);
94
94
  const formatparsedMinJoinPool = isTheSame ? parsedMinJoinPool : Number(parsedMinJoinPool) + 0.01;
95
- const parsedMinAltJoinPool = formatNumber(missingAmount.add(existentialDeposit).toString(), inputAssetInfo.decimals || 0);
95
+
96
+ // If balance can not cover ED, add ED to the missing amount
97
+ const needExtraED = bnInputAssetBalance.eq(BN_ZERO) && bnAltInputAssetBalance.eq(BN_ZERO);
98
+ const totalMissingAlt = needExtraED ? missingAmount.add(existentialDeposit) : missingAmount;
99
+ const parsedMinAltJoinPool = formatNumber(totalMissingAlt.toString(), inputAssetInfo.decimals || 0);
96
100
  const formatParsedMinAltJoinPool = isTheSame ? parsedMinAltJoinPool : Number(parsedMinAltJoinPool) + 0.01;
97
101
  return {
98
102
  passed: false,
@@ -293,23 +297,22 @@ export default class BaseSpecialStakingPoolHandler extends BasePoolHandler {
293
297
  const inputTokenInfo = this.state.getAssetBySlug(this.inputAsset);
294
298
  const altInputTokenBalance = await this.state.balanceService.getTransferableBalance(params.address, altInputTokenInfo.originChain, altInputTokenSlug);
295
299
  const missingAmount = bnAmount.sub(bnInputTokenBalance); // TODO: what if input token is not LOCAL ??
296
- const xcmFee = new BN(path.totalFee[1].amount || '0');
297
- const xcmAmount = missingAmount.add(xcmFee);
300
+ const xcmFeeValidate = new BN(path.totalFee[1].amount || '0').mul(new BN(XCM_FEE_RATIO));
298
301
  const bnAltInputTokenBalance = new BN(altInputTokenBalance.value || '0');
299
- if (!bnAltInputTokenBalance.sub(xcmAmount).sub(xcmFee).gt(BN_ZERO)) {
302
+ if (!bnAltInputTokenBalance.sub(missingAmount).sub(xcmFeeValidate).gt(BN_ZERO)) {
300
303
  processValidation.failedStep = path.steps[1];
301
304
  processValidation.ok = false;
302
305
  processValidation.status = YieldValidationStatus.NOT_ENOUGH_BALANCE;
303
- const bnMaxXCM = new BN(altInputTokenBalance.value).sub(xcmFee.mul(new BN(XCM_FEE_RATIO)));
306
+ const bnMaxXCM = new BN(altInputTokenBalance.value).sub(xcmFeeValidate);
304
307
  const inputTokenDecimal = _getAssetDecimals(inputTokenInfo);
305
- const maxBn = bnInputTokenBalance.add(new BN(altInputTokenBalance.value)).sub(xcmFee).sub(xcmFee);
308
+ const maxBn = bnInputTokenBalance.add(bnAltInputTokenBalance.sub(xcmFeeValidate));
306
309
  const maxValue = formatNumber(maxBn.toString(), inputTokenInfo.decimals || 0);
307
310
  const maxXCMValue = formatNumber(bnMaxXCM.toString(), inputTokenDecimal);
308
311
  const symbol = _getAssetSymbol(altInputTokenInfo);
309
312
  const inputNetworkName = this.chainInfo.name;
310
313
  const altNetworkName = _getAssetName(altInputTokenInfo);
311
314
  const currentValue = formatNumber(bnInputTokenBalance.toString(), inputTokenDecimal);
312
- processValidation.message = t('You can only enter a maximum of {{maxValue}} {{symbol}}, which is {{currentValue}} {{symbol}} ({{inputNetworkName}}) and {{maxXCMValue}} {{symbol}} ({{altNetworkName}}). Lower your amount and try again.', {
315
+ processValidation.message = t('bg.EARNING.services.service.earning.specialHandler.maximumInputExceeded', {
313
316
  replace: {
314
317
  symbol,
315
318
  maxValue,
@@ -366,13 +369,13 @@ export default class BaseSpecialStakingPoolHandler extends BasePoolHandler {
366
369
  processValidation.status = YieldValidationStatus.NOT_ENOUGH_BALANCE;
367
370
  const maxString = formatNumber(bnInputTokenBalance.toString(), inputTokenInfo.decimals || 0);
368
371
  if (maxString !== '0') {
369
- processValidation.message = t('Amount must be equal or less than {{number}}', {
372
+ processValidation.message = t('bg.EARNING.services.service.earning.specialHandler.amountMaxError', {
370
373
  replace: {
371
374
  number: maxString
372
375
  }
373
376
  });
374
377
  } else {
375
- processValidation.message = t('You need balance greater than 0 to continue');
378
+ processValidation.message = t('bg.EARNING.services.service.earning.specialHandler.balanceGreaterThanZeroRequired');
376
379
  }
377
380
  return [new TransactionError(YieldValidationStatus.NOT_ENOUGH_BALANCE, processValidation.message, processValidation)];
378
381
  }
@@ -344,7 +344,7 @@ export class AccountDeriveHandler extends AccountBaseHandler {
344
344
  const addresses = pairs.map(pair => pair.address);
345
345
  const exists = this.state.checkAddressExists(addresses);
346
346
  if (!isMigration) {
347
- assert(!exists, t('Account already exists under the name "{{name}}"', {
347
+ assert(!exists, t('bg.ACCOUNT.services.keyring.handler.Derive.accountExistsWithName', {
348
348
  replace: {
349
349
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
350
350
  }
@@ -85,7 +85,7 @@ export class AccountJsonHandler extends AccountBaseHandler {
85
85
  throw new Error(e.message);
86
86
  }
87
87
  } else {
88
- throw new Error(t('Incorrect password'));
88
+ throw new Error(t('bg.ACCOUNT.services.keyring.handler.Json.incorrectPassword'));
89
89
  }
90
90
  }
91
91
  jsonRestoreV2({
@@ -105,7 +105,7 @@ export class AccountJsonHandler extends AccountBaseHandler {
105
105
  try {
106
106
  const _pair = keyring.createFromJson(file);
107
107
  const exists = this.state.checkAddressExists([_pair.address]);
108
- assert(!exists, t('Account already exists under the name {{name}}', {
108
+ assert(!exists, t('bg.ACCOUNT.services.keyring.handler.Json.accountAlreadyExistsWithName', {
109
109
  replace: {
110
110
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || _pair.address
111
111
  }
@@ -131,7 +131,7 @@ export class AccountJsonHandler extends AccountBaseHandler {
131
131
  reject(error);
132
132
  }
133
133
  } else {
134
- reject(new Error(t('Incorrect password')));
134
+ reject(new Error(t('bg.ACCOUNT.services.keyring.handler.Json.incorrectPassword')));
135
135
  }
136
136
  return promise;
137
137
  }
@@ -163,7 +163,7 @@ export class AccountJsonHandler extends AccountBaseHandler {
163
163
  return rs;
164
164
  }, []);
165
165
  if (!(pairs !== null && pairs !== void 0 && pairs.length)) {
166
- throw new Error(t('No valid accounts found to import'));
166
+ throw new Error(t('bg.ACCOUNT.services.keyring.handler.Json.noValidAccountsToImport'));
167
167
  }
168
168
  const accountProxyMap = combineAccountsWithKeyPair(pairs, modifyPairs, accountProxies);
169
169
  const result = Object.values(accountProxyMap).map(proxy => {
@@ -187,7 +187,7 @@ export class AccountJsonHandler extends AccountBaseHandler {
187
187
  throw new Error(e.message);
188
188
  }
189
189
  } else {
190
- throw new Error(t('Incorrect password'));
190
+ throw new Error(t('bg.ACCOUNT.services.keyring.handler.Json.incorrectPassword'));
191
191
  }
192
192
  }
193
193
  batchRestoreV2({
@@ -222,7 +222,7 @@ export class AccountJsonHandler extends AccountBaseHandler {
222
222
  return rs;
223
223
  }, []);
224
224
  if (!(pairs !== null && pairs !== void 0 && pairs.length)) {
225
- throw new Error(t('No valid accounts found to import'));
225
+ throw new Error(t('bg.ACCOUNT.services.keyring.handler.Json.noValidAccountsToImport'));
226
226
  }
227
227
  const accountProxyMap = combineAccountsWithKeyPair(pairs, modifyPairs, accountProxies);
228
228
  const rawProxyIds = _proxyIds && _proxyIds.length ? _proxyIds : Object.keys(accountProxyMap);
@@ -248,13 +248,13 @@ export class AccountJsonHandler extends AccountBaseHandler {
248
248
  const proxyIds = Object.values(filteredAccountProxies).flatMap(proxy => proxy.id);
249
249
  if (!addresses.length) {
250
250
  if (_exists) {
251
- throw new Error(t('Account already exists under the name {{name}}', {
251
+ throw new Error(t('bg.ACCOUNT.services.keyring.handler.Json.accountAlreadyExistsWithName', {
252
252
  replace: {
253
253
  name: _exists.name || _exists.address || ''
254
254
  }
255
255
  }));
256
256
  } else {
257
- throw new Error(t('No accounts found to import'));
257
+ throw new Error(t('bg.ACCOUNT.services.keyring.handler.Json.noAccountsFoundToImport'));
258
258
  }
259
259
  }
260
260
  const _accountProxies = this.state.value.accountProxy;
@@ -314,7 +314,7 @@ export class AccountJsonHandler extends AccountBaseHandler {
314
314
  throw new Error(error.message);
315
315
  }
316
316
  } else {
317
- reject(new Error(t('Incorrect password')));
317
+ reject(new Error(t('bg.ACCOUNT.services.keyring.handler.Json.incorrectPassword')));
318
318
  }
319
319
  return promise;
320
320
  }
@@ -325,7 +325,7 @@ export class AccountJsonHandler extends AccountBaseHandler {
325
325
  } = request;
326
326
  try {
327
327
  if (proxyIds && !proxyIds.length) {
328
- throw new Error(t('No accounts found to export'));
328
+ throw new Error(t('bg.ACCOUNT.services.keyring.handler.Json.noAccountsFoundToExport'));
329
329
  }
330
330
  const _accountProxy = this.state.value.accountProxy;
331
331
  const _modifyPair = this.state.value.modifyPair;
@@ -345,7 +345,7 @@ export class AccountJsonHandler extends AccountBaseHandler {
345
345
  } catch (e) {
346
346
  const error = e;
347
347
  if (error.message === 'Invalid master password') {
348
- throw new Error(t('Incorrect password'));
348
+ throw new Error(t('bg.ACCOUNT.services.keyring.handler.Json.incorrectPassword'));
349
349
  } else {
350
350
  throw error;
351
351
  }
@@ -30,7 +30,7 @@ export class AccountLedgerHandler extends AccountBaseHandler {
30
30
  originGenesisHash
31
31
  } = request;
32
32
  const exists = this.state.checkAddressExists([address]);
33
- assert(!exists, t('Account already exists under the name {{name}}', {
33
+ assert(!exists, t('bg.ACCOUNT.services.keyring.handler.Ledger.accountAlreadyExistsWithName', {
34
34
  replace: {
35
35
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || address
36
36
  }
@@ -74,10 +74,10 @@ export class AccountLedgerHandler extends AccountBaseHandler {
74
74
  }) {
75
75
  const addresses = [];
76
76
  if (!accounts.length) {
77
- throw new Error(t('Can\'t find an account. Please try again'));
77
+ throw new Error(t('bg.ACCOUNT.services.keyring.handler.Ledger.cantFindAccountTryAgain'));
78
78
  }
79
79
  const exists = this.state.checkAddressExists(accounts.map(account => account.address));
80
- assert(!exists, t('Account already exists under the name {{name}}', {
80
+ assert(!exists, t('bg.ACCOUNT.services.keyring.handler.Ledger.accountAlreadyExistsWithName', {
81
81
  replace: {
82
82
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
83
83
  }
@@ -50,20 +50,20 @@ export class AccountMnemonicHandler extends AccountBaseHandler {
50
50
  let mnemonicTypes = 'general';
51
51
  let pairTypes = [];
52
52
  if (isHex(phrase)) {
53
- assert(isHex(phrase, 256), t('Invalid seed phrase. Please try again.'));
53
+ assert(isHex(phrase, 256), t('bg.ACCOUNT.services.keyring.handler.Mnemonic.invalidSeedPhraseTryAgain'));
54
54
  } else {
55
55
  // sadly isHex detects as string, so we need a cast here
56
- assert(SEED_LENGTHS.includes(phrase.split(' ').length), t('Seed phrase needs to contain {{x}} words', {
56
+ assert(SEED_LENGTHS.includes(phrase.split(' ').length), t('bg.ACCOUNT.services.keyring.handler.Mnemonic.seedPhraseWordCount', {
57
57
  replace: {
58
58
  x: SEED_LENGTHS.join(', ')
59
59
  }
60
60
  }));
61
61
  try {
62
- assert(mnemonicValidate(phrase), t('Invalid seed phrase. Please try again.'));
62
+ assert(mnemonicValidate(phrase), t('bg.ACCOUNT.services.keyring.handler.Mnemonic.invalidSeedPhraseTryAgain'));
63
63
  mnemonicTypes = 'general';
64
64
  pairTypes = ['sr25519', ...EthereumKeypairTypes, 'ton', ...CardanoKeypairTypes, ...BitcoinKeypairTypes];
65
65
  } catch (e) {
66
- assert(tonMnemonicValidate(phrase), t('Invalid seed phrase. Please try again.'));
66
+ assert(tonMnemonicValidate(phrase), t('bg.ACCOUNT.services.keyring.handler.Mnemonic.invalidSeedPhraseTryAgain'));
67
67
  mnemonicTypes = 'ton';
68
68
  pairTypes = ['ton-native'];
69
69
  }
@@ -78,7 +78,7 @@ export class AccountMnemonicHandler extends AccountBaseHandler {
78
78
  rs.addressMap[type] = keyring.createFromUri(getSuri(mnemonic, type), {}, type).address;
79
79
  });
80
80
  const exists = this.state.checkAddressExists(Object.values(rs.addressMap));
81
- assert(!exists, t('Account already exists under the name {{name}}', {
81
+ assert(!exists, t('bg.ACCOUNT.services.keyring.handler.Mnemonic.accountAlreadyExistsWithName', {
82
82
  replace: {
83
83
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
84
84
  }
@@ -101,14 +101,14 @@ export class AccountMnemonicHandler extends AccountBaseHandler {
101
101
  const types = type ? [type] : ['sr25519', ...EthereumKeypairTypes, 'ton', ...CardanoKeypairTypes, ...BitcoinKeypairTypes];
102
102
  if (!hasMasterPassword) {
103
103
  if (!password) {
104
- throw Error(t('The password of each account is needed to set up master password'));
104
+ throw Error(t('bg.ACCOUNT.services.keyring.handler.Mnemonic.eachAccountPasswordNeeded'));
105
105
  } else {
106
106
  keyring.changeMasterPassword(password);
107
107
  this.parentService.updateKeyringState();
108
108
  }
109
109
  }
110
110
  if (!types || !types.length) {
111
- throw Error(t('Please choose at least one account type'));
111
+ throw Error(t('bg.ACCOUNT.services.keyring.handler.Mnemonic.chooseAtLeastOneAccountType'));
112
112
  }
113
113
  const nameExists = this.state.checkNameExists(name);
114
114
  if (nameExists) {
@@ -129,7 +129,7 @@ export class AccountMnemonicHandler extends AccountBaseHandler {
129
129
  addressDict[type] = address;
130
130
  });
131
131
  const exists = this.state.checkAddressExists(Object.values(addressDict));
132
- assert(!exists, t('Account already exists under the name {{name}}', {
132
+ assert(!exists, t('bg.ACCOUNT.services.keyring.handler.Mnemonic.accountAlreadyExistsWithName', {
133
133
  replace: {
134
134
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
135
135
  }
@@ -180,7 +180,7 @@ export class AccountMnemonicHandler extends AccountBaseHandler {
180
180
  const isUnified = this.state.isUnifiedAccount(proxyId);
181
181
  if (!isUnified) {
182
182
  const pair = keyring.getPair(proxyId);
183
- assert(pair, t('Unable to find account'));
183
+ assert(pair, t('bg.ACCOUNT.services.keyring.handler.Mnemonic.unableToFindAccount'));
184
184
  const result = pair.exportMnemonic(password);
185
185
  return {
186
186
  result
@@ -195,7 +195,7 @@ export class AccountMnemonicHandler extends AccountBaseHandler {
195
195
  break;
196
196
  }
197
197
  }
198
- assert(pair, t('Unable to find account'));
198
+ assert(pair, t('bg.ACCOUNT.services.keyring.handler.Mnemonic.unableToFindAccount'));
199
199
  const result = pair.exportMnemonic(password) || '';
200
200
  return {
201
201
  result
@@ -88,7 +88,7 @@ export class AccountModifyHandler extends AccountBaseHandler {
88
88
  }
89
89
  if (!accountProxies[proxyId]) {
90
90
  const pair = keyring.getPair(proxyId);
91
- assert(pair, t('Unable to find account'));
91
+ assert(pair, t('bg.ACCOUNT.services.keyring.handler.Modify.unableToFindAccount'));
92
92
  keyring.saveAccountMeta(pair, {
93
93
  ...pair.meta,
94
94
  name
@@ -100,7 +100,7 @@ export class AccountModifyHandler extends AccountBaseHandler {
100
100
  this.state.upsertAccountProxyByKey(accountProxy);
101
101
  for (const address of addresses) {
102
102
  const pair = keyring.getPair(address);
103
- assert(pair, t('Unable to find account'));
103
+ assert(pair, t('bg.ACCOUNT.services.keyring.handler.Modify.unableToFindAccount'));
104
104
  keyring.saveAccountMeta(pair, {
105
105
  ...pair.meta,
106
106
  name
@@ -238,7 +238,7 @@ export class AccountModifyHandler extends AccountBaseHandler {
238
238
  const pairs = keyring.getPairs();
239
239
  const childPairs = pairs.filter(pair => pair.meta.parentAddress === oldAddress);
240
240
  for (const childPair of childPairs) {
241
- assert(pair, t('Unable to find account'));
241
+ assert(pair, t('bg.ACCOUNT.services.keyring.handler.Modify.unableToFindAccount'));
242
242
  keyring.saveAccountMeta(childPair, {
243
243
  ...childPair.meta,
244
244
  parentAddress: newAddress
@@ -34,14 +34,14 @@ export class AccountSecretHandler extends AccountBaseHandler {
34
34
  if (exists.type === type) {
35
35
  return [{
36
36
  code: AccountExternalErrorCode.INVALID_ADDRESS,
37
- message: t('Account exists')
37
+ message: t('bg.ACCOUNT.services.keyring.handler.Secret.accountExists')
38
38
  }];
39
39
  }
40
40
  }
41
41
  } catch (e) {}
42
42
  const nameExists = this.state.checkNameExists(name);
43
43
  if (nameExists) {
44
- throw Error(t('Account name already exists'));
44
+ throw Error(t('bg.ACCOUNT.services.keyring.handler.Secret.accountNameAlreadyExists'));
45
45
  }
46
46
  const meta = {
47
47
  name,
@@ -116,10 +116,10 @@ export class AccountSecretHandler extends AccountBaseHandler {
116
116
  rs.keyTypes = types;
117
117
  } else {
118
118
  rs.autoAddPrefix = false;
119
- assert(false, t('Invalid private key'));
119
+ assert(false, t('bg.ACCOUNT.services.keyring.handler.Secret.invalidPrivateKey'));
120
120
  }
121
121
  const exists = this.state.checkAddressExists(Object.values(rs.addressMap));
122
- assert(!exists, t('Account already exists under the name {{name}}', {
122
+ assert(!exists, t('bg.ACCOUNT.services.keyring.handler.Secret.accountAlreadyExistsWithName', {
123
123
  replace: {
124
124
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
125
125
  }
@@ -180,13 +180,13 @@ export class AccountSecretHandler extends AccountBaseHandler {
180
180
  success: false,
181
181
  errors: [{
182
182
  code: AccountExternalErrorCode.KEYRING_ERROR,
183
- message: t('Cannot create account')
183
+ message: t('bg.ACCOUNT.services.keyring.handler.Secret.cannotCreateAccount')
184
184
  }]
185
185
  };
186
186
  }
187
187
  const _address = keyringPair.address;
188
188
  const exists = this.state.checkAddressExists([_address]);
189
- assert(!exists, t('Account already exists under the name {{name}}', {
189
+ assert(!exists, t('bg.ACCOUNT.services.keyring.handler.Secret.accountAlreadyExistsWithName', {
190
190
  replace: {
191
191
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
192
192
  }
@@ -274,7 +274,7 @@ export class AccountSecretHandler extends AccountBaseHandler {
274
274
  if (response.isValid) {
275
275
  const exists = this.state.checkAddressExists([response.address]);
276
276
  if (exists) {
277
- response.errorMessage = t('Account already exists under the name {{name}}', {
277
+ response.errorMessage = t('bg.ACCOUNT.services.keyring.handler.Secret.accountAlreadyExistsWithName', {
278
278
  replace: {
279
279
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
280
280
  }
@@ -5,7 +5,7 @@ import BaseMigrationJob from '@subwallet/extension-base/services/migration-servi
5
5
  export default class DeleteEarningData extends BaseMigrationJob {
6
6
  async run() {
7
7
  try {
8
- await this.state.dbService.deleteYieldPoolInfo(['LcDOT___acala_euphrates_liquid_staking', 'xcDOT___moonwell_lending']);
8
+ await this.state.dbService.deleteYieldPoolInfo(['KILT___native_staking___kilt', 'PILT___native_staking___kilt_peregrine']);
9
9
  } catch (e) {
10
10
  console.error(e);
11
11
  }
@@ -7,12 +7,7 @@ export default class MigrateTransactionHistoryBySymbol extends BaseMigrationJob
7
7
  const state = this.state;
8
8
  try {
9
9
  const changeSlugsMap = {
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'
10
+ 'polygon-ERC20-USDT-0xc2132D05D31c914a87C6611C10748AEb04B58e8F': 'polygon-ERC20-USD₮0-0xc2132D05D31c914a87C6611C10748AEb04B58e8F'
16
11
  };
17
12
  const allTxs = [];
18
13
  await Promise.all(Object.entries(changeSlugsMap).map(async ([oldSlug, newSlug], i) => {
@@ -6,12 +6,7 @@ export default class MigrateAssetSetting extends BaseMigrationJob {
6
6
  async run() {
7
7
  try {
8
8
  const changeSlugsMap = {
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'
9
+ 'polygon-ERC20-USDT-0xc2132D05D31c914a87C6611C10748AEb04B58e8F': 'polygon-ERC20-USD₮0-0xc2132D05D31c914a87C6611C10748AEb04B58e8F'
15
10
  };
16
11
  const assetSetting = await this.state.chainService.getAssetSettings();
17
12
  const migratedAssetSetting = {};