@subwallet/extension-base 1.3.54-0 → 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
@@ -14,51 +14,51 @@ var _SWError = require("./SWError");
14
14
  // Todo: finish this map in the future
15
15
  const defaultErrorMap = {
16
16
  NOT_ENOUGH_BALANCE: {
17
- message: (0, _utils.detectTranslate)('Insufficient balance'),
17
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.insufficientBalance'),
18
18
  code: undefined
19
19
  },
20
20
  CHAIN_DISCONNECTED: {
21
- message: (0, _utils.detectTranslate)('Network is disconnected'),
21
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.networkIsDisconnected'),
22
22
  code: undefined
23
23
  },
24
24
  INVALID_PARAMS: {
25
- message: (0, _utils.detectTranslate)('Undefined error. Please contact SubWallet support'),
25
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.undefinedErrorContactSupport'),
26
26
  code: undefined
27
27
  },
28
28
  INTERNAL_ERROR: {
29
- message: (0, _utils.detectTranslate)('Undefined error. Please contact SubWallet support'),
29
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.undefinedErrorContactSupport'),
30
30
  code: undefined
31
31
  },
32
32
  DUPLICATE_TRANSACTION: {
33
- message: (0, _utils.detectTranslate)('Another transaction is in queue. Please try again later'),
33
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.transactionInQueue'),
34
34
  code: undefined
35
35
  },
36
36
  UNABLE_TO_SIGN: {
37
- message: (0, _utils.detectTranslate)('Unable to sign'),
37
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.unableToSign'),
38
38
  code: undefined
39
39
  },
40
40
  USER_REJECT_REQUEST: {
41
- message: (0, _utils.detectTranslate)('Rejected by user'),
41
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.rejectedByUser'),
42
42
  code: undefined
43
43
  },
44
44
  UNABLE_TO_SEND: {
45
- message: (0, _utils.detectTranslate)('Unable to send'),
45
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.unableToSend'),
46
46
  code: undefined
47
47
  },
48
48
  SEND_TRANSACTION_FAILED: {
49
- message: (0, _utils.detectTranslate)('Send transaction failed'),
49
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.sendTransactionFailed'),
50
50
  code: undefined
51
51
  },
52
52
  NOT_ENOUGH_EXISTENTIAL_DEPOSIT: {
53
- message: (0, _utils.detectTranslate)('Insufficient balance to cover existential deposit. Please decrease the transaction amount or increase your current balance'),
53
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.insufficientBalanceForExistentialDeposit'),
54
54
  code: undefined
55
55
  },
56
56
  [_types.BasicTxErrorType.UNSUPPORTED]: {
57
- message: (0, _utils.detectTranslate)('This feature is not available with this token'),
57
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.featureNotAvailableForToken'),
58
58
  code: undefined
59
59
  },
60
60
  [_types.BasicTxErrorType.TIMEOUT]: {
61
- message: (0, _utils.detectTranslate)('Transaction timeout'),
61
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.transactionTimeout'),
62
62
  code: undefined
63
63
  },
64
64
  [_types.StakingTxErrorType.NOT_ENOUGH_MIN_STAKE]: {
@@ -77,43 +77,43 @@ const defaultErrorMap = {
77
77
  code: undefined
78
78
  },
79
79
  [_types.StakingTxErrorType.INVALID_ACTIVE_STAKE]: {
80
- message: (0, _utils.detectTranslate)('Invalid. If you unstake this amount your active stake would fall below minimum active threshold'),
80
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.invalidUnstakeBelowMinimum'),
81
81
  code: undefined
82
82
  },
83
83
  [_types.StakingTxErrorType.EXCEED_MAX_UNSTAKING]: {
84
- message: (0, _utils.detectTranslate)('You reached the maximum number of unstake requests'),
84
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.maxUnstakeRequestsReached'),
85
85
  code: undefined
86
86
  },
87
87
  [_types.StakingTxErrorType.INACTIVE_NOMINATION_POOL]: {
88
- message: (0, _utils.detectTranslate)('Invalid. Inactive nomination pool'),
88
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.invalidInactiveNominationPool'),
89
89
  code: undefined
90
90
  },
91
91
  [_types.StakingTxErrorType.CAN_NOT_GET_METADATA]: {
92
- message: (0, _utils.detectTranslate)('Unable to fetch staking data. Re-enable current network and try again'),
92
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.unableToFetchStakingData'),
93
93
  code: undefined
94
94
  },
95
95
  [_types.StakingTxErrorType.REMAINING_AMOUNT_TOO_LOW]: {
96
- message: (0, _utils.detectTranslate)('Remaining amount too low'),
96
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.remainingAmountTooLow'),
97
97
  code: undefined
98
98
  },
99
99
  [_types.TransferTxErrorType.RECEIVER_NOT_ENOUGH_EXISTENTIAL_DEPOSIT]: {
100
- message: (0, _utils.detectTranslate)('Receiver is not enough existential deposit'),
100
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.receiverNotEnoughExistentialDeposit'),
101
101
  code: undefined
102
102
  },
103
103
  [_types.YieldValidationStatus.NOT_ENOUGH_FEE]: {
104
- message: (0, _utils.detectTranslate)('Insufficient balance'),
104
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.insufficientBalance'),
105
105
  code: undefined
106
106
  },
107
107
  [_types.YieldValidationStatus.NOT_ENOUGH_MIN_JOIN_POOL]: {
108
- message: (0, _utils.detectTranslate)('Not enough min earning amount'),
108
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.notEnoughMinEarningAmount'),
109
109
  code: undefined
110
110
  },
111
111
  [_types.SwapErrorType.QUOTE_TIMEOUT]: {
112
- message: (0, _utils.detectTranslate)('Quote timeout'),
112
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.quoteTimeout'),
113
113
  code: undefined
114
114
  },
115
115
  [_types.SwapErrorType.INVALID_RECIPIENT]: {
116
- message: (0, _utils.detectTranslate)('Invalid recipient'),
116
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.error.Transaction.invalidRecipient'),
117
117
  code: undefined
118
118
  }
119
119
  };
@@ -14,11 +14,11 @@ var _TransactionError = require("../errors/TransactionError");
14
14
 
15
15
  const defaultWarningMap = {
16
16
  [_types.BasicTxWarningCode.NOT_ENOUGH_EXISTENTIAL_DEPOSIT]: {
17
- message: (0, _utils.detectTranslate)('Insufficient balance to cover existential deposit. Please decrease the transaction amount or increase your current balance'),
17
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.warning.Transaction.insufficientBalanceForExistentialDeposit'),
18
18
  code: undefined
19
19
  },
20
20
  [_types.BasicTxWarningCode.IS_BOUNCEABLE_ADDRESS]: {
21
- message: (0, _utils.detectTranslate)('We are not supporting for bounceable address. The send mode is work as non-bounceable address.'),
21
+ message: (0, _utils.detectTranslate)('bg.TRANSACTION.background.warning.Transaction.bounceableAddressNotSupported'),
22
22
  code: undefined
23
23
  }
24
24
  };
@@ -66,14 +66,26 @@ Object.keys(_transfer).forEach(function (key) {
66
66
  function validateSpendingAndFeePayment(spendingToken, feeToken, bnSpendingAmount, bnFromTokenBalance, bnFeeAmount, bnFeeTokenBalance) {
67
67
  if (spendingToken.slug === feeToken.slug) {
68
68
  if (bnFromTokenBalance.lte(bnSpendingAmount.plus(bnFeeAmount).plus((0, _utils._isNativeToken)(spendingToken) ? '0' : (0, _utils._getTokenMinAmount)(spendingToken)))) {
69
- return [new _TransactionError.TransactionError(_types.BasicTxErrorType.NOT_ENOUGH_BALANCE, (0, _i18next.t)(`Insufficient balance. Deposit ${spendingToken.symbol} and try again.`))];
69
+ return [new _TransactionError.TransactionError(_types.BasicTxErrorType.NOT_ENOUGH_BALANCE, (0, _i18next.t)('bg.core.validation.insufficientSpendingTokenBalance', {
70
+ replace: {
71
+ spendingTokenSymbol: spendingToken.symbol
72
+ }
73
+ }))];
70
74
  }
71
75
  } else {
72
76
  if (bnFromTokenBalance.lte(bnSpendingAmount.plus((0, _utils._isNativeToken)(spendingToken) ? '0' : (0, _utils._getTokenMinAmount)(spendingToken)))) {
73
- return [new _TransactionError.TransactionError(_types.BasicTxErrorType.NOT_ENOUGH_BALANCE, (0, _i18next.t)(`Insufficient balance. Deposit ${spendingToken.symbol} and try again.`))];
77
+ return [new _TransactionError.TransactionError(_types.BasicTxErrorType.NOT_ENOUGH_BALANCE, (0, _i18next.t)('bg.core.validation.insufficientSpendingTokenBalance', {
78
+ replace: {
79
+ spendingTokenSymbol: spendingToken.symbol
80
+ }
81
+ }))];
74
82
  }
75
83
  if (bnFeeTokenBalance.lte(bnFeeAmount.plus((0, _utils._isNativeToken)(feeToken) ? '0' : (0, _utils._getTokenMinAmount)(feeToken)))) {
76
- return [new _TransactionError.TransactionError(_types.BasicTxErrorType.NOT_ENOUGH_BALANCE, (0, _i18next.t)(`Insufficient balance. Deposit ${feeToken.symbol} and try again.`))];
84
+ return [new _TransactionError.TransactionError(_types.BasicTxErrorType.NOT_ENOUGH_BALANCE, (0, _i18next.t)('bg.core.validation.insufficientFeeTokenBalance', {
85
+ replace: {
86
+ feeTokenSymbol: feeToken.symbol
87
+ }
88
+ }))];
77
89
  }
78
90
  }
79
91
  return [];
@@ -181,7 +181,7 @@ async function validationAuthMiddleware(koni, url, payload) {
181
181
  return handleAuthError(payload, 'Account not in allowed list', 'dApp', errors);
182
182
  }
183
183
  if (payload.pair.meta.noPublicKey) {
184
- return handleAuthError(payload, (0, _i18next.t)('This account is not supported for this action'), 'dApp', errors);
184
+ return handleAuthError(payload, (0, _i18next.t)('bg.TRANSACTION.core.validation.request.accountNotSupportedForAction'), 'dApp', errors);
185
185
  }
186
186
  payload.authInfo = authInfo;
187
187
  }
@@ -768,14 +768,14 @@ async function validationBitcoinSignMessageMiddleware(koni, url, payload_) {
768
768
  errors.push(error);
769
769
  };
770
770
  if (address === '' || !message) {
771
- handleError((0, _i18next.t)('not found address or payload to sign'));
771
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.notFoundAddressOrPayload'));
772
772
  }
773
773
  if (!(0, _validate.isBitcoinAddress)(address)) {
774
- handleError((0, _i18next.t)('Invalid bitcoin address'));
774
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.invalidBitcoinAddress'));
775
775
  }
776
776
  const pair = pair_ || _uiKeyring.keyring.getPair(address);
777
777
  if (!pair) {
778
- handleError((0, _i18next.t)('Unable to find account'));
778
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.unableToFindAccount'));
779
779
  }
780
780
  const hashPayload = '';
781
781
  let canSign = false;
@@ -825,23 +825,23 @@ async function validationBitcoinSignPsbtMiddleware(koni, url, payload_) {
825
825
  errors.push(error);
826
826
  };
827
827
  if (!(psbtParams.network === 'mainnet' || psbtParams.network === 'testnet')) {
828
- handleError((0, _i18next.t)('Network to try this request is must be mainnet or testnet'));
828
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.networkMustBeMainnetOrTestnet'));
829
829
  }
830
830
  if (!networkKey) {
831
- handleError((0, _i18next.t)('Network unavailable. Please switch network or manually add network to wallet'));
831
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.networkUnavailableSwitchOrAdd'));
832
832
  }
833
833
  if (!psbt || !address) {
834
- handleError((0, _i18next.t)('Not found payload to sign'));
834
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.notFoundPayloadToSign'));
835
835
  }
836
836
  if (!(0, _util.isHex)(`0x${psbt}`)) {
837
- handleError((0, _i18next.t)('Psbt to be signed must be hex-encoded'));
837
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.psbtMustBeHexEncoded'));
838
838
  }
839
839
  if (!(0, _validate.isBitcoinAddress)(address)) {
840
- handleError((0, _i18next.t)('Not found address'));
840
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.notFoundAddress'));
841
841
  }
842
842
  const addressInfo = (0, _utils3.getBitcoinAddressInfo)(address);
843
843
  if (psbtParams.network !== addressInfo.network) {
844
- handleError((0, _i18next.t)('The account or the network is not matched'));
844
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.accountOrNetworkNotMatched'));
845
845
  }
846
846
  const payload = {
847
847
  broadcast: !!broadcast,
@@ -898,13 +898,13 @@ async function validationBitcoinSendTransactionMiddleware(koni, url, payload_) {
898
898
  return val;
899
899
  };
900
900
  if (transactionParams.network !== senderAccountInfo.network) {
901
- handleError((0, _i18next.t)('The account or the network is not matched'));
901
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.accountOrNetworkNotMatched'));
902
902
  }
903
903
  if (!((_transactionParams$re = transactionParams.recipients) !== null && _transactionParams$re !== void 0 && _transactionParams$re.length)) {
904
- handleError((0, _i18next.t)('please provide the recipient and the amount'));
904
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.provideRecipientAndAmount'));
905
905
  }
906
906
  if (((_transactionParams$re2 = transactionParams.recipients) === null || _transactionParams$re2 === void 0 ? void 0 : _transactionParams$re2.length) > 1) {
907
- handleError((0, _i18next.t)("we don't support multiple recipients yet. Please provide only one for now."));
907
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.multipleRecipientsNotSupported'));
908
908
  }
909
909
  if (transactionParams.recipients.filter(_ref => {
910
910
  let {
@@ -917,17 +917,17 @@ async function validationBitcoinSendTransactionMiddleware(koni, url, payload_) {
917
917
  }
918
918
  const recipientAccountInfo = (0, _utils3.getBitcoinAddressInfo)(transactionParams.recipients[0].address);
919
919
  if (recipientAccountInfo.network !== transactionParams.network) {
920
- handleError((0, _i18next.t)('invalid recipient address'));
920
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.invalidRecipientAddress'));
921
921
  }
922
922
  if (transactionParams.recipients.length !== 1) {
923
- handleError((0, _i18next.t)('receiving address must be a single account'));
923
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.receivingAddressMustBeSingleAccount'));
924
924
  }
925
925
  if (address === transactionParams.recipients[0].address) {
926
- handleError((0, _i18next.t)('must be different from sending address'));
926
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.mustBeDifferentFromSendingAddress'));
927
927
  }
928
928
  const pair = pair_ || _uiKeyring.keyring.getPair(address);
929
929
  if (!pair) {
930
- handleError((0, _i18next.t)('unable to find account'));
930
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.unableToFindAccountError'));
931
931
  }
932
932
  const tokenInfo = koni.getNativeTokenInfo(networkKey);
933
933
  let freeBalance = {
@@ -940,15 +940,15 @@ async function validationBitcoinSendTransactionMiddleware(koni, url, payload_) {
940
940
  freeBalance = await koni.balanceService.getTransferableBalance(address, networkKey, tokenInfo.slug);
941
941
  } catch (e) {
942
942
  const message = e.message;
943
- if (message.toLowerCase().includes((0, _i18next.t)('please enable network'))) {
943
+ if (message.toLowerCase().includes((0, _i18next.t)('bg.TRANSACTION.core.validation.request.pleaseEnableNetwork'))) {
944
944
  const chainInfo = koni.chainService.getChainInfoByKey(networkKey);
945
945
  payload_.errorPosition = 'ui';
946
946
  payload_.confirmationType = 'bitcoinSendTransactionRequestAfterConfirmation';
947
- const [message, name] = [(0, _i18next.t)('Enable {{chain}} network on the extension and try again', {
947
+ const [message, name] = [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.enableChainOnExtension', {
948
948
  replace: {
949
949
  chain: chainInfo.name
950
950
  }
951
- }), (0, _i18next.t)('Network not enabled')];
951
+ }), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.networkNotEnabled')];
952
952
  const error = new _BitcoinProviderError.BitcoinProviderError(_KoniTypes.BitcoinProviderErrorType.INVALID_PARAMS, message, undefined, name);
953
953
  console.error(error);
954
954
  errors.push(error);
@@ -965,7 +965,7 @@ async function validationBitcoinSendTransactionMiddleware(koni, url, payload_) {
965
965
  };
966
966
  });
967
967
  if (new _bignumber.default(freeBalance.value).lte(totalValue)) {
968
- handleError((0, _i18next.t)('insufficient balance'));
968
+ handleError((0, _i18next.t)('bg.TRANSACTION.core.validation.request.insufficientBalanceError'));
969
969
  }
970
970
  const sendTransactionRequest = {
971
971
  networkKey,
@@ -990,10 +990,10 @@ function convertErrorMessage(message_, name) {
990
990
 
991
991
  // Network error
992
992
  if (message.includes('connection error') || message.includes('connection not open') || message.includes('connection timeout') || message.includes('can not active chain') || message.includes('invalid json rpc') || message.includes('internet connection')) {
993
- return [(0, _i18next.t)('Re-enable the network or change RPC on the extension and try again'), (0, _i18next.t)('Unstable network connection')];
993
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.reEnableOrChangeRpc'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.unstableNetworkConnection')];
994
994
  }
995
995
  if (message.includes('network is currently not supported')) {
996
- return [(0, _i18next.t)('This network is not yet supported on SubWallet. (Import the network)[https://docs.subwallet.app/main/extension-user-guide/customize-your-networks#import-networks] on SubWallet and try again'), (0, _i18next.t)('Network not supported')];
996
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.networkNotSupportedImport'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.networkNotSupported')];
997
997
  }
998
998
 
999
999
  // Authentication
@@ -1007,48 +1007,48 @@ function convertErrorMessage(message_, name) {
1007
1007
  // Transaction
1008
1008
 
1009
1009
  if (message.includes('recipient address not found')) {
1010
- return [(0, _i18next.t)('Enter recipient address and try again'), (0, _i18next.t)('Recipient address not found')];
1010
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.enterRecipientAddress'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.recipientAddressNotFound')];
1011
1011
  }
1012
1012
  if (message.includes('is not a number') || message.includes('invalid number value') || message.includes('invalid bignumberish')) {
1013
- return [(0, _i18next.t)('Amount must be an integer. Enter an integer and try again'), (0, _i18next.t)('Invalid amount')];
1013
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.amountMustBeInteger'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.invalidAmount')];
1014
1014
  }
1015
1015
  if (message.includes('calculate estimate gas fee') || message.includes('invalidcode')) {
1016
- return [(0, _i18next.t)('Unable to calculate estimated gas for this transaction. Try again or contact support at agent@subwallet.app'), (0, _i18next.t)('Gas calculation error')];
1016
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.gasCalculationError'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.gasCalculationErrorTitle')];
1017
1017
  }
1018
1018
  if (message.includes('invalid recipient address')) {
1019
- return [(0, _i18next.t)('Make sure the recipient address is valid and in the same type as the sender address, then try again'), (0, _i18next.t)('Invalid recipient address')];
1019
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.recipientAddressTypeMismatch'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.invalidRecipientAddressError')];
1020
1020
  }
1021
1021
  if (message.includes('must be different from sending address')) {
1022
- return [(0, _i18next.t)('The recipient address must be different from the sender address'), (0, _i18next.t)('Invalid recipient address')];
1022
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.recipientMustBeDifferentFromSender'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.invalidRecipientAddressError')];
1023
1023
  }
1024
1024
  if (message.includes('the sender address must be the ethereum address type')) {
1025
- return [(0, _i18next.t)('The sender address must be the ethereum address type'), (0, _i18next.t)('Invalid address type')];
1025
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.senderMustBeEthereumAddress'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.invalidAddressType')];
1026
1026
  }
1027
1027
  if (message.includes('the sender address must be the ethereum address type')) {
1028
- return [(0, _i18next.t)('The sender address must be the bitcoin address type'), (0, _i18next.t)('Invalid address type')];
1028
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.senderMustBeBitcoinAddress'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.invalidAddressType')];
1029
1029
  }
1030
1030
  if (message.includes('account or the network is not matched')) {
1031
- return [(0, _i18next.t)('The account does not match the selected network'), (0, _i18next.t)('Invalid address type')];
1031
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.accountDoesNotMatchNetwork'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.invalidAddressType')];
1032
1032
  }
1033
1033
  if (message.includes('receiving address must be a single account')) {
1034
- return [(0, _i18next.t)('The receiving address must be a single account'), (0, _i18next.t)('Invalid recipient address')];
1034
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.receivingAddressMustBeSingle'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.invalidRecipientAddressError')];
1035
1035
  }
1036
1036
  if (message.includes('insufficient balance') || message.includes('insufficient funds')) {
1037
- return [(0, _i18next.t)('Insufficient balance on the sender address. Top up your balance and try again'), (0, _i18next.t)('Unable to sign transaction')];
1037
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.insufficientSenderBalance'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.unableToSignTransaction')];
1038
1038
  }
1039
1039
  if (message.includes('substrate') && message.includes('receive this token')) {
1040
- return [(0, _i18next.t)('The recipient account is a Ledger Polkadot (EVM) account, which is not supported for this transaction. Change recipient account and try again'), (0, _i18next.t)('Invalid account type')];
1040
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.recipientLedgerEvmNotSupported'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.invalidAccountType')];
1041
1041
  }
1042
1042
 
1043
1043
  // Sign Message
1044
1044
  if (message.includes('not found address or payload to sign')) {
1045
- return [(0, _i18next.t)('An error occurred when signing this request. Try again or contact support at agent@subwallet.app'), (0, _i18next.t)('Unable to sign')];
1045
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.errorSigningRequest'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.unableToSign')];
1046
1046
  }
1047
1047
  if (message.includes('unsupported method') || message.includes('unsupported action')) {
1048
- return [(0, _i18next.t)('This sign method is not supported by SubWallet. Try again or contact support at agent@subwallet.app'), (0, _i18next.t)('Method not supported')];
1048
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.signMethodNotSupported'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.methodNotSupported')];
1049
1049
  }
1050
1050
  if (message.includes('eip712 typed data') || message.includes('invalid message')) {
1051
- return [(0, _i18next.t)('An error occurred when attempting to sign this request. Contact support at email: agent@subwallet.app'), (0, _i18next.t)('Unable to sign')];
1051
+ return [(0, _i18next.t)('bg.TRANSACTION.core.validation.request.errorAttemptingToSign'), (0, _i18next.t)('bg.TRANSACTION.core.validation.request.unableToSign')];
1052
1052
  }
1053
1053
  return [message, name || 'Error'];
1054
1054
  }
@@ -41,20 +41,20 @@ function validateTransferRequest(tokenInfo, from, to, value, transferAll) {
41
41
  const errors = [];
42
42
  if (!transferAll) {
43
43
  if (value === undefined) {
44
- errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('Transfer amount is required')));
44
+ errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.transferAmountRequired')));
45
45
  }
46
46
  }
47
47
  if (!tokenInfo) {
48
- errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('Not found token from registry')));
48
+ errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.tokenNotFoundInRegistry')));
49
49
  }
50
50
  if ((0, _utilCrypto.isEthereumAddress)(from) && (0, _utilCrypto.isEthereumAddress)(to) && (0, _utils3._isTokenEvmSmartContract)(tokenInfo) && (0, _utils3._getContractAddressOfToken)(tokenInfo).length === 0) {
51
- errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('Not found ERC20 address for this token')));
51
+ errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.erc20AddressNotFound')));
52
52
  }
53
53
  if ((0, _keyring.isTonAddress)(from) && (0, _keyring.isTonAddress)(to) && (0, _utils3._isTokenTonSmartContract)(tokenInfo) && (0, _utils3._getContractAddressOfToken)(tokenInfo).length === 0) {
54
- errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('Not found TEP74 address for this token')));
54
+ errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.tep74AddressNotFound')));
55
55
  }
56
56
  if ((0, _keyring.isCardanoAddress)(from) && (0, _keyring.isCardanoAddress)(to) && (0, _utils3._isCIP26Token)(tokenInfo) && (0, _utils.getCardanoAssetId)(tokenInfo).length === 0) {
57
- errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('Not found policy id of this token')));
57
+ errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.policyIdNotFound')));
58
58
  }
59
59
  return errors;
60
60
  }
@@ -72,7 +72,7 @@ function additionalValidateTransferForRecipient(sendingTokenInfo, nativeTokenInf
72
72
  const minXCMStr = (0, _utils5.formatNumber)(sendingTokenMinAmountXCM.toString(), (0, _utils3._getAssetDecimals)(sendingTokenInfo), _utils5.balanceFormatter, {
73
73
  maxNumberFormat: (0, _utils3._getAssetDecimals)(sendingTokenInfo) || 6
74
74
  });
75
- const error = new _TransactionError.TransactionError(_types.TransferTxErrorType.NOT_ENOUGH_VALUE, (0, _i18next.t)('You must transfer at least {{amount}} {{symbol}} to keep the recipient account alive. Increase amount and try again', {
75
+ const error = new _TransactionError.TransactionError(_types.TransferTxErrorType.NOT_ENOUGH_VALUE, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.transferMinimumToKeepAccountAlive', {
76
76
  replace: {
77
77
  amount: minXCMStr,
78
78
  symbol: sendingTokenInfo.symbol
@@ -89,7 +89,7 @@ function additionalValidateTransferForRecipient(sendingTokenInfo, nativeTokenInf
89
89
  const balanceKeepAlive = (0, _utils5.formatNumber)(nativeTokenMinAmount, (0, _utils3._getAssetDecimals)(nativeTokenInfo), _utils5.balanceFormatter, {
90
90
  maxNumberFormat: (0, _utils3._getAssetDecimals)(nativeTokenInfo) || 6
91
91
  });
92
- const error = new _TransactionError.TransactionError(_types.TransferTxErrorType.RECEIVER_NOT_ENOUGH_EXISTENTIAL_DEPOSIT, (0, _i18next.t)('The recipient account has less than {{amount}} {{nativeSymbol}}, which can lead to your {{localSymbol}} being lost. Change recipient account and try again', {
92
+ const error = new _TransactionError.TransactionError(_types.TransferTxErrorType.RECEIVER_NOT_ENOUGH_EXISTENTIAL_DEPOSIT, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.recipientBalanceTooLow', {
93
93
  replace: {
94
94
  amount: balanceKeepAlive,
95
95
  nativeSymbol: nativeTokenInfo.symbol,
@@ -103,7 +103,7 @@ function additionalValidateTransferForRecipient(sendingTokenInfo, nativeTokenInf
103
103
  const atLeastStr = (0, _utils5.formatNumber)(atLeast.toString(), (0, _utils3._getAssetDecimals)(sendingTokenInfo), _utils5.balanceFormatter, {
104
104
  maxNumberFormat: (0, _utils3._getAssetDecimals)(sendingTokenInfo) || 6
105
105
  });
106
- const error = new _TransactionError.TransactionError(_types.TransferTxErrorType.RECEIVER_NOT_ENOUGH_EXISTENTIAL_DEPOSIT, (0, _i18next.t)('You must transfer at least {{amount}} {{symbol}} to avoid losing funds on the recipient account. Increase amount and try again', {
106
+ const error = new _TransactionError.TransactionError(_types.TransferTxErrorType.RECEIVER_NOT_ENOUGH_EXISTENTIAL_DEPOSIT, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.transferMinimumToAvoidFundLoss', {
107
107
  replace: {
108
108
  amount: atLeastStr,
109
109
  symbol: sendingTokenInfo.symbol
@@ -117,7 +117,7 @@ function additionalValidateTransferForRecipient(sendingTokenInfo, nativeTokenInf
117
117
  const atLeastStr = (0, _utils5.formatNumber)(atLeast.toString(), (0, _utils3._getAssetDecimals)(sendingTokenInfo), _utils5.balanceFormatter, {
118
118
  maxNumberFormat: (0, _utils3._getAssetDecimals)(sendingTokenInfo) || 6
119
119
  });
120
- const error = new _TransactionError.TransactionError(_types.TransferTxErrorType.RECEIVER_NOT_ENOUGH_EXISTENTIAL_DEPOSIT, (0, _i18next.t)('You must transfer at least {{amount}} {{symbol}} to keep the recipient account alive. Increase amount and try again', {
120
+ const error = new _TransactionError.TransactionError(_types.TransferTxErrorType.RECEIVER_NOT_ENOUGH_EXISTENTIAL_DEPOSIT, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.transferMinimumToKeepAccountAlive', {
121
121
  replace: {
122
122
  amount: atLeastStr,
123
123
  symbol: sendingTokenInfo.symbol
@@ -133,7 +133,7 @@ function validateXcmTransferRequest(destTokenInfo, sender, sendingValue) {
133
133
  const errors = [];
134
134
  const keypair = _uiKeyring.keyring.getPair(sender);
135
135
  if (!destTokenInfo) {
136
- errors.push(new _TransactionError.TransactionError(_types.TransferTxErrorType.INVALID_TOKEN, (0, _i18next.t)('Not found token from registry')));
136
+ errors.push(new _TransactionError.TransactionError(_types.TransferTxErrorType.INVALID_TOKEN, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.tokenNotFoundInRegistry')));
137
137
  }
138
138
  return [errors, keypair];
139
139
  }
@@ -142,7 +142,11 @@ function checkSupportForFeature(validationResponse, blockedFeaturesList, chainIn
142
142
  const chain = validationResponse.chain;
143
143
  const currentFeature = `${extrinsicType}___${chain}`;
144
144
  if (blockedFeaturesList.includes(currentFeature)) {
145
- validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.UNSUPPORTED, (0, _i18next.t)(`Feature under maintenance on ${chainInfo.name} network. Try again later`)));
145
+ validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.UNSUPPORTED, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.featureUnderMaintenanceOnNetwork', {
146
+ replace: {
147
+ chainInfoName: chainInfo.name
148
+ }
149
+ })));
146
150
  }
147
151
  }
148
152
  function checkSupportForAction(validationResponse, blockedActionsMap) {
@@ -305,7 +309,7 @@ function checkSupportForAction(validationResponse, blockedActionsMap) {
305
309
  }
306
310
  const blockedActionsList = Object.values(blockedActionsMap).flat();
307
311
  if (blockedActionsList.includes(currentAction)) {
308
- validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.UNSUPPORTED, (0, _i18next.t)('Feature under maintenance. Try again later')));
312
+ validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.UNSUPPORTED, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.featureUnderMaintenance')));
309
313
  }
310
314
  }
311
315
 
@@ -316,7 +320,7 @@ function checkSupportForTransaction(validationResponse, transaction) {
316
320
  } = validationResponse;
317
321
  if (!transaction) {
318
322
  if (extrinsicType === _KoniTypes.ExtrinsicType.SEND_NFT) {
319
- validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.UNSUPPORTED, (0, _i18next.t)('This feature is not yet available for this NFT')));
323
+ validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.UNSUPPORTED, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.featureNotAvailableForNft')));
320
324
  } else {
321
325
  validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.UNSUPPORTED));
322
326
  }
@@ -420,20 +424,20 @@ function checkSigningAccountForTransaction(validationResponse, chainInfoMap) {
420
424
  } = validationResponse;
421
425
  const pair = _uiKeyring.keyring.getPair(address);
422
426
  if (!pair) {
423
- validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INTERNAL_ERROR, (0, _i18next.t)('Unable to find account')));
427
+ validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INTERNAL_ERROR, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.unableToFindAccount')));
424
428
  } else {
425
429
  const accountJson = (0, _utils5.pairToAccount)(pair, chainInfoMap);
426
430
  if (!accountJson.transactionActions.includes(extrinsicType)) {
427
431
  // check if the account can sign the transaction type
428
- validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('This feature is not available with this account')));
432
+ validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.featureNotAvailableForAccount')));
429
433
  } else if (accountJson.specialChain && accountJson.specialChain !== chain) {
430
434
  // check if the account can only be used on a specific chain (for ledger legacy)
431
- validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('This feature is not available with this account')));
435
+ validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.featureNotAvailableForAccount')));
432
436
  } else {
433
437
  const compatibleMap = [_types.AccountSignMode.LEGACY_LEDGER, _types.AccountSignMode.GENERIC_LEDGER].includes(accountJson.signMode) ? _constants.LEDGER_SIGNING_COMPATIBLE_MAP : _constants.SIGNING_COMPATIBLE_MAP;
434
438
  if (!compatibleMap[chainType].includes(accountJson.chainType)) {
435
439
  // check if the account chain type is compatible with the transaction chain type
436
- validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('This feature is not available with this account')));
440
+ validationResponse.errors.push(new _TransactionError.TransactionError(_types.BasicTxErrorType.INVALID_PARAMS, (0, _i18next.t)('bg.TRANSACTION.core.validation.transfer.featureNotAvailableForAccount')));
437
441
  }
438
442
  }
439
443
  }
@@ -87,7 +87,7 @@ const parseSubstrateTransaction = (data, apiPromise) => {
87
87
  } catch (e) {
88
88
  return {
89
89
  ...baseInfo,
90
- message: (0, _i18next.t)('Unable to decode the information'),
90
+ message: (0, _i18next.t)('bg.DAPP.koni.api.dotsama.parseTransaction.unableToDecodeInformation'),
91
91
  method: _method
92
92
  };
93
93
  }
@@ -49,7 +49,7 @@ function validateRelayUnbondingCondition(amount, chainStakingMetadata, nominator
49
49
  errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.INVALID_ACTIVE_STAKE));
50
50
  }
51
51
  if (nominatorMetadata.unstakings.length > chainStakingMetadata.maxWithdrawalRequestPerValidator) {
52
- errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.EXCEED_MAX_UNSTAKING, (0, _i18next.t)('You cannot unstake more than {{number}} times', {
52
+ errors.push(new _TransactionError.TransactionError(_types.StakingTxErrorType.EXCEED_MAX_UNSTAKING, (0, _i18next.t)('bg.EARNING.koni.api.staking.bonding.relayChain.maxUnstakeTimes', {
53
53
  replace: {
54
54
  number: chainStakingMetadata.maxWithdrawalRequestPerValidator
55
55
  }
@@ -497,7 +497,7 @@ async function getRelayMaxNominations(substrateApi) {
497
497
  const getMinStakeErrorMessage = (chainInfo, bnMinStake) => {
498
498
  const tokenInfo = (0, _utils._getChainNativeTokenBasicInfo)(chainInfo);
499
499
  const number = (0, _number.formatNumber)(bnMinStake.toString(), tokenInfo.decimals || 0, _number.balanceFormatter);
500
- return (0, _i18next.t)('Insufficient stake. You need to stake at least {{number}} {{tokenSymbol}} to earn rewards', {
500
+ return (0, _i18next.t)('bg.EARNING.koni.api.staking.bonding.utils.insufficientStakeToEarn', {
501
501
  replace: {
502
502
  tokenSymbol: tokenInfo.symbol,
503
503
  number
@@ -506,30 +506,30 @@ const getMinStakeErrorMessage = (chainInfo, bnMinStake) => {
506
506
  };
507
507
  exports.getMinStakeErrorMessage = getMinStakeErrorMessage;
508
508
  const getMaxValidatorErrorMessage = (chainInfo, max) => {
509
- let message = (0, _utils2.detectTranslate)('You cannot select more than {{number}} validators for this network');
509
+ let message = (0, _utils2.detectTranslate)('bg.EARNING.koni.api.staking.bonding.utils.maxValidatorsSelection');
510
510
  const label = getValidatorLabel(chainInfo.slug);
511
511
  if (max > 1) {
512
512
  switch (label) {
513
513
  case 'dApp':
514
- message = (0, _utils2.detectTranslate)('You cannot select more than {{number}} dApps for this network');
514
+ message = (0, _utils2.detectTranslate)('bg.EARNING.koni.api.staking.bonding.utils.maxDappsSelection');
515
515
  break;
516
516
  case 'Collator':
517
- message = (0, _utils2.detectTranslate)('You cannot select more than {{number}} collators for this network');
517
+ message = (0, _utils2.detectTranslate)('bg.EARNING.koni.api.staking.bonding.utils.maxCollatorsSelection');
518
518
  break;
519
519
  case 'Validator':
520
- message = (0, _utils2.detectTranslate)('You cannot select more than {{number}} validators for this network');
520
+ message = (0, _utils2.detectTranslate)('bg.EARNING.koni.api.staking.bonding.utils.maxValidatorsSelection');
521
521
  break;
522
522
  }
523
523
  } else {
524
524
  switch (label) {
525
525
  case 'dApp':
526
- message = (0, _utils2.detectTranslate)('You cannot select more than {{number}} dApp for this network');
526
+ message = (0, _utils2.detectTranslate)('bg.EARNING.koni.api.staking.bonding.utils.maxOneDappSelection');
527
527
  break;
528
528
  case 'Collator':
529
- message = (0, _utils2.detectTranslate)('You cannot select more than {{number}} collator for this network');
529
+ message = (0, _utils2.detectTranslate)('bg.EARNING.koni.api.staking.bonding.utils.maxOneCollatorSelection');
530
530
  break;
531
531
  case 'Validator':
532
- message = (0, _utils2.detectTranslate)('You cannot select more than {{number}} validator for this network');
532
+ message = (0, _utils2.detectTranslate)('bg.EARNING.koni.api.staking.bonding.utils.maxOneValidatorSelection');
533
533
  break;
534
534
  }
535
535
  }
@@ -545,29 +545,29 @@ const getExistUnstakeErrorMessage = (chain, type, isStakeMore) => {
545
545
  if (!isStakeMore) {
546
546
  switch (label) {
547
547
  case 'dApp':
548
- return (0, _i18next.t)('You can unstake from a dApp once');
548
+ return (0, _i18next.t)('bg.EARNING.koni.api.staking.bonding.utils.unstakeFromDappOnce');
549
549
  case 'Collator':
550
- return (0, _i18next.t)('You can unstake from a collator once');
550
+ return (0, _i18next.t)('bg.EARNING.koni.api.staking.bonding.utils.unstakeFromCollatorOnce');
551
551
  case 'Validator':
552
552
  {
553
553
  if (type === _KoniTypes.StakingType.POOLED) {
554
- return (0, _i18next.t)('You can unstake from a pool once');
554
+ return (0, _i18next.t)('bg.EARNING.koni.api.staking.bonding.utils.unstakeFromPoolOnce');
555
555
  }
556
- return (0, _i18next.t)('You can unstake from a validator once');
556
+ return (0, _i18next.t)('bg.EARNING.koni.api.staking.bonding.utils.unstakeFromValidatorOnce');
557
557
  }
558
558
  }
559
559
  } else {
560
560
  switch (label) {
561
561
  case 'dApp':
562
- return (0, _i18next.t)('You cannot stake more for a dApp you are unstaking from');
562
+ return (0, _i18next.t)('bg.EARNING.koni.api.staking.bonding.utils.cannotStakeMoreOnUnstakingDapp');
563
563
  case 'Collator':
564
- return (0, _i18next.t)('You cannot stake more for a collator you are unstaking from');
564
+ return (0, _i18next.t)('bg.EARNING.koni.api.staking.bonding.utils.cannotStakeMoreOnUnstakingCollator');
565
565
  case 'Validator':
566
566
  {
567
567
  if (type === _KoniTypes.StakingType.POOLED) {
568
- return (0, _i18next.t)('You cannot stake more for a pool you are unstaking from');
568
+ return (0, _i18next.t)('bg.EARNING.koni.api.staking.bonding.utils.cannotStakeMoreOnUnstakingPool');
569
569
  }
570
- return (0, _i18next.t)('You cannot stake more for a validator you are unstaking from');
570
+ return (0, _i18next.t)('bg.EARNING.koni.api.staking.bonding.utils.cannotStakeMoreOnUnstakingValidator');
571
571
  }
572
572
  }
573
573
  }
@@ -194,7 +194,7 @@ async function getAmplitudeUnclaimedStakingReward(substrateApiMap, addresses, ne
194
194
  });
195
195
  const unclaimedRewardList = [];
196
196
  await Promise.all(chains.map(async chain => {
197
- if (_constants._STAKING_CHAIN_GROUP.amplitude.includes(chain) && !_constants._STAKING_CHAIN_GROUP.kilt.includes(chain) && !_constants._STAKING_CHAIN_GROUP.krest_network.includes(chain)) {
197
+ if (_constants._STAKING_CHAIN_GROUP.amplitude.includes(chain) && !_constants._STAKING_CHAIN_GROUP.krest_network.includes(chain)) {
198
198
  const networkInfo = networks[chain];
199
199
  const apiProps = await substrateApiMap[chain].isReady;
200
200
  await Promise.all(useAddresses.map(async address => {