{"version":3,"file":"order_events.mjs","names":[],"sources":["../../../src/contracts/deepbook_predict/order_events.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Order-lifecycle events for Predict.\n *\n * Events carry transition identities and deltas rather than account or market\n * balances. Partial closes link an old order ID to its replacement; the position\n * root remains constant across that chain. Queued fills emit `OrderMinted` and\n * `LiveOrderRedeemed` from inside Predict's order-flow fills; the queue's own\n * events belong to the order-flow companion package.\n */\n\nimport { MoveStruct } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { U256, U64 } from '../../bcs/integers.js';\nconst $moduleName = '@local-pkg/deepbook_predict::order_events';\nexport const OrderMinted = new MoveStruct({\n\tname: `${$moduleName}::OrderMinted`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\taccount_id: bcs.Address,\n\t\torder_id: U256,\n\t\t/**\n\t\t * Stable economic-position handle: the original mint's `order_id`, carried forward\n\t\t * unchanged across partial-close replacements. Equals `order_id` here.\n\t\t */\n\t\tposition_root_id: U256,\n\t\towner: bcs.Address,\n\t\t/**\n\t\t * Canonical strike range as absolute ticks: `lower_tick` (`0` = `-inf`) and\n\t\t * `higher_tick` (`pos_inf_tick` = `+inf`). Raw strikes are the derived display\n\t\t * form, `tick * tick_size` with the `tick_size` from `MarketCreated`.\n\t\t */\n\t\tlower_tick: U64,\n\t\thigher_tick: U64,\n\t\t/** 1e9-scaled range probability quoted at entry. */\n\t\tentry_probability: U64,\n\t\tquantity: U64,\n\t\t/** Premium the user paid into LP backing, in USDC base units. */\n\t\tpremium: U64,\n\t\t/** Full trading fee assessed for the mint, including any sponsor-paid subsidy. */\n\t\ttrading_fee: U64,\n\t\t/** Portion of `trading_fee` paid from expiry-local fee incentives. */\n\t\tfee_incentive_subsidy: U64,\n\t\tbuilder_fee: U64,\n\t\t/** EWMA gas-price congestion surcharge assessed for the mint, in USDC base units. */\n\t\tpenalty_fee: U64,\n\t\t/**\n\t\t * Portion of the trader-paid trading fee and congestion surcharge delivered to the\n\t\t * referrer.\n\t\t */\n\t\treferral_fee: U64,\n\t\t/** Separate inventory-impact charge escrowed for live-close rebates. */\n\t\tinventory_impact_charge: U64,\n\t\t/**\n\t\t * Builder code the order named, credited with `builder_fee`; `none` when the order\n\t\t * named none. Recorded even at a zero fee, so attribution covers apps that charge\n\t\t * nothing.\n\t\t */\n\t\tbuilder_code_id: bcs.option(bcs.Address),\n\t\t/** Referrer recorded on the minting account, independent of the fee paid. */\n\t\treferrer_account_id: bcs.option(bcs.Address),\n\t\tonchain_timestamp_ms: U64,\n\t\t/**\n\t\t * Oracle source timestamps present when this mint was priced: Pyth's canonical\n\t\t * source time and the Block Scholes per-update source times used for freshness.\n\t\t * The SVI one is also the roll-down anchor. Pyth is `0` only when unusable.\n\t\t */\n\t\tpyth_spot_source_timestamp_ms: U64,\n\t\tblock_scholes_spot_source_timestamp_ms: U64,\n\t\tblock_scholes_forward_source_timestamp_ms: U64,\n\t\tblock_scholes_svi_source_timestamp_ms: U64,\n\t},\n});\nexport const LiveOrderRedeemed = new MoveStruct({\n\tname: `${$moduleName}::LiveOrderRedeemed`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\taccount_id: bcs.Address,\n\t\torder_id: U256,\n\t\t/**\n\t\t * Stable economic-position handle, constant across the replacement chain. On a\n\t\t * partial close the replacement inherits this same root.\n\t\t */\n\t\tposition_root_id: U256,\n\t\towner: bcs.Address,\n\t\tquantity_closed: U64,\n\t\t/** `0` means the position was fully closed. */\n\t\tremaining_quantity: U64,\n\t\t/** New order ID minted to carry the remainder on a partial live close. */\n\t\treplacement_order_id: bcs.option(U256),\n\t\t/** Redeem value before fees. */\n\t\tredeem_amount: U64,\n\t\ttrading_fee: U64,\n\t\tbuilder_fee: U64,\n\t\t/** EWMA gas-price congestion surcharge retained by the pool, in USDC base units. */\n\t\tpenalty_fee: U64,\n\t\t/** Separate inventory-impact rebate paid from its isolated escrow. */\n\t\tinventory_impact_rebate: U64,\n\t\t/**\n\t\t * Builder code the order named, credited with `builder_fee`; `none` when the order\n\t\t * named none. Recorded even at a zero fee, so attribution covers apps that charge\n\t\t * nothing.\n\t\t */\n\t\tbuilder_code_id: bcs.option(bcs.Address),\n\t\tonchain_timestamp_ms: U64,\n\t\t/**\n\t\t * Oracle source timestamps present when this redemption was priced: Pyth's\n\t\t * canonical source time and the Block Scholes per-update source times used for\n\t\t * freshness. The SVI one is also the roll-down anchor. Pyth is `0` only when\n\t\t * unusable.\n\t\t */\n\t\tpyth_spot_source_timestamp_ms: U64,\n\t\tblock_scholes_spot_source_timestamp_ms: U64,\n\t\tblock_scholes_forward_source_timestamp_ms: U64,\n\t\tblock_scholes_svi_source_timestamp_ms: U64,\n\t},\n});\nexport const SettledOrderRedeemed = new MoveStruct({\n\tname: `${$moduleName}::SettledOrderRedeemed`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\taccount_id: bcs.Address,\n\t\torder_id: U256,\n\t\t/** Stable economic-position handle, constant across the replacement chain. */\n\t\tposition_root_id: U256,\n\t\towner: bcs.Address,\n\t\tpayout_amount: U64,\n\t\tonchain_timestamp_ms: U64,\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,cAAc;AACpB,MAAa,cAAc,IAAI,WAAW;CACzC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,kBAAkB,IAAI;EACtB,YAAY,IAAI;EAChB,UAAU;EAKV,kBAAkB;EAClB,OAAO,IAAI;EAMX,YAAY;EACZ,aAAa;EAEb,mBAAmB;EACnB,UAAU;EAEV,SAAS;EAET,aAAa;EAEb,uBAAuB;EACvB,aAAa;EAEb,aAAa;EAKb,cAAc;EAEd,yBAAyB;EAMzB,iBAAiB,IAAI,OAAO,IAAI,QAAQ;EAExC,qBAAqB,IAAI,OAAO,IAAI,QAAQ;EAC5C,sBAAsB;EAMtB,+BAA+B;EAC/B,wCAAwC;EACxC,2CAA2C;EAC3C,uCAAuC;EACvC;CACD,CAAC;AACF,MAAa,oBAAoB,IAAI,WAAW;CAC/C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,kBAAkB,IAAI;EACtB,YAAY,IAAI;EAChB,UAAU;EAKV,kBAAkB;EAClB,OAAO,IAAI;EACX,iBAAiB;EAEjB,oBAAoB;EAEpB,sBAAsB,IAAI,OAAO,KAAK;EAEtC,eAAe;EACf,aAAa;EACb,aAAa;EAEb,aAAa;EAEb,yBAAyB;EAMzB,iBAAiB,IAAI,OAAO,IAAI,QAAQ;EACxC,sBAAsB;EAOtB,+BAA+B;EAC/B,wCAAwC;EACxC,2CAA2C;EAC3C,uCAAuC;EACvC;CACD,CAAC;AACF,MAAa,uBAAuB,IAAI,WAAW;CAClD,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,kBAAkB,IAAI;EACtB,YAAY,IAAI;EAChB,UAAU;EAEV,kBAAkB;EAClB,OAAO,IAAI;EACX,eAAe;EACf,sBAAsB;EACtB;CACD,CAAC"}