import { type Address } from "viem"; import type { BasicSwapCall, CurveAddLiquidity, CurveRemoveLiquidity, LegacyAdapterOperation, TokenAmount, Transfers } from "./legacyAdapterOperations.js"; import type { TokenTransfer } from "./types.js"; /** * Converts an ordered array of {@link TokenTransfer} into net signed balance * changes ({@link Transfers}) for the given credit account. */ export declare function toNetTransfers(transfers: TokenTransfer[], creditAccount: Address): Transfers; /** * Extracts the bare function name from a Solidity signature. * `"redeemDiff(uint256)"` → `"redeemDiff"`, `"getReward()"` → `"getReward"` */ export declare function fnSigToName(signature: string): string; /** * Splits signed transfer map into positive (inflows) and negative (outflows, stored as absolute values). * @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/account_operation.go#L274-L289 — Go `parsePosNegAmount` */ export declare function parsePosNegAmount(transfers: Transfers): { pos: TokenAmount[]; neg: TokenAmount[]; }; /** * Parses transfers into a basic swap (one token in, one token out). * Expects at most 1 positive and 1 negative entry. * @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/account_operation.go#L306-L321 — Go `SwapParse` */ export declare function swapFromTransfers(transfers: Transfers): BasicSwapCall; /** * Returns all positive-balance entries as reward token amounts. * @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type.go#L214-L226 — Go `getReward` handler */ export declare function rewardsFromTransfers(transfers: Transfers): TokenAmount[]; /** * Returns all transfer entries as token amounts (absolute values). * Used for ConvexWithdrawAndClaim where all transfers (including withdrawals) are reported. * @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type.go#L250-L261 */ export declare function allTransfersAsTokenAmounts(transfers: Transfers): TokenAmount[]; /** * Parses transfers into a CurveAddLiquidity operation. * Negative entries are the added liquidity tokens, the single positive entry is the LP token received. * @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type.go#L154-L164 */ export declare function curveAddLiquidityFromTransfers(transfers: Transfers): CurveAddLiquidity; /** * Parses transfers into a CurveRemoveLiquidity operation. * Positive entries are the received tokens, the single negative entry is the LP token burned. * @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type.go#L145-L153 */ export declare function curveRemoveLiquidityFromTransfers(transfers: Transfers): CurveRemoveLiquidity; /** * Shared classification logic for Curve adapter operations. * Uses {@link fnSigToName} to strip parameter types so matching works with both * bare names (`"exchange"`) and full signatures (`"exchange(int128,int128,uint256,uint256)"`). * Also handles `_diff_` adapter variants (e.g. `remove_diff_liquidity_one_coin`). * * @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type.go#L132-L164 * @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type_v3.go#L39-L104 */ export declare function classifyCurveOperation(functionName: string, transfers: Transfers): LegacyAdapterOperation | undefined;