import { EMode, EModeIdentity, EModePool, Pool, TransactionResult } from './types.js'; import { DevInspectResults } from '@mysten/sui/jsonRpc'; import { Transaction } from '@mysten/sui/transactions'; import { BcsType } from '@mysten/sui/bcs'; import { default as BigNumber } from 'bignumber.js'; import { SuiPriceServiceConnection } from './pyth.js'; /** * Default Sui client for callers that do not pass one, matching v1 behavior: * a public mainnet fullnode (gRPC). Fine for development and low volume; * production should pass its own client (private endpoint / auth headers). */ export declare const suiClient: import('./sui').NaviSuiClient; export declare function devInspectTransaction(client: any, options: { transactionBlock?: Transaction | Uint8Array; transaction?: Transaction | Uint8Array; sender: string; }): Promise; export declare function getSuiObject(client: any, options: { id: string; options?: Record; }): Promise<{ error: { code: string; error: string; } | undefined; data?: undefined; } | { data: { objectId: any; version: any; digest: any; type: any; owner: any; previousTransaction: any; content: { dataType: string; type: any; fields: any; } | undefined; display: any; }; error?: undefined; }>; export declare function multiGetSuiObjects(client: any, options: { ids: string[]; options?: Record; }): Promise; /** * Wraps a function with singleton behavior to prevent duplicate concurrent calls * * This decorator ensures that if the same function is called with the same arguments * while a previous call is still pending, it returns the existing promise instead * of making a new call. * * @param fn - Function to wrap with singleton behavior * @returns Wrapped function with singleton behavior */ export declare function withSingleton Promise>(fn: T): T; /** * Wraps a function with caching behavior * * This decorator caches function results based on arguments and cache options. * It respects cache time settings and can be disabled per call. * * @param fn - Function to wrap with caching behavior * @returns Wrapped function with caching behavior */ export declare function withCache Promise>(fn: T): T; /** * Converts object keys from snake_case to camelCase recursively * * This function transforms all keys in an object (including nested objects and arrays) * from snake_case format to camelCase format. * * @param obj - Object to transform * @returns Object with camelCase keys */ export declare function camelize>(obj: T): T; /** * Parses a value for use in transaction building * * This function converts various value types into the appropriate format * for transaction building, handling both primitive types and existing * transaction results. * * @param value - Value to parse (string, number, boolean, or object) * @param format - Format function to apply to the value * @returns Transaction result in the appropriate format */ export declare function parseTxValue(value: string | number | boolean | object | null | undefined, format: any): TransactionResult; /** * Parses a pool value for use in transaction building * * This function handles different pool representations and converts them * to the appropriate transaction object format. * * @param tx - Transaction object to build * @param value - Pool value (string, Pool object, or TransactionResult) * @returns Transaction result representing the pool */ export declare function parseTxPoolValue(tx: Transaction, value: string | Pool | TransactionResult): TransactionResult; /** * Parses the result of a devInspectTransactionBlock call * * This function extracts and parses return values from transaction inspection * results using BCS (Binary Canonical Serialization) types. * * @param data - DevInspectResults from transaction inspection * @param parseTypes - Array of BCS types to parse the return values * @param options - Optional configuration including error handling * @returns Parsed result data */ export declare function parseDevInspectResult(data: DevInspectResults, parseTypes: BcsType[], options?: { throwError?: boolean; }): T; /** * Normalizes a coin type string using Sui's struct tag normalization * * @param coinType - Coin type string to normalize * @returns Normalized coin type string */ export declare function normalizeCoinType(coinType: string): string; /** * Processes health factor values from contract format to human-readable format * * This function converts the raw health factor value from the contract * (which is typically a large integer) to a more readable decimal format. * * @param hf - Raw health factor value from contract * @returns Processed health factor value */ export declare function processContractHealthFactor(hf: number): number; /** * Pyth price service connection for oracle price feeds * * This connection is used to fetch real-time price data from the Pyth network * for various assets in the lending protocol. */ export declare const suiPythConnection: SuiPriceServiceConnection; export declare const Rate_Decimals = 27; export declare const rayMathMulIndex: (amount: string | number, index: string | number) => BigNumber; export declare const requestHeaders: HeadersInit; export declare function getPoolsMap(pools: Pool[], key?: 'uniqueId' | 'id'): Record; export declare function getEmodesMap(emodes: EMode[], key?: 'uniqueId' | 'emodeId'): Record; export declare function poolToEModePool(pool: Pool, emodeIdentity: EModeIdentity): EModePool; export declare function parsePoolUID(uid: string): { marketKey: string; poolId: number; } | null; export declare function uuid(): string; //# sourceMappingURL=utils.d.ts.map