/** * MetricAMM SDK - StateView Read Functions * Efficient batch read functions using the StateView contract */ import type { Address, PublicClient } from "viem"; import type { Slot0, Slot1, BinStateExternal, BinStatesExternal, BinStatesScaled, FeeConfig, PositionBinSharesResult } from "../types.js"; /** * Get slot0 data efficiently (all in one call) */ export declare function getSlot0(publicClient: PublicClient, stateViewAddress: Address, poolAddress: Address): Promise; /** * Get slot1 data (total scaled token amounts in bins) */ export declare function getSlot1(publicClient: PublicClient, stateViewAddress: Address, poolAddress: Address): Promise; /** * Get bin state with balances in external (native token decimal) units */ export declare function getBinStateExternal(publicClient: PublicClient, stateViewAddress: Address, poolAddress: Address, binIdx: number): Promise; /** * Get multiple bin states efficiently (batch read) */ export declare function getBinStatesExternal(publicClient: PublicClient, stateViewAddress: Address, poolAddress: Address, binIndices: number[]): Promise; /** * Get multiple bin states in scaled (internal) units (batch read) */ export declare function getBinStatesScaled(publicClient: PublicClient, stateViewAddress: Address, poolAddress: Address, binIndices: number[]): Promise; /** * Get bin total shares */ export declare function getBinTotalShares(publicClient: PublicClient, stateViewAddress: Address, poolAddress: Address, binIdx: number): Promise; /** * Get user position shares via StateView */ export declare function getPositionBinSharesFromStateView(publicClient: PublicClient, stateViewAddress: Address, poolAddress: Address, owner: Address, salt: bigint, binIdx: number): Promise; /** * Create a position bin key (matches Solidity's toPositionBinKey) * Layout: [address(160)] | [salt(80)] | [bin(16)] = 256 bits */ export declare function toPositionBinKey(owner: Address, salt: bigint, bin: number): `0x${string}`; /** * Get user position shares for a range of bins via StateView batch call * * @param publicClient - Viem public client * @param stateViewAddress - StateView contract address * @param poolAddress - Pool address * @param owner - Position owner (e.g., NFTPositionManager address) * @param salt - Position salt (e.g., NFT token ID) * @param lowerBin - Lower bin index (inclusive) * @param upperBin - Upper bin index (inclusive) * @returns Array of { binIdx, shares } for bins with non-zero shares */ export declare function getPositionBinSharesRange(publicClient: PublicClient, stateViewAddress: Address, poolAddress: Address, owner: Address, salt: bigint, lowerBin: number, upperBin: number): Promise; /** * Get user position shares for specific (possibly non-contiguous) bins via StateView batch call. * * Unlike getPositionBinSharesRange which scans a contiguous range, * this function queries exact bin indices you specify. * * @param publicClient - Viem public client * @param stateViewAddress - StateView contract address * @param poolAddress - Pool address * @param owner - Position owner address * @param salt - Position salt * @param bins - Array of specific bin indices to query (e.g., [-3, 1, 2]) * @returns Array of { binIdx, shares } for bins with non-zero shares */ export declare function getPositionBinSharesForBins(publicClient: PublicClient, stateViewAddress: Address, poolAddress: Address, owner: Address, salt: bigint, bins: number[]): Promise; /** * Get fee configuration */ export declare function getFeeConfig(publicClient: PublicClient, stateViewAddress: Address, poolAddress: Address): Promise; /** * Get price provider address */ export declare function getPriceProvider(publicClient: PublicClient, stateViewAddress: Address, poolAddress: Address): Promise
; /** * Get last trade timestamp */ export declare function getLastTradeTimestamp(publicClient: PublicClient, stateViewAddress: Address, poolAddress: Address): Promise; //# sourceMappingURL=read.d.ts.map