import type { AccountsControllerGetSelectedAccountAction, AccountsControllerSelectedAccountChangeEvent } from "@metamask/accounts-controller"; import type { ControllerGetStateAction, ControllerStateChangeEvent, RestrictedControllerMessenger } from "@metamask/base-controller"; import { BaseController } from "@metamask/base-controller"; import type { NetworkControllerStateChangeEvent } from "@metamask/network-controller"; import type { NetworkControllerGetNetworkClientByIdAction, NetworkControllerGetStateAction } from "@metamask/network-controller"; import { type PooledStake, type VaultData } from "@metamask/stake-sdk"; export declare const controllerName = "EarnController"; export type PooledStakingState = { pooledStakes: PooledStake; exchangeRate: string; vaultData: VaultData; isEligible: boolean; }; export type StablecoinLendingState = { vaults: StablecoinVault[]; }; export type StablecoinVault = { symbol: string; name: string; chainId: number; tokenAddress: string; vaultAddress: string; currentAPY: string; supply: string; liquidity: string; }; export type EarnControllerState = { pooled_staking: PooledStakingState; stablecoin_lending?: StablecoinLendingState; lastUpdated: number; }; /** * Gets the default state for the EarnController. * * @returns The default EarnController state. */ export declare function getDefaultEarnControllerState(): EarnControllerState; /** * The action which can be used to retrieve the state of the EarnController. */ export type EarnControllerGetStateAction = ControllerGetStateAction; /** * All actions that EarnController registers, to be called externally. */ export type EarnControllerActions = EarnControllerGetStateAction; /** * All actions that EarnController calls internally. */ export type AllowedActions = NetworkControllerGetNetworkClientByIdAction | NetworkControllerGetStateAction | AccountsControllerGetSelectedAccountAction; /** * The event that EarnController publishes when updating state. */ export type EarnControllerStateChangeEvent = ControllerStateChangeEvent; /** * All events that EarnController publishes, to be subscribed to externally. */ export type EarnControllerEvents = EarnControllerStateChangeEvent; /** * All events that EarnController subscribes to internally. */ export type AllowedEvents = AccountsControllerSelectedAccountChangeEvent | NetworkControllerStateChangeEvent; /** * The messenger which is restricted to actions and events accessed by * EarnController. */ export type EarnControllerMessenger = RestrictedControllerMessenger; /** * EarnController manages DeFi earning opportunities across different protocols and chains. */ export declare class EarnController extends BaseController { #private; constructor({ messenger, state, }: { messenger: EarnControllerMessenger; state?: Partial; }); /** * Refreshes the pooled stakes data for the current account. * Fetches updated stake information including lifetime rewards, assets, and exit requests * from the staking API service and updates the state. * * @returns A promise that resolves when the stakes data has been updated */ refreshPooledStakes(): Promise; /** * Refreshes the staking eligibility status for the current account. * Updates the eligibility status in the controller state based on the location and address blocklist for compliance. * * @returns A promise that resolves when the eligibility status has been updated */ refreshStakingEligibility(): Promise; /** * Refreshes vault data for the current chain. * Updates the vault data in the controller state including APY, capacity, * fee percentage, total assets, and vault address. * * @returns A promise that resolves when the vault data has been updated */ refreshVaultData(): Promise; /** * Refreshes all pooled staking related data including stakes, eligibility, and vault data. * This method allows partial success, meaning some data may update while other requests fail. * All errors are collected and thrown as a single error message. * * @returns A promise that resolves when all possible data has been updated * @throws {Error} If any of the refresh operations fail, with concatenated error messages */ refreshPooledStakingData(): Promise; } //# sourceMappingURL=EarnController.d.cts.map