@typus/typus-perp-sdk 1.3.1 → 1.3.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/dist/src/index.js +26 -7
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -25,12 +25,23 @@ const dotenv_1 = __importDefault(require("dotenv"));
|
|
|
25
25
|
dotenv_1.default.config();
|
|
26
26
|
// default MAINNET
|
|
27
27
|
exports.NETWORK = process.env.NEXT_PUBLIC_CLUSTER == "testnet" ? "TESTNET" : "MAINNET";
|
|
28
|
-
// Mainnet is
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
28
|
+
// Mainnet is perp v7, re-linked onto typus_oracle v17 + pyth_lazer v2.
|
|
29
|
+
//
|
|
30
|
+
// v6 0xb78db3bf is NOT interchangeable here, even though it carries the same `_v2`
|
|
31
|
+
// order entries. Every perp VIEW function is `public(package)`, which pins its whole
|
|
32
|
+
// transitive dep closure tx-wide, and v6 linked pyth_lazer v1 — so any devInspect that
|
|
33
|
+
// bundles `updateOracleV2WithPythLazer` with a view (getLiquidationPriceAndPnl,
|
|
34
|
+
// getMaxReleasingCollateralAmount, …) fails `InvalidLinkage` and returns [] SILENTLY.
|
|
35
|
+
// The user-facing WRITE path is unaffected: create_trading_order_v2 /
|
|
36
|
+
// match_trading_order_v2 / release_collateral_v2 / increase_collateral_v2 are all
|
|
37
|
+
// `public`, which is exempt. See typus-rust mainnet_lazer_migration.md §1c.
|
|
38
|
+
//
|
|
39
|
+
// Note typus-config@main is staler still — its PACKAGE.PERP.PERP is v5 0x8e4743f2,
|
|
40
|
+
// PACKAGE.DOV_SINGLE is dov v107 and PACKAGE.ORACLE is oracle v14. Do not take the
|
|
41
|
+
// perp package id from there. `client.config.package.oracle` (v14) is itself a hazard:
|
|
42
|
+
// pinned below the v17 that the Lazer command loads, it is the probe-G InvalidLinkage.
|
|
32
43
|
exports.PERP_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
33
|
-
? "
|
|
44
|
+
? "0x6a0284b7a1ee2e677e2b12e3aa44530ebd26af017894504adf2915cce422bb10"
|
|
34
45
|
: "0x228f1823a2daf15cf2d5031e47bd7c26ae1d19ea89160df29d351c6e56134c61";
|
|
35
46
|
exports.STAKE_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
36
47
|
? "0xd280f3a072bca4b7b5b450f40c82a30b3935cd1d12d927eb9d1f790520a83d3b"
|
|
@@ -70,10 +81,18 @@ exports.LOCK_VAULT = exports.NETWORK == "MAINNET"
|
|
|
70
81
|
? "0x585355900351dd1915b77f31c06ae9e6d58b187de848d4e6e6a55d3789e281d6"
|
|
71
82
|
: "0x8d3c497b2b0e7b8a7633422e8da780ba83ea6709d81ba7b0ca6935d58692cc96";
|
|
72
83
|
// Pyth Lazer + OracleV2. Mainnet values mirror typus-rust
|
|
73
|
-
// src/config/mainnet/pyth.json (oracle
|
|
84
|
+
// src/config/mainnet/pyth.json (oracle v17 / Lazer state), which the crankers
|
|
74
85
|
// already run against — the OracleV2 object below holds 24 registered tokens.
|
|
86
|
+
//
|
|
87
|
+
// This MUST move together with PERP_PACKAGE_ID above. client.ts overrides
|
|
88
|
+
// config.package.oracle with it, so it is the package every `updateOracleV2WithPythLazer`
|
|
89
|
+
// command targets — and perp v7 links oracle v17. Leaving it at v16 while perp goes to v7
|
|
90
|
+
// does not fix the read path, it just relocates the InvalidLinkage: measured read-only on
|
|
91
|
+
// mainnet, `[lazer-v2 parse, oracle-v16 update_latest_price_v2, perp-v7 view]` still fails
|
|
92
|
+
// (typus-rust examples/linkage_probe_liquidation, probe V5). The same PTB with v17
|
|
93
|
+
// succeeds (V2). One version per package tx-wide — never pin this below what perp links.
|
|
75
94
|
exports.ORACLE_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
76
|
-
? "
|
|
95
|
+
? "0x7f490c95fcd6a707aebef4441a8fb82693a45a01872e50c3f797a553f35d33e9"
|
|
77
96
|
: "0xd2e030ab7f0fc956c7e683cf3c6faf3d22868dee81a4aae9f4a10a6d998a8a02";
|
|
78
97
|
exports.ORACLE_V2_ID = exports.NETWORK == "MAINNET"
|
|
79
98
|
? "0xcd03806a638885c18d9866b9704cb53487c51df8642e95059a6984673b9fa211"
|