@mysten/deepbook-v3 2.6.4 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +153 -0
- package/PREDICT.md +389 -61
- package/dist/contracts/account/account.d.mts +23 -23
- package/dist/contracts/account/account.d.mts.map +1 -1
- package/dist/contracts/account/account_registry.d.mts +13 -13
- package/dist/contracts/deepbook/account.d.mts +18 -18
- package/dist/contracts/deepbook/balances.d.mts +4 -4
- package/dist/contracts/deepbook/deep_price.d.mts +3 -3
- package/dist/contracts/deepbook/order.d.mts +12 -12
- package/dist/contracts/deepbook_predict/admin.d.mts +4 -4
- package/dist/contracts/deepbook_predict/builder_code.d.mts +11 -11
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts +10 -10
- package/dist/contracts/deepbook_predict/config_events.d.mts +93 -68
- package/dist/contracts/deepbook_predict/config_events.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/config_events.mjs +45 -1
- package/dist/contracts/deepbook_predict/config_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/deps/std/type_name.mjs +17 -0
- package/dist/contracts/deepbook_predict/deps/std/type_name.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_market.d.mts +652 -235
- package/dist/contracts/deepbook_predict/expiry_market.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/expiry_market.mjs +652 -186
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/lp_book.mjs +1 -1
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/market_manager.d.mts +27 -27
- package/dist/contracts/deepbook_predict/order_events.d.mts +50 -50
- package/dist/contracts/deepbook_predict/order_events.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.mjs +3 -1
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pause_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/plp.d.mts +184 -82
- package/dist/contracts/deepbook_predict/plp.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/plp.mjs +126 -7
- package/dist/contracts/deepbook_predict/plp.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pool_accounting.mjs +1 -1
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/predict_account.d.mts +14 -14
- package/dist/contracts/deepbook_predict/pricing.d.mts +91 -58
- package/dist/contracts/deepbook_predict/pricing.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/pricing.mjs +30 -3
- package/dist/contracts/deepbook_predict/pricing.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing_config.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/protocol_config.d.mts +400 -92
- package/dist/contracts/deepbook_predict/protocol_config.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/protocol_config.mjs +451 -61
- package/dist/contracts/deepbook_predict/protocol_config.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/range_codec.d.mts +2 -2
- package/dist/contracts/deepbook_predict/registry.d.mts +28 -28
- package/dist/contracts/deepbook_predict/strike_exposure.mjs +1 -1
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs +17 -12
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/vault_events.d.mts +154 -106
- package/dist/contracts/deepbook_predict/vault_events.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/vault_events.mjs +57 -1
- package/dist/contracts/deepbook_predict/vault_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict_math/config-arguments.d.mts +10 -0
- package/dist/contracts/deepbook_predict_math/config-arguments.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_math/lazer_price.d.mts +106 -0
- package/dist/contracts/deepbook_predict_math/lazer_price.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_math/lazer_price.mjs +125 -0
- package/dist/contracts/deepbook_predict_math/lazer_price.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_math/math.d.mts +284 -0
- package/dist/contracts/deepbook_predict_math/math.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_math/math.mjs +364 -0
- package/dist/contracts/deepbook_predict_math/math.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/config-arguments.d.mts +13 -0
- package/dist/contracts/deepbook_predict_orders/config-arguments.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_orders/delayed_execution_config.d.mts +215 -0
- package/dist/contracts/deepbook_predict_orders/delayed_execution_config.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_orders/delayed_execution_config.mjs +215 -0
- package/dist/contracts/deepbook_predict_orders/delayed_execution_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.mjs +87 -0
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/pricing.mjs +52 -0
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/pricing.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/deps/fixed_math/i64.mjs +25 -0
- package/dist/contracts/deepbook_predict_orders/deps/fixed_math/i64.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/deps/sui/balance.mjs +21 -0
- package/dist/contracts/deepbook_predict_orders/deps/sui/balance.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/deps/sui/table.mjs +39 -0
- package/dist/contracts/deepbook_predict_orders/deps/sui/table.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/desk.d.mts +187 -0
- package/dist/contracts/deepbook_predict_orders/desk.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_orders/desk.mjs +261 -0
- package/dist/contracts/deepbook_predict_orders/desk.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/order_queue.d.mts +1042 -0
- package/dist/contracts/deepbook_predict_orders/order_queue.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_orders/order_queue.mjs +849 -0
- package/dist/contracts/deepbook_predict_orders/order_queue.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/queue.d.mts +683 -0
- package/dist/contracts/deepbook_predict_orders/queue.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_orders/queue.mjs +912 -0
- package/dist/contracts/deepbook_predict_orders/queue.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/queue_events.d.mts +195 -0
- package/dist/contracts/deepbook_predict_orders/queue_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_orders/queue_events.mjs +187 -0
- package/dist/contracts/deepbook_predict_orders/queue_events.mjs.map +1 -0
- package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
- package/dist/contracts/deepbook_sessions/sessions.d.mts +163 -28
- package/dist/contracts/deepbook_sessions/sessions.d.mts.map +1 -1
- package/dist/contracts/deepbook_sessions/sessions.mjs +234 -5
- package/dist/contracts/deepbook_sessions/sessions.mjs.map +1 -1
- package/dist/deployments/mainnet.mjs +7 -4
- package/dist/deployments/mainnet.mjs.map +1 -1
- package/dist/deployments/testnet.mjs +7 -4
- package/dist/deployments/testnet.mjs.map +1 -1
- package/dist/predict/bindings/expiry-market.d.mts +77 -0
- package/dist/predict/bindings/expiry-market.d.mts.map +1 -0
- package/dist/predict/bindings/expiry-market.mjs +139 -0
- package/dist/predict/bindings/expiry-market.mjs.map +1 -0
- package/dist/predict/bindings/protocol-config.d.mts +39 -0
- package/dist/predict/bindings/protocol-config.d.mts.map +1 -0
- package/dist/predict/bindings/protocol-config.mjs +90 -0
- package/dist/predict/bindings/protocol-config.mjs.map +1 -0
- package/dist/predict/bindings/rename.mjs +9 -0
- package/dist/predict/bindings/rename.mjs.map +1 -0
- package/dist/predict/client.d.mts +595 -16
- package/dist/predict/client.d.mts.map +1 -1
- package/dist/predict/client.mjs +986 -10
- package/dist/predict/client.mjs.map +1 -1
- package/dist/predict/config/generated.d.mts +22 -1
- package/dist/predict/config/generated.d.mts.map +1 -1
- package/dist/predict/config/generated.mjs +30 -1
- package/dist/predict/config/generated.mjs.map +1 -1
- package/dist/predict/config/mainnet.mjs +11 -3
- package/dist/predict/config/mainnet.mjs.map +1 -1
- package/dist/predict/config/testnet.mjs +11 -3
- package/dist/predict/config/testnet.mjs.map +1 -1
- package/dist/predict/config/types.d.mts +50 -1
- package/dist/predict/config/types.d.mts.map +1 -1
- package/dist/predict/cost.d.mts +38 -11
- package/dist/predict/cost.d.mts.map +1 -1
- package/dist/predict/cost.mjs +37 -11
- package/dist/predict/cost.mjs.map +1 -1
- package/dist/predict/decode.d.mts +251 -1
- package/dist/predict/decode.d.mts.map +1 -1
- package/dist/predict/decode.mjs +342 -4
- package/dist/predict/decode.mjs.map +1 -1
- package/dist/predict/errors.d.mts +69 -6
- package/dist/predict/errors.d.mts.map +1 -1
- package/dist/predict/errors.mjs +277 -4
- package/dist/predict/errors.mjs.map +1 -1
- package/dist/predict/index.d.mts +21 -10
- package/dist/predict/index.mjs +24 -12
- package/dist/predict/queue-id.d.mts +13 -0
- package/dist/predict/queue-id.d.mts.map +1 -0
- package/dist/predict/queue-id.mjs +19 -0
- package/dist/predict/queue-id.mjs.map +1 -0
- package/dist/predict/queue.d.mts +505 -0
- package/dist/predict/queue.d.mts.map +1 -0
- package/dist/predict/queue.mjs +774 -0
- package/dist/predict/queue.mjs.map +1 -0
- package/dist/predict/reads/balances.mjs +1 -1
- package/dist/predict/reads/markets.mjs +46 -5
- package/dist/predict/reads/markets.mjs.map +1 -1
- package/dist/predict/reads/pool.mjs +1 -1
- package/dist/predict/reads/pricing.d.mts +1 -1
- package/dist/predict/reads/queue.d.mts +105 -0
- package/dist/predict/reads/queue.d.mts.map +1 -0
- package/dist/predict/reads/queue.mjs +445 -0
- package/dist/predict/reads/queue.mjs.map +1 -0
- package/dist/predict/ticks.d.mts +9 -1
- package/dist/predict/ticks.d.mts.map +1 -1
- package/dist/predict/ticks.mjs +18 -1
- package/dist/predict/ticks.mjs.map +1 -1
- package/dist/predict/tx/authed.mjs +1 -1
- package/dist/predict/tx/common.d.mts.map +1 -1
- package/dist/predict/tx/common.mjs +12 -1
- package/dist/predict/tx/common.mjs.map +1 -1
- package/dist/predict/tx/queue.d.mts +220 -0
- package/dist/predict/tx/queue.d.mts.map +1 -0
- package/dist/predict/tx/queue.mjs +399 -0
- package/dist/predict/tx/queue.mjs.map +1 -0
- package/dist/predict/tx/trade.d.mts.map +1 -1
- package/dist/predict/tx/trade.mjs +61 -43
- package/dist/predict/tx/trade.mjs.map +1 -1
- package/dist/sessions.d.mts +90 -2
- package/dist/sessions.d.mts.map +1 -1
- package/dist/sessions.mjs +107 -2
- package/dist/sessions.mjs.map +1 -1
- package/dist/transactions/balanceManager.d.mts +12 -12
- package/dist/transactions/balanceManager.d.mts.map +1 -1
- package/dist/transactions/deepbook.d.mts +20 -20
- package/dist/transactions/deepbook.d.mts.map +1 -1
- package/dist/transactions/deepbookAdmin.d.mts +4 -4
- package/dist/transactions/deepbookAdmin.d.mts.map +1 -1
- package/dist/transactions/marginAdmin.d.mts +7 -7
- package/dist/transactions/marginAdmin.d.mts.map +1 -1
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginMaintainer.d.mts.map +1 -1
- package/dist/transactions/marginManager.d.mts +32 -32
- package/dist/transactions/marginManager.d.mts.map +1 -1
- package/dist/transactions/marginPool.d.mts +18 -18
- package/dist/transactions/marginRegistry.d.mts +16 -16
- package/dist/transactions/marginTPSL.d.mts +10 -10
- package/dist/transactions/marginTPSL.d.mts.map +1 -1
- package/dist/transactions/poolProxy.d.mts +8 -8
- package/dist/transactions/poolProxy.d.mts.map +1 -1
- package/package.json +4 -4
- package/src/contracts/deepbook_predict/config_events.ts +39 -0
- package/src/contracts/deepbook_predict/deps/std/type_name.ts +24 -0
- package/src/contracts/deepbook_predict/expiry_market.ts +960 -169
- package/src/contracts/deepbook_predict/order_events.ts +3 -1
- package/src/contracts/deepbook_predict/plp.ts +150 -9
- package/src/contracts/deepbook_predict/pricing.ts +46 -7
- package/src/contracts/deepbook_predict/pricing_config.ts +3 -1
- package/src/contracts/deepbook_predict/protocol_config.ts +648 -33
- package/src/contracts/deepbook_predict/strike_payout_tree.ts +25 -21
- package/src/contracts/deepbook_predict/vault_events.ts +65 -0
- package/src/contracts/deepbook_predict_math/config-arguments.ts +6 -0
- package/src/contracts/deepbook_predict_math/lazer_price.ts +196 -0
- package/src/contracts/deepbook_predict_math/math.ts +553 -0
- package/src/contracts/deepbook_predict_orders/config-arguments.ts +11 -0
- package/src/contracts/deepbook_predict_orders/delayed_execution_config.ts +430 -0
- package/src/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.ts +108 -0
- package/src/contracts/deepbook_predict_orders/deps/deepbook_predict/pricing.ts +58 -0
- package/src/contracts/deepbook_predict_orders/deps/fixed_math/i64.ts +21 -0
- package/src/contracts/deepbook_predict_orders/deps/sui/balance.ts +19 -0
- package/src/contracts/deepbook_predict_orders/deps/sui/table.ts +37 -0
- package/src/contracts/deepbook_predict_orders/desk.ts +419 -0
- package/src/contracts/deepbook_predict_orders/order_flow.ts +19 -0
- package/src/contracts/deepbook_predict_orders/order_queue.ts +1670 -0
- package/src/contracts/deepbook_predict_orders/queue.ts +1394 -0
- package/src/contracts/deepbook_predict_orders/queue_events.ts +189 -0
- package/src/contracts/deepbook_sessions/sessions.ts +355 -4
- package/src/deployments/mainnet.ts +7 -2
- package/src/deployments/testnet.ts +7 -2
- package/src/deployments/types.ts +14 -1
- package/src/predict/bindings/expiry-market.ts +127 -0
- package/src/predict/bindings/protocol-config.ts +59 -0
- package/src/predict/bindings/rename.ts +14 -0
- package/src/predict/client.ts +2076 -13
- package/src/predict/config/generated.ts +50 -0
- package/src/predict/config/mainnet.ts +16 -2
- package/src/predict/config/testnet.ts +16 -2
- package/src/predict/config/types.ts +51 -1
- package/src/predict/cost.ts +62 -14
- package/src/predict/decode.ts +691 -2
- package/src/predict/errors.ts +391 -14
- package/src/predict/index.ts +87 -6
- package/src/predict/queue-id.ts +22 -0
- package/src/predict/queue.ts +1231 -0
- package/src/predict/reads/markets.ts +30 -0
- package/src/predict/reads/queue.ts +606 -0
- package/src/predict/ticks.ts +35 -0
- package/src/predict/tx/common.ts +25 -1
- package/src/predict/tx/queue.ts +525 -0
- package/src/predict/tx/trade.ts +80 -49
- package/src/sessions.ts +206 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.mjs";
|
|
3
|
+
import { U64 } from "../../bcs/integers.mjs";
|
|
4
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
5
|
+
|
|
6
|
+
//#region src/contracts/deepbook_predict_orders/delayed_execution_config.ts
|
|
7
|
+
/**************************************************************
|
|
8
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
9
|
+
**************************************************************/
|
|
10
|
+
/**
|
|
11
|
+
* Admin-tunable policy for delayed execution: the timing, capacity, fee, and
|
|
12
|
+
* settlement-batch settings that queued mints and early sells run under.
|
|
13
|
+
*
|
|
14
|
+
* A leaf module, so `queue_events` can embed the policy and `desk` can store it.
|
|
15
|
+
* It owns the struct, its launch defaults, the field getters, and the package
|
|
16
|
+
* setters with every bound: each field's own range, the relational timing rules,
|
|
17
|
+
* and the per-account cap against the capacities. Predict caps what admission
|
|
18
|
+
* accepts on its side (`constants::max_svi_max_age_ms` and the deadline margin),
|
|
19
|
+
* and these bounds stay inside it.
|
|
20
|
+
*/
|
|
21
|
+
var delayed_execution_config_exports = /* @__PURE__ */ __exportAll({
|
|
22
|
+
DelayedExecutionPolicy: () => DelayedExecutionPolicy,
|
|
23
|
+
delayMs: () => delayMs,
|
|
24
|
+
gapWaitMs: () => gapWaitMs,
|
|
25
|
+
minSellQuantity: () => minSellQuantity,
|
|
26
|
+
mintCapacity: () => mintCapacity,
|
|
27
|
+
orderFee: () => orderFee,
|
|
28
|
+
perAccountCap: () => perAccountCap,
|
|
29
|
+
pythChannel: () => pythChannel,
|
|
30
|
+
pythPriceBufferMs: () => pythPriceBufferMs,
|
|
31
|
+
sellCapacity: () => sellCapacity,
|
|
32
|
+
settlePayoutBatch: () => settlePayoutBatch,
|
|
33
|
+
settleRefundBatch: () => settleRefundBatch,
|
|
34
|
+
stallTimeoutMs: () => stallTimeoutMs,
|
|
35
|
+
stuckThresholdMs: () => stuckThresholdMs,
|
|
36
|
+
sviMaxAgeMs: () => sviMaxAgeMs
|
|
37
|
+
});
|
|
38
|
+
const $moduleName = "@local-pkg/deepbook_predict_orders::delayed_execution_config";
|
|
39
|
+
const DelayedExecutionPolicy = new MoveStruct({
|
|
40
|
+
name: `${$moduleName}::DelayedExecutionPolicy`,
|
|
41
|
+
fields: {
|
|
42
|
+
delay_ms: U64,
|
|
43
|
+
stall_timeout_ms: U64,
|
|
44
|
+
stuck_threshold_ms: U64,
|
|
45
|
+
gap_wait_ms: U64,
|
|
46
|
+
pyth_price_buffer_ms: U64,
|
|
47
|
+
pyth_channel: bcs.u8(),
|
|
48
|
+
svi_max_age_ms: U64,
|
|
49
|
+
mint_capacity: U64,
|
|
50
|
+
sell_capacity: U64,
|
|
51
|
+
per_account_cap: U64,
|
|
52
|
+
order_fee: U64,
|
|
53
|
+
min_sell_quantity: U64,
|
|
54
|
+
settle_refund_batch: U64,
|
|
55
|
+
settle_payout_batch: U64
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
function delayMs(options) {
|
|
59
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
60
|
+
const argumentsTypes = [null];
|
|
61
|
+
const parameterNames = ["policy"];
|
|
62
|
+
return (tx) => tx.moveCall({
|
|
63
|
+
package: packageAddress,
|
|
64
|
+
module: "delayed_execution_config",
|
|
65
|
+
function: "delay_ms",
|
|
66
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function stallTimeoutMs(options) {
|
|
70
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
71
|
+
const argumentsTypes = [null];
|
|
72
|
+
const parameterNames = ["policy"];
|
|
73
|
+
return (tx) => tx.moveCall({
|
|
74
|
+
package: packageAddress,
|
|
75
|
+
module: "delayed_execution_config",
|
|
76
|
+
function: "stall_timeout_ms",
|
|
77
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function stuckThresholdMs(options) {
|
|
81
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
82
|
+
const argumentsTypes = [null];
|
|
83
|
+
const parameterNames = ["policy"];
|
|
84
|
+
return (tx) => tx.moveCall({
|
|
85
|
+
package: packageAddress,
|
|
86
|
+
module: "delayed_execution_config",
|
|
87
|
+
function: "stuck_threshold_ms",
|
|
88
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function gapWaitMs(options) {
|
|
92
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
93
|
+
const argumentsTypes = [null];
|
|
94
|
+
const parameterNames = ["policy"];
|
|
95
|
+
return (tx) => tx.moveCall({
|
|
96
|
+
package: packageAddress,
|
|
97
|
+
module: "delayed_execution_config",
|
|
98
|
+
function: "gap_wait_ms",
|
|
99
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function pythPriceBufferMs(options) {
|
|
103
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
104
|
+
const argumentsTypes = [null];
|
|
105
|
+
const parameterNames = ["policy"];
|
|
106
|
+
return (tx) => tx.moveCall({
|
|
107
|
+
package: packageAddress,
|
|
108
|
+
module: "delayed_execution_config",
|
|
109
|
+
function: "pyth_price_buffer_ms",
|
|
110
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function pythChannel(options) {
|
|
114
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
115
|
+
const argumentsTypes = [null];
|
|
116
|
+
const parameterNames = ["policy"];
|
|
117
|
+
return (tx) => tx.moveCall({
|
|
118
|
+
package: packageAddress,
|
|
119
|
+
module: "delayed_execution_config",
|
|
120
|
+
function: "pyth_channel",
|
|
121
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function sviMaxAgeMs(options) {
|
|
125
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
126
|
+
const argumentsTypes = [null];
|
|
127
|
+
const parameterNames = ["policy"];
|
|
128
|
+
return (tx) => tx.moveCall({
|
|
129
|
+
package: packageAddress,
|
|
130
|
+
module: "delayed_execution_config",
|
|
131
|
+
function: "svi_max_age_ms",
|
|
132
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function mintCapacity(options) {
|
|
136
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
137
|
+
const argumentsTypes = [null];
|
|
138
|
+
const parameterNames = ["policy"];
|
|
139
|
+
return (tx) => tx.moveCall({
|
|
140
|
+
package: packageAddress,
|
|
141
|
+
module: "delayed_execution_config",
|
|
142
|
+
function: "mint_capacity",
|
|
143
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function sellCapacity(options) {
|
|
147
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
148
|
+
const argumentsTypes = [null];
|
|
149
|
+
const parameterNames = ["policy"];
|
|
150
|
+
return (tx) => tx.moveCall({
|
|
151
|
+
package: packageAddress,
|
|
152
|
+
module: "delayed_execution_config",
|
|
153
|
+
function: "sell_capacity",
|
|
154
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function perAccountCap(options) {
|
|
158
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
159
|
+
const argumentsTypes = [null];
|
|
160
|
+
const parameterNames = ["policy"];
|
|
161
|
+
return (tx) => tx.moveCall({
|
|
162
|
+
package: packageAddress,
|
|
163
|
+
module: "delayed_execution_config",
|
|
164
|
+
function: "per_account_cap",
|
|
165
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function orderFee(options) {
|
|
169
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
170
|
+
const argumentsTypes = [null];
|
|
171
|
+
const parameterNames = ["policy"];
|
|
172
|
+
return (tx) => tx.moveCall({
|
|
173
|
+
package: packageAddress,
|
|
174
|
+
module: "delayed_execution_config",
|
|
175
|
+
function: "order_fee",
|
|
176
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function minSellQuantity(options) {
|
|
180
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
181
|
+
const argumentsTypes = [null];
|
|
182
|
+
const parameterNames = ["policy"];
|
|
183
|
+
return (tx) => tx.moveCall({
|
|
184
|
+
package: packageAddress,
|
|
185
|
+
module: "delayed_execution_config",
|
|
186
|
+
function: "min_sell_quantity",
|
|
187
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function settleRefundBatch(options) {
|
|
191
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
192
|
+
const argumentsTypes = [null];
|
|
193
|
+
const parameterNames = ["policy"];
|
|
194
|
+
return (tx) => tx.moveCall({
|
|
195
|
+
package: packageAddress,
|
|
196
|
+
module: "delayed_execution_config",
|
|
197
|
+
function: "settle_refund_batch",
|
|
198
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function settlePayoutBatch(options) {
|
|
202
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
203
|
+
const argumentsTypes = [null];
|
|
204
|
+
const parameterNames = ["policy"];
|
|
205
|
+
return (tx) => tx.moveCall({
|
|
206
|
+
package: packageAddress,
|
|
207
|
+
module: "delayed_execution_config",
|
|
208
|
+
function: "settle_payout_batch",
|
|
209
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
//#endregion
|
|
214
|
+
export { DelayedExecutionPolicy, delayed_execution_config_exports, orderFee };
|
|
215
|
+
//# sourceMappingURL=delayed_execution_config.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delayed_execution_config.mjs","names":[],"sources":["../../../src/contracts/deepbook_predict_orders/delayed_execution_config.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Admin-tunable policy for delayed execution: the timing, capacity, fee, and\n * settlement-batch settings that queued mints and early sells run under.\n *\n * A leaf module, so `queue_events` can embed the policy and `desk` can store it.\n * It owns the struct, its launch defaults, the field getters, and the package\n * setters with every bound: each field's own range, the relational timing rules,\n * and the per-account cap against the capacities. Predict caps what admission\n * accepts on its side (`constants::max_svi_max_age_ms` and the deadline margin),\n * and these bounds stay inside it.\n */\n\nimport { MoveStruct, normalizeMoveArguments } from '../utils/index.js';\nimport { U64 } from '../../bcs/integers.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nconst $moduleName = '@local-pkg/deepbook_predict_orders::delayed_execution_config';\nexport const DelayedExecutionPolicy = new MoveStruct({\n\tname: `${$moduleName}::DelayedExecutionPolicy`,\n\tfields: {\n\t\t/**\n\t\t * Latest τ may fall after placement. τ rounds down to the policy channel's tick at\n\t\t * or before `t₀ + delay_ms`.\n\t\t */\n\t\tdelay_ms: U64,\n\t\t/**\n\t\t * Sets each order's deadline:\n\t\t * `max(min(τ + stall_timeout_ms, expiry), last deadline)`. At or past it the\n\t\t * order is refunded, never filled.\n\t\t */\n\t\tstall_timeout_ms: U64,\n\t\t/**\n\t\t * Placement refuses new orders while an uncommitted cohort is this far past its τ\n\t\t * with nothing newer committed, or while two or more uncommitted cohorts are each\n\t\t * this far past their τ.\n\t\t */\n\t\tstuck_threshold_ms: U64,\n\t\t/** Commit accepts a backup tick for a cohort only once now is this far past its τ. */\n\t\tgap_wait_ms: U64,\n\t\t/**\n\t\t * Switches the backup tick on or off. `0` accepts only the update stamped exactly\n\t\t * τ. Above `0`, once now is `gap_wait_ms` past τ, a cohort also accepts its single\n\t\t * backup: the update stamped one tick of its own stored channel after τ. The value\n\t\t * is not a window: the setter keeps it at `0` or one tick of the policy channel.\n\t\t */\n\t\tpyth_price_buffer_ms: U64,\n\t\t/**\n\t\t * Pyth Lazer channel new orders are priced on: `2` (`fixed_rate@50ms`) or `3`\n\t\t * (`fixed_rate@200ms`). Its tick period is τ's grid. Each order stores the channel\n\t\t * it was placed under.\n\t\t */\n\t\tpyth_channel: bcs.u8(),\n\t\t/**\n\t\t * Oldest Block Scholes SVI a placement accepts into an order's volatility\n\t\t * snapshot.\n\t\t */\n\t\tsvi_max_age_ms: U64,\n\t\t/** Most unfinished queued mints per market. */\n\t\tmint_capacity: U64,\n\t\t/** Most unfinished queued sells per market. */\n\t\tsell_capacity: U64,\n\t\t/** Most unfinished queued orders per account per market. */\n\t\tper_account_cap: U64,\n\t\t/**\n\t\t * Flat fee charged at placement. Kept on a fill and on limit or admission refunds;\n\t\t * returned on every other refund.\n\t\t */\n\t\torder_fee: U64,\n\t\t/** Smallest early-sell close quantity. */\n\t\tmin_sell_quantity: U64,\n\t\t/** Most records one `settle_step` call visits while refunding leftover orders. */\n\t\tsettle_refund_batch: U64,\n\t\t/** Most records one `settle_step` call visits while paying Open records. */\n\t\tsettle_payout_batch: U64,\n\t},\n});\nexport interface DelayMsArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface DelayMsOptions {\n\tpackage?: string;\n\targuments: DelayMsArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function delayMs(options: DelayMsOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'delay_ms',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface StallTimeoutMsArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface StallTimeoutMsOptions {\n\tpackage?: string;\n\targuments: StallTimeoutMsArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function stallTimeoutMs(options: StallTimeoutMsOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'stall_timeout_ms',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface StuckThresholdMsArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface StuckThresholdMsOptions {\n\tpackage?: string;\n\targuments: StuckThresholdMsArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function stuckThresholdMs(options: StuckThresholdMsOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'stuck_threshold_ms',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface GapWaitMsArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface GapWaitMsOptions {\n\tpackage?: string;\n\targuments: GapWaitMsArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function gapWaitMs(options: GapWaitMsOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'gap_wait_ms',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface PythPriceBufferMsArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface PythPriceBufferMsOptions {\n\tpackage?: string;\n\targuments: PythPriceBufferMsArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function pythPriceBufferMs(options: PythPriceBufferMsOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'pyth_price_buffer_ms',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface PythChannelArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface PythChannelOptions {\n\tpackage?: string;\n\targuments: PythChannelArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function pythChannel(options: PythChannelOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'pyth_channel',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface SviMaxAgeMsArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface SviMaxAgeMsOptions {\n\tpackage?: string;\n\targuments: SviMaxAgeMsArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function sviMaxAgeMs(options: SviMaxAgeMsOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'svi_max_age_ms',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface MintCapacityArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface MintCapacityOptions {\n\tpackage?: string;\n\targuments: MintCapacityArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function mintCapacity(options: MintCapacityOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'mint_capacity',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface SellCapacityArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface SellCapacityOptions {\n\tpackage?: string;\n\targuments: SellCapacityArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function sellCapacity(options: SellCapacityOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'sell_capacity',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface PerAccountCapArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface PerAccountCapOptions {\n\tpackage?: string;\n\targuments: PerAccountCapArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function perAccountCap(options: PerAccountCapOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'per_account_cap',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface OrderFeeArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface OrderFeeOptions {\n\tpackage?: string;\n\targuments: OrderFeeArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function orderFee(options: OrderFeeOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'order_fee',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface MinSellQuantityArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface MinSellQuantityOptions {\n\tpackage?: string;\n\targuments: MinSellQuantityArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function minSellQuantity(options: MinSellQuantityOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'min_sell_quantity',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface SettleRefundBatchArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface SettleRefundBatchOptions {\n\tpackage?: string;\n\targuments: SettleRefundBatchArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function settleRefundBatch(options: SettleRefundBatchOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'settle_refund_batch',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface SettlePayoutBatchArguments {\n\tpolicy: TransactionArgument;\n}\nexport interface SettlePayoutBatchOptions {\n\tpackage?: string;\n\targuments: SettlePayoutBatchArguments | [policy: TransactionArgument];\n\tconfig?: {\n\t\tpredictOrdersPackageId?: string;\n\t};\n}\nexport function settlePayoutBatch(options: SettlePayoutBatchOptions) {\n\tconst packageAddress =\n\t\toptions.package ??\n\t\toptions.config?.predictOrdersPackageId ??\n\t\t'@local-pkg/deepbook_predict_orders';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['policy'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'delayed_execution_config',\n\t\t\tfunction: 'settle_payout_batch',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { MoveStruct } from "../../../utils/index.mjs";
|
|
2
|
+
import { U256, U64 } from "../../../../bcs/integers.mjs";
|
|
3
|
+
import { VolSnapshot } from "./pricing.mjs";
|
|
4
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
5
|
+
|
|
6
|
+
//#region src/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.ts
|
|
7
|
+
/**************************************************************
|
|
8
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
9
|
+
**************************************************************/
|
|
10
|
+
/**
|
|
11
|
+
* Per-expiry Predict market.
|
|
12
|
+
*
|
|
13
|
+
* An ExpiryMarket is the hot shared object for one expiry. It owns trade
|
|
14
|
+
* execution, strike exposure state, and an embedded expiry-cash custody component,
|
|
15
|
+
* plus local sponsor-funded fee incentives. Live oracle validation is delegated to
|
|
16
|
+
* `pricing::load_live_pricer`; this module owns market flow policy and then passes
|
|
17
|
+
* loaded `Pricer` snapshots into exposure business logic. Pool-wide PLP accounting
|
|
18
|
+
* and profit accounting remain outside this module.
|
|
19
|
+
*
|
|
20
|
+
* It also owns the order-flow primitives an order-flow companion package drives.
|
|
21
|
+
* `admit_mint` and `admit_sell` admit one queued order, pin a mint's boundary
|
|
22
|
+
* nodes, record the order's cash need in the market's `OrderFlowLedger`, and issue
|
|
23
|
+
* or advance its `OrderReceipt`. `commit` stores the bounded Pyth price the order
|
|
24
|
+
* fills at, `try_fill` fills or refunds it, `release` takes it out without
|
|
25
|
+
* filling, and `try_pay_settled` pays a queue-held position after settlement. A
|
|
26
|
+
* queued fill never enters the account: its position stays in the receipt.
|
|
27
|
+
* Admission, commit, and fill need an allowlisted companion witness; release and
|
|
28
|
+
* the settled payout need only the receipt. The queue itself, its escrow, its
|
|
29
|
+
* policy, and its events live in the companion.
|
|
30
|
+
*
|
|
31
|
+
* Mainnet USDC is a regulated coin: Sui aborts a transaction that sends it to an
|
|
32
|
+
* address on its deny list, or to anyone while it is globally paused. So the fill,
|
|
33
|
+
* the fee routing, and the settled payout read `sui::deny_list` first and never
|
|
34
|
+
* send to such an address. A fill for a denied receive address is refused, a
|
|
35
|
+
* denied builder or referrer's fee stays in market cash, and a denied winner's
|
|
36
|
+
* payout is skipped for a later `try_pay_settled`.
|
|
37
|
+
*/
|
|
38
|
+
const $moduleName = "deepbook_predict::expiry_market";
|
|
39
|
+
const OrderParties = new MoveStruct({
|
|
40
|
+
name: `${$moduleName}::OrderParties`,
|
|
41
|
+
fields: {
|
|
42
|
+
account_id: bcs.Address,
|
|
43
|
+
owner: bcs.Address,
|
|
44
|
+
receive_address: bcs.Address,
|
|
45
|
+
referrer_account_id: bcs.option(bcs.Address),
|
|
46
|
+
referrer_receive_address: bcs.option(bcs.Address),
|
|
47
|
+
builder_code_id: bcs.option(bcs.Address)
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const OrderReceipt = new MoveStruct({
|
|
51
|
+
name: `${$moduleName}::OrderReceipt`,
|
|
52
|
+
fields: {
|
|
53
|
+
expiry_market_id: bcs.Address,
|
|
54
|
+
stage: bcs.u8(),
|
|
55
|
+
kind: bcs.u8(),
|
|
56
|
+
parties: OrderParties,
|
|
57
|
+
lower_tick: U64,
|
|
58
|
+
higher_tick: U64,
|
|
59
|
+
quantity: U64,
|
|
60
|
+
max_premium: U64,
|
|
61
|
+
min_quantity: U64,
|
|
62
|
+
max_probability: U64,
|
|
63
|
+
min_probability: U64,
|
|
64
|
+
min_proceeds: U64,
|
|
65
|
+
tau_ms: U64,
|
|
66
|
+
deadline_ms: U64,
|
|
67
|
+
channel: bcs.u8(),
|
|
68
|
+
vol: VolSnapshot,
|
|
69
|
+
budget: U64,
|
|
70
|
+
order_fee: U64,
|
|
71
|
+
cash_need: U64,
|
|
72
|
+
subsidy_bound: U64,
|
|
73
|
+
subsidy_rate: U64,
|
|
74
|
+
subsidy_reserved: U64,
|
|
75
|
+
spot: U64,
|
|
76
|
+
tick_ms: U64,
|
|
77
|
+
generation_us: U64,
|
|
78
|
+
order_id: U256,
|
|
79
|
+
root_id: U256,
|
|
80
|
+
opened_at_ms: U64,
|
|
81
|
+
held_quantity: U64
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
export { OrderReceipt };
|
|
87
|
+
//# sourceMappingURL=expiry_market.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expiry_market.mjs","names":["pricing.VolSnapshot"],"sources":["../../../../../src/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Per-expiry Predict market.\n *\n * An ExpiryMarket is the hot shared object for one expiry. It owns trade\n * execution, strike exposure state, and an embedded expiry-cash custody component,\n * plus local sponsor-funded fee incentives. Live oracle validation is delegated to\n * `pricing::load_live_pricer`; this module owns market flow policy and then passes\n * loaded `Pricer` snapshots into exposure business logic. Pool-wide PLP accounting\n * and profit accounting remain outside this module.\n *\n * It also owns the order-flow primitives an order-flow companion package drives.\n * `admit_mint` and `admit_sell` admit one queued order, pin a mint's boundary\n * nodes, record the order's cash need in the market's `OrderFlowLedger`, and issue\n * or advance its `OrderReceipt`. `commit` stores the bounded Pyth price the order\n * fills at, `try_fill` fills or refunds it, `release` takes it out without\n * filling, and `try_pay_settled` pays a queue-held position after settlement. A\n * queued fill never enters the account: its position stays in the receipt.\n * Admission, commit, and fill need an allowlisted companion witness; release and\n * the settled payout need only the receipt. The queue itself, its escrow, its\n * policy, and its events live in the companion.\n *\n * Mainnet USDC is a regulated coin: Sui aborts a transaction that sends it to an\n * address on its deny list, or to anyone while it is globally paused. So the fill,\n * the fee routing, and the settled payout read `sui::deny_list` first and never\n * send to such an address. A fill for a denied receive address is refused, a\n * denied builder or referrer's fee stays in market cash, and a denied winner's\n * payout is skipped for a later `try_pay_settled`.\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { U64, U256 } from '../../../../bcs/integers.js';\nimport * as pricing from './pricing.js';\nconst $moduleName = 'deepbook_predict::expiry_market';\nexport const OrderParties = new MoveStruct({\n\tname: `${$moduleName}::OrderParties`,\n\tfields: {\n\t\taccount_id: bcs.Address,\n\t\towner: bcs.Address,\n\t\t/** Sell proceeds and the settled payout go only here. */\n\t\treceive_address: bcs.Address,\n\t\treferrer_account_id: bcs.option(bcs.Address),\n\t\treferrer_receive_address: bcs.option(bcs.Address),\n\t\tbuilder_code_id: bcs.option(bcs.Address),\n\t},\n});\nexport const OrderReceipt = new MoveStruct({\n\tname: `${$moduleName}::OrderReceipt`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\tstage: bcs.u8(),\n\t\t/** A `constants` mint kind, or `order_kind_sell` once a sell is admitted. */\n\t\tkind: bcs.u8(),\n\t\t/** The account's snapshot at the last admission. */\n\t\tparties: OrderParties,\n\t\tlower_tick: U64,\n\t\thigher_tick: U64,\n\t\t/** The exact mint quantity, or the sell's close quantity. */\n\t\tquantity: U64,\n\t\tmax_premium: U64,\n\t\tmin_quantity: U64,\n\t\tmax_probability: U64,\n\t\tmin_probability: U64,\n\t\tmin_proceeds: U64,\n\t\t/** Earliest Pyth generation time the order may price at. */\n\t\ttau_ms: U64,\n\t\t/** At or past it the order is refunded, never filled. */\n\t\tdeadline_ms: U64,\n\t\t/** The Lazer channel τ was planned on; the committed price must come from it. */\n\t\tchannel: bcs.u8(),\n\t\tvol: pricing.VolSnapshot,\n\t\tbudget: U64,\n\t\torder_fee: U64,\n\t\t/**\n\t\t * Worst-case market cash the fill can consume. Counted in the ledger's\n\t\t * `waiting_cash_need` while the order is admitted.\n\t\t */\n\t\tcash_need: U64,\n\t\t/**\n\t\t * The t₀ quote's pre-subsidy trading fee, capped at `budget`. Bounds the subsidy\n\t\t * `commit` reserves.\n\t\t */\n\t\tsubsidy_bound: U64,\n\t\tsubsidy_rate: U64,\n\t\tsubsidy_reserved: U64,\n\t\t/** The committed Pyth price, 1e9-normalized; `0` until `commit`. */\n\t\tspot: U64,\n\t\t/** The committed update's envelope, in ms. The fill prices at it. */\n\t\ttick_ms: U64,\n\t\t/** The committed feed's own update time, in µs. */\n\t\tgeneration_us: U64,\n\t\t/** The open position's order ID; `0` until the mint fills. */\n\t\torder_id: U256,\n\t\t/** Stable economic-position handle, constant across partial closes. */\n\t\troot_id: U256,\n\t\topened_at_ms: U64,\n\t\t/**\n\t\t * The open position's size, the quantity `order_id` names. The request's\n\t\t * `quantity` is the mint or close quantity, so a sell admission never overwrites\n\t\t * the size it closes.\n\t\t */\n\t\theld_quantity: U64,\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAM,cAAc;AACpB,MAAa,eAAe,IAAI,WAAW;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,YAAY,IAAI;EAChB,OAAO,IAAI;EAEX,iBAAiB,IAAI;EACrB,qBAAqB,IAAI,OAAO,IAAI,QAAQ;EAC5C,0BAA0B,IAAI,OAAO,IAAI,QAAQ;EACjD,iBAAiB,IAAI,OAAO,IAAI,QAAQ;EACxC;CACD,CAAC;AACF,MAAa,eAAe,IAAI,WAAW;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,kBAAkB,IAAI;EACtB,OAAO,IAAI,IAAI;EAEf,MAAM,IAAI,IAAI;EAEd,SAAS;EACT,YAAY;EACZ,aAAa;EAEb,UAAU;EACV,aAAa;EACb,cAAc;EACd,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EAEd,QAAQ;EAER,aAAa;EAEb,SAAS,IAAI,IAAI;EACjB,KAAKA;EACL,QAAQ;EACR,WAAW;EAKX,WAAW;EAKX,eAAe;EACf,cAAc;EACd,kBAAkB;EAElB,MAAM;EAEN,SAAS;EAET,eAAe;EAEf,UAAU;EAEV,SAAS;EACT,cAAc;EAMd,eAAe;EACf;CACD,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { MoveStruct } from "../../../utils/index.mjs";
|
|
2
|
+
import { U64 } from "../../../../bcs/integers.mjs";
|
|
3
|
+
import { I64 } from "../fixed_math/i64.mjs";
|
|
4
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
5
|
+
|
|
6
|
+
//#region src/contracts/deepbook_predict_orders/deps/deepbook_predict/pricing.ts
|
|
7
|
+
/**************************************************************
|
|
8
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
9
|
+
**************************************************************/
|
|
10
|
+
/**
|
|
11
|
+
* Pricing for Predict markets.
|
|
12
|
+
*
|
|
13
|
+
* This module reads canonical Propbook Pyth and Block Scholes feeds and computes
|
|
14
|
+
* SVI-adjusted digital probabilities. Live reads require fresh, pricing-safe Block
|
|
15
|
+
* Scholes spot, forward, and SVI observations. The latest forward is paired with
|
|
16
|
+
* an exact source-timestamp spot from Propbook's bounded recent history. The live
|
|
17
|
+
* forward comes from one of two admin-selected sources
|
|
18
|
+
* (`PricingConfig.use_pyth_spot_for_forward`): a fresh positive Pyth spot carrying
|
|
19
|
+
* the Block Scholes basis, or the Block Scholes forward directly. A load falls
|
|
20
|
+
* back to the Block Scholes forward when the selected Pyth spot is stale or
|
|
21
|
+
* unavailable; valuation prices on that fallback, while every live trade (mints,
|
|
22
|
+
* mint quotes, and live redeems) refuses it through `assert_pyth_spot_fresh`.
|
|
23
|
+
* Exact-history reads do not apply live freshness policy.
|
|
24
|
+
*
|
|
25
|
+
* Delayed execution splits that read in two. `load_vol` validates the same live
|
|
26
|
+
* inputs when an order is admitted and returns the raw Block Scholes basis and SVI
|
|
27
|
+
* its receipt stores; `pricer_at` later rebuilds a `Pricer` from them at the
|
|
28
|
+
* order's committed Pyth tick. The `try_*` reads price exactly as `up_price` and
|
|
29
|
+
* `range_price` do, and return `none` where those abort, so an order-flow fill
|
|
30
|
+
* never aborts on a surface.
|
|
31
|
+
*/
|
|
32
|
+
const $moduleName = "deepbook_predict::pricing";
|
|
33
|
+
const VolSnapshot = new MoveStruct({
|
|
34
|
+
name: `${$moduleName}::VolSnapshot`,
|
|
35
|
+
fields: {
|
|
36
|
+
pyth_source_id: bcs.u32(),
|
|
37
|
+
bs_spot: U64,
|
|
38
|
+
bs_forward: U64,
|
|
39
|
+
svi_a: I64,
|
|
40
|
+
svi_b: U64,
|
|
41
|
+
svi_rho: I64,
|
|
42
|
+
svi_m: I64,
|
|
43
|
+
svi_sigma: U64,
|
|
44
|
+
bs_spot_source_timestamp_ms: U64,
|
|
45
|
+
bs_forward_source_timestamp_ms: U64,
|
|
46
|
+
svi_source_timestamp_ms: U64
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { VolSnapshot };
|
|
52
|
+
//# sourceMappingURL=pricing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing.mjs","names":["i64.I64"],"sources":["../../../../../src/contracts/deepbook_predict_orders/deps/deepbook_predict/pricing.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Pricing for Predict markets.\n *\n * This module reads canonical Propbook Pyth and Block Scholes feeds and computes\n * SVI-adjusted digital probabilities. Live reads require fresh, pricing-safe Block\n * Scholes spot, forward, and SVI observations. The latest forward is paired with\n * an exact source-timestamp spot from Propbook's bounded recent history. The live\n * forward comes from one of two admin-selected sources\n * (`PricingConfig.use_pyth_spot_for_forward`): a fresh positive Pyth spot carrying\n * the Block Scholes basis, or the Block Scholes forward directly. A load falls\n * back to the Block Scholes forward when the selected Pyth spot is stale or\n * unavailable; valuation prices on that fallback, while every live trade (mints,\n * mint quotes, and live redeems) refuses it through `assert_pyth_spot_fresh`.\n * Exact-history reads do not apply live freshness policy.\n *\n * Delayed execution splits that read in two. `load_vol` validates the same live\n * inputs when an order is admitted and returns the raw Block Scholes basis and SVI\n * its receipt stores; `pricer_at` later rebuilds a `Pricer` from them at the\n * order's committed Pyth tick. The `try_*` reads price exactly as `up_price` and\n * `range_price` do, and return `none` where those abort, so an order-flow fill\n * never aborts on a surface.\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { U64 } from '../../../../bcs/integers.js';\nimport * as i64 from '../fixed_math/i64.js';\nconst $moduleName = 'deepbook_predict::pricing';\nexport const VolSnapshot = new MoveStruct({\n\tname: `${$moduleName}::VolSnapshot`,\n\tfields: {\n\t\t/**\n\t\t * Canonical Propbook Pyth source for the market's underlying; commit finds this\n\t\t * feed in each Lazer update.\n\t\t */\n\t\tpyth_source_id: bcs.u32(),\n\t\t/** The matched Block Scholes spot and forward, narrowed to Predict's width. */\n\t\tbs_spot: U64,\n\t\tbs_forward: U64,\n\t\t/** Raw SVI parameters before roll-down, at 1e9. */\n\t\tsvi_a: i64.I64,\n\t\tsvi_b: U64,\n\t\tsvi_rho: i64.I64,\n\t\tsvi_m: i64.I64,\n\t\tsvi_sigma: U64,\n\t\t/**\n\t\t * Provider source timestamps of the three reads. The SVI one is also the roll-down\n\t\t * anchor.\n\t\t */\n\t\tbs_spot_source_timestamp_ms: U64,\n\t\tbs_forward_source_timestamp_ms: U64,\n\t\tsvi_source_timestamp_ms: U64,\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,cAAc;AACpB,MAAa,cAAc,IAAI,WAAW;CACzC,MAAM,GAAG,YAAY;CACrB,QAAQ;EAKP,gBAAgB,IAAI,KAAK;EAEzB,SAAS;EACT,YAAY;EAEZ,OAAOA;EACP,OAAO;EACP,SAASA;EACT,OAAOA;EACP,WAAW;EAKX,6BAA6B;EAC7B,gCAAgC;EAChC,yBAAyB;EACzB;CACD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MoveStruct } from "../../../utils/index.mjs";
|
|
2
|
+
import { U64 } from "../../../../bcs/integers.mjs";
|
|
3
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
4
|
+
|
|
5
|
+
//#region src/contracts/deepbook_predict_orders/deps/fixed_math/i64.ts
|
|
6
|
+
/**************************************************************
|
|
7
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
8
|
+
**************************************************************/
|
|
9
|
+
/**
|
|
10
|
+
* Signed integers represented by a `u64` magnitude and a canonical nonnegative
|
|
11
|
+
* zero. Scaled multiplication and division use 1e9 fixed point and truncate the
|
|
12
|
+
* result's magnitude toward zero.
|
|
13
|
+
*/
|
|
14
|
+
const $moduleName = "fixed_math::i64";
|
|
15
|
+
const I64 = new MoveStruct({
|
|
16
|
+
name: `${$moduleName}::I64`,
|
|
17
|
+
fields: {
|
|
18
|
+
magnitude: U64,
|
|
19
|
+
is_negative: bcs.bool()
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { I64 };
|
|
25
|
+
//# sourceMappingURL=i64.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i64.mjs","names":[],"sources":["../../../../../src/contracts/deepbook_predict_orders/deps/fixed_math/i64.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Signed integers represented by a `u64` magnitude and a canonical nonnegative\n * zero. Scaled multiplication and division use 1e9 fixed point and truncate the\n * result's magnitude toward zero.\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { U64 } from '../../../../bcs/integers.js';\nimport { bcs } from '@mysten/sui/bcs';\nconst $moduleName = 'fixed_math::i64';\nexport const I64 = new MoveStruct({\n\tname: `${$moduleName}::I64`,\n\tfields: {\n\t\tmagnitude: U64,\n\t\tis_negative: bcs.bool(),\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,cAAc;AACpB,MAAa,MAAM,IAAI,WAAW;CACjC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,WAAW;EACX,aAAa,IAAI,MAAM;EACvB;CACD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MoveStruct } from "../../../utils/index.mjs";
|
|
2
|
+
import { U64 } from "../../../../bcs/integers.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/contracts/deepbook_predict_orders/deps/sui/balance.ts
|
|
5
|
+
/**************************************************************
|
|
6
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
7
|
+
**************************************************************/
|
|
8
|
+
/**
|
|
9
|
+
* A storable handler for Balances in general. Is used in the `Coin` module to
|
|
10
|
+
* allow balance operations and can be used to implement custom coins with `Supply`
|
|
11
|
+
* and `Balance`s.
|
|
12
|
+
*/
|
|
13
|
+
const $moduleName = "0x2::balance";
|
|
14
|
+
const Balance = new MoveStruct({
|
|
15
|
+
name: `${$moduleName}::Balance<phantom T>`,
|
|
16
|
+
fields: { value: U64 }
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Balance };
|
|
21
|
+
//# sourceMappingURL=balance.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance.mjs","names":[],"sources":["../../../../../src/contracts/deepbook_predict_orders/deps/sui/balance.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * A storable handler for Balances in general. Is used in the `Coin` module to\n * allow balance operations and can be used to implement custom coins with `Supply`\n * and `Balance`s.\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { U64 } from '../../../../bcs/integers.js';\nconst $moduleName = '0x2::balance';\nexport const Balance = new MoveStruct({\n\tname: `${$moduleName}::Balance<phantom T>`,\n\tfields: {\n\t\tvalue: U64,\n\t},\n});\n"],"mappings":";;;;;;;;;;;;AAYA,MAAM,cAAc;AACpB,MAAa,UAAU,IAAI,WAAW;CACrC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,OAAO,KACP;CACD,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { MoveStruct } from "../../../utils/index.mjs";
|
|
2
|
+
import { U64 } from "../../../../bcs/integers.mjs";
|
|
3
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
4
|
+
|
|
5
|
+
//#region src/contracts/deepbook_predict_orders/deps/sui/table.ts
|
|
6
|
+
/**************************************************************
|
|
7
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
8
|
+
**************************************************************/
|
|
9
|
+
/**
|
|
10
|
+
* A table is a map-like collection. But unlike a traditional collection, it's keys
|
|
11
|
+
* and values are not stored within the `Table` value, but instead are stored using
|
|
12
|
+
* Sui's object system. The `Table` struct acts only as a handle into the object
|
|
13
|
+
* system to retrieve those keys and values. Note that this means that `Table`
|
|
14
|
+
* values with exactly the same key-value mapping will not be equal, with `==`, at
|
|
15
|
+
* runtime. For example
|
|
16
|
+
*
|
|
17
|
+
* ```
|
|
18
|
+
* let table1 = table::new<u64, bool>();
|
|
19
|
+
* let table2 = table::new<u64, bool>();
|
|
20
|
+
* table::add(&mut table1, 0, false);
|
|
21
|
+
* table::add(&mut table1, 1, true);
|
|
22
|
+
* table::add(&mut table2, 0, false);
|
|
23
|
+
* table::add(&mut table2, 1, true);
|
|
24
|
+
* // table1 does not equal table2, despite having the same entries
|
|
25
|
+
* assert!(&table1 != &table2);
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
const $moduleName = "0x2::table";
|
|
29
|
+
const Table = new MoveStruct({
|
|
30
|
+
name: `${$moduleName}::Table<phantom K, phantom V>`,
|
|
31
|
+
fields: {
|
|
32
|
+
id: bcs.Address,
|
|
33
|
+
size: U64
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { Table };
|
|
39
|
+
//# sourceMappingURL=table.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.mjs","names":[],"sources":["../../../../../src/contracts/deepbook_predict_orders/deps/sui/table.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * A table is a map-like collection. But unlike a traditional collection, it's keys\n * and values are not stored within the `Table` value, but instead are stored using\n * Sui's object system. The `Table` struct acts only as a handle into the object\n * system to retrieve those keys and values. Note that this means that `Table`\n * values with exactly the same key-value mapping will not be equal, with `==`, at\n * runtime. For example\n *\n * ```\n * let table1 = table::new<u64, bool>();\n * let table2 = table::new<u64, bool>();\n * table::add(&mut table1, 0, false);\n * table::add(&mut table1, 1, true);\n * table::add(&mut table2, 0, false);\n * table::add(&mut table2, 1, true);\n * // table1 does not equal table2, despite having the same entries\n * assert!(&table1 != &table2);\n * ```\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { U64 } from '../../../../bcs/integers.js';\nconst $moduleName = '0x2::table';\nexport const Table = new MoveStruct({\n\tname: `${$moduleName}::Table<phantom K, phantom V>`,\n\tfields: {\n\t\t/** the ID of this table */\n\t\tid: bcs.Address,\n\t\t/** the number of key-value pairs in the table */\n\t\tsize: U64,\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,cAAc;AACpB,MAAa,QAAQ,IAAI,WAAW;CACnC,MAAM,GAAG,YAAY;CACrB,QAAQ;EAEP,IAAI,IAAI;EAER,MAAM;EACN;CACD,CAAC"}
|