@subwallet/extension-base 1.3.54-1 → 1.3.55-1

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
@@ -44,11 +44,11 @@ class BaseLendingPoolHandler extends _special.default {
44
44
  const maxUnstakeRequest = poolInfo.statistic.maxWithdrawalRequestPerFarmer;
45
45
  const derivativeTokenInfo = this.state.getAssetBySlug(this.derivativeAssets[0]);
46
46
  if (bnAmount.lte(_utils.BN_ZERO)) {
47
- return [new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('Amount must be greater than 0'))];
47
+ return [new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.EARNING.services.service.earning.lending.amountMustBeGreaterThanZero'))];
48
48
  }
49
49
  if (bnAmount.lt(minUnstake)) {
50
50
  const minUnstakeStr = (0, _utils.formatNumber)(minUnstake.toString(), derivativeTokenInfo.decimals || 0);
51
- errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.NOT_ENOUGH_MIN_UNSTAKE, (0, _i18next.t)('You need to unstake at least {{amount}} {{token}}', {
51
+ errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.NOT_ENOUGH_MIN_UNSTAKE, (0, _i18next.t)('bg.EARNING.services.service.earning.lending.unstakeMinimumAmount', {
52
52
  replace: {
53
53
  amount: minUnstakeStr,
54
54
  token: derivativeTokenInfo.symbol
@@ -61,7 +61,7 @@ class BaseLendingPoolHandler extends _special.default {
61
61
  }
62
62
 
63
63
  if (poolPosition.unstakings.length > maxUnstakeRequest) {
64
- errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.EXCEED_MAX_UNSTAKING, (0, _i18next.t)('You cannot unstake more than {{number}} times', {
64
+ errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.EXCEED_MAX_UNSTAKING, (0, _i18next.t)('bg.EARNING.services.service.earning.lending.maxUnstakeTimes', {
65
65
  replace: {
66
66
  number: maxUnstakeRequest
67
67
  }
@@ -61,11 +61,11 @@ class BaseLiquidStakingPoolHandler extends _special.default {
61
61
  const maxUnstakeRequest = poolInfo.statistic.maxWithdrawalRequestPerFarmer;
62
62
  const derivativeTokenInfo = this.state.getAssetBySlug(this.derivativeAssets[0]);
63
63
  if (bnAmount.lte(_util.BN_ZERO)) {
64
- return [new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('Amount must be greater than 0'))];
64
+ return [new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.EARNING.services.service.earning.liquidStaking.amountMustBeGreaterThanZero'))];
65
65
  }
66
66
  if (bnAmount.lt(minUnstake)) {
67
67
  const minUnstakeStr = (0, _utils2.formatNumber)(minUnstake.toString(), derivativeTokenInfo.decimals || 0);
68
- errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.NOT_ENOUGH_MIN_UNSTAKE, (0, _i18next.t)('You need to unstake at least {{amount}} {{token}}', {
68
+ errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.NOT_ENOUGH_MIN_UNSTAKE, (0, _i18next.t)('bg.EARNING.services.service.earning.liquidStaking.unstakeMinimumAmount', {
69
69
  replace: {
70
70
  amount: minUnstakeStr,
71
71
  token: derivativeTokenInfo.symbol
@@ -78,7 +78,7 @@ class BaseLiquidStakingPoolHandler extends _special.default {
78
78
  }
79
79
 
80
80
  if (poolPosition.unstakings.length > maxUnstakeRequest) {
81
- errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.EXCEED_MAX_UNSTAKING, (0, _i18next.t)('You cannot unstake more than {{number}} times', {
81
+ errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.EXCEED_MAX_UNSTAKING, (0, _i18next.t)('bg.EARNING.services.service.earning.liquidStaking.maxUnstakeTimes', {
82
82
  replace: {
83
83
  number: maxUnstakeRequest
84
84
  }
@@ -279,7 +279,7 @@ class AmplitudeNativeStakingPoolHandler extends _basePara.default {
279
279
  let cancel = false;
280
280
  const substrateApi = this.substrateApi;
281
281
  await substrateApi.isReady;
282
- if (!_constants2._STAKING_CHAIN_GROUP.kilt.includes(this.chain) && !_constants2._STAKING_CHAIN_GROUP.krest_network.includes(this.chain)) {
282
+ if (!_constants2._STAKING_CHAIN_GROUP.krest_network.includes(this.chain)) {
283
283
  await Promise.all(useAddresses.map(async address => {
284
284
  const _unclaimedReward = await substrateApi.api.query.parachainStaking.rewards(address);
285
285
  if (cancel) {
@@ -114,7 +114,7 @@ class BaseParaNativeStakingPoolHandler extends _base.default {
114
114
  }
115
115
  const bnAmount = new _util.BN(amount);
116
116
  if (bnAmount.lte(_util.BN_ZERO)) {
117
- errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('Amount must be greater than 0')));
117
+ errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.EARNING.services.service.earning.nativeStakingPara.amountMustBeGreaterThanZero')));
118
118
  }
119
119
  let targetNomination;
120
120
  for (const nomination of poolPosition.nominations) {
@@ -635,7 +635,7 @@ class RelayNativeStakingPoolHandler extends _base.default {
635
635
  }
636
636
  const bnAmount = new _util.BN(amount);
637
637
  if (bnAmount.lte(_util.BN_ZERO)) {
638
- errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('Amount must be greater than 0')));
638
+ errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.EARNING.services.service.earning.nativeStakingRelay.amountMustBeGreaterThanZero')));
639
639
  }
640
640
  const bnActiveStake = new _util.BN(poolPosition.activeStake);
641
641
  const bnRemainingStake = bnActiveStake.sub(new _util.BN(amount));
@@ -645,7 +645,7 @@ class RelayNativeStakingPoolHandler extends _base.default {
645
645
  errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.INVALID_ACTIVE_STAKE));
646
646
  }
647
647
  if (poolPosition.unstakings.length > maxUnstake) {
648
- errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.EXCEED_MAX_UNSTAKING, (0, _i18next.t)('You cannot unstake more than {{number}} times', {
648
+ errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.EXCEED_MAX_UNSTAKING, (0, _i18next.t)('bg.EARNING.services.service.earning.nativeStakingRelay.maxUnstakeTimes', {
649
649
  replace: {
650
650
  number: maxUnstake
651
651
  }
@@ -538,7 +538,12 @@ class TaoNativeStakingPoolHandler extends _basePara.default {
538
538
  } = data;
539
539
  const bnMinStake = await this.getMinBond(subnetData === null || subnetData === void 0 ? void 0 : subnetData.netuid);
540
540
  if (new _bignumber.default(amount).lt(bnMinStake)) {
541
- return [new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)(`Insufficient stake. You need to stake at least ${(0, _utils3.formatNumber)(bnMinStake, (0, _utils2._getAssetDecimals)(this.nativeToken))} ${(0, _utils2._getAssetSymbol)(this.nativeToken)} to earn rewards`))];
541
+ return [new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.EARNING.services.service.earning.nativeStaking.tao.insufficientStakeToEarn', {
542
+ replace: {
543
+ bnMinStake: (0, _utils3.formatNumber)(bnMinStake, (0, _utils2._getAssetDecimals)(this.nativeToken)),
544
+ symbol: (0, _utils2._getAssetSymbol)(this.nativeToken)
545
+ }
546
+ }))];
542
547
  }
543
548
  return baseErrors;
544
549
  }
@@ -576,7 +581,12 @@ class TaoNativeStakingPoolHandler extends _basePara.default {
576
581
  const minUnstake = minDelegatorStake.dividedBy(alphaToTaoPrice);
577
582
  if (new _bignumber.default(amount).lt(minUnstake)) {
578
583
  var _poolInfo$metadata$su2;
579
- return [new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)(`Amount too low. You need to unstake at least ${(0, _utils3.formatNumber)(minUnstake, (0, _utils2._getAssetDecimals)(this.nativeToken))} ${((_poolInfo$metadata$su2 = poolInfo.metadata.subnetData) === null || _poolInfo$metadata$su2 === void 0 ? void 0 : _poolInfo$metadata$su2.subnetSymbol) || (0, _utils2._getAssetSymbol)(this.nativeToken)}`))];
584
+ return [new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.EARNING.services.service.earning.nativeStaking.tao.unstakeAmountTooLow', {
585
+ replace: {
586
+ bnMinUnstake: (0, _utils3.formatNumber)(minUnstake, (0, _utils2._getAssetDecimals)(this.nativeToken)),
587
+ symbol: ((_poolInfo$metadata$su2 = poolInfo.metadata.subnetData) === null || _poolInfo$metadata$su2 === void 0 ? void 0 : _poolInfo$metadata$su2.subnetSymbol) || (0, _utils2._getAssetSymbol)(this.nativeToken)
588
+ }
589
+ }))];
580
590
  }
581
591
  return baseErrors;
582
592
  }
@@ -601,10 +611,10 @@ class TaoNativeStakingPoolHandler extends _basePara.default {
601
611
  const selectedValidatorInfo = targetValidators[0];
602
612
  const destValidator = selectedValidatorInfo.address;
603
613
  if (new _bignumber.default(amount).lte(0)) {
604
- return Promise.reject(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('Amount must be greater than 0')));
614
+ return Promise.reject(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.EARNING.services.service.earning.nativeStaking.tao.amountMustBeGreaterThanZero')));
605
615
  }
606
616
  if (originValidator === destValidator) {
607
- return Promise.reject(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, 'From validator is the same with to validator'));
617
+ return Promise.reject(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.EARNING.services.service.earning.nativeStaking.tao.fromValidatorSameAsTo')));
608
618
  }
609
619
  const alphaToTaoPrice = new _bignumber.default(await getAlphaToTaoRate(this.substrateApi, netuid));
610
620
  const bnMinStake = await this.getMinBond(netuid);
@@ -612,12 +622,22 @@ class TaoNativeStakingPoolHandler extends _basePara.default {
612
622
  const formattedMinUnstake = minUnstake.dividedBy(1000000).integerValue(_bignumber.default.ROUND_CEIL).dividedBy(1000);
613
623
  const bnMinMoveStake = formattedMinUnstake.multipliedBy(10 ** (0, _utils2._getAssetDecimals)(this.nativeToken));
614
624
  if (new _bignumber.default(amount).lt(bnMinMoveStake)) {
615
- return Promise.reject(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)(`Amount too low. You need to move at least ${formattedMinUnstake.toString()} ${(metadata === null || metadata === void 0 ? void 0 : metadata.subnetSymbol) || ''}`)));
625
+ return Promise.reject(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.EARNING.services.service.earning.nativeStaking.tao.moveStakeAmountTooLow', {
626
+ replace: {
627
+ bnMinMoveStake: formattedMinUnstake.toString(),
628
+ symbol: (metadata === null || metadata === void 0 ? void 0 : metadata.subnetSymbol) || ''
629
+ }
630
+ })));
616
631
  }
617
632
 
618
633
  // Avoid remaining amount too low -> can't do anything with that amount
619
634
  if (!(maxAmount === amount) && new _bignumber.default(maxAmount).minus(new _bignumber.default(amount)).lt(bnMinMoveStake)) {
620
- return Promise.reject(new _TransactionError.TransactionError(_types.StakingTxErrorType.REMAINING_AMOUNT_TOO_LOW, (0, _i18next.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 ${(0, _utils3.formatNumber)(maxAmount, (0, _utils2._getAssetDecimals)(this.nativeToken))} ${(metadata === null || metadata === void 0 ? void 0 : metadata.subnetSymbol) || (0, _utils2._getAssetSymbol)(this.nativeToken)} to the new validator, or "Cancel" and lower the amount, then try again`)));
635
+ return Promise.reject(new _TransactionError.TransactionError(_types.StakingTxErrorType.REMAINING_AMOUNT_TOO_LOW, (0, _i18next.t)('bg.EARNING.services.service.earning.nativeStaking.tao.remainingStakeBelowMinimumWarning', {
636
+ replace: {
637
+ maxAmount: (0, _utils3.formatNumber)(maxAmount, (0, _utils2._getAssetDecimals)(this.nativeToken)),
638
+ subnetSymbol: (metadata === null || metadata === void 0 ? void 0 : metadata.subnetSymbol) || (0, _utils2._getAssetSymbol)(this.nativeToken)
639
+ }
640
+ })));
621
641
  }
622
642
  const extrinsic = chainApi.api.tx.subtensorModule.moveStake(originValidator, destValidator, netuid, netuid, amount);
623
643
  return extrinsic;
@@ -523,7 +523,7 @@ class NominationPoolHandler extends _base.default {
523
523
  }
524
524
  const bnAmount = new _util.BN(amount);
525
525
  if (bnAmount.lte(_util.BN_ZERO)) {
526
- errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('Amount must be greater than 0')));
526
+ errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.EARNING.services.service.earning.nominationPool.amountMustBeGreaterThanZero')));
527
527
  }
528
528
  const bnActiveStake = new _util.BN(poolPosition.activeStake);
529
529
  const bnRemainingStake = bnActiveStake.sub(new _util.BN(amount));
@@ -533,7 +533,7 @@ class NominationPoolHandler extends _base.default {
533
533
  errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.INVALID_ACTIVE_STAKE));
534
534
  }
535
535
  if (poolPosition.unstakings.length > maxUnstake) {
536
- errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.EXCEED_MAX_UNSTAKING, (0, _i18next.t)('You cannot unstake more than {{number}} times', {
536
+ errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.EXCEED_MAX_UNSTAKING, (0, _i18next.t)('bg.EARNING.services.service.earning.nominationPool.maxUnstakeTimes', {
537
537
  replace: {
538
538
  number: maxUnstake
539
539
  }
@@ -99,7 +99,11 @@ class BaseSpecialStakingPoolHandler extends _base.default {
99
99
  const altName = altChain.name;
100
100
  const parsedMinJoinPool = (0, _utils4.formatNumber)(missingAmount.toString(), inputAssetInfo.decimals || 0);
101
101
  const formatparsedMinJoinPool = isTheSame ? parsedMinJoinPool : Number(parsedMinJoinPool) + 0.01;
102
- const parsedMinAltJoinPool = (0, _utils4.formatNumber)(missingAmount.add(existentialDeposit).toString(), inputAssetInfo.decimals || 0);
102
+
103
+ // If balance can not cover ED, add ED to the missing amount
104
+ const needExtraED = bnInputAssetBalance.eq(_util.BN_ZERO) && bnAltInputAssetBalance.eq(_util.BN_ZERO);
105
+ const totalMissingAlt = needExtraED ? missingAmount.add(existentialDeposit) : missingAmount;
106
+ const parsedMinAltJoinPool = (0, _utils4.formatNumber)(totalMissingAlt.toString(), inputAssetInfo.decimals || 0);
103
107
  const formatParsedMinAltJoinPool = isTheSame ? parsedMinAltJoinPool : Number(parsedMinAltJoinPool) + 0.01;
104
108
  return {
105
109
  passed: false,
@@ -300,23 +304,22 @@ class BaseSpecialStakingPoolHandler extends _base.default {
300
304
  const inputTokenInfo = this.state.getAssetBySlug(this.inputAsset);
301
305
  const altInputTokenBalance = await this.state.balanceService.getTransferableBalance(params.address, altInputTokenInfo.originChain, altInputTokenSlug);
302
306
  const missingAmount = bnAmount.sub(bnInputTokenBalance); // TODO: what if input token is not LOCAL ??
303
- const xcmFee = new _util.BN(path.totalFee[1].amount || '0');
304
- const xcmAmount = missingAmount.add(xcmFee);
307
+ const xcmFeeValidate = new _util.BN(path.totalFee[1].amount || '0').mul(new _util.BN(_constants.XCM_FEE_RATIO));
305
308
  const bnAltInputTokenBalance = new _util.BN(altInputTokenBalance.value || '0');
306
- if (!bnAltInputTokenBalance.sub(xcmAmount).sub(xcmFee).gt(_util.BN_ZERO)) {
309
+ if (!bnAltInputTokenBalance.sub(missingAmount).sub(xcmFeeValidate).gt(_util.BN_ZERO)) {
307
310
  processValidation.failedStep = path.steps[1];
308
311
  processValidation.ok = false;
309
312
  processValidation.status = _types.YieldValidationStatus.NOT_ENOUGH_BALANCE;
310
- const bnMaxXCM = new _util.BN(altInputTokenBalance.value).sub(xcmFee.mul(new _util.BN(_constants.XCM_FEE_RATIO)));
313
+ const bnMaxXCM = new _util.BN(altInputTokenBalance.value).sub(xcmFeeValidate);
311
314
  const inputTokenDecimal = (0, _utils3._getAssetDecimals)(inputTokenInfo);
312
- const maxBn = bnInputTokenBalance.add(new _util.BN(altInputTokenBalance.value)).sub(xcmFee).sub(xcmFee);
315
+ const maxBn = bnInputTokenBalance.add(bnAltInputTokenBalance.sub(xcmFeeValidate));
313
316
  const maxValue = (0, _utils4.formatNumber)(maxBn.toString(), inputTokenInfo.decimals || 0);
314
317
  const maxXCMValue = (0, _utils4.formatNumber)(bnMaxXCM.toString(), inputTokenDecimal);
315
318
  const symbol = (0, _utils3._getAssetSymbol)(altInputTokenInfo);
316
319
  const inputNetworkName = this.chainInfo.name;
317
320
  const altNetworkName = (0, _utils3._getAssetName)(altInputTokenInfo);
318
321
  const currentValue = (0, _utils4.formatNumber)(bnInputTokenBalance.toString(), inputTokenDecimal);
319
- processValidation.message = (0, _i18next.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.', {
322
+ processValidation.message = (0, _i18next.t)('bg.EARNING.services.service.earning.specialHandler.maximumInputExceeded', {
320
323
  replace: {
321
324
  symbol,
322
325
  maxValue,
@@ -373,13 +376,13 @@ class BaseSpecialStakingPoolHandler extends _base.default {
373
376
  processValidation.status = _types.YieldValidationStatus.NOT_ENOUGH_BALANCE;
374
377
  const maxString = (0, _utils4.formatNumber)(bnInputTokenBalance.toString(), inputTokenInfo.decimals || 0);
375
378
  if (maxString !== '0') {
376
- processValidation.message = (0, _i18next.t)('Amount must be equal or less than {{number}}', {
379
+ processValidation.message = (0, _i18next.t)('bg.EARNING.services.service.earning.specialHandler.amountMaxError', {
377
380
  replace: {
378
381
  number: maxString
379
382
  }
380
383
  });
381
384
  } else {
382
- processValidation.message = (0, _i18next.t)('You need balance greater than 0 to continue');
385
+ processValidation.message = (0, _i18next.t)('bg.EARNING.services.service.earning.specialHandler.balanceGreaterThanZeroRequired');
383
386
  }
384
387
  return [new _TransactionError.TransactionError(_types.YieldValidationStatus.NOT_ENOUGH_BALANCE, processValidation.message, processValidation)];
385
388
  }
@@ -356,7 +356,7 @@ class AccountDeriveHandler extends _Base.AccountBaseHandler {
356
356
  const addresses = pairs.map(pair => pair.address);
357
357
  const exists = this.state.checkAddressExists(addresses);
358
358
  if (!isMigration) {
359
- (0, _util.assert)(!exists, (0, _i18next.t)('Account already exists under the name "{{name}}"', {
359
+ (0, _util.assert)(!exists, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Derive.accountExistsWithName', {
360
360
  replace: {
361
361
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
362
362
  }
@@ -91,7 +91,7 @@ class AccountJsonHandler extends _Base.AccountBaseHandler {
91
91
  throw new Error(e.message);
92
92
  }
93
93
  } else {
94
- throw new Error((0, _i18next.t)('Incorrect password'));
94
+ throw new Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Json.incorrectPassword'));
95
95
  }
96
96
  }
97
97
  jsonRestoreV2(_ref2, onDone) {
@@ -112,7 +112,7 @@ class AccountJsonHandler extends _Base.AccountBaseHandler {
112
112
  try {
113
113
  const _pair = _uiKeyring.keyring.createFromJson(file);
114
114
  const exists = this.state.checkAddressExists([_pair.address]);
115
- (0, _util.assert)(!exists, (0, _i18next.t)('Account already exists under the name {{name}}', {
115
+ (0, _util.assert)(!exists, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Json.accountAlreadyExistsWithName', {
116
116
  replace: {
117
117
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || _pair.address
118
118
  }
@@ -138,7 +138,7 @@ class AccountJsonHandler extends _Base.AccountBaseHandler {
138
138
  reject(error);
139
139
  }
140
140
  } else {
141
- reject(new Error((0, _i18next.t)('Incorrect password')));
141
+ reject(new Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Json.incorrectPassword')));
142
142
  }
143
143
  return promise;
144
144
  }
@@ -171,7 +171,7 @@ class AccountJsonHandler extends _Base.AccountBaseHandler {
171
171
  return rs;
172
172
  }, []);
173
173
  if (!(pairs !== null && pairs !== void 0 && pairs.length)) {
174
- throw new Error((0, _i18next.t)('No valid accounts found to import'));
174
+ throw new Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Json.noValidAccountsToImport'));
175
175
  }
176
176
  const accountProxyMap = (0, _utils.combineAccountsWithKeyPair)(pairs, modifyPairs, accountProxies);
177
177
  const result = Object.values(accountProxyMap).map(proxy => {
@@ -195,7 +195,7 @@ class AccountJsonHandler extends _Base.AccountBaseHandler {
195
195
  throw new Error(e.message);
196
196
  }
197
197
  } else {
198
- throw new Error((0, _i18next.t)('Incorrect password'));
198
+ throw new Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Json.incorrectPassword'));
199
199
  }
200
200
  }
201
201
  batchRestoreV2(_ref4) {
@@ -231,7 +231,7 @@ class AccountJsonHandler extends _Base.AccountBaseHandler {
231
231
  return rs;
232
232
  }, []);
233
233
  if (!(pairs !== null && pairs !== void 0 && pairs.length)) {
234
- throw new Error((0, _i18next.t)('No valid accounts found to import'));
234
+ throw new Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Json.noValidAccountsToImport'));
235
235
  }
236
236
  const accountProxyMap = (0, _utils.combineAccountsWithKeyPair)(pairs, modifyPairs, accountProxies);
237
237
  const rawProxyIds = _proxyIds && _proxyIds.length ? _proxyIds : Object.keys(accountProxyMap);
@@ -261,13 +261,13 @@ class AccountJsonHandler extends _Base.AccountBaseHandler {
261
261
  const proxyIds = Object.values(filteredAccountProxies).flatMap(proxy => proxy.id);
262
262
  if (!addresses.length) {
263
263
  if (_exists) {
264
- throw new Error((0, _i18next.t)('Account already exists under the name {{name}}', {
264
+ throw new Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Json.accountAlreadyExistsWithName', {
265
265
  replace: {
266
266
  name: _exists.name || _exists.address || ''
267
267
  }
268
268
  }));
269
269
  } else {
270
- throw new Error((0, _i18next.t)('No accounts found to import'));
270
+ throw new Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Json.noAccountsFoundToImport'));
271
271
  }
272
272
  }
273
273
  const _accountProxies = this.state.value.accountProxy;
@@ -327,7 +327,7 @@ class AccountJsonHandler extends _Base.AccountBaseHandler {
327
327
  throw new Error(error.message);
328
328
  }
329
329
  } else {
330
- reject(new Error((0, _i18next.t)('Incorrect password')));
330
+ reject(new Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Json.incorrectPassword')));
331
331
  }
332
332
  return promise;
333
333
  }
@@ -338,7 +338,7 @@ class AccountJsonHandler extends _Base.AccountBaseHandler {
338
338
  } = request;
339
339
  try {
340
340
  if (proxyIds && !proxyIds.length) {
341
- throw new Error((0, _i18next.t)('No accounts found to export'));
341
+ throw new Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Json.noAccountsFoundToExport'));
342
342
  }
343
343
  const _accountProxy = this.state.value.accountProxy;
344
344
  const _modifyPair = this.state.value.modifyPair;
@@ -364,7 +364,7 @@ class AccountJsonHandler extends _Base.AccountBaseHandler {
364
364
  } catch (e) {
365
365
  const error = e;
366
366
  if (error.message === 'Invalid master password') {
367
- throw new Error((0, _i18next.t)('Incorrect password'));
367
+ throw new Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Json.incorrectPassword'));
368
368
  } else {
369
369
  throw error;
370
370
  }
@@ -35,7 +35,7 @@ class AccountLedgerHandler extends _Base.AccountBaseHandler {
35
35
  originGenesisHash
36
36
  } = request;
37
37
  const exists = this.state.checkAddressExists([address]);
38
- (0, _util.assert)(!exists, (0, _i18next.t)('Account already exists under the name {{name}}', {
38
+ (0, _util.assert)(!exists, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Ledger.accountAlreadyExistsWithName', {
39
39
  replace: {
40
40
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || address
41
41
  }
@@ -80,10 +80,10 @@ class AccountLedgerHandler extends _Base.AccountBaseHandler {
80
80
  } = _ref;
81
81
  const addresses = [];
82
82
  if (!accounts.length) {
83
- throw new Error((0, _i18next.t)('Can\'t find an account. Please try again'));
83
+ throw new Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Ledger.cantFindAccountTryAgain'));
84
84
  }
85
85
  const exists = this.state.checkAddressExists(accounts.map(account => account.address));
86
- (0, _util.assert)(!exists, (0, _i18next.t)('Account already exists under the name {{name}}', {
86
+ (0, _util.assert)(!exists, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Ledger.accountAlreadyExistsWithName', {
87
87
  replace: {
88
88
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
89
89
  }
@@ -60,20 +60,20 @@ class AccountMnemonicHandler extends _Base.AccountBaseHandler {
60
60
  let mnemonicTypes = 'general';
61
61
  let pairTypes = [];
62
62
  if ((0, _util.isHex)(phrase)) {
63
- (0, _util.assert)((0, _util.isHex)(phrase, 256), (0, _i18next.t)('Invalid seed phrase. Please try again.'));
63
+ (0, _util.assert)((0, _util.isHex)(phrase, 256), (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Mnemonic.invalidSeedPhraseTryAgain'));
64
64
  } else {
65
65
  // sadly isHex detects as string, so we need a cast here
66
- (0, _util.assert)(SEED_LENGTHS.includes(phrase.split(' ').length), (0, _i18next.t)('Seed phrase needs to contain {{x}} words', {
66
+ (0, _util.assert)(SEED_LENGTHS.includes(phrase.split(' ').length), (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Mnemonic.seedPhraseWordCount', {
67
67
  replace: {
68
68
  x: SEED_LENGTHS.join(', ')
69
69
  }
70
70
  }));
71
71
  try {
72
- (0, _util.assert)((0, _utilCrypto.mnemonicValidate)(phrase), (0, _i18next.t)('Invalid seed phrase. Please try again.'));
72
+ (0, _util.assert)((0, _utilCrypto.mnemonicValidate)(phrase), (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Mnemonic.invalidSeedPhraseTryAgain'));
73
73
  mnemonicTypes = 'general';
74
74
  pairTypes = ['sr25519', ..._types2.EthereumKeypairTypes, 'ton', ..._types2.CardanoKeypairTypes, ..._types2.BitcoinKeypairTypes];
75
75
  } catch (e) {
76
- (0, _util.assert)((0, _utils2.tonMnemonicValidate)(phrase), (0, _i18next.t)('Invalid seed phrase. Please try again.'));
76
+ (0, _util.assert)((0, _utils2.tonMnemonicValidate)(phrase), (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Mnemonic.invalidSeedPhraseTryAgain'));
77
77
  mnemonicTypes = 'ton';
78
78
  pairTypes = ['ton-native'];
79
79
  }
@@ -88,7 +88,7 @@ class AccountMnemonicHandler extends _Base.AccountBaseHandler {
88
88
  rs.addressMap[type] = _uiKeyring.keyring.createFromUri((0, _utils.getSuri)(mnemonic, type), {}, type).address;
89
89
  });
90
90
  const exists = this.state.checkAddressExists(Object.values(rs.addressMap));
91
- (0, _util.assert)(!exists, (0, _i18next.t)('Account already exists under the name {{name}}', {
91
+ (0, _util.assert)(!exists, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Mnemonic.accountAlreadyExistsWithName', {
92
92
  replace: {
93
93
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
94
94
  }
@@ -111,14 +111,14 @@ class AccountMnemonicHandler extends _Base.AccountBaseHandler {
111
111
  const types = type ? [type] : ['sr25519', ..._types2.EthereumKeypairTypes, 'ton', ..._types2.CardanoKeypairTypes, ..._types2.BitcoinKeypairTypes];
112
112
  if (!hasMasterPassword) {
113
113
  if (!password) {
114
- throw Error((0, _i18next.t)('The password of each account is needed to set up master password'));
114
+ throw Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Mnemonic.eachAccountPasswordNeeded'));
115
115
  } else {
116
116
  _uiKeyring.keyring.changeMasterPassword(password);
117
117
  this.parentService.updateKeyringState();
118
118
  }
119
119
  }
120
120
  if (!types || !types.length) {
121
- throw Error((0, _i18next.t)('Please choose at least one account type'));
121
+ throw Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Mnemonic.chooseAtLeastOneAccountType'));
122
122
  }
123
123
  const nameExists = this.state.checkNameExists(name);
124
124
  if (nameExists) {
@@ -139,7 +139,7 @@ class AccountMnemonicHandler extends _Base.AccountBaseHandler {
139
139
  addressDict[type] = address;
140
140
  });
141
141
  const exists = this.state.checkAddressExists(Object.values(addressDict));
142
- (0, _util.assert)(!exists, (0, _i18next.t)('Account already exists under the name {{name}}', {
142
+ (0, _util.assert)(!exists, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Mnemonic.accountAlreadyExistsWithName', {
143
143
  replace: {
144
144
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
145
145
  }
@@ -191,7 +191,7 @@ class AccountMnemonicHandler extends _Base.AccountBaseHandler {
191
191
  const isUnified = this.state.isUnifiedAccount(proxyId);
192
192
  if (!isUnified) {
193
193
  const pair = _uiKeyring.keyring.getPair(proxyId);
194
- (0, _util.assert)(pair, (0, _i18next.t)('Unable to find account'));
194
+ (0, _util.assert)(pair, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Mnemonic.unableToFindAccount'));
195
195
  const result = pair.exportMnemonic(password);
196
196
  return {
197
197
  result
@@ -206,7 +206,7 @@ class AccountMnemonicHandler extends _Base.AccountBaseHandler {
206
206
  break;
207
207
  }
208
208
  }
209
- (0, _util.assert)(pair, (0, _i18next.t)('Unable to find account'));
209
+ (0, _util.assert)(pair, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Mnemonic.unableToFindAccount'));
210
210
  const result = pair.exportMnemonic(password) || '';
211
211
  return {
212
212
  result
@@ -94,7 +94,7 @@ class AccountModifyHandler extends _Base.AccountBaseHandler {
94
94
  }
95
95
  if (!accountProxies[proxyId]) {
96
96
  const pair = _uiKeyring.keyring.getPair(proxyId);
97
- (0, _util.assert)(pair, (0, _i18next.t)('Unable to find account'));
97
+ (0, _util.assert)(pair, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Modify.unableToFindAccount'));
98
98
  _uiKeyring.keyring.saveAccountMeta(pair, {
99
99
  ...pair.meta,
100
100
  name
@@ -106,7 +106,7 @@ class AccountModifyHandler extends _Base.AccountBaseHandler {
106
106
  this.state.upsertAccountProxyByKey(accountProxy);
107
107
  for (const address of addresses) {
108
108
  const pair = _uiKeyring.keyring.getPair(address);
109
- (0, _util.assert)(pair, (0, _i18next.t)('Unable to find account'));
109
+ (0, _util.assert)(pair, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Modify.unableToFindAccount'));
110
110
  _uiKeyring.keyring.saveAccountMeta(pair, {
111
111
  ...pair.meta,
112
112
  name
@@ -245,7 +245,7 @@ class AccountModifyHandler extends _Base.AccountBaseHandler {
245
245
  const pairs = _uiKeyring.keyring.getPairs();
246
246
  const childPairs = pairs.filter(pair => pair.meta.parentAddress === oldAddress);
247
247
  for (const childPair of childPairs) {
248
- (0, _util.assert)(pair, (0, _i18next.t)('Unable to find account'));
248
+ (0, _util.assert)(pair, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Modify.unableToFindAccount'));
249
249
  _uiKeyring.keyring.saveAccountMeta(childPair, {
250
250
  ...childPair.meta,
251
251
  parentAddress: newAddress
@@ -40,14 +40,14 @@ class AccountSecretHandler extends _Base.AccountBaseHandler {
40
40
  if (exists.type === type) {
41
41
  return [{
42
42
  code: _KoniTypes.AccountExternalErrorCode.INVALID_ADDRESS,
43
- message: (0, _i18next.t)('Account exists')
43
+ message: (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Secret.accountExists')
44
44
  }];
45
45
  }
46
46
  }
47
47
  } catch (e) {}
48
48
  const nameExists = this.state.checkNameExists(name);
49
49
  if (nameExists) {
50
- throw Error((0, _i18next.t)('Account name already exists'));
50
+ throw Error((0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Secret.accountNameAlreadyExists'));
51
51
  }
52
52
  const meta = {
53
53
  name,
@@ -124,10 +124,10 @@ class AccountSecretHandler extends _Base.AccountBaseHandler {
124
124
  rs.keyTypes = types;
125
125
  } else {
126
126
  rs.autoAddPrefix = false;
127
- (0, _util.assert)(false, (0, _i18next.t)('Invalid private key'));
127
+ (0, _util.assert)(false, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Secret.invalidPrivateKey'));
128
128
  }
129
129
  const exists = this.state.checkAddressExists(Object.values(rs.addressMap));
130
- (0, _util.assert)(!exists, (0, _i18next.t)('Account already exists under the name {{name}}', {
130
+ (0, _util.assert)(!exists, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Secret.accountAlreadyExistsWithName', {
131
131
  replace: {
132
132
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
133
133
  }
@@ -189,13 +189,13 @@ class AccountSecretHandler extends _Base.AccountBaseHandler {
189
189
  success: false,
190
190
  errors: [{
191
191
  code: _KoniTypes.AccountExternalErrorCode.KEYRING_ERROR,
192
- message: (0, _i18next.t)('Cannot create account')
192
+ message: (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Secret.cannotCreateAccount')
193
193
  }]
194
194
  };
195
195
  }
196
196
  const _address = keyringPair.address;
197
197
  const exists = this.state.checkAddressExists([_address]);
198
- (0, _util.assert)(!exists, (0, _i18next.t)('Account already exists under the name {{name}}', {
198
+ (0, _util.assert)(!exists, (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Secret.accountAlreadyExistsWithName', {
199
199
  replace: {
200
200
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
201
201
  }
@@ -284,7 +284,7 @@ class AccountSecretHandler extends _Base.AccountBaseHandler {
284
284
  if (response.isValid) {
285
285
  const exists = this.state.checkAddressExists([response.address]);
286
286
  if (exists) {
287
- response.errorMessage = (0, _i18next.t)('Account already exists under the name {{name}}', {
287
+ response.errorMessage = (0, _i18next.t)('bg.ACCOUNT.services.keyring.handler.Secret.accountAlreadyExistsWithName', {
288
288
  replace: {
289
289
  name: (exists === null || exists === void 0 ? void 0 : exists.name) || (exists === null || exists === void 0 ? void 0 : exists.address) || ''
290
290
  }
@@ -12,7 +12,7 @@ var _Base = _interopRequireDefault(require("@subwallet/extension-base/services/m
12
12
  class DeleteEarningData extends _Base.default {
13
13
  async run() {
14
14
  try {
15
- await this.state.dbService.deleteYieldPoolInfo(['LcDOT___acala_euphrates_liquid_staking', 'xcDOT___moonwell_lending']);
15
+ await this.state.dbService.deleteYieldPoolInfo(['KILT___native_staking___kilt', 'PILT___native_staking___kilt_peregrine']);
16
16
  } catch (e) {
17
17
  console.error(e);
18
18
  }
@@ -14,12 +14,7 @@ class MigrateTransactionHistoryBySymbol extends _Base.default {
14
14
  const state = this.state;
15
15
  try {
16
16
  const changeSlugsMap = {
17
- 'bifrost_testnet-NATIVE-BNC': 'bifrost_testnet-NATIVE-BFC',
18
- 'energy_web_x_rococo-NATIVE-VT': 'energy_web_x_rococo-NATIVE-EWT',
19
- 'chainflip_dot-NATIVE-DOT': 'chainflip_dot-NATIVE-Unit',
20
- 'autonomys_taurus-NATIVE-AI3': 'autonomys_taurus-NATIVE-tAI3',
21
- 'fraxtal-NATIVE-frxETH': 'fraxtal-ERC20-frxETH-0xFC00000000000000000000000000000000000006',
22
- 'arbitrum_one-ERC20-USDT-0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9': 'arbitrum_one-ERC20-USD₮0-0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'
17
+ 'polygon-ERC20-USDT-0xc2132D05D31c914a87C6611C10748AEb04B58e8F': 'polygon-ERC20-USD₮0-0xc2132D05D31c914a87C6611C10748AEb04B58e8F'
23
18
  };
24
19
  const allTxs = [];
25
20
  await Promise.all(Object.entries(changeSlugsMap).map(async (_ref, i) => {
@@ -13,12 +13,7 @@ class MigrateAssetSetting extends _Base.default {
13
13
  async run() {
14
14
  try {
15
15
  const changeSlugsMap = {
16
- 'bifrost_testnet-NATIVE-BNC': 'bifrost_testnet-NATIVE-BFC',
17
- 'energy_web_x_rococo-NATIVE-VT': 'energy_web_x_rococo-NATIVE-EWT',
18
- 'chainflip_dot-NATIVE-DOT': 'chainflip_dot-NATIVE-Unit',
19
- 'autonomys_taurus-NATIVE-AI3': 'autonomys_taurus-NATIVE-tAI3',
20
- 'fraxtal-NATIVE-frxETH': 'fraxtal-ERC20-frxETH-0xFC00000000000000000000000000000000000006',
21
- 'arbitrum_one-ERC20-USDT-0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9': 'arbitrum_one-ERC20-USD₮0-0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'
16
+ 'polygon-ERC20-USDT-0xc2132D05D31c914a87C6611C10748AEb04B58e8F': 'polygon-ERC20-USD₮0-0xc2132D05D31c914a87C6611C10748AEb04B58e8F'
22
17
  };
23
18
  const assetSetting = await this.state.chainService.getAssetSettings();
24
19
  const migratedAssetSetting = {};
@@ -54,7 +54,7 @@ var _default = {
54
54
  '1.1.7': _DeleteChain.default,
55
55
  '1.1.13-01': _MigrateTokenDecimals.default,
56
56
  // '1.1.13-02-2': EnableEarningChains,
57
- '1.1.13-03': _DeleteEarningData.default,
57
+ '1.3.55-03': _DeleteEarningData.default,
58
58
  '1.1.17-01': _MigratePioneerProvider.default,
59
59
  '1.1.17-03': _EnableVaraChain.default,
60
60
  '1.1.24-01': _MigrateProvidersV1M1P.default,
@@ -63,8 +63,8 @@ var _default = {
63
63
  '1.1.33-01': _MigrateLedgerAccountV.default,
64
64
  '1.1.41-01': _DeleteChainStaking.default,
65
65
  // '1.1.46-01': AutoEnableSomeTokens,
66
- '1.3.53-01': _MigrateAssetSetting.default,
67
- '1.3.53-02': _MigrateTransactionHistoryBySymbol.default,
66
+ '1.3.55-01': _MigrateAssetSetting.default,
67
+ '1.3.55-02': _MigrateTransactionHistoryBySymbol.default,
68
68
  '1.2.69-01': _MigrateRemoveGenesisHash.default,
69
69
  '1.2.13-01': _ReloadMetadata.default,
70
70
  '1.2.32-01': _MigratePairData.default,
@@ -375,7 +375,7 @@ class BitcoinRequestHandler {
375
375
  } = this.confirmationsPromiseMap[id];
376
376
  const confirmation = confirmations[type][id];
377
377
  if (!resolver || !confirmation) {
378
- this.#logger.error((0, _i18next.t)('Unable to proceed. Please try again'), type, id);
378
+ this.#logger.error((0, _i18next.t)('bg.DAPP.services.service.request.BitcoinHandler.unableToProceed'), type, id);
379
379
  throw new Error('Unable to proceed. Please try again');
380
380
  }
381
381
  if (isApproved) {
@@ -95,8 +95,8 @@ class CardanoRequestHandler {
95
95
  } = this.confirmationsPromiseMap[id];
96
96
  const confirmation = confirmations[type][id];
97
97
  if (!resolver || !confirmation) {
98
- this.#logger.error((0, _i18next.t)('Unable to proceed. Please try again'), type, id);
99
- throw new Error((0, _i18next.t)('Unable to proceed. Please try again'));
98
+ this.#logger.error((0, _i18next.t)('bg.DAPP.services.service.request.CardanoHandler.unableToProceed'), type, id);
99
+ throw new Error((0, _i18next.t)('bg.DAPP.services.service.request.CardanoHandler.unableToProceed'));
100
100
  }
101
101
 
102
102
  // Fill signature for some special type