import { TokenClassKey } from "@gala-chain/api"; import { GalaChainContext } from "@gala-chain/chaincode"; import BigNumber from "bignumber.js"; import { DexFeeConfig, DexPositionOwner, Pool } from "../../api/"; /** * * @param arr It will sort array for string * @returns It will return modified array with sorted according to lexiographical order */ export declare const sortString: (arr: string[]) => { sortedArr: string[]; isChanged: boolean; }; export declare function generateKeyFromClassKey(obj: TokenClassKey): string; /** * Validates and normalizes the order of two tokens for pool creation. * * Ensures that token0 is lexicographically smaller than token1 and that both tokens are different. * * @param token0 - The first token's class key. * @param token1 - The second token's class key. * @throws ValidationFailedError if tokens are the same or in the wrong order. * @returns A tuple containing the normalized token0 and token1 keys. */ export declare function validateTokenOrder(token0: TokenClassKey, token1: TokenClassKey): string[]; export declare function genBookMark(...params: string[] | number[]): string; export declare function splitBookmark(bookmark?: string): { chainBookmark: string; localBookmark: string; }; /** * Generates a tick range string in the format "lower:upper". */ export declare function genTickRange(tickLower: number, tickUpper: number): string; /** * Parses a tick range string and returns the lower and upper ticks as numbers. */ export declare function parseTickRange(tickRange: string): { tickLower: number; tickUpper: number; }; /** * Retrieves the global DEX protocol fee configuration. * * @param ctx - GalaChain context object. * @returns A Promise resolving to the DexFeeConfig object if found, or undefined if not set. */ export declare function fetchDexProtocolFeeConfig(ctx: GalaChainContext): Promise; /** * Retrieves the user position object for a given holder and pool. * * @param ctx - GalaChain context object. * @param positionHolder - The user's address or ID. * @param poolHash - Identifier for the pool. * @returns A Promise resolving to the user's DexPositionOwner object. */ export declare function getUserPositionIds(ctx: GalaChainContext, positionHolder: string, poolHash: string): Promise; /** * Retrieves the decimals for token0 and token1 from a given pool. * * @param ctx - GalaChain context object. * @param pool - The Pool object containing token class keys. * @returns A Promise resolving to a tuple of [token0Decimals, token1Decimals]. */ export declare function getTokenDecimalsFromPool(ctx: GalaChainContext, pool: Pool): Promise<[number, number]>; /** * Rounds a raw token amount to the token class's decimal precision. * * @param amount - The token amount as a string or BigNumber. * @param decimals - The number of decimals to round to (from token class). * @returns A BigNumber rounded down to the specified decimals. */ export declare function roundTokenAmount(amount: string | BigNumber, decimals: number, roundUp: boolean): BigNumber; //# sourceMappingURL=dexUtils.d.ts.map