@subwallet/extension-base 1.3.22-0 → 1.3.23-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 (193) hide show
  1. package/background/KoniTypes.d.ts +75 -2
  2. package/background/KoniTypes.js +2 -0
  3. package/cjs/background/KoniTypes.js +2 -0
  4. package/cjs/constants/environment.js +4 -2
  5. package/cjs/constants/signing.js +6 -2
  6. package/cjs/core/logic-validation/recipientAddress.js +9 -1
  7. package/cjs/core/logic-validation/transfer.js +35 -29
  8. package/cjs/core/types.js +1 -0
  9. package/cjs/core/utils.js +12 -1
  10. package/cjs/defaults.js +1 -1
  11. package/cjs/koni/api/dotsama/crowdloan.js +1 -1
  12. package/cjs/koni/api/nft/index.js +9 -16
  13. package/cjs/koni/api/staking/index.js +3 -4
  14. package/cjs/koni/background/handlers/Extension.js +234 -96
  15. package/cjs/koni/background/handlers/State.js +15 -0
  16. package/cjs/packageInfo.js +1 -1
  17. package/cjs/services/balance-service/helpers/subscribe/cardano/consts.js +11 -0
  18. package/cjs/services/balance-service/helpers/subscribe/cardano/index.js +63 -0
  19. package/cjs/services/balance-service/helpers/subscribe/cardano/types.js +1 -0
  20. package/cjs/services/balance-service/helpers/subscribe/cardano/utils.js +74 -0
  21. package/cjs/services/balance-service/helpers/subscribe/index.js +21 -7
  22. package/cjs/services/balance-service/helpers/subscribe/ton/utils.js +2 -2
  23. package/cjs/services/balance-service/index.js +4 -2
  24. package/cjs/services/balance-service/transfer/cardano-transfer.js +122 -0
  25. package/cjs/services/balance-service/transfer/token.js +4 -4
  26. package/cjs/services/chain-service/handler/CardanoApi.js +176 -0
  27. package/cjs/services/chain-service/handler/CardanoChainHandler.js +83 -0
  28. package/cjs/services/chain-service/handler/TonApi.js +2 -5
  29. package/cjs/services/chain-service/index.js +29 -7
  30. package/cjs/services/chain-service/utils/index.js +40 -11
  31. package/cjs/services/chain-service/utils/patch.js +1 -1
  32. package/cjs/services/earning-service/handlers/liquid-staking/bifrost-manta.js +1 -1
  33. package/cjs/services/earning-service/handlers/liquid-staking/bifrost.js +1 -1
  34. package/cjs/services/earning-service/service.js +6 -12
  35. package/cjs/services/fee-service/service.js +19 -8
  36. package/cjs/services/history-service/index.js +4 -6
  37. package/cjs/services/inapp-notification-service/index.js +12 -4
  38. package/cjs/services/keyring-service/context/account-context.js +17 -2
  39. package/cjs/services/keyring-service/context/handlers/Derive.js +10 -7
  40. package/cjs/services/keyring-service/context/handlers/Migration.js +268 -0
  41. package/cjs/services/keyring-service/context/handlers/Mnemonic.js +2 -2
  42. package/cjs/services/keyring-service/context/handlers/Secret.js +1 -1
  43. package/cjs/services/keyring-service/utils.js +18 -0
  44. package/cjs/services/request-service/handler/CardanoRequestHandler.js +172 -0
  45. package/cjs/services/request-service/handler/EvmRequestHandler.js +1 -1
  46. package/cjs/services/request-service/index.js +20 -2
  47. package/cjs/services/setting-service/constants.js +10 -1
  48. package/cjs/services/storage-service/DatabaseService.js +3 -0
  49. package/cjs/services/storage-service/db-stores/InappNotification.js +6 -0
  50. package/cjs/services/swap-service/handler/asset-hub/handler.js +0 -59
  51. package/cjs/services/swap-service/handler/chainflip-handler.js +33 -281
  52. package/cjs/services/swap-service/handler/hydradx-handler.js +23 -190
  53. package/cjs/services/swap-service/handler/simpleswap-handler.js +1 -222
  54. package/cjs/services/swap-service/handler/uniswap-handler.js +331 -0
  55. package/cjs/services/swap-service/index.js +31 -22
  56. package/cjs/services/swap-service/utils.js +21 -38
  57. package/cjs/services/transaction-service/helpers/index.js +6 -1
  58. package/cjs/services/transaction-service/index.js +278 -21
  59. package/cjs/services/transaction-service/utils.js +5 -1
  60. package/cjs/types/account/info/keyring.js +12 -1
  61. package/cjs/types/fee/cardano.js +1 -0
  62. package/cjs/types/swap/index.js +7 -2
  63. package/cjs/utils/account/analyze.js +2 -1
  64. package/cjs/utils/account/common.js +29 -20
  65. package/cjs/utils/account/derive/info/solo.js +9 -4
  66. package/cjs/utils/account/derive/validate.js +36 -2
  67. package/cjs/utils/account/transform.js +38 -13
  68. package/cjs/utils/fee/transfer.js +40 -7
  69. package/cjs/utils/index.js +2 -2
  70. package/cjs/utils/staticData/index.js +7 -2
  71. package/constants/environment.d.ts +1 -0
  72. package/constants/environment.js +2 -1
  73. package/constants/signing.js +6 -2
  74. package/core/logic-validation/recipientAddress.js +11 -3
  75. package/core/logic-validation/transfer.js +9 -3
  76. package/core/substrate/xcm-parser.d.ts +1 -1
  77. package/core/types.d.ts +1 -0
  78. package/core/types.js +1 -0
  79. package/core/utils.d.ts +1 -0
  80. package/core/utils.js +13 -3
  81. package/defaults.d.ts +1 -1
  82. package/defaults.js +1 -1
  83. package/koni/api/dotsama/crowdloan.js +3 -3
  84. package/koni/api/nft/index.js +10 -16
  85. package/koni/api/nft/story_odyssey_nft/index.d.ts +1 -1
  86. package/koni/api/staking/index.js +4 -5
  87. package/koni/background/handlers/Extension.d.ts +9 -0
  88. package/koni/background/handlers/Extension.js +144 -8
  89. package/koni/background/handlers/State.d.ts +5 -1
  90. package/koni/background/handlers/State.js +16 -1
  91. package/package.json +71 -9
  92. package/packageInfo.js +1 -1
  93. package/services/balance-service/helpers/subscribe/cardano/consts.d.ts +1 -0
  94. package/services/balance-service/helpers/subscribe/cardano/consts.js +4 -0
  95. package/services/balance-service/helpers/subscribe/cardano/index.d.ts +2 -0
  96. package/services/balance-service/helpers/subscribe/cardano/index.js +57 -0
  97. package/services/balance-service/helpers/subscribe/cardano/types.d.ts +34 -0
  98. package/services/balance-service/helpers/subscribe/cardano/types.js +1 -0
  99. package/services/balance-service/helpers/subscribe/cardano/utils.d.ts +15 -0
  100. package/services/balance-service/helpers/subscribe/cardano/utils.js +62 -0
  101. package/services/balance-service/helpers/subscribe/index.d.ts +2 -2
  102. package/services/balance-service/helpers/subscribe/index.js +23 -9
  103. package/services/balance-service/helpers/subscribe/ton/utils.d.ts +1 -1
  104. package/services/balance-service/helpers/subscribe/ton/utils.js +1 -1
  105. package/services/balance-service/index.js +4 -2
  106. package/services/balance-service/transfer/cardano-transfer.d.ts +24 -0
  107. package/services/balance-service/transfer/cardano-transfer.js +114 -0
  108. package/services/balance-service/transfer/token.d.ts +1 -1
  109. package/services/balance-service/transfer/token.js +2 -2
  110. package/services/chain-service/handler/CardanoApi.d.ts +38 -0
  111. package/services/chain-service/handler/CardanoApi.js +167 -0
  112. package/services/chain-service/handler/CardanoChainHandler.d.ts +17 -0
  113. package/services/chain-service/handler/CardanoChainHandler.js +75 -0
  114. package/services/chain-service/handler/TonApi.js +3 -6
  115. package/services/chain-service/handler/types.d.ts +1 -0
  116. package/services/chain-service/index.d.ts +3 -1
  117. package/services/chain-service/index.js +29 -7
  118. package/services/chain-service/types.d.ts +9 -1
  119. package/services/chain-service/utils/index.d.ts +4 -0
  120. package/services/chain-service/utils/index.js +32 -11
  121. package/services/chain-service/utils/patch.js +1 -1
  122. package/services/earning-service/handlers/liquid-staking/bifrost-manta.js +1 -1
  123. package/services/earning-service/handlers/liquid-staking/bifrost.js +1 -1
  124. package/services/earning-service/service.js +8 -14
  125. package/services/fee-service/service.js +19 -8
  126. package/services/history-service/index.js +6 -8
  127. package/services/inapp-notification-service/index.d.ts +3 -4
  128. package/services/inapp-notification-service/index.js +14 -6
  129. package/services/keyring-service/context/account-context.d.ts +6 -2
  130. package/services/keyring-service/context/account-context.js +17 -2
  131. package/services/keyring-service/context/handlers/Derive.d.ts +1 -1
  132. package/services/keyring-service/context/handlers/Derive.js +10 -8
  133. package/services/keyring-service/context/handlers/Migration.d.ts +17 -0
  134. package/services/keyring-service/context/handlers/Migration.js +258 -0
  135. package/services/keyring-service/context/handlers/Mnemonic.js +2 -2
  136. package/services/keyring-service/context/handlers/Secret.js +2 -2
  137. package/services/keyring-service/utils.d.ts +2 -0
  138. package/services/keyring-service/utils.js +11 -0
  139. package/services/request-service/handler/CardanoRequestHandler.d.ts +16 -0
  140. package/services/request-service/handler/CardanoRequestHandler.js +163 -0
  141. package/services/request-service/handler/EvmRequestHandler.js +1 -1
  142. package/services/request-service/index.d.ts +6 -3
  143. package/services/request-service/index.js +19 -5
  144. package/services/setting-service/constants.d.ts +3 -0
  145. package/services/setting-service/constants.js +6 -0
  146. package/services/storage-service/DatabaseService.d.ts +1 -0
  147. package/services/storage-service/DatabaseService.js +3 -0
  148. package/services/storage-service/db-stores/InappNotification.d.ts +1 -0
  149. package/services/storage-service/db-stores/InappNotification.js +6 -0
  150. package/services/swap-service/handler/asset-hub/handler.d.ts +1 -4
  151. package/services/swap-service/handler/asset-hub/handler.js +2 -61
  152. package/services/swap-service/handler/base-handler.d.ts +1 -4
  153. package/services/swap-service/handler/chainflip-handler.d.ts +2 -9
  154. package/services/swap-service/handler/chainflip-handler.js +31 -280
  155. package/services/swap-service/handler/hydradx-handler.d.ts +1 -6
  156. package/services/swap-service/handler/hydradx-handler.js +13 -180
  157. package/services/swap-service/handler/simpleswap-handler.d.ts +1 -4
  158. package/services/swap-service/handler/simpleswap-handler.js +5 -226
  159. package/services/swap-service/handler/uniswap-handler.d.ts +41 -0
  160. package/services/swap-service/handler/uniswap-handler.js +323 -0
  161. package/services/swap-service/index.js +30 -22
  162. package/services/swap-service/utils.d.ts +1 -5
  163. package/services/swap-service/utils.js +7 -21
  164. package/services/transaction-service/helpers/index.d.ts +2 -0
  165. package/services/transaction-service/helpers/index.js +4 -0
  166. package/services/transaction-service/index.d.ts +8 -2
  167. package/services/transaction-service/index.js +263 -10
  168. package/services/transaction-service/types.d.ts +7 -0
  169. package/services/transaction-service/utils.js +7 -2
  170. package/types/account/info/keyring.d.ts +4 -1
  171. package/types/account/info/keyring.js +9 -0
  172. package/types/account/info/proxy.d.ts +2 -0
  173. package/types/balance/index.d.ts +4 -1
  174. package/types/fee/base.d.ts +1 -1
  175. package/types/fee/cardano.d.ts +18 -0
  176. package/types/fee/cardano.js +1 -0
  177. package/types/fee/subscription.d.ts +4 -3
  178. package/types/swap/index.d.ts +11 -3
  179. package/types/swap/index.js +7 -2
  180. package/utils/account/analyze.js +2 -1
  181. package/utils/account/common.d.ts +11 -6
  182. package/utils/account/common.js +28 -19
  183. package/utils/account/derive/info/solo.js +10 -5
  184. package/utils/account/derive/validate.d.ts +1 -0
  185. package/utils/account/derive/validate.js +34 -1
  186. package/utils/account/transform.d.ts +2 -1
  187. package/utils/account/transform.js +37 -13
  188. package/utils/fee/transfer.d.ts +2 -1
  189. package/utils/fee/transfer.js +44 -11
  190. package/utils/index.js +4 -4
  191. package/utils/staticData/index.d.ts +4 -1
  192. package/utils/staticData/index.js +5 -1
  193. package/utils/staticData/oldChainPrefix.json +1 -0
@@ -35,6 +35,6 @@ export declare class OdysseyNftApi extends BaseNftApi {
35
35
  private processNftItem;
36
36
  handleNfts(params: HandleNftParams): Promise<void>;
37
37
  fetchNftsWithDetail(address: string): Promise<OdysseyToken[] | null>;
38
- fetchNfts(params: HandleNftParams): Promise<0 | 1>;
38
+ fetchNfts(params: HandleNftParams): Promise<1 | 0>;
39
39
  }
40
40
  export {};
@@ -1,19 +1,18 @@
1
1
  // Copyright 2019-2022 @subwallet/extension-koni authors & contributors
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
+ import { ChainType } from '@subwallet/extension-base/background/KoniTypes';
4
5
  import { getAmplitudeStakingOnChain, getAstarStakingOnChain, getParaStakingOnChain } from '@subwallet/extension-base/koni/api/staking/paraChain';
5
6
  import { getNominationPoolReward, getRelayPoolingOnChain, getRelayStakingOnChain } from '@subwallet/extension-base/koni/api/staking/relayChain';
6
7
  import { getAllSubsquidStaking } from '@subwallet/extension-base/koni/api/staking/subsquidStaking';
7
8
  import { _PURE_EVM_CHAINS } from '@subwallet/extension-base/services/chain-service/constants';
8
9
  import { _isChainEvmCompatible, _isChainSupportSubstrateStaking, _isSubstrateRelayChain } from '@subwallet/extension-base/services/chain-service/utils';
9
10
  import { _STAKING_CHAIN_GROUP } from '@subwallet/extension-base/services/earning-service/constants';
10
- import { categoryAddresses } from '@subwallet/extension-base/utils';
11
+ import { getAddressesByChainType } from '@subwallet/extension-base/utils';
11
12
  export function stakingOnChainApi(addresses, substrateApiMap, chainInfoMap, stakingCallback, nominatorStateCallback) {
12
13
  const filteredApiMap = [];
13
- const {
14
- evm: evmAddresses,
15
- substrate: substrateAddresses
16
- } = categoryAddresses(addresses);
14
+ const evmAddresses = getAddressesByChainType(addresses, [ChainType.EVM]);
15
+ const substrateAddresses = getAddressesByChainType(addresses, [ChainType.SUBSTRATE]);
17
16
  Object.entries(chainInfoMap).forEach(([networkKey, chainInfo]) => {
18
17
  if (_PURE_EVM_CHAINS.indexOf(networkKey) < 0 && _isChainSupportSubstrateStaking(chainInfo)) {
19
18
  filteredApiMap.push({
@@ -77,6 +77,9 @@ export default class KoniExtension {
77
77
  private subscribeSettings;
78
78
  private setEnableChainPatrol;
79
79
  private saveNotificationSetup;
80
+ private saveMigrationAcknowledgedStatus;
81
+ private saveUnifiedAccountMigrationInProgress;
82
+ private pingUnifiedAccountMigrationDone;
80
83
  private setShowZeroBalance;
81
84
  private setLanguage;
82
85
  private setShowBalance;
@@ -149,8 +152,10 @@ export default class KoniExtension {
149
152
  private resolveQrTransfer;
150
153
  private subscribeConfirmations;
151
154
  private subscribeConfirmationsTon;
155
+ private subscribeConfirmationsCardano;
152
156
  private completeConfirmation;
153
157
  private completeConfirmationTon;
158
+ private completeConfirmationCardano;
154
159
  private getNetworkJsonByChainId;
155
160
  private parseSubstrateTransaction;
156
161
  private parseEVMRLP;
@@ -250,6 +255,7 @@ export default class KoniExtension {
250
255
  private subscribeBuyTokens;
251
256
  private subscribeBuyServices;
252
257
  private subscribeSwapPairs;
258
+ private generateOptimalProcess;
253
259
  private handleSwapRequest;
254
260
  private getLatestSwapQuote;
255
261
  private validateSwapProcess;
@@ -268,5 +274,8 @@ export default class KoniExtension {
268
274
  private createPassConfirmationParams;
269
275
  private subscribeProcessById;
270
276
  private subscribeProcessAlive;
277
+ private migrateUnifiedAndFetchEligibleSoloAccounts;
278
+ private migrateSoloAccount;
279
+ private pingSession;
271
280
  handle<TMessageType extends MessageTypes>(id: string, type: TMessageType, request: RequestTypes[TMessageType], port: chrome.runtime.Port): Promise<ResponseType<TMessageType>>;
272
281
  }
@@ -22,9 +22,11 @@ import { getBondingExtrinsic, getCancelWithdrawalExtrinsic, getClaimRewardExtrin
22
22
  import { getTuringCancelCompoundingExtrinsic, getTuringCompoundExtrinsic } from '@subwallet/extension-base/koni/api/staking/bonding/paraChain';
23
23
  import { getPoolingBondingExtrinsic, getPoolingUnbondingExtrinsic, validatePoolBondingCondition, validateRelayUnbondingCondition } from '@subwallet/extension-base/koni/api/staking/bonding/relayChain';
24
24
  import { YIELD_EXTRINSIC_TYPES } from '@subwallet/extension-base/koni/api/yield/helper/utils';
25
+ import { DEFAULT_CARDANO_TTL_OFFSET } from '@subwallet/extension-base/services/balance-service/helpers/subscribe/cardano/consts';
25
26
  import { isBounceableAddress } from '@subwallet/extension-base/services/balance-service/helpers/subscribe/ton/utils';
27
+ import { createCardanoTransaction } from '@subwallet/extension-base/services/balance-service/transfer/cardano-transfer';
26
28
  import { getERC20TransactionObject, getERC721Transaction, getEVMTransactionObject, getPSP34TransferExtrinsic } from '@subwallet/extension-base/services/balance-service/transfer/smart-contract';
27
- import { createTransferExtrinsic } from '@subwallet/extension-base/services/balance-service/transfer/token';
29
+ import { createSubstrateExtrinsic } from '@subwallet/extension-base/services/balance-service/transfer/token';
28
30
  import { createTonTransaction } from '@subwallet/extension-base/services/balance-service/transfer/ton-transfer';
29
31
  import { createAvailBridgeExtrinsicFromAvail, createAvailBridgeTxFromEth, createPolygonBridgeExtrinsic, createSnowBridgeExtrinsic, createXcmExtrinsic } from '@subwallet/extension-base/services/balance-service/transfer/xcm';
30
32
  import { getClaimTxOnAvail, getClaimTxOnEthereum, isAvailChainBridge } from '@subwallet/extension-base/services/balance-service/transfer/xcm/availBridge';
@@ -32,7 +34,7 @@ import { _isPolygonChainBridge, getClaimPolygonBridge, isClaimedPolygonBridge }
32
34
  import { _isPosChainBridge, getClaimPosBridge } from '@subwallet/extension-base/services/balance-service/transfer/xcm/posBridge';
33
35
  import { _DEFAULT_MANTA_ZK_CHAIN, _MANTA_ZK_CHAIN_GROUP, _ZK_ASSET_PREFIX, SUFFICIENT_CHAIN } from '@subwallet/extension-base/services/chain-service/constants';
34
36
  import { _ChainConnectionStatus } from '@subwallet/extension-base/services/chain-service/types';
35
- import { _getAssetDecimals, _getAssetSymbol, _getChainNativeTokenBasicInfo, _getContractAddressOfToken, _getEvmChainId, _getTokenOnChainAssetId, _getXcmAssetMultilocation, _isAssetSmartContractNft, _isBridgedToken, _isChainEvmCompatible, _isChainSubstrateCompatible, _isCustomAsset, _isLocalToken, _isMantaZkAsset, _isNativeToken, _isPureEvmChain, _isTokenEvmSmartContract, _isTokenTransferredByEvm, _isTokenTransferredByTon } from '@subwallet/extension-base/services/chain-service/utils';
37
+ import { _getAssetDecimals, _getAssetSymbol, _getChainNativeTokenBasicInfo, _getContractAddressOfToken, _getEvmChainId, _getTokenOnChainAssetId, _getXcmAssetMultilocation, _isAssetSmartContractNft, _isBridgedToken, _isChainEvmCompatible, _isChainSubstrateCompatible, _isCustomAsset, _isLocalToken, _isMantaZkAsset, _isNativeToken, _isPureEvmChain, _isTokenEvmSmartContract, _isTokenTransferredByCardano, _isTokenTransferredByEvm, _isTokenTransferredByTon } from '@subwallet/extension-base/services/chain-service/utils';
36
38
  import { calculateToAmountByReservePool } from '@subwallet/extension-base/services/fee-service/utils';
37
39
  import { EXTENSION_REQUEST_URL } from '@subwallet/extension-base/services/request-service/constants';
38
40
  import { DEFAULT_AUTO_LOCK_TIME } from '@subwallet/extension-base/services/setting-service/constants';
@@ -40,11 +42,11 @@ import { checkLiquidityForPool, estimateTokensForPool, getReserveForPool } from
40
42
  import { isProposalExpired, isSupportWalletConnectChain, isSupportWalletConnectNamespace } from '@subwallet/extension-base/services/wallet-connect-service/helpers';
41
43
  import { SWStorage } from '@subwallet/extension-base/storage';
42
44
  import { AccountsStore } from '@subwallet/extension-base/stores';
43
- import { AccountSignMode, BasicTxErrorType, BasicTxWarningCode, CommonStepType, EarningProcessType, ProcessType, StakingTxErrorType, StepStatus, SwapFeeType, SwapStepType, YieldPoolType, YieldStepType } from '@subwallet/extension-base/types';
45
+ import { AccountSignMode, BasicTxErrorType, BasicTxWarningCode, CommonStepType, EarningProcessType, ProcessType, StakingTxErrorType, StepStatus, SwapFeeType, SwapProviderId, SwapStepType, YieldPoolType, YieldStepType } from '@subwallet/extension-base/types';
44
46
  import { _analyzeAddress, calculateMaxTransferable, combineAllAccountProxy, createTransactionFromRLP, detectTransferTxType, getAccountSignMode, isSameAddress, MODULE_SUPPORT, reformatAddress, signatureToHex, transformAccounts, transformAddresses, uniqueStringArray } from '@subwallet/extension-base/utils';
45
47
  import { parseContractInput, parseEvmRlp } from '@subwallet/extension-base/utils/eth/parseTransaction';
46
48
  import { getId } from '@subwallet/extension-base/utils/getId';
47
- import { getKeypairTypeByAddress, isAddress, isSubstrateAddress, isTonAddress } from '@subwallet/keyring';
49
+ import { getKeypairTypeByAddress, isAddress, isCardanoAddress, isSubstrateAddress, isTonAddress } from '@subwallet/keyring';
48
50
  import { EthereumKeypairTypes, SubstrateKeypairTypes, TonKeypairTypes } from '@subwallet/keyring/types';
49
51
  import { keyring } from '@subwallet/ui-keyring';
50
52
  import { getSdkError } from '@walletconnect/utils';
@@ -781,6 +783,22 @@ export default class KoniExtension {
781
783
  this.#koniState.updateSetting('notificationSetup', request);
782
784
  return true;
783
785
  }
786
+ saveMigrationAcknowledgedStatus({
787
+ isAcknowledgedUnifiedAccountMigration
788
+ }) {
789
+ this.#koniState.updateSetting('isAcknowledgedUnifiedAccountMigration', isAcknowledgedUnifiedAccountMigration);
790
+ return true;
791
+ }
792
+ saveUnifiedAccountMigrationInProgress({
793
+ isUnifiedAccountMigrationInProgress
794
+ }) {
795
+ this.#koniState.updateSetting('isUnifiedAccountMigrationInProgress', isUnifiedAccountMigrationInProgress);
796
+ return true;
797
+ }
798
+ pingUnifiedAccountMigrationDone() {
799
+ this.#koniState.updateSetting('isUnifiedAccountMigrationInProgress', false);
800
+ return true;
801
+ }
784
802
  setShowZeroBalance({
785
803
  show
786
804
  }) {
@@ -1193,9 +1211,23 @@ export default class KoniExtension {
1193
1211
  // currently not used
1194
1212
  tonApi
1195
1213
  });
1214
+ } else if (isCardanoAddress(from) && isCardanoAddress(to) && _isTokenTransferredByCardano(transferTokenInfo)) {
1215
+ chainType = ChainType.CARDANO;
1216
+ const cardanoApi = this.#koniState.getCardanoApi(chain);
1217
+ [transaction, transferAmount.value] = await createCardanoTransaction({
1218
+ tokenInfo: transferTokenInfo,
1219
+ from,
1220
+ to,
1221
+ networkKey: chain,
1222
+ value: value || '0',
1223
+ cardanoTtlOffset: DEFAULT_CARDANO_TTL_OFFSET,
1224
+ transferAll: !!transferAll,
1225
+ cardanoApi,
1226
+ nativeTokenInfo
1227
+ });
1196
1228
  } else {
1197
1229
  const substrateApi = this.#koniState.getSubstrateApi(chain);
1198
- [transaction, transferAmount.value] = await createTransferExtrinsic({
1230
+ [transaction, transferAmount.value] = await createSubstrateExtrinsic({
1199
1231
  transferAll: !!transferAll,
1200
1232
  value: value || '0',
1201
1233
  from: from,
@@ -1695,6 +1727,7 @@ export default class KoniExtension {
1695
1727
  }
1696
1728
  const _request = {
1697
1729
  address: address,
1730
+ cardanoApi: this.#koniState.chainService.getCardanoApi(chain),
1698
1731
  destChain,
1699
1732
  destToken,
1700
1733
  evmApi: this.#koniState.chainService.getEvmApi(chain),
@@ -1892,12 +1925,24 @@ export default class KoniExtension {
1892
1925
  });
1893
1926
  return this.#koniState.getConfirmationsQueueSubjectTon().getValue();
1894
1927
  }
1928
+ subscribeConfirmationsCardano(id, port) {
1929
+ const cb = createSubscription(id, port);
1930
+ const subscription = this.#koniState.getConfirmationsQueueSubjectCardano().subscribe(cb);
1931
+ this.createUnsubscriptionHandle(id, subscription.unsubscribe);
1932
+ port.onDisconnect.addListener(() => {
1933
+ this.cancelSubscription(id);
1934
+ });
1935
+ return this.#koniState.getConfirmationsQueueSubjectCardano().getValue();
1936
+ }
1895
1937
  async completeConfirmation(request) {
1896
1938
  return await this.#koniState.completeConfirmation(request);
1897
1939
  }
1898
1940
  async completeConfirmationTon(request) {
1899
1941
  return await this.#koniState.completeConfirmationTon(request);
1900
1942
  }
1943
+ async completeConfirmationCardano(request) {
1944
+ return await this.#koniState.completeConfirmationCardano(request);
1945
+ }
1901
1946
 
1902
1947
  /// Sign Qr
1903
1948
 
@@ -3109,6 +3154,17 @@ export default class KoniExtension {
3109
3154
  }
3110
3155
  return this.#koniState.transactionService.generateBeforeHandleResponseErrors(yieldValidation);
3111
3156
  }
3157
+ let submitData;
3158
+ try {
3159
+ submitData = await this.#koniState.earningService.handleYieldJoin(inputData);
3160
+ } catch (e) {
3161
+ if (step) {
3162
+ this.#koniState.transactionService.updateProcessStepStatus(step, {
3163
+ status: StepStatus.FAILED
3164
+ });
3165
+ }
3166
+ throw e;
3167
+ }
3112
3168
 
3113
3169
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3114
3170
  const {
@@ -3118,7 +3174,7 @@ export default class KoniExtension {
3118
3174
  transferNativeAmount,
3119
3175
  txChain,
3120
3176
  txData
3121
- } = await this.#koniState.earningService.handleYieldJoin(inputData);
3177
+ } = submitData;
3122
3178
  const isPoolSupportAlternativeFee = this.#koniState.earningService.isPoolSupportAlternativeFee(inputData.data.slug);
3123
3179
  const poolHandler = this.#koniState.earningService.getPoolHandler(data.slug);
3124
3180
  const isMintingStep = YIELD_EXTRINSIC_TYPES.includes(extrinsicType);
@@ -3527,6 +3583,9 @@ export default class KoniExtension {
3527
3583
  ready = true;
3528
3584
  return this.#koniState.swapService.getSwapPairs();
3529
3585
  }
3586
+ async generateOptimalProcess(request) {
3587
+ return this.#koniState.swapService.generateOptimalProcess(request);
3588
+ }
3530
3589
  async handleSwapRequest(request) {
3531
3590
  return this.#koniState.swapService.handleSwapRequest(request);
3532
3591
  }
@@ -3578,16 +3637,29 @@ export default class KoniExtension {
3578
3637
  }
3579
3638
  return this.#koniState.transactionService.generateBeforeHandleResponseErrors(swapValidations);
3580
3639
  }
3640
+ let submitData;
3641
+ try {
3642
+ submitData = await this.#koniState.swapService.handleSwapProcess(inputData);
3643
+ } catch (e) {
3644
+ if (step) {
3645
+ this.#koniState.transactionService.updateProcessStepStatus(step, {
3646
+ status: StepStatus.FAILED
3647
+ });
3648
+ }
3649
+ throw e;
3650
+ }
3581
3651
 
3582
3652
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3583
3653
  const {
3584
3654
  chainType,
3585
3655
  extrinsic,
3586
3656
  extrinsicType,
3657
+ isPermit,
3587
3658
  transferNativeAmount,
3588
3659
  txChain,
3589
3660
  txData
3590
- } = await this.#koniState.swapService.handleSwapProcess(inputData);
3661
+ } = submitData;
3662
+
3591
3663
  // const chosenFeeToken = process.steps.findIndex((step) => step.type === SwapStepType.SET_FEE_TOKEN) > -1;
3592
3664
  // const allowSkipValidation = [ExtrinsicType.SET_FEE_TOKEN, ExtrinsicType.SWAP].includes(extrinsicType);
3593
3665
 
@@ -3670,6 +3742,24 @@ export default class KoniExtension {
3670
3742
  await this.#koniState.transactionService.updateProcessInfo(processId, combineInfo, step);
3671
3743
  }
3672
3744
  }
3745
+ if (isPermit) {
3746
+ return await this.#koniState.transactionService.handlePermitTransaction({
3747
+ address,
3748
+ chain: txChain,
3749
+ transaction: extrinsic,
3750
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3751
+ data: txData,
3752
+ extrinsicType,
3753
+ // change this depends on step
3754
+ chainType,
3755
+ resolveOnDone: !isLastStep,
3756
+ transferNativeAmount,
3757
+ ...this.createPassConfirmationParams(isPassConfirmation),
3758
+ errorOnTimeOut,
3759
+ eventsHandler,
3760
+ step
3761
+ });
3762
+ }
3673
3763
  return await this.#koniState.transactionService.handleTransaction({
3674
3764
  address,
3675
3765
  chain: txChain,
@@ -3887,7 +3977,8 @@ export default class KoniExtension {
3887
3977
  const onSend = callback
3888
3978
  // eslint-disable-next-line node/no-callback-literal
3889
3979
  ? rs => callback(rs) : undefined;
3890
- if (stepNums > 2 && isLastStep) {
3980
+ const specialCaseForUniswap = data.quote.provider.id === SwapProviderId.UNISWAP && !!data.process.steps.find(step => step.type === SwapStepType.PERMIT);
3981
+ if (stepNums > 2 && isLastStep && !specialCaseForUniswap) {
3891
3982
  const quote = data.quote;
3892
3983
  const latestSwapQuote = await this.getLatestSwapQuote({
3893
3984
  address: data.address,
@@ -4013,6 +4104,32 @@ export default class KoniExtension {
4013
4104
 
4014
4105
  /* Multi process */
4015
4106
 
4107
+ /* Migrate Unified Account */
4108
+ async migrateUnifiedAndFetchEligibleSoloAccounts(request) {
4109
+ const setMigratingMode = () => {
4110
+ this.saveUnifiedAccountMigrationInProgress({
4111
+ isUnifiedAccountMigrationInProgress: true
4112
+ });
4113
+ };
4114
+ return await this.#koniState.keyringService.context.migrateUnifiedAndFetchEligibleSoloAccounts(request, setMigratingMode);
4115
+ }
4116
+ migrateSoloAccount(request) {
4117
+ const proxyIds = request.soloAccounts.map(account => account.proxyId);
4118
+ const response = this.#koniState.keyringService.context.migrateSoloAccount(request);
4119
+ const newProxyId = response.migratedUnifiedAccountId; // get from response to ensure account migration is done.
4120
+ const newName = request.accountName;
4121
+ try {
4122
+ this.#koniState.inappNotificationService.migrateNotificationProxyId(proxyIds, newProxyId, newName);
4123
+ } catch (error) {
4124
+ console.error('Error on migrating notification for unified account migration', error);
4125
+ }
4126
+ return response;
4127
+ }
4128
+ pingSession(request) {
4129
+ return this.#koniState.keyringService.context.pingSession(request);
4130
+ }
4131
+ /* Migrate Unified Account */
4132
+
4016
4133
  // --------------------------------------------------------------
4017
4134
  // eslint-disable-next-line @typescript-eslint/require-await
4018
4135
  async handle(id, type, request, port) {
@@ -4098,6 +4215,12 @@ export default class KoniExtension {
4098
4215
  return this.setEnableChainPatrol(request);
4099
4216
  case 'pri(settings.saveNotificationSetup)':
4100
4217
  return this.saveNotificationSetup(request);
4218
+ case 'pri(settings.saveMigrationAcknowledgedStatus)':
4219
+ return this.saveMigrationAcknowledgedStatus(request);
4220
+ case 'pri(settings.saveUnifiedAccountMigrationInProgress)':
4221
+ return this.saveUnifiedAccountMigrationInProgress(request);
4222
+ case 'pri(settings.pingUnifiedAccountMigrationDone)':
4223
+ return this.pingUnifiedAccountMigrationDone();
4101
4224
  case 'pri(settings.saveShowZeroBalance)':
4102
4225
  return this.setShowZeroBalance(request);
4103
4226
  case 'pri(settings.saveLanguage)':
@@ -4375,10 +4498,14 @@ export default class KoniExtension {
4375
4498
  return this.subscribeConfirmations(id, port);
4376
4499
  case 'pri(confirmationsTon.subscribe)':
4377
4500
  return this.subscribeConfirmationsTon(id, port);
4501
+ case 'pri(confirmationsCardano.subscribe)':
4502
+ return this.subscribeConfirmationsCardano(id, port);
4378
4503
  case 'pri(confirmations.complete)':
4379
4504
  return await this.completeConfirmation(request);
4380
4505
  case 'pri(confirmationsTon.complete)':
4381
4506
  return await this.completeConfirmationTon(request);
4507
+ case 'pri(confirmationsCardano.complete)':
4508
+ return await this.completeConfirmationCardano(request);
4382
4509
 
4383
4510
  /// Stake
4384
4511
  case 'pri(bonding.getBondingOptions)':
@@ -4569,6 +4696,8 @@ export default class KoniExtension {
4569
4696
  /* Swap service */
4570
4697
  case 'pri(swapService.subscribePairs)':
4571
4698
  return this.subscribeSwapPairs(id, port);
4699
+ case 'pri(swapService.generateOptimalProcess)':
4700
+ return this.generateOptimalProcess(request);
4572
4701
  case 'pri(swapService.handleSwapRequest)':
4573
4702
  return this.handleSwapRequest(request);
4574
4703
  case 'pri(swapService.getLatestQuote)':
@@ -4623,6 +4752,13 @@ export default class KoniExtension {
4623
4752
  return this.subscribeProcessAlive(id, port);
4624
4753
  /* Multi process */
4625
4754
 
4755
+ /* Migrate Unified Account */
4756
+ case 'pri(migrate.migrateUnifiedAndFetchEligibleSoloAccounts)':
4757
+ return await this.migrateUnifiedAndFetchEligibleSoloAccounts(request);
4758
+ case 'pri(migrate.migrateSoloAccount)':
4759
+ return this.migrateSoloAccount(request);
4760
+ case 'pri(migrate.pingSession)':
4761
+ return this.pingSession(request);
4626
4762
  // Default
4627
4763
  default:
4628
4764
  throw new Error(`Unable to handle message of type ${type}`);
@@ -1,6 +1,6 @@
1
1
  /// <reference types="chrome" />
2
2
  import { _AssetRef, _AssetType, _ChainAsset, _ChainInfo, _MultiChainAsset } from '@subwallet/chain-list/types';
3
- import { AddTokenRequestExternal, AmountData, ApiMap, AuthRequestV2, ChainStakingMetadata, ConfirmationsQueue, ConfirmationsQueueTon, CrowdloanItem, CrowdloanJson, EvmSendTransactionParams, ExternalRequestPromise, MantaPayConfig, MantaPaySyncState, NftCollection, NftItem, NftJson, NominatorMetadata, RequestAccountExportPrivateKey, RequestConfirmationComplete, RequestConfirmationCompleteTon, RequestCrowdloanContributions, RequestSettingsType, ResponseAccountExportPrivateKey, ServiceInfo, SingleModeJson, StakingItem, StakingJson, StakingRewardItem, StakingRewardJson, StakingType, UiSettings } from '@subwallet/extension-base/background/KoniTypes';
3
+ import { AddTokenRequestExternal, AmountData, ApiMap, AuthRequestV2, ChainStakingMetadata, ConfirmationsQueue, ConfirmationsQueueCardano, ConfirmationsQueueTon, CrowdloanItem, CrowdloanJson, EvmSendTransactionParams, ExternalRequestPromise, MantaPayConfig, MantaPaySyncState, NftCollection, NftItem, NftJson, NominatorMetadata, RequestAccountExportPrivateKey, RequestConfirmationComplete, RequestConfirmationCompleteCardano, RequestConfirmationCompleteTon, RequestCrowdloanContributions, RequestSettingsType, ResponseAccountExportPrivateKey, ServiceInfo, SingleModeJson, StakingItem, StakingJson, StakingRewardItem, StakingRewardJson, StakingType, UiSettings } from '@subwallet/extension-base/background/KoniTypes';
4
4
  import { RequestAuthorizeTab, RequestRpcSend, RequestRpcSubscribe, RequestRpcUnsubscribe, RequestSign, ResponseRpcListProviders, ResponseSigning } from '@subwallet/extension-base/background/types';
5
5
  import { EnvConfig } from '@subwallet/extension-base/constants';
6
6
  import { BalanceService } from '@subwallet/extension-base/services/balance-service';
@@ -192,6 +192,8 @@ export default class KoniState {
192
192
  getEvmApi(networkKey: string): import("../../../services/chain-service/handler/EvmApi").EvmApi;
193
193
  getTonApiMap(): Record<string, import("../../../services/chain-service/handler/TonApi").TonApi>;
194
194
  getTonApi(networkKey: string): import("../../../services/chain-service/handler/TonApi").TonApi;
195
+ getCardanoApiMap(): Record<string, import("../../../services/chain-service/handler/CardanoApi").CardanoApi>;
196
+ getCardanoApi(networkKey: string): import("../../../services/chain-service/handler/CardanoApi").CardanoApi;
195
197
  getApiMap(): ApiMap;
196
198
  refreshSubstrateApi(key: string): boolean;
197
199
  refreshWeb3Api(key: string): void;
@@ -215,8 +217,10 @@ export default class KoniState {
215
217
  evmSendTransaction(id: string, url: string, transactionParams: EvmSendTransactionParams, networkKeyInit?: string, topic?: string): Promise<string | undefined>;
216
218
  getConfirmationsQueueSubject(): BehaviorSubject<ConfirmationsQueue>;
217
219
  getConfirmationsQueueSubjectTon(): BehaviorSubject<ConfirmationsQueueTon>;
220
+ getConfirmationsQueueSubjectCardano(): BehaviorSubject<ConfirmationsQueueCardano>;
218
221
  completeConfirmation(request: RequestConfirmationComplete): Promise<boolean>;
219
222
  completeConfirmationTon(request: RequestConfirmationCompleteTon): Promise<boolean>;
223
+ completeConfirmationCardano(request: RequestConfirmationCompleteCardano): Promise<boolean>;
220
224
  private onMV3Update;
221
225
  private storePreviousVersionData;
222
226
  migrateMV3LocalStorage(data: string): Promise<boolean>;
@@ -5,7 +5,7 @@ import { EvmProviderError } from '@subwallet/extension-base/background/errors/Ev
5
5
  import { withErrorLog } from '@subwallet/extension-base/background/handlers/helpers';
6
6
  import { isSubscriptionRunning, unsubscribe } from '@subwallet/extension-base/background/handlers/subscriptions';
7
7
  import { APIItemState, ChainType, EvmProviderErrorType, ExternalRequestPromiseStatus, ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
8
- import { MANTA_PAY_BALANCE_INTERVAL, REMIND_EXPORT_ACCOUNT } from '@subwallet/extension-base/constants';
8
+ import { BACKEND_API_URL, MANTA_PAY_BALANCE_INTERVAL, REMIND_EXPORT_ACCOUNT } from '@subwallet/extension-base/constants';
9
9
  import { convertErrorFormat, generateValidationProcess, validationAuthMiddleware, validationAuthWCMiddleware, validationConnectMiddleware, validationEvmDataTransactionMiddleware, validationEvmSignMessageMiddleware } from '@subwallet/extension-base/core/logic-validation';
10
10
  import { BalanceService } from '@subwallet/extension-base/services/balance-service';
11
11
  import { ServiceStatus } from '@subwallet/extension-base/services/base/types';
@@ -39,6 +39,7 @@ import { SWStorage } from '@subwallet/extension-base/storage';
39
39
  import { BasicTxErrorType } from '@subwallet/extension-base/types';
40
40
  import { isManifestV3, stripUrl, targetIsWeb } from '@subwallet/extension-base/utils';
41
41
  import { createPromiseHandler } from '@subwallet/extension-base/utils/promise';
42
+ import subwalletApiSdk from '@subwallet/subwallet-api-sdk';
42
43
  import { keyring } from '@subwallet/ui-keyring';
43
44
  import BN from 'bn.js';
44
45
  import { t } from 'i18next';
@@ -83,6 +84,8 @@ export default class KoniState {
83
84
  waitSleeping = null;
84
85
  waitStarting = null;
85
86
  constructor(providers = {}) {
87
+ // Init subwallet api sdk
88
+ subwalletApiSdk.init(BACKEND_API_URL);
86
89
  this.providers = providers;
87
90
  this.eventService = new EventService();
88
91
  this.dbService = new DatabaseService(this.eventService);
@@ -718,6 +721,12 @@ export default class KoniState {
718
721
  getTonApi(networkKey) {
719
722
  return this.chainService.getTonApi(networkKey);
720
723
  }
724
+ getCardanoApiMap() {
725
+ return this.chainService.getCardanoApiMap();
726
+ }
727
+ getCardanoApi(networkKey) {
728
+ return this.chainService.getCardanoApi(networkKey);
729
+ }
721
730
  getApiMap() {
722
731
  return {
723
732
  substrate: this.chainService.getSubstrateApiMap(),
@@ -998,12 +1007,18 @@ export default class KoniState {
998
1007
  getConfirmationsQueueSubjectTon() {
999
1008
  return this.requestService.confirmationsQueueSubjectTon;
1000
1009
  }
1010
+ getConfirmationsQueueSubjectCardano() {
1011
+ return this.requestService.confirmationsQueueSubjectCardano;
1012
+ }
1001
1013
  async completeConfirmation(request) {
1002
1014
  return await this.requestService.completeConfirmation(request);
1003
1015
  }
1004
1016
  async completeConfirmationTon(request) {
1005
1017
  return await this.requestService.completeConfirmationTon(request);
1006
1018
  }
1019
+ async completeConfirmationCardano(request) {
1020
+ return await this.requestService.completeConfirmationCardano(request);
1021
+ }
1007
1022
  async onMV3Update() {
1008
1023
  const migrationStatus = await SWStorage.instance.getItem('mv3_migration');
1009
1024
  if (!migrationStatus || migrationStatus !== 'done') {
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "./cjs/detectPackage.js"
18
18
  ],
19
19
  "type": "module",
20
- "version": "1.3.22-0",
20
+ "version": "1.3.23-0",
21
21
  "main": "./cjs/index.js",
22
22
  "module": "./index.js",
23
23
  "types": "./index.d.ts",
@@ -654,6 +654,26 @@
654
654
  "require": "./cjs/services/balance-service/helpers/subscribe/index.js",
655
655
  "default": "./services/balance-service/helpers/subscribe/index.js"
656
656
  },
657
+ "./services/balance-service/helpers/subscribe/cardano": {
658
+ "types": "./services/balance-service/helpers/subscribe/cardano/index.d.ts",
659
+ "require": "./cjs/services/balance-service/helpers/subscribe/cardano/index.js",
660
+ "default": "./services/balance-service/helpers/subscribe/cardano/index.js"
661
+ },
662
+ "./services/balance-service/helpers/subscribe/cardano/consts": {
663
+ "types": "./services/balance-service/helpers/subscribe/cardano/consts.d.ts",
664
+ "require": "./cjs/services/balance-service/helpers/subscribe/cardano/consts.js",
665
+ "default": "./services/balance-service/helpers/subscribe/cardano/consts.js"
666
+ },
667
+ "./services/balance-service/helpers/subscribe/cardano/types": {
668
+ "types": "./services/balance-service/helpers/subscribe/cardano/types.d.ts",
669
+ "require": "./cjs/services/balance-service/helpers/subscribe/cardano/types.js",
670
+ "default": "./services/balance-service/helpers/subscribe/cardano/types.js"
671
+ },
672
+ "./services/balance-service/helpers/subscribe/cardano/utils": {
673
+ "types": "./services/balance-service/helpers/subscribe/cardano/utils.d.ts",
674
+ "require": "./cjs/services/balance-service/helpers/subscribe/cardano/utils.js",
675
+ "default": "./services/balance-service/helpers/subscribe/cardano/utils.js"
676
+ },
657
677
  "./services/balance-service/helpers/subscribe/evm": {
658
678
  "types": "./services/balance-service/helpers/subscribe/evm.d.ts",
659
679
  "require": "./cjs/services/balance-service/helpers/subscribe/evm.js",
@@ -694,6 +714,11 @@
694
714
  "require": "./cjs/services/balance-service/helpers/subscribe/ton/utils.js",
695
715
  "default": "./services/balance-service/helpers/subscribe/ton/utils.js"
696
716
  },
717
+ "./services/balance-service/transfer/cardano-transfer": {
718
+ "types": "./services/balance-service/transfer/cardano-transfer.d.ts",
719
+ "require": "./cjs/services/balance-service/transfer/cardano-transfer.js",
720
+ "default": "./services/balance-service/transfer/cardano-transfer.js"
721
+ },
697
722
  "./services/balance-service/transfer/smart-contract": {
698
723
  "types": "./services/balance-service/transfer/smart-contract.d.ts",
699
724
  "require": "./cjs/services/balance-service/transfer/smart-contract.js",
@@ -819,6 +844,16 @@
819
844
  "require": "./cjs/services/chain-service/handler/AbstractChainHandler.js",
820
845
  "default": "./services/chain-service/handler/AbstractChainHandler.js"
821
846
  },
847
+ "./services/chain-service/handler/CardanoApi": {
848
+ "types": "./services/chain-service/handler/CardanoApi.d.ts",
849
+ "require": "./cjs/services/chain-service/handler/CardanoApi.js",
850
+ "default": "./services/chain-service/handler/CardanoApi.js"
851
+ },
852
+ "./services/chain-service/handler/CardanoChainHandler": {
853
+ "types": "./services/chain-service/handler/CardanoChainHandler.d.ts",
854
+ "require": "./cjs/services/chain-service/handler/CardanoChainHandler.js",
855
+ "default": "./services/chain-service/handler/CardanoChainHandler.js"
856
+ },
822
857
  "./services/chain-service/handler/EvmApi": {
823
858
  "types": "./services/chain-service/handler/EvmApi.d.ts",
824
859
  "require": "./cjs/services/chain-service/handler/EvmApi.js",
@@ -1221,6 +1256,11 @@
1221
1256
  "require": "./cjs/services/keyring-service/context/handlers/Ledger.js",
1222
1257
  "default": "./services/keyring-service/context/handlers/Ledger.js"
1223
1258
  },
1259
+ "./services/keyring-service/context/handlers/Migration": {
1260
+ "types": "./services/keyring-service/context/handlers/Migration.d.ts",
1261
+ "require": "./cjs/services/keyring-service/context/handlers/Migration.js",
1262
+ "default": "./services/keyring-service/context/handlers/Migration.js"
1263
+ },
1224
1264
  "./services/keyring-service/context/handlers/Mnemonic": {
1225
1265
  "types": "./services/keyring-service/context/handlers/Mnemonic.d.ts",
1226
1266
  "require": "./cjs/services/keyring-service/context/handlers/Mnemonic.js",
@@ -1266,6 +1306,11 @@
1266
1306
  "require": "./cjs/services/keyring-service/context/stores/ModifyPair.js",
1267
1307
  "default": "./services/keyring-service/context/stores/ModifyPair.js"
1268
1308
  },
1309
+ "./services/keyring-service/utils": {
1310
+ "types": "./services/keyring-service/utils.d.ts",
1311
+ "require": "./cjs/services/keyring-service/utils.js",
1312
+ "default": "./services/keyring-service/utils.js"
1313
+ },
1269
1314
  "./services/migration-service": {
1270
1315
  "types": "./services/migration-service/index.d.ts",
1271
1316
  "require": "./cjs/services/migration-service/index.js",
@@ -1541,6 +1586,11 @@
1541
1586
  "require": "./cjs/services/request-service/handler/AuthRequestHandler.js",
1542
1587
  "default": "./services/request-service/handler/AuthRequestHandler.js"
1543
1588
  },
1589
+ "./services/request-service/handler/CardanoRequestHandler": {
1590
+ "types": "./services/request-service/handler/CardanoRequestHandler.d.ts",
1591
+ "require": "./cjs/services/request-service/handler/CardanoRequestHandler.js",
1592
+ "default": "./services/request-service/handler/CardanoRequestHandler.js"
1593
+ },
1544
1594
  "./services/request-service/handler/ConnectWCRequestHandler": {
1545
1595
  "types": "./services/request-service/handler/ConnectWCRequestHandler.d.ts",
1546
1596
  "require": "./cjs/services/request-service/handler/ConnectWCRequestHandler.js",
@@ -1821,6 +1871,11 @@
1821
1871
  "require": "./cjs/services/swap-service/handler/simpleswap-handler.js",
1822
1872
  "default": "./services/swap-service/handler/simpleswap-handler.js"
1823
1873
  },
1874
+ "./services/swap-service/handler/uniswap-handler": {
1875
+ "types": "./services/swap-service/handler/uniswap-handler.d.ts",
1876
+ "require": "./cjs/services/swap-service/handler/uniswap-handler.js",
1877
+ "default": "./services/swap-service/handler/uniswap-handler.js"
1878
+ },
1824
1879
  "./services/swap-service/utils": {
1825
1880
  "types": "./services/swap-service/utils.d.ts",
1826
1881
  "require": "./cjs/services/swap-service/utils.js",
@@ -2151,6 +2206,11 @@
2151
2206
  "require": "./cjs/types/fee/base.js",
2152
2207
  "default": "./types/fee/base.js"
2153
2208
  },
2209
+ "./types/fee/cardano": {
2210
+ "types": "./types/fee/cardano.d.ts",
2211
+ "require": "./cjs/types/fee/cardano.js",
2212
+ "default": "./types/fee/cardano.js"
2213
+ },
2154
2214
  "./types/fee/evm": {
2155
2215
  "types": "./types/fee/evm.d.ts",
2156
2216
  "require": "./cjs/types/fee/evm.js",
@@ -2544,6 +2604,7 @@
2544
2604
  "./utils/staticData/crowdloanFunds.json": "./utils/staticData/crowdloanFunds.json",
2545
2605
  "./utils/staticData/currencySymbol.json": "./utils/staticData/currencySymbol.json",
2546
2606
  "./utils/staticData/marketingCampaigns.json": "./utils/staticData/marketingCampaigns.json",
2607
+ "./utils/staticData/oldChainPrefix.json": "./utils/staticData/oldChainPrefix.json",
2547
2608
  "./utils/staticData/remindNotificationTime.json": "./utils/staticData/remindNotificationTime.json",
2548
2609
  "./utils/staticData/termAndCondition.json": "./utils/staticData/termAndCondition.json",
2549
2610
  "./utils/swap": {
@@ -2561,7 +2622,7 @@
2561
2622
  "@acala-network/api": "^5.0.2",
2562
2623
  "@apollo/client": "^3.7.14",
2563
2624
  "@azns/resolver-core": "^1.4.0",
2564
- "@chainflip/sdk": "^1.6.0",
2625
+ "@emurgo/cardano-serialization-lib-nodejs": "^13.2.0",
2565
2626
  "@equilab/api": "~1.14.25",
2566
2627
  "@ethereumjs/common": "^4.1.0",
2567
2628
  "@ethereumjs/tx": "^5.1.0",
@@ -2593,13 +2654,14 @@
2593
2654
  "@reduxjs/toolkit": "^1.9.1",
2594
2655
  "@sora-substrate/type-definitions": "^1.17.7",
2595
2656
  "@substrate/connect": "^0.8.9",
2596
- "@subwallet/chain-list": "0.2.99",
2597
- "@subwallet/extension-base": "^1.3.22-0",
2598
- "@subwallet/extension-chains": "^1.3.22-0",
2599
- "@subwallet/extension-dapp": "^1.3.22-0",
2600
- "@subwallet/extension-inject": "^1.3.22-0",
2601
- "@subwallet/keyring": "^0.1.8-beta.0",
2602
- "@subwallet/ui-keyring": "^0.1.8-beta.0",
2657
+ "@subwallet/chain-list": "0.2.101",
2658
+ "@subwallet/extension-base": "^1.3.23-0",
2659
+ "@subwallet/extension-chains": "^1.3.23-0",
2660
+ "@subwallet/extension-dapp": "^1.3.23-0",
2661
+ "@subwallet/extension-inject": "^1.3.23-0",
2662
+ "@subwallet/keyring": "^0.1.9",
2663
+ "@subwallet/subwallet-api-sdk": "^1.3.23-0",
2664
+ "@subwallet/ui-keyring": "^0.1.9",
2603
2665
  "@ton/core": "^0.56.3",
2604
2666
  "@ton/crypto": "^3.2.0",
2605
2667
  "@ton/ton": "^15.0.0",
package/packageInfo.js CHANGED
@@ -7,5 +7,5 @@ export const packageInfo = {
7
7
  name: '@subwallet/extension-base',
8
8
  path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
9
9
  type: 'esm',
10
- version: '1.3.22-0'
10
+ version: '1.3.23-0'
11
11
  };
@@ -0,0 +1 @@
1
+ export declare const DEFAULT_CARDANO_TTL_OFFSET: number;
@@ -0,0 +1,4 @@
1
+ // Copyright 2019-2022 @subwallet/extension-base
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export const DEFAULT_CARDANO_TTL_OFFSET = 2 * 60 * 60 * 1000; // 2 hours
@@ -0,0 +1,2 @@
1
+ import { SusbcribeCardanoPalletBalance } from '@subwallet/extension-base/types';
2
+ export declare function subscribeCardanoBalance(params: SusbcribeCardanoPalletBalance): () => void;