import { CanPlaceLimitOrderParams, CanPlaceMarketOrderParams, CreatePermissionlessPoolParams, PlaceLimitOrderParams, PlaceMarketOrderParams, SwapParams, SwapWithManagerParams } from "../types/index.mjs"; import { DeepBookConfig } from "../utils/config.mjs"; import * as _mysten_sui_transactions137 from "@mysten/sui/transactions"; import { Transaction } from "@mysten/sui/transactions"; //#region src/transactions/deepbook.d.ts /** * DeepBookContract class for managing DeepBook operations. */ 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 multiple orders * @param {string} poolKey The key to identify the pool * @param {string} balanceManagerKey The key to identify the BalanceManager * @param {string[]} orderIds Array of order IDs to cancel * @returns A function that takes a Transaction object */ cancelOrders: (poolKey: string, balanceManagerKey: string, orderIds: string[]) => (tx: Transaction) => void; /** * @description Cancel an existing order, no-op if the order is not currently in the * balance manager's open orders (e.g. already filled, cancelled, expired-and-swept, * or not owned by this balance manager). Unlike `cancelOrder`, this will not abort * on unknown order ids. * @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 */ cancelLiveOrder: (poolKey: string, balanceManagerKey: string, orderId: string) => (tx: Transaction) => void; /** * @description Cancel multiple orders, skipping any order_id that is not currently in * the balance manager's open orders (e.g. already filled, cancelled, expired-and-swept, * or not owned by this balance manager). Duplicate ids in the input vector are handled * gracefully. Unlike `cancelOrders`, this will not abort on unknown order ids. * @param {string} poolKey The key to identify the pool * @param {string} balanceManagerKey The key to identify the BalanceManager * @param {string[]} orderIds Array of order IDs to cancel * @returns A function that takes a Transaction object */ cancelLiveOrders: (poolKey: string, balanceManagerKey: string, orderIds: 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 Withdraw settled amounts permissionlessly 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 */ withdrawSettledAmountsPermissionless: (poolKey: string, balanceManagerKey: string) => (tx: Transaction) => void; /** * @description Withdraw settled amounts permissionlessly for a balance manager by ID * @param {string} poolKey The key to identify the pool * @param {string} balanceManagerId The object ID of the BalanceManager * @returns A function that takes a Transaction object */ withdrawSettledAmountsManagerID: (poolKey: string, balanceManagerId: 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 Mint a referral for a pool * @param {string} poolKey The key to identify the pool * @param {number} multiplier The multiplier for the referral * @returns A function that takes a Transaction object */ mintReferral: (poolKey: string, multiplier: number) => (tx: Transaction) => void; /** * @description Update the referral multiplier for a pool (DeepBookPoolReferral) * @param {string} poolKey The key to identify the pool * @param {string} referral The referral (DeepBookPoolReferral) to update * @param {number} multiplier The multiplier for the referral * @returns A function that takes a Transaction object */ updatePoolReferralMultiplier: (poolKey: string, referral: string, multiplier: number) => (tx: Transaction) => void; /** * @description Claim the rewards for a referral (DeepBookPoolReferral) * @param {string} poolKey The key to identify the pool * @param {string} referral The referral (DeepBookPoolReferral) to claim the rewards for * @returns A function that takes a Transaction object */ claimPoolReferralRewards: (poolKey: string, referral: string) => (tx: Transaction) => { baseRewards: { NestedResult: [number, number]; $kind: "NestedResult"; }; quoteRewards: { NestedResult: [number, number]; $kind: "NestedResult"; }; deepRewards: { NestedResult: [number, number]; $kind: "NestedResult"; }; }; /** * @description Update the allowed versions for a pool * @param {string} poolKey The key of the pool to be updated * @returns A function that takes a Transaction object */ updatePoolAllowedVersions: (poolKey: 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 | bigint) => (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 | bigint) => (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 | bigint, quoteQuantity: number | bigint) => (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 | bigint, priceHigh: number | bigint, 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 [{ NestedResult: [number, number]; $kind: "NestedResult"; }, { NestedResult: [number, number]; $kind: "NestedResult"; }, { NestedResult: [number, number]; $kind: "NestedResult"; }]; /** * @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 [{ NestedResult: [number, number]; $kind: "NestedResult"; }, { NestedResult: [number, number]; $kind: "NestedResult"; }, { NestedResult: [number, number]; $kind: "NestedResult"; }]; /** * @description Swap exact quantity without a balance manager * @param {SwapParams & {isBaseToCoin: boolean}} params Parameters for the swap * @returns A function that takes a Transaction object */ swapExactQuantity: (params: SwapParams & { isBaseToCoin: boolean; }) => (tx: Transaction) => readonly [{ NestedResult: [number, number]; $kind: "NestedResult"; }, { NestedResult: [number, number]; $kind: "NestedResult"; }, { NestedResult: [number, number]; $kind: "NestedResult"; }]; /** * @description Swap exact base for quote with a balance manager * @param {SwapWithManagerParams} params Parameters for the swap * @returns A function that takes a Transaction object */ swapExactBaseForQuoteWithManager: (params: SwapWithManagerParams) => (tx: Transaction) => readonly [{ NestedResult: [number, number]; $kind: "NestedResult"; }, { NestedResult: [number, number]; $kind: "NestedResult"; }]; /** * @description Swap exact quote for base with a balance manager * @param {SwapWithManagerParams} params Parameters for the swap * @returns A function that takes a Transaction object */ swapExactQuoteForBaseWithManager: (params: SwapWithManagerParams) => (tx: Transaction) => readonly [{ NestedResult: [number, number]; $kind: "NestedResult"; }, { NestedResult: [number, number]; $kind: "NestedResult"; }]; /** * @description Swap exact quantity (base or quote) with a balance manager * @param {SwapWithManagerParams & {isBaseToCoin: boolean}} params Parameters for the swap * @returns A function that takes a Transaction object */ swapExactQuantityWithManager: (params: SwapWithManagerParams & { isBaseToCoin: boolean; }) => (tx: Transaction) => readonly [{ NestedResult: [number, number]; $kind: "NestedResult"; }, { NestedResult: [number, number]; $kind: "NestedResult"; }]; /** * @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; /** * @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 Get the balance manager IDs for a given owner * @param {string} owner The owner address to get balance manager IDs for * @returns A function that takes a Transaction object */ getBalanceManagerIds: (owner: string) => (tx: Transaction) => void; /** * @description Get the balances for a referral (DeepBookPoolReferral) * @param {string} poolKey The key to identify the pool * @param {string} referral The referral (DeepBookPoolReferral) to get the balances for * @returns A function that takes a Transaction object */ getPoolReferralBalances: (poolKey: string, referral: string) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Get the multiplier for a referral (DeepBookPoolReferral) * @param {string} poolKey The key to identify the pool * @param {string} referral The referral (DeepBookPoolReferral) to get the multiplier for * @returns A function that takes a Transaction object */ poolReferralMultiplier: (poolKey: string, referral: string) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Check if a pool is a stable pool * @param {string} poolKey The key to identify the pool * @returns A function that takes a Transaction object */ stablePool: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Check if a pool is registered * @param {string} poolKey The key to identify the pool * @returns A function that takes a Transaction object */ registeredPool: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Get the quote quantity out for a given base quantity using input token as fee * @param {string} poolKey The key to identify the pool * @param {number} baseQuantity Base quantity to convert * @returns A function that takes a Transaction object */ getQuoteQuantityOutInputFee: (poolKey: string, baseQuantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Get the base quantity out for a given quote quantity using input token as fee * @param {string} poolKey The key to identify the pool * @param {number} quoteQuantity Quote quantity to convert * @returns A function that takes a Transaction object */ getBaseQuantityOutInputFee: (poolKey: string, quoteQuantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Get the quantity out for a given base or quote quantity using input token as fee * @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 */ getQuantityOutInputFee: (poolKey: string, baseQuantity: number | bigint, quoteQuantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Get the base quantity needed to receive a target quote quantity * @param {string} poolKey The key to identify the pool * @param {number} targetQuoteQuantity Target quote quantity * @param {boolean} payWithDeep Whether to pay fees with DEEP * @returns A function that takes a Transaction object */ getBaseQuantityIn: (poolKey: string, targetQuoteQuantity: number | bigint, payWithDeep: boolean) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Get the quote quantity needed to receive a target base quantity * @param {string} poolKey The key to identify the pool * @param {number} targetBaseQuantity Target base quantity * @param {boolean} payWithDeep Whether to pay fees with DEEP * @returns A function that takes a Transaction object */ getQuoteQuantityIn: (poolKey: string, targetBaseQuantity: number | bigint, payWithDeep: boolean) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Get account order details for a balance manager * @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 */ getAccountOrderDetails: (poolKey: string, managerKey: string) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Get the DEEP required for an order * @param {string} poolKey The key to identify the pool * @param {number} baseQuantity Base quantity * @param {number} price Price * @returns A function that takes a Transaction object */ getOrderDeepRequired: (poolKey: string, baseQuantity: number | bigint, price: number | bigint) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Check if account exists for a balance manager * @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 */ accountExists: (poolKey: string, managerKey: string) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Get the next epoch trade parameters for a pool * @param {string} poolKey The key to identify the pool * @returns A function that takes a Transaction object */ poolTradeParamsNext: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Get the quorum for a pool * @param {string} poolKey The key to identify the pool * @returns A function that takes a Transaction object */ quorum: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Get the pool ID * @param {string} poolKey The key to identify the pool * @returns A function that takes a Transaction object */ poolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Check if a limit order can be placed * @param {CanPlaceLimitOrderParams} params Parameters for checking limit order validity * @returns A function that takes a Transaction object */ canPlaceLimitOrder: (params: CanPlaceLimitOrderParams) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Check if a market order can be placed * @param {CanPlaceMarketOrderParams} params Parameters for checking market order validity * @returns A function that takes a Transaction object */ canPlaceMarketOrder: (params: CanPlaceMarketOrderParams) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Check if market order params are valid * @param {string} poolKey The key to identify the pool * @param {number} quantity Quantity * @returns A function that takes a Transaction object */ checkMarketOrderParams: (poolKey: string, quantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; /** * @description Check if limit order params are valid * @param {string} poolKey The key to identify the pool * @param {number} price Price * @param {number} quantity Quantity * @param {number} expireTimestamp Expiration timestamp * @returns A function that takes a Transaction object */ checkLimitOrderParams: (poolKey: string, price: number | bigint, quantity: number | bigint, expireTimestamp: number) => (tx: Transaction) => _mysten_sui_transactions137.TransactionResult; } //#endregion export { DeepBookContract }; //# sourceMappingURL=deepbook.d.mts.map