@waterx/sdk 4.3.1 → 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.
- package/.claude/skills/waterx-sdk-integration/SKILL.md +219 -0
- package/README.md +177 -10
- package/SKILLS.md +34 -0
- package/dist/cjs/src/generated/waterx_rule/waterx_rule.d.ts +140 -7
- package/dist/cjs/src/generated/waterx_rule/waterx_rule.js +163 -8
- package/dist/cjs/src/oracle/aggregate.d.ts +8 -4
- package/dist/cjs/src/oracle/aggregate.js +74 -29
- package/dist/cjs/src/oracle/config.d.ts +3 -2
- package/dist/cjs/src/oracle/index.d.ts +2 -2
- package/dist/cjs/src/oracle/index.js +10 -5
- package/dist/cjs/src/oracle/price-update-rule.d.ts +10 -2
- package/dist/cjs/src/oracle/rules/pyth-lazer-rule.d.ts +25 -7
- package/dist/cjs/src/oracle/rules/pyth-lazer-rule.js +41 -17
- package/dist/cjs/src/oracle/rules/waterx-rule.d.ts +136 -47
- package/dist/cjs/src/oracle/rules/waterx-rule.js +450 -114
- package/dist/cjs/src/perp/client.d.ts +10 -8
- package/dist/cjs/src/perp/index.d.ts +2 -2
- package/dist/cjs/src/perp/index.js +10 -2
- package/dist/cjs/src/unified-client.d.ts +1 -1
- package/dist/src/generated/waterx_rule/waterx_rule.d.ts +140 -7
- package/dist/src/generated/waterx_rule/waterx_rule.js +151 -7
- package/dist/src/oracle/aggregate.d.ts +8 -4
- package/dist/src/oracle/aggregate.js +75 -30
- package/dist/src/oracle/config.d.ts +3 -2
- package/dist/src/oracle/index.d.ts +2 -2
- package/dist/src/oracle/index.js +8 -6
- package/dist/src/oracle/price-update-rule.d.ts +10 -2
- package/dist/src/oracle/rules/pyth-lazer-rule.d.ts +25 -7
- package/dist/src/oracle/rules/pyth-lazer-rule.js +41 -17
- package/dist/src/oracle/rules/waterx-rule.d.ts +136 -47
- package/dist/src/oracle/rules/waterx-rule.js +447 -114
- package/dist/src/perp/client.d.ts +10 -8
- package/dist/src/perp/index.d.ts +2 -2
- package/dist/src/perp/index.js +7 -1
- package/dist/src/unified-client.d.ts +1 -1
- package/package.json +8 -2
|
@@ -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
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
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
|
|
76
|
-
*
|
|
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/
|
|
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/
|
|
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;
|
package/dist/src/perp/index.d.ts
CHANGED
|
@@ -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";
|
package/dist/src/perp/index.js
CHANGED
|
@@ -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,
|
|
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/
|
|
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.
|
|
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": "
|
|
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",
|