import { BalanceManager, Coin, MarginManager, MarginPool, Pool, PythConfig } from "../types/index.mjs"; import { CoinMap, DeepbookPackageIds, MarginPoolMap, PoolMap } from "./constants.mjs"; import { BalanceManagerContract } from "../transactions/balanceManager.mjs"; import { SuiClientTypes } from "@mysten/sui/client"; //#region src/utils/config.d.ts declare const FLOAT_SCALAR = 1000000000; declare const DEEP_SCALAR = 1000000; declare const MAX_TIMESTAMP = 1844674407370955161n; declare const PRICE_INFO_OBJECT_MAX_AGE_MS = 30000; declare const GAS_BUDGET = 250000000; declare const POOL_CREATION_FEE_DEEP = 500000000; declare class DeepBookConfig { #private; network: SuiClientTypes.Network; balanceManagers: { [key: string]: BalanceManager; }; marginManagers: { [key: string]: MarginManager; }; address: string; pyth: PythConfig; DEEPBOOK_PACKAGE_ID: string; REGISTRY_ID: string; DEEP_TREASURY_ID: string; MARGIN_PACKAGE_ID: string; MARGIN_V1: string; MARGIN_REGISTRY_ID: string; LIQUIDATION_PACKAGE_ID: string; adminCap?: string; marginAdminCap?: string; marginMaintainerCap?: string; balanceManager: BalanceManagerContract; constructor({ network, address, adminCap, marginAdminCap, marginMaintainerCap, balanceManagers, marginManagers, coins, pools, marginPools, packageIds, pyth, pythAccessToken }: { network: SuiClientTypes.Network; address: string; adminCap?: string; marginAdminCap?: string; marginMaintainerCap?: string; balanceManagers?: { [key: string]: BalanceManager; }; marginManagers?: { [key: string]: MarginManager; }; coins?: CoinMap; pools?: PoolMap; marginPools?: MarginPoolMap; packageIds?: DeepbookPackageIds; pyth?: PythConfig; /** * Bearer token for the Hermes serving Pyth's upgraded Core, which answers 401 * without one. Set this rather than `pyth` when the built-in state objects are * correct and only the credential is missing — `pyth` replaces the whole config, * so setting a token through it means restating the state object ids. * * Applied after `pyth`, so if both carry a token this one wins. */ pythAccessToken?: string; }); requirePyth(): void; /** * The Pyth feed id for a coin under the active deployment. * * Pairs with {@link getPriceInfoObjectId}: Hermes is queried by feed id and the Move * call takes the object, so the two must come from the same deployment or the update * lands on an object the on-chain feed-id check then rejects. */ getFeedId(coinKey: string): string; /** * The `PriceInfoObject` id for a coin on Pyth's upgraded Core. * * Throws rather than passing `undefined` into a move call: a feed may simply have no * object on the upgraded deployment yet, and the resulting on-chain abort * (`EPriceFeedIdMismatch`) does not say which coin was at fault. */ getPriceInfoObjectId(coinKey: string): string; getCoin(key: string): Coin; getPool(key: string): Pool; getMarginPool(key: string): MarginPool; /** * @description Get the balance manager by key * @param managerKey Key of the balance manager * @returns The BalanceManager object */ getBalanceManager(managerKey: string): BalanceManager; /** * @description Get the margin manager by key * @param managerKey Key of the margin manager * @returns The MarginManager object */ getMarginManager(managerKey: string): MarginManager; } //#endregion export { DEEP_SCALAR, DeepBookConfig, FLOAT_SCALAR, GAS_BUDGET, MAX_TIMESTAMP, POOL_CREATION_FEE_DEEP, PRICE_INFO_OBJECT_MAX_AGE_MS }; //# sourceMappingURL=config.d.mts.map