{"version":3,"file":"queue_events.mjs","names":["order_queue.OrderRequest","order_queue.HeldPosition","order_queue.OrderTiming","pricing.VolSnapshot","delayed_execution_config.DelayedExecutionPolicy"],"sources":["../../../src/contracts/deepbook_predict_orders/queue_events.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * The order-flow companion's events. Predict still emits `OrderMinted` and\n * `LiveOrderRedeemed` from its fills; these sit next to them. The placement, fill,\n * and refund events carry the market's post-call cash, required cash, and waiting\n * cash need, so the keeper tracks spare cash from events alone.\n */\n\nimport { MoveStruct } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { U64, U256 } from '../../bcs/integers.js';\nimport * as order_queue from './order_queue.js';\nimport * as pricing from './deps/deepbook_predict/pricing.js';\nimport * as delayed_execution_config from './delayed_execution_config.js';\nconst $moduleName = '@local-pkg/deepbook_predict_orders::queue_events';\nexport const OrderEnqueued = new MoveStruct({\n\tname: `${$moduleName}::OrderEnqueued`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\trecord_id: U64,\n\t\taccount_id: bcs.Address,\n\t\t/** An `order_queue` kind code. */\n\t\tkind: bcs.u8(),\n\t\trequest: order_queue.OrderRequest,\n\t\t/** The position a sell moved into the record; zero for a mint. */\n\t\tposition: order_queue.HeldPosition,\n\t\ttiming: order_queue.OrderTiming,\n\t\tvol: pricing.VolSnapshot,\n\t\tbudget: U64,\n\t\torder_fee: U64,\n\t\t/** The order's worst-case cash need, added to the waiting total. */\n\t\tcash_need: U64,\n\t\tsubsidy_bound: U64,\n\t\tbuilder_code_id: bcs.option(bcs.Address),\n\t\treferrer_account_id: bcs.option(bcs.Address),\n\t\t/** The Open record a sell took its position from. `none` for a mint. */\n\t\tsource_record_id: bcs.option(U64),\n\t\t/** The market's cash, required cash, and waiting cash need after the call. */\n\t\tmarket_cash: U64,\n\t\trequired_cash: U64,\n\t\twaiting_cash_need: U64,\n\t\tonchain_timestamp_ms: U64,\n\t},\n});\nexport const CohortCommitted = new MoveStruct({\n\tname: `${$moduleName}::CohortCommitted`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\ttau_ms: U64,\n\t\t/** The update's envelope in ms: τ, or the backup tick one channel tick later. */\n\t\ttick_ms: U64,\n\t\tfirst_record_id: U64,\n\t\tlast_record_id: U64,\n\t\t/** The committed price of the cohort's first order, normalized to 1e9. */\n\t\tspot: U64,\n\t\t/** That price's own update time, in µs. */\n\t\tgeneration_us: U64,\n\t\tpyth_source_id: bcs.u32(),\n\t\tpyth_channel: bcs.u8(),\n\t\t/** The transaction sender, so monitoring sees commits by third parties. */\n\t\tsender: bcs.Address,\n\t\tonchain_timestamp_ms: U64,\n\t},\n});\nexport const QueuedOrderFilled = new MoveStruct({\n\tname: `${$moduleName}::QueuedOrderFilled`,\n\tfields: {\n\t\t/** The market's cash, required cash, and waiting cash need after the call. */\n\t\tmarket_cash: U64,\n\t\trequired_cash: U64,\n\t\twaiting_cash_need: U64,\n\t\texpiry_market_id: bcs.Address,\n\t\trecord_id: U64,\n\t\taccount_id: bcs.Address,\n\t\tkind: bcs.u8(),\n\t\t/** Filled quantity (mint) or closed quantity (sell). */\n\t\tquantity: U64,\n\t\t/** Cost paid (mint) or proceeds (sell). */\n\t\tamount: U64,\n\t\ttrading_fee: U64,\n\t\tbuilder_fee: U64,\n\t\treferral_fee: U64,\n\t\torder_fee: U64,\n\t\t/** Reserved fee subsidy the fill used. */\n\t\tsubsidy_used: U64,\n\t\tinventory_impact: U64,\n\t\ttau_ms: U64,\n\t\ttick_ms: U64,\n\t\t/**\n\t\t * The position the record now holds: a mint's new position or a partial sell's\n\t\t * replacement; zero after a full close.\n\t\t */\n\t\tposition: order_queue.HeldPosition,\n\t\tsender: bcs.Address,\n\t\tonchain_timestamp_ms: U64,\n\t},\n});\nexport const QueuedOrderRefunded = new MoveStruct({\n\tname: `${$moduleName}::QueuedOrderRefunded`,\n\tfields: {\n\t\t/** The market's cash, required cash, and waiting cash need after the call. */\n\t\tmarket_cash: U64,\n\t\trequired_cash: U64,\n\t\twaiting_cash_need: U64,\n\t\texpiry_market_id: bcs.Address,\n\t\trecord_id: U64,\n\t\taccount_id: bcs.Address,\n\t\tkind: bcs.u8(),\n\t\t/** An `order_queue` reason code. */\n\t\treason: bcs.u8(),\n\t\tescrow_returned: U64,\n\t\torder_fee_returned: U64,\n\t\tsubsidy_returned: U64,\n\t\t/** True when a sell's record went back to Open holding its position. */\n\t\tposition_returned: bcs.bool(),\n\t\tsender: bcs.Address,\n\t\tonchain_timestamp_ms: U64,\n\t},\n});\nexport const QueuedOrdersCleaned = new MoveStruct({\n\tname: `${$moduleName}::QueuedOrdersCleaned`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\trecord_ids: bcs.vector(U64),\n\t\tonchain_timestamp_ms: U64,\n\t},\n});\nexport const OpenRecordSettled = new MoveStruct({\n\tname: `${$moduleName}::OpenRecordSettled`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\trecord_id: U64,\n\t\taccount_id: bcs.Address,\n\t\torder_id: U256,\n\t\tpayout: U64,\n\t\tonchain_timestamp_ms: U64,\n\t},\n});\nexport const OpenRecordPayoutSkipped = new MoveStruct({\n\tname: `${$moduleName}::OpenRecordPayoutSkipped`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\trecord_id: U64,\n\t\taccount_id: bcs.Address,\n\t\torder_id: U256,\n\t\tpayout: U64,\n\t\tonchain_timestamp_ms: U64,\n\t},\n});\nexport const RecordFundsParked = new MoveStruct({\n\tname: `${$moduleName}::RecordFundsParked`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\trecord_id: U64,\n\t\taccount_id: bcs.Address,\n\t\treceive_address: bcs.Address,\n\t\tamount: U64,\n\t\tonchain_timestamp_ms: U64,\n\t},\n});\nexport const RecordFundsClaimed = new MoveStruct({\n\tname: `${$moduleName}::RecordFundsClaimed`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\trecord_id: U64,\n\t\taccount_id: bcs.Address,\n\t\treceive_address: bcs.Address,\n\t\tamount: U64,\n\t\tonchain_timestamp_ms: U64,\n\t},\n});\nexport const MarketPayoutsCompleted = new MoveStruct({\n\tname: `${$moduleName}::MarketPayoutsCompleted`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\tonchain_timestamp_ms: U64,\n\t},\n});\nexport const DelayedExecutionPolicyUpdated = new MoveStruct({\n\tname: `${$moduleName}::DelayedExecutionPolicyUpdated`,\n\tfields: {\n\t\tdesk_id: bcs.Address,\n\t\tpolicy: delayed_execution_config.DelayedExecutionPolicy,\n\t\tonchain_timestamp_ms: U64,\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,cAAc;AACpB,MAAa,gBAAgB,IAAI,WAAW;CAC3C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,kBAAkB,IAAI;EACtB,WAAW;EACX,YAAY,IAAI;EAEhB,MAAM,IAAI,IAAI;EACd,SAASA;EAET,UAAUC;EACV,QAAQC;EACR,KAAKC;EACL,QAAQ;EACR,WAAW;EAEX,WAAW;EACX,eAAe;EACf,iBAAiB,IAAI,OAAO,IAAI,QAAQ;EACxC,qBAAqB,IAAI,OAAO,IAAI,QAAQ;EAE5C,kBAAkB,IAAI,OAAO,IAAI;EAEjC,aAAa;EACb,eAAe;EACf,mBAAmB;EACnB,sBAAsB;EACtB;CACD,CAAC;AACF,MAAa,kBAAkB,IAAI,WAAW;CAC7C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,kBAAkB,IAAI;EACtB,QAAQ;EAER,SAAS;EACT,iBAAiB;EACjB,gBAAgB;EAEhB,MAAM;EAEN,eAAe;EACf,gBAAgB,IAAI,KAAK;EACzB,cAAc,IAAI,IAAI;EAEtB,QAAQ,IAAI;EACZ,sBAAsB;EACtB;CACD,CAAC;AACF,MAAa,oBAAoB,IA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