import { PoolConfigParams } from "../types/index.mjs"; import { DeepBookConfig } from "../utils/config.mjs"; import * as _mysten_sui_transactions159 from "@mysten/sui/transactions"; import { Transaction, TransactionArgument } from "@mysten/sui/transactions"; //#region src/transactions/marginAdmin.d.ts /** * MarginAdminContract class for managing admin actions. */ declare class MarginAdminContract { #private; /** * @param {DeepBookConfig} config Configuration for MarginAdminContract */ constructor(config: DeepBookConfig); /** * @description Mint a maintainer cap * @returns A function that takes a Transaction object */ mintMaintainerCap: () => (tx: Transaction) => _mysten_sui_transactions159.TransactionResult; /** * @description Revoke a maintainer cap * @returns A function that takes a Transaction object */ revokeMaintainerCap: (maintainerCapId: string) => (tx: Transaction) => void; /** * @description Register a deepbook pool * @param {string} poolKey The key of the pool to be registered * @param {TransactionArgument} poolConfig The configuration of the pool * @returns A function that takes a Transaction object */ registerDeepbookPool: (poolKey: string, poolConfig: TransactionArgument) => (tx: Transaction) => void; /** * @description Enable a deepbook pool for margin trading * @param {string} poolKey The key of the pool to be enabled * @returns A function that takes a Transaction object */ enableDeepbookPool: (poolKey: string) => (tx: Transaction) => void; /** * @description Disable a deepbook pool from margin trading * @param {string} poolKey The key of the pool to be disabled * @returns A function that takes a Transaction object */ disableDeepbookPool: (poolKey: string) => (tx: Transaction) => void; /** * @description Update the risk parameters for a margin * @param {string} poolKey The key of the pool to be updated * @param {TransactionArgument} poolConfig The configuration of the pool * @returns A function that takes a Transaction object */ updateRiskParams: (poolKey: string, poolConfig: TransactionArgument) => (tx: Transaction) => void; /** * @description Set the price deviation tolerance for a pool. `tolerance` is * in 9-decimal float scaling (1.0 = `FLOAT_SCALAR`); the SDK applies the * scaling, so callers pass a human-readable fraction (e.g. `0.1` for 10%). * Requires the pool's current price to have been initialized via * `PoolProxyContract.updateCurrentPrice` first. * @param {string} poolKey The key of the pool to update * @param {number | bigint} tolerance Tolerance as a fraction (e.g. 0.1 for 10%) * @returns A function that takes a Transaction object */ setPriceTolerance: (poolKey: string, tolerance: number | bigint) => (tx: Transaction) => void; /** * @description Set the maximum acceptable Pyth price age (in milliseconds) * for a pool. Requires the pool's current price to have been initialized * via `PoolProxyContract.updateCurrentPrice` first. * @param {string} poolKey The key of the pool to update * @param {number | bigint} maxAgeMs Max age in milliseconds (raw u64) * @returns A function that takes a Transaction object */ setMaxPriceAge: (poolKey: string, maxAgeMs: number | bigint) => (tx: Transaction) => void; /** * @description Set the maximum lifetime (in milliseconds) of margin limit * orders for a pool. `pool_proxy::place_limit_order_v2` and * `place_reduce_only_limit_order_v2` clamp the user-supplied * `expire_timestamp` to at most `now + max_order_ttl_ms`, bounding margin * orders' exposure to stale-price exploitation. * @param {string} poolKey The key of the pool to update * @param {number | bigint} maxOrderTtlMs Max order TTL in milliseconds (raw u64) * @returns A function that takes a Transaction object */ setMaxOrderTtl: (poolKey: string, maxOrderTtlMs: number | bigint) => (tx: Transaction) => void; /** * @description Set the minimum risk ratio required to open a new position on * a pool. Distinct from the borrow floor: this gates position opening, not * borrowing. Stored in 9-decimal float scaling (1.0 = `FLOAT_SCALAR`); the SDK * applies the scaling, so callers pass a human-readable ratio (e.g. `1.25`). * @param {string} poolKey The key of the pool to update * @param {number | bigint} minOpenRiskRatio Minimum open risk ratio (e.g. 1.25) * @returns A function that takes a Transaction object */ setMinOpenRiskRatio: (poolKey: string, minOpenRiskRatio: number | bigint) => (tx: Transaction) => void; /** * @description Add the PythConfig to the margin registry * @param {Transaction} tx The transaction object * @param {TransactionArgument} config The config to be added * @returns A function that takes a Transaction object */ addConfig: (config: TransactionArgument) => (tx: Transaction) => void; /** * @description Remove the PythConfig from the margin registry * @param {Transaction} tx The transaction object * @returns A function that takes a Transaction object */ removeConfig: () => (tx: Transaction) => void; /** * @description Enable a specific version * @param {number} version The version to be enabled * @returns A function that takes a Transaction object */ enableVersion: (version: number) => (tx: Transaction) => void; /** * @description Disable a specific version * @param {number} version The version to be disabled * @returns A function that takes a Transaction object */ disableVersion: (version: number) => (tx: Transaction) => void; /** * @description Create a new pool config * @param {string} poolKey The key to identify the pool * @param {PoolConfigParams} poolConfigParams The parameters for the pool config * @returns A function that takes a Transaction object */ newPoolConfig: (poolKey: string, poolConfigParams: PoolConfigParams) => (tx: Transaction) => _mysten_sui_transactions159.TransactionResult; /** * @description Create a new pool config with leverage * @param {string} poolKey The key to identify the pool * @param {number} leverage The leverage for the pool * @returns A function that takes a Transaction object */ newPoolConfigWithLeverage: (poolKey: string, leverage: number) => (tx: Transaction) => void; /** * @description Create a new coin type data * @param {string} coinKey The key to identify the coin * @param {number} maxConfBps The maximum confidence interval in basis points * @param {number} maxEwmaDifferenceBps The maximum EWMA difference in basis points * @returns A function that takes a Transaction object */ newCoinTypeData: (coinKey: string, maxConfBps: number, maxEwmaDifferenceBps: number) => (tx: Transaction) => _mysten_sui_transactions159.TransactionResult; /** * @description Create a new Pyth config * @param {Array<{coinKey: string, maxConfBps: number, maxEwmaDifferenceBps: number}>} coinSetups The coins with their oracle config to be added to the Pyth config * @param {number} maxAgeSeconds The max age in seconds for the Pyth config * @returns A function that takes a Transaction object */ newPythConfig: (coinSetups: Array<{ coinKey: string; maxConfBps: number; maxEwmaDifferenceBps: number; }>, maxAgeSeconds: number) => (tx: Transaction) => _mysten_sui_transactions159.TransactionResult; /** * @description Mint a pause cap * @returns A function that takes a Transaction object */ mintPauseCap: () => (tx: Transaction) => _mysten_sui_transactions159.TransactionResult; /** * @description Revoke a pause cap * @param {string} pauseCapId The ID of the pause cap to revoke * @returns A function that takes a Transaction object */ revokePauseCap: (pauseCapId: string) => (tx: Transaction) => void; /** * @description Disable a version using pause cap * @param {number} version The version to disable * @param {string} pauseCapId The ID of the pause cap * @returns A function that takes a Transaction object */ disableVersionPauseCap: (version: number, pauseCapId: string) => (tx: Transaction) => void; /** * @description Withdraw the default referral fees (admin only) * The default referral at 0x0 doesn't have a SupplyReferral object * @param {string} coinKey The key to identify the margin pool * @returns A function that takes a Transaction object and returns a Coin */ adminWithdrawDefaultReferralFees: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions159.TransactionResult; } //#endregion export { MarginAdminContract }; //# sourceMappingURL=marginAdmin.d.mts.map