@subwallet/extension-base 1.3.76-0 → 1.3.77-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 (42) hide show
  1. package/background/KoniTypes.d.ts +2 -1
  2. package/cjs/core/substrate/xcm-parser.js +8 -11
  3. package/cjs/koni/background/handlers/Extension.js +258 -63
  4. package/cjs/koni/background/handlers/Tabs.js +2 -3
  5. package/cjs/packageInfo.js +1 -1
  6. package/cjs/services/chain-service/utils/patch.js +1 -1
  7. package/cjs/services/earning-service/constants/chains.js +4 -1
  8. package/cjs/services/earning-service/handlers/liquid-staking/stella-swap.js +8 -5
  9. package/cjs/services/earning-service/service.js +18 -2
  10. package/cjs/services/multisig-service/index.js +1 -1
  11. package/cjs/services/request-service/handler/SubstrateRequestHandler.js +12 -0
  12. package/cjs/services/request-service/index.js +3 -0
  13. package/cjs/services/setting-service/constants.js +2 -1
  14. package/cjs/services/storage-service/db-stores/InappNotification.js +1 -1
  15. package/cjs/services/transaction-service/index.js +9 -0
  16. package/core/substrate/xcm-parser.d.ts +1 -0
  17. package/core/substrate/xcm-parser.js +7 -11
  18. package/koni/background/handlers/Extension.d.ts +19 -0
  19. package/koni/background/handlers/Extension.js +197 -5
  20. package/koni/background/handlers/Tabs.js +2 -3
  21. package/package.json +6 -6
  22. package/packageInfo.js +1 -1
  23. package/services/chain-service/utils/patch.d.ts +1 -1
  24. package/services/chain-service/utils/patch.js +1 -1
  25. package/services/earning-service/constants/chains.d.ts +1 -0
  26. package/services/earning-service/constants/chains.js +2 -0
  27. package/services/earning-service/handlers/liquid-staking/stella-swap.d.ts +1 -0
  28. package/services/earning-service/handlers/liquid-staking/stella-swap.js +6 -4
  29. package/services/earning-service/service.js +20 -4
  30. package/services/inapp-notification-service/interfaces.d.ts +1 -0
  31. package/services/multisig-service/index.js +1 -1
  32. package/services/request-service/handler/SubstrateRequestHandler.d.ts +1 -0
  33. package/services/request-service/handler/SubstrateRequestHandler.js +12 -0
  34. package/services/request-service/index.d.ts +1 -0
  35. package/services/request-service/index.js +3 -0
  36. package/services/request-service/types.d.ts +1 -0
  37. package/services/setting-service/constants.js +2 -1
  38. package/services/storage-service/db-stores/InappNotification.js +1 -1
  39. package/services/transaction-service/index.d.ts +1 -1
  40. package/services/transaction-service/index.js +9 -0
  41. package/types/balance/transfer.d.ts +2 -0
  42. package/types/multisig/index.d.ts +12 -0
@@ -20,7 +20,7 @@ import { WalletConnectNotSupportRequest, WalletConnectSessionRequest } from '@su
20
20
  import { AccountChainType, AccountJson, AccountsWithCurrentAddress, AddressJson, BalanceJson, BalanceType, BaseRequestSign, BuyServiceInfo, BuyTokenInfo, CommonOptimalTransferPath, CurrentAccountInfo, EarningRewardHistoryItem, EarningRewardJson, EarningStatus, HandleSubstrateProxyWrappedTxResponse, HandleYieldStepParams, InternalRequestSign, LeavePoolAdditionalData, NominationPoolInfo, OptimalYieldPath, OptimalYieldPathParams, RequestAccountBatchExportV2, RequestAccountCreateSuriV2, RequestAccountNameValidate, RequestAccountProxyEdit, RequestAccountProxyForget, RequestBatchJsonGetAccountInfo, RequestBatchRestoreV2, RequestBounceableValidate, RequestChangeAllowOneSign, RequestChangeBittensorRootClaimType, RequestChangeTonWalletContractVersion, RequestCheckCrossChainTransfer, RequestCheckPublicAndSecretKey, RequestCheckTransfer, RequestCrossChainTransfer, RequestDeriveCreateMultiple, RequestDeriveCreateV3, RequestDeriveValidateV2, RequestEarlyValidateYield, RequestEarningImpact, RequestExportAccountProxyMnemonic, RequestGetAllTonWalletContractVersion, RequestGetAmountForPair, RequestGetDeriveAccounts, RequestGetDeriveSuggestion, RequestGetTokensCanPayFee, RequestGetYieldPoolTargets, RequestInputAccountSubscribe, RequestJsonGetAccountInfo, RequestJsonRestoreV2, RequestMetadataHash, RequestMnemonicCreateV2, RequestMnemonicValidateV2, RequestPrivateKeyValidateV2, RequestShortenMetadata, RequestStakeCancelWithdrawal, RequestStakeClaimReward, RequestSubmitProcessTransaction, RequestSubscribeProcessById, RequestTransfer, RequestUnlockDotCheckCanMint, RequestUnlockDotSubscribeMintedData, RequestYieldLeave, RequestYieldStepSubmit, RequestYieldWithdrawal, ResponseAccountBatchExportV2, ResponseAccountCreateSuriV2, ResponseAccountNameValidate, ResponseBatchJsonGetAccountInfo, ResponseCheckPublicAndSecretKey, ResponseDeriveValidateV2, ResponseEarlyValidateYield, ResponseExportAccountProxyMnemonic, ResponseGetAllTonWalletContractVersion, ResponseGetDeriveAccounts, ResponseGetDeriveSuggestion, ResponseGetYieldPoolTargets, ResponseInputAccountSubscribe, ResponseJsonGetAccountInfo, ResponseMetadataHash, ResponseMnemonicCreateV2, ResponseMnemonicValidateV2, ResponsePrivateKeyValidateV2, ResponseShortenMetadata, ResponseSubscribeProcessAlive, ResponseSubscribeProcessById, StorageDataInterface, SubmitChangeValidatorStaking, SubmitYieldJoinData, SubmitYieldStepData, SubnetYieldPositionInfo, SwapPair, SwapQuoteResponse, SwapRequest, SwapRequestResult, SwapRequestV2, SwapSubmitParams, SwapTxData, TokenSpendingApprovalParams, UnlockDotTransactionNft, UnstakingStatus, ValidateSwapProcessParams, ValidateYieldProcessParams, YieldPoolInfo, YieldPoolType, YieldPositionInfo } from '@subwallet/extension-base/types';
21
21
  import { RequestSubmitSignPsbtTransfer, RequestSubmitTransfer, RequestSubmitTransferWithId, RequestSubscribeTransfer, ResponseSubscribeTransfer, ResponseSubscribeTransferConfirmation } from '@subwallet/extension-base/types/balance/transfer';
22
22
  import { RequestClaimBridge } from '@subwallet/extension-base/types/bridge';
23
- import { ApprovePendingTxRequest, CancelPendingTxRequest, ExecutePendingTxRequest, InitMultisigTxRequest, InitMultisigTxResponse, RequestGetSignableAccountInfos, ResponseGetSignableAccountInfos } from '@subwallet/extension-base/types/multisig';
23
+ import { ApprovePendingTxRequest, CancelPendingTxRequest, ExecutePendingTxRequest, InitMultisigTxRequest, InitMultisigTxResponse, PrepareMultisigSignRequest, PrepareMultisigSignResponse, RequestGetSignableAccountInfos, ResponseGetSignableAccountInfos } from '@subwallet/extension-base/types/multisig';
24
24
  import { GetNotificationParams, MarkAllReadParams, RequestIsClaimedPolygonBridge, RequestSwitchStatusParams } from '@subwallet/extension-base/types/notification';
25
25
  import { InjectedAccount, InjectedAccountWithMeta, MetadataDefBase } from '@subwallet/extension-inject/types';
26
26
  import { BitcoinAddressType, KeyringPair$Meta } from '@subwallet/keyring/types';
@@ -2147,6 +2147,7 @@ export interface KoniRequestSignatures {
2147
2147
  'pri(multisig.cancelPendingTx)': [CancelPendingTxRequest, SWTransactionResponse];
2148
2148
  'pri(multisig.getSignableAccountInfos)': [RequestGetSignableAccountInfos, ResponseGetSignableAccountInfos];
2149
2149
  'pri(multisig.initMultisigTx)': [InitMultisigTxRequest, SWTransactionResponse];
2150
+ 'pri(multisig.prepareSignRequest)': [PrepareMultisigSignRequest, PrepareMultisigSignResponse];
2150
2151
  'pri(substrateProxyAccount.getGroupInfo)': [RequestGetSubstrateProxyAccountGroup, SubstrateProxyAccountGroup];
2151
2152
  'pri(substrateProxyAccount.add)': [RequestAddSubstrateProxyAccount, SWTransactionResponse];
2152
2153
  'pri(substrateProxyAccount.remove)': [RequestRemoveSubstrateProxyAccount, SWTransactionResponse];
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports._adaptX1Interior = _adaptX1Interior;
7
7
  exports._getXcmUnstableWarning = _getXcmUnstableWarning;
8
8
  exports._isAcrossBridgeXcm = _isAcrossBridgeXcm;
9
+ exports._isAssetHubBridgeXcm = _isAssetHubBridgeXcm;
9
10
  exports._isAvailBridgeXcm = _isAvailBridgeXcm;
10
11
  exports._isMythosFromHydrationToMythos = _isMythosFromHydrationToMythos;
11
12
  exports._isPolygonBridgeXcm = _isPolygonBridgeXcm;
@@ -23,17 +24,10 @@ var _utils = require("@subwallet/extension-base/services/chain-service/utils");
23
24
  // SPDX-License-Identifier: Apache-2.0
24
25
 
25
26
  function _isXcmTransferUnstable(originChainInfo, destChainInfo, assetSlug) {
26
- return !_isXcmWithinSameConsensus(originChainInfo, destChainInfo) || _isMythosFromHydrationToMythos(originChainInfo, destChainInfo, assetSlug) || _isPolygonBridgeXcm(originChainInfo, destChainInfo) || _isPosBridgeXcm(originChainInfo, destChainInfo);
27
+ return !_isXcmWithinSameConsensus(originChainInfo, destChainInfo) && !_isAssetHubBridgeXcm || _isMythosFromHydrationToMythos(originChainInfo, destChainInfo, assetSlug) || _isPolygonBridgeXcm(originChainInfo, destChainInfo) || _isPosBridgeXcm(originChainInfo, destChainInfo);
27
28
  }
28
- function getAssetHubBridgeUnstableWarning(originChainInfo) {
29
- switch (originChainInfo.slug) {
30
- case _chainList.COMMON_CHAIN_SLUGS.POLKADOT_ASSET_HUB:
31
- return 'Cross-chain transfer of this token is not recommended as it is in beta and incurs a transaction fee of 2 DOT. Continue at your own risk';
32
- case _chainList.COMMON_CHAIN_SLUGS.KUSAMA_ASSET_HUB:
33
- return 'Cross-chain transfer of this token is not recommended as it is in beta and incurs a transaction fee of 0.4 KSM. Continue at your own risk';
34
- default:
35
- return 'Cross-chain transfer of this token is not recommended as it is in beta and incurs a large transaction fee. Continue at your own risk';
36
- }
29
+ function getDefaultUnstableWarning() {
30
+ return 'Cross-chain transfer of this token is not recommended as it is in beta and incurs a large transaction fee. Continue at your own risk';
37
31
  }
38
32
  function getSnowBridgeUnstableWarning(originChainInfo) {
39
33
  switch (originChainInfo.slug) {
@@ -77,7 +71,7 @@ function _getXcmUnstableWarning(originChainInfo, destChainInfo, assetSlug) {
77
71
  } else if (_isMythosFromHydrationToMythos(originChainInfo, destChainInfo, assetSlug)) {
78
72
  return getMythosFromHydrationToMythosWarning();
79
73
  } else {
80
- return getAssetHubBridgeUnstableWarning(originChainInfo);
74
+ return getDefaultUnstableWarning();
81
75
  }
82
76
  }
83
77
  function _isXcmWithinSameConsensus(originChainInfo, destChainInfo) {
@@ -103,6 +97,9 @@ function _isPosBridgeXcm(originChainInfo, destChainInfo) {
103
97
  function _isAcrossBridgeXcm(originChainInfo, destChainInfo) {
104
98
  return (0, _acrossBridge._isAcrossChainBridge)(originChainInfo.slug, destChainInfo.slug);
105
99
  }
100
+ function _isAssetHubBridgeXcm(originChainInfo, destChainInfo) {
101
+ return originChainInfo.slug === 'statemint' && destChainInfo.slug === 'statemine' || originChainInfo.slug === 'statemine' && destChainInfo.slug === 'statemint';
102
+ }
106
103
  // ---------------------------------------------------------------------------------------------------------------------
107
104
 
108
105
  function _adaptX1Interior(_assetIdentifier, version) {