@metamask/earn-controller 11.1.2 → 11.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,49 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [11.2.1]
11
+
12
+ ### Changed
13
+
14
+ - Bump `@metamask/account-tree-controller` from `^6.0.0` to `^7.0.0` ([#8325](https://github.com/MetaMask/core/pull/8325))
15
+
16
+ ## [11.2.0]
17
+
18
+ ### Added
19
+
20
+ - Expose public `EarnController` methods through its messenger ([#8173](https://github.com/MetaMask/core/pull/8173))
21
+ - The following actions are now available:
22
+ - `EarnController:refreshPooledStakes`
23
+ - `EarnController:refreshEarnEligibility`
24
+ - `EarnController:refreshPooledStakingVaultMetadata`
25
+ - `EarnController:refreshPooledStakingVaultDailyApys`
26
+ - `EarnController:refreshPooledStakingVaultApyAverages`
27
+ - `EarnController:refreshPooledStakingData`
28
+ - `EarnController:refreshLendingMarkets`
29
+ - `EarnController:refreshLendingPositions`
30
+ - `EarnController:refreshLendingEligibility`
31
+ - `EarnController:refreshLendingData`
32
+ - `EarnController:refreshTronStakingApy`
33
+ - `EarnController:getTronStakingApy`
34
+ - `EarnController:getLendingPositionHistory`
35
+ - `EarnController:getLendingMarketDailyApysAndAverages`
36
+ - `EarnController:executeLendingDeposit`
37
+ - `EarnController:executeLendingWithdraw`
38
+ - `EarnController:executeLendingTokenApprove`
39
+ - `EarnController:getLendingTokenAllowance`
40
+ - `EarnController:getLendingTokenMaxWithdraw`
41
+ - `EarnController:getLendingTokenMaxDeposit`
42
+ - Corresponding action types (e.g. `EarnControllerRefreshPooledStakesAction`) are available as well.
43
+
44
+ ### Changed
45
+
46
+ - Bump `@metamask/base-controller` from `^9.0.0` to `^9.0.1` ([#8317](https://github.com/MetaMask/core/pull/8317))
47
+ - Bump `@metamask/messenger` from `^0.3.0` to `^1.0.0` ([#8317](https://github.com/MetaMask/core/pull/8317))
48
+ - Bump `@metamask/network-controller` from `^30.0.0` to `^30.0.1` ([#8317](https://github.com/MetaMask/core/pull/8317))
49
+ - Bump `@metamask/keyring-api` from `^21.5.0` to `^21.6.0` ([#8259](https://github.com/MetaMask/core/pull/8259))
50
+ - Bump `@metamask/account-tree-controller` from `^5.0.0` to `^6.0.0` ([#8162](https://github.com/MetaMask/core/pull/8162), [#8317](https://github.com/MetaMask/core/pull/8317))
51
+ - Bump `@metamask/transaction-controller` from `^63.0.0` to `^63.1.0` ([#8272](https://github.com/MetaMask/core/pull/8272))
52
+
10
53
  ## [11.1.2]
11
54
 
12
55
  ### Changed
@@ -360,7 +403,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
360
403
 
361
404
  - Initial release ([#5271](https://github.com/MetaMask/core/pull/5271))
362
405
 
363
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/earn-controller@11.1.2...HEAD
406
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/earn-controller@11.2.1...HEAD
407
+ [11.2.1]: https://github.com/MetaMask/core/compare/@metamask/earn-controller@11.2.0...@metamask/earn-controller@11.2.1
408
+ [11.2.0]: https://github.com/MetaMask/core/compare/@metamask/earn-controller@11.1.2...@metamask/earn-controller@11.2.0
364
409
  [11.1.2]: https://github.com/MetaMask/core/compare/@metamask/earn-controller@11.1.1...@metamask/earn-controller@11.1.2
365
410
  [11.1.1]: https://github.com/MetaMask/core/compare/@metamask/earn-controller@11.1.0...@metamask/earn-controller@11.1.1
366
411
  [11.1.0]: https://github.com/MetaMask/core/compare/@metamask/earn-controller@11.0.0...@metamask/earn-controller@11.1.0
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * This file is auto generated.
4
+ * Do not edit manually.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=EarnController-method-action-types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EarnController-method-action-types.cjs","sourceRoot":"","sources":["../src/EarnController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { EarnController } from './EarnController';\n\n/**\n * Refreshes the pooled stakes data for the current account.\n * Fetches updated stake information including lifetime rewards, assets, and exit requests\n * from the staking API service and updates the state.\n *\n * @param options - Optional arguments\n * @param [options.resetCache] - Control whether the BE cache should be invalidated (optional).\n * @param [options.address] - The address to refresh pooled stakes for (optional).\n * @param [options.chainId] - The chain id to refresh pooled stakes for (optional).\n * @returns A promise that resolves when the stakes data has been updated\n */\nexport type EarnControllerRefreshPooledStakesAction = {\n type: `EarnController:refreshPooledStakes`;\n handler: EarnController['refreshPooledStakes'];\n};\n\n/**\n * Refreshes the earn eligibility status for the current account.\n * Updates the eligibility status in the controller state based on the location and address blocklist for compliance.\n *\n * Note: Pooled-staking and Lending used the same result since there isn't a need to split these up right now.\n *\n * @param options - Optional arguments\n * @param [options.address] - Address to refresh earn eligibility for (optional).\n * @returns A promise that resolves when the eligibility status has been updated\n */\nexport type EarnControllerRefreshEarnEligibilityAction = {\n type: `EarnController:refreshEarnEligibility`;\n handler: EarnController['refreshEarnEligibility'];\n};\n\n/**\n * Refreshes pooled staking vault metadata for the current chain.\n * Updates the vault metadata in the controller state including APY, capacity,\n * fee percentage, total assets, and vault address.\n *\n * @param [chainId] - The chain id to refresh pooled staking vault metadata for (optional).\n * @returns A promise that resolves when the vault metadata has been updated\n */\nexport type EarnControllerRefreshPooledStakingVaultMetadataAction = {\n type: `EarnController:refreshPooledStakingVaultMetadata`;\n handler: EarnController['refreshPooledStakingVaultMetadata'];\n};\n\n/**\n * Refreshes pooled staking vault daily apys for the current chain.\n * Updates the pooled staking vault daily apys controller state.\n *\n * @param [options] - The options for refreshing pooled staking vault daily apys.\n * @param [options.chainId] - The chain id to refresh pooled staking vault daily apys for (defaults to Ethereum).\n * @param [options.days] - The number of days to fetch pooled staking vault daily apys for (defaults to 365).\n * @param [options.order] - The order in which to fetch pooled staking vault daily apys. Descending order fetches the latest N days (latest working backwards). Ascending order fetches the oldest N days (oldest working forwards) (defaults to 'desc').\n * @returns A promise that resolves when the pooled staking vault daily apys have been updated.\n */\nexport type EarnControllerRefreshPooledStakingVaultDailyApysAction = {\n type: `EarnController:refreshPooledStakingVaultDailyApys`;\n handler: EarnController['refreshPooledStakingVaultDailyApys'];\n};\n\n/**\n * Refreshes pooled staking vault apy averages for the current chain.\n * Updates the pooled staking vault apy averages controller state.\n *\n * @param [chainId] - The chain id to refresh pooled staking vault apy averages for (optional).\n * @returns A promise that resolves when the pooled staking vault apy averages have been updated.\n */\nexport type EarnControllerRefreshPooledStakingVaultApyAveragesAction = {\n type: `EarnController:refreshPooledStakingVaultApyAverages`;\n handler: EarnController['refreshPooledStakingVaultApyAverages'];\n};\n\n/**\n * Refreshes all pooled staking related data including stakes, eligibility, and vault data.\n * This method allows partial success, meaning some data may update while other requests fail.\n * All errors are collected and thrown as a single error message.\n *\n * @param options - Optional arguments\n * @param [options.resetCache] - Control whether the BE cache should be invalidated (optional).\n * @param [options.address] - The address to refresh pooled stakes for (optional).\n * @returns A promise that resolves when all possible data has been updated\n * @throws {Error} If any of the refresh operations fail, with concatenated error messages\n */\nexport type EarnControllerRefreshPooledStakingDataAction = {\n type: `EarnController:refreshPooledStakingData`;\n handler: EarnController['refreshPooledStakingData'];\n};\n\n/**\n * Refreshes the lending markets data for all chains.\n * Updates the lending markets in the controller state.\n *\n * @returns A promise that resolves when the lending markets have been updated\n */\nexport type EarnControllerRefreshLendingMarketsAction = {\n type: `EarnController:refreshLendingMarkets`;\n handler: EarnController['refreshLendingMarkets'];\n};\n\n/**\n * Refreshes the lending positions for the current account.\n * Updates the lending positions in the controller state.\n *\n * @param options - Optional arguments\n * @param [options.address] - The address to refresh lending positions for (optional).\n * @returns A promise that resolves when the lending positions have been updated\n */\nexport type EarnControllerRefreshLendingPositionsAction = {\n type: `EarnController:refreshLendingPositions`;\n handler: EarnController['refreshLendingPositions'];\n};\n\n/**\n * Refreshes the lending eligibility status for the current account.\n * Updates the eligibility status in the controller state based on the location and address blocklist for compliance.\n *\n * @param options - Optional arguments\n * @param [options.address] - The address to refresh lending eligibility for (optional).\n * @returns A promise that resolves when the eligibility status has been updated\n */\nexport type EarnControllerRefreshLendingEligibilityAction = {\n type: `EarnController:refreshLendingEligibility`;\n handler: EarnController['refreshLendingEligibility'];\n};\n\n/**\n * Refreshes all lending related data including markets, positions, and eligibility.\n * This method allows partial success, meaning some data may update while other requests fail.\n * All errors are collected and thrown as a single error message.\n *\n * @returns A promise that resolves when all possible data has been updated\n * @throws {Error} If any of the refresh operations fail, with concatenated error messages\n */\nexport type EarnControllerRefreshLendingDataAction = {\n type: `EarnController:refreshLendingData`;\n handler: EarnController['refreshLendingData'];\n};\n\n/**\n * Refreshes the APY for TRON staking.\n * The consumer provides a fetcher function that returns the APY for TRON.\n *\n * @param apyFetcher - An async function that fetches and returns the APY as a decimal string.\n * @returns A promise that resolves when the APY has been updated.\n */\nexport type EarnControllerRefreshTronStakingApyAction = {\n type: `EarnController:refreshTronStakingApy`;\n handler: EarnController['refreshTronStakingApy'];\n};\n\n/**\n * Gets the TRON staking APY.\n *\n * @returns The APY for TRON staking, or undefined if not available.\n */\nexport type EarnControllerGetTronStakingApyAction = {\n type: `EarnController:getTronStakingApy`;\n handler: EarnController['getTronStakingApy'];\n};\n\n/**\n * Gets the lending position history for the current account.\n *\n * @param options - Optional arguments\n * @param [options.address] - The address to get lending position history for (optional).\n * @param options.chainId - The chain id to get lending position history for.\n * @param [options.positionId] - The position id to get lending position history for.\n * @param [options.marketId] - The market id to get lending position history for.\n * @param [options.marketAddress] - The market address to get lending position history for.\n * @param [options.protocol] - The protocol to get lending position history for.\n * @param [options.days] - The number of days to get lending position history for (optional).\n * @returns A promise that resolves when the lending position history has been updated\n */\nexport type EarnControllerGetLendingPositionHistoryAction = {\n type: `EarnController:getLendingPositionHistory`;\n handler: EarnController['getLendingPositionHistory'];\n};\n\n/**\n * Gets the lending market daily apys and averages for the current chain.\n *\n * @param options - Optional arguments\n * @param options.chainId - The chain id to get lending market daily apys and averages for.\n * @param [options.protocol] - The protocol to get lending market daily apys and averages for.\n * @param [options.marketId] - The market id to get lending market daily apys and averages for.\n * @param [options.days] - The number of days to get lending market daily apys and averages for (optional).\n * @returns A promise that resolves when the lending market daily apys and averages have been updated\n */\nexport type EarnControllerGetLendingMarketDailyApysAndAveragesAction = {\n type: `EarnController:getLendingMarketDailyApysAndAverages`;\n handler: EarnController['getLendingMarketDailyApysAndAverages'];\n};\n\n/**\n * Executes a lending deposit transaction.\n *\n * @param options - The options for the lending deposit transaction.\n * @param options.amount - The amount to deposit.\n * @param options.chainId - The chain ID for the lending deposit transaction.\n * @param options.protocol - The protocol of the lending market.\n * @param options.underlyingTokenAddress - The address of the underlying token.\n * @param options.gasOptions - The gas options for the transaction.\n * @param options.gasOptions.gasLimit - The gas limit for the transaction.\n * @param options.gasOptions.gasBufferPct - The gas buffer percentage for the transaction.\n * @param options.txOptions - The transaction options for the transaction.\n * @returns A promise that resolves to the transaction hash.\n */\nexport type EarnControllerExecuteLendingDepositAction = {\n type: `EarnController:executeLendingDeposit`;\n handler: EarnController['executeLendingDeposit'];\n};\n\n/**\n * Executes a lending withdraw transaction.\n *\n * @param options - The options for the lending withdraw transaction.\n * @param options.amount - The amount to withdraw.\n * @param options.chainId - The chain ID for the lending withdraw transaction.\n * @param options.protocol - The protocol of the lending market.\n * @param options.underlyingTokenAddress - The address of the underlying token.\n * @param options.gasOptions - The gas options for the transaction.\n * @param options.gasOptions.gasLimit - The gas limit for the transaction.\n * @param options.gasOptions.gasBufferPct - The gas buffer percentage for the transaction.\n * @param options.txOptions - The transaction options for the transaction.\n * @returns A promise that resolves to the transaction hash.\n */\nexport type EarnControllerExecuteLendingWithdrawAction = {\n type: `EarnController:executeLendingWithdraw`;\n handler: EarnController['executeLendingWithdraw'];\n};\n\n/**\n * Executes a lending token approve transaction.\n *\n * @param options - The options for the lending token approve transaction.\n * @param options.amount - The amount to approve.\n * @param options.chainId - The chain ID for the lending token approve transaction.\n * @param options.protocol - The protocol of the lending market.\n * @param options.underlyingTokenAddress - The address of the underlying token.\n * @param options.gasOptions - The gas options for the transaction.\n * @param options.gasOptions.gasLimit - The gas limit for the transaction.\n * @param options.gasOptions.gasBufferPct - The gas buffer percentage for the transaction.\n * @param options.txOptions - The transaction options for the transaction.\n * @returns A promise that resolves to the transaction hash.\n */\nexport type EarnControllerExecuteLendingTokenApproveAction = {\n type: `EarnController:executeLendingTokenApprove`;\n handler: EarnController['executeLendingTokenApprove'];\n};\n\n/**\n * Gets the allowance for a lending token.\n *\n * @param protocol - The protocol of the lending market.\n * @param underlyingTokenAddress - The address of the underlying token.\n * @returns A promise that resolves to the allowance.\n */\nexport type EarnControllerGetLendingTokenAllowanceAction = {\n type: `EarnController:getLendingTokenAllowance`;\n handler: EarnController['getLendingTokenAllowance'];\n};\n\n/**\n * Gets the maximum withdraw amount for a lending token's output token or shares if no output token.\n *\n * @param protocol - The protocol of the lending market.\n * @param underlyingTokenAddress - The address of the underlying token.\n * @returns A promise that resolves to the maximum withdraw amount.\n */\nexport type EarnControllerGetLendingTokenMaxWithdrawAction = {\n type: `EarnController:getLendingTokenMaxWithdraw`;\n handler: EarnController['getLendingTokenMaxWithdraw'];\n};\n\n/**\n * Gets the maximum deposit amount for a lending token.\n *\n * @param protocol - The protocol of the lending market.\n * @param underlyingTokenAddress - The address of the underlying token.\n * @returns A promise that resolves to the maximum deposit amount.\n */\nexport type EarnControllerGetLendingTokenMaxDepositAction = {\n type: `EarnController:getLendingTokenMaxDeposit`;\n handler: EarnController['getLendingTokenMaxDeposit'];\n};\n\n/**\n * Union of all EarnController action types.\n */\nexport type EarnControllerMethodActions =\n | EarnControllerRefreshPooledStakesAction\n | EarnControllerRefreshEarnEligibilityAction\n | EarnControllerRefreshPooledStakingVaultMetadataAction\n | EarnControllerRefreshPooledStakingVaultDailyApysAction\n | EarnControllerRefreshPooledStakingVaultApyAveragesAction\n | EarnControllerRefreshPooledStakingDataAction\n | EarnControllerRefreshLendingMarketsAction\n | EarnControllerRefreshLendingPositionsAction\n | EarnControllerRefreshLendingEligibilityAction\n | EarnControllerRefreshLendingDataAction\n | EarnControllerRefreshTronStakingApyAction\n | EarnControllerGetTronStakingApyAction\n | EarnControllerGetLendingPositionHistoryAction\n | EarnControllerGetLendingMarketDailyApysAndAveragesAction\n | EarnControllerExecuteLendingDepositAction\n | EarnControllerExecuteLendingWithdrawAction\n | EarnControllerExecuteLendingTokenApproveAction\n | EarnControllerGetLendingTokenAllowanceAction\n | EarnControllerGetLendingTokenMaxWithdrawAction\n | EarnControllerGetLendingTokenMaxDepositAction;\n"]}
@@ -0,0 +1,275 @@
1
+ /**
2
+ * This file is auto generated.
3
+ * Do not edit manually.
4
+ */
5
+ import type { EarnController } from "./EarnController.cjs";
6
+ /**
7
+ * Refreshes the pooled stakes data for the current account.
8
+ * Fetches updated stake information including lifetime rewards, assets, and exit requests
9
+ * from the staking API service and updates the state.
10
+ *
11
+ * @param options - Optional arguments
12
+ * @param [options.resetCache] - Control whether the BE cache should be invalidated (optional).
13
+ * @param [options.address] - The address to refresh pooled stakes for (optional).
14
+ * @param [options.chainId] - The chain id to refresh pooled stakes for (optional).
15
+ * @returns A promise that resolves when the stakes data has been updated
16
+ */
17
+ export type EarnControllerRefreshPooledStakesAction = {
18
+ type: `EarnController:refreshPooledStakes`;
19
+ handler: EarnController['refreshPooledStakes'];
20
+ };
21
+ /**
22
+ * Refreshes the earn eligibility status for the current account.
23
+ * Updates the eligibility status in the controller state based on the location and address blocklist for compliance.
24
+ *
25
+ * Note: Pooled-staking and Lending used the same result since there isn't a need to split these up right now.
26
+ *
27
+ * @param options - Optional arguments
28
+ * @param [options.address] - Address to refresh earn eligibility for (optional).
29
+ * @returns A promise that resolves when the eligibility status has been updated
30
+ */
31
+ export type EarnControllerRefreshEarnEligibilityAction = {
32
+ type: `EarnController:refreshEarnEligibility`;
33
+ handler: EarnController['refreshEarnEligibility'];
34
+ };
35
+ /**
36
+ * Refreshes pooled staking vault metadata for the current chain.
37
+ * Updates the vault metadata in the controller state including APY, capacity,
38
+ * fee percentage, total assets, and vault address.
39
+ *
40
+ * @param [chainId] - The chain id to refresh pooled staking vault metadata for (optional).
41
+ * @returns A promise that resolves when the vault metadata has been updated
42
+ */
43
+ export type EarnControllerRefreshPooledStakingVaultMetadataAction = {
44
+ type: `EarnController:refreshPooledStakingVaultMetadata`;
45
+ handler: EarnController['refreshPooledStakingVaultMetadata'];
46
+ };
47
+ /**
48
+ * Refreshes pooled staking vault daily apys for the current chain.
49
+ * Updates the pooled staking vault daily apys controller state.
50
+ *
51
+ * @param [options] - The options for refreshing pooled staking vault daily apys.
52
+ * @param [options.chainId] - The chain id to refresh pooled staking vault daily apys for (defaults to Ethereum).
53
+ * @param [options.days] - The number of days to fetch pooled staking vault daily apys for (defaults to 365).
54
+ * @param [options.order] - The order in which to fetch pooled staking vault daily apys. Descending order fetches the latest N days (latest working backwards). Ascending order fetches the oldest N days (oldest working forwards) (defaults to 'desc').
55
+ * @returns A promise that resolves when the pooled staking vault daily apys have been updated.
56
+ */
57
+ export type EarnControllerRefreshPooledStakingVaultDailyApysAction = {
58
+ type: `EarnController:refreshPooledStakingVaultDailyApys`;
59
+ handler: EarnController['refreshPooledStakingVaultDailyApys'];
60
+ };
61
+ /**
62
+ * Refreshes pooled staking vault apy averages for the current chain.
63
+ * Updates the pooled staking vault apy averages controller state.
64
+ *
65
+ * @param [chainId] - The chain id to refresh pooled staking vault apy averages for (optional).
66
+ * @returns A promise that resolves when the pooled staking vault apy averages have been updated.
67
+ */
68
+ export type EarnControllerRefreshPooledStakingVaultApyAveragesAction = {
69
+ type: `EarnController:refreshPooledStakingVaultApyAverages`;
70
+ handler: EarnController['refreshPooledStakingVaultApyAverages'];
71
+ };
72
+ /**
73
+ * Refreshes all pooled staking related data including stakes, eligibility, and vault data.
74
+ * This method allows partial success, meaning some data may update while other requests fail.
75
+ * All errors are collected and thrown as a single error message.
76
+ *
77
+ * @param options - Optional arguments
78
+ * @param [options.resetCache] - Control whether the BE cache should be invalidated (optional).
79
+ * @param [options.address] - The address to refresh pooled stakes for (optional).
80
+ * @returns A promise that resolves when all possible data has been updated
81
+ * @throws {Error} If any of the refresh operations fail, with concatenated error messages
82
+ */
83
+ export type EarnControllerRefreshPooledStakingDataAction = {
84
+ type: `EarnController:refreshPooledStakingData`;
85
+ handler: EarnController['refreshPooledStakingData'];
86
+ };
87
+ /**
88
+ * Refreshes the lending markets data for all chains.
89
+ * Updates the lending markets in the controller state.
90
+ *
91
+ * @returns A promise that resolves when the lending markets have been updated
92
+ */
93
+ export type EarnControllerRefreshLendingMarketsAction = {
94
+ type: `EarnController:refreshLendingMarkets`;
95
+ handler: EarnController['refreshLendingMarkets'];
96
+ };
97
+ /**
98
+ * Refreshes the lending positions for the current account.
99
+ * Updates the lending positions in the controller state.
100
+ *
101
+ * @param options - Optional arguments
102
+ * @param [options.address] - The address to refresh lending positions for (optional).
103
+ * @returns A promise that resolves when the lending positions have been updated
104
+ */
105
+ export type EarnControllerRefreshLendingPositionsAction = {
106
+ type: `EarnController:refreshLendingPositions`;
107
+ handler: EarnController['refreshLendingPositions'];
108
+ };
109
+ /**
110
+ * Refreshes the lending eligibility status for the current account.
111
+ * Updates the eligibility status in the controller state based on the location and address blocklist for compliance.
112
+ *
113
+ * @param options - Optional arguments
114
+ * @param [options.address] - The address to refresh lending eligibility for (optional).
115
+ * @returns A promise that resolves when the eligibility status has been updated
116
+ */
117
+ export type EarnControllerRefreshLendingEligibilityAction = {
118
+ type: `EarnController:refreshLendingEligibility`;
119
+ handler: EarnController['refreshLendingEligibility'];
120
+ };
121
+ /**
122
+ * Refreshes all lending related data including markets, positions, and eligibility.
123
+ * This method allows partial success, meaning some data may update while other requests fail.
124
+ * All errors are collected and thrown as a single error message.
125
+ *
126
+ * @returns A promise that resolves when all possible data has been updated
127
+ * @throws {Error} If any of the refresh operations fail, with concatenated error messages
128
+ */
129
+ export type EarnControllerRefreshLendingDataAction = {
130
+ type: `EarnController:refreshLendingData`;
131
+ handler: EarnController['refreshLendingData'];
132
+ };
133
+ /**
134
+ * Refreshes the APY for TRON staking.
135
+ * The consumer provides a fetcher function that returns the APY for TRON.
136
+ *
137
+ * @param apyFetcher - An async function that fetches and returns the APY as a decimal string.
138
+ * @returns A promise that resolves when the APY has been updated.
139
+ */
140
+ export type EarnControllerRefreshTronStakingApyAction = {
141
+ type: `EarnController:refreshTronStakingApy`;
142
+ handler: EarnController['refreshTronStakingApy'];
143
+ };
144
+ /**
145
+ * Gets the TRON staking APY.
146
+ *
147
+ * @returns The APY for TRON staking, or undefined if not available.
148
+ */
149
+ export type EarnControllerGetTronStakingApyAction = {
150
+ type: `EarnController:getTronStakingApy`;
151
+ handler: EarnController['getTronStakingApy'];
152
+ };
153
+ /**
154
+ * Gets the lending position history for the current account.
155
+ *
156
+ * @param options - Optional arguments
157
+ * @param [options.address] - The address to get lending position history for (optional).
158
+ * @param options.chainId - The chain id to get lending position history for.
159
+ * @param [options.positionId] - The position id to get lending position history for.
160
+ * @param [options.marketId] - The market id to get lending position history for.
161
+ * @param [options.marketAddress] - The market address to get lending position history for.
162
+ * @param [options.protocol] - The protocol to get lending position history for.
163
+ * @param [options.days] - The number of days to get lending position history for (optional).
164
+ * @returns A promise that resolves when the lending position history has been updated
165
+ */
166
+ export type EarnControllerGetLendingPositionHistoryAction = {
167
+ type: `EarnController:getLendingPositionHistory`;
168
+ handler: EarnController['getLendingPositionHistory'];
169
+ };
170
+ /**
171
+ * Gets the lending market daily apys and averages for the current chain.
172
+ *
173
+ * @param options - Optional arguments
174
+ * @param options.chainId - The chain id to get lending market daily apys and averages for.
175
+ * @param [options.protocol] - The protocol to get lending market daily apys and averages for.
176
+ * @param [options.marketId] - The market id to get lending market daily apys and averages for.
177
+ * @param [options.days] - The number of days to get lending market daily apys and averages for (optional).
178
+ * @returns A promise that resolves when the lending market daily apys and averages have been updated
179
+ */
180
+ export type EarnControllerGetLendingMarketDailyApysAndAveragesAction = {
181
+ type: `EarnController:getLendingMarketDailyApysAndAverages`;
182
+ handler: EarnController['getLendingMarketDailyApysAndAverages'];
183
+ };
184
+ /**
185
+ * Executes a lending deposit transaction.
186
+ *
187
+ * @param options - The options for the lending deposit transaction.
188
+ * @param options.amount - The amount to deposit.
189
+ * @param options.chainId - The chain ID for the lending deposit transaction.
190
+ * @param options.protocol - The protocol of the lending market.
191
+ * @param options.underlyingTokenAddress - The address of the underlying token.
192
+ * @param options.gasOptions - The gas options for the transaction.
193
+ * @param options.gasOptions.gasLimit - The gas limit for the transaction.
194
+ * @param options.gasOptions.gasBufferPct - The gas buffer percentage for the transaction.
195
+ * @param options.txOptions - The transaction options for the transaction.
196
+ * @returns A promise that resolves to the transaction hash.
197
+ */
198
+ export type EarnControllerExecuteLendingDepositAction = {
199
+ type: `EarnController:executeLendingDeposit`;
200
+ handler: EarnController['executeLendingDeposit'];
201
+ };
202
+ /**
203
+ * Executes a lending withdraw transaction.
204
+ *
205
+ * @param options - The options for the lending withdraw transaction.
206
+ * @param options.amount - The amount to withdraw.
207
+ * @param options.chainId - The chain ID for the lending withdraw transaction.
208
+ * @param options.protocol - The protocol of the lending market.
209
+ * @param options.underlyingTokenAddress - The address of the underlying token.
210
+ * @param options.gasOptions - The gas options for the transaction.
211
+ * @param options.gasOptions.gasLimit - The gas limit for the transaction.
212
+ * @param options.gasOptions.gasBufferPct - The gas buffer percentage for the transaction.
213
+ * @param options.txOptions - The transaction options for the transaction.
214
+ * @returns A promise that resolves to the transaction hash.
215
+ */
216
+ export type EarnControllerExecuteLendingWithdrawAction = {
217
+ type: `EarnController:executeLendingWithdraw`;
218
+ handler: EarnController['executeLendingWithdraw'];
219
+ };
220
+ /**
221
+ * Executes a lending token approve transaction.
222
+ *
223
+ * @param options - The options for the lending token approve transaction.
224
+ * @param options.amount - The amount to approve.
225
+ * @param options.chainId - The chain ID for the lending token approve transaction.
226
+ * @param options.protocol - The protocol of the lending market.
227
+ * @param options.underlyingTokenAddress - The address of the underlying token.
228
+ * @param options.gasOptions - The gas options for the transaction.
229
+ * @param options.gasOptions.gasLimit - The gas limit for the transaction.
230
+ * @param options.gasOptions.gasBufferPct - The gas buffer percentage for the transaction.
231
+ * @param options.txOptions - The transaction options for the transaction.
232
+ * @returns A promise that resolves to the transaction hash.
233
+ */
234
+ export type EarnControllerExecuteLendingTokenApproveAction = {
235
+ type: `EarnController:executeLendingTokenApprove`;
236
+ handler: EarnController['executeLendingTokenApprove'];
237
+ };
238
+ /**
239
+ * Gets the allowance for a lending token.
240
+ *
241
+ * @param protocol - The protocol of the lending market.
242
+ * @param underlyingTokenAddress - The address of the underlying token.
243
+ * @returns A promise that resolves to the allowance.
244
+ */
245
+ export type EarnControllerGetLendingTokenAllowanceAction = {
246
+ type: `EarnController:getLendingTokenAllowance`;
247
+ handler: EarnController['getLendingTokenAllowance'];
248
+ };
249
+ /**
250
+ * Gets the maximum withdraw amount for a lending token's output token or shares if no output token.
251
+ *
252
+ * @param protocol - The protocol of the lending market.
253
+ * @param underlyingTokenAddress - The address of the underlying token.
254
+ * @returns A promise that resolves to the maximum withdraw amount.
255
+ */
256
+ export type EarnControllerGetLendingTokenMaxWithdrawAction = {
257
+ type: `EarnController:getLendingTokenMaxWithdraw`;
258
+ handler: EarnController['getLendingTokenMaxWithdraw'];
259
+ };
260
+ /**
261
+ * Gets the maximum deposit amount for a lending token.
262
+ *
263
+ * @param protocol - The protocol of the lending market.
264
+ * @param underlyingTokenAddress - The address of the underlying token.
265
+ * @returns A promise that resolves to the maximum deposit amount.
266
+ */
267
+ export type EarnControllerGetLendingTokenMaxDepositAction = {
268
+ type: `EarnController:getLendingTokenMaxDeposit`;
269
+ handler: EarnController['getLendingTokenMaxDeposit'];
270
+ };
271
+ /**
272
+ * Union of all EarnController action types.
273
+ */
274
+ export type EarnControllerMethodActions = EarnControllerRefreshPooledStakesAction | EarnControllerRefreshEarnEligibilityAction | EarnControllerRefreshPooledStakingVaultMetadataAction | EarnControllerRefreshPooledStakingVaultDailyApysAction | EarnControllerRefreshPooledStakingVaultApyAveragesAction | EarnControllerRefreshPooledStakingDataAction | EarnControllerRefreshLendingMarketsAction | EarnControllerRefreshLendingPositionsAction | EarnControllerRefreshLendingEligibilityAction | EarnControllerRefreshLendingDataAction | EarnControllerRefreshTronStakingApyAction | EarnControllerGetTronStakingApyAction | EarnControllerGetLendingPositionHistoryAction | EarnControllerGetLendingMarketDailyApysAndAveragesAction | EarnControllerExecuteLendingDepositAction | EarnControllerExecuteLendingWithdrawAction | EarnControllerExecuteLendingTokenApproveAction | EarnControllerGetLendingTokenAllowanceAction | EarnControllerGetLendingTokenMaxWithdrawAction | EarnControllerGetLendingTokenMaxDepositAction;
275
+ //# sourceMappingURL=EarnController-method-action-types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EarnController-method-action-types.d.cts","sourceRoot":"","sources":["../src/EarnController-method-action-types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,275 @@
1
+ /**
2
+ * This file is auto generated.
3
+ * Do not edit manually.
4
+ */
5
+ import type { EarnController } from "./EarnController.mjs";
6
+ /**
7
+ * Refreshes the pooled stakes data for the current account.
8
+ * Fetches updated stake information including lifetime rewards, assets, and exit requests
9
+ * from the staking API service and updates the state.
10
+ *
11
+ * @param options - Optional arguments
12
+ * @param [options.resetCache] - Control whether the BE cache should be invalidated (optional).
13
+ * @param [options.address] - The address to refresh pooled stakes for (optional).
14
+ * @param [options.chainId] - The chain id to refresh pooled stakes for (optional).
15
+ * @returns A promise that resolves when the stakes data has been updated
16
+ */
17
+ export type EarnControllerRefreshPooledStakesAction = {
18
+ type: `EarnController:refreshPooledStakes`;
19
+ handler: EarnController['refreshPooledStakes'];
20
+ };
21
+ /**
22
+ * Refreshes the earn eligibility status for the current account.
23
+ * Updates the eligibility status in the controller state based on the location and address blocklist for compliance.
24
+ *
25
+ * Note: Pooled-staking and Lending used the same result since there isn't a need to split these up right now.
26
+ *
27
+ * @param options - Optional arguments
28
+ * @param [options.address] - Address to refresh earn eligibility for (optional).
29
+ * @returns A promise that resolves when the eligibility status has been updated
30
+ */
31
+ export type EarnControllerRefreshEarnEligibilityAction = {
32
+ type: `EarnController:refreshEarnEligibility`;
33
+ handler: EarnController['refreshEarnEligibility'];
34
+ };
35
+ /**
36
+ * Refreshes pooled staking vault metadata for the current chain.
37
+ * Updates the vault metadata in the controller state including APY, capacity,
38
+ * fee percentage, total assets, and vault address.
39
+ *
40
+ * @param [chainId] - The chain id to refresh pooled staking vault metadata for (optional).
41
+ * @returns A promise that resolves when the vault metadata has been updated
42
+ */
43
+ export type EarnControllerRefreshPooledStakingVaultMetadataAction = {
44
+ type: `EarnController:refreshPooledStakingVaultMetadata`;
45
+ handler: EarnController['refreshPooledStakingVaultMetadata'];
46
+ };
47
+ /**
48
+ * Refreshes pooled staking vault daily apys for the current chain.
49
+ * Updates the pooled staking vault daily apys controller state.
50
+ *
51
+ * @param [options] - The options for refreshing pooled staking vault daily apys.
52
+ * @param [options.chainId] - The chain id to refresh pooled staking vault daily apys for (defaults to Ethereum).
53
+ * @param [options.days] - The number of days to fetch pooled staking vault daily apys for (defaults to 365).
54
+ * @param [options.order] - The order in which to fetch pooled staking vault daily apys. Descending order fetches the latest N days (latest working backwards). Ascending order fetches the oldest N days (oldest working forwards) (defaults to 'desc').
55
+ * @returns A promise that resolves when the pooled staking vault daily apys have been updated.
56
+ */
57
+ export type EarnControllerRefreshPooledStakingVaultDailyApysAction = {
58
+ type: `EarnController:refreshPooledStakingVaultDailyApys`;
59
+ handler: EarnController['refreshPooledStakingVaultDailyApys'];
60
+ };
61
+ /**
62
+ * Refreshes pooled staking vault apy averages for the current chain.
63
+ * Updates the pooled staking vault apy averages controller state.
64
+ *
65
+ * @param [chainId] - The chain id to refresh pooled staking vault apy averages for (optional).
66
+ * @returns A promise that resolves when the pooled staking vault apy averages have been updated.
67
+ */
68
+ export type EarnControllerRefreshPooledStakingVaultApyAveragesAction = {
69
+ type: `EarnController:refreshPooledStakingVaultApyAverages`;
70
+ handler: EarnController['refreshPooledStakingVaultApyAverages'];
71
+ };
72
+ /**
73
+ * Refreshes all pooled staking related data including stakes, eligibility, and vault data.
74
+ * This method allows partial success, meaning some data may update while other requests fail.
75
+ * All errors are collected and thrown as a single error message.
76
+ *
77
+ * @param options - Optional arguments
78
+ * @param [options.resetCache] - Control whether the BE cache should be invalidated (optional).
79
+ * @param [options.address] - The address to refresh pooled stakes for (optional).
80
+ * @returns A promise that resolves when all possible data has been updated
81
+ * @throws {Error} If any of the refresh operations fail, with concatenated error messages
82
+ */
83
+ export type EarnControllerRefreshPooledStakingDataAction = {
84
+ type: `EarnController:refreshPooledStakingData`;
85
+ handler: EarnController['refreshPooledStakingData'];
86
+ };
87
+ /**
88
+ * Refreshes the lending markets data for all chains.
89
+ * Updates the lending markets in the controller state.
90
+ *
91
+ * @returns A promise that resolves when the lending markets have been updated
92
+ */
93
+ export type EarnControllerRefreshLendingMarketsAction = {
94
+ type: `EarnController:refreshLendingMarkets`;
95
+ handler: EarnController['refreshLendingMarkets'];
96
+ };
97
+ /**
98
+ * Refreshes the lending positions for the current account.
99
+ * Updates the lending positions in the controller state.
100
+ *
101
+ * @param options - Optional arguments
102
+ * @param [options.address] - The address to refresh lending positions for (optional).
103
+ * @returns A promise that resolves when the lending positions have been updated
104
+ */
105
+ export type EarnControllerRefreshLendingPositionsAction = {
106
+ type: `EarnController:refreshLendingPositions`;
107
+ handler: EarnController['refreshLendingPositions'];
108
+ };
109
+ /**
110
+ * Refreshes the lending eligibility status for the current account.
111
+ * Updates the eligibility status in the controller state based on the location and address blocklist for compliance.
112
+ *
113
+ * @param options - Optional arguments
114
+ * @param [options.address] - The address to refresh lending eligibility for (optional).
115
+ * @returns A promise that resolves when the eligibility status has been updated
116
+ */
117
+ export type EarnControllerRefreshLendingEligibilityAction = {
118
+ type: `EarnController:refreshLendingEligibility`;
119
+ handler: EarnController['refreshLendingEligibility'];
120
+ };
121
+ /**
122
+ * Refreshes all lending related data including markets, positions, and eligibility.
123
+ * This method allows partial success, meaning some data may update while other requests fail.
124
+ * All errors are collected and thrown as a single error message.
125
+ *
126
+ * @returns A promise that resolves when all possible data has been updated
127
+ * @throws {Error} If any of the refresh operations fail, with concatenated error messages
128
+ */
129
+ export type EarnControllerRefreshLendingDataAction = {
130
+ type: `EarnController:refreshLendingData`;
131
+ handler: EarnController['refreshLendingData'];
132
+ };
133
+ /**
134
+ * Refreshes the APY for TRON staking.
135
+ * The consumer provides a fetcher function that returns the APY for TRON.
136
+ *
137
+ * @param apyFetcher - An async function that fetches and returns the APY as a decimal string.
138
+ * @returns A promise that resolves when the APY has been updated.
139
+ */
140
+ export type EarnControllerRefreshTronStakingApyAction = {
141
+ type: `EarnController:refreshTronStakingApy`;
142
+ handler: EarnController['refreshTronStakingApy'];
143
+ };
144
+ /**
145
+ * Gets the TRON staking APY.
146
+ *
147
+ * @returns The APY for TRON staking, or undefined if not available.
148
+ */
149
+ export type EarnControllerGetTronStakingApyAction = {
150
+ type: `EarnController:getTronStakingApy`;
151
+ handler: EarnController['getTronStakingApy'];
152
+ };
153
+ /**
154
+ * Gets the lending position history for the current account.
155
+ *
156
+ * @param options - Optional arguments
157
+ * @param [options.address] - The address to get lending position history for (optional).
158
+ * @param options.chainId - The chain id to get lending position history for.
159
+ * @param [options.positionId] - The position id to get lending position history for.
160
+ * @param [options.marketId] - The market id to get lending position history for.
161
+ * @param [options.marketAddress] - The market address to get lending position history for.
162
+ * @param [options.protocol] - The protocol to get lending position history for.
163
+ * @param [options.days] - The number of days to get lending position history for (optional).
164
+ * @returns A promise that resolves when the lending position history has been updated
165
+ */
166
+ export type EarnControllerGetLendingPositionHistoryAction = {
167
+ type: `EarnController:getLendingPositionHistory`;
168
+ handler: EarnController['getLendingPositionHistory'];
169
+ };
170
+ /**
171
+ * Gets the lending market daily apys and averages for the current chain.
172
+ *
173
+ * @param options - Optional arguments
174
+ * @param options.chainId - The chain id to get lending market daily apys and averages for.
175
+ * @param [options.protocol] - The protocol to get lending market daily apys and averages for.
176
+ * @param [options.marketId] - The market id to get lending market daily apys and averages for.
177
+ * @param [options.days] - The number of days to get lending market daily apys and averages for (optional).
178
+ * @returns A promise that resolves when the lending market daily apys and averages have been updated
179
+ */
180
+ export type EarnControllerGetLendingMarketDailyApysAndAveragesAction = {
181
+ type: `EarnController:getLendingMarketDailyApysAndAverages`;
182
+ handler: EarnController['getLendingMarketDailyApysAndAverages'];
183
+ };
184
+ /**
185
+ * Executes a lending deposit transaction.
186
+ *
187
+ * @param options - The options for the lending deposit transaction.
188
+ * @param options.amount - The amount to deposit.
189
+ * @param options.chainId - The chain ID for the lending deposit transaction.
190
+ * @param options.protocol - The protocol of the lending market.
191
+ * @param options.underlyingTokenAddress - The address of the underlying token.
192
+ * @param options.gasOptions - The gas options for the transaction.
193
+ * @param options.gasOptions.gasLimit - The gas limit for the transaction.
194
+ * @param options.gasOptions.gasBufferPct - The gas buffer percentage for the transaction.
195
+ * @param options.txOptions - The transaction options for the transaction.
196
+ * @returns A promise that resolves to the transaction hash.
197
+ */
198
+ export type EarnControllerExecuteLendingDepositAction = {
199
+ type: `EarnController:executeLendingDeposit`;
200
+ handler: EarnController['executeLendingDeposit'];
201
+ };
202
+ /**
203
+ * Executes a lending withdraw transaction.
204
+ *
205
+ * @param options - The options for the lending withdraw transaction.
206
+ * @param options.amount - The amount to withdraw.
207
+ * @param options.chainId - The chain ID for the lending withdraw transaction.
208
+ * @param options.protocol - The protocol of the lending market.
209
+ * @param options.underlyingTokenAddress - The address of the underlying token.
210
+ * @param options.gasOptions - The gas options for the transaction.
211
+ * @param options.gasOptions.gasLimit - The gas limit for the transaction.
212
+ * @param options.gasOptions.gasBufferPct - The gas buffer percentage for the transaction.
213
+ * @param options.txOptions - The transaction options for the transaction.
214
+ * @returns A promise that resolves to the transaction hash.
215
+ */
216
+ export type EarnControllerExecuteLendingWithdrawAction = {
217
+ type: `EarnController:executeLendingWithdraw`;
218
+ handler: EarnController['executeLendingWithdraw'];
219
+ };
220
+ /**
221
+ * Executes a lending token approve transaction.
222
+ *
223
+ * @param options - The options for the lending token approve transaction.
224
+ * @param options.amount - The amount to approve.
225
+ * @param options.chainId - The chain ID for the lending token approve transaction.
226
+ * @param options.protocol - The protocol of the lending market.
227
+ * @param options.underlyingTokenAddress - The address of the underlying token.
228
+ * @param options.gasOptions - The gas options for the transaction.
229
+ * @param options.gasOptions.gasLimit - The gas limit for the transaction.
230
+ * @param options.gasOptions.gasBufferPct - The gas buffer percentage for the transaction.
231
+ * @param options.txOptions - The transaction options for the transaction.
232
+ * @returns A promise that resolves to the transaction hash.
233
+ */
234
+ export type EarnControllerExecuteLendingTokenApproveAction = {
235
+ type: `EarnController:executeLendingTokenApprove`;
236
+ handler: EarnController['executeLendingTokenApprove'];
237
+ };
238
+ /**
239
+ * Gets the allowance for a lending token.
240
+ *
241
+ * @param protocol - The protocol of the lending market.
242
+ * @param underlyingTokenAddress - The address of the underlying token.
243
+ * @returns A promise that resolves to the allowance.
244
+ */
245
+ export type EarnControllerGetLendingTokenAllowanceAction = {
246
+ type: `EarnController:getLendingTokenAllowance`;
247
+ handler: EarnController['getLendingTokenAllowance'];
248
+ };
249
+ /**
250
+ * Gets the maximum withdraw amount for a lending token's output token or shares if no output token.
251
+ *
252
+ * @param protocol - The protocol of the lending market.
253
+ * @param underlyingTokenAddress - The address of the underlying token.
254
+ * @returns A promise that resolves to the maximum withdraw amount.
255
+ */
256
+ export type EarnControllerGetLendingTokenMaxWithdrawAction = {
257
+ type: `EarnController:getLendingTokenMaxWithdraw`;
258
+ handler: EarnController['getLendingTokenMaxWithdraw'];
259
+ };
260
+ /**
261
+ * Gets the maximum deposit amount for a lending token.
262
+ *
263
+ * @param protocol - The protocol of the lending market.
264
+ * @param underlyingTokenAddress - The address of the underlying token.
265
+ * @returns A promise that resolves to the maximum deposit amount.
266
+ */
267
+ export type EarnControllerGetLendingTokenMaxDepositAction = {
268
+ type: `EarnController:getLendingTokenMaxDeposit`;
269
+ handler: EarnController['getLendingTokenMaxDeposit'];
270
+ };
271
+ /**
272
+ * Union of all EarnController action types.
273
+ */
274
+ export type EarnControllerMethodActions = EarnControllerRefreshPooledStakesAction | EarnControllerRefreshEarnEligibilityAction | EarnControllerRefreshPooledStakingVaultMetadataAction | EarnControllerRefreshPooledStakingVaultDailyApysAction | EarnControllerRefreshPooledStakingVaultApyAveragesAction | EarnControllerRefreshPooledStakingDataAction | EarnControllerRefreshLendingMarketsAction | EarnControllerRefreshLendingPositionsAction | EarnControllerRefreshLendingEligibilityAction | EarnControllerRefreshLendingDataAction | EarnControllerRefreshTronStakingApyAction | EarnControllerGetTronStakingApyAction | EarnControllerGetLendingPositionHistoryAction | EarnControllerGetLendingMarketDailyApysAndAveragesAction | EarnControllerExecuteLendingDepositAction | EarnControllerExecuteLendingWithdrawAction | EarnControllerExecuteLendingTokenApproveAction | EarnControllerGetLendingTokenAllowanceAction | EarnControllerGetLendingTokenMaxWithdrawAction | EarnControllerGetLendingTokenMaxDepositAction;
275
+ //# sourceMappingURL=EarnController-method-action-types.d.mts.map