import type { Transaction } from '@onelabs/sui/transactions'; import type { CreatePermissionlessPoolParams, PlaceLimitOrderParams, PlaceMarketOrderParams, SwapParams } from '../types/index.js'; import type { DeepBookConfig } from '../utils/config.js'; /** * DeepBookContract class for managing DeepBook operations. */ export declare class DeepBookContract { #private; /** * @param {DeepBookConfig} config Configuration for DeepBookContract */ constructor(config: DeepBookConfig); /** * @description Place a limit order * @param {PlaceLimitOrderParams} params Parameters for placing a limit order * @returns A function that takes a Transaction object */ placeLimitOrder: (params: PlaceLimitOrderParams) => (tx: Transaction) => void; /** * @description Place a market order * @param {PlaceMarketOrderParams} params Parameters for placing a market order * @returns A function that takes a Transaction object */ placeMarketOrder: (params: PlaceMarketOrderParams) => (tx: Transaction) => void; /** * @description Modify an existing order * @param {string} poolKey The key to identify the pool * @param {string} balanceManagerKey The key to identify the BalanceManager * @param {string} orderId Order ID to modify * @param {number} newQuantity New quantity for the order * @returns A function that takes a Transaction object */ modifyOrder: (poolKey: string, balanceManagerKey: string, orderId: string, newQuantity: number) => (tx: Transaction) => void; /** * @description Cancel an existing order * @param {string} poolKey The key to identify the pool * @param {string} balanceManagerKey The key to identify the BalanceManager * @param {string} orderId Order ID to cancel * @returns A function that takes a Transaction object */ cancelOrder: (poolKey: string, balanceManagerKey: string, orderId: string) => (tx: Transaction) => void; /** * @description Cancel all open orders for a balance manager * @param {string} poolKey The key to identify the pool * @param {string} balanceManagerKey The key to identify the BalanceManager * @returns A function that takes a Transaction object */ cancelAllOrders: (poolKey: string, balanceManagerKey: string) => (tx: Transaction) => void; /** * @description Withdraw settled amounts for a balance manager * @param {string} poolKey The key to identify the pool * @param {string} balanceManagerKey The key to identify the BalanceManager * @returns A function that takes a Transaction object */ withdrawSettledAmounts: (poolKey: string, balanceManagerKey: string) => (tx: Transaction) => void; /** * @description Add a deep price point for a target pool using a reference pool * @param {string} targetPoolKey The key to identify the target pool * @param {string} referencePoolKey The key to identify the reference pool * @returns A function that takes a Transaction object */ addDeepPricePoint: (targetPoolKey: string, referencePoolKey: string) => (tx: Transaction) => void; /** * @description Claim rebates for a balance manager * @param {string} poolKey The key to identify the pool * @param {string} balanceManagerKey The key to identify the BalanceManager * @returns A function that takes a Transaction object */ claimRebates: (poolKey: string, balanceManagerKey: string) => (tx: Transaction) => void; /** * @description Gets an order * @param {string} poolKey The key to identify the pool * @param {string} orderId Order ID to get * @returns A function that takes a Transaction object */ getOrder: (poolKey: string, orderId: string) => (tx: Transaction) => void; /** * @description Prepares a transaction to retrieve multiple orders from a specified pool. * @param {string} poolKey - The identifier key for the pool to retrieve orders from. * @param {string[]} orderIds - Array of order IDs to retrieve. * @returns {Function} A function that takes a Transaction object */ getOrders: (poolKey: string, orderIds: string[]) => (tx: Transaction) => void; /** * @description Burn DEEP tokens from the pool * @param {string} poolKey The key to identify the pool * @returns A function that takes a Transaction object */ burnDeep: (poolKey: string) => (tx: Transaction) => void; /** * @description Get the mid price for a pool * @param {string} poolKey The key to identify the pool * @returns A function that takes a Transaction object */ midPrice: (poolKey: string) => (tx: Transaction) => void; /** * @description Check if a pool is whitelisted * @param {string} poolKey The key to identify the pool * @returns A function that takes a Transaction object */ whitelisted: (poolKey: string) => (tx: Transaction) => void; /** * @description Get the quote quantity out for a given base quantity in * @param {string} poolKey The key to identify the pool * @param {number} baseQuantity Base quantity to convert * @returns A function that takes a Transaction object */ getQuoteQuantityOut: (poolKey: string, baseQuantity: number) => (tx: Transaction) => void; /** * @description Get the base quantity out for a given quote quantity in * @param {string} poolKey The key to identify the pool * @param {number} quoteQuantity Quote quantity to convert * @returns A function that takes a Transaction object */ getBaseQuantityOut: (poolKey: string, quoteQuantity: number) => (tx: Transaction) => void; /** * @description Get the quantity out for a given base or quote quantity * @param {string} poolKey The key to identify the pool * @param {number} baseQuantity Base quantity to convert * @param {number} quoteQuantity Quote quantity to convert * @returns A function that takes a Transaction object */ getQuantityOut: (poolKey: string, baseQuantity: number, quoteQuantity: number) => (tx: Transaction) => void; /** * @description Get open orders for a balance manager in a pool * @param {string} poolKey The key to identify the pool * @param {string} managerKey Key of the balance manager * @returns A function that takes a Transaction object */ accountOpenOrders: (poolKey: string, managerKey: string) => (tx: Transaction) => void; /** * @description Get level 2 order book specifying range of price * @param {string} poolKey The key to identify the pool * @param {number} priceLow Lower bound of the price range * @param {number} priceHigh Upper bound of the price range * @param {boolean} isBid Whether to get bid or ask orders * @returns A function that takes a Transaction object */ getLevel2Range: (poolKey: string, priceLow: number, priceHigh: number, isBid: boolean) => (tx: Transaction) => void; /** * @description Get level 2 order book ticks from mid-price for a pool * @param {string} poolKey The key to identify the pool * @param {number} tickFromMid Number of ticks from mid-price * @returns A function that takes a Transaction object */ getLevel2TicksFromMid: (poolKey: string, tickFromMid: number) => (tx: Transaction) => void; /** * @description Get the vault balances for a pool * @param {string} poolKey The key to identify the pool * @returns A function that takes a Transaction object */ vaultBalances: (poolKey: string) => (tx: Transaction) => void; /** * @description Get the pool ID by asset types * @param {string} baseType Type of the base asset * @param {string} quoteType Type of the quote asset * @returns A function that takes a Transaction object */ getPoolIdByAssets: (baseType: string, quoteType: string) => (tx: Transaction) => void; /** * @description Swap exact base amount for quote amount * @param {SwapParams} params Parameters for the swap * @returns A function that takes a Transaction object */ swapExactBaseForQuote: (params: SwapParams) => (tx: Transaction) => readonly [{ $kind: "NestedResult"; NestedResult: [number, number]; }, { $kind: "NestedResult"; NestedResult: [number, number]; }, { $kind: "NestedResult"; NestedResult: [number, number]; }]; /** * @description Swap exact quote amount for base amount * @param {SwapParams} params Parameters for the swap * @returns A function that takes a Transaction object */ swapExactQuoteForBase: (params: SwapParams) => (tx: Transaction) => readonly [{ $kind: "NestedResult"; NestedResult: [number, number]; }, { $kind: "NestedResult"; NestedResult: [number, number]; }, { $kind: "NestedResult"; NestedResult: [number, number]; }]; /** * @description Get the trade parameters for a given pool, including taker fee, maker fee, and stake required. * @param {string} poolKey Key of the pool * @returns A function that takes a Transaction object */ poolTradeParams: (poolKey: string) => (tx: Transaction) => void; /** * @description Get the book parameters for a given pool, including tick size, lot size, and min size. * @param {string} poolKey Key of the pool * @returns A function that takes a Transaction object */ poolBookParams: (poolKey: string) => (tx: Transaction) => void; /** * @description Get the account information for a given pool and balance manager * @param {string} poolKey Key of the pool * @param {string} managerKey The key of the BalanceManager * @returns A function that takes a Transaction object */ account: (poolKey: string, managerKey: string) => (tx: Transaction) => void; /** * @description Get the locked balance for a given pool and balance manager * @param {string} poolKey Key of the pool * @param {string} managerKey The key of the BalanceManager * @returns A function that takes a Transaction object */ lockedBalance: (poolKey: string, managerKey: string) => (tx: Transaction) => void; /** * @description Get the DEEP price conversion for a pool * @param {string} poolKey The key to identify the pool * @returns A function that takes a Transaction object */ getPoolDeepPrice: (poolKey: string) => (tx: Transaction) => void; /** * @description Create a new pool permissionlessly * @param {CreatePermissionlessPoolParams} params Parameters for creating permissionless pool * @returns A function that takes a Transaction object */ createPermissionlessPool: (params: CreatePermissionlessPoolParams) => (tx: Transaction) => void; }