import { Token } from "../../model/primitives.js"; import { MerklReward } from "../../model/rewards.js"; import "../../model/index.js"; import { RewardsSdk } from "./types.js"; import { Address } from "viem"; //#region src/sdk/rewards/helpers.d.ts /** A claimable amount of one token in one pool, before it is merged. */ export interface RewardPart { pool: Address; poolToken: Token; token: Token; value: bigint; /** USD price of one whole token, as the source sends it. */ price: number | string | null | undefined; } /** * The pool a source names, and its share token. A v3.1 pool is its own * ERC-4626 share token, so its address is the only token a campaign can name; * the `AddressMap` owns the casing a source writes it in. */ export declare function resolvePool(sdk: RewardsSdk): (address: string | undefined) => { pool: `0x${string}`; poolToken: Token; } | undefined; /** Sources send amounts as free-form strings, which `toBigInt` throws on. */ export declare function parseAmount(value: string | undefined): bigint | undefined; /** What is left of `total` after `claimed`, when anything is. */ export declare function remaining(total: bigint | undefined, claimed: bigint | undefined): bigint | undefined; /** * An incentive token is rarely protocol collateral, so the registry usually * has no entry for it — and both sources always name it. */ export declare function toRewardToken(sdk: RewardsSdk, address: Address, named: { symbol: string; name?: string; decimals: number; }): Token; /** * One reward per pool and incentive token, at the last part's price. Amounts * are summed raw and priced once at the end — pricing each part and adding the results would round * every one of them. */ export declare function mergeRewards(sdk: RewardsSdk, source: MerklReward["source"], parts: readonly RewardPart[]): MerklReward[]; //#endregion