@mysten/deepbook-v3 2.0.0 → 2.1.3
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 +100 -0
- package/PREDICT.md +256 -0
- package/README.md +116 -0
- package/dist/account.d.mts +139 -0
- package/dist/account.d.mts.map +1 -0
- package/dist/account.mjs +181 -0
- package/dist/account.mjs.map +1 -0
- package/dist/bcs/integers.mjs +23 -0
- package/dist/bcs/integers.mjs.map +1 -0
- package/dist/contracts/account/account.d.mts +382 -0
- package/dist/contracts/account/account.d.mts.map +1 -0
- package/dist/contracts/account/account.mjs +443 -0
- package/dist/contracts/account/account.mjs.map +1 -0
- package/dist/contracts/account/account_events.d.mts +41 -0
- package/dist/contracts/account/account_events.d.mts.map +1 -0
- package/dist/contracts/account/account_events.mjs +72 -0
- package/dist/contracts/account/account_events.mjs.map +1 -0
- package/dist/contracts/account/account_registry.d.mts +210 -0
- package/dist/contracts/account/account_registry.d.mts.map +1 -0
- package/dist/contracts/account/account_registry.mjs +263 -0
- package/dist/contracts/account/account_registry.mjs.map +1 -0
- package/dist/contracts/account/config-arguments.d.mts +10 -0
- package/dist/contracts/account/config-arguments.d.mts.map +1 -0
- package/dist/contracts/account/deps/sui/bag.mjs +44 -0
- package/dist/contracts/account/deps/sui/bag.mjs.map +1 -0
- package/dist/contracts/deepbook/account.d.mts +18 -18
- package/dist/contracts/deepbook/balance_manager.mjs.map +1 -1
- package/dist/contracts/deepbook/balances.d.mts +4 -4
- package/dist/contracts/deepbook/balances.d.mts.map +1 -1
- package/dist/contracts/deepbook/deep_price.d.mts +3 -3
- package/dist/contracts/deepbook/deep_price.d.mts.map +1 -1
- package/dist/contracts/deepbook/order.d.mts +12 -12
- package/dist/contracts/deepbook/pool.mjs.map +1 -1
- package/dist/contracts/deepbook/registry.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/margin_manager.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/margin_manager_upgraded.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/margin_pool.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/margin_registry.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/pool_proxy.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/protocol_config.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/tpsl.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/builder_code_events.mjs +38 -0
- package/dist/contracts/deepbook_predict/builder_code_events.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/config-arguments.d.mts +13 -0
- package/dist/contracts/deepbook_predict/config-arguments.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/deps/fixed_math/i64.mjs +25 -0
- package/dist/contracts/deepbook_predict/deps/fixed_math/i64.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/deps/sui/balance.mjs +25 -0
- package/dist/contracts/deepbook_predict/deps/sui/balance.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/deps/sui/coin.mjs +24 -0
- package/dist/contracts/deepbook_predict/deps/sui/coin.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/deps/sui/table.mjs +39 -0
- package/dist/contracts/deepbook_predict/deps/sui/table.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/deps/sui/vec_set.mjs +26 -0
- package/dist/contracts/deepbook_predict/deps/sui/vec_set.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/ewma.mjs +29 -0
- package/dist/contracts/deepbook_predict/ewma.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_cash.mjs +27 -0
- package/dist/contracts/deepbook_predict/expiry_cash.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_market.mjs +367 -0
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/lp_book.mjs +92 -0
- package/dist/contracts/deepbook_predict/lp_book.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/market_manager.mjs +59 -0
- package/dist/contracts/deepbook_predict/market_manager.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/order.mjs +26 -0
- package/dist/contracts/deepbook_predict/order.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/order_events.mjs +84 -0
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/plp.mjs +284 -0
- package/dist/contracts/deepbook_predict/plp.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/pool_accounting.mjs +58 -0
- package/dist/contracts/deepbook_predict/pool_accounting.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/predict_account.mjs +106 -0
- package/dist/contracts/deepbook_predict/predict_account.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/pricing.mjs +80 -0
- package/dist/contracts/deepbook_predict/pricing.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/range_codec.mjs +41 -0
- package/dist/contracts/deepbook_predict/range_codec.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/registry.mjs +55 -0
- package/dist/contracts/deepbook_predict/registry.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/strike_exposure.mjs +65 -0
- package/dist/contracts/deepbook_predict/strike_exposure.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/strike_exposure_config.mjs +33 -0
- package/dist/contracts/deepbook_predict/strike_exposure_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs +72 -0
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/vault_events.mjs +184 -0
- package/dist/contracts/deepbook_predict/vault_events.mjs.map +1 -0
- package/dist/contracts/deepbook_sessions/config-arguments.d.mts +10 -0
- package/dist/contracts/deepbook_sessions/config-arguments.d.mts.map +1 -0
- package/dist/contracts/deepbook_sessions/deps/sui/vec_map.mjs +37 -0
- package/dist/contracts/deepbook_sessions/deps/sui/vec_map.mjs.map +1 -0
- package/dist/contracts/deepbook_sessions/session_config.d.mts +63 -0
- package/dist/contracts/deepbook_sessions/session_config.d.mts.map +1 -0
- package/dist/contracts/deepbook_sessions/session_config.mjs +82 -0
- package/dist/contracts/deepbook_sessions/session_config.mjs.map +1 -0
- package/dist/contracts/deepbook_sessions/sessions.d.mts +275 -0
- package/dist/contracts/deepbook_sessions/sessions.d.mts.map +1 -0
- package/dist/contracts/deepbook_sessions/sessions.mjs +443 -0
- package/dist/contracts/deepbook_sessions/sessions.mjs.map +1 -0
- package/dist/contracts/margin_liquidation/liquidation_vault.mjs.map +1 -1
- package/dist/contracts/utils/index.d.mts +18 -1
- package/dist/contracts/utils/index.d.mts.map +1 -1
- package/dist/deployments/index.d.mts +31 -0
- package/dist/deployments/index.d.mts.map +1 -0
- package/dist/deployments/index.mjs +30 -0
- package/dist/deployments/index.mjs.map +1 -0
- package/dist/deployments/testnet.d.mts +14 -0
- package/dist/deployments/testnet.d.mts.map +1 -0
- package/dist/deployments/testnet.mjs +73 -0
- package/dist/deployments/testnet.mjs.map +1 -0
- package/dist/deployments/types.d.mts +36 -0
- package/dist/deployments/types.d.mts.map +1 -0
- package/dist/index.mjs +0 -1
- package/dist/predict/client.d.mts +255 -0
- package/dist/predict/client.d.mts.map +1 -0
- package/dist/predict/client.mjs +436 -0
- package/dist/predict/client.mjs.map +1 -0
- package/dist/predict/config/generated.d.mts +29 -0
- package/dist/predict/config/generated.d.mts.map +1 -0
- package/dist/predict/config/generated.mjs +16 -0
- package/dist/predict/config/generated.mjs.map +1 -0
- package/dist/predict/config/index.d.mts +10 -0
- package/dist/predict/config/index.d.mts.map +1 -0
- package/dist/predict/config/index.mjs +13 -0
- package/dist/predict/config/index.mjs.map +1 -0
- package/dist/predict/config/testnet.d.mts +17 -0
- package/dist/predict/config/testnet.d.mts.map +1 -0
- package/dist/predict/config/testnet.mjs +26 -0
- package/dist/predict/config/testnet.mjs.map +1 -0
- package/dist/predict/config/types.d.mts +55 -0
- package/dist/predict/config/types.d.mts.map +1 -0
- package/dist/predict/decode.d.mts +162 -0
- package/dist/predict/decode.d.mts.map +1 -0
- package/dist/predict/decode.mjs +175 -0
- package/dist/predict/decode.mjs.map +1 -0
- package/dist/predict/errors.d.mts +42 -0
- package/dist/predict/errors.d.mts.map +1 -0
- package/dist/predict/errors.mjs +37 -0
- package/dist/predict/errors.mjs.map +1 -0
- package/dist/predict/index.d.mts +18 -0
- package/dist/predict/index.mjs +14 -0
- package/dist/predict/pricing.d.mts +73 -0
- package/dist/predict/pricing.d.mts.map +1 -0
- package/dist/predict/pricing.mjs +129 -0
- package/dist/predict/pricing.mjs.map +1 -0
- package/dist/predict/reads/balances.mjs +41 -0
- package/dist/predict/reads/balances.mjs.map +1 -0
- package/dist/predict/reads/inspect.d.mts +8 -0
- package/dist/predict/reads/inspect.d.mts.map +1 -0
- package/dist/predict/reads/inspect.mjs +37 -0
- package/dist/predict/reads/inspect.mjs.map +1 -0
- package/dist/predict/reads/markets.mjs +130 -0
- package/dist/predict/reads/markets.mjs.map +1 -0
- package/dist/predict/reads/parse.mjs +20 -0
- package/dist/predict/reads/parse.mjs.map +1 -0
- package/dist/predict/reads/pool.mjs +26 -0
- package/dist/predict/reads/pool.mjs.map +1 -0
- package/dist/predict/reads/positions.d.mts +12 -0
- package/dist/predict/reads/positions.d.mts.map +1 -0
- package/dist/predict/reads/positions.mjs +77 -0
- package/dist/predict/reads/positions.mjs.map +1 -0
- package/dist/predict/reads/pricing.d.mts +20 -0
- package/dist/predict/reads/pricing.d.mts.map +1 -0
- package/dist/predict/reads/pricing.mjs +43 -0
- package/dist/predict/reads/pricing.mjs.map +1 -0
- package/dist/predict/ticks.d.mts +11 -0
- package/dist/predict/ticks.d.mts.map +1 -0
- package/dist/predict/ticks.mjs +21 -0
- package/dist/predict/ticks.mjs.map +1 -0
- package/dist/predict/tx/authed.mjs +18 -0
- package/dist/predict/tx/authed.mjs.map +1 -0
- package/dist/predict/tx/common.d.mts +18 -0
- package/dist/predict/tx/common.d.mts.map +1 -0
- package/dist/predict/tx/common.mjs +52 -0
- package/dist/predict/tx/common.mjs.map +1 -0
- package/dist/predict/tx/trade.d.mts +15 -0
- package/dist/predict/tx/trade.d.mts.map +1 -0
- package/dist/predict/tx/trade.mjs +86 -0
- package/dist/predict/tx/trade.mjs.map +1 -0
- package/dist/predict/units.d.mts +11 -0
- package/dist/predict/units.d.mts.map +1 -0
- package/dist/predict/units.mjs +44 -0
- package/dist/predict/units.mjs.map +1 -0
- package/dist/queries/accountQueries.mjs +0 -1
- package/dist/queries/accountQueries.mjs.map +1 -1
- package/dist/queries/orderQueries.mjs +0 -1
- package/dist/queries/orderQueries.mjs.map +1 -1
- package/dist/queries/registryQueries.mjs +0 -1
- package/dist/queries/registryQueries.mjs.map +1 -1
- package/dist/sessions.d.mts +244 -0
- package/dist/sessions.d.mts.map +1 -0
- package/dist/sessions.mjs +291 -0
- package/dist/sessions.mjs.map +1 -0
- package/dist/transactions/balanceManager.d.mts +12 -12
- package/dist/transactions/deepbook.d.mts +20 -20
- 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/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginManager.d.mts +32 -32
- 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/poolProxy.d.mts +8 -8
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs.map +1 -1
- package/dist/utils/constants.d.mts.map +1 -1
- package/dist/utils/constants.mjs +1 -1
- package/dist/utils/constants.mjs.map +1 -1
- package/package.json +33 -12
- package/src/account.ts +239 -0
- package/src/bcs/integers.ts +35 -0
- package/src/contracts/account/account.ts +706 -0
- package/src/contracts/account/account_events.ts +64 -0
- package/src/contracts/account/account_registry.ts +468 -0
- package/src/contracts/account/config-arguments.ts +8 -0
- package/src/contracts/account/deps/sui/bag.ts +42 -0
- package/src/contracts/deepbook/balance_manager.ts +1 -2
- package/src/contracts/deepbook/pool.ts +12 -24
- package/src/contracts/deepbook/registry.ts +1 -2
- package/src/contracts/deepbook_margin/margin_manager.ts +9 -18
- package/src/contracts/deepbook_margin/margin_manager_upgraded.ts +5 -10
- package/src/contracts/deepbook_margin/margin_pool.ts +2 -4
- package/src/contracts/deepbook_margin/margin_registry.ts +3 -6
- package/src/contracts/deepbook_margin/pool_proxy.ts +3 -6
- package/src/contracts/deepbook_margin/protocol_config.ts +1 -2
- package/src/contracts/deepbook_margin/tpsl.ts +1 -2
- package/src/contracts/deepbook_predict/admin.ts +44 -0
- package/src/contracts/deepbook_predict/builder_code.ts +155 -0
- package/src/contracts/deepbook_predict/builder_code_events.ts +34 -0
- package/src/contracts/deepbook_predict/config-arguments.ts +11 -0
- package/src/contracts/deepbook_predict/config_events.ts +140 -0
- package/src/contracts/deepbook_predict/deps/fixed_math/i64.ts +21 -0
- package/src/contracts/deepbook_predict/deps/sui/balance.ts +25 -0
- package/src/contracts/deepbook_predict/deps/sui/coin.ts +20 -0
- package/src/contracts/deepbook_predict/deps/sui/table.ts +37 -0
- package/src/contracts/deepbook_predict/deps/sui/vec_set.ts +22 -0
- package/src/contracts/deepbook_predict/ewma.ts +26 -0
- package/src/contracts/deepbook_predict/ewma_config.ts +28 -0
- package/src/contracts/deepbook_predict/expiry_cash.ts +24 -0
- package/src/contracts/deepbook_predict/expiry_market.ts +1549 -0
- package/src/contracts/deepbook_predict/lp_book.ts +105 -0
- package/src/contracts/deepbook_predict/market_lifecycle_cap.ts +75 -0
- package/src/contracts/deepbook_predict/market_manager.ts +218 -0
- package/src/contracts/deepbook_predict/order.ts +24 -0
- package/src/contracts/deepbook_predict/order_events.ts +129 -0
- package/src/contracts/deepbook_predict/pause_cap.ts +68 -0
- package/src/contracts/deepbook_predict/plp.ts +987 -0
- package/src/contracts/deepbook_predict/pool_accounting.ts +79 -0
- package/src/contracts/deepbook_predict/predict_account.ts +180 -0
- package/src/contracts/deepbook_predict/pricing.ts +124 -0
- package/src/contracts/deepbook_predict/pricing_config.ts +41 -0
- package/src/contracts/deepbook_predict/protocol_config.ts +1066 -0
- package/src/contracts/deepbook_predict/range_codec.ts +53 -0
- package/src/contracts/deepbook_predict/registry.ts +694 -0
- package/src/contracts/deepbook_predict/strike_exposure.ts +77 -0
- package/src/contracts/deepbook_predict/strike_exposure_config.ts +46 -0
- package/src/contracts/deepbook_predict/strike_payout_tree.ts +89 -0
- package/src/contracts/deepbook_predict/vault_events.ts +222 -0
- package/src/contracts/deepbook_sessions/config-arguments.ts +8 -0
- package/src/contracts/deepbook_sessions/deps/sui/vec_map.ts +33 -0
- package/src/contracts/deepbook_sessions/session_config.ts +130 -0
- package/src/contracts/deepbook_sessions/sessions.ts +663 -0
- package/src/contracts/margin_liquidation/liquidation_vault.ts +2 -4
- package/src/contracts/propbook/block_scholes_store.ts +842 -0
- package/src/contracts/propbook/deps/sui/table.ts +37 -0
- package/src/contracts/propbook/oracle_lane.ts +170 -0
- package/src/contracts/propbook/pyth_feed.ts +414 -0
- package/src/contracts/propbook/registry.ts +596 -0
- package/src/contracts/pyth/pyth.ts +2 -4
- package/src/deployments/index.ts +73 -0
- package/src/deployments/testnet.ts +107 -0
- package/src/deployments/types.ts +81 -0
- package/src/index.ts +5 -0
- package/src/predict/client.ts +941 -0
- package/src/predict/config/generated.ts +39 -0
- package/src/predict/config/index.ts +25 -0
- package/src/predict/config/testnet.ts +27 -0
- package/src/predict/config/types.ts +52 -0
- package/src/predict/decode.ts +476 -0
- package/src/predict/errors.ts +83 -0
- package/src/predict/index.ts +94 -0
- package/src/predict/pricing.ts +199 -0
- package/src/predict/reads/balances.ts +55 -0
- package/src/predict/reads/inspect.ts +78 -0
- package/src/predict/reads/markets.ts +222 -0
- package/src/predict/reads/parse.ts +30 -0
- package/src/predict/reads/pool.ts +37 -0
- package/src/predict/reads/positions.ts +144 -0
- package/src/predict/reads/pricing.ts +79 -0
- package/src/predict/ticks.ts +42 -0
- package/src/predict/tx/authed.ts +20 -0
- package/src/predict/tx/common.ts +92 -0
- package/src/predict/tx/trade.ts +183 -0
- package/src/predict/units.ts +49 -0
- package/src/sessions.ts +471 -0
- package/src/types/index.ts +1 -2
- package/src/utils/constants.ts +1 -7
- package/dist/types/bcs.mjs +0 -7
|
@@ -0,0 +1,842 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Stores verifier-authenticated Block Scholes observations for one immutable base
|
|
7
|
+
* asset, including the latest values and canonical spot observations at exact
|
|
8
|
+
* minute boundaries. Propbook derives every accepted series id from that identity
|
|
9
|
+
* through the upstream SID package, so a valid observation for another asset
|
|
10
|
+
* cannot enter this store. Stored values are held exactly as the verifier produced
|
|
11
|
+
* them; scaling and signed-value interpretation belong to the reading package.
|
|
12
|
+
* Exact spot history additionally admits only positive `u64`-representable values
|
|
13
|
+
* so an unusable observation cannot claim a permanent key. Value and SVI
|
|
14
|
+
* observations use separate stores because the verifier exposes distinct batch and
|
|
15
|
+
* value types. The registry creates and binds both stores atomically from one
|
|
16
|
+
* base-asset input.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { type BcsType, bcs } from '@mysten/sui/bcs';
|
|
20
|
+
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
21
|
+
import { U64, U128, U256 } from '../../bcs/integers.js';
|
|
22
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
23
|
+
import * as table from './deps/sui/table.js';
|
|
24
|
+
const $moduleName = '@local-pkg/propbook::block_scholes_store';
|
|
25
|
+
/**
|
|
26
|
+
* One accepted observation and the three clocks that describe it. The clocks
|
|
27
|
+
* answer different questions and are not interchangeable: a calibration that has
|
|
28
|
+
* not changed republishes under its original model time, so only
|
|
29
|
+
* `source_timestamp_ms` distinguishes a quiet feed from a stopped one.
|
|
30
|
+
*/
|
|
31
|
+
export function BsRead<Value extends BcsType<any>>(...typeParameters: [Value]) {
|
|
32
|
+
return new MoveStruct({
|
|
33
|
+
name: `${$moduleName}::BsRead<${typeParameters[0].name as Value['name']}>`,
|
|
34
|
+
fields: {
|
|
35
|
+
/**
|
|
36
|
+
* Provider calibration time — when the series was last re-derived, held fixed
|
|
37
|
+
* across republishes of that calibration. The provider's per-series replay key:
|
|
38
|
+
* ordering keys on this first. The published VALUES are as-of the envelope time:
|
|
39
|
+
* per the provider contract, an SVI publish whose model time is unchanged carries
|
|
40
|
+
* the same calibration already rolled down to its new publish time, never
|
|
41
|
+
* duplicate data.
|
|
42
|
+
*/
|
|
43
|
+
model_timestamp_ms: U64,
|
|
44
|
+
/**
|
|
45
|
+
* Envelope time of the batch this observation arrived in, advancing on every
|
|
46
|
+
* provider flush and never regressing once stored (see `apply`). The economic
|
|
47
|
+
* clock: consumers gate freshness on it and the SVI roll-down anchors on it, so a
|
|
48
|
+
* republished unchanged value is re-asserted as current at its new envelope time.
|
|
49
|
+
*/
|
|
50
|
+
source_timestamp_ms: U64,
|
|
51
|
+
/** Sui clock time when the accepting transaction executed. */
|
|
52
|
+
onchain_timestamp_ms: U64,
|
|
53
|
+
/** Digest of the transaction that accepted this observation. */
|
|
54
|
+
writer_digest: bcs.vector(bcs.u8()),
|
|
55
|
+
value: typeParameters[0],
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export const SVIParams = new MoveStruct({
|
|
60
|
+
name: `${$moduleName}::SVIParams`,
|
|
61
|
+
fields: {
|
|
62
|
+
a_magnitude: U128,
|
|
63
|
+
a_is_negative: bcs.bool(),
|
|
64
|
+
b: U128,
|
|
65
|
+
sigma: U128,
|
|
66
|
+
rho_magnitude: U128,
|
|
67
|
+
rho_is_negative: bcs.bool(),
|
|
68
|
+
m_magnitude: U128,
|
|
69
|
+
m_is_negative: bcs.bool(),
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
export const BlockScholesValueStore = new MoveStruct({
|
|
73
|
+
name: `${$moduleName}::BlockScholesValueStore`,
|
|
74
|
+
fields: {
|
|
75
|
+
id: bcs.Address,
|
|
76
|
+
propbook_underlying_id: bcs.u32(),
|
|
77
|
+
block_scholes_base_asset: bcs.string(),
|
|
78
|
+
/**
|
|
79
|
+
* Package version this store runs at; writes require an exact match and `migrate`
|
|
80
|
+
* advances it forward-only after a package upgrade.
|
|
81
|
+
*/
|
|
82
|
+
version: U64,
|
|
83
|
+
values: table.Table,
|
|
84
|
+
/** First positive `u64`-representable canonical spot at each exact minute boundary. */
|
|
85
|
+
exact_spot_reads: table.Table,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
export const BlockScholesSVIStore = new MoveStruct({
|
|
89
|
+
name: `${$moduleName}::BlockScholesSVIStore`,
|
|
90
|
+
fields: {
|
|
91
|
+
id: bcs.Address,
|
|
92
|
+
propbook_underlying_id: bcs.u32(),
|
|
93
|
+
block_scholes_base_asset: bcs.string(),
|
|
94
|
+
version: U64,
|
|
95
|
+
svis: table.Table,
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* Emitted only for observations that were stored, so its presence means the series
|
|
100
|
+
* advanced.
|
|
101
|
+
*/
|
|
102
|
+
export function BlockScholesObservationRecorded<Observation extends BcsType<any>>(
|
|
103
|
+
...typeParameters: [Observation]
|
|
104
|
+
) {
|
|
105
|
+
return new MoveStruct({
|
|
106
|
+
name: `${$moduleName}::BlockScholesObservationRecorded<${typeParameters[0].name as Observation['name']}>`,
|
|
107
|
+
fields: {
|
|
108
|
+
propbook_underlying_id: bcs.u32(),
|
|
109
|
+
propbook_oracle_id: bcs.Address,
|
|
110
|
+
sid: U256,
|
|
111
|
+
/** `0` = spot, `1` = forward, and `2` = SVI. */
|
|
112
|
+
series_kind: bcs.u8(),
|
|
113
|
+
/** Absolute unix-millisecond expiry; zero for the non-expiring spot series. */
|
|
114
|
+
expiry_ms: U64,
|
|
115
|
+
observation: typeParameters[0],
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/** Emitted when the canonical spot is inserted into exact minute-boundary history. */
|
|
120
|
+
export function BlockScholesObservationInserted<Observation extends BcsType<any>>(
|
|
121
|
+
...typeParameters: [Observation]
|
|
122
|
+
) {
|
|
123
|
+
return new MoveStruct({
|
|
124
|
+
name: `${$moduleName}::BlockScholesObservationInserted<${typeParameters[0].name as Observation['name']}>`,
|
|
125
|
+
fields: {
|
|
126
|
+
propbook_oracle_id: bcs.Address,
|
|
127
|
+
observation: typeParameters[0],
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
export const BlockScholesBatchIngested = new MoveStruct({
|
|
132
|
+
name: `${$moduleName}::BlockScholesBatchIngested`,
|
|
133
|
+
fields: {
|
|
134
|
+
propbook_underlying_id: bcs.u32(),
|
|
135
|
+
propbook_oracle_id: bcs.Address,
|
|
136
|
+
/** `0` = spot, `1` = forward, and `2` = SVI. */
|
|
137
|
+
series_kind: bcs.u8(),
|
|
138
|
+
source_timestamp_ms: U64,
|
|
139
|
+
/** Sui clock time when the batch ingestion transaction executed. */
|
|
140
|
+
onchain_timestamp_ms: U64,
|
|
141
|
+
/** Verified observations carried by the batch. */
|
|
142
|
+
update_count: U64,
|
|
143
|
+
/** Observations that became their series' latest. */
|
|
144
|
+
applied: U64,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
export interface ValueStoreIdArguments {
|
|
148
|
+
store: RawTransactionArgument<string>;
|
|
149
|
+
}
|
|
150
|
+
export interface ValueStoreIdOptions {
|
|
151
|
+
package?: string;
|
|
152
|
+
arguments: ValueStoreIdArguments | [store: RawTransactionArgument<string>];
|
|
153
|
+
}
|
|
154
|
+
export function valueStoreId(options: ValueStoreIdOptions) {
|
|
155
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
156
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
157
|
+
const parameterNames = ['store'];
|
|
158
|
+
return (tx: Transaction) =>
|
|
159
|
+
tx.moveCall({
|
|
160
|
+
package: packageAddress,
|
|
161
|
+
module: 'block_scholes_store',
|
|
162
|
+
function: 'value_store_id',
|
|
163
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
export interface SviStoreIdArguments {
|
|
167
|
+
store: RawTransactionArgument<string>;
|
|
168
|
+
}
|
|
169
|
+
export interface SviStoreIdOptions {
|
|
170
|
+
package?: string;
|
|
171
|
+
arguments: SviStoreIdArguments | [store: RawTransactionArgument<string>];
|
|
172
|
+
}
|
|
173
|
+
export function sviStoreId(options: SviStoreIdOptions) {
|
|
174
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
175
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
176
|
+
const parameterNames = ['store'];
|
|
177
|
+
return (tx: Transaction) =>
|
|
178
|
+
tx.moveCall({
|
|
179
|
+
package: packageAddress,
|
|
180
|
+
module: 'block_scholes_store',
|
|
181
|
+
function: 'svi_store_id',
|
|
182
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
export interface ValueStoreBaseAssetArguments {
|
|
186
|
+
store: RawTransactionArgument<string>;
|
|
187
|
+
}
|
|
188
|
+
export interface ValueStoreBaseAssetOptions {
|
|
189
|
+
package?: string;
|
|
190
|
+
arguments: ValueStoreBaseAssetArguments | [store: RawTransactionArgument<string>];
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Returns the immutable provider base-asset spelling for external composition or
|
|
194
|
+
* devInspect.
|
|
195
|
+
*/
|
|
196
|
+
export function valueStoreBaseAsset(options: ValueStoreBaseAssetOptions) {
|
|
197
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
198
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
199
|
+
const parameterNames = ['store'];
|
|
200
|
+
return (tx: Transaction) =>
|
|
201
|
+
tx.moveCall({
|
|
202
|
+
package: packageAddress,
|
|
203
|
+
module: 'block_scholes_store',
|
|
204
|
+
function: 'value_store_base_asset',
|
|
205
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
export interface SviStoreBaseAssetArguments {
|
|
209
|
+
store: RawTransactionArgument<string>;
|
|
210
|
+
}
|
|
211
|
+
export interface SviStoreBaseAssetOptions {
|
|
212
|
+
package?: string;
|
|
213
|
+
arguments: SviStoreBaseAssetArguments | [store: RawTransactionArgument<string>];
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Returns the immutable provider base-asset spelling for external composition or
|
|
217
|
+
* devInspect.
|
|
218
|
+
*/
|
|
219
|
+
export function sviStoreBaseAsset(options: SviStoreBaseAssetOptions) {
|
|
220
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
221
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
222
|
+
const parameterNames = ['store'];
|
|
223
|
+
return (tx: Transaction) =>
|
|
224
|
+
tx.moveCall({
|
|
225
|
+
package: packageAddress,
|
|
226
|
+
module: 'block_scholes_store',
|
|
227
|
+
function: 'svi_store_base_asset',
|
|
228
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
export interface ValueStoreVersionArguments {
|
|
232
|
+
store: RawTransactionArgument<string>;
|
|
233
|
+
}
|
|
234
|
+
export interface ValueStoreVersionOptions {
|
|
235
|
+
package?: string;
|
|
236
|
+
arguments: ValueStoreVersionArguments | [store: RawTransactionArgument<string>];
|
|
237
|
+
}
|
|
238
|
+
export function valueStoreVersion(options: ValueStoreVersionOptions) {
|
|
239
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
240
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
241
|
+
const parameterNames = ['store'];
|
|
242
|
+
return (tx: Transaction) =>
|
|
243
|
+
tx.moveCall({
|
|
244
|
+
package: packageAddress,
|
|
245
|
+
module: 'block_scholes_store',
|
|
246
|
+
function: 'value_store_version',
|
|
247
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
export interface SviStoreVersionArguments {
|
|
251
|
+
store: RawTransactionArgument<string>;
|
|
252
|
+
}
|
|
253
|
+
export interface SviStoreVersionOptions {
|
|
254
|
+
package?: string;
|
|
255
|
+
arguments: SviStoreVersionArguments | [store: RawTransactionArgument<string>];
|
|
256
|
+
}
|
|
257
|
+
export function sviStoreVersion(options: SviStoreVersionOptions) {
|
|
258
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
259
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
260
|
+
const parameterNames = ['store'];
|
|
261
|
+
return (tx: Transaction) =>
|
|
262
|
+
tx.moveCall({
|
|
263
|
+
package: packageAddress,
|
|
264
|
+
module: 'block_scholes_store',
|
|
265
|
+
function: 'svi_store_version',
|
|
266
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
export interface SpotSidArguments {
|
|
270
|
+
store: RawTransactionArgument<string>;
|
|
271
|
+
}
|
|
272
|
+
export interface SpotSidOptions {
|
|
273
|
+
package?: string;
|
|
274
|
+
arguments: SpotSidArguments | [store: RawTransactionArgument<string>];
|
|
275
|
+
}
|
|
276
|
+
/** Returns the canonical spot series id for external subscription construction. */
|
|
277
|
+
export function spotSid(options: SpotSidOptions) {
|
|
278
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
279
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
280
|
+
const parameterNames = ['store'];
|
|
281
|
+
return (tx: Transaction) =>
|
|
282
|
+
tx.moveCall({
|
|
283
|
+
package: packageAddress,
|
|
284
|
+
module: 'block_scholes_store',
|
|
285
|
+
function: 'spot_sid',
|
|
286
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
export interface ForwardSidArguments {
|
|
290
|
+
store: RawTransactionArgument<string>;
|
|
291
|
+
expiryMs: RawTransactionArgument<number | bigint>;
|
|
292
|
+
}
|
|
293
|
+
export interface ForwardSidOptions {
|
|
294
|
+
package?: string;
|
|
295
|
+
arguments:
|
|
296
|
+
| ForwardSidArguments
|
|
297
|
+
| [store: RawTransactionArgument<string>, expiryMs: RawTransactionArgument<number | bigint>];
|
|
298
|
+
}
|
|
299
|
+
/** Returns one canonical forward series id for external subscription construction. */
|
|
300
|
+
export function forwardSid(options: ForwardSidOptions) {
|
|
301
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
302
|
+
const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
|
|
303
|
+
const parameterNames = ['store', 'expiryMs'];
|
|
304
|
+
return (tx: Transaction) =>
|
|
305
|
+
tx.moveCall({
|
|
306
|
+
package: packageAddress,
|
|
307
|
+
module: 'block_scholes_store',
|
|
308
|
+
function: 'forward_sid',
|
|
309
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
export interface SviSidArguments {
|
|
313
|
+
store: RawTransactionArgument<string>;
|
|
314
|
+
expiryMs: RawTransactionArgument<number | bigint>;
|
|
315
|
+
}
|
|
316
|
+
export interface SviSidOptions {
|
|
317
|
+
package?: string;
|
|
318
|
+
arguments:
|
|
319
|
+
| SviSidArguments
|
|
320
|
+
| [store: RawTransactionArgument<string>, expiryMs: RawTransactionArgument<number | bigint>];
|
|
321
|
+
}
|
|
322
|
+
/** Returns one canonical SVI series id for external subscription construction. */
|
|
323
|
+
export function sviSid(options: SviSidOptions) {
|
|
324
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
325
|
+
const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
|
|
326
|
+
const parameterNames = ['store', 'expiryMs'];
|
|
327
|
+
return (tx: Transaction) =>
|
|
328
|
+
tx.moveCall({
|
|
329
|
+
package: packageAddress,
|
|
330
|
+
module: 'block_scholes_store',
|
|
331
|
+
function: 'svi_sid',
|
|
332
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
export interface SpotArguments {
|
|
336
|
+
store: RawTransactionArgument<string>;
|
|
337
|
+
}
|
|
338
|
+
export interface SpotOptions {
|
|
339
|
+
package?: string;
|
|
340
|
+
arguments: SpotArguments | [store: RawTransactionArgument<string>];
|
|
341
|
+
}
|
|
342
|
+
/** Returns the latest canonical spot observation, or `none` if none has landed. */
|
|
343
|
+
export function spot(options: SpotOptions) {
|
|
344
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
345
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
346
|
+
const parameterNames = ['store'];
|
|
347
|
+
return (tx: Transaction) =>
|
|
348
|
+
tx.moveCall({
|
|
349
|
+
package: packageAddress,
|
|
350
|
+
module: 'block_scholes_store',
|
|
351
|
+
function: 'spot',
|
|
352
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
export interface SpotAtArguments {
|
|
356
|
+
store: RawTransactionArgument<string>;
|
|
357
|
+
sourceTimestampMs: RawTransactionArgument<number | bigint>;
|
|
358
|
+
}
|
|
359
|
+
export interface SpotAtOptions {
|
|
360
|
+
package?: string;
|
|
361
|
+
arguments:
|
|
362
|
+
| SpotAtArguments
|
|
363
|
+
| [
|
|
364
|
+
store: RawTransactionArgument<string>,
|
|
365
|
+
sourceTimestampMs: RawTransactionArgument<number | bigint>,
|
|
366
|
+
];
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Returns the canonical spot observation published at exactly
|
|
370
|
+
* `source_timestamp_ms`.
|
|
371
|
+
*/
|
|
372
|
+
export function spotAt(options: SpotAtOptions) {
|
|
373
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
374
|
+
const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
|
|
375
|
+
const parameterNames = ['store', 'sourceTimestampMs'];
|
|
376
|
+
return (tx: Transaction) =>
|
|
377
|
+
tx.moveCall({
|
|
378
|
+
package: packageAddress,
|
|
379
|
+
module: 'block_scholes_store',
|
|
380
|
+
function: 'spot_at',
|
|
381
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
export interface ForwardArguments {
|
|
385
|
+
store: RawTransactionArgument<string>;
|
|
386
|
+
expiryMs: RawTransactionArgument<number | bigint>;
|
|
387
|
+
}
|
|
388
|
+
export interface ForwardOptions {
|
|
389
|
+
package?: string;
|
|
390
|
+
arguments:
|
|
391
|
+
| ForwardArguments
|
|
392
|
+
| [store: RawTransactionArgument<string>, expiryMs: RawTransactionArgument<number | bigint>];
|
|
393
|
+
}
|
|
394
|
+
/** Returns the latest canonical forward observation at `expiry_ms`. */
|
|
395
|
+
export function forward(options: ForwardOptions) {
|
|
396
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
397
|
+
const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
|
|
398
|
+
const parameterNames = ['store', 'expiryMs'];
|
|
399
|
+
return (tx: Transaction) =>
|
|
400
|
+
tx.moveCall({
|
|
401
|
+
package: packageAddress,
|
|
402
|
+
module: 'block_scholes_store',
|
|
403
|
+
function: 'forward',
|
|
404
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
export interface SviArguments {
|
|
408
|
+
store: RawTransactionArgument<string>;
|
|
409
|
+
expiryMs: RawTransactionArgument<number | bigint>;
|
|
410
|
+
}
|
|
411
|
+
export interface SviOptions {
|
|
412
|
+
package?: string;
|
|
413
|
+
arguments:
|
|
414
|
+
| SviArguments
|
|
415
|
+
| [store: RawTransactionArgument<string>, expiryMs: RawTransactionArgument<number | bigint>];
|
|
416
|
+
}
|
|
417
|
+
/** Returns the latest canonical SVI observation at `expiry_ms`. */
|
|
418
|
+
export function svi(options: SviOptions) {
|
|
419
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
420
|
+
const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
|
|
421
|
+
const parameterNames = ['store', 'expiryMs'];
|
|
422
|
+
return (tx: Transaction) =>
|
|
423
|
+
tx.moveCall({
|
|
424
|
+
package: packageAddress,
|
|
425
|
+
module: 'block_scholes_store',
|
|
426
|
+
function: 'svi',
|
|
427
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
export interface ReadModelTimestampMsArguments {
|
|
431
|
+
read: TransactionArgument;
|
|
432
|
+
}
|
|
433
|
+
export interface ReadModelTimestampMsOptions {
|
|
434
|
+
package?: string;
|
|
435
|
+
arguments: ReadModelTimestampMsArguments | [read: TransactionArgument];
|
|
436
|
+
typeArguments: [string];
|
|
437
|
+
}
|
|
438
|
+
export function readModelTimestampMs(options: ReadModelTimestampMsOptions) {
|
|
439
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
440
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
441
|
+
const parameterNames = ['read'];
|
|
442
|
+
return (tx: Transaction) =>
|
|
443
|
+
tx.moveCall({
|
|
444
|
+
package: packageAddress,
|
|
445
|
+
module: 'block_scholes_store',
|
|
446
|
+
function: 'read_model_timestamp_ms',
|
|
447
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
448
|
+
typeArguments: options.typeArguments,
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
export interface ReadSourceTimestampMsArguments {
|
|
452
|
+
read: TransactionArgument;
|
|
453
|
+
}
|
|
454
|
+
export interface ReadSourceTimestampMsOptions {
|
|
455
|
+
package?: string;
|
|
456
|
+
arguments: ReadSourceTimestampMsArguments | [read: TransactionArgument];
|
|
457
|
+
typeArguments: [string];
|
|
458
|
+
}
|
|
459
|
+
export function readSourceTimestampMs(options: ReadSourceTimestampMsOptions) {
|
|
460
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
461
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
462
|
+
const parameterNames = ['read'];
|
|
463
|
+
return (tx: Transaction) =>
|
|
464
|
+
tx.moveCall({
|
|
465
|
+
package: packageAddress,
|
|
466
|
+
module: 'block_scholes_store',
|
|
467
|
+
function: 'read_source_timestamp_ms',
|
|
468
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
469
|
+
typeArguments: options.typeArguments,
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
export interface ReadOnchainTimestampMsArguments {
|
|
473
|
+
read: TransactionArgument;
|
|
474
|
+
}
|
|
475
|
+
export interface ReadOnchainTimestampMsOptions {
|
|
476
|
+
package?: string;
|
|
477
|
+
arguments: ReadOnchainTimestampMsArguments | [read: TransactionArgument];
|
|
478
|
+
typeArguments: [string];
|
|
479
|
+
}
|
|
480
|
+
export function readOnchainTimestampMs(options: ReadOnchainTimestampMsOptions) {
|
|
481
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
482
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
483
|
+
const parameterNames = ['read'];
|
|
484
|
+
return (tx: Transaction) =>
|
|
485
|
+
tx.moveCall({
|
|
486
|
+
package: packageAddress,
|
|
487
|
+
module: 'block_scholes_store',
|
|
488
|
+
function: 'read_onchain_timestamp_ms',
|
|
489
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
490
|
+
typeArguments: options.typeArguments,
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
export interface ReadWriterDigestArguments {
|
|
494
|
+
read: TransactionArgument;
|
|
495
|
+
}
|
|
496
|
+
export interface ReadWriterDigestOptions {
|
|
497
|
+
package?: string;
|
|
498
|
+
arguments: ReadWriterDigestArguments | [read: TransactionArgument];
|
|
499
|
+
typeArguments: [string];
|
|
500
|
+
}
|
|
501
|
+
export function readWriterDigest(options: ReadWriterDigestOptions) {
|
|
502
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
503
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
504
|
+
const parameterNames = ['read'];
|
|
505
|
+
return (tx: Transaction) =>
|
|
506
|
+
tx.moveCall({
|
|
507
|
+
package: packageAddress,
|
|
508
|
+
module: 'block_scholes_store',
|
|
509
|
+
function: 'read_writer_digest',
|
|
510
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
511
|
+
typeArguments: options.typeArguments,
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
export interface ReadValueArguments {
|
|
515
|
+
read: TransactionArgument;
|
|
516
|
+
}
|
|
517
|
+
export interface ReadValueOptions {
|
|
518
|
+
package?: string;
|
|
519
|
+
arguments: ReadValueArguments | [read: TransactionArgument];
|
|
520
|
+
typeArguments: [string];
|
|
521
|
+
}
|
|
522
|
+
export function readValue(options: ReadValueOptions) {
|
|
523
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
524
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
525
|
+
const parameterNames = ['read'];
|
|
526
|
+
return (tx: Transaction) =>
|
|
527
|
+
tx.moveCall({
|
|
528
|
+
package: packageAddress,
|
|
529
|
+
module: 'block_scholes_store',
|
|
530
|
+
function: 'read_value',
|
|
531
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
532
|
+
typeArguments: options.typeArguments,
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
export interface SviAMagnitudeArguments {
|
|
536
|
+
params: TransactionArgument;
|
|
537
|
+
}
|
|
538
|
+
export interface SviAMagnitudeOptions {
|
|
539
|
+
package?: string;
|
|
540
|
+
arguments: SviAMagnitudeArguments | [params: TransactionArgument];
|
|
541
|
+
}
|
|
542
|
+
export function sviAMagnitude(options: SviAMagnitudeOptions) {
|
|
543
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
544
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
545
|
+
const parameterNames = ['params'];
|
|
546
|
+
return (tx: Transaction) =>
|
|
547
|
+
tx.moveCall({
|
|
548
|
+
package: packageAddress,
|
|
549
|
+
module: 'block_scholes_store',
|
|
550
|
+
function: 'svi_a_magnitude',
|
|
551
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
export interface SviAIsNegativeArguments {
|
|
555
|
+
params: TransactionArgument;
|
|
556
|
+
}
|
|
557
|
+
export interface SviAIsNegativeOptions {
|
|
558
|
+
package?: string;
|
|
559
|
+
arguments: SviAIsNegativeArguments | [params: TransactionArgument];
|
|
560
|
+
}
|
|
561
|
+
export function sviAIsNegative(options: SviAIsNegativeOptions) {
|
|
562
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
563
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
564
|
+
const parameterNames = ['params'];
|
|
565
|
+
return (tx: Transaction) =>
|
|
566
|
+
tx.moveCall({
|
|
567
|
+
package: packageAddress,
|
|
568
|
+
module: 'block_scholes_store',
|
|
569
|
+
function: 'svi_a_is_negative',
|
|
570
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
export interface SviBArguments {
|
|
574
|
+
params: TransactionArgument;
|
|
575
|
+
}
|
|
576
|
+
export interface SviBOptions {
|
|
577
|
+
package?: string;
|
|
578
|
+
arguments: SviBArguments | [params: TransactionArgument];
|
|
579
|
+
}
|
|
580
|
+
export function sviB(options: SviBOptions) {
|
|
581
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
582
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
583
|
+
const parameterNames = ['params'];
|
|
584
|
+
return (tx: Transaction) =>
|
|
585
|
+
tx.moveCall({
|
|
586
|
+
package: packageAddress,
|
|
587
|
+
module: 'block_scholes_store',
|
|
588
|
+
function: 'svi_b',
|
|
589
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
export interface SviSigmaArguments {
|
|
593
|
+
params: TransactionArgument;
|
|
594
|
+
}
|
|
595
|
+
export interface SviSigmaOptions {
|
|
596
|
+
package?: string;
|
|
597
|
+
arguments: SviSigmaArguments | [params: TransactionArgument];
|
|
598
|
+
}
|
|
599
|
+
export function sviSigma(options: SviSigmaOptions) {
|
|
600
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
601
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
602
|
+
const parameterNames = ['params'];
|
|
603
|
+
return (tx: Transaction) =>
|
|
604
|
+
tx.moveCall({
|
|
605
|
+
package: packageAddress,
|
|
606
|
+
module: 'block_scholes_store',
|
|
607
|
+
function: 'svi_sigma',
|
|
608
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
export interface SviRhoMagnitudeArguments {
|
|
612
|
+
params: TransactionArgument;
|
|
613
|
+
}
|
|
614
|
+
export interface SviRhoMagnitudeOptions {
|
|
615
|
+
package?: string;
|
|
616
|
+
arguments: SviRhoMagnitudeArguments | [params: TransactionArgument];
|
|
617
|
+
}
|
|
618
|
+
export function sviRhoMagnitude(options: SviRhoMagnitudeOptions) {
|
|
619
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
620
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
621
|
+
const parameterNames = ['params'];
|
|
622
|
+
return (tx: Transaction) =>
|
|
623
|
+
tx.moveCall({
|
|
624
|
+
package: packageAddress,
|
|
625
|
+
module: 'block_scholes_store',
|
|
626
|
+
function: 'svi_rho_magnitude',
|
|
627
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
export interface SviRhoIsNegativeArguments {
|
|
631
|
+
params: TransactionArgument;
|
|
632
|
+
}
|
|
633
|
+
export interface SviRhoIsNegativeOptions {
|
|
634
|
+
package?: string;
|
|
635
|
+
arguments: SviRhoIsNegativeArguments | [params: TransactionArgument];
|
|
636
|
+
}
|
|
637
|
+
export function sviRhoIsNegative(options: SviRhoIsNegativeOptions) {
|
|
638
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
639
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
640
|
+
const parameterNames = ['params'];
|
|
641
|
+
return (tx: Transaction) =>
|
|
642
|
+
tx.moveCall({
|
|
643
|
+
package: packageAddress,
|
|
644
|
+
module: 'block_scholes_store',
|
|
645
|
+
function: 'svi_rho_is_negative',
|
|
646
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
export interface SviMMagnitudeArguments {
|
|
650
|
+
params: TransactionArgument;
|
|
651
|
+
}
|
|
652
|
+
export interface SviMMagnitudeOptions {
|
|
653
|
+
package?: string;
|
|
654
|
+
arguments: SviMMagnitudeArguments | [params: TransactionArgument];
|
|
655
|
+
}
|
|
656
|
+
export function sviMMagnitude(options: SviMMagnitudeOptions) {
|
|
657
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
658
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
659
|
+
const parameterNames = ['params'];
|
|
660
|
+
return (tx: Transaction) =>
|
|
661
|
+
tx.moveCall({
|
|
662
|
+
package: packageAddress,
|
|
663
|
+
module: 'block_scholes_store',
|
|
664
|
+
function: 'svi_m_magnitude',
|
|
665
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
export interface SviMIsNegativeArguments {
|
|
669
|
+
params: TransactionArgument;
|
|
670
|
+
}
|
|
671
|
+
export interface SviMIsNegativeOptions {
|
|
672
|
+
package?: string;
|
|
673
|
+
arguments: SviMIsNegativeArguments | [params: TransactionArgument];
|
|
674
|
+
}
|
|
675
|
+
export function sviMIsNegative(options: SviMIsNegativeOptions) {
|
|
676
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
677
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
678
|
+
const parameterNames = ['params'];
|
|
679
|
+
return (tx: Transaction) =>
|
|
680
|
+
tx.moveCall({
|
|
681
|
+
package: packageAddress,
|
|
682
|
+
module: 'block_scholes_store',
|
|
683
|
+
function: 'svi_m_is_negative',
|
|
684
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
export interface ApplySpotBatchArguments {
|
|
688
|
+
store: RawTransactionArgument<string>;
|
|
689
|
+
batch: TransactionArgument;
|
|
690
|
+
}
|
|
691
|
+
export interface ApplySpotBatchOptions {
|
|
692
|
+
package?: string;
|
|
693
|
+
arguments:
|
|
694
|
+
ApplySpotBatchArguments | [store: RawTransactionArgument<string>, batch: TransactionArgument];
|
|
695
|
+
}
|
|
696
|
+
/** Ingest the canonical spot batch for this store's base asset. */
|
|
697
|
+
export function applySpotBatch(options: ApplySpotBatchOptions) {
|
|
698
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
699
|
+
const argumentsTypes = [null, null, '0x2::clock::Clock'] satisfies (string | null)[];
|
|
700
|
+
const parameterNames = ['store', 'batch'];
|
|
701
|
+
return (tx: Transaction) =>
|
|
702
|
+
tx.moveCall({
|
|
703
|
+
package: packageAddress,
|
|
704
|
+
module: 'block_scholes_store',
|
|
705
|
+
function: 'apply_spot_batch',
|
|
706
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
export interface InsertAtArguments {
|
|
710
|
+
store: RawTransactionArgument<string>;
|
|
711
|
+
batch: TransactionArgument;
|
|
712
|
+
}
|
|
713
|
+
export interface InsertAtOptions {
|
|
714
|
+
package?: string;
|
|
715
|
+
arguments:
|
|
716
|
+
InsertAtArguments | [store: RawTransactionArgument<string>, batch: TransactionArgument];
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Insert the canonical spot batch into exact minute-boundary history without
|
|
720
|
+
* changing `latest`. A valid batch whose signed `source_timestamp_ms` is not a
|
|
721
|
+
* minute boundary, or whose spot is zero or wider than `u64`, is ignored without
|
|
722
|
+
* aborting. The first admissible observation at a boundary owns the key and cannot
|
|
723
|
+
* be replaced.
|
|
724
|
+
*/
|
|
725
|
+
export function insertAt(options: InsertAtOptions) {
|
|
726
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
727
|
+
const argumentsTypes = [null, null, '0x2::clock::Clock'] satisfies (string | null)[];
|
|
728
|
+
const parameterNames = ['store', 'batch'];
|
|
729
|
+
return (tx: Transaction) =>
|
|
730
|
+
tx.moveCall({
|
|
731
|
+
package: packageAddress,
|
|
732
|
+
module: 'block_scholes_store',
|
|
733
|
+
function: 'insert_at',
|
|
734
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
export interface ApplyForwardBatchArguments {
|
|
738
|
+
store: RawTransactionArgument<string>;
|
|
739
|
+
batch: TransactionArgument;
|
|
740
|
+
expiriesMs: RawTransactionArgument<Array<number | bigint>>;
|
|
741
|
+
}
|
|
742
|
+
export interface ApplyForwardBatchOptions {
|
|
743
|
+
package?: string;
|
|
744
|
+
arguments:
|
|
745
|
+
| ApplyForwardBatchArguments
|
|
746
|
+
| [
|
|
747
|
+
store: RawTransactionArgument<string>,
|
|
748
|
+
batch: TransactionArgument,
|
|
749
|
+
expiriesMs: RawTransactionArgument<Array<number | bigint>>,
|
|
750
|
+
];
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Ingest canonical forwards for this store's base asset. `expiries_ms[i]` is an
|
|
754
|
+
* untrusted descriptor witness for signed update `i`; equality with the
|
|
755
|
+
* upstream-derived SID proves the association before any observation is stored.
|
|
756
|
+
*/
|
|
757
|
+
export function applyForwardBatch(options: ApplyForwardBatchOptions) {
|
|
758
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
759
|
+
const argumentsTypes = [null, null, 'vector<u64>', '0x2::clock::Clock'] satisfies (
|
|
760
|
+
string | null
|
|
761
|
+
)[];
|
|
762
|
+
const parameterNames = ['store', 'batch', 'expiriesMs'];
|
|
763
|
+
return (tx: Transaction) =>
|
|
764
|
+
tx.moveCall({
|
|
765
|
+
package: packageAddress,
|
|
766
|
+
module: 'block_scholes_store',
|
|
767
|
+
function: 'apply_forward_batch',
|
|
768
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
export interface ApplySviBatchArguments {
|
|
772
|
+
store: RawTransactionArgument<string>;
|
|
773
|
+
batch: TransactionArgument;
|
|
774
|
+
expiriesMs: RawTransactionArgument<Array<number | bigint>>;
|
|
775
|
+
}
|
|
776
|
+
export interface ApplySviBatchOptions {
|
|
777
|
+
package?: string;
|
|
778
|
+
arguments:
|
|
779
|
+
| ApplySviBatchArguments
|
|
780
|
+
| [
|
|
781
|
+
store: RawTransactionArgument<string>,
|
|
782
|
+
batch: TransactionArgument,
|
|
783
|
+
expiriesMs: RawTransactionArgument<Array<number | bigint>>,
|
|
784
|
+
];
|
|
785
|
+
}
|
|
786
|
+
/** Ingest canonical SVI observations for this store's base asset. */
|
|
787
|
+
export function applySviBatch(options: ApplySviBatchOptions) {
|
|
788
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
789
|
+
const argumentsTypes = [null, null, 'vector<u64>', '0x2::clock::Clock'] satisfies (
|
|
790
|
+
string | null
|
|
791
|
+
)[];
|
|
792
|
+
const parameterNames = ['store', 'batch', 'expiriesMs'];
|
|
793
|
+
return (tx: Transaction) =>
|
|
794
|
+
tx.moveCall({
|
|
795
|
+
package: packageAddress,
|
|
796
|
+
module: 'block_scholes_store',
|
|
797
|
+
function: 'apply_svi_batch',
|
|
798
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
export interface MigrateValueStoreArguments {
|
|
802
|
+
store: RawTransactionArgument<string>;
|
|
803
|
+
}
|
|
804
|
+
export interface MigrateValueStoreOptions {
|
|
805
|
+
package?: string;
|
|
806
|
+
arguments: MigrateValueStoreArguments | [store: RawTransactionArgument<string>];
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Migrate this store to the running package version. Forward-only:
|
|
810
|
+
* `current_version!()` is compiled into each package version's bytecode.
|
|
811
|
+
*/
|
|
812
|
+
export function migrateValueStore(options: MigrateValueStoreOptions) {
|
|
813
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
814
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
815
|
+
const parameterNames = ['store'];
|
|
816
|
+
return (tx: Transaction) =>
|
|
817
|
+
tx.moveCall({
|
|
818
|
+
package: packageAddress,
|
|
819
|
+
module: 'block_scholes_store',
|
|
820
|
+
function: 'migrate_value_store',
|
|
821
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
export interface MigrateSviStoreArguments {
|
|
825
|
+
store: RawTransactionArgument<string>;
|
|
826
|
+
}
|
|
827
|
+
export interface MigrateSviStoreOptions {
|
|
828
|
+
package?: string;
|
|
829
|
+
arguments: MigrateSviStoreArguments | [store: RawTransactionArgument<string>];
|
|
830
|
+
}
|
|
831
|
+
export function migrateSviStore(options: MigrateSviStoreOptions) {
|
|
832
|
+
const packageAddress = options.package ?? '@local-pkg/propbook';
|
|
833
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
834
|
+
const parameterNames = ['store'];
|
|
835
|
+
return (tx: Transaction) =>
|
|
836
|
+
tx.moveCall({
|
|
837
|
+
package: packageAddress,
|
|
838
|
+
module: 'block_scholes_store',
|
|
839
|
+
function: 'migrate_svi_store',
|
|
840
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
841
|
+
});
|
|
842
|
+
}
|