@subwallet/extension-base 1.3.70-2 → 1.3.72-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 (237) hide show
  1. package/background/KoniTypes.d.ts +13 -2
  2. package/background/KoniTypes.js +68 -9
  3. package/cjs/background/KoniTypes.js +68 -9
  4. package/cjs/constants/blocked-actions.js +3 -0
  5. package/cjs/core/logic-validation/recipientAddress.js +1 -1
  6. package/cjs/core/logic-validation/swap.js +0 -3
  7. package/cjs/core/logic-validation/transfer.js +33 -10
  8. package/cjs/core/substrate/system-pallet.js +0 -2
  9. package/cjs/core/types.js +1 -0
  10. package/cjs/koni/api/nft/wasm_nft/index.js +0 -1
  11. package/cjs/koni/api/staking/bonding/astar.js +0 -2
  12. package/cjs/koni/api/staking/bonding/paraChain.js +0 -3
  13. package/cjs/koni/api/staking/bonding/relayChain.js +2 -4
  14. package/cjs/koni/api/staking/bonding/utils.js +0 -4
  15. package/cjs/koni/background/cron.js +0 -1
  16. package/cjs/koni/background/handlers/Extension.js +235 -166
  17. package/cjs/koni/background/handlers/State.js +56 -52
  18. package/cjs/koni/background/handlers/Tabs.js +39 -34
  19. package/cjs/packageInfo.js +1 -1
  20. package/cjs/page/index.js +7 -0
  21. package/cjs/page/substrate/PostMessageProvider.js +3 -0
  22. package/cjs/services/balance-service/helpers/subscribe/cardano/utils.js +0 -1
  23. package/cjs/services/balance-service/helpers/subscribe/substrate/gear.js +0 -2
  24. package/cjs/services/balance-service/helpers/subscribe/substrate/index.js +48 -5
  25. package/cjs/services/balance-service/helpers/subscribe/ton/utils.js +0 -3
  26. package/cjs/services/balance-service/index.js +103 -7
  27. package/cjs/services/balance-service/transfer/bitcoin-transfer.js +0 -1
  28. package/cjs/services/balance-service/transfer/cardano-transfer.js +1 -2
  29. package/cjs/services/balance-service/transfer/smart-contract.js +0 -1
  30. package/cjs/services/balance-service/transfer/token.js +13 -37
  31. package/cjs/services/balance-service/transfer/ton-transfer.js +0 -1
  32. package/cjs/services/balance-service/transfer/xcm/index.js +3 -8
  33. package/cjs/services/balance-service/transfer/xcm/snowBridge.js +0 -1
  34. package/cjs/services/balance-service/transfer/xcm/utils.js +1 -1
  35. package/cjs/services/chain-service/constants.js +6 -5
  36. package/cjs/services/chain-service/handler/CardanoApi.js +3 -1
  37. package/cjs/services/chain-service/handler/SubstrateApi.js +0 -2
  38. package/cjs/services/chain-service/handler/light-client/index.js +1 -2
  39. package/cjs/services/chain-service/health-check/index.js +0 -1
  40. package/cjs/services/chain-service/health-check/utils/new-utils/chain-asset-validate.js +0 -1
  41. package/cjs/services/chain-service/index.js +19 -26
  42. package/cjs/services/chain-service/utils/index.js +21 -25
  43. package/cjs/services/chain-service/utils/patch.js +1 -1
  44. package/cjs/services/earning-service/handlers/base.js +32 -0
  45. package/cjs/services/earning-service/handlers/lending/base.js +0 -2
  46. package/cjs/services/earning-service/handlers/liquid-staking/acala.js +0 -1
  47. package/cjs/services/earning-service/handlers/liquid-staking/base.js +0 -2
  48. package/cjs/services/earning-service/handlers/liquid-staking/bifrost.js +0 -2
  49. package/cjs/services/earning-service/handlers/liquid-staking/parallel.js +0 -1
  50. package/cjs/services/earning-service/handlers/native-staking/astar.js +0 -2
  51. package/cjs/services/earning-service/handlers/native-staking/dtao.js +43 -2
  52. package/cjs/services/earning-service/handlers/native-staking/energy.js +0 -1
  53. package/cjs/services/earning-service/handlers/native-staking/mythos.js +0 -2
  54. package/cjs/services/earning-service/handlers/native-staking/para-chain.js +0 -2
  55. package/cjs/services/earning-service/handlers/native-staking/relay-chain.js +8 -9
  56. package/cjs/services/earning-service/handlers/special.js +7 -0
  57. package/cjs/services/history-service/subsquid-multi-chain-history.js +0 -1
  58. package/cjs/services/keyring-service/context/handlers/Derive.js +1 -1
  59. package/cjs/services/keyring-service/context/handlers/Migration.js +11 -9
  60. package/cjs/services/keyring-service/context/handlers/Mnemonic.js +18 -13
  61. package/cjs/services/keyring-service/context/state.js +21 -3
  62. package/cjs/services/keyring-service/utils.js +12 -2
  63. package/cjs/services/migration-service/index.js +1 -2
  64. package/cjs/services/migration-service/scripts/MigrateTransactionHistoryBySymbol20251223.js +55 -0
  65. package/cjs/services/migration-service/scripts/databases/MigrateAssetSetting20251223.js +41 -0
  66. package/cjs/services/migration-service/scripts/index.js +17 -13
  67. package/cjs/services/mint-campaign-service/campaigns/UnlockDotCampaign.js +0 -1
  68. package/cjs/services/nft-service/index.js +5 -0
  69. package/cjs/services/open-gov/handler.js +0 -2
  70. package/cjs/services/open-gov/interface.js +4 -1
  71. package/cjs/services/request-service/handler/BitcoinRequestHandler.js +1 -2
  72. package/cjs/services/request-service/handler/CardanoRequestHandler.js +0 -1
  73. package/cjs/services/request-service/handler/EvmRequestHandler.js +0 -1
  74. package/cjs/services/request-service/handler/TonRequestHandler.js +0 -1
  75. package/cjs/services/request-service/helper/index.js +1 -2
  76. package/cjs/services/storage-service/DatabaseService.js +0 -2
  77. package/cjs/services/storage-service/databases/index.js +2 -0
  78. package/cjs/services/substrate-proxy-service/constant.js +26 -0
  79. package/cjs/services/substrate-proxy-service/index.js +170 -0
  80. package/cjs/services/swap-service/handler/asset-hub/handler.js +0 -1
  81. package/cjs/services/swap-service/handler/asset-hub/router.js +0 -1
  82. package/cjs/services/swap-service/handler/chainflip-handler.js +1 -4
  83. package/cjs/services/swap-service/handler/hydradx-handler.js +0 -1
  84. package/cjs/services/swap-service/handler/kyber-handler.js +0 -1
  85. package/cjs/services/swap-service/handler/optimex-handler.js +1 -2
  86. package/cjs/services/swap-service/handler/simpleswap-handler.js +1 -3
  87. package/cjs/services/swap-service/handler/uniswap-handler.js +0 -3
  88. package/cjs/services/transaction-service/event-parser/index.js +6 -6
  89. package/cjs/services/transaction-service/index.js +105 -37
  90. package/cjs/services/transaction-service/utils.js +8 -5
  91. package/cjs/services/wallet-connect-service/index.js +21 -18
  92. package/cjs/services/wallet-connect-service/types.js +1 -1
  93. package/cjs/types/account/info/keyring.js +9 -1
  94. package/cjs/types/balance/index.js +5 -1
  95. package/cjs/types/index.js +11 -0
  96. package/cjs/types/substrateProxyAccount/actions/index.js +1 -0
  97. package/cjs/types/substrateProxyAccount/index.js +16 -0
  98. package/cjs/types/swap/index.js +2 -1
  99. package/cjs/types/transaction/process.js +2 -0
  100. package/cjs/types/yield/actions/join/step.js +17 -1
  101. package/cjs/utils/account/common.js +0 -26
  102. package/cjs/utils/account/derive/info/solo.js +7 -4
  103. package/cjs/utils/account/derive/validate.js +1 -1
  104. package/cjs/utils/account/transform.js +10 -5
  105. package/cjs/utils/auth.js +1 -1
  106. package/cjs/utils/bitcoin/utxo-management.js +0 -1
  107. package/cjs/utils/environment.js +2 -1
  108. package/cjs/utils/fee/transfer.js +5 -4
  109. package/cjs/utils/index.js +1 -2
  110. package/constants/blocked-actions.js +3 -0
  111. package/core/logic-validation/recipientAddress.js +1 -1
  112. package/core/logic-validation/swap.js +0 -3
  113. package/core/logic-validation/transfer.d.ts +3 -3
  114. package/core/logic-validation/transfer.js +34 -11
  115. package/core/substrate/system-pallet.js +0 -2
  116. package/core/types.d.ts +2 -1
  117. package/core/types.js +1 -0
  118. package/koni/api/nft/wasm_nft/index.js +0 -1
  119. package/koni/api/staking/bonding/astar.js +0 -2
  120. package/koni/api/staking/bonding/paraChain.js +0 -3
  121. package/koni/api/staking/bonding/relayChain.js +2 -4
  122. package/koni/api/staking/bonding/utils.js +0 -4
  123. package/koni/background/cron.js +0 -1
  124. package/koni/background/handlers/Extension.d.ts +3 -0
  125. package/koni/background/handlers/Extension.js +89 -19
  126. package/koni/background/handlers/State.d.ts +2 -0
  127. package/koni/background/handlers/State.js +43 -38
  128. package/koni/background/handlers/Tabs.js +9 -3
  129. package/package.json +50 -21
  130. package/packageInfo.js +1 -1
  131. package/page/substrate/PostMessageProvider.js +3 -0
  132. package/services/balance-service/helpers/subscribe/cardano/utils.js +0 -1
  133. package/services/balance-service/helpers/subscribe/substrate/gear.js +0 -2
  134. package/services/balance-service/helpers/subscribe/substrate/index.js +47 -4
  135. package/services/balance-service/helpers/subscribe/ton/utils.js +0 -3
  136. package/services/balance-service/index.d.ts +8 -0
  137. package/services/balance-service/index.js +105 -9
  138. package/services/balance-service/transfer/bitcoin-transfer.js +0 -1
  139. package/services/balance-service/transfer/smart-contract.js +0 -1
  140. package/services/balance-service/transfer/token.d.ts +0 -4
  141. package/services/balance-service/transfer/token.js +12 -35
  142. package/services/balance-service/transfer/ton-transfer.js +0 -1
  143. package/services/balance-service/transfer/xcm/index.js +3 -8
  144. package/services/balance-service/transfer/xcm/snowBridge.js +0 -1
  145. package/services/balance-service/transfer/xcm/utils.d.ts +0 -2
  146. package/services/balance-service/transfer/xcm/utils.js +1 -1
  147. package/services/chain-service/constants.d.ts +1 -1
  148. package/services/chain-service/constants.js +4 -4
  149. package/services/chain-service/handler/CardanoApi.js +3 -1
  150. package/services/chain-service/handler/SubstrateApi.js +0 -2
  151. package/services/chain-service/health-check/index.js +0 -1
  152. package/services/chain-service/health-check/utils/new-utils/chain-asset-validate.js +0 -1
  153. package/services/chain-service/index.d.ts +0 -1
  154. package/services/chain-service/index.js +16 -23
  155. package/services/chain-service/utils/index.js +22 -26
  156. package/services/chain-service/utils/patch.d.ts +1 -1
  157. package/services/chain-service/utils/patch.js +1 -1
  158. package/services/earning-service/handlers/base.js +32 -0
  159. package/services/earning-service/handlers/lending/base.js +0 -2
  160. package/services/earning-service/handlers/liquid-staking/acala.js +0 -1
  161. package/services/earning-service/handlers/liquid-staking/base.js +0 -2
  162. package/services/earning-service/handlers/liquid-staking/bifrost.js +0 -2
  163. package/services/earning-service/handlers/liquid-staking/parallel.js +0 -1
  164. package/services/earning-service/handlers/native-staking/astar.js +0 -2
  165. package/services/earning-service/handlers/native-staking/dtao.js +43 -0
  166. package/services/earning-service/handlers/native-staking/energy.js +0 -1
  167. package/services/earning-service/handlers/native-staking/mythos.js +0 -2
  168. package/services/earning-service/handlers/native-staking/para-chain.js +0 -2
  169. package/services/earning-service/handlers/native-staking/relay-chain.js +8 -9
  170. package/services/earning-service/handlers/special.js +7 -0
  171. package/services/history-service/subsquid-multi-chain-history.js +0 -1
  172. package/services/keyring-service/context/handlers/Derive.js +2 -2
  173. package/services/keyring-service/context/handlers/Migration.js +3 -1
  174. package/services/keyring-service/context/handlers/Mnemonic.d.ts +1 -1
  175. package/services/keyring-service/context/handlers/Mnemonic.js +16 -10
  176. package/services/keyring-service/context/state.d.ts +3 -0
  177. package/services/keyring-service/context/state.js +21 -3
  178. package/services/keyring-service/utils.d.ts +1 -0
  179. package/services/keyring-service/utils.js +9 -0
  180. package/services/migration-service/scripts/MigrateTransactionHistoryBySymbol20251223.d.ts +4 -0
  181. package/services/migration-service/scripts/MigrateTransactionHistoryBySymbol20251223.js +46 -0
  182. package/services/migration-service/scripts/databases/MigrateAssetSetting20251223.d.ts +4 -0
  183. package/services/migration-service/scripts/databases/MigrateAssetSetting20251223.js +33 -0
  184. package/services/migration-service/scripts/index.js +8 -4
  185. package/services/mint-campaign-service/campaigns/UnlockDotCampaign.js +0 -1
  186. package/services/nft-service/index.js +6 -0
  187. package/services/open-gov/handler.js +0 -2
  188. package/services/open-gov/interface.d.ts +4 -3
  189. package/services/open-gov/interface.js +4 -1
  190. package/services/request-service/handler/CardanoRequestHandler.js +0 -1
  191. package/services/request-service/handler/EvmRequestHandler.js +0 -1
  192. package/services/request-service/handler/TonRequestHandler.js +0 -1
  193. package/services/setting-service/constants.js +0 -1
  194. package/services/storage-service/DatabaseService.js +0 -2
  195. package/services/storage-service/databases/index.js +3 -0
  196. package/services/substrate-proxy-service/constant.d.ts +3 -0
  197. package/services/substrate-proxy-service/constant.js +19 -0
  198. package/services/substrate-proxy-service/index.d.ts +13 -0
  199. package/services/substrate-proxy-service/index.js +159 -0
  200. package/services/swap-service/handler/asset-hub/handler.js +0 -1
  201. package/services/swap-service/handler/asset-hub/router.js +0 -1
  202. package/services/swap-service/handler/chainflip-handler.js +0 -2
  203. package/services/swap-service/handler/hydradx-handler.js +0 -1
  204. package/services/swap-service/handler/kyber-handler.js +0 -1
  205. package/services/swap-service/handler/simpleswap-handler.js +0 -1
  206. package/services/swap-service/handler/uniswap-handler.js +0 -3
  207. package/services/transaction-service/event-parser/index.js +6 -6
  208. package/services/transaction-service/index.js +79 -11
  209. package/services/transaction-service/types.d.ts +2 -2
  210. package/services/transaction-service/utils.js +8 -5
  211. package/services/wallet-connect-service/index.js +21 -18
  212. package/services/wallet-connect-service/types.js +1 -1
  213. package/types/account/action/add/mnemonic.d.ts +3 -2
  214. package/types/account/info/keyring.js +9 -1
  215. package/types/balance/index.js +5 -1
  216. package/types/balance/transfer.d.ts +1 -0
  217. package/types/index.d.ts +1 -0
  218. package/types/index.js +1 -0
  219. package/types/substrateProxyAccount/actions/index.d.ts +17 -0
  220. package/types/substrateProxyAccount/actions/index.js +1 -0
  221. package/types/substrateProxyAccount/index.d.ts +23 -0
  222. package/types/substrateProxyAccount/index.js +8 -0
  223. package/types/swap/index.js +2 -1
  224. package/types/transaction/process.js +3 -1
  225. package/types/transaction/request.d.ts +1 -0
  226. package/types/yield/actions/join/step.js +17 -1
  227. package/types/yield/actions/join/submit.d.ts +1 -1
  228. package/utils/account/common.d.ts +0 -3
  229. package/utils/account/common.js +0 -24
  230. package/utils/account/derive/info/solo.js +8 -5
  231. package/utils/account/derive/validate.d.ts +2 -2
  232. package/utils/account/derive/validate.js +1 -1
  233. package/utils/account/transform.js +10 -5
  234. package/utils/auth.js +2 -2
  235. package/utils/bitcoin/utxo-management.js +0 -1
  236. package/utils/fee/transfer.js +4 -2
  237. package/utils/index.js +2 -5
@@ -61,7 +61,7 @@ var _types5 = require("@subwallet/keyring/types");
61
61
  var _utils9 = require("@subwallet/keyring/utils");
62
62
  var _validate = require("@subwallet/keyring/utils/address/validate");
63
63
  var _uiKeyring = require("@subwallet/ui-keyring");
64
- var _utils10 = require("@walletconnect/utils");
64
+ var _utils0 = require("@walletconnect/utils");
65
65
  var _bignumber = _interopRequireDefault(require("bignumber.js"));
66
66
  var bitcoin = _interopRequireWildcard(require("bitcoinjs-lib"));
67
67
  var _i18next = require("i18next");
@@ -69,9 +69,8 @@ var _rxjs = require("rxjs");
69
69
  var _types6 = require("@polkadot/types");
70
70
  var _util = require("@polkadot/util");
71
71
  var _utilCrypto = require("@polkadot/util-crypto");
72
- var _utils11 = require("../utils");
73
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
74
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
72
+ var _utils1 = require("../utils");
73
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
75
74
  // Copyright 2019-2022 @subwallet/extension-koni authors & contributors
76
75
  // SPDX-License-Identifier: Apache-2.0
77
76
 
@@ -458,11 +457,11 @@ class KoniExtension {
458
457
  /**
459
458
  * @todo: move to keyring context
460
459
  * */
461
- editContactAccount(_ref10) {
460
+ editContactAccount(_ref0) {
462
461
  let {
463
462
  address,
464
463
  meta
465
- } = _ref10;
464
+ } = _ref0;
466
465
  if ((0, _keyring.isAddress)(address)) {
467
466
  const _address = (0, _utils8.reformatAddress)(address);
468
467
  _uiKeyring.keyring.saveAddress(_address, meta);
@@ -475,10 +474,10 @@ class KoniExtension {
475
474
  /**
476
475
  * @todo: move to keyring context
477
476
  * */
478
- deleteContactAccount(_ref11) {
477
+ deleteContactAccount(_ref1) {
479
478
  let {
480
479
  address
481
- } = _ref11;
480
+ } = _ref1;
482
481
  if ((0, _keyring.isAddress)(address)) {
483
482
  const _address = (0, _utils8.reformatAddress)(address);
484
483
  _uiKeyring.keyring.forgetAddress(_address);
@@ -527,11 +526,11 @@ class KoniExtension {
527
526
  list: authList
528
527
  };
529
528
  }
530
- authorizeApproveV2(_ref12) {
529
+ authorizeApproveV2(_ref10) {
531
530
  let {
532
531
  accounts,
533
532
  id
534
- } = _ref12;
533
+ } = _ref10;
535
534
  const queued = this.#koniState.getAuthRequestV2(id);
536
535
  (0, _util.assert)(queued, (0, _i18next.t)('bg.koni.handler.Extension.unableToProceed'));
537
536
  const {
@@ -543,10 +542,10 @@ class KoniExtension {
543
542
  });
544
543
  return true;
545
544
  }
546
- authorizeRejectV2(_ref13) {
545
+ authorizeRejectV2(_ref11) {
547
546
  let {
548
547
  id
549
- } = _ref13;
548
+ } = _ref11;
550
549
  const queued = this.#koniState.getAuthRequestV2(id);
551
550
  (0, _util.assert)(queued, (0, _i18next.t)('bg.koni.handler.Extension.unableToProceed'));
552
551
  const {
@@ -555,10 +554,10 @@ class KoniExtension {
555
554
  reject(new Error('Rejected'));
556
555
  return true;
557
556
  }
558
- authorizeCancelV2(_ref14) {
557
+ authorizeCancelV2(_ref12) {
559
558
  let {
560
559
  id
561
- } = _ref14;
560
+ } = _ref12;
562
561
  const queued = this.#koniState.getAuthRequestV2(id);
563
562
  (0, _util.assert)(queued, (0, _i18next.t)('bg.koni.handler.Extension.unableToProceed'));
564
563
  const {
@@ -615,7 +614,7 @@ class KoniExtension {
615
614
  const type = (0, _keyring.getKeypairTypeByAddress)(address);
616
615
  const validTypes = {
617
616
  evm: _types5.EthereumKeypairTypes,
618
- substrate: _types5.SubstrateKeypairTypes,
617
+ substrate: _types5.AllSubstrateKeypairTypes,
619
618
  ton: _types5.TonKeypairTypes,
620
619
  cardano: _types5.CardanoKeypairTypes,
621
620
  bitcoin: _types5.BitcoinKeypairTypes
@@ -631,31 +630,31 @@ class KoniExtension {
631
630
  }
632
631
  return accountAuthTypes.reduce((list, accountAuthType) => {
633
632
  if (accountAuthType === 'evm') {
634
- accounts.forEach(_ref15 => {
633
+ accounts.forEach(_ref13 => {
635
634
  let {
636
635
  address
637
- } = _ref15;
636
+ } = _ref13;
638
637
  return (0, _utilCrypto.isEthereumAddress)(address) && list.push(address);
639
638
  });
640
639
  } else if (accountAuthType === 'substrate') {
641
- accounts.forEach(_ref16 => {
640
+ accounts.forEach(_ref14 => {
642
641
  let {
643
642
  address
644
- } = _ref16;
643
+ } = _ref14;
645
644
  return (0, _keyring.isSubstrateAddress)(address) && list.push(address);
646
645
  });
647
646
  } else if (accountAuthType === 'ton') {
648
- accounts.forEach(_ref17 => {
647
+ accounts.forEach(_ref15 => {
649
648
  let {
650
649
  address
651
- } = _ref17;
650
+ } = _ref15;
652
651
  return (0, _keyring.isTonAddress)(address) && list.push(address);
653
652
  });
654
653
  } else if (accountAuthType === 'cardano') {
655
- accounts.forEach(_ref18 => {
654
+ accounts.forEach(_ref16 => {
656
655
  let {
657
656
  address
658
- } = _ref18;
657
+ } = _ref16;
659
658
  return (0, _keyring.isCardanoAddress)(address) && list.push(address);
660
659
  });
661
660
  }
@@ -716,12 +715,12 @@ class KoniExtension {
716
715
  });
717
716
  });
718
717
  }
719
- async switchCurrentNetworkAuthorization(_ref19) {
718
+ async switchCurrentNetworkAuthorization(_ref17) {
720
719
  let {
721
720
  authSwitchNetworkType,
722
721
  networkKey,
723
722
  url
724
- } = _ref19;
723
+ } = _ref17;
725
724
  const authUrls = await this.#koniState.getAuthList();
726
725
  const chainInfo = this.#koniState.chainService.getChainInfoByKey(networkKey);
727
726
  const chainState = this.#koniState.getChainStateByKey(networkKey);
@@ -871,10 +870,10 @@ class KoniExtension {
871
870
  this.#koniState.updateSetting('theme', data);
872
871
  return true;
873
872
  }
874
- setCamera(_ref20) {
873
+ setCamera(_ref18) {
875
874
  let {
876
875
  camera
877
- } = _ref20;
876
+ } = _ref18;
878
877
  this.#koniState.updateSetting('camera', camera);
879
878
  return true;
880
879
  }
@@ -882,17 +881,17 @@ class KoniExtension {
882
881
  this.#koniState.updateSetting('browserConfirmationType', data);
883
882
  return true;
884
883
  }
885
- setAutoLockTime(_ref21) {
884
+ setAutoLockTime(_ref19) {
886
885
  let {
887
886
  autoLockTime
888
- } = _ref21;
887
+ } = _ref19;
889
888
  this.#koniState.updateSetting('timeAutoLock', autoLockTime);
890
889
  return true;
891
890
  }
892
- setUnlockType(_ref22) {
891
+ setUnlockType(_ref20) {
893
892
  let {
894
893
  unlockType
895
- } = _ref22;
894
+ } = _ref20;
896
895
  this.#koniState.updateSetting('unlockType', unlockType);
897
896
  return true;
898
897
  }
@@ -909,10 +908,10 @@ class KoniExtension {
909
908
  });
910
909
  return await this.getSettings();
911
910
  }
912
- setEnableChainPatrol(_ref23) {
911
+ setEnableChainPatrol(_ref21) {
913
912
  let {
914
913
  enable
915
- } = _ref23;
914
+ } = _ref21;
916
915
  this.#koniState.updateSetting('enableChainPatrol', enable);
917
916
  return true;
918
917
  }
@@ -920,17 +919,17 @@ class KoniExtension {
920
919
  this.#koniState.updateSetting('notificationSetup', request);
921
920
  return true;
922
921
  }
923
- saveMigrationAcknowledgedStatus(_ref24) {
922
+ saveMigrationAcknowledgedStatus(_ref22) {
924
923
  let {
925
924
  isAcknowledgedUnifiedAccountMigration
926
- } = _ref24;
925
+ } = _ref22;
927
926
  this.#koniState.updateSetting('isAcknowledgedUnifiedAccountMigration', isAcknowledgedUnifiedAccountMigration);
928
927
  return true;
929
928
  }
930
- saveUnifiedAccountMigrationInProgress(_ref25) {
929
+ saveUnifiedAccountMigrationInProgress(_ref23) {
931
930
  let {
932
931
  isUnifiedAccountMigrationInProgress
933
- } = _ref25;
932
+ } = _ref23;
934
933
  this.#koniState.updateSetting('isUnifiedAccountMigrationInProgress', isUnifiedAccountMigrationInProgress);
935
934
  return true;
936
935
  }
@@ -938,31 +937,31 @@ class KoniExtension {
938
937
  this.#koniState.updateSetting('isUnifiedAccountMigrationInProgress', false);
939
938
  return true;
940
939
  }
941
- setShowZeroBalance(_ref26) {
940
+ setShowZeroBalance(_ref24) {
942
941
  let {
943
942
  show
944
- } = _ref26;
943
+ } = _ref24;
945
944
  this.#koniState.updateSetting('isShowZeroBalance', show);
946
945
  return true;
947
946
  }
948
- setLanguage(_ref27) {
947
+ setLanguage(_ref25) {
949
948
  let {
950
949
  language
951
- } = _ref27;
950
+ } = _ref25;
952
951
  this.#koniState.updateSetting('language', language);
953
952
  return true;
954
953
  }
955
- setShowBalance(_ref28) {
954
+ setShowBalance(_ref26) {
956
955
  let {
957
956
  enable
958
- } = _ref28;
957
+ } = _ref26;
959
958
  this.#koniState.updateSetting('isShowBalance', enable);
960
959
  return true;
961
960
  }
962
- setAllowOneSign(_ref29) {
961
+ setAllowOneSign(_ref27) {
963
962
  let {
964
963
  allowOneSign
965
- } = _ref29;
964
+ } = _ref27;
966
965
  this.#koniState.updateSetting('allowOneSign', allowOneSign);
967
966
  return true;
968
967
  }
@@ -1011,11 +1010,11 @@ class KoniExtension {
1011
1010
  async getPrice() {
1012
1011
  return this.#koniState.priceService.getPrice();
1013
1012
  }
1014
- async getHistoryTokenPrice(_ref30) {
1013
+ async getHistoryTokenPrice(_ref28) {
1015
1014
  let {
1016
1015
  priceId,
1017
1016
  timeframe
1018
- } = _ref30;
1017
+ } = _ref28;
1019
1018
  return this.#koniState.priceService.getHistoryTokenPriceData(priceId, timeframe);
1020
1019
  }
1021
1020
  checkCoinGeckoPriceSupport(priceId) {
@@ -1036,10 +1035,10 @@ class KoniExtension {
1036
1035
  price: currentPrice
1037
1036
  };
1038
1037
  }
1039
- async setPriceCurrency(_ref31) {
1038
+ async setPriceCurrency(_ref29) {
1040
1039
  let {
1041
1040
  currency
1042
- } = _ref31;
1041
+ } = _ref29;
1043
1042
  return await this.#koniState.priceService.setPriceCurrency(currency);
1044
1043
  }
1045
1044
  subscribePrice(id, port) {
@@ -1250,11 +1249,11 @@ class KoniExtension {
1250
1249
  // Re-filter
1251
1250
  return historySubject.getValue().filter(item => addresses.some(address => (0, _utils8.isSameAddress)(item.address, address)));
1252
1251
  }
1253
- subscribeHistoryByChainAndAddress(_ref32, id, port) {
1252
+ subscribeHistoryByChainAndAddress(_ref30, id, port) {
1254
1253
  let {
1255
1254
  address,
1256
1255
  chain
1257
- } = _ref32;
1256
+ } = _ref30;
1258
1257
  const cb = (0, _subscriptions.createSubscription)(id, port);
1259
1258
  const subscribeHistoriesResponse = this.#koniState.historyService.subscribeHistories(chain, address, cb);
1260
1259
  this.createUnsubscriptionHandle(id, subscribeHistoriesResponse.unsubscribe);
@@ -1305,6 +1304,7 @@ class KoniExtension {
1305
1304
  feeCustom,
1306
1305
  feeOption,
1307
1306
  from,
1307
+ signerSubstrateProxyAddress,
1308
1308
  to,
1309
1309
  tokenPayFeeSlug,
1310
1310
  tokenSlug,
@@ -1538,6 +1538,7 @@ class KoniExtension {
1538
1538
  isTransferAll: isTransferNativeToken ? transferAll : false,
1539
1539
  isTransferLocalTokenAndPayThatTokenAsFee,
1540
1540
  edAsWarning: isTransferNativeToken,
1541
+ signerSubstrateProxyAddress,
1541
1542
  additionalValidator: additionalValidator
1542
1543
  });
1543
1544
  }
@@ -1549,6 +1550,7 @@ class KoniExtension {
1549
1550
  from,
1550
1551
  isPassConfirmation,
1551
1552
  originNetworkKey,
1553
+ signerSubstrateProxyAddress,
1552
1554
  to,
1553
1555
  tokenPayFeeSlug,
1554
1556
  tokenSlug,
@@ -1744,7 +1746,8 @@ class KoniExtension {
1744
1746
  xcmFeeDryRun,
1745
1747
  errors,
1746
1748
  additionalValidator: additionalValidator,
1747
- eventsHandler: eventsHandler
1749
+ eventsHandler: eventsHandler,
1750
+ signerSubstrateProxyAddress
1748
1751
  });
1749
1752
  }
1750
1753
  async makeBitcoinDappTransferConfirmation(inputData) {
@@ -1851,11 +1854,11 @@ class KoniExtension {
1851
1854
  } = inputData_;
1852
1855
  let inputAmount = new _bignumber.default(0);
1853
1856
  const transferTokenInfo = this.#koniState.chainService.getAssetBySlug(tokenSlug);
1854
- const totalUtxoInput = txInput.reduce((total, _ref33) => {
1857
+ const totalUtxoInput = txInput.reduce((total, _ref31) => {
1855
1858
  let {
1856
1859
  address,
1857
1860
  amount
1858
- } = _ref33;
1861
+ } = _ref31;
1859
1862
  if (!address || !amount) {
1860
1863
  return total;
1861
1864
  }
@@ -1864,11 +1867,11 @@ class KoniExtension {
1864
1867
  }
1865
1868
  return total.plus(new _bignumber.default(amount || 0));
1866
1869
  }, new _bignumber.default(0));
1867
- const totalUtxoOutput = txOutput.reduce((total, _ref34) => {
1870
+ const totalUtxoOutput = txOutput.reduce((total, _ref32) => {
1868
1871
  let {
1869
1872
  address,
1870
1873
  amount
1871
- } = _ref34;
1874
+ } = _ref32;
1872
1875
  if (!address || !amount) {
1873
1876
  return total;
1874
1877
  }
@@ -2052,28 +2055,28 @@ class KoniExtension {
2052
2055
  disableChain(networkKey) {
2053
2056
  return this.#koniState.disableChain(networkKey);
2054
2057
  }
2055
- async enableChain(_ref35) {
2058
+ async enableChain(_ref33) {
2056
2059
  let {
2057
2060
  chainSlug,
2058
2061
  enableTokens
2059
- } = _ref35;
2062
+ } = _ref33;
2060
2063
  return await this.#koniState.enableChain(chainSlug, enableTokens);
2061
2064
  }
2062
- async enableChainWithPriorityAssets(_ref36) {
2065
+ async enableChainWithPriorityAssets(_ref34) {
2063
2066
  let {
2064
2067
  chainSlug,
2065
2068
  enableTokens
2066
- } = _ref36;
2069
+ } = _ref34;
2067
2070
  return await this.#koniState.enableChainWithPriorityAssets(chainSlug, enableTokens);
2068
2071
  }
2069
2072
  async reconnectChain(chainSlug) {
2070
2073
  return this.#koniState.chainService.reconnectChain(chainSlug);
2071
2074
  }
2072
- async validateNetwork(_ref37) {
2075
+ async validateNetwork(_ref35) {
2073
2076
  let {
2074
2077
  existedChainSlug,
2075
2078
  provider
2076
- } = _ref37;
2079
+ } = _ref35;
2077
2080
  return await this.#koniState.validateCustomChain(provider, existedChainSlug);
2078
2081
  }
2079
2082
  resetDefaultNetwork() {
@@ -2166,13 +2169,13 @@ class KoniExtension {
2166
2169
  async validateCustomAsset(data) {
2167
2170
  return await this.#koniState.validateCustomAsset(data);
2168
2171
  }
2169
- async getAddressTransferableBalance(_ref38) {
2172
+ async getAddressTransferableBalance(_ref36) {
2170
2173
  let {
2171
2174
  address,
2172
2175
  extrinsicType,
2173
2176
  networkKey,
2174
2177
  token
2175
- } = _ref38;
2178
+ } = _ref36;
2176
2179
  if (token && _constants2._MANTA_ZK_CHAIN_GROUP.includes(networkKey)) {
2177
2180
  const tokenInfo = this.#koniState.chainService.getAssetBySlug(token);
2178
2181
  if (tokenInfo.symbol.startsWith(_constants2._ZK_ASSET_PREFIX)) {
@@ -2181,14 +2184,14 @@ class KoniExtension {
2181
2184
  }
2182
2185
  return await this.#koniState.balanceService.getTransferableBalance(address, networkKey, token, extrinsicType);
2183
2186
  }
2184
- async getAddressAvailableBalanceByType(_ref39) {
2187
+ async getAddressAvailableBalanceByType(_ref37) {
2185
2188
  let {
2186
2189
  address,
2187
2190
  balanceType,
2188
2191
  extrinsicType,
2189
2192
  networkKey,
2190
2193
  token
2191
- } = _ref39;
2194
+ } = _ref37;
2192
2195
  if (token && _constants2._MANTA_ZK_CHAIN_GROUP.includes(networkKey)) {
2193
2196
  const tokenInfo = this.#koniState.chainService.getAssetBySlug(token);
2194
2197
  if (tokenInfo.symbol.startsWith(_constants2._ZK_ASSET_PREFIX)) {
@@ -2197,13 +2200,13 @@ class KoniExtension {
2197
2200
  }
2198
2201
  return await this.#koniState.balanceService.getBalanceByType(address, networkKey, token, balanceType, extrinsicType);
2199
2202
  }
2200
- async getAddressTotalBalance(_ref40) {
2203
+ async getAddressTotalBalance(_ref38) {
2201
2204
  let {
2202
2205
  address,
2203
2206
  extrinsicType,
2204
2207
  networkKey,
2205
2208
  token
2206
- } = _ref40;
2209
+ } = _ref38;
2207
2210
  return await this.#koniState.balanceService.getTotalBalance(address, networkKey, token, extrinsicType);
2208
2211
  }
2209
2212
  async subscribeMaxTransferable(request, id, port) {
@@ -2260,11 +2263,11 @@ class KoniExtension {
2260
2263
  freeBalance: freeBalanceSubject,
2261
2264
  fee: feeSubject
2262
2265
  }).subscribe({
2263
- next: _ref41 => {
2266
+ next: _ref39 => {
2264
2267
  let {
2265
2268
  fee,
2266
2269
  freeBalance
2267
- } = _ref41;
2270
+ } = _ref39;
2268
2271
  (0, _utils8.calculateMaxTransferable)(id, _request, freeBalance, fee).then(cb).catch(console.error);
2269
2272
  }
2270
2273
  });
@@ -2286,7 +2289,6 @@ class KoniExtension {
2286
2289
  const fee = await this.#koniState.feeService.subscribeChainFee(id, chain, feeChainType, data => {
2287
2290
  feeSubject.next(data); // Must be called after subscription
2288
2291
  });
2289
-
2290
2292
  const unsub = () => {
2291
2293
  subscription.unsubscribe();
2292
2294
  unsubBalance();
@@ -2298,7 +2300,7 @@ class KoniExtension {
2298
2300
  });
2299
2301
  return (0, _utils8.calculateMaxTransferable)(id, _request, freeBalance, fee);
2300
2302
  }
2301
- async subscribeTransferableWhenConfirmation(_ref42, id, port) {
2303
+ async subscribeTransferableWhenConfirmation(_ref40, id, port) {
2302
2304
  let {
2303
2305
  address,
2304
2306
  chain,
@@ -2307,7 +2309,7 @@ class KoniExtension {
2307
2309
  to,
2308
2310
  token,
2309
2311
  value
2310
- } = _ref42;
2312
+ } = _ref40;
2311
2313
  const cb = (0, _subscriptions.createSubscription)(id, port);
2312
2314
  const freeBalanceSubject = new _rxjs.Subject();
2313
2315
  const feeSubject = new _rxjs.Subject();
@@ -2395,29 +2397,28 @@ class KoniExtension {
2395
2397
  feeOptions: feeOptions,
2396
2398
  feeType,
2397
2399
  error,
2398
- id
2400
+ id,
2401
+ maxTransferableWithoutFee: freeBalance.value
2399
2402
  };
2400
2403
  };
2401
2404
  const subscription = (0, _rxjs.combineLatest)({
2402
2405
  freeBalance: freeBalanceSubject,
2403
2406
  fee: feeSubject
2404
2407
  }).subscribe({
2405
- next: _ref43 => {
2408
+ next: _ref41 => {
2406
2409
  let {
2407
2410
  fee,
2408
2411
  freeBalance
2409
- } = _ref43;
2412
+ } = _ref41;
2410
2413
  convertData(freeBalance, fee, _feeOptions, feeCustom).then(cb).catch(console.error);
2411
2414
  }
2412
2415
  });
2413
2416
  const [unsubBalance, freeBalance] = await this.#koniState.balanceService.subscribeBalance(address, chain, token, _types4.BalanceType.TRANSFERABLE, _KoniTypes.ExtrinsicType.TRANSFER_BALANCE, data => {
2414
2417
  freeBalanceSubject.next(data); // Must be called after subscription
2415
2418
  });
2416
-
2417
2419
  const fee = await this.#koniState.feeService.subscribeChainFee(id, chain, feeType, data => {
2418
2420
  feeSubject.next(data); // Must be called after subscription
2419
2421
  });
2420
-
2421
2422
  const unsub = () => {
2422
2423
  subscription.unsubscribe();
2423
2424
  unsubBalance();
@@ -2429,13 +2430,13 @@ class KoniExtension {
2429
2430
  });
2430
2431
  return convertData(freeBalance, fee, _feeOptions, feeCustom);
2431
2432
  }
2432
- async subscribeAddressTransferableBalance(_ref44, id, port) {
2433
+ async subscribeAddressTransferableBalance(_ref42, id, port) {
2433
2434
  let {
2434
2435
  address,
2435
2436
  extrinsicType,
2436
2437
  networkKey,
2437
2438
  token
2438
- } = _ref44;
2439
+ } = _ref42;
2439
2440
  const cb = (0, _subscriptions.createSubscription)(id, port);
2440
2441
  const convertData = data => {
2441
2442
  return {
@@ -2454,14 +2455,14 @@ class KoniExtension {
2454
2455
  });
2455
2456
  return convertData(currentFreeBalance);
2456
2457
  }
2457
- async subscribeAddressAvailableBalanceByType(_ref45, id, port) {
2458
+ async subscribeAddressAvailableBalanceByType(_ref43, id, port) {
2458
2459
  let {
2459
2460
  address,
2460
2461
  balanceType,
2461
2462
  extrinsicType,
2462
2463
  networkKey,
2463
2464
  token
2464
- } = _ref45;
2465
+ } = _ref43;
2465
2466
  const cb = (0, _subscriptions.createSubscription)(id, port);
2466
2467
  const convertData = data => {
2467
2468
  return {
@@ -2484,7 +2485,8 @@ class KoniExtension {
2484
2485
  const {
2485
2486
  params,
2486
2487
  recipientAddress,
2487
- senderAddress
2488
+ senderAddress,
2489
+ signerSubstrateProxyAddress
2488
2490
  } = inputData;
2489
2491
  const isSendingSelf = (0, _transfer2.isRecipientSelf)(senderAddress, recipientAddress);
2490
2492
 
@@ -2505,18 +2507,19 @@ class KoniExtension {
2505
2507
  isSendingSelf
2506
2508
  },
2507
2509
  extrinsicType: _KoniTypes.ExtrinsicType.SEND_NFT,
2508
- chainType: _KoniTypes.ChainType.SUBSTRATE
2510
+ chainType: _KoniTypes.ChainType.SUBSTRATE,
2511
+ signerSubstrateProxyAddress
2509
2512
  });
2510
2513
  return {
2511
2514
  ...rs,
2512
2515
  isSendingSelf
2513
2516
  };
2514
2517
  }
2515
- async enableChains(_ref46) {
2518
+ async enableChains(_ref44) {
2516
2519
  let {
2517
2520
  chainSlugs,
2518
2521
  enableTokens
2519
- } = _ref46;
2522
+ } = _ref44;
2520
2523
  try {
2521
2524
  await Promise.all(chainSlugs.map(chainSlug => this.enableChain({
2522
2525
  chainSlug,
@@ -2660,30 +2663,30 @@ class KoniExtension {
2660
2663
 
2661
2664
  // Parse transaction
2662
2665
 
2663
- parseSubstrateTransaction(_ref47) {
2666
+ parseSubstrateTransaction(_ref45) {
2664
2667
  let {
2665
2668
  data,
2666
2669
  networkKey
2667
- } = _ref47;
2670
+ } = _ref45;
2668
2671
  const apiProps = this.#koniState.getSubstrateApi(networkKey);
2669
2672
  const apiPromise = apiProps.api;
2670
2673
  return (0, _parseTransaction.parseSubstrateTransaction)(data, apiPromise);
2671
2674
  }
2672
- async parseEVMRLP(_ref48) {
2675
+ async parseEVMRLP(_ref46) {
2673
2676
  let {
2674
2677
  data
2675
- } = _ref48;
2678
+ } = _ref46;
2676
2679
  return await (0, _parseTransaction2.parseEvmRlp)(data, this.#koniState.getChainInfoMap(), this.#koniState.getEvmApiMap());
2677
2680
  }
2678
2681
 
2679
2682
  // Sign
2680
2683
 
2681
- qrSignSubstrate(_ref49) {
2684
+ qrSignSubstrate(_ref47) {
2682
2685
  let {
2683
2686
  address,
2684
2687
  data,
2685
2688
  networkKey
2686
- } = _ref49;
2689
+ } = _ref47;
2687
2690
  const pair = _uiKeyring.keyring.getPair(address);
2688
2691
  (0, _util.assert)(pair, (0, _i18next.t)('bg.koni.handler.Extension.unableToFindAccount'));
2689
2692
  if (pair.isLocked) {
@@ -2700,13 +2703,13 @@ class KoniExtension {
2700
2703
  signature: signed
2701
2704
  };
2702
2705
  }
2703
- async qrSignEVM(_ref50) {
2706
+ async qrSignEVM(_ref48) {
2704
2707
  let {
2705
2708
  address,
2706
2709
  chainId,
2707
2710
  message,
2708
2711
  type
2709
- } = _ref50;
2712
+ } = _ref48;
2710
2713
  let signed;
2711
2714
  const network = this.getNetworkJsonByChainId(chainId);
2712
2715
  if (!network) {
@@ -2790,11 +2793,11 @@ class KoniExtension {
2790
2793
  });
2791
2794
  return this.#koniState.getNominatorMetadata();
2792
2795
  }
2793
- async getBondingOptions(_ref51) {
2796
+ async getBondingOptions(_ref49) {
2794
2797
  let {
2795
2798
  chain,
2796
2799
  type
2797
- } = _ref51;
2800
+ } = _ref49;
2798
2801
  const apiProps = this.#koniState.getSubstrateApi(chain);
2799
2802
  const chainInfo = this.#koniState.getChainInfo(chain);
2800
2803
  const chainStakingMetadata = await this.#koniState.getStakingMetadataByChain(chain, type);
@@ -2984,12 +2987,12 @@ class KoniExtension {
2984
2987
  }
2985
2988
 
2986
2989
  // EVM Transaction
2987
- async parseContractInput(_ref52) {
2990
+ async parseContractInput(_ref50) {
2988
2991
  let {
2989
2992
  chainId,
2990
2993
  contract,
2991
2994
  data
2992
- } = _ref52;
2995
+ } = _ref50;
2993
2996
  const network = this.getNetworkJsonByChainId(chainId);
2994
2997
  return await (0, _parseTransaction2.parseContractInput)(data, contract, network);
2995
2998
  }
@@ -3089,10 +3092,10 @@ class KoniExtension {
3089
3092
 
3090
3093
  // Unlock wallet
3091
3094
 
3092
- keyringUnlock(_ref53) {
3095
+ keyringUnlock(_ref51) {
3093
3096
  let {
3094
3097
  password
3095
- } = _ref53;
3098
+ } = _ref51;
3096
3099
  try {
3097
3100
  _uiKeyring.keyring.unlockKeyring(password);
3098
3101
  // this.#koniState.initMantaPay(password)
@@ -3123,11 +3126,11 @@ class KoniExtension {
3123
3126
 
3124
3127
  // Export mnemonic
3125
3128
 
3126
- keyringExportMnemonic(_ref54) {
3129
+ keyringExportMnemonic(_ref52) {
3127
3130
  let {
3128
3131
  address,
3129
3132
  password
3130
- } = _ref54;
3133
+ } = _ref52;
3131
3134
  const pair = _uiKeyring.keyring.getPair(address);
3132
3135
  const result = pair.exportMnemonic(password);
3133
3136
  return {
@@ -3137,10 +3140,10 @@ class KoniExtension {
3137
3140
 
3138
3141
  // Reset wallet
3139
3142
 
3140
- async resetWallet(_ref55) {
3143
+ async resetWallet(_ref53) {
3141
3144
  let {
3142
3145
  resetAll
3143
- } = _ref55;
3146
+ } = _ref53;
3144
3147
  try {
3145
3148
  await this.#koniState.resetWallet(resetAll);
3146
3149
  return {
@@ -3156,10 +3159,10 @@ class KoniExtension {
3156
3159
  }
3157
3160
 
3158
3161
  // Signing substrate request
3159
- async signingApprovePasswordV2(_ref56) {
3162
+ async signingApprovePasswordV2(_ref54) {
3160
3163
  let {
3161
3164
  id
3162
- } = _ref56;
3165
+ } = _ref54;
3163
3166
  const queued = this.#koniState.getSignRequest(id);
3164
3167
  (0, _util.assert)(queued, (0, _i18next.t)('bg.koni.handler.Extension.unableToProceed'));
3165
3168
  const {
@@ -3188,12 +3191,12 @@ class KoniExtension {
3188
3191
  let registry = new _types6.TypeRegistry();
3189
3192
  if (isJsonPayload(payload)) {
3190
3193
  const [, chainInfo] = this.#koniState.findNetworkKeyByGenesisHash(payload.genesisHash);
3191
- const registries = await Promise.all([(0, _utils11.setupApiRegistry)(chainInfo, this.#koniState), (0, _utils11.setupDatabaseRegistry)(chainInfo, payload, this.#koniState), (0, _utils11.setupDappRegistry)(payload, this.#koniState)]);
3194
+ const registries = await Promise.all([(0, _utils1.setupApiRegistry)(chainInfo, this.#koniState), (0, _utils1.setupDatabaseRegistry)(chainInfo, payload, this.#koniState), (0, _utils1.setupDappRegistry)(payload, this.#koniState)]);
3192
3195
  const validRegistries = registries.filter(item => !!(item !== null && item !== void 0 && item.registry));
3193
3196
  if (validRegistries.length === 0) {
3194
3197
  registry.setSignedExtensions(payload.signedExtensions);
3195
3198
  } else {
3196
- registry = (0, _utils11.getSuitableRegistry)(validRegistries, payload);
3199
+ registry = (0, _utils1.getSuitableRegistry)(validRegistries, payload);
3197
3200
  }
3198
3201
  }
3199
3202
  const result = request.sign(registry, pair);
@@ -3318,10 +3321,10 @@ class KoniExtension {
3318
3321
  getSupportedSmartContractTypes() {
3319
3322
  return this.#koniState.getSupportedSmartContractTypes();
3320
3323
  }
3321
- getTransaction(_ref57) {
3324
+ getTransaction(_ref55) {
3322
3325
  let {
3323
3326
  id
3324
- } = _ref57;
3327
+ } = _ref55;
3325
3328
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3326
3329
  const {
3327
3330
  transaction,
@@ -3332,8 +3335,8 @@ class KoniExtension {
3332
3335
  async subscribeTransactions(id, port) {
3333
3336
  const cb = (0, _subscriptions.createSubscription)(id, port);
3334
3337
  function convertRs(rs, processMap) {
3335
- return Object.fromEntries(Object.entries(rs).map(_ref58 => {
3336
- let [key, value] = _ref58;
3338
+ return Object.fromEntries(Object.entries(rs).map(_ref56 => {
3339
+ let [key, value] = _ref56;
3337
3340
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3338
3341
  const {
3339
3342
  additionalValidator,
@@ -3359,11 +3362,11 @@ class KoniExtension {
3359
3362
  const subscription = (0, _rxjs.combineLatest)({
3360
3363
  transactions: transactionsObservable,
3361
3364
  processMap: processTransactionObservable
3362
- }).subscribe(_ref59 => {
3365
+ }).subscribe(_ref57 => {
3363
3366
  let {
3364
3367
  processMap,
3365
3368
  transactions
3366
- } = _ref59;
3369
+ } = _ref57;
3367
3370
  cb(convertRs(transactions, processMap));
3368
3371
  });
3369
3372
  port.onDisconnect.addListener(() => {
@@ -3384,10 +3387,10 @@ class KoniExtension {
3384
3387
  });
3385
3388
  return notificationSubject.value;
3386
3389
  }
3387
- async reloadCron(_ref60) {
3390
+ async reloadCron(_ref58) {
3388
3391
  let {
3389
3392
  data
3390
- } = _ref60;
3393
+ } = _ref58;
3391
3394
  if (data === 'nft') {
3392
3395
  return await this.#koniState.reloadNft();
3393
3396
  } else if (data === 'staking') {
@@ -3430,10 +3433,10 @@ class KoniExtension {
3430
3433
  }
3431
3434
 
3432
3435
  // Phishing detect
3433
- async passPhishingPage(_ref61) {
3436
+ async passPhishingPage(_ref59) {
3434
3437
  let {
3435
3438
  url
3436
- } = _ref61;
3439
+ } = _ref59;
3437
3440
  return await this.#koniState.approvePassPhishingPage(url);
3438
3441
  }
3439
3442
 
@@ -3454,10 +3457,10 @@ class KoniExtension {
3454
3457
  /// Wallet connect
3455
3458
 
3456
3459
  // Connect
3457
- async connectWalletConnect(_ref62) {
3460
+ async connectWalletConnect(_ref60) {
3458
3461
  let {
3459
3462
  uri
3460
- } = _ref62;
3463
+ } = _ref60;
3461
3464
  await this.#koniState.walletConnectService.connect(uri);
3462
3465
  return true;
3463
3466
  }
@@ -3470,11 +3473,11 @@ class KoniExtension {
3470
3473
  });
3471
3474
  return this.#koniState.requestService.allConnectWCRequests;
3472
3475
  }
3473
- async approveWalletConnectSession(_ref63) {
3476
+ async approveWalletConnectSession(_ref61) {
3474
3477
  let {
3475
3478
  accounts: selectedAccounts,
3476
3479
  id
3477
- } = _ref63;
3480
+ } = _ref61;
3478
3481
  const request = this.#koniState.requestService.getConnectWCRequest(id);
3479
3482
  if ((0, _helpers2.isProposalExpired)(request.request.params)) {
3480
3483
  throw new Error('The proposal has been expired');
@@ -3486,22 +3489,22 @@ class KoniExtension {
3486
3489
  const availableNamespaces = {};
3487
3490
  const namespaces = {};
3488
3491
  const chainInfoMap = this.#koniState.getChainInfoMap();
3489
- Object.entries(requiredNamespaces).forEach(_ref64 => {
3490
- let [key, namespace] = _ref64;
3492
+ Object.entries(requiredNamespaces).forEach(_ref62 => {
3493
+ let [key, namespace] = _ref62;
3491
3494
  if ((0, _helpers2.isSupportWalletConnectNamespace)(key)) {
3492
3495
  if (namespace.chains) {
3493
3496
  const unSupportChains = namespace.chains.filter(chain => !(0, _helpers2.isSupportWalletConnectChain)(chain, chainInfoMap));
3494
3497
  if (unSupportChains.length) {
3495
- throw new Error((0, _utils10.getSdkError)('UNSUPPORTED_CHAINS').message + ' ' + unSupportChains.toString());
3498
+ throw new Error((0, _utils0.getSdkError)('UNSUPPORTED_CHAINS').message + ' ' + unSupportChains.toString());
3496
3499
  }
3497
3500
  availableNamespaces[key] = namespace;
3498
3501
  }
3499
3502
  } else {
3500
- throw new Error((0, _utils10.getSdkError)('UNSUPPORTED_NAMESPACE_KEY').message + ' ' + key);
3503
+ throw new Error((0, _utils0.getSdkError)('UNSUPPORTED_NAMESPACE_KEY').message + ' ' + key);
3501
3504
  }
3502
3505
  });
3503
- Object.entries(optionalNamespaces).forEach(_ref65 => {
3504
- let [key, namespace] = _ref65;
3506
+ Object.entries(optionalNamespaces).forEach(_ref63 => {
3507
+ let [key, namespace] = _ref63;
3505
3508
  if ((0, _helpers2.isSupportWalletConnectNamespace)(key)) {
3506
3509
  if (namespace.chains) {
3507
3510
  const supportChains = namespace.chains.filter(chain => (0, _helpers2.isSupportWalletConnectChain)(chain, chainInfoMap)) || [];
@@ -3525,8 +3528,8 @@ class KoniExtension {
3525
3528
  }
3526
3529
  }
3527
3530
  });
3528
- Object.entries(availableNamespaces).forEach(_ref66 => {
3529
- let [key, namespace] = _ref66;
3531
+ Object.entries(availableNamespaces).forEach(_ref64 => {
3532
+ let [key, namespace] = _ref64;
3530
3533
  if (namespace.chains) {
3531
3534
  const accounts = selectedAccounts.filter(address => {
3532
3535
  const [_namespace] = address.split(':');
@@ -3550,10 +3553,10 @@ class KoniExtension {
3550
3553
  request.resolve();
3551
3554
  return true;
3552
3555
  }
3553
- async rejectWalletConnectSession(_ref67) {
3556
+ async rejectWalletConnectSession(_ref65) {
3554
3557
  let {
3555
3558
  id
3556
- } = _ref67;
3559
+ } = _ref65;
3557
3560
  const request = this.#koniState.requestService.getConnectWCRequest(id);
3558
3561
  const wcId = request.request.id;
3559
3562
  if ((0, _helpers2.isProposalExpired)(request.request.params)) {
@@ -3575,10 +3578,10 @@ class KoniExtension {
3575
3578
  });
3576
3579
  return this.#koniState.walletConnectService.sessions;
3577
3580
  }
3578
- async disconnectWalletConnectSession(_ref68) {
3581
+ async disconnectWalletConnectSession(_ref66) {
3579
3582
  let {
3580
3583
  topic
3581
- } = _ref68;
3584
+ } = _ref66;
3582
3585
  await this.#koniState.walletConnectService.disconnect(topic);
3583
3586
  return true;
3584
3587
  }
@@ -3591,18 +3594,18 @@ class KoniExtension {
3591
3594
  });
3592
3595
  return this.#koniState.requestService.allNotSupportWCRequests;
3593
3596
  }
3594
- approveWalletConnectNotSupport(_ref69) {
3597
+ approveWalletConnectNotSupport(_ref67) {
3595
3598
  let {
3596
3599
  id
3597
- } = _ref69;
3600
+ } = _ref67;
3598
3601
  const request = this.#koniState.requestService.getNotSupportWCRequest(id);
3599
3602
  request.resolve();
3600
3603
  return true;
3601
3604
  }
3602
- rejectWalletConnectNotSupport(_ref70) {
3605
+ rejectWalletConnectNotSupport(_ref68) {
3603
3606
  let {
3604
3607
  id
3605
- } = _ref70;
3608
+ } = _ref68;
3606
3609
  const request = this.#koniState.requestService.getNotSupportWCRequest(id);
3607
3610
  request.reject(new Error('USER_REJECTED'));
3608
3611
  return true;
@@ -3610,11 +3613,11 @@ class KoniExtension {
3610
3613
 
3611
3614
  /// Manta
3612
3615
 
3613
- async enableMantaPay(_ref71) {
3616
+ async enableMantaPay(_ref69) {
3614
3617
  let {
3615
3618
  address,
3616
3619
  password
3617
- } = _ref71;
3620
+ } = _ref69;
3618
3621
  // always takes the current account
3619
3622
  function timeout() {
3620
3623
  return new Promise(resolve => setTimeout(resolve, 1500));
@@ -3681,21 +3684,21 @@ class KoniExtension {
3681
3684
  const unsubSyncProgress = await ((_this$koniState$chain7 = this.#koniState.chainService) === null || _this$koniState$chain7 === void 0 ? void 0 : (_this$koniState$chain8 = _this$koniState$chain7.mantaPay) === null || _this$koniState$chain8 === void 0 ? void 0 : _this$koniState$chain8.subscribeSyncProgress());
3682
3685
  console.debug('Start initial sync for MantaPay');
3683
3686
  this.#koniState.initialSyncMantaPay(address).then(() => {
3684
- var _this$koniState$chain9, _this$koniState$chain10;
3687
+ var _this$koniState$chain9, _this$koniState$chain0;
3685
3688
  console.debug('Finished initial sync for MantaPay');
3686
3689
  this.#skipAutoLock = false;
3687
3690
  unsubSyncProgress && unsubSyncProgress();
3688
3691
  // make sure the sync state is set, just in case it gets unsubscribed
3689
- (_this$koniState$chain9 = this.#koniState.chainService) === null || _this$koniState$chain9 === void 0 ? void 0 : (_this$koniState$chain10 = _this$koniState$chain9.mantaPay) === null || _this$koniState$chain10 === void 0 ? void 0 : _this$koniState$chain10.setSyncState({
3692
+ (_this$koniState$chain9 = this.#koniState.chainService) === null || _this$koniState$chain9 === void 0 ? void 0 : (_this$koniState$chain0 = _this$koniState$chain9.mantaPay) === null || _this$koniState$chain0 === void 0 ? void 0 : _this$koniState$chain0.setSyncState({
3690
3693
  progress: 100,
3691
3694
  isSyncing: false
3692
3695
  });
3693
3696
  }).catch(e => {
3694
- var _this$koniState$chain11, _this$koniState$chain12;
3697
+ var _this$koniState$chain1, _this$koniState$chain10;
3695
3698
  console.error('Error syncing MantaPay', e);
3696
3699
  this.#skipAutoLock = false;
3697
3700
  unsubSyncProgress && unsubSyncProgress();
3698
- (_this$koniState$chain11 = this.#koniState.chainService) === null || _this$koniState$chain11 === void 0 ? void 0 : (_this$koniState$chain12 = _this$koniState$chain11.mantaPay) === null || _this$koniState$chain12 === void 0 ? void 0 : _this$koniState$chain12.setSyncState({
3701
+ (_this$koniState$chain1 = this.#koniState.chainService) === null || _this$koniState$chain1 === void 0 ? void 0 : (_this$koniState$chain10 = _this$koniState$chain1.mantaPay) === null || _this$koniState$chain10 === void 0 ? void 0 : _this$koniState$chain10.setSyncState({
3699
3702
  progress: 0,
3700
3703
  isSyncing: false
3701
3704
  });
@@ -3704,11 +3707,11 @@ class KoniExtension {
3704
3707
  async disableMantaPay(address) {
3705
3708
  return this.#koniState.disableMantaPay(address);
3706
3709
  }
3707
- async isTonBounceableAddress(_ref72) {
3710
+ async isTonBounceableAddress(_ref70) {
3708
3711
  let {
3709
3712
  address,
3710
3713
  chain
3711
- } = _ref72;
3714
+ } = _ref70;
3712
3715
  try {
3713
3716
  const tonApi = this.#koniState.getTonApi(chain);
3714
3717
  const state = await tonApi.getAccountState(address);
@@ -3734,7 +3737,7 @@ class KoniExtension {
3734
3737
  return this.#koniState.getMantaPayConfig('calamari');
3735
3738
  }
3736
3739
  subscribeMantaPaySyncState(id, port) {
3737
- var _this$koniState$subsc, _this$koniState$chain13, _this$koniState$chain14;
3740
+ var _this$koniState$subsc, _this$koniState$chain11, _this$koniState$chain12;
3738
3741
  const cb = (0, _subscriptions.createSubscription)(id, port);
3739
3742
  const syncingStateSubscription = (_this$koniState$subsc = this.#koniState.subscribeMantaPaySyncState()) === null || _this$koniState$subsc === void 0 ? void 0 : _this$koniState$subsc.subscribe({
3740
3743
  next: rs => {
@@ -3745,7 +3748,7 @@ class KoniExtension {
3745
3748
  port.onDisconnect.addListener(() => {
3746
3749
  this.cancelSubscription(id);
3747
3750
  });
3748
- return ((_this$koniState$chain13 = this.#koniState.chainService) === null || _this$koniState$chain13 === void 0 ? void 0 : (_this$koniState$chain14 = _this$koniState$chain13.mantaPay) === null || _this$koniState$chain14 === void 0 ? void 0 : _this$koniState$chain14.getSyncState()) || {
3751
+ return ((_this$koniState$chain11 = this.#koniState.chainService) === null || _this$koniState$chain11 === void 0 ? void 0 : (_this$koniState$chain12 = _this$koniState$chain11.mantaPay) === null || _this$koniState$chain12 === void 0 ? void 0 : _this$koniState$chain12.getSyncState()) || {
3749
3752
  isSyncing: false,
3750
3753
  progress: 0,
3751
3754
  needManualSync: false
@@ -3754,10 +3757,10 @@ class KoniExtension {
3754
3757
 
3755
3758
  /* Metadata */
3756
3759
 
3757
- async findRawMetadata(_ref73) {
3760
+ async findRawMetadata(_ref71) {
3758
3761
  let {
3759
3762
  genesisHash
3760
- } = _ref73;
3763
+ } = _ref71;
3761
3764
  const {
3762
3765
  metadata,
3763
3766
  specVersion,
@@ -3771,20 +3774,20 @@ class KoniExtension {
3771
3774
  userExtensions
3772
3775
  };
3773
3776
  }
3774
- async calculateMetadataHash(_ref74) {
3777
+ async calculateMetadataHash(_ref72) {
3775
3778
  let {
3776
3779
  chain
3777
- } = _ref74;
3780
+ } = _ref72;
3778
3781
  const hash = await this.#koniState.calculateMetadataHash(chain);
3779
3782
  return {
3780
3783
  metadataHash: hash || ''
3781
3784
  };
3782
3785
  }
3783
- async shortenMetadata(_ref75) {
3786
+ async shortenMetadata(_ref73) {
3784
3787
  let {
3785
3788
  chain,
3786
3789
  txBlob
3787
- } = _ref75;
3790
+ } = _ref73;
3788
3791
  const shorten = await this.#koniState.shortenMetadata(chain, txBlob);
3789
3792
  return {
3790
3793
  txMetadata: shorten || ''
@@ -3838,7 +3841,8 @@ class KoniExtension {
3838
3841
  isPassConfirmation,
3839
3842
  onSend,
3840
3843
  path,
3841
- processId
3844
+ processId,
3845
+ signerSubstrateProxyAddress
3842
3846
  } = inputData;
3843
3847
  const {
3844
3848
  address
@@ -3969,6 +3973,7 @@ class KoniExtension {
3969
3973
  // change this depends on step
3970
3974
  chainType,
3971
3975
  resolveOnDone: !isLastStep,
3976
+ signerSubstrateProxyAddress,
3972
3977
  transferNativeAmount,
3973
3978
  balanceType: balanceTypeForPool,
3974
3979
  skipFeeValidation: isMintingStep && isPoolSupportAlternativeFee,
@@ -3981,6 +3986,7 @@ class KoniExtension {
3981
3986
  async handleYieldLeave(params) {
3982
3987
  const {
3983
3988
  address,
3989
+ signerSubstrateProxyAddress,
3984
3990
  slug
3985
3991
  } = params;
3986
3992
  const leaveValidation = await this.#koniState.earningService.validateYieldLeave(params);
@@ -3996,6 +4002,7 @@ class KoniExtension {
3996
4002
  data: params,
3997
4003
  // TODO
3998
4004
  extrinsicType,
4005
+ signerSubstrateProxyAddress,
3999
4006
  chainType: (handler === null || handler === void 0 ? void 0 : handler.transactionChainType) || _KoniTypes.ChainType.SUBSTRATE
4000
4007
  });
4001
4008
  }
@@ -4072,6 +4079,7 @@ class KoniExtension {
4072
4079
  async yieldSubmitWithdrawal(params) {
4073
4080
  const {
4074
4081
  address,
4082
+ signerSubstrateProxyAddress,
4075
4083
  slug
4076
4084
  } = params;
4077
4085
  const poolHandler = this.#koniState.earningService.getPoolHandler(slug);
@@ -4085,6 +4093,7 @@ class KoniExtension {
4085
4093
  transaction: extrinsic,
4086
4094
  data: params,
4087
4095
  extrinsicType: _KoniTypes.ExtrinsicType.STAKING_WITHDRAW,
4096
+ signerSubstrateProxyAddress,
4088
4097
  chainType: (poolHandler === null || poolHandler === void 0 ? void 0 : poolHandler.transactionChainType) || _KoniTypes.ChainType.SUBSTRATE
4089
4098
  });
4090
4099
  }
@@ -4092,6 +4101,7 @@ class KoniExtension {
4092
4101
  const {
4093
4102
  address,
4094
4103
  selectedUnstaking,
4104
+ signerSubstrateProxyAddress,
4095
4105
  slug
4096
4106
  } = params;
4097
4107
  const poolHandler = this.#koniState.earningService.getPoolHandler(slug);
@@ -4106,12 +4116,14 @@ class KoniExtension {
4106
4116
  transaction: extrinsic,
4107
4117
  data: params,
4108
4118
  extrinsicType: _KoniTypes.ExtrinsicType.STAKING_CANCEL_UNSTAKE,
4119
+ signerSubstrateProxyAddress,
4109
4120
  chainType: (poolHandler === null || poolHandler === void 0 ? void 0 : poolHandler.transactionChainType) || _KoniTypes.ChainType.SUBSTRATE
4110
4121
  });
4111
4122
  }
4112
4123
  async yieldSubmitClaimReward(params) {
4113
4124
  const {
4114
4125
  address,
4126
+ signerSubstrateProxyAddress,
4115
4127
  slug
4116
4128
  } = params;
4117
4129
  const poolHandler = this.#koniState.earningService.getPoolHandler(slug);
@@ -4124,6 +4136,7 @@ class KoniExtension {
4124
4136
  chain: poolHandler.chain,
4125
4137
  transaction: extrinsic,
4126
4138
  data: params,
4139
+ signerSubstrateProxyAddress,
4127
4140
  extrinsicType: _KoniTypes.ExtrinsicType.STAKING_CLAIM_REWARD,
4128
4141
  chainType: (poolHandler === null || poolHandler === void 0 ? void 0 : poolHandler.transactionChainType) || _KoniTypes.ChainType.SUBSTRATE
4129
4142
  });
@@ -4142,6 +4155,7 @@ class KoniExtension {
4142
4155
  async handleYieldChangeValidator(params) {
4143
4156
  const {
4144
4157
  address,
4158
+ signerSubstrateProxyAddress,
4145
4159
  slug
4146
4160
  } = params;
4147
4161
  const poolHandler = this.#koniState.earningService.getPoolHandler(slug);
@@ -4154,6 +4168,7 @@ class KoniExtension {
4154
4168
  chain: poolHandler.chain,
4155
4169
  transaction: extrinsic,
4156
4170
  data: params,
4171
+ signerSubstrateProxyAddress,
4157
4172
  extrinsicType: _KoniTypes.ExtrinsicType.CHANGE_EARNING_VALIDATOR,
4158
4173
  chainType: _KoniTypes.ChainType.SUBSTRATE
4159
4174
  });
@@ -4161,18 +4176,18 @@ class KoniExtension {
4161
4176
 
4162
4177
  /* Campaign */
4163
4178
 
4164
- unlockDotCheckCanMint(_ref76) {
4179
+ unlockDotCheckCanMint(_ref74) {
4165
4180
  let {
4166
4181
  address,
4167
4182
  network,
4168
4183
  slug
4169
- } = _ref76;
4184
+ } = _ref74;
4170
4185
  return this.#koniState.mintCampaignService.unlockDotCampaign.canMint(address, slug, network);
4171
4186
  }
4172
- unlockDotSubscribeMintedData(id, port, _ref77) {
4187
+ unlockDotSubscribeMintedData(id, port, _ref75) {
4173
4188
  let {
4174
4189
  transactionId
4175
- } = _ref77;
4190
+ } = _ref75;
4176
4191
  const cb = (0, _subscriptions.createSubscription)(id, port);
4177
4192
  const subscription = this.#koniState.mintCampaignService.unlockDotCampaign.subscribeMintedNft(transactionId, cb);
4178
4193
  this.createUnsubscriptionHandle(id, subscription.unsubscribe);
@@ -4204,10 +4219,10 @@ class KoniExtension {
4204
4219
  });
4205
4220
  return filterBanner(await this.#koniState.campaignService.getProcessingCampaign());
4206
4221
  }
4207
- async completeCampaignBanner(_ref78) {
4222
+ async completeCampaignBanner(_ref76) {
4208
4223
  let {
4209
4224
  slug
4210
- } = _ref78;
4225
+ } = _ref76;
4211
4226
  const campaign = await this.#koniState.dbService.getCampaign(slug);
4212
4227
  if (campaign) {
4213
4228
  await this.#koniState.dbService.upsertCampaign({
@@ -4742,8 +4757,8 @@ class KoniExtension {
4742
4757
  resolve();
4743
4758
  }
4744
4759
  };
4745
- this.#koniState.balanceService.subscribeTransferableBalance(address, waitXcmData.chain, waitXcmData.token, waitXcmData.nextTxType, onRs).then(_ref79 => {
4746
- let [_unsub, rs] = _ref79;
4760
+ this.#koniState.balanceService.subscribeTransferableBalance(address, waitXcmData.chain, waitXcmData.token, waitXcmData.nextTxType, onRs).then(_ref77 => {
4761
+ let [_unsub, rs] = _ref77;
4747
4762
  unsub = _unsub;
4748
4763
  onRs(rs);
4749
4764
  }).catch(console.error);
@@ -4840,6 +4855,48 @@ class KoniExtension {
4840
4855
  pingSession(request) {
4841
4856
  return this.#koniState.keyringService.context.pingSession(request);
4842
4857
  }
4858
+ getSubstrateProxyAccountGroup(request) {
4859
+ return this.#koniState.substrateProxyAccountService.getSubstrateProxyAccountGroup(request);
4860
+ }
4861
+ async handleAddSubstrateProxyAccount(params) {
4862
+ const {
4863
+ address,
4864
+ chain,
4865
+ signerSubstrateProxyAddress
4866
+ } = params;
4867
+ const validationErrors = await this.#koniState.substrateProxyAccountService.validateAddSubstrateProxyAccount(params, signerSubstrateProxyAddress);
4868
+ if (validationErrors.length > 0) {
4869
+ return this.#koniState.transactionService.generateBeforeHandleResponseErrors(validationErrors);
4870
+ }
4871
+ const extrinsic = await this.#koniState.substrateProxyAccountService.addSubstrateProxyAccounts(params);
4872
+ return await this.#koniState.transactionService.handleTransaction({
4873
+ address,
4874
+ chain,
4875
+ transaction: extrinsic,
4876
+ data: params,
4877
+ extrinsicType: _KoniTypes.ExtrinsicType.ADD_SUBSTRATE_PROXY_ACCOUNT,
4878
+ chainType: _KoniTypes.ChainType.SUBSTRATE,
4879
+ signerSubstrateProxyAddress
4880
+ });
4881
+ }
4882
+ async handleRemoveSubstrateProxyAccount(params) {
4883
+ const {
4884
+ address,
4885
+ chain,
4886
+ signerSubstrateProxyAddress
4887
+ } = params;
4888
+ const extrinsic = await this.#koniState.substrateProxyAccountService.removeSubstrateProxyAccounts(params);
4889
+ return await this.#koniState.transactionService.handleTransaction({
4890
+ address,
4891
+ chain,
4892
+ transaction: extrinsic,
4893
+ data: params,
4894
+ extrinsicType: _KoniTypes.ExtrinsicType.REMOVE_SUBSTRATE_PROXY_ACCOUNT,
4895
+ chainType: _KoniTypes.ChainType.SUBSTRATE,
4896
+ signerSubstrateProxyAddress
4897
+ });
4898
+ }
4899
+
4843
4900
  /* Migrate Unified Account */
4844
4901
 
4845
4902
  /* Open Gov */
@@ -4852,7 +4909,8 @@ class KoniExtension {
4852
4909
  transaction: extrinsic,
4853
4910
  data: request,
4854
4911
  extrinsicType: _KoniTypes.ExtrinsicType.GOV_VOTE,
4855
- chainType: _KoniTypes.ChainType.SUBSTRATE
4912
+ chainType: _KoniTypes.ChainType.SUBSTRATE,
4913
+ signerSubstrateProxyAddress: request.signerSubstrateProxyAddress
4856
4914
  });
4857
4915
  }
4858
4916
  async handleRemoveVote(request) {
@@ -4863,7 +4921,8 @@ class KoniExtension {
4863
4921
  transaction: extrinsic,
4864
4922
  data: request,
4865
4923
  extrinsicType: _KoniTypes.ExtrinsicType.GOV_UNVOTE,
4866
- chainType: _KoniTypes.ChainType.SUBSTRATE
4924
+ chainType: _KoniTypes.ChainType.SUBSTRATE,
4925
+ signerSubstrateProxyAddress: request.signerSubstrateProxyAddress
4867
4926
  });
4868
4927
  }
4869
4928
  async handleUnlockVote(request) {
@@ -4874,7 +4933,8 @@ class KoniExtension {
4874
4933
  transaction: extrinsic,
4875
4934
  data: request,
4876
4935
  extrinsicType: _KoniTypes.ExtrinsicType.GOV_UNLOCK_VOTE,
4877
- chainType: _KoniTypes.ChainType.SUBSTRATE
4936
+ chainType: _KoniTypes.ChainType.SUBSTRATE,
4937
+ signerSubstrateProxyAddress: request.signerSubstrateProxyAddress
4878
4938
  });
4879
4939
  }
4880
4940
  async subscribeGovLockedInfo(id, port) {
@@ -5562,6 +5622,15 @@ class KoniExtension {
5562
5622
  return this.handleUnlockVote(request);
5563
5623
  case 'pri(openGov.subscribeGovLockedInfo)':
5564
5624
  return this.subscribeGovLockedInfo(id, port);
5625
+
5626
+ // Proxy
5627
+ case 'pri(substrateProxyAccount.getGroupInfo)':
5628
+ return this.getSubstrateProxyAccountGroup(request);
5629
+ case 'pri(substrateProxyAccount.add)':
5630
+ return this.handleAddSubstrateProxyAccount(request);
5631
+ case 'pri(substrateProxyAccount.remove)':
5632
+ return this.handleRemoveSubstrateProxyAccount(request);
5633
+
5565
5634
  // Default
5566
5635
  default:
5567
5636
  throw new Error(`Unable to handle message of type ${type}`);