import { ConfigValue, MoveStruct, RawTransactionArgument } from "../utils/index.mjs"; import * as _mysten_sui_bcs878 from "@mysten/sui/bcs"; import * as _mysten_sui_transactions606 from "@mysten/sui/transactions"; import { Transaction, TransactionArgument } from "@mysten/sui/transactions"; //#region src/contracts/deepbook_predict_orders/queue.d.ts declare const MarketQueue: MoveStruct<{ id: _mysten_sui_bcs878.BcsType, "bytes[32]">; desk_id: _mysten_sui_bcs878.BcsType, "bytes[32]">; expiry_market_id: _mysten_sui_bcs878.BcsType, "bytes[32]">; book: MoveStruct<{ orders: MoveStruct<{ id: _mysten_sui_bcs878.BcsType, "bytes[32]">; size: _mysten_sui_bcs878.BcsType; }, "0x2::table::Table">; next_id: _mysten_sui_bcs878.BcsType; resolve_head: _mysten_sui_bcs878.BcsType; payout_cursor: _mysten_sui_bcs878.BcsType; cohorts: _mysten_sui_bcs878.BcsType<{ tau_ms: bigint; deadline_ms: bigint; first_id: bigint; end_id: bigint; pyth_channel: number; committed: boolean; unfinished: bigint; }[], Iterable<{ tau_ms: string | number | bigint; deadline_ms: string | number | bigint; first_id: string | number | bigint; end_id: string | number | bigint; pyth_channel: number; committed: boolean; unfinished: string | number | bigint; }> & { length: number; }, string>; last_tau_ms: _mysten_sui_bcs878.BcsType; last_committed_tau_ms: _mysten_sui_bcs878.BcsType; last_deadline_ms: _mysten_sui_bcs878.BcsType; last_channel: _mysten_sui_bcs878.BcsType; per_account: MoveStruct<{ id: _mysten_sui_bcs878.BcsType, "bytes[32]">; size: _mysten_sui_bcs878.BcsType; }, "0x2::table::Table">; pending_mints: _mysten_sui_bcs878.BcsType; pending_sells: _mysten_sui_bcs878.BcsType; }, "@local-pkg/deepbook_predict_orders::order_queue::OrderBook">; /** Set by the `settle_step` call that emits `MarketPayoutsCompleted`. */ payouts_completed: _mysten_sui_bcs878.BcsType; }, "@local-pkg/deepbook_predict_orders::queue::MarketQueue">; interface PhaseDrainOptions { package?: string; arguments?: []; config?: { predictOrdersPackageId?: string; }; } declare function phaseDrain(options?: PhaseDrainOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface PhasePayOptions { package?: string; arguments?: []; config?: { predictOrdersPackageId?: string; }; } declare function phasePay(options?: PhasePayOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface PhaseDoneOptions { package?: string; arguments?: []; config?: { predictOrdersPackageId?: string; }; } declare function phaseDone(options?: PhaseDoneOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface QueueIdArguments { registryId: RawTransactionArgument; expiryMarketId: RawTransactionArgument; } interface QueueIdOptions { package?: string; arguments: QueueIdArguments | [registryId: RawTransactionArgument, expiryMarketId: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } /** * Return the ID of `expiry_market_id`'s queue under the queue registry * `registry_id`, whether or not it exists yet. For PTB construction. */ declare function queueId(options: QueueIdOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface IdArguments { queue: RawTransactionArgument; } interface IdOptions { package?: string; arguments: IdArguments | [queue: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } declare function id(options: IdOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface DeskIdArguments { queue: RawTransactionArgument; } interface DeskIdOptions { package?: string; arguments: DeskIdArguments | [queue: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } declare function deskId(options: DeskIdOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface ExpiryMarketIdArguments { queue: RawTransactionArgument; } interface ExpiryMarketIdOptions { package?: string; arguments: ExpiryMarketIdArguments | [queue: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } declare function expiryMarketId(options: ExpiryMarketIdOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface OrderArguments { queue: RawTransactionArgument; recordId: RawTransactionArgument; } interface OrderOptions { package?: string; arguments: OrderArguments | [queue: RawTransactionArgument, recordId: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } /** Return one record, or `none` for a missing or deleted record ID. */ declare function order(options: OrderOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface QueueHeadsArguments { queue: RawTransactionArgument; } interface QueueHeadsOptions { package?: string; arguments: QueueHeadsArguments | [queue: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } /** * Return `(resolve_head, next_id, last_tau_ms, last_committed_tau_ms)`. * `resolve_head` is a lower bound on the first unfinished record. */ declare function queueHeads(options: QueueHeadsOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface PayoutProgressArguments { queue: RawTransactionArgument; } interface PayoutProgressOptions { package?: string; arguments: PayoutProgressArguments | [queue: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } /** * Return `(payout_cursor, next_id, payouts_completed)`. The settlement payout walk * is finished once `payouts_completed` is set. */ declare function payoutProgress(options: PayoutProgressOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface WaitingCohortsArguments { queue: RawTransactionArgument; } interface WaitingCohortsOptions { package?: string; arguments: WaitingCohortsArguments | [queue: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } /** * Return * `(cohort count, oldest uncommitted τ, oldest uncommitted τ above last_committed_tau_ms)`. * The third value is the cohort the stuck gate's first rule watches. */ declare function waitingCohorts(options: WaitingCohortsOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface QueueStuckArguments { queue: RawTransactionArgument; desk?: RawTransactionArgument; } interface QueueStuckOptions { package?: string; arguments: QueueStuckArguments; config?: { orderDesk: ConfigValue; predictOrdersPackageId?: string; }; } /** * Whether placement would refuse a new order as stuck right now (both rules of the * stuck gate). Drives the app's "pricing delayed" banner. */ declare function queueStuck(options: QueueStuckOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface PendingCountsArguments { queue: RawTransactionArgument; } interface PendingCountsOptions { package?: string; arguments: PendingCountsArguments | [queue: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } /** * Return `(pending_mints, pending_sells)`, the unfinished orders counted against * the policy capacities. */ declare function pendingCounts(options: PendingCountsOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface WaitingOrdersArguments { queue: RawTransactionArgument; accountId: RawTransactionArgument; } interface WaitingOrdersOptions { package?: string; arguments: WaitingOrdersArguments | [queue: RawTransactionArgument, accountId: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } /** * Return the unfinished queued orders `account_id` holds in this queue, the count * the per-account cap checks. The settlement drain (`settle_step`) refunds without * lowering it, since no placement reads it once the market has expired, so after * expiry it can overstate what the account still has waiting. Read `order` for * each record's status instead. */ declare function waitingOrders(options: WaitingOrdersOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface OldestUnfinishedTauMsArguments { queue: RawTransactionArgument; } interface OldestUnfinishedTauMsOptions { package?: string; arguments: OldestUnfinishedTauMsArguments | [queue: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } /** Return τ of the oldest cohort with an unfinished order, for monitoring. */ declare function oldestUnfinishedTauMs(options: OldestUnfinishedTauMsOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface BuilderFeePerContractArguments { queue: RawTransactionArgument; recordId: RawTransactionArgument; } interface BuilderFeePerContractOptions { package?: string; arguments: BuilderFeePerContractArguments | [queue: RawTransactionArgument, recordId: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } /** * Return the builder fee per contract `record_id`'s order pays at its fill, in * FLOAT_SCALING of the $1 payout: the capped fee its receipt records, or `0` for a * missing record, a record holding no receipt or an open one, and an order that * names no builder. For SDK and devInspect reads of a waiting order. */ declare function builderFeePerContract(options: BuilderFeePerContractOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface QuoteRedeemOpenArguments { queue: RawTransactionArgument; market: RawTransactionArgument; Wrapper: RawTransactionArgument; pricer: TransactionArgument; recordId: RawTransactionArgument; closeQuantity: RawTransactionArgument; } interface QuoteRedeemOpenOptions { package?: string; arguments: QuoteRedeemOpenArguments | [queue: RawTransactionArgument, market: RawTransactionArgument, Wrapper: RawTransactionArgument, pricer: TransactionArgument, recordId: RawTransactionArgument, closeQuantity: RawTransactionArgument]; config?: { predictOrdersPackageId?: string; }; } interface QuoteRedeemOpenWithBuilderFeeArguments { queue: RawTransactionArgument; market: RawTransactionArgument; config?: RawTransactionArgument; pricer: TransactionArgument; recordId: RawTransactionArgument; closeQuantity: RawTransactionArgument; builderFeePerContract: RawTransactionArgument; } interface QuoteRedeemOpenWithBuilderFeeOptions { package?: string; arguments: QuoteRedeemOpenWithBuilderFeeArguments; config?: { protocolConfig: ConfigValue; predictOrdersPackageId?: string; }; } /** * `quote_redeem_open` for a sell that names a builder, through Predict's * `quote_close_with_builder_fee`: charges `builder_fee_per_contract`, in * FLOAT_SCALING of the $1 payout, capped at `protocol_config::builder_fee_cap` and * then at the redeem value left after the trading fee, as the fill charges it. * Changes nothing and aborts like `quote_redeem_open`. For SDK and devInspect * pricing before `enqueue_redeem_open_with_builder`. */ declare function quoteRedeemOpenWithBuilderFee(options: QuoteRedeemOpenWithBuilderFeeOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface CreateAndShareArguments { registry?: RawTransactionArgument; desk?: RawTransactionArgument; market: RawTransactionArgument; } interface CreateAndShareOptions { package?: string; arguments: CreateAndShareArguments; config?: { queueRegistry: ConfigValue; orderDesk: ConfigValue; predictOrdersPackageId?: string; }; } /** * Create and share `market`'s queue under `desk`. Permissionless; the caller pays * its storage. The queue's ID is derived from the desk's registry and the market, * so a second call for the same market aborts. Writes only the registry, which no * trading call reads, so creation never contends with trading on the desk. Aborts * `EWrongDesk` for another desk's registry. */ declare function createAndShare(options: CreateAndShareOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface EnqueueExactQuantityArguments { queue: RawTransactionArgument; market: RawTransactionArgument; wrapper: RawTransactionArgument; auth: TransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; propbookRegistry?: RawTransactionArgument; pyth: RawTransactionArgument; bsValues: RawTransactionArgument; bsSvi: RawTransactionArgument; lowerTick: RawTransactionArgument; higherTick: RawTransactionArgument; quantity: RawTransactionArgument; maxCost: RawTransactionArgument; maxProbability: RawTransactionArgument; } interface EnqueueExactQuantityOptions { package?: string; arguments: EnqueueExactQuantityArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; oracleRegistry: ConfigValue; predictOrdersPackageId?: string; }; } /** * Place a queued mint for an exact quantity, priced later at Pyth's signed price * for its τ. `max_cost` caps the all-in withdrawal and is mandatory; * `max_probability` caps the entry probability at τ. Escrows the budget, * `min(max_cost, quantity, available - order_fee)`, and the order fee, and returns * the new record ID. * * Aborts, charging nothing, when the queue refuses the order: the desk floor, * another desk's or market's queue (`EWrongDesk`, `EWrongMarket`), a stuck or full * queue (`EQueueStuck`, `EQueueFull`, `EAccountOrderCap`), τ at or past the cutoff * (`EPastCutoff`), an unlimited or zero `max_cost` (`EMintCostCapRequired`), or a * balance not above the order fee (`EFeeNotCovered`). Then Predict's `admit_mint` * applies its gates, the order's own limits at the clock, and the market's spare * cash. */ declare function enqueueExactQuantity(options: EnqueueExactQuantityOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface EnqueueExactQuantityWithBuilderArguments { queue: RawTransactionArgument; market: RawTransactionArgument; wrapper: RawTransactionArgument; auth: TransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; propbookRegistry?: RawTransactionArgument; pyth: RawTransactionArgument; bsValues: RawTransactionArgument; bsSvi: RawTransactionArgument; code: RawTransactionArgument; builderFeePerContract: RawTransactionArgument; lowerTick: RawTransactionArgument; higherTick: RawTransactionArgument; quantity: RawTransactionArgument; maxCost: RawTransactionArgument; maxProbability: RawTransactionArgument; } interface EnqueueExactQuantityWithBuilderOptions { package?: string; arguments: EnqueueExactQuantityWithBuilderArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; oracleRegistry: ConfigValue; predictOrdersPackageId?: string; }; } /** * `enqueue_exact_quantity` for an order that names a builder: `code` is the * builder code the trade pays and `builder_fee_per_contract` its fee per contract, * in FLOAT_SCALING of the $1 payout. Predict caps the fee at * `protocol_config::builder_fee_cap`, records it in the order's receipt, and * prices the order's limits with it, and the fill pays `quantity * fee`, rounded * down, to the code. Refuses orders like `enqueue_exact_quantity`. Returns the new * record ID. */ declare function enqueueExactQuantityWithBuilder(options: EnqueueExactQuantityWithBuilderOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface EnqueueExactAmountArguments { queue: RawTransactionArgument; market: RawTransactionArgument; wrapper: RawTransactionArgument; auth: TransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; propbookRegistry?: RawTransactionArgument; pyth: RawTransactionArgument; bsValues: RawTransactionArgument; bsSvi: RawTransactionArgument; lowerTick: RawTransactionArgument; higherTick: RawTransactionArgument; maxPremium: RawTransactionArgument; minQuantity: RawTransactionArgument; maxCost: RawTransactionArgument; } interface EnqueueExactAmountOptions { package?: string; arguments: EnqueueExactAmountArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; oracleRegistry: ConfigValue; predictOrdersPackageId?: string; }; } /** * Place a queued premium-budget mint: sized at τ under `max_premium`, at least * `min_quantity`, with the all-in withdrawal capped by the mandatory `max_cost`. * Escrows `min(max_cost, available - order_fee)` and the order fee. Refuses orders * like `enqueue_exact_quantity`. Returns the new record ID. */ declare function enqueueExactAmount(options: EnqueueExactAmountOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface EnqueueExactAmountWithBuilderArguments { queue: RawTransactionArgument; market: RawTransactionArgument; wrapper: RawTransactionArgument; auth: TransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; propbookRegistry?: RawTransactionArgument; pyth: RawTransactionArgument; bsValues: RawTransactionArgument; bsSvi: RawTransactionArgument; code: RawTransactionArgument; builderFeePerContract: RawTransactionArgument; lowerTick: RawTransactionArgument; higherTick: RawTransactionArgument; maxPremium: RawTransactionArgument; minQuantity: RawTransactionArgument; maxCost: RawTransactionArgument; } interface EnqueueExactAmountWithBuilderOptions { package?: string; arguments: EnqueueExactAmountWithBuilderArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; oracleRegistry: ConfigValue; predictOrdersPackageId?: string; }; } /** * `enqueue_exact_amount` for an order that names a builder, charging the capped * `builder_fee_per_contract` to `code` like `enqueue_exact_quantity_with_builder`. * The fee is inside the `max_cost` withdrawal cap. Returns the new record ID. */ declare function enqueueExactAmountWithBuilder(options: EnqueueExactAmountWithBuilderOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface EnqueueExactCostArguments { queue: RawTransactionArgument; market: RawTransactionArgument; wrapper: RawTransactionArgument; auth: TransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; propbookRegistry?: RawTransactionArgument; pyth: RawTransactionArgument; bsValues: RawTransactionArgument; bsSvi: RawTransactionArgument; lowerTick: RawTransactionArgument; higherTick: RawTransactionArgument; maxCost: RawTransactionArgument; minQuantity: RawTransactionArgument; } interface EnqueueExactCostOptions { package?: string; arguments: EnqueueExactCostArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; oracleRegistry: ConfigValue; predictOrdersPackageId?: string; }; } /** * Place a queued all-in-budget mint: sized at τ so the all-in cost fits * `max_cost`, at least `min_quantity`. Escrows * `min(max_cost, available - order_fee)` and the order fee. `max_cost` is * mandatory here too: the unlimited value is refused. Refuses orders like * `enqueue_exact_quantity`. Returns the new record ID. */ declare function enqueueExactCost(options: EnqueueExactCostOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface EnqueueExactCostWithBuilderArguments { queue: RawTransactionArgument; market: RawTransactionArgument; wrapper: RawTransactionArgument; auth: TransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; propbookRegistry?: RawTransactionArgument; pyth: RawTransactionArgument; bsValues: RawTransactionArgument; bsSvi: RawTransactionArgument; code: RawTransactionArgument; builderFeePerContract: RawTransactionArgument; lowerTick: RawTransactionArgument; higherTick: RawTransactionArgument; maxCost: RawTransactionArgument; minQuantity: RawTransactionArgument; } interface EnqueueExactCostWithBuilderOptions { package?: string; arguments: EnqueueExactCostWithBuilderArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; oracleRegistry: ConfigValue; predictOrdersPackageId?: string; }; } /** * `enqueue_exact_cost` for an order that names a builder, charging the capped * `builder_fee_per_contract` to `code` like `enqueue_exact_quantity_with_builder`. * The fill sizes the order so the fee fits inside `max_cost`. Returns the new * record ID. */ declare function enqueueExactCostWithBuilder(options: EnqueueExactCostWithBuilderOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface EnqueueRedeemOpenArguments { queue: RawTransactionArgument; market: RawTransactionArgument; wrapper: RawTransactionArgument; auth: TransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; propbookRegistry?: RawTransactionArgument; pyth: RawTransactionArgument; bsValues: RawTransactionArgument; bsSvi: RawTransactionArgument; recordId: RawTransactionArgument; closeQuantity: RawTransactionArgument; minProbability: RawTransactionArgument; minProceeds: RawTransactionArgument; } interface EnqueueRedeemOpenOptions { package?: string; arguments: EnqueueRedeemOpenArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; oracleRegistry: ConfigValue; predictOrdersPackageId?: string; }; } /** * Place a queued early sell of `close_quantity` of an Open record's position. * `record_id` is the record's queue ID, not the position's order ID. The source * record must belong to this account (`ENotRecordOwner`) and be Open * (`ERecordNotOpen`, also for a missing ID). It is marked Closed and its receipt * and whole position move into the new record until the sell fills or refunds. * `min_probability` and `min_proceeds` are the close-side floors at τ. Returns the * new record ID. * * Escrows only the order fee, so a balance equal to it is enough. Refuses a sell * below `min_sell_quantity` or one leaving a remainder below it (`EBelowMinSell`), * and otherwise like `enqueue_exact_quantity`. Predict's `admit_sell` is open * during the trading pause and a market mint pause and has no spare-cash check: * the keeper funds the market before τ, and resolve refunds a sell the market * still cannot cover. */ declare function enqueueRedeemOpen(options: EnqueueRedeemOpenOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface EnqueueRedeemOpenWithBuilderArguments { queue: RawTransactionArgument; market: RawTransactionArgument; wrapper: RawTransactionArgument; auth: TransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; propbookRegistry?: RawTransactionArgument; pyth: RawTransactionArgument; bsValues: RawTransactionArgument; bsSvi: RawTransactionArgument; code: RawTransactionArgument; builderFeePerContract: RawTransactionArgument; recordId: RawTransactionArgument; closeQuantity: RawTransactionArgument; minProbability: RawTransactionArgument; minProceeds: RawTransactionArgument; } interface EnqueueRedeemOpenWithBuilderOptions { package?: string; arguments: EnqueueRedeemOpenWithBuilderArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; oracleRegistry: ConfigValue; predictOrdersPackageId?: string; }; } /** * `enqueue_redeem_open` for a sell that names a builder: `code` is the builder * code the sell pays and `builder_fee_per_contract` its fee per contract, in * FLOAT_SCALING of the $1 payout. Predict caps the fee at * `protocol_config::builder_fee_cap`, records it in the order's receipt, and * checks `min_proceeds` with it, and the fill pays `close_quantity * fee`, rounded * down, to the code, capped at the redeem value left after the trading fee. * Refuses sells like `enqueue_redeem_open`. Returns the new record ID. */ declare function enqueueRedeemOpenWithBuilder(options: EnqueueRedeemOpenWithBuilderOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface CommitArguments { queue: RawTransactionArgument; market: RawTransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; updates: TransactionArgument; } interface CommitOptions { package?: string; arguments: CommitArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; predictOrdersPackageId?: string; }; } /** * Attach verified Pyth Lazer prices to the waiting cohorts whose τ they match. * Permissionless. Each update must come from the Pyth Lazer verifier earlier in * the same PTB; their order in `updates` does not matter. An update that matches * no waiting cohort is skipped. * * Matching reads only the inline cohort list and picks at most one update per * waiting cohort before its deadline: the one stamped exactly its τ on its * channel, or else, once the price buffer is above zero and now is at least * `gap_wait_ms` past τ, the one stamped one tick of the cohort's own channel * later. Each matched cohort then commits whole or not at all: one price per feed * is decoded through `lazer_price::from_update`, every Pending order is checked * against it before any is written, and an empty price, a price generated before * τ, or an envelope after now leaves the cohort for a later commit or its deadline * refund. The decode aborts on an update that lacks an order's feed or one of its * properties, because the caller passed the wrong update. Each committed mint * escrows the subsidy Predict reserves for it. * * Uses Lazer's v1 `Update`, which Pyth marked deprecated on Mainnet but still * serves; v2 arrives with a later library constructor. */ declare function commit(options: CommitOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface ResolveArguments { queue: RawTransactionArgument; market: RawTransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; maxOrders: RawTransactionArgument; } interface ResolveOptions { package?: string; arguments: ResolveArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; predictOrdersPackageId?: string; }; } /** * Fill or refund committed orders in τ order, visiting at most `max_orders` * records, and never more than 450 (each emits up to two events, and Sui caps a * transaction at 1,024). Permissionless. Returns how many orders it finished. * * Walks the cohorts in τ order and loads only committed or overdue ones; a cohort * still waiting for its price is skipped without loading a record. Every record * visited counts against `max_orders`, finished or missing ones included. The 450 * cap bounds events, not loaded objects (`MAX_ORDERS_PER_CALL`), so the caller * sizes `max_orders` to stay inside Sui's per-transaction object limit. An order * at or past its deadline is refunded (reason 5), never filled. A committed order * goes to Predict's `try_fill`, which fills it or returns the refund reason (1, 2, * 4, 8, or 9); the queue returns the escrow Predict hands back to the trader, or * parks it in the record when the receive address is denied. Returns 0 on a * settled market, whose waiting orders the settlement drain refunds. */ declare function resolve(options: ResolveOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface RefundArguments { queue: RawTransactionArgument; market: RawTransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; maxOrders: RawTransactionArgument; } interface RefundOptions { package?: string; arguments: RefundArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; predictOrdersPackageId?: string; }; } /** * Refund waiting orders at or past their deadline (reason 5), visiting at most * `max_orders` records, refunded or not, and never more than 450, as `resolve` * does. It walks the cohorts in τ order and stops at the first one not yet due, * since deadlines never decrease along the queue. Permissionless, and available * while Predict is frozen or this companion's witness is disabled: Predict's * `release` checks only its version floor. A refund the receive address cannot * take is parked in its record. Returns how many orders it refunded: `0`, without * aborting, when none is due. */ declare function refund(options: RefundOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface AdminRefundArguments { queue: RawTransactionArgument; market: RawTransactionArgument; AdminCap: RawTransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; recordIds: RawTransactionArgument>; } interface AdminRefundOptions { package?: string; arguments: AdminRefundArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; predictOrdersPackageId?: string; }; } /** * Refund the listed waiting orders at once (reason 7), wherever they sit in the * queue. Predict's `AdminCap` only, and available while Predict is frozen. Missing * and finished IDs are skipped, and a refund the receive address cannot take is * parked in its record. */ declare function adminRefund(options: AdminRefundOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface CleanupArguments { queue: RawTransactionArgument; market: RawTransactionArgument; desk?: RawTransactionArgument; recordIds: RawTransactionArgument>; } interface CleanupOptions { package?: string; arguments: CleanupArguments; config?: { orderDesk: ConfigValue; predictOrdersPackageId?: string; }; } /** * Delete Refunded and Closed records of a settled market. Permissionless; the * storage rebate goes to the caller. Missing IDs, other statuses, and records * still holding a receipt or funds (parked funds included, until `claim_parked`) * are skipped; `QueuedOrdersCleaned` is emitted only when a record was deleted. * Takes `&Clock` only to stamp the event. */ declare function cleanup(options: CleanupOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface SettleStepArguments { queue: RawTransactionArgument; market: RawTransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; } interface SettleStepOptions { package?: string; arguments: SettleStepArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; predictOrdersPackageId?: string; }; } /** * Run one bounded settlement phase on this queue and return the phase the queue is * in afterwards, which the next call runs (`phase_drain`, `phase_pay`, or * `phase_done`). Permissionless; aborts `EMarketNotExpired` before expiry. * * - DRAIN, while unfinished orders remain: refund them in τ order with reason 5, * visiting at most the policy's `settle_refund_batch` records, refunded or not. * No pruning and no account rows, so each refund loads its record alone. A * refund the receive address cannot take is parked in its record. Runs before * and after Predict settles, and while Predict is frozen. * - PAY, once nothing is unfinished and Predict has settled the market: from the * payout cursor, visit at most `settle_payout_batch` records. Each Open record * is paid its settled payout through `try_pay_settled` (zero for a loser), * marked Closed, and reported with `OpenRecordSettled`. A record the market * cannot pay, or whose receive address is denied, stays Open with * `OpenRecordPayoutSkipped`, and `pay_open` pays it later. Before Predict * settles, a PAY call changes nothing. * - DONE: the call whose walk reaches the last record emits * `MarketPayoutsCompleted`; later calls change nothing. Skipped records are * still paid through `pay_open`. * * The keeper sends one call per transaction until it returns `phase_done()`. */ declare function settleStep(options: SettleStepOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface PayOpenArguments { queue: RawTransactionArgument; market: RawTransactionArgument; desk?: RawTransactionArgument; config?: RawTransactionArgument; recordId: RawTransactionArgument; } interface PayOpenOptions { package?: string; arguments: PayOpenArguments; config?: { orderDesk: ConfigValue; protocolConfig: ConfigValue; predictOrdersPackageId?: string; }; } /** * Pay one Open record of a settled market its settled payout through Predict's * `try_pay_settled`, at any time after settlement, before or after `settle_step` * completes: the record the payout walk skipped because the market was short of * cash or its receive address was denied. Permissionless. Emits * `OpenRecordSettled` and closes the record, or emits `OpenRecordPayoutSkipped` * and leaves it Open if the cause persists. A missing or non-Open record is left * alone. Aborts `EMarketNotSettled` before Predict settles the market. */ declare function payOpen(options: PayOpenOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; interface ClaimParkedArguments { queue: RawTransactionArgument; desk?: RawTransactionArgument; recordId: RawTransactionArgument; } interface ClaimParkedOptions { package?: string; arguments: ClaimParkedArguments; config?: { orderDesk: ConfigValue; predictOrdersPackageId?: string; }; } /** * Send a finished record's parked funds, change or a refund its receive address * could not take, to that address once a send would go through (`denied` is * false). Permissionless: the funds go only to the record's own receive address. * Emits `RecordFundsClaimed` and returns the amount sent, or returns `0` and * changes nothing for a missing or unfinished record, one with nothing parked, or * an address still denied. */ declare function claimParked(options: ClaimParkedOptions): (tx: Transaction) => _mysten_sui_transactions606.TransactionResult; //#endregion export { AdminRefundArguments, AdminRefundOptions, BuilderFeePerContractArguments, BuilderFeePerContractOptions, ClaimParkedArguments, ClaimParkedOptions, CleanupArguments, CleanupOptions, CommitArguments, CommitOptions, CreateAndShareArguments, CreateAndShareOptions, DeskIdArguments, DeskIdOptions, EnqueueExactAmountArguments, EnqueueExactAmountOptions, EnqueueExactAmountWithBuilderArguments, EnqueueExactAmountWithBuilderOptions, EnqueueExactCostArguments, EnqueueExactCostOptions, EnqueueExactCostWithBuilderArguments, EnqueueExactCostWithBuilderOptions, EnqueueExactQuantityArguments, EnqueueExactQuantityOptions, EnqueueExactQuantityWithBuilderArguments, EnqueueExactQuantityWithBuilderOptions, EnqueueRedeemOpenArguments, EnqueueRedeemOpenOptions, EnqueueRedeemOpenWithBuilderArguments, EnqueueRedeemOpenWithBuilderOptions, ExpiryMarketIdArguments, ExpiryMarketIdOptions, IdArguments, IdOptions, MarketQueue, OldestUnfinishedTauMsArguments, OldestUnfinishedTauMsOptions, OrderArguments, OrderOptions, PayOpenArguments, PayOpenOptions, PayoutProgressArguments, PayoutProgressOptions, PendingCountsArguments, PendingCountsOptions, PhaseDoneOptions, PhaseDrainOptions, PhasePayOptions, QueueHeadsArguments, QueueHeadsOptions, QueueIdArguments, QueueIdOptions, QueueStuckArguments, QueueStuckOptions, QuoteRedeemOpenOptions, QuoteRedeemOpenWithBuilderFeeArguments, QuoteRedeemOpenWithBuilderFeeOptions, RefundArguments, RefundOptions, ResolveArguments, ResolveOptions, SettleStepArguments, SettleStepOptions, WaitingCohortsArguments, WaitingCohortsOptions, WaitingOrdersArguments, WaitingOrdersOptions, adminRefund, builderFeePerContract, claimParked, cleanup, commit, createAndShare, deskId, enqueueExactAmount, enqueueExactAmountWithBuilder, enqueueExactCost, enqueueExactCostWithBuilder, enqueueExactQuantity, enqueueExactQuantityWithBuilder, enqueueRedeemOpen, enqueueRedeemOpenWithBuilder, expiryMarketId, id, oldestUnfinishedTauMs, order, payOpen, payoutProgress, pendingCounts, phaseDone, phaseDrain, phasePay, queueHeads, queueId, queueStuck, quoteRedeemOpenWithBuilderFee, refund, resolve, settleStep, waitingCohorts, waitingOrders }; //# sourceMappingURL=queue.d.mts.map