@waterx/sdk 4.3.2 → 4.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.
@@ -32,10 +32,11 @@ export interface CreateClientOptions extends LoadConfigOptions {
32
32
  * and a `pythApiKey` (Lazer is auth-first); Lazer infra lives in the
33
33
  * source's own `LAZER_INFRA` table.
34
34
  * - `'waterx_rule'` — the first-party WaterX quote-center (Nautilus-TEE,
35
- * ed25519-signed batches): ONE envelope covering the build's tickers,
36
- * verified AND fed by a single `collect_batch_latest` per collector. No
37
- * credential and no per-update fee; needs `packages.waterx_rule` with
38
- * feeds. Quote-center infra lives in the source's own `WATERX_INFRA`
35
+ * ed25519-signed prices): one signed Merkle LEAF per ticker, verified AND
36
+ * fed by a single `collect_single_with_proof` per collector (falling back to
37
+ * one whole-batch envelope + `collect_batch_latest` against a quote-center
38
+ * with no leaf route). No credential and no per-update fee; needs
39
+ * `packages.waterx_rule` with feeds. Quote-center infra lives in the source's own `WATERX_INFRA`
39
40
  * table; endpoint/transport overridable via
40
41
  * {@link CreateClientOptions.waterxEndpoint} /
41
42
  * {@link CreateClientOptions.waterxFetch} — the browser-CORS proxy hook,
@@ -72,15 +73,16 @@ export interface CreateClientOptions extends LoadConfigOptions {
72
73
  * Quote-center base URL for `oracleSource: 'waterx_rule'` — overrides the
73
74
  * source's own per-network `WATERX_INFRA` default.
74
75
  *
75
- * This is the one source a BROWSER fetches itself (the signed envelope is
76
- * pulled from the page), so it is bound by the quote-center deployment's CORS
76
+ * This is the one source a BROWSER fetches itself (the signed price is pulled
77
+ * from the page), so it is bound by the quote-center deployment's CORS
77
78
  * allowlist. A front end whose origin is not allowed — or one that must route
78
79
  * egress through its own backend — points this at a same-origin proxy that
79
- * forwards `GET /v1/quotes/update`. Unused by the Pyth sources.
80
+ * forwards `GET /v1/quotes/leaves` (and `GET /v1/quotes/update`, the fallback
81
+ * route). Unused by the Pyth sources.
80
82
  *
81
83
  * An absolute URL. Any base PATH is preserved (`joinEndpointPath`), so
82
84
  * `https://app.example/api/quote-center` fetches
83
- * `https://app.example/api/quote-center/v1/quotes/update` — a proxy route
85
+ * `https://app.example/api/quote-center/v1/quotes/leaves` — a proxy route
84
86
  * survives instead of being rewritten to the origin root.
85
87
  */
86
88
  waterxEndpoint?: string;
@@ -13,8 +13,8 @@ export type { EstLiqPriceViewOpts } from "./liq-view.ts";
13
13
  export * from "./user/index.ts";
14
14
  export * from "./tx-builders.ts";
15
15
  export * from "./fetch.ts";
16
- export { FetchPolicyError, LazerApiKeyMissingError, OracleFeeSourceUnavailableError, OracleSourceNotImplementedError, PythCache, aggregateTicker, aggregateTickerWithConstant, aggregateTickerWithPyth, ORACLE_SOURCES, buildPythPriceUpdateCalls, fetchPriceFeedsUpdateData, isOracleSource, parseOracleSourceList, pythCoreHermesEndpoint, pythProHermesEndpoint, refreshOraclePrices, resolveHermesReadEndpoint, updatePythPrices, waterxEnvelopeOf, waterxQuoteCenterEndpoint, } from "../oracle/index.ts";
17
- export type { FetchPolicy, OracleFeeSource, OracleSource, UpdateDataProvider, } from "../oracle/index.ts";
16
+ export { FetchPolicyError, LazerApiKeyMissingError, OracleFeeSourceUnavailableError, OracleSourceNotImplementedError, PythCache, aggregateTicker, aggregateTickerWithConstant, aggregateTickerWithPyth, ORACLE_SOURCES, buildPythPriceUpdateCalls, fetchPriceFeedsUpdateData, isOracleSource, parseOracleSourceList, pythCoreHermesEndpoint, pythProHermesEndpoint, refreshOraclePrices, resolveHermesReadEndpoint, updatePythPrices, waterxEnvelopeOf, waterxLeavesOf, parseSignedLeaves, MERKLE_ROOT_INTENT, waterxQuoteCenterEndpoint, } from "../oracle/index.ts";
17
+ export type { FetchPolicy, OracleFeeSource, OracleSource, UpdateDataProvider, WaterxBatchItem, WaterxEnvelopePayload, WaterxLeafPayload, WaterxSignedEnvelope, WaterxSignedLeaf, WaterxUpdatePayload, } from "../oracle/index.ts";
18
18
  export { fetchDepositVaa, fetchVaa, listBridgeWithdrawalVaas, listVaasByEmitter, padEvmEmitter, toWormholescanEmitter, vaaBase64ToBytes, vaaBase64ToHex, vaaBytesToBase64, waitForVaa, } from "../account/funding/wormhole.ts";
19
19
  export type { VaaListItem, VaaResponse, WormholescanOptions } from "../account/funding/wormhole.ts";
20
20
  export { AccountData as AccountDataBcs, GlobalConfigData as GlobalConfigDataBcs, MarketData as MarketDataBcs, OrderData as OrderDataBcs, PoolData as PoolDataBcs, PositionData as PositionDataBcs, RedeemRequestData as RedeemRequestDataBcs, TokenPoolData as TokenPoolDataBcs, } from "../generated/waterx_perp_view/view.ts";
@@ -15,7 +15,13 @@ export * from "./tx-builders.js";
15
15
  // ======== Read-only queries ========
16
16
  export * from "./fetch.js";
17
17
  // ======== Oracle utilities (Pyth source + rule aggregation) ========
18
- export { FetchPolicyError, LazerApiKeyMissingError, OracleFeeSourceUnavailableError, OracleSourceNotImplementedError, PythCache, aggregateTicker, aggregateTickerWithConstant, aggregateTickerWithPyth, ORACLE_SOURCES, buildPythPriceUpdateCalls, fetchPriceFeedsUpdateData, isOracleSource, parseOracleSourceList, pythCoreHermesEndpoint, pythProHermesEndpoint, refreshOraclePrices, resolveHermesReadEndpoint, updatePythPrices, waterxEnvelopeOf, waterxQuoteCenterEndpoint, } from "../oracle/index.js";
18
+ export { FetchPolicyError, LazerApiKeyMissingError, OracleFeeSourceUnavailableError, OracleSourceNotImplementedError, PythCache, aggregateTicker, aggregateTickerWithConstant, aggregateTickerWithPyth, ORACLE_SOURCES, buildPythPriceUpdateCalls, fetchPriceFeedsUpdateData, isOracleSource, parseOracleSourceList, pythCoreHermesEndpoint, pythProHermesEndpoint, refreshOraclePrices, resolveHermesReadEndpoint, updatePythPrices, waterxEnvelopeOf,
19
+ // Leaves are the DEFAULT waterx wire shape, so their accessor + parser belong
20
+ // on the same surface as `waterxEnvelopeOf` (and on the root, which re-exports
21
+ // this file). A prefetch cache written against the envelope-only surface would
22
+ // otherwise get `null` from its only accessor on the normal path and have to
23
+ // discover `@waterx/sdk/oracle` to fix it.
24
+ waterxLeavesOf, parseSignedLeaves, MERKLE_ROOT_INTENT, waterxQuoteCenterEndpoint, } from "../oracle/index.js";
19
25
  // ======== Wormhole / Wormholescan utilities (credit bridge) ========
20
26
  export { fetchDepositVaa, fetchVaa, listBridgeWithdrawalVaas, listVaasByEmitter, padEvmEmitter, toWormholescanEmitter, vaaBase64ToBytes, vaaBase64ToHex, vaaBytesToBase64, waitForVaa, } from "../account/funding/wormhole.js";
21
27
  // ======== Generated BCS types (sui-ts-codegen) ========
@@ -406,7 +406,7 @@ export interface ClientCreateOptions {
406
406
  * the quote-center deployment's CORS allowlist: a front end whose origin is
407
407
  * not allowed points this at its own same-origin proxy. An absolute URL whose
408
408
  * base PATH is preserved — `https://app.example/api/quote-center` fetches
409
- * `…/api/quote-center/v1/quotes/update`. Unused by the Pyth sources.
409
+ * `…/api/quote-center/v1/quotes/leaves`. Unused by the Pyth sources.
410
410
  */
411
411
  waterxEndpoint?: string;
412
412
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waterx/sdk",
3
- "version": "4.3.2",
3
+ "version": "4.3.3",
4
4
  "description": "WaterX SDK — perpetuals and prediction markets on Sui",
5
5
  "license": "MIT",
6
6
  "author": "WaterX",
@@ -155,8 +155,13 @@
155
155
  },
156
156
  "./package.json": "./package.json"
157
157
  },
158
+ "engines": {
159
+ "node": ">=22"
160
+ },
158
161
  "files": [
159
162
  "dist",
163
+ ".claude/skills/waterx-sdk-integration/SKILL.md",
164
+ "SKILLS.md",
160
165
  "LICENSE",
161
166
  "package.json"
162
167
  ],
@@ -174,7 +179,8 @@
174
179
  "oracle:aggregates:testnet": "tsx scripts/print-oracle-aggregates.ts --testnet",
175
180
  "oracle:aggregates:mainnet": "tsx scripts/print-oracle-aggregates.ts --mainnet",
176
181
  "typecheck": "tsc --noEmit",
177
- "check": "pnpm lint && pnpm typecheck && pnpm test:unit",
182
+ "docs:check": "tsx scripts/check-docs-links.ts",
183
+ "check": "pnpm docs:check && pnpm typecheck && pnpm test:unit && pnpm lint",
178
184
  "test": "vitest run --project unit --project predict-unit",
179
185
  "test:unit": "vitest run --project unit --project predict-unit",
180
186
  "test:unit:perp": "vitest run --project unit",