@mysten/deepbook-v3 2.1.3 → 2.3.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 +45 -0
- package/PREDICT.md +17 -5
- package/dist/account.d.mts.map +1 -1
- package/dist/account.mjs +3 -1
- package/dist/account.mjs.map +1 -1
- package/dist/contracts/account/account.d.mts +23 -23
- package/dist/contracts/account/account.d.mts.map +1 -1
- package/dist/contracts/account/account_events.d.mts +20 -20
- package/dist/contracts/account/account_registry.d.mts +19 -19
- package/dist/contracts/account/account_registry.d.mts.map +1 -1
- 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/deps/sui/vec_map.mjs +37 -0
- package/dist/contracts/deepbook_predict/deps/sui/vec_map.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_cash.mjs +1 -1
- package/dist/contracts/deepbook_predict/expiry_cash.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/expiry_market.mjs +15 -6
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/market_manager.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/plp.mjs +53 -31
- package/dist/contracts/deepbook_predict/plp.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pool_accounting.mjs +7 -7
- package/dist/contracts/deepbook_predict/pool_accounting.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/predict_account.mjs +1 -1
- package/dist/contracts/deepbook_predict/predict_account.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing.mjs +13 -1
- package/dist/contracts/deepbook_predict/pricing.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/registry.mjs +2 -1
- package/dist/contracts/deepbook_predict/registry.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/strike_exposure.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs +13 -1
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/vault_events.mjs +19 -7
- package/dist/contracts/deepbook_predict/vault_events.mjs.map +1 -1
- package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
- package/dist/contracts/deepbook_sessions/session_config.d.mts.map +1 -1
- package/dist/contracts/deepbook_sessions/sessions.d.mts +22 -22
- package/dist/contracts/deepbook_sessions/sessions.d.mts.map +1 -1
- package/dist/deployments/index.d.mts +3 -2
- package/dist/deployments/index.d.mts.map +1 -1
- package/dist/deployments/index.mjs +4 -1
- package/dist/deployments/index.mjs.map +1 -1
- package/dist/deployments/mainnet.d.mts +14 -0
- package/dist/deployments/mainnet.d.mts.map +1 -0
- package/dist/deployments/mainnet.mjs +73 -0
- package/dist/deployments/mainnet.mjs.map +1 -0
- package/dist/deployments/testnet.mjs +23 -23
- package/dist/deployments/testnet.mjs.map +1 -1
- package/dist/deployments/types.d.mts +1 -1
- package/dist/predict/client.d.mts +25 -4
- package/dist/predict/client.d.mts.map +1 -1
- package/dist/predict/client.mjs +4 -4
- package/dist/predict/client.mjs.map +1 -1
- package/dist/predict/config/index.d.mts +2 -0
- package/dist/predict/config/index.d.mts.map +1 -1
- package/dist/predict/config/index.mjs +4 -1
- package/dist/predict/config/index.mjs.map +1 -1
- package/dist/predict/config/mainnet.d.mts +17 -0
- package/dist/predict/config/mainnet.d.mts.map +1 -0
- package/dist/predict/config/mainnet.mjs +26 -0
- package/dist/predict/config/mainnet.mjs.map +1 -0
- package/dist/predict/config/types.d.mts +6 -0
- package/dist/predict/config/types.d.mts.map +1 -1
- package/dist/predict/index.d.mts +4 -2
- package/dist/predict/index.mjs +3 -1
- package/dist/predict/pricing.d.mts +6 -6
- package/dist/predict/pricing.d.mts.map +1 -1
- package/dist/predict/pricing.mjs +6 -6
- package/dist/predict/pricing.mjs.map +1 -1
- package/dist/predict/reads/balances.mjs.map +1 -1
- package/dist/predict/reads/markets.mjs +1 -1
- package/dist/predict/reads/markets.mjs.map +1 -1
- package/dist/predict/reads/pricing.d.mts +2 -1
- package/dist/predict/reads/pricing.d.mts.map +1 -1
- package/dist/predict/reads/pricing.mjs.map +1 -1
- package/dist/sessions.d.mts.map +1 -1
- package/dist/sessions.mjs +3 -1
- 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/deepbookAdmin.d.mts +4 -4
- package/dist/transactions/marginAdmin.d.mts +7 -7
- 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/marginPool.d.mts.map +1 -1
- 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 +3 -3
- package/src/account.ts +3 -1
- package/src/contracts/deepbook_predict/builder_code.ts +3 -3
- package/src/contracts/deepbook_predict/config_events.ts +9 -2
- package/src/contracts/deepbook_predict/deps/sui/vec_map.ts +33 -0
- package/src/contracts/deepbook_predict/expiry_cash.ts +1 -1
- package/src/contracts/deepbook_predict/expiry_market.ts +70 -11
- package/src/contracts/deepbook_predict/market_lifecycle_cap.ts +3 -10
- package/src/contracts/deepbook_predict/market_manager.ts +2 -2
- package/src/contracts/deepbook_predict/order_events.ts +6 -6
- package/src/contracts/deepbook_predict/plp.ts +263 -81
- package/src/contracts/deepbook_predict/pool_accounting.ts +14 -14
- package/src/contracts/deepbook_predict/pool_valuation_cap.ts +69 -0
- package/src/contracts/deepbook_predict/predict_account.ts +1 -1
- package/src/contracts/deepbook_predict/pricing.ts +16 -4
- package/src/contracts/deepbook_predict/protocol_config.ts +202 -7
- package/src/contracts/deepbook_predict/registry.ts +91 -17
- package/src/contracts/deepbook_predict/strike_exposure.ts +1 -1
- package/src/contracts/deepbook_predict/strike_payout_tree.ts +27 -0
- package/src/contracts/deepbook_predict/vault_events.ts +45 -14
- package/src/contracts/propbook/block_scholes_store.ts +8 -42
- package/src/deployments/index.ts +13 -3
- package/src/deployments/mainnet.ts +107 -0
- package/src/deployments/testnet.ts +25 -25
- package/src/deployments/types.ts +1 -1
- package/src/predict/client.ts +45 -15
- package/src/predict/config/index.ts +7 -2
- package/src/predict/config/mainnet.ts +27 -0
- package/src/predict/config/types.ts +7 -1
- package/src/predict/index.ts +5 -0
- package/src/predict/pricing.ts +11 -9
- package/src/predict/reads/balances.ts +1 -1
- package/src/predict/reads/markets.ts +1 -1
- package/src/predict/reads/pricing.ts +2 -1
- package/src/sessions.ts +4 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { MAINNET_ACCOUNT, MAINNET_DEPLOYMENT, MAINNET_PREDICT, MAINNET_SESSIONS, MAINNET_UNITS } from "./mainnet.mjs";
|
|
1
2
|
import { TESTNET_ACCOUNT, TESTNET_DEPLOYMENT, TESTNET_PREDICT, TESTNET_SESSIONS, TESTNET_UNITS } from "./testnet.mjs";
|
|
2
3
|
|
|
3
4
|
//#region src/deployments/index.ts
|
|
4
5
|
function unrecorded(network, override) {
|
|
5
|
-
return /* @__PURE__ */ new Error(`@mysten/deepbook-v3: no deployment recorded for network '${network}'. Predict, sessions and the account primitive are testnet
|
|
6
|
+
return /* @__PURE__ */ new Error(`@mysten/deepbook-v3: no deployment recorded for network '${network}'. Predict, sessions and the account primitive are recorded for testnet and mainnet. For your own deployment, ${override}`);
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* @description Which deployment the ids on `network` came from — its name and the
|
|
@@ -12,6 +13,7 @@ function unrecorded(network, override) {
|
|
|
12
13
|
*/
|
|
13
14
|
function getDeployment(network) {
|
|
14
15
|
if (network === "testnet") return TESTNET_DEPLOYMENT;
|
|
16
|
+
if (network === "mainnet") return MAINNET_DEPLOYMENT;
|
|
15
17
|
throw unrecorded(network, "read the deployment name and commit from your own deploy manifest.");
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
@@ -22,6 +24,7 @@ function getDeployment(network) {
|
|
|
22
24
|
*/
|
|
23
25
|
function getUnits(network) {
|
|
24
26
|
if (network === "testnet") return TESTNET_UNITS;
|
|
27
|
+
if (network === "mainnet") return MAINNET_UNITS;
|
|
25
28
|
throw unrecorded(network, "read these scale constants from your own deploy manifest.");
|
|
26
29
|
}
|
|
27
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/deployments/index.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Canonical per-network deployment ids.\n *\n * Every subpath reads its slice of this one record rather than carrying its own copy, so a\n * redeploy is a single regeneration (`pnpm sync-deployment`) and the subpaths cannot end up\n * addressing different deployments. The records themselves are generated from the deploy\n * tooling's manifest — see `scripts/sync-deployment.ts`.\n */\n\nimport type { SuiClientTypes } from '@mysten/sui/client';\n\nimport {\n\tTESTNET_ACCOUNT,\n\tTESTNET_DEPLOYMENT,\n\tTESTNET_PREDICT,\n\tTESTNET_SESSIONS,\n\tTESTNET_UNITS,\n} from './testnet.js';\nimport type { DeploymentInfo, DeploymentUnits } from './types.js';\n\nexport type {\n\tAccountIds,\n\tDeploymentInfo,\n\tDeploymentUnits,\n\tPredictIds,\n\tSessionsIds,\n} from './types.js';\n\nexport { TESTNET_ACCOUNT, TESTNET_DEPLOYMENT, TESTNET_PREDICT, TESTNET_SESSIONS, TESTNET_UNITS };\n\n/** Networks this package carries ids for.
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/deployments/index.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Canonical per-network deployment ids.\n *\n * Every subpath reads its slice of this one record rather than carrying its own copy, so a\n * redeploy is a single regeneration (`pnpm sync-deployment`) and the subpaths cannot end up\n * addressing different deployments. The records themselves are generated from the deploy\n * tooling's manifest — see `scripts/sync-deployment.ts`.\n */\n\nimport type { SuiClientTypes } from '@mysten/sui/client';\n\nimport {\n\tMAINNET_ACCOUNT,\n\tMAINNET_DEPLOYMENT,\n\tMAINNET_PREDICT,\n\tMAINNET_SESSIONS,\n\tMAINNET_UNITS,\n} from './mainnet.js';\nimport {\n\tTESTNET_ACCOUNT,\n\tTESTNET_DEPLOYMENT,\n\tTESTNET_PREDICT,\n\tTESTNET_SESSIONS,\n\tTESTNET_UNITS,\n} from './testnet.js';\nimport type { DeploymentInfo, DeploymentUnits } from './types.js';\n\nexport type {\n\tAccountIds,\n\tDeploymentInfo,\n\tDeploymentUnits,\n\tPredictIds,\n\tSessionsIds,\n} from './types.js';\n\nexport { TESTNET_ACCOUNT, TESTNET_DEPLOYMENT, TESTNET_PREDICT, TESTNET_SESSIONS, TESTNET_UNITS };\nexport { MAINNET_ACCOUNT, MAINNET_DEPLOYMENT, MAINNET_PREDICT, MAINNET_SESSIONS, MAINNET_UNITS };\n\n/** Networks this package carries ids for. */\nexport type DeployedNetwork = 'testnet' | 'mainnet';\n\n/**\n * Accepts the same wide network type the Sui client exposes, so `getUnits(client.network)`\n * composes. Narrowing to `DeployedNetwork` would reject that, and listing\n * `'testnet' | 'mainnet'` would be worse still: it admits exactly one value that always\n * throws while rejecting `'devnet'` at compile time.\n */\nexport type NetworkArg = SuiClientTypes.Network;\n\nfunction unrecorded(network: string, override: string): Error {\n\treturn new Error(\n\t\t`@mysten/deepbook-v3: no deployment recorded for network '${network}'. ` +\n\t\t\t'Predict, sessions and the account primitive are recorded for testnet and mainnet. ' +\n\t\t\t`For your own deployment, ${override}`,\n\t);\n}\n\n/**\n * @description Which deployment the ids on `network` came from — its name and the\n * deepbookv3 commit they were generated at. Useful when a bug report needs to say which\n * on-chain deployment an SDK build was pinned to.\n * @throws if the network has no deployment recorded, rather than returning placeholder ids.\n */\nexport function getDeployment(network: NetworkArg): DeploymentInfo {\n\tif (network === 'testnet') return TESTNET_DEPLOYMENT;\n\tif (network === 'mainnet') return MAINNET_DEPLOYMENT;\n\tthrow unrecorded(network, 'read the deployment name and commit from your own deploy manifest.');\n}\n\n/**\n * @description Scale constants for `network` — lot size, fixed-point scale, and coin\n * decimals. Deployment-wide, so any subpath formatting a custody balance can read them\n * rather than hardcoding 6.\n * @throws if the network has no recorded deployment.\n */\nexport function getUnits(network: NetworkArg): DeploymentUnits {\n\tif (network === 'testnet') return TESTNET_UNITS;\n\tif (network === 'mainnet') return MAINNET_UNITS;\n\tthrow unrecorded(network, 'read these scale constants from your own deploy manifest.');\n}\n"],"mappings":";;;;AAoDA,SAAS,WAAW,SAAiB,UAAyB;AAC7D,wBAAO,IAAI,MACV,4DAA4D,QAAQ,gHAEvC,WAC7B;;;;;;;;AASF,SAAgB,cAAc,SAAqC;AAClE,KAAI,YAAY,UAAW,QAAO;AAClC,KAAI,YAAY,UAAW,QAAO;AAClC,OAAM,WAAW,SAAS,qEAAqE;;;;;;;;AAShG,SAAgB,SAAS,SAAsC;AAC9D,KAAI,YAAY,UAAW,QAAO;AAClC,KAAI,YAAY,UAAW,QAAO;AAClC,OAAM,WAAW,SAAS,4DAA4D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DeploymentInfo, DeploymentUnits } from "./types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/deployments/mainnet.d.ts
|
|
4
|
+
/** Which on-chain deployment the ids below came from. */
|
|
5
|
+
declare const MAINNET_DEPLOYMENT: DeploymentInfo;
|
|
6
|
+
/**
|
|
7
|
+
* Scale constants the deployment owns rather than the SDK. Deployment-wide:
|
|
8
|
+
* `quoteCoinDecimals` and `fixedPointScale` apply to any subpath formatting a custody
|
|
9
|
+
* balance, not just Predict.
|
|
10
|
+
*/
|
|
11
|
+
declare const MAINNET_UNITS: DeploymentUnits;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { MAINNET_DEPLOYMENT, MAINNET_UNITS };
|
|
14
|
+
//# sourceMappingURL=mainnet.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mainnet.d.mts","names":[],"sources":["../../src/deployments/mainnet.ts"],"mappings":";;;;cA2Ba,kBAAA,EAAoB,cAAA;;;;;;cAqCpB,aAAA,EAAe,eAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//#region src/deployments/mainnet.ts
|
|
2
|
+
/** Which on-chain deployment the ids below came from. */
|
|
3
|
+
const MAINNET_DEPLOYMENT = Object.freeze({
|
|
4
|
+
deployment: "deepbook-predict-mainnet",
|
|
5
|
+
network: "mainnet",
|
|
6
|
+
chainId: "35834a8a",
|
|
7
|
+
sourceCommit: "14a7e8f822e0397df2d61fbfbce3ef21086891c2"
|
|
8
|
+
});
|
|
9
|
+
/** Ids for the shared `account` primitive — the `/account` subpath's slice. */
|
|
10
|
+
const MAINNET_ACCOUNT = Object.freeze({
|
|
11
|
+
accountPackageId: "0xa6f1b22aaeb429f6fd8f01c13f605256e00876457fd122da8a0e2c1045c75929",
|
|
12
|
+
accountRegistry: "0x210ba485d973b5356e9078318837137efabdd5ffb9eeb3705ba7eef3340324fc"
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Ids for time-limited sessions — the `/sessions` subpath's slice.
|
|
16
|
+
*
|
|
17
|
+
* `deepbookRegistry` is only needed by the DeepBook **spot** session wrappers; the Predict
|
|
18
|
+
* wrappers never take it. It is carried here so a spot caller does not have to reach into
|
|
19
|
+
* the package root for one id.
|
|
20
|
+
*/
|
|
21
|
+
const MAINNET_SESSIONS = Object.freeze({
|
|
22
|
+
sessionsPackageId: "0xebfa125baee571c1f8c903c1dd54a5bc57949db82469b836c32eca251756c82a",
|
|
23
|
+
sessionsConfig: "0x0c5f64365b3bf1f67827d6975893190079cc048247f9ff0b08390aa9ee697c5c",
|
|
24
|
+
accountPackageId: "0xa6f1b22aaeb429f6fd8f01c13f605256e00876457fd122da8a0e2c1045c75929",
|
|
25
|
+
accountRegistry: "0x210ba485d973b5356e9078318837137efabdd5ffb9eeb3705ba7eef3340324fc",
|
|
26
|
+
deepbookRegistry: "0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d",
|
|
27
|
+
deepbookCoreAccountPackageId: "0xebcd5b403ee78021e3f78d1c77e2117a676caa8a9754dedb99e7b102b0d81872",
|
|
28
|
+
protocolConfig: "0x55e8800bcb31b792683ca4385bd533716e2a9721364236a69ee2c3bee61dd8f2"
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Scale constants the deployment owns rather than the SDK. Deployment-wide:
|
|
32
|
+
* `quoteCoinDecimals` and `fixedPointScale` apply to any subpath formatting a custody
|
|
33
|
+
* balance, not just Predict.
|
|
34
|
+
*/
|
|
35
|
+
const MAINNET_UNITS = Object.freeze({
|
|
36
|
+
positionLotSize: 1e4,
|
|
37
|
+
fixedPointScale: 1e9,
|
|
38
|
+
quoteCoinDecimals: 6,
|
|
39
|
+
positionQuantityDecimals: 6
|
|
40
|
+
});
|
|
41
|
+
/** Ids for DeepBook Predict — the `/predict` subpath's slice. */
|
|
42
|
+
const MAINNET_PREDICT = Object.freeze({
|
|
43
|
+
network: "mainnet",
|
|
44
|
+
packages: Object.freeze({
|
|
45
|
+
predict: "0x774f9555865a7b96e31ec982f62d5bdf9d74bf57a6468b5ed41340c231afd7df",
|
|
46
|
+
account: "0xa6f1b22aaeb429f6fd8f01c13f605256e00876457fd122da8a0e2c1045c75929",
|
|
47
|
+
propbook: "0x2a63e378ab0138cdcb12651a093f3799f8b8e4f6c927ce6de0e8bc7ded0ec49d"
|
|
48
|
+
}),
|
|
49
|
+
objects: Object.freeze({
|
|
50
|
+
registry: "0xc98e430d82bed9f777288061faa1988da705a97db7f0da9f215ab372c53a2362",
|
|
51
|
+
protocolConfig: "0x55e8800bcb31b792683ca4385bd533716e2a9721364236a69ee2c3bee61dd8f2",
|
|
52
|
+
poolVault: "0x3f80653bf9324162254d89724276aae7b36ba7c83d4650214afbf266da98f492",
|
|
53
|
+
oracleRegistry: "0x1ff67a8499b0af7c0fbb26ba82c319be25413af93d9a961ee60f8d1229e7de7c",
|
|
54
|
+
accountRegistry: "0x210ba485d973b5356e9078318837137efabdd5ffb9eeb3705ba7eef3340324fc"
|
|
55
|
+
}),
|
|
56
|
+
quoteCoinType: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
|
|
57
|
+
coinTypes: Object.freeze({
|
|
58
|
+
plp: "0x774f9555865a7b96e31ec982f62d5bdf9d74bf57a6468b5ed41340c231afd7df::plp::PLP",
|
|
59
|
+
deep: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP"
|
|
60
|
+
}),
|
|
61
|
+
units: MAINNET_UNITS,
|
|
62
|
+
underlyings: Object.freeze({ BTC: Object.freeze({
|
|
63
|
+
symbol: "BTC",
|
|
64
|
+
propbookUnderlyingId: 1,
|
|
65
|
+
pythFeed: "0x44bd2e00549973bb6a58785836e97ed80b4979e67dc3bf312c997e56053e5376",
|
|
66
|
+
blockScholesValueStore: "0xe7c83ee4ac0c300d68d8d4c3d265d78287b4767dcbc5f279cd6f210b6248d493",
|
|
67
|
+
blockScholesSviStore: "0x8e5568aebf490c2adfd4e010a9b4ddcf7c774183f58c98fcd438bae1fc68f561"
|
|
68
|
+
}) })
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { MAINNET_ACCOUNT, MAINNET_DEPLOYMENT, MAINNET_PREDICT, MAINNET_SESSIONS, MAINNET_UNITS };
|
|
73
|
+
//# sourceMappingURL=mainnet.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mainnet.mjs","names":[],"sources":["../../src/deployments/mainnet.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// GENERATED by `pnpm sync-deployment` from the deploy tooling's own manifest\n// (`packages/predict/deployment/deployment.mainnet.json`). Do not hand-edit:\n// the next regeneration overwrites it, and a hand-patched id is exactly the drift this\n// file exists to prevent. To move to a new deployment, check the sibling deepbookv3\n// checkout out to the new anchor and re-run the script.\n//\n// Deployment: deepbook-predict-mainnet\n// sourceCommit: 14a7e8f822e0397df2d61fbfbce3ef21086891c2\n//\n// Runtime-dependency-free — every subpath reads a slice of this, so a value import here\n// would pull that module into all of their graphs. The type import below is erased.\n//\n// Frozen: these are shared module singletons, so an accessor handing one to a caller who\n// mutates it would change what every other caller sees.\n\nimport type {\n\tAccountIds,\n\tDeploymentInfo,\n\tDeploymentUnits,\n\tPredictIds,\n\tSessionsIds,\n} from './types.js';\n\n/** Which on-chain deployment the ids below came from. */\nexport const MAINNET_DEPLOYMENT: DeploymentInfo = Object.freeze({\n\tdeployment: 'deepbook-predict-mainnet',\n\tnetwork: 'mainnet',\n\tchainId: '35834a8a',\n\tsourceCommit: '14a7e8f822e0397df2d61fbfbce3ef21086891c2',\n});\n\n/** Ids for the shared `account` primitive — the `/account` subpath's slice. */\nexport const MAINNET_ACCOUNT: AccountIds = Object.freeze({\n\taccountPackageId: '0xa6f1b22aaeb429f6fd8f01c13f605256e00876457fd122da8a0e2c1045c75929',\n\taccountRegistry: '0x210ba485d973b5356e9078318837137efabdd5ffb9eeb3705ba7eef3340324fc',\n});\n\n/**\n * Ids for time-limited sessions — the `/sessions` subpath's slice.\n *\n * `deepbookRegistry` is only needed by the DeepBook **spot** session wrappers; the Predict\n * wrappers never take it. It is carried here so a spot caller does not have to reach into\n * the package root for one id.\n */\nexport const MAINNET_SESSIONS: SessionsIds = Object.freeze({\n\tsessionsPackageId: '0xebfa125baee571c1f8c903c1dd54a5bc57949db82469b836c32eca251756c82a',\n\tsessionsConfig: '0x0c5f64365b3bf1f67827d6975893190079cc048247f9ff0b08390aa9ee697c5c',\n\taccountPackageId: '0xa6f1b22aaeb429f6fd8f01c13f605256e00876457fd122da8a0e2c1045c75929',\n\taccountRegistry: '0x210ba485d973b5356e9078318837137efabdd5ffb9eeb3705ba7eef3340324fc',\n\tdeepbookRegistry: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',\n\tdeepbookCoreAccountPackageId:\n\t\t'0xebcd5b403ee78021e3f78d1c77e2117a676caa8a9754dedb99e7b102b0d81872',\n\t/** Required by every Predict session wrapper — they all take `config: &ProtocolConfig`. */\n\tprotocolConfig: '0x55e8800bcb31b792683ca4385bd533716e2a9721364236a69ee2c3bee61dd8f2',\n});\n\n/**\n * Scale constants the deployment owns rather than the SDK. Deployment-wide:\n * `quoteCoinDecimals` and `fixedPointScale` apply to any subpath formatting a custody\n * balance, not just Predict.\n */\nexport const MAINNET_UNITS: DeploymentUnits = Object.freeze({\n\tpositionLotSize: 10000,\n\tfixedPointScale: 1000000000,\n\tquoteCoinDecimals: 6,\n\tpositionQuantityDecimals: 6,\n});\n\n/** Ids for DeepBook Predict — the `/predict` subpath's slice. */\nexport const MAINNET_PREDICT: PredictIds = Object.freeze({\n\tnetwork: 'mainnet',\n\tpackages: Object.freeze({\n\t\tpredict: '0x774f9555865a7b96e31ec982f62d5bdf9d74bf57a6468b5ed41340c231afd7df',\n\t\taccount: '0xa6f1b22aaeb429f6fd8f01c13f605256e00876457fd122da8a0e2c1045c75929',\n\t\tpropbook: '0x2a63e378ab0138cdcb12651a093f3799f8b8e4f6c927ce6de0e8bc7ded0ec49d',\n\t}),\n\tobjects: Object.freeze({\n\t\tregistry: '0xc98e430d82bed9f777288061faa1988da705a97db7f0da9f215ab372c53a2362',\n\t\tprotocolConfig: '0x55e8800bcb31b792683ca4385bd533716e2a9721364236a69ee2c3bee61dd8f2',\n\t\tpoolVault: '0x3f80653bf9324162254d89724276aae7b36ba7c83d4650214afbf266da98f492',\n\t\toracleRegistry: '0x1ff67a8499b0af7c0fbb26ba82c319be25413af93d9a961ee60f8d1229e7de7c',\n\t\taccountRegistry: '0x210ba485d973b5356e9078318837137efabdd5ffb9eeb3705ba7eef3340324fc',\n\t}),\n\tquoteCoinType: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',\n\t/**\n\t * `plp` is the LP share coin type. It is NOT derivable from `packages.predict`: a Move\n\t * type tag keeps the ORIGINAL package id across an upgrade, while `packages.predict`\n\t * moves to the latest. They agree only while predict is at v1.\n\t */\n\tcoinTypes: Object.freeze({\n\t\tplp: '0x774f9555865a7b96e31ec982f62d5bdf9d74bf57a6468b5ed41340c231afd7df::plp::PLP',\n\t\tdeep: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP',\n\t}),\n\tunits: MAINNET_UNITS,\n\tunderlyings: Object.freeze({\n\t\tBTC: Object.freeze({\n\t\t\tsymbol: 'BTC',\n\t\t\tpropbookUnderlyingId: 1,\n\t\t\tpythFeed: '0x44bd2e00549973bb6a58785836e97ed80b4979e67dc3bf312c997e56053e5376',\n\t\t\tblockScholesValueStore: '0xe7c83ee4ac0c300d68d8d4c3d265d78287b4767dcbc5f279cd6f210b6248d493',\n\t\t\tblockScholesSviStore: '0x8e5568aebf490c2adfd4e010a9b4ddcf7c774183f58c98fcd438bae1fc68f561',\n\t\t}),\n\t}),\n});\n"],"mappings":";;AA2BA,MAAa,qBAAqC,OAAO,OAAO;CAC/D,YAAY;CACZ,SAAS;CACT,SAAS;CACT,cAAc;CACd,CAAC;;AAGF,MAAa,kBAA8B,OAAO,OAAO;CACxD,kBAAkB;CAClB,iBAAiB;CACjB,CAAC;;;;;;;;AASF,MAAa,mBAAgC,OAAO,OAAO;CAC1D,mBAAmB;CACnB,gBAAgB;CAChB,kBAAkB;CAClB,iBAAiB;CACjB,kBAAkB;CAClB,8BACC;CAED,gBAAgB;CAChB,CAAC;;;;;;AAOF,MAAa,gBAAiC,OAAO,OAAO;CAC3D,iBAAiB;CACjB,iBAAiB;CACjB,mBAAmB;CACnB,0BAA0B;CAC1B,CAAC;;AAGF,MAAa,kBAA8B,OAAO,OAAO;CACxD,SAAS;CACT,UAAU,OAAO,OAAO;EACvB,SAAS;EACT,SAAS;EACT,UAAU;EACV,CAAC;CACF,SAAS,OAAO,OAAO;EACtB,UAAU;EACV,gBAAgB;EAChB,WAAW;EACX,gBAAgB;EAChB,iBAAiB;EACjB,CAAC;CACF,eAAe;CAMf,WAAW,OAAO,OAAO;EACxB,KAAK;EACL,MAAM;EACN,CAAC;CACF,OAAO;CACP,aAAa,OAAO,OAAO,EAC1B,KAAK,OAAO,OAAO;EAClB,QAAQ;EACR,sBAAsB;EACtB,UAAU;EACV,wBAAwB;EACxB,sBAAsB;EACtB,CAAC,EACF,CAAC;CACF,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
//#region src/deployments/testnet.ts
|
|
2
2
|
/** Which on-chain deployment the ids below came from. */
|
|
3
3
|
const TESTNET_DEPLOYMENT = Object.freeze({
|
|
4
|
-
deployment: "predict-testnet
|
|
4
|
+
deployment: "deepbook-predict-testnet",
|
|
5
5
|
network: "testnet",
|
|
6
6
|
chainId: "4c78adac",
|
|
7
|
-
sourceCommit: "
|
|
7
|
+
sourceCommit: "a928bd2da4b71abf7c4ea6f66abec2763308331e"
|
|
8
8
|
});
|
|
9
9
|
/** Ids for the shared `account` primitive — the `/account` subpath's slice. */
|
|
10
10
|
const TESTNET_ACCOUNT = Object.freeze({
|
|
11
|
-
accountPackageId: "
|
|
12
|
-
accountRegistry: "
|
|
11
|
+
accountPackageId: "0x543139156cb90d1a73df33b5dca37d7c8bdce62506c7874ebc854afd319b98f1",
|
|
12
|
+
accountRegistry: "0xb889caefe327cbdea58e529e3b9e10dc93f1e661ddef32824d28527edf8d6385"
|
|
13
13
|
});
|
|
14
14
|
/**
|
|
15
15
|
* Ids for time-limited sessions — the `/sessions` subpath's slice.
|
|
@@ -19,13 +19,13 @@ const TESTNET_ACCOUNT = Object.freeze({
|
|
|
19
19
|
* the package root for one id.
|
|
20
20
|
*/
|
|
21
21
|
const TESTNET_SESSIONS = Object.freeze({
|
|
22
|
-
sessionsPackageId: "
|
|
23
|
-
sessionsConfig: "
|
|
24
|
-
accountPackageId: "
|
|
25
|
-
accountRegistry: "
|
|
22
|
+
sessionsPackageId: "0x10c91d168dc4a04357f9d23795a204092ca46e5b97f8b9ef26fea95664d5bb38",
|
|
23
|
+
sessionsConfig: "0x63cde7c7d846f15c51802ec3d44ba44918658e3155b0d2e0cb26d6fc1b4dadd8",
|
|
24
|
+
accountPackageId: "0x543139156cb90d1a73df33b5dca37d7c8bdce62506c7874ebc854afd319b98f1",
|
|
25
|
+
accountRegistry: "0xb889caefe327cbdea58e529e3b9e10dc93f1e661ddef32824d28527edf8d6385",
|
|
26
26
|
deepbookRegistry: "0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1",
|
|
27
|
-
deepbookCoreAccountPackageId: "
|
|
28
|
-
protocolConfig: "
|
|
27
|
+
deepbookCoreAccountPackageId: "0x2dbb8e6a5b9a8ac6201c7aeff6de0c7e7bca5dcd8d6c16538cb1a7447a298071",
|
|
28
|
+
protocolConfig: "0xfeda745dfdef2cd9721c2ff1e1de538d103bc6012469d0eec10ea5de67f636d0"
|
|
29
29
|
});
|
|
30
30
|
/**
|
|
31
31
|
* Scale constants the deployment owns rather than the SDK. Deployment-wide:
|
|
@@ -42,29 +42,29 @@ const TESTNET_UNITS = Object.freeze({
|
|
|
42
42
|
const TESTNET_PREDICT = Object.freeze({
|
|
43
43
|
network: "testnet",
|
|
44
44
|
packages: Object.freeze({
|
|
45
|
-
predict: "
|
|
46
|
-
account: "
|
|
47
|
-
propbook: "
|
|
45
|
+
predict: "0x25d075d2de915feda7ab9b8f855afe59cbcd4b2ce96f75324940c810f84da018",
|
|
46
|
+
account: "0x543139156cb90d1a73df33b5dca37d7c8bdce62506c7874ebc854afd319b98f1",
|
|
47
|
+
propbook: "0xa04a43dbbfb123feec96691a22809d8a87e9ac37ae9356079c439750145aa92b"
|
|
48
48
|
}),
|
|
49
49
|
objects: Object.freeze({
|
|
50
|
-
registry: "
|
|
51
|
-
protocolConfig: "
|
|
52
|
-
poolVault: "
|
|
53
|
-
oracleRegistry: "
|
|
54
|
-
accountRegistry: "
|
|
50
|
+
registry: "0xd21fab5444128eb65c5f6299564f583db72ad84d17581a4febe68878127100d5",
|
|
51
|
+
protocolConfig: "0xfeda745dfdef2cd9721c2ff1e1de538d103bc6012469d0eec10ea5de67f636d0",
|
|
52
|
+
poolVault: "0xd6b96a77d5acfd4f4a660cbd1098ed62abf2317e85a01274d1a4eeef19603767",
|
|
53
|
+
oracleRegistry: "0xda71af88a8b9d01b6913937a84c5a63bb4e1015a7a2142185ec9ef73f675615f",
|
|
54
|
+
accountRegistry: "0xb889caefe327cbdea58e529e3b9e10dc93f1e661ddef32824d28527edf8d6385"
|
|
55
55
|
}),
|
|
56
|
-
quoteCoinType: "
|
|
56
|
+
quoteCoinType: "0xc028557a1ed49e42ed091e115aedefd70a442b184c18fbec5c48d5b6c0b8c184::usdc::USDC",
|
|
57
57
|
coinTypes: Object.freeze({
|
|
58
|
-
plp: "
|
|
58
|
+
plp: "0x25d075d2de915feda7ab9b8f855afe59cbcd4b2ce96f75324940c810f84da018::plp::PLP",
|
|
59
59
|
deep: "0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP"
|
|
60
60
|
}),
|
|
61
61
|
units: TESTNET_UNITS,
|
|
62
62
|
underlyings: Object.freeze({ BTC: Object.freeze({
|
|
63
63
|
symbol: "BTC",
|
|
64
64
|
propbookUnderlyingId: 1,
|
|
65
|
-
pythFeed: "
|
|
66
|
-
blockScholesValueStore: "
|
|
67
|
-
blockScholesSviStore: "
|
|
65
|
+
pythFeed: "0x7179188b3a27758c53668a4ec09a81be114dea5ffabcf367f4e720a26db8ee59",
|
|
66
|
+
blockScholesValueStore: "0x77dee47fb870753c740439f436e0c30c00c60f13f171c901125b3d60f89518e5",
|
|
67
|
+
blockScholesSviStore: "0xe8aa80965d201e2cb18359c3aa315e3abc5bbf807a10a59d6e011ef41be5db7a"
|
|
68
68
|
}) })
|
|
69
69
|
});
|
|
70
70
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testnet.mjs","names":[],"sources":["../../src/deployments/testnet.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// GENERATED by `pnpm sync-deployment` from the deploy tooling's own manifest\n// (`packages/predict/deployment/deployment.testnet.json`). Do not hand-edit:\n// the next regeneration overwrites it, and a hand-patched id is exactly the drift this\n// file exists to prevent. To move to a new deployment, check the sibling deepbookv3\n// checkout out to the new anchor and re-run the script.\n//\n// Deployment: predict-testnet
|
|
1
|
+
{"version":3,"file":"testnet.mjs","names":[],"sources":["../../src/deployments/testnet.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// GENERATED by `pnpm sync-deployment` from the deploy tooling's own manifest\n// (`packages/predict/deployment/deployment.testnet.json`). Do not hand-edit:\n// the next regeneration overwrites it, and a hand-patched id is exactly the drift this\n// file exists to prevent. To move to a new deployment, check the sibling deepbookv3\n// checkout out to the new anchor and re-run the script.\n//\n// Deployment: deepbook-predict-testnet\n// sourceCommit: a928bd2da4b71abf7c4ea6f66abec2763308331e\n//\n// Runtime-dependency-free — every subpath reads a slice of this, so a value import here\n// would pull that module into all of their graphs. The type import below is erased.\n//\n// Frozen: these are shared module singletons, so an accessor handing one to a caller who\n// mutates it would change what every other caller sees.\n\nimport type {\n\tAccountIds,\n\tDeploymentInfo,\n\tDeploymentUnits,\n\tPredictIds,\n\tSessionsIds,\n} from './types.js';\n\n/** Which on-chain deployment the ids below came from. */\nexport const TESTNET_DEPLOYMENT: DeploymentInfo = Object.freeze({\n\tdeployment: 'deepbook-predict-testnet',\n\tnetwork: 'testnet',\n\tchainId: '4c78adac',\n\tsourceCommit: 'a928bd2da4b71abf7c4ea6f66abec2763308331e',\n});\n\n/** Ids for the shared `account` primitive — the `/account` subpath's slice. */\nexport const TESTNET_ACCOUNT: AccountIds = Object.freeze({\n\taccountPackageId: '0x543139156cb90d1a73df33b5dca37d7c8bdce62506c7874ebc854afd319b98f1',\n\taccountRegistry: '0xb889caefe327cbdea58e529e3b9e10dc93f1e661ddef32824d28527edf8d6385',\n});\n\n/**\n * Ids for time-limited sessions — the `/sessions` subpath's slice.\n *\n * `deepbookRegistry` is only needed by the DeepBook **spot** session wrappers; the Predict\n * wrappers never take it. It is carried here so a spot caller does not have to reach into\n * the package root for one id.\n */\nexport const TESTNET_SESSIONS: SessionsIds = Object.freeze({\n\tsessionsPackageId: '0x10c91d168dc4a04357f9d23795a204092ca46e5b97f8b9ef26fea95664d5bb38',\n\tsessionsConfig: '0x63cde7c7d846f15c51802ec3d44ba44918658e3155b0d2e0cb26d6fc1b4dadd8',\n\taccountPackageId: '0x543139156cb90d1a73df33b5dca37d7c8bdce62506c7874ebc854afd319b98f1',\n\taccountRegistry: '0xb889caefe327cbdea58e529e3b9e10dc93f1e661ddef32824d28527edf8d6385',\n\tdeepbookRegistry: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1',\n\tdeepbookCoreAccountPackageId:\n\t\t'0x2dbb8e6a5b9a8ac6201c7aeff6de0c7e7bca5dcd8d6c16538cb1a7447a298071',\n\t/** Required by every Predict session wrapper — they all take `config: &ProtocolConfig`. */\n\tprotocolConfig: '0xfeda745dfdef2cd9721c2ff1e1de538d103bc6012469d0eec10ea5de67f636d0',\n});\n\n/**\n * Scale constants the deployment owns rather than the SDK. Deployment-wide:\n * `quoteCoinDecimals` and `fixedPointScale` apply to any subpath formatting a custody\n * balance, not just Predict.\n */\nexport const TESTNET_UNITS: DeploymentUnits = Object.freeze({\n\tpositionLotSize: 10000,\n\tfixedPointScale: 1000000000,\n\tquoteCoinDecimals: 6,\n\tpositionQuantityDecimals: 6,\n});\n\n/** Ids for DeepBook Predict — the `/predict` subpath's slice. */\nexport const TESTNET_PREDICT: PredictIds = Object.freeze({\n\tnetwork: 'testnet',\n\tpackages: Object.freeze({\n\t\tpredict: '0x25d075d2de915feda7ab9b8f855afe59cbcd4b2ce96f75324940c810f84da018',\n\t\taccount: '0x543139156cb90d1a73df33b5dca37d7c8bdce62506c7874ebc854afd319b98f1',\n\t\tpropbook: '0xa04a43dbbfb123feec96691a22809d8a87e9ac37ae9356079c439750145aa92b',\n\t}),\n\tobjects: Object.freeze({\n\t\tregistry: '0xd21fab5444128eb65c5f6299564f583db72ad84d17581a4febe68878127100d5',\n\t\tprotocolConfig: '0xfeda745dfdef2cd9721c2ff1e1de538d103bc6012469d0eec10ea5de67f636d0',\n\t\tpoolVault: '0xd6b96a77d5acfd4f4a660cbd1098ed62abf2317e85a01274d1a4eeef19603767',\n\t\toracleRegistry: '0xda71af88a8b9d01b6913937a84c5a63bb4e1015a7a2142185ec9ef73f675615f',\n\t\taccountRegistry: '0xb889caefe327cbdea58e529e3b9e10dc93f1e661ddef32824d28527edf8d6385',\n\t}),\n\tquoteCoinType: '0xc028557a1ed49e42ed091e115aedefd70a442b184c18fbec5c48d5b6c0b8c184::usdc::USDC',\n\t/**\n\t * `plp` is the LP share coin type. It is NOT derivable from `packages.predict`: a Move\n\t * type tag keeps the ORIGINAL package id across an upgrade, while `packages.predict`\n\t * moves to the latest. They agree only while predict is at v1.\n\t */\n\tcoinTypes: Object.freeze({\n\t\tplp: '0x25d075d2de915feda7ab9b8f855afe59cbcd4b2ce96f75324940c810f84da018::plp::PLP',\n\t\tdeep: '0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP',\n\t}),\n\tunits: TESTNET_UNITS,\n\tunderlyings: Object.freeze({\n\t\tBTC: Object.freeze({\n\t\t\tsymbol: 'BTC',\n\t\t\tpropbookUnderlyingId: 1,\n\t\t\tpythFeed: '0x7179188b3a27758c53668a4ec09a81be114dea5ffabcf367f4e720a26db8ee59',\n\t\t\tblockScholesValueStore: '0x77dee47fb870753c740439f436e0c30c00c60f13f171c901125b3d60f89518e5',\n\t\t\tblockScholesSviStore: '0xe8aa80965d201e2cb18359c3aa315e3abc5bbf807a10a59d6e011ef41be5db7a',\n\t\t}),\n\t}),\n});\n"],"mappings":";;AA2BA,MAAa,qBAAqC,OAAO,OAAO;CAC/D,YAAY;CACZ,SAAS;CACT,SAAS;CACT,cAAc;CACd,CAAC;;AAGF,MAAa,kBAA8B,OAAO,OAAO;CACxD,kBAAkB;CAClB,iBAAiB;CACjB,CAAC;;;;;;;;AASF,MAAa,mBAAgC,OAAO,OAAO;CAC1D,mBAAmB;CACnB,gBAAgB;CAChB,kBAAkB;CAClB,iBAAiB;CACjB,kBAAkB;CAClB,8BACC;CAED,gBAAgB;CAChB,CAAC;;;;;;AAOF,MAAa,gBAAiC,OAAO,OAAO;CAC3D,iBAAiB;CACjB,iBAAiB;CACjB,mBAAmB;CACnB,0BAA0B;CAC1B,CAAC;;AAGF,MAAa,kBAA8B,OAAO,OAAO;CACxD,SAAS;CACT,UAAU,OAAO,OAAO;EACvB,SAAS;EACT,SAAS;EACT,UAAU;EACV,CAAC;CACF,SAAS,OAAO,OAAO;EACtB,UAAU;EACV,gBAAgB;EAChB,WAAW;EACX,gBAAgB;EAChB,iBAAiB;EACjB,CAAC;CACF,eAAe;CAMf,WAAW,OAAO,OAAO;EACxB,KAAK;EACL,MAAM;EACN,CAAC;CACF,OAAO;CACP,aAAa,OAAO,OAAO,EAC1B,KAAK,OAAO,OAAO;EAClB,QAAQ;EACR,sBAAsB;EACtB,UAAU;EACV,wBAAwB;EACxB,sBAAsB;EACtB,CAAC,EACF,CAAC;CACF,CAAC"}
|
|
@@ -21,7 +21,7 @@ interface DeploymentInfo {
|
|
|
21
21
|
*
|
|
22
22
|
* Only `positionLotSize` is currently read by the SDK (`PredictClient#assertLot`); the other
|
|
23
23
|
* three are shipped as the deployment's own record of its scales. `units.ts` still hardcodes
|
|
24
|
-
* the
|
|
24
|
+
* the USDC and fixed-point decimals, so do not read this as "the SDK derives its scaling
|
|
25
25
|
* from here" — wiring that up is separate work.
|
|
26
26
|
*/
|
|
27
27
|
interface DeploymentUnits {
|
|
@@ -59,6 +59,27 @@ interface CloseOptions {
|
|
|
59
59
|
orderId: bigint;
|
|
60
60
|
quantity: number;
|
|
61
61
|
}
|
|
62
|
+
/** Options for `supplyPlp`. */
|
|
63
|
+
interface PlpSupplyOptions {
|
|
64
|
+
/**
|
|
65
|
+
* Floor on the PLP minted for the whole request, as raw `bigint` shares — PLP is raw
|
|
66
|
+
* everywhere in this SDK. It is a floor on the MARK, not a share count: a flush quoting
|
|
67
|
+
* less does not fill smaller, it declines. Omitted → `0n`, no floor.
|
|
68
|
+
*
|
|
69
|
+
* How a miss is handled is the deployment's `lp_request_limit_flush_attempts`: at the
|
|
70
|
+
* shipped count of one the first flush below the floor cancels and refunds the request.
|
|
71
|
+
*/
|
|
72
|
+
minPlpOut?: bigint;
|
|
73
|
+
}
|
|
74
|
+
/** Options for `withdrawPlp`. */
|
|
75
|
+
interface PlpWithdrawOptions {
|
|
76
|
+
/**
|
|
77
|
+
* Floor on the USDC paid for the whole request, in USD decimals like every other amount
|
|
78
|
+
* here. A floor on the MARK, not an amount: a flush quoting less declines rather than
|
|
79
|
+
* paying out smaller. Omitted → no floor. Measured after the protocol's withdraw fee.
|
|
80
|
+
*/
|
|
81
|
+
minUsdcOut?: number | string;
|
|
82
|
+
}
|
|
62
83
|
/** One tradeable market as returned by read.markets(). */
|
|
63
84
|
interface ActiveMarket {
|
|
64
85
|
id: string;
|
|
@@ -93,7 +114,7 @@ interface MarketSummary {
|
|
|
93
114
|
}
|
|
94
115
|
/** Aggregate pool figures. Balances in human units (shares raw); the pending fields
|
|
95
116
|
* are request COUNTS, not amounts — the on-chain getters expose queue lengths, and
|
|
96
|
-
* the escrowed
|
|
117
|
+
* the escrowed USDC/PLP behind them is tracked separately. */
|
|
97
118
|
interface PoolSummary {
|
|
98
119
|
plpTotalSupply: bigint;
|
|
99
120
|
idleUsdc: number;
|
|
@@ -210,8 +231,8 @@ declare class PredictClient {
|
|
|
210
231
|
mintAmount: (owner: string, m: MarketDescriptor, opts: MintAmountOptions) => Promise<Transaction>;
|
|
211
232
|
redeem: (owner: string, m: MarketDescriptor, opts: CloseOptions) => Promise<Transaction>;
|
|
212
233
|
claimSettled: (owner: string, m: Pick<MarketDescriptor, "underlying" | "expiryMs" | "marketId">, opts: Pick<CloseOptions, "orderId">) => Promise<Transaction>;
|
|
213
|
-
supplyPlp: (owner: string, amountUsdc: number | string) => Transaction;
|
|
214
|
-
withdrawPlp: (owner: string, shares: bigint) => Transaction;
|
|
234
|
+
supplyPlp: (owner: string, amountUsdc: number | string, options?: PlpSupplyOptions) => Transaction;
|
|
235
|
+
withdrawPlp: (owner: string, shares: bigint, options?: PlpWithdrawOptions) => Transaction;
|
|
215
236
|
cancelSupplyPlp: (owner: string, index: bigint) => Transaction;
|
|
216
237
|
cancelWithdrawPlp: (owner: string, index: bigint) => Transaction;
|
|
217
238
|
setBuilderCode: (owner: string, builderCodeId: string) => Transaction;
|
|
@@ -251,5 +272,5 @@ declare class PredictClient {
|
|
|
251
272
|
};
|
|
252
273
|
}
|
|
253
274
|
//#endregion
|
|
254
|
-
export { ActiveMarket, CloseOptions, MarketDescriptor, MarketSummary, MintAmountOptions, MintOptions, MintQuote, POSITION_LOT_SIZE, PoolSummary, PredictClient, PredictCompatibleClient, RedeemQuote, predict };
|
|
275
|
+
export { ActiveMarket, CloseOptions, MarketDescriptor, MarketSummary, MintAmountOptions, MintOptions, MintQuote, POSITION_LOT_SIZE, PlpSupplyOptions, PlpWithdrawOptions, PoolSummary, PredictClient, PredictCompatibleClient, RedeemQuote, predict };
|
|
255
276
|
//# sourceMappingURL=client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","names":[],"sources":["../../src/predict/client.ts"],"mappings":";;;;;;;;;;;;AAyEA;;cAAa,iBAAA;;;KAWD,gBAAA;EACX,UAAA;EACA,QAAA;EASY;;;;;EAHZ,QAAA;AAAA;EAGE,IAAA,EAAM,IAAA;EAaN;;;;AAOH;EAdG,MAAA;AAAA;EAcyB;;EATzB,IAAA,WAYF;EAVE,KAAA,UAUY;EARZ,KAAA;AAAA;;UAKc,WAAA;EAChB,QAAA;EACA,OAAA;EACA,cAAA;AAAA;;UAIgB,iBAAA;EAUY;EAR5B,KAAA;EACA,WAAA;EASQ;EAPR,OAAA;AAAA;;;UAKgB,YAAA;EAChB,OAAA;EACA,QAAA;AAAA;;UAIgB,YAAA;EAChB,EAAA;EACA,QAAA;
|
|
1
|
+
{"version":3,"file":"client.d.mts","names":[],"sources":["../../src/predict/client.ts"],"mappings":";;;;;;;;;;;;AAyEA;;cAAa,iBAAA;;;KAWD,gBAAA;EACX,UAAA;EACA,QAAA;EASY;;;;;EAHZ,QAAA;AAAA;EAGE,IAAA,EAAM,IAAA;EAaN;;;;AAOH;EAdG,MAAA;AAAA;EAcyB;;EATzB,IAAA,WAYF;EAVE,KAAA,UAUY;EARZ,KAAA;AAAA;;UAKc,WAAA;EAChB,QAAA;EACA,OAAA;EACA,cAAA;AAAA;;UAIgB,iBAAA;EAUY;EAR5B,KAAA;EACA,WAAA;EASQ;EAPR,OAAA;AAAA;;;UAKgB,YAAA;EAChB,OAAA;EACA,QAAA;AAAA;;UAIgB,gBAAA;EAuBA;;;;;;;;EAdhB,SAAA;AAAA;;UAIgB,kBAAA;EA2BA;;;;;EArBhB,UAAA;AAAA;;UAIgB,YAAA;EAChB,EAAA;EACA,QAAA;EA4Bc;EA1Bd,QAAA;EAgCgB;;;;;EA1BhB,iBAAA;EACA,UAAA;EA+BA;EA7BA,cAAA;AAAA;AAiCD;AAAA,UA7BiB,aAAA;EAChB,EAAA;EACA,QAAA;EACA,QAAA;EA8BA;;;;;EAxBA,iBAAA;EACA,UAAA;EACA,GAAA;EA0CA;EAxCA,cAAA;AAAA;;;;UAMgB,WAAA;EAChB,cAAA;EACA,QAAA;EAoCS;EAlCT,qBAAA;EAsC2B;EApC3B,uBAAA;AAAA;;UAIgB,SAAA;EAuChB;EArCA,gBAAA;EAqCyB;EAnCzB,OAAA;EAmC2D;;;;;;EA5B3D,IAAA;IACC,OAAA;IACA,OAAA;IACA,OAAA;IACA,OAAA;IACA,QAAA;IACA,eAAA;EAAA;EAoC6B;;;;;EA7B9B,IAAA;EACA,QAAA;EACA,GAAA;IAAO,OAAA;IAAiB,IAAA;IAAc,QAAA;IAAkB,gBAAA;EAAA;EAyCxD;EAvCA,SAAA;AAAA;;UAIgB,WAAA;EA0CS;EAxCzB,QAAA;EAwCwD;EAtCxD,KAAA;EAsCwB;;EAnCxB,IAAA;IAAQ,OAAA;IAAiB,OAAA;IAAiB,OAAA;IAAiB,qBAAA;EAAA;EAC3D,cAAA;EACA,SAAA;EACA,GAAA;IAAO,QAAA;IAAkB,KAAA;IAAe,cAAA;EAAA;EACxC,SAAA;AAAA;AAAA,KAUI,uBAAA,GAA0B,IAAA,CAAK,gBAAA;EACnC,MAAA;AAAA;AAkCD;;;AAAA,UA5BiB,uBAAA,SAAgC,iBAAA;;;;;iBAMjC,OAAA,iCAAA,CAAA;EACf,IAAA;EACA,OAAA;EACA;AAAA;EAEA,IAAA,GAAO,IAAA;EACP,OAAA;EACA,MAAA,GAAS,aAAA;AAAA,IACN,qBAAA,CAAsB,uBAAA,EAAyB,IAAA,EAAM,aAAA;;;;;;;;cAc5C,aAAA;EAAA;WACH,GAAA,EAAK,aAAA;cAgBF,IAAA;IACX,OAAA;IACA,MAAA,EAAQ,uBAAA;IACR,MAAA,GAAS,aAAA;EAAA;EA0Y6C;EAnYvD,YAAA,CAAa,KAAA;EAAA,SA0NJ,EAAA;yBACW,WAAA;6BAkBL,UAAA,mBACc,IAAA;MAClB,MAAA;IAAA,MACP,WAAA;8BAuCW,UAAA,mBACc,IAAA;MAClB,YAAA;IAAA,MACP,WAAA;0BAqBiB,CAAA,EAAK,gBAAA,EAAgB,IAAA,EAAQ,WAAA,KAAc,OAAA,CAAQ,WAAA;gCAIzD,CAAA,EACV,gBAAA,EAAgB,IAAA,EACb,iBAAA,KACJ,OAAA,CAAQ,WAAA;4BA0BW,CAAA,EAAK,gBAAA,EAAgB,IAAA,EAAQ,YAAA,KAAe,OAAA,CAAQ,WAAA;kCAI5D,CAAA,EACV,IAAA,CAAK,gBAAA,2CAAyD,IAAA,EAC3D,IAAA,CAAK,YAAA,iBACT,OAAA,CAAQ,WAAA;+BAoBG,UAAA,mBACc,OAAA,GAClB,gBAAA,KACP,WAAA;iCAqBwB,MAAA,UAAgB,OAAA,GAAW,kBAAA,KAA0B,WAAA;qCAcjD,KAAA,aAAkB,WAAA;uCAUhB,KAAA,aAAkB,WAAA;oCAcrB,aAAA,aAA0B,WAAA;yCAWrB,WAAA;EAAA;EAAA,SAU3B,IAAA;mBAGW,OAAA,CAAQ,YAAA;iCAeA,QAAA,UAAkB,OAAA,aAAoB,OAAA;kCAM/B,OAAA,CAAQ,YAAA;eAezB,uBAAA,KAA0B,OAAA;MAAU,EAAA;MAAY,IAAA;IAAA;gBAuB7D,IAAA,CAAK,gBAAA,iCACN,OAAA,CAAQ,WAAA;MAAgB,IAAA,EAAM,cAAA;IAAA;+BAWnB,CAAA,EACV,gBAAA,EAAgB,IAAA,EACb,IAAA,CAAK,WAAA,kBACT,OAAA,CAAQ,SAAA;iCAiCG,CAAA,EACV,gBAAA,EAAgB,IAAA,EACb,YAAA,KACJ,OAAA,CAAQ,WAAA;gBAoBP,IAAA,CAAK,gBAAA,iCACN,OAAA,CAAQ,aAAA;gCAsBqB,OAAA;mCAIH,OAAA;gBAGb,OAAA,CAAQ,WAAA;EAAA;EAAA,SAiBhB,MAAA;cACE,0BAAA,KAA0B,WAAA;eACzB,0BAAA,KAA0B,WAAA;gBACzB,0BAAA,KAA0B,aAAA;iBAEzB,0BAAA,KAA0B,aAAA;eAC5B,0BAAA,KAA0B,YAAA;gBAEzB,0BAAA,KAA0B,YAAA;uBACnB,0BAAA,KAA0B,oBAAA;iBAEhC,0BAAA,KAA0B,oBAAA;kBAEzB,0BAAA,KAA0B,oBAAA;oBAExB,0BAAA,KAA0B,iBAAA;mBAE3B,0BAAA,KAA0B,gBAAA;qBAExB,0BAAA,KAA0B,kBAAA;EAAA;AAAA"}
|
package/dist/predict/client.mjs
CHANGED
|
@@ -126,20 +126,20 @@ var PredictClient = class PredictClient {
|
|
|
126
126
|
orderId: opts$1.orderId
|
|
127
127
|
}));
|
|
128
128
|
},
|
|
129
|
-
supplyPlp: (owner, amountUsdc) => txOf(requestSupply({
|
|
129
|
+
supplyPlp: (owner, amountUsdc, options = {}) => txOf(requestSupply({
|
|
130
130
|
config: this.#config,
|
|
131
131
|
arguments: {
|
|
132
132
|
wrapper: this.wrapperIdFor(owner),
|
|
133
133
|
amount: usdcToRaw(amountUsdc),
|
|
134
|
-
minPlpOut: 0n
|
|
134
|
+
minPlpOut: options.minPlpOut ?? 0n
|
|
135
135
|
}
|
|
136
136
|
})),
|
|
137
|
-
withdrawPlp: (owner, shares) => txOf(requestWithdraw({
|
|
137
|
+
withdrawPlp: (owner, shares, options = {}) => txOf(requestWithdraw({
|
|
138
138
|
config: this.#config,
|
|
139
139
|
arguments: {
|
|
140
140
|
wrapper: this.wrapperIdFor(owner),
|
|
141
141
|
amount: shares,
|
|
142
|
-
|
|
142
|
+
minUsdcOut: options.minUsdcOut === void 0 ? 0n : usdcToRaw(options.minUsdcOut)
|
|
143
143
|
}
|
|
144
144
|
})),
|
|
145
145
|
cancelSupplyPlp: (owner, index) => txOf(cancelSupplyRequest({
|