import { type Abi, type Address } from "viem"; import type { ERC4626Vault } from "../../entities/ERC4626Vault.js"; import type { AccountRewardStream } from "../../entities/Account.js"; import type { TransactionPlan } from "../executionService/index.js"; import type { ProviderService } from "../providerService/index.js"; import type { DeploymentService } from "../deploymentService/index.js"; import type { IABIService } from "../abiService/index.js"; import type { AccountRewardInfo, VaultAccountInfo } from "../accountService/adapters/accountOnchainAdapter/accountLensTypes.js"; import type { BuildRewardClaimAllPlanArgs, BuildRewardClaimPlanArgs, BuildRewardClaimsPlanArgs, FetchRewardStreamsArgs, BuildRewardStreamClaimPlanArgs, FuulClaimCheck, FuulTotals, IRewardsAdapter, IRewardsService, UserReward, VaultRewardInfo } from "./rewardsServiceTypes.js"; import { type IsActiveForViewerFn } from "./rewardCampaignEligibility.js"; /** * The row with the larger amount is not necessarily the row whose token the * upstream managed to resolve. Scaling an amount by the wrong decimals is * worse than taking the other row's token, so an unresolved token always * yields to a resolved one. */ export declare const preferResolvedRewardToken: (selected: UserReward, supplement: UserReward) => UserReward["token"]; /** * Collapse two rows of the same turtle stream into one. Exported because the * fallback adapter factory in `buildSDK` merges the V3 and direct rows before * this service ever sees them, and both reductions have to keep the same * token. */ export declare const mergeTurtleUserRewards: (base: UserReward, candidate: UserReward) => UserReward; /** * Return shape accepted from a legacy `setQueryVaultAccountInfo` callback. * * Everything `AccountRewardInfo` requires beyond the old `VaultAccountInfo` is * optional here, so a callback written against the old declared return type still * compiles. `account`, `vault`, and `enabledRewardsInfo` are the only fields * `fetchRewardStreams` reads. */ export interface LegacyRewardAccountInfo { account: Address; vault: Address; enabledRewardsInfo?: AccountRewardInfo["enabledRewardsInfo"]; timestamp?: bigint; balanceTracker?: Address; balanceForwarderEnabled?: boolean; balance?: bigint; } /** Callback signature the deprecated `setQueryVaultAccountInfo` still accepts. */ export type LegacyQueryRewardAccountInfoFn = (provider: ReturnType, accountLensAddress: Address, account: Address, vault: Address, abi?: Abi) => Promise; export declare class RewardsService implements IRewardsService { private adapter; private readonly addresses; private providerService?; private deploymentService?; private abiService?; private isActiveForViewer; constructor(adapter: IRewardsAdapter, addresses: { merklDistributorAddress: Address; fuulManagerAddress: Address; fuulFactoryAddress: Address; rewardStreamsAddress?: Address; }, options?: { isActiveForViewer?: IsActiveForViewerFn; abiService?: IABIService; }); setAdapter(adapter: IRewardsAdapter): void; setProviderService(providerService: ProviderService): void; setDeploymentService(deploymentService: DeploymentService): void; setABIService(abiService: IABIService): void; setIsActiveForViewer(fn: IsActiveForViewerFn): void; getIsActiveForViewer(): IsActiveForViewerFn; fetchVaultRewards(chainId: number, vaultAddress: Address): Promise; fetchChainRewards(chainId: number): Promise>; populateRewards(vaults: ERC4626Vault[]): Promise; fetchUserRewards(chainId: number, address: Address): Promise; fetchFuulTotals(address: Address, chainId?: number): Promise; fetchFuulClaimChecks(address: Address, chainId?: number): Promise; queryRewardAccountInfo: (provider: ReturnType, accountLensAddress: Address, account: Address, vault: Address, abi?: Abi) => Promise; setQueryRewardAccountInfo(fn: typeof this.queryRewardAccountInfo): void; /** * @deprecated Reads `getVaultAccountInfo`, which carries no reward data, so * `fetchRewardStreams` never used the result it returns. Kept for source * compatibility and unused internally; use `queryRewardAccountInfo`. */ queryVaultAccountInfo: (provider: ReturnType, accountLensAddress: Address, account: Address, vault: Address) => Promise; /** * @deprecated Use `setQueryRewardAccountInfo`. * * Retargets the same reader `fetchRewardStreams` uses, as it always did — * pointing this at the unused `queryVaultAccountInfo` property instead would * silently discard the override. The callback's return value is projected onto * `AccountRewardInfo`, so a callback written against the old declared * `VaultAccountInfo` return type still compiles: only the fields * `fetchRewardStreams` reads are required. */ setQueryVaultAccountInfo(fn: LegacyQueryRewardAccountInfoFn): void; fetchRewardStreams(args: FetchRewardStreamsArgs): Promise; buildClaimPlan(args: BuildRewardClaimPlanArgs): Promise; buildClaimPlans(args: BuildRewardClaimsPlanArgs): Promise; buildClaimAllPlan(args: BuildRewardClaimAllPlanArgs): Promise; buildRewardStreamClaimPlan(args: BuildRewardStreamClaimPlanArgs): TransactionPlan; private getProvider; private getDeployment; private resolveRewardStreamsAddress; private resolveAccountLensAddress; private buildContractCallBatchPlan; private buildMerklContractCall; private getTrustedMerklDistributorAddress; private validateBrevisClaimTarget; private getBrevisClaimAdapter; private isSameBrevisClaim; private arrayEquals; private buildBrevisContractCall; private buildFuulContractCall; private validateFuulClaimChecks; private readFuulClaimFee; private hydrateTurtleClaimableRewards; private buildTurtleContractCall; private fetchTurtleProof; private readTurtleCanClaim; getMerklDistributorAddress(): Address; getFuulManagerAddress(): Address; getFuulFactoryAddress(): Address; } //# sourceMappingURL=rewardsService.d.ts.map