@waterx/sdk 4.3.3 → 5.0.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/.claude/skills/waterx-sdk-integration/SKILL.md +41 -35
- package/README.md +81 -77
- package/dist/cjs/src/account/config.d.ts +3 -5
- package/dist/cjs/src/account/funding/wormhole.d.ts +1 -2
- package/dist/cjs/src/account/funding/wormhole.js +1 -2
- package/dist/cjs/src/oracle/aggregate.d.ts +45 -61
- package/dist/cjs/src/oracle/aggregate.js +138 -138
- package/dist/cjs/src/oracle/config.d.ts +35 -49
- package/dist/cjs/src/oracle/config.js +1 -1
- package/dist/cjs/src/oracle/host.d.ts +14 -19
- package/dist/cjs/src/oracle/host.js +3 -3
- package/dist/cjs/src/oracle/index.d.ts +25 -16
- package/dist/cjs/src/oracle/index.js +79 -66
- package/dist/cjs/src/oracle/price-update-rule.d.ts +104 -66
- package/dist/cjs/src/oracle/price-update-rule.js +24 -16
- package/dist/cjs/src/oracle/pyth-pro-history.d.ts +36 -0
- package/dist/cjs/src/oracle/pyth-pro-history.js +41 -0
- package/dist/cjs/src/oracle/read-plane.d.ts +35 -53
- package/dist/cjs/src/oracle/read-plane.js +26 -48
- package/dist/cjs/src/oracle/read-prices.d.ts +105 -0
- package/dist/cjs/src/oracle/read-prices.js +162 -0
- package/dist/cjs/src/oracle/rule-registry.d.ts +12 -12
- package/dist/cjs/src/oracle/rule-registry.js +12 -14
- package/dist/cjs/src/oracle/rules/pyth-lazer-rule.d.ts +24 -3
- package/dist/cjs/src/oracle/rules/pyth-lazer-rule.js +40 -20
- package/dist/cjs/src/oracle/rules/waterx-rule.d.ts +137 -12
- package/dist/cjs/src/oracle/rules/waterx-rule.js +318 -55
- package/dist/cjs/src/oracle/schedule.d.ts +109 -0
- package/dist/cjs/src/oracle/schedule.js +991 -0
- package/dist/cjs/src/oracle/source-list.d.ts +31 -27
- package/dist/cjs/src/oracle/source-list.js +43 -45
- package/dist/cjs/src/oracle/symbol-catalog.d.ts +54 -0
- package/dist/cjs/src/oracle/symbol-catalog.js +69 -0
- package/dist/cjs/src/oracle/update-fetch.d.ts +11 -15
- package/dist/cjs/src/oracle/update-fetch.js +12 -19
- package/dist/cjs/src/oracle/validate.d.ts +105 -0
- package/dist/cjs/src/oracle/validate.js +185 -0
- package/dist/cjs/src/oracle/weight-coverage.d.ts +79 -0
- package/dist/cjs/src/oracle/weight-coverage.js +173 -0
- package/dist/cjs/src/perp/client.d.ts +35 -52
- package/dist/cjs/src/perp/client.js +44 -17
- package/dist/cjs/src/perp/config-view.d.ts +5 -14
- package/dist/cjs/src/perp/config-view.js +5 -16
- package/dist/cjs/src/perp/config.d.ts +3 -3
- package/dist/cjs/src/perp/config.js +11 -13
- package/dist/cjs/src/perp/index.d.ts +4 -6
- package/dist/cjs/src/perp/index.js +35 -18
- package/dist/cjs/src/perp/tx-builders/common.d.ts +86 -48
- package/dist/cjs/src/perp/tx-builders/common.js +115 -47
- package/dist/cjs/src/perp/tx-builders/wlp.d.ts +3 -14
- package/dist/cjs/src/perp/tx-builders/wlp.js +6 -35
- package/dist/cjs/src/perp/tx-builders.d.ts +6 -5
- package/dist/cjs/src/perp/tx-builders.js +16 -10
- package/dist/cjs/src/unified-client.d.ts +8 -34
- package/dist/cjs/src/unified-client.js +3 -4
- package/dist/cjs/src/utils/config.d.ts +0 -8
- package/dist/cjs/src/utils/config.js +5 -13
- package/dist/src/account/config.d.ts +3 -5
- package/dist/src/account/funding/wormhole.d.ts +1 -2
- package/dist/src/account/funding/wormhole.js +1 -2
- package/dist/src/oracle/aggregate.d.ts +45 -61
- package/dist/src/oracle/aggregate.js +138 -137
- package/dist/src/oracle/config.d.ts +35 -49
- package/dist/src/oracle/config.js +1 -1
- package/dist/src/oracle/host.d.ts +14 -19
- package/dist/src/oracle/host.js +3 -3
- package/dist/src/oracle/index.d.ts +25 -16
- package/dist/src/oracle/index.js +55 -50
- package/dist/src/oracle/price-update-rule.d.ts +104 -66
- package/dist/src/oracle/price-update-rule.js +23 -16
- package/dist/src/oracle/pyth-pro-history.d.ts +36 -0
- package/dist/src/oracle/pyth-pro-history.js +38 -0
- package/dist/src/oracle/read-plane.d.ts +35 -53
- package/dist/src/oracle/read-plane.js +25 -47
- package/dist/src/oracle/read-prices.d.ts +105 -0
- package/dist/src/oracle/read-prices.js +156 -0
- package/dist/src/oracle/rule-registry.d.ts +12 -12
- package/dist/src/oracle/rule-registry.js +12 -14
- package/dist/src/oracle/rules/pyth-lazer-rule.d.ts +24 -3
- package/dist/src/oracle/rules/pyth-lazer-rule.js +39 -20
- package/dist/src/oracle/rules/waterx-rule.d.ts +137 -12
- package/dist/src/oracle/rules/waterx-rule.js +314 -56
- package/dist/src/oracle/schedule.d.ts +109 -0
- package/dist/src/oracle/schedule.js +985 -0
- package/dist/src/oracle/source-list.d.ts +31 -27
- package/dist/src/oracle/source-list.js +42 -43
- package/dist/src/oracle/symbol-catalog.d.ts +54 -0
- package/dist/src/oracle/symbol-catalog.js +65 -0
- package/dist/src/oracle/update-fetch.d.ts +11 -15
- package/dist/src/oracle/update-fetch.js +12 -18
- package/dist/src/oracle/validate.d.ts +105 -0
- package/dist/src/oracle/validate.js +177 -0
- package/dist/src/oracle/weight-coverage.d.ts +79 -0
- package/dist/src/oracle/weight-coverage.js +166 -0
- package/dist/src/perp/client.d.ts +35 -52
- package/dist/src/perp/client.js +45 -18
- package/dist/src/perp/config-view.d.ts +5 -14
- package/dist/src/perp/config-view.js +5 -16
- package/dist/src/perp/config.d.ts +3 -3
- package/dist/src/perp/config.js +11 -13
- package/dist/src/perp/index.d.ts +4 -6
- package/dist/src/perp/index.js +11 -5
- package/dist/src/perp/tx-builders/common.d.ts +86 -48
- package/dist/src/perp/tx-builders/common.js +114 -48
- package/dist/src/perp/tx-builders/wlp.d.ts +3 -14
- package/dist/src/perp/tx-builders/wlp.js +6 -35
- package/dist/src/perp/tx-builders.d.ts +6 -5
- package/dist/src/perp/tx-builders.js +15 -6
- package/dist/src/unified-client.d.ts +8 -34
- package/dist/src/unified-client.js +3 -4
- package/dist/src/utils/config.d.ts +0 -8
- package/dist/src/utils/config.js +5 -12
- package/package.json +1 -1
- package/dist/cjs/src/generated/pyth_sponsor_rule/deps/sui/balance.d.ts +0 -12
- package/dist/cjs/src/generated/pyth_sponsor_rule/deps/sui/balance.js +0 -17
- package/dist/cjs/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.d.ts +0 -68
- package/dist/cjs/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.js +0 -113
- package/dist/cjs/src/generated/waterx_pyth_rule/deps/sui/vec_map.d.ts +0 -36
- package/dist/cjs/src/generated/waterx_pyth_rule/deps/sui/vec_map.js +0 -31
- package/dist/cjs/src/generated/waterx_pyth_rule/pyth_rule.d.ts +0 -192
- package/dist/cjs/src/generated/waterx_pyth_rule/pyth_rule.js +0 -214
- package/dist/cjs/src/oracle/pyth.d.ts +0 -227
- package/dist/cjs/src/oracle/pyth.js +0 -652
- package/dist/cjs/src/oracle/rules/pyth-core-rule.d.ts +0 -15
- package/dist/cjs/src/oracle/rules/pyth-core-rule.js +0 -100
- package/dist/cjs/src/oracle/rules/pyth-rule.d.ts +0 -11
- package/dist/cjs/src/oracle/rules/pyth-rule.js +0 -29
- package/dist/cjs/src/oracle/rules/sponsor.d.ts +0 -32
- package/dist/cjs/src/oracle/rules/sponsor.js +0 -56
- package/dist/src/generated/pyth_sponsor_rule/deps/sui/balance.d.ts +0 -12
- package/dist/src/generated/pyth_sponsor_rule/deps/sui/balance.js +0 -14
- package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.d.ts +0 -68
- package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.js +0 -73
- package/dist/src/generated/waterx_pyth_rule/deps/sui/vec_map.d.ts +0 -36
- package/dist/src/generated/waterx_pyth_rule/deps/sui/vec_map.js +0 -27
- package/dist/src/generated/waterx_pyth_rule/pyth_rule.d.ts +0 -192
- package/dist/src/generated/waterx_pyth_rule/pyth_rule.js +0 -170
- package/dist/src/oracle/pyth.d.ts +0 -227
- package/dist/src/oracle/pyth.js +0 -638
- package/dist/src/oracle/rules/pyth-core-rule.d.ts +0 -15
- package/dist/src/oracle/rules/pyth-core-rule.js +0 -97
- package/dist/src/oracle/rules/pyth-rule.d.ts +0 -11
- package/dist/src/oracle/rules/pyth-rule.js +0 -26
- package/dist/src/oracle/rules/sponsor.d.ts +0 -32
- package/dist/src/oracle/rules/sponsor.js +0 -52
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Oracle-layer config schema — the package entries + config slice the shared
|
|
3
|
-
* oracle layer (
|
|
3
|
+
* oracle layer (oracle rules + aggregate) reads. This is shared
|
|
4
4
|
* infra, **not** the perp line: `perp/config.ts` imports these and
|
|
5
5
|
* `WaterXPackages extends OraclePackages`; nothing here imports `perp/` or
|
|
6
6
|
* `prediction/`. Snake_case mirrors the canonical `waterx-config` JSON 1:1.
|
|
@@ -12,35 +12,26 @@
|
|
|
12
12
|
import type { BasePackageEntry } from "../account/config.ts";
|
|
13
13
|
import type { BaseLineConfig } from "../base-client.ts";
|
|
14
14
|
import type { FetchPolicy } from "./update-fetch.ts";
|
|
15
|
-
export interface PythRulePackage extends BasePackageEntry {
|
|
16
|
-
config: string;
|
|
17
|
-
feeds: Record<string, {
|
|
18
|
-
feed_id: string;
|
|
19
|
-
price_info_object: string;
|
|
20
|
-
}>;
|
|
21
|
-
}
|
|
22
|
-
export interface PythSponsorRulePackage extends BasePackageEntry {
|
|
23
|
-
pyth_sponsor: string;
|
|
24
|
-
}
|
|
25
15
|
/**
|
|
26
16
|
* `pyth_lazer_rule` deployment entry — present in the deployed testnet
|
|
27
17
|
* `waterx-config` JSON. Read by `PythLazerRule` (`rules/pyth-lazer-rule.ts`):
|
|
28
18
|
* `feeds` for ticker support + integer feed-id resolution, `state` for the
|
|
29
19
|
* verify call, `published_at`/`config` for the per-ticker feed call.
|
|
30
20
|
*
|
|
31
|
-
* `enabled`
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
21
|
+
* `enabled` switches the source off for this deployment: `deriveOracleSources`
|
|
22
|
+
* skips a block explicitly set to `false`. Absent means ON — every live config
|
|
23
|
+
* omits it, and a published block with feeds is a wired source. Which rule
|
|
24
|
+
* prices a given TICKER is still decided by the feeds maps alone, never by a
|
|
25
|
+
* per-ticker flag.
|
|
35
26
|
*/
|
|
36
27
|
export interface PythLazerRulePackage extends BasePackageEntry {
|
|
37
28
|
config: string;
|
|
38
29
|
state: string;
|
|
39
30
|
enabled?: boolean;
|
|
40
|
-
/** Oracle ticker → integer Pyth Lazer feed id (distinct
|
|
31
|
+
/** Oracle ticker → integer Pyth Lazer feed id (distinct from the legacy Hermes hex id scheme). */
|
|
41
32
|
feeds: Record<string, number>;
|
|
42
33
|
}
|
|
43
|
-
/** Per-ticker `constant_rule` feed entry (
|
|
34
|
+
/** Per-ticker `constant_rule` feed entry (per-ticker map keyed by oracle ticker). */
|
|
44
35
|
export interface ConstantFeedEntry {
|
|
45
36
|
/**
|
|
46
37
|
* Constant 1e9-scaled price (decimal string), mirroring the on-chain
|
|
@@ -54,13 +45,13 @@ export interface WaterxConstantRulePackage extends BasePackageEntry {
|
|
|
54
45
|
/** Shared `constant_rule::Config` holding the per-ticker constant prices. */
|
|
55
46
|
config: string;
|
|
56
47
|
/**
|
|
57
|
-
* Oracle ticker → constant feed entry
|
|
58
|
-
*
|
|
59
|
-
*
|
|
48
|
+
* Oracle ticker → constant feed entry. A ticker present here is fed via
|
|
49
|
+
* `constant_rule::feed`, alone (constant-only) or alongside the live
|
|
50
|
+
* sources (e.g. `USDCUSD → { price: "1000000000" }`).
|
|
60
51
|
*/
|
|
61
52
|
feeds?: Record<string, ConstantFeedEntry>;
|
|
62
53
|
}
|
|
63
|
-
/** Per-ticker `supra_rule` feed entry (
|
|
54
|
+
/** Per-ticker `supra_rule` feed entry (per-ticker map keyed by oracle ticker). */
|
|
64
55
|
export interface SupraFeedEntry {
|
|
65
56
|
/** Supra pair id (mirrors the on-chain `Config`; informational off-chain). */
|
|
66
57
|
pair_id: number;
|
|
@@ -84,8 +75,8 @@ export interface SupraRulePackage extends BasePackageEntry {
|
|
|
84
75
|
}
|
|
85
76
|
/**
|
|
86
77
|
* Per-ticker `waterx_rule` feed entry. Keyed in `feeds` by the oracle **ticker**
|
|
87
|
-
* (e.g. `"SUIUSD"
|
|
88
|
-
*
|
|
78
|
+
* (e.g. `"SUIUSD"`), so `Object.keys(feeds)` is the SDK's supported-ticker
|
|
79
|
+
* set. The fields are
|
|
89
80
|
* informational off-chain — the SDK keys routing/support off the entry's
|
|
90
81
|
* presence and pushes the enclave-signed price verbatim, never re-deriving it.
|
|
91
82
|
*/
|
|
@@ -103,8 +94,8 @@ export interface WaterxRuleFeedEntry {
|
|
|
103
94
|
* `rules/waterx-rule.ts`), not this JSON.
|
|
104
95
|
*
|
|
105
96
|
* `enabled` mirrors the JSON field verbatim but MUST NOT be read for routing —
|
|
106
|
-
* which rule prices a ticker is decided solely by the client's
|
|
107
|
-
*
|
|
97
|
+
* which rule prices a ticker is decided solely by the client's derived fed set
|
|
98
|
+
* (see `OracleHost.oracleSources`), mirroring `pyth_lazer_rule`.
|
|
108
99
|
*/
|
|
109
100
|
export interface WaterxRulePackage extends BasePackageEntry {
|
|
110
101
|
/** Shared `waterx_rule::Config` (per-symbol on-chain feed_config). */
|
|
@@ -128,23 +119,21 @@ export interface WaterxOraclePackage extends BasePackageEntry {
|
|
|
128
119
|
* structurally an oracle config.
|
|
129
120
|
*/
|
|
130
121
|
export interface OraclePackages {
|
|
131
|
-
pyth_rule: PythRulePackage;
|
|
132
|
-
pyth_sponsor_rule?: PythSponsorRulePackage;
|
|
133
122
|
/** See {@link PythLazerRulePackage} — typed only, not read for routing. */
|
|
134
123
|
pyth_lazer_rule?: PythLazerRulePackage;
|
|
135
124
|
constant_rule?: WaterxConstantRulePackage;
|
|
136
125
|
supra_rule?: SupraRulePackage;
|
|
137
|
-
/** See {@link WaterxRulePackage} — read by `WaterxRule` when
|
|
126
|
+
/** See {@link WaterxRulePackage} — read by `WaterxRule` when the config wires it. */
|
|
138
127
|
waterx_rule?: WaterxRulePackage;
|
|
139
128
|
waterx_oracle: WaterxOraclePackage;
|
|
140
129
|
}
|
|
141
130
|
/**
|
|
142
131
|
* The caller-tunable subset of `fetchWithPolicy`'s policy exposed on the
|
|
143
132
|
* `pythFetch` create option and `client.pyth.fetch` — the retry/timeout budget
|
|
144
|
-
* for the off-chain
|
|
145
|
-
* (`
|
|
146
|
-
* `FetchPolicy` (no `retryDelayMs` / `apiKey` / `fetchImpl`).
|
|
147
|
-
*
|
|
133
|
+
* for the off-chain Lazer (`PythLazerRule`) update fetch and the Lazer read
|
|
134
|
+
* executor (`readLazerPrices`). Deliberately narrower than the internal
|
|
135
|
+
* `FetchPolicy` (no `retryDelayMs` / `apiKey` / `fetchImpl`). Falls back to
|
|
136
|
+
* `fetchWithPolicy`'s defaults (15s timeout, 2 retries) when unset.
|
|
148
137
|
*/
|
|
149
138
|
export type PythFetchPolicy = {
|
|
150
139
|
timeoutMs?: number;
|
|
@@ -152,10 +141,9 @@ export type PythFetchPolicy = {
|
|
|
152
141
|
};
|
|
153
142
|
/**
|
|
154
143
|
* `client.pyth` — ONLY the caller-supplied Pyth credential + fetch policy,
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* the Lazer constants inside `rules/pyth-lazer-rule.ts`). A non-Pyth source
|
|
144
|
+
* read by `PythLazerRule`. It carries NO endpoints and NO on-chain object
|
|
145
|
+
* ids: every oracle source owns its own infra, co-located with its rule (the
|
|
146
|
+
* Lazer constants inside `rules/pyth-lazer-rule.ts`). A non-Pyth source
|
|
159
147
|
* never reads this slice.
|
|
160
148
|
* Nothing here is sourced from the canonical `waterx-config` JSON — a Bearer
|
|
161
149
|
* secret has no place in a public CDN document.
|
|
@@ -164,22 +152,20 @@ export interface PythAccessConfig {
|
|
|
164
152
|
/**
|
|
165
153
|
* Pyth access token (`Authorization: Bearer …`). Required by
|
|
166
154
|
* `PythLazerRule`'s signed-update fetch — Lazer is auth-first, so there is
|
|
167
|
-
* no keyless default; absent when a lazer-routed
|
|
168
|
-
* `LazerApiKeyMissing` is thrown
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* `fetch` below.
|
|
155
|
+
* no keyless default; absent when a lazer-routed build runs →
|
|
156
|
+
* `LazerApiKeyMissing` is thrown by `refreshOraclePrices`'s credential
|
|
157
|
+
* pre-check (before any fetch) or by the rule's own fetch. Supplied via
|
|
158
|
+
* the `pythApiKey` create option (the SDK never reads `process.env` or the
|
|
159
|
+
* config JSON). The same key authenticates the Pyth Pro read/history
|
|
160
|
+
* surfaces (`readLazerPrices`, `fetchPythProHistory`).
|
|
174
161
|
*/
|
|
175
162
|
api_key?: string;
|
|
176
163
|
/**
|
|
177
|
-
* Retry/timeout policy for the
|
|
178
|
-
*
|
|
179
|
-
* (
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* timeout, 2 retries) when unset.
|
|
164
|
+
* Retry/timeout policy for the Lazer (`PythLazerRule`) off-chain update
|
|
165
|
+
* fetch — see `fetchWithPolicy` (`./update-fetch.ts`) for the full policy
|
|
166
|
+
* (backoff, which statuses retry, Bearer attachment). Supplied via the
|
|
167
|
+
* `pythFetch` create option. Optional: defaults to `fetchWithPolicy`'s
|
|
168
|
+
* built-in defaults (15s timeout, 2 retries) when unset.
|
|
183
169
|
*/
|
|
184
170
|
fetch?: PythFetchPolicy;
|
|
185
171
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Oracle-layer config schema — the package entries + config slice the shared
|
|
4
|
-
* oracle layer (
|
|
4
|
+
* oracle layer (oracle rules + aggregate) reads. This is shared
|
|
5
5
|
* infra, **not** the perp line: `perp/config.ts` imports these and
|
|
6
6
|
* `WaterXPackages extends OraclePackages`; nothing here imports `perp/` or
|
|
7
7
|
* `prediction/`. Snake_case mirrors the canonical `waterx-config` JSON 1:1.
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The oracle/refresh code used to take a concrete `PerpClient`, which fused the
|
|
5
5
|
* shared oracle layer to the perp line. It only ever needs config-schema
|
|
6
|
-
* lookups, the
|
|
7
|
-
* structural interface instead. `PerpClient` satisfies it without any
|
|
8
|
-
* clause, and a future `PredictClient` (or a test double) can too.
|
|
6
|
+
* lookups, the caller-supplied access slices, and a gRPC client — so it depends
|
|
7
|
+
* on this structural interface instead. `PerpClient` satisfies it without any
|
|
8
|
+
* `implements` clause, and a future `PredictClient` (or a test double) can too.
|
|
9
9
|
*/
|
|
10
10
|
import type { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
11
11
|
import type { Network } from "../constants.ts";
|
|
12
12
|
import type { OracleConfig, PythAccessConfig, WaterxAccessConfig } from "./config.ts";
|
|
13
13
|
import type { OracleSource } from "./price-update-rule.ts";
|
|
14
14
|
export interface OracleHost {
|
|
15
|
-
/** Sui network this client targets — each rule keys its OWN infra table by it (`
|
|
15
|
+
/** Sui network this client targets — each rule keys its OWN infra table by it (`LAZER_INFRA`, `WATERX_INFRA`). */
|
|
16
16
|
readonly network: Network;
|
|
17
17
|
/** Oracle slice of the canonical `waterx-config` JSON (rule packages + per-ticker feeds). */
|
|
18
18
|
readonly config: OracleConfig;
|
|
@@ -29,19 +29,19 @@ export interface OracleHost {
|
|
|
29
29
|
* by the quote-center's CORS allowlist.
|
|
30
30
|
*/
|
|
31
31
|
readonly waterx?: WaterxAccessConfig;
|
|
32
|
-
/** gRPC client for
|
|
32
|
+
/** gRPC client for any on-chain reads an update path needs. */
|
|
33
33
|
readonly grpcClient: SuiGrpcClient;
|
|
34
34
|
/**
|
|
35
|
-
* The FED SET for `refreshOraclePrices`'s update legs
|
|
36
|
-
* `
|
|
37
|
-
*
|
|
35
|
+
* The FED SET for `refreshOraclePrices`'s update legs, derived from the
|
|
36
|
+
* deployment config (`deriveOracleSources`) — never a create option and
|
|
37
|
+
* never an env var.
|
|
38
|
+
*
|
|
39
|
+
* Every derived source's data is fetched and fed in one build; the chain's
|
|
38
40
|
* per-ticker weight tables decide which contributions count (feeding an
|
|
39
|
-
* unweighted rule is dropped on-chain; starving a weighted one aborts)
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* consumers (BE/FE) wire this option from their own env var
|
|
44
|
-
* (`ORACLE_SOURCE`, comma-separated).
|
|
41
|
+
* unweighted rule is dropped on-chain; starving a weighted one aborts).
|
|
42
|
+
* Deriving the maximal wired set is therefore the fail-safe direction, and
|
|
43
|
+
* it keeps the fed set a SUPERSET of every ticker's weighted set through a
|
|
44
|
+
* weight migration for free.
|
|
45
45
|
*/
|
|
46
46
|
readonly oracleSources: readonly OracleSource[];
|
|
47
47
|
/** True when `ticker` is priced by `constant_rule`. */
|
|
@@ -52,9 +52,4 @@ export interface OracleHost {
|
|
|
52
52
|
config: string;
|
|
53
53
|
oracle_holder: string;
|
|
54
54
|
} | undefined;
|
|
55
|
-
/** The `pyth_rule.feeds` entry for `ticker` (`{ feed_id, price_info_object }`); throws if absent. */
|
|
56
|
-
getPythFeed(ticker: string): {
|
|
57
|
-
feed_id: string;
|
|
58
|
-
price_info_object: string;
|
|
59
|
-
};
|
|
60
55
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* The oracle/refresh code used to take a concrete `PerpClient`, which fused the
|
|
6
6
|
* shared oracle layer to the perp line. It only ever needs config-schema
|
|
7
|
-
* lookups, the
|
|
8
|
-
* structural interface instead. `PerpClient` satisfies it without any
|
|
9
|
-
* clause, and a future `PredictClient` (or a test double) can too.
|
|
7
|
+
* lookups, the caller-supplied access slices, and a gRPC client — so it depends
|
|
8
|
+
* on this structural interface instead. `PerpClient` satisfies it without any
|
|
9
|
+
* `implements` clause, and a future `PredictClient` (or a test double) can too.
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -5,32 +5,41 @@
|
|
|
5
5
|
* - `host.ts` — `OracleHost`, the narrow client slice this module reads.
|
|
6
6
|
* - `update-fetch.ts` — `fetchWithPolicy`, the shared retry/timeout/Bearer resilience
|
|
7
7
|
* wrapper every off-chain oracle (and config) fetch goes through.
|
|
8
|
-
* - `pyth.ts` — Pyth as a price source: Hermes REST + on-chain update PTB.
|
|
9
8
|
* - `price-update-rule.ts`— `PriceUpdateRule`, the fetch/build strategy port a rule
|
|
10
9
|
* implements; `rule-registry.ts` + `aggregate.ts` wire
|
|
11
10
|
* routing across rules.
|
|
12
|
-
* - `rules/*` — one file per oracle rule (
|
|
11
|
+
* - `rules/*` — one file per oracle rule (lazer / waterx / supra / constant).
|
|
13
12
|
* - `aggregate.ts` — the orchestrator that feeds rules into a collector + aggregates.
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
13
|
+
* - `read-plane.ts` / `read-prices.ts` — per-source READ plans + their executors.
|
|
14
|
+
* - `validate.ts` — consumers' boot-time coverage/credential asserts.
|
|
15
|
+
* - `schedule.ts` / `symbol-catalog.ts` / `pyth-pro-history.ts` — market hours
|
|
16
|
+
* (parser + status walker), the Pyth Pro symbol catalog,
|
|
17
|
+
* and Pro chart history.
|
|
17
18
|
*/
|
|
18
19
|
export type { OracleHost } from "./host.ts";
|
|
19
20
|
export { FetchPolicyError, fetchWithPolicy, joinEndpointPath } from "./update-fetch.ts";
|
|
20
21
|
export type { FetchPolicy } from "./update-fetch.ts";
|
|
21
|
-
export {
|
|
22
|
-
export
|
|
23
|
-
export type { PriceUpdateRule, PriceUpdateRuleKind, RuleUpdateData, RuleUpdateHandle, BuildUpdateOpts, OracleSource, UpdateDataProvider, } from "./price-update-rule.ts";
|
|
22
|
+
export type { PriceUpdateRule, PriceUpdateRuleKind, RuleUpdateData, RuleUpdateHandle, OracleCredentialRequirement, OracleCredentials, OracleSource, UpdateDataProvider, } from "./price-update-rule.ts";
|
|
23
|
+
export { oracleCredentialsFromHost } from "./price-update-rule.ts";
|
|
24
24
|
export { ORACLE_SOURCES } from "./price-update-rule.ts";
|
|
25
|
-
export {
|
|
26
|
-
export { resolveOracleReadPlan,
|
|
25
|
+
export { deriveOracleSources } from "./source-list.ts";
|
|
26
|
+
export { resolveOracleReadPlan, readPlanTickers } from "./read-plane.ts";
|
|
27
27
|
export type { OracleReadPlan } from "./read-plane.ts";
|
|
28
|
-
export {
|
|
29
|
-
export type {
|
|
28
|
+
export { LazerNotEntitledError, readLazerPrices, readQuoteCenterPrices } from "./read-prices.ts";
|
|
29
|
+
export type { OraclePriceEntry } from "./read-prices.ts";
|
|
30
|
+
export { OracleTickerUnservedError, assertOracleWriteCoverage, missingOracleCredentials, partitionServableTickers, servableTickers, } from "./validate.ts";
|
|
31
|
+
export type { OracleCredentialKind } from "./validate.ts";
|
|
32
|
+
export { assertOracleWeightCoverage, readOracleWeightCoverage, OracleWeightCoverageError, OracleWeightUnreadableError, } from "./weight-coverage.ts";
|
|
33
|
+
export type { TickerWeightCoverage } from "./weight-coverage.ts";
|
|
30
34
|
export { PythLazerRule, LazerApiKeyMissingError } from "./rules/pyth-lazer-rule.ts";
|
|
31
35
|
export type { PythLazerUpdatePayload } from "./rules/pyth-lazer-rule.ts";
|
|
32
|
-
export { WaterxRule, parseSignedEnvelope, parseSignedLeaves, BATCH_PRICE_INTENT, MERKLE_ROOT_INTENT, WATERX_INFRA, waterxQuoteCenterEndpoint, waterxLeavesOf, waterxEnvelopeOf, } from "./rules/waterx-rule.ts";
|
|
33
|
-
export type { WaterxUpdatePayload, WaterxLeafPayload, WaterxEnvelopePayload, WaterxSignedEnvelope, WaterxSignedLeaf, WaterxBatchItem, } from "./rules/waterx-rule.ts";
|
|
36
|
+
export { WaterxRule, parseSignedEnvelope, parseSignedLeaves, BATCH_PRICE_INTENT, MERKLE_ROOT_INTENT, WATERX_INFRA, waterxQuoteCenterEndpoint, fetchWaterxSignedUpdate, fetchWaterxSignedLeaves, fetchWaterxUpdateData, pullWaterxQuotes, WATERX_MAX_PRICE_AGE_MS, isFreshWaterxEntry, waterxLeavesOf, waterxEnvelopeOf, } from "./rules/waterx-rule.ts";
|
|
37
|
+
export type { WaterxUpdatePayload, WaterxLeafPayload, WaterxEnvelopePayload, WaterxSignedEnvelope, WaterxSignedLeaf, WaterxBatchItem, LeafPull, } from "./rules/waterx-rule.ts";
|
|
34
38
|
export { OracleSourceNotImplementedError, resolveOracleRule } from "./rule-registry.ts";
|
|
35
|
-
export { aggregateTicker,
|
|
36
|
-
export {
|
|
39
|
+
export { aggregateTicker, aggregateTickerWithConstant, refreshOraclePrices } from "./aggregate.ts";
|
|
40
|
+
export type { OracleRefreshSummary } from "./aggregate.ts";
|
|
41
|
+
export { PythScheduleParseError, parsePythSchedule, getMarketStatus } from "./schedule.ts";
|
|
42
|
+
export type { HolidayDate, MarketStatusResult, ParsedPythSchedule, TradingHours, TradingSession, } from "./schedule.ts";
|
|
43
|
+
export { fetchPythSymbolCatalog } from "./symbol-catalog.ts";
|
|
44
|
+
export type { PythSymbolRecord } from "./symbol-catalog.ts";
|
|
45
|
+
export { fetchPythProHistory } from "./pyth-pro-history.ts";
|
|
@@ -6,89 +6,89 @@
|
|
|
6
6
|
* - `host.ts` — `OracleHost`, the narrow client slice this module reads.
|
|
7
7
|
* - `update-fetch.ts` — `fetchWithPolicy`, the shared retry/timeout/Bearer resilience
|
|
8
8
|
* wrapper every off-chain oracle (and config) fetch goes through.
|
|
9
|
-
* - `pyth.ts` — Pyth as a price source: Hermes REST + on-chain update PTB.
|
|
10
9
|
* - `price-update-rule.ts`— `PriceUpdateRule`, the fetch/build strategy port a rule
|
|
11
10
|
* implements; `rule-registry.ts` + `aggregate.ts` wire
|
|
12
11
|
* routing across rules.
|
|
13
|
-
* - `rules/*` — one file per oracle rule (
|
|
12
|
+
* - `rules/*` — one file per oracle rule (lazer / waterx / supra / constant).
|
|
14
13
|
* - `aggregate.ts` — the orchestrator that feeds rules into a collector + aggregates.
|
|
15
|
-
*
|
|
16
|
-
* `
|
|
17
|
-
*
|
|
14
|
+
* - `read-plane.ts` / `read-prices.ts` — per-source READ plans + their executors.
|
|
15
|
+
* - `validate.ts` — consumers' boot-time coverage/credential asserts.
|
|
16
|
+
* - `schedule.ts` / `symbol-catalog.ts` / `pyth-pro-history.ts` — market hours
|
|
17
|
+
* (parser + status walker), the Pyth Pro symbol catalog,
|
|
18
|
+
* and Pro chart history.
|
|
18
19
|
*/
|
|
19
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.
|
|
21
|
+
exports.fetchPythProHistory = exports.fetchPythSymbolCatalog = exports.getMarketStatus = exports.parsePythSchedule = exports.PythScheduleParseError = exports.refreshOraclePrices = exports.aggregateTickerWithConstant = exports.aggregateTicker = exports.resolveOracleRule = exports.OracleSourceNotImplementedError = exports.waterxEnvelopeOf = exports.waterxLeavesOf = exports.isFreshWaterxEntry = exports.WATERX_MAX_PRICE_AGE_MS = exports.pullWaterxQuotes = exports.fetchWaterxUpdateData = exports.fetchWaterxSignedLeaves = exports.fetchWaterxSignedUpdate = exports.waterxQuoteCenterEndpoint = exports.WATERX_INFRA = exports.MERKLE_ROOT_INTENT = exports.BATCH_PRICE_INTENT = exports.parseSignedLeaves = exports.parseSignedEnvelope = exports.WaterxRule = exports.LazerApiKeyMissingError = exports.PythLazerRule = exports.OracleWeightUnreadableError = exports.OracleWeightCoverageError = exports.readOracleWeightCoverage = exports.assertOracleWeightCoverage = exports.servableTickers = exports.partitionServableTickers = exports.missingOracleCredentials = exports.assertOracleWriteCoverage = exports.OracleTickerUnservedError = exports.readQuoteCenterPrices = exports.readLazerPrices = exports.LazerNotEntitledError = exports.readPlanTickers = exports.resolveOracleReadPlan = exports.deriveOracleSources = exports.ORACLE_SOURCES = exports.oracleCredentialsFromHost = exports.joinEndpointPath = exports.fetchWithPolicy = exports.FetchPolicyError = void 0;
|
|
21
22
|
// Shared fetch resilience wrapper — `FetchPolicyError` is re-exported (not
|
|
22
23
|
// just the type) so a consumer (e.g. a BE prefetch cache) can `instanceof`
|
|
23
|
-
// it off
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
// them (the hand-rolled copies were how the Pro `/hermes` base path got
|
|
30
|
-
// dropped and the Bearer went missing on sibling fetches).
|
|
24
|
+
// it off a failed rule fetch / `loadConfig` surface, without a deep import
|
|
25
|
+
// of `./update-fetch.ts`. `fetchWithPolicy` + `joinEndpointPath` are exported
|
|
26
|
+
// for consumers that hit oracle-adjacent endpoints THEMSELVES: one shared
|
|
27
|
+
// Bearer/timeout/retry policy and one base-path-safe URL join, instead of
|
|
28
|
+
// each caller re-rolling them (the hand-rolled copies were how base paths
|
|
29
|
+
// got dropped and Bearers went missing on sibling fetches).
|
|
31
30
|
var update_fetch_ts_1 = require("./update-fetch.js");
|
|
32
31
|
Object.defineProperty(exports, "FetchPolicyError", { enumerable: true, get: function () { return update_fetch_ts_1.FetchPolicyError; } });
|
|
33
32
|
Object.defineProperty(exports, "fetchWithPolicy", { enumerable: true, get: function () { return update_fetch_ts_1.fetchWithPolicy; } });
|
|
34
33
|
Object.defineProperty(exports, "joinEndpointPath", { enumerable: true, get: function () { return update_fetch_ts_1.joinEndpointPath; } });
|
|
35
|
-
// Pyth source — `OracleFeeSourceUnavailableError` and
|
|
36
|
-
// `HermesEndpointRejectedAllFeedsError` are re-exported (not just the types)
|
|
37
|
-
// for the same `instanceof` reason as `FetchPolicyError` above: a consumer of
|
|
38
|
-
// `buildPythPriceUpdateCalls` / `updatePythPrices` / `refreshOraclePrices` can
|
|
39
|
-
// branch on the fee-source failure directly, and a consumer of
|
|
40
|
-
// `fetchPriceFeedsUpdateData` / `probeMissingFeeds` can tell a misconfigured
|
|
41
|
-
// or unentitled endpoint apart from feeds that endpoint genuinely lacks.
|
|
42
|
-
var pyth_ts_1 = require("./pyth.js");
|
|
43
|
-
Object.defineProperty(exports, "PythCache", { enumerable: true, get: function () { return pyth_ts_1.PythCache; } });
|
|
44
|
-
Object.defineProperty(exports, "fetchPriceFeedsUpdateData", { enumerable: true, get: function () { return pyth_ts_1.fetchPriceFeedsUpdateData; } });
|
|
45
|
-
Object.defineProperty(exports, "endpointSupportedFeedIds", { enumerable: true, get: function () { return pyth_ts_1.endpointSupportedFeedIds; } });
|
|
46
|
-
Object.defineProperty(exports, "probeMissingFeeds", { enumerable: true, get: function () { return pyth_ts_1.probeMissingFeeds; } });
|
|
47
|
-
Object.defineProperty(exports, "buildPythPriceUpdateCalls", { enumerable: true, get: function () { return pyth_ts_1.buildPythPriceUpdateCalls; } });
|
|
48
|
-
// The pyth read-plane endpoint accessors — Core (keyless, per network) and
|
|
49
|
-
// Pro (the documented fixed base; auth via the caller's Bearer key). There
|
|
50
|
-
// is no client-level endpoint field: consumers pick via
|
|
51
|
-
// `resolveHermesReadEndpoint` (pyth_rule listed → Core, else override ??
|
|
52
|
-
// Pro) — never a hand-rolled branch, never a cross-source fallback.
|
|
53
|
-
Object.defineProperty(exports, "pythCoreHermesEndpoint", { enumerable: true, get: function () { return pyth_ts_1.pythCoreHermesEndpoint; } });
|
|
54
|
-
Object.defineProperty(exports, "pythProHermesEndpoint", { enumerable: true, get: function () { return pyth_ts_1.pythProHermesEndpoint; } });
|
|
55
|
-
Object.defineProperty(exports, "PYTH_PRO_HERMES_ENDPOINT", { enumerable: true, get: function () { return pyth_ts_1.PYTH_PRO_HERMES_ENDPOINT; } });
|
|
56
|
-
Object.defineProperty(exports, "updatePythPrices", { enumerable: true, get: function () { return pyth_ts_1.updatePythPrices; } });
|
|
57
|
-
Object.defineProperty(exports, "HermesEndpointRejectedAllFeedsError", { enumerable: true, get: function () { return pyth_ts_1.HermesEndpointRejectedAllFeedsError; } });
|
|
58
|
-
Object.defineProperty(exports, "MISSING_FEED_MEMO_TTL_MS", { enumerable: true, get: function () { return pyth_ts_1.MISSING_FEED_MEMO_TTL_MS; } });
|
|
59
|
-
Object.defineProperty(exports, "OracleFeeSourceUnavailableError", { enumerable: true, get: function () { return pyth_ts_1.OracleFeeSourceUnavailableError; } });
|
|
60
|
-
// Canonical OracleSource value list + THE env-string parser consumers fold
|
|
61
|
-
// onto — semantics and rationale in `source-list.ts`'s header.
|
|
62
34
|
var price_update_rule_ts_1 = require("./price-update-rule.js");
|
|
63
|
-
Object.defineProperty(exports, "
|
|
35
|
+
Object.defineProperty(exports, "oracleCredentialsFromHost", { enumerable: true, get: function () { return price_update_rule_ts_1.oracleCredentialsFromHost; } });
|
|
36
|
+
// Canonical OracleSource value list + THE fed-set derivation (config in,
|
|
37
|
+
// sources out) — semantics and rationale in `source-list.ts`'s header. There
|
|
38
|
+
// is no `oracleSource` option and no `ORACLE_SOURCE` env var to parse.
|
|
39
|
+
var price_update_rule_ts_2 = require("./price-update-rule.js");
|
|
40
|
+
Object.defineProperty(exports, "ORACLE_SOURCES", { enumerable: true, get: function () { return price_update_rule_ts_2.ORACLE_SOURCES; } });
|
|
64
41
|
var source_list_ts_1 = require("./source-list.js");
|
|
65
|
-
Object.defineProperty(exports, "
|
|
66
|
-
Object.defineProperty(exports, "parseOracleSourceList", { enumerable: true, get: function () { return source_list_ts_1.parseOracleSourceList; } });
|
|
42
|
+
Object.defineProperty(exports, "deriveOracleSources", { enumerable: true, get: function () { return source_list_ts_1.deriveOracleSources; } });
|
|
67
43
|
// Per-source READ-plane resolution — which tickers a source can price
|
|
68
|
-
// off-chain and with which ids (`resolveOracleReadPlan
|
|
69
|
-
//
|
|
70
|
-
// (`
|
|
71
|
-
//
|
|
72
|
-
//
|
|
73
|
-
//
|
|
44
|
+
// off-chain and with which ids (`resolveOracleReadPlan`; every source reads
|
|
45
|
+
// its OWN feeds namespace, so write set == read set), plus the executors that
|
|
46
|
+
// run a plan (`readLazerPrices` / `readQuoteCenterPrices`) and decode each
|
|
47
|
+
// source's wire scaling in ONE place. `LazerNotEntitledError` is re-exported
|
|
48
|
+
// (not just the type) for the same `instanceof` reason as `FetchPolicyError`
|
|
49
|
+
// above: a consumer drops unentitled feeds and retries.
|
|
74
50
|
var read_plane_ts_1 = require("./read-plane.js");
|
|
75
51
|
Object.defineProperty(exports, "resolveOracleReadPlan", { enumerable: true, get: function () { return read_plane_ts_1.resolveOracleReadPlan; } });
|
|
76
|
-
Object.defineProperty(exports, "
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
Object.defineProperty(exports, "
|
|
52
|
+
Object.defineProperty(exports, "readPlanTickers", { enumerable: true, get: function () { return read_plane_ts_1.readPlanTickers; } });
|
|
53
|
+
var read_prices_ts_1 = require("./read-prices.js");
|
|
54
|
+
Object.defineProperty(exports, "LazerNotEntitledError", { enumerable: true, get: function () { return read_prices_ts_1.LazerNotEntitledError; } });
|
|
55
|
+
Object.defineProperty(exports, "readLazerPrices", { enumerable: true, get: function () { return read_prices_ts_1.readLazerPrices; } });
|
|
56
|
+
Object.defineProperty(exports, "readQuoteCenterPrices", { enumerable: true, get: function () { return read_prices_ts_1.readQuoteCenterPrices; } });
|
|
57
|
+
// Boot-time deployment asserts consumers fold onto (`OracleTickerUnservedError`
|
|
58
|
+
// is `instanceof`-able, same rationale as above — and is the SAME type the
|
|
59
|
+
// per-build composers raise). Deliberately NOT called at client creation —
|
|
60
|
+
// see `validate.ts`'s header.
|
|
61
|
+
var validate_ts_1 = require("./validate.js");
|
|
62
|
+
Object.defineProperty(exports, "OracleTickerUnservedError", { enumerable: true, get: function () { return validate_ts_1.OracleTickerUnservedError; } });
|
|
63
|
+
Object.defineProperty(exports, "assertOracleWriteCoverage", { enumerable: true, get: function () { return validate_ts_1.assertOracleWriteCoverage; } });
|
|
64
|
+
Object.defineProperty(exports, "missingOracleCredentials", { enumerable: true, get: function () { return validate_ts_1.missingOracleCredentials; } });
|
|
65
|
+
Object.defineProperty(exports, "partitionServableTickers", { enumerable: true, get: function () { return validate_ts_1.partitionServableTickers; } });
|
|
66
|
+
Object.defineProperty(exports, "servableTickers", { enumerable: true, get: function () { return validate_ts_1.servableTickers; } });
|
|
67
|
+
// The ON-CHAIN half of the same question. `validate.ts` reasons from config
|
|
68
|
+
// alone (necessary, not sufficient); this reads the aggregator weights, which
|
|
69
|
+
// is the only way to catch a ticker that is servable by config yet weighted to
|
|
70
|
+
// a rule the fed set cannot supply — the shape that aborts a WHOLE PTB.
|
|
71
|
+
var weight_coverage_ts_1 = require("./weight-coverage.js");
|
|
72
|
+
Object.defineProperty(exports, "assertOracleWeightCoverage", { enumerable: true, get: function () { return weight_coverage_ts_1.assertOracleWeightCoverage; } });
|
|
73
|
+
Object.defineProperty(exports, "readOracleWeightCoverage", { enumerable: true, get: function () { return weight_coverage_ts_1.readOracleWeightCoverage; } });
|
|
74
|
+
Object.defineProperty(exports, "OracleWeightCoverageError", { enumerable: true, get: function () { return weight_coverage_ts_1.OracleWeightCoverageError; } });
|
|
75
|
+
Object.defineProperty(exports, "OracleWeightUnreadableError", { enumerable: true, get: function () { return weight_coverage_ts_1.OracleWeightUnreadableError; } });
|
|
80
76
|
// Pyth Lazer rule (signed-update generation; `feedLazerRule` stays internal to `aggregate.ts`)
|
|
81
77
|
// `LazerApiKeyMissingError` is re-exported (not just the type) for the same
|
|
82
|
-
// `instanceof` reason as `
|
|
78
|
+
// `instanceof` reason as `FetchPolicyError` above.
|
|
83
79
|
var pyth_lazer_rule_ts_1 = require("./rules/pyth-lazer-rule.js");
|
|
84
80
|
Object.defineProperty(exports, "PythLazerRule", { enumerable: true, get: function () { return pyth_lazer_rule_ts_1.PythLazerRule; } });
|
|
85
81
|
Object.defineProperty(exports, "LazerApiKeyMissingError", { enumerable: true, get: function () { return pyth_lazer_rule_ts_1.LazerApiKeyMissingError; } });
|
|
86
82
|
// `WATERX_INFRA` / `waterxQuoteCenterEndpoint` are the source's own infra table +
|
|
87
|
-
// read-plane accessor
|
|
83
|
+
// read-plane accessor.
|
|
88
84
|
// WaterX quote-center rule (first-party ed25519 signed prices; the `feedWaterxRule*`
|
|
89
85
|
// legs stay internal to `aggregate.ts`). Both wire shapes are exported because a
|
|
90
86
|
// BE prefetch cache holds whichever one its quote-center serves: per-symbol
|
|
91
|
-
// Merkle leaves (default) or one indivisible batch envelope (fallback).
|
|
87
|
+
// Merkle leaves (default) or one indivisible batch envelope (fallback). The
|
|
88
|
+
// WL-2345 seams: the raw fetchers (`fetchWaterxSignedUpdate` /
|
|
89
|
+
// `fetchWaterxSignedLeaves`), the coverage-policy fetch
|
|
90
|
+
// (`fetchWaterxUpdateData`), and the freshness contract
|
|
91
|
+
// (`WATERX_MAX_PRICE_AGE_MS` / `isFreshWaterxEntry`).
|
|
92
92
|
var waterx_rule_ts_1 = require("./rules/waterx-rule.js");
|
|
93
93
|
Object.defineProperty(exports, "WaterxRule", { enumerable: true, get: function () { return waterx_rule_ts_1.WaterxRule; } });
|
|
94
94
|
Object.defineProperty(exports, "parseSignedEnvelope", { enumerable: true, get: function () { return waterx_rule_ts_1.parseSignedEnvelope; } });
|
|
@@ -97,26 +97,39 @@ Object.defineProperty(exports, "BATCH_PRICE_INTENT", { enumerable: true, get: fu
|
|
|
97
97
|
Object.defineProperty(exports, "MERKLE_ROOT_INTENT", { enumerable: true, get: function () { return waterx_rule_ts_1.MERKLE_ROOT_INTENT; } });
|
|
98
98
|
Object.defineProperty(exports, "WATERX_INFRA", { enumerable: true, get: function () { return waterx_rule_ts_1.WATERX_INFRA; } });
|
|
99
99
|
Object.defineProperty(exports, "waterxQuoteCenterEndpoint", { enumerable: true, get: function () { return waterx_rule_ts_1.waterxQuoteCenterEndpoint; } });
|
|
100
|
+
Object.defineProperty(exports, "fetchWaterxSignedUpdate", { enumerable: true, get: function () { return waterx_rule_ts_1.fetchWaterxSignedUpdate; } });
|
|
101
|
+
Object.defineProperty(exports, "fetchWaterxSignedLeaves", { enumerable: true, get: function () { return waterx_rule_ts_1.fetchWaterxSignedLeaves; } });
|
|
102
|
+
Object.defineProperty(exports, "fetchWaterxUpdateData", { enumerable: true, get: function () { return waterx_rule_ts_1.fetchWaterxUpdateData; } });
|
|
103
|
+
Object.defineProperty(exports, "pullWaterxQuotes", { enumerable: true, get: function () { return waterx_rule_ts_1.pullWaterxQuotes; } });
|
|
104
|
+
Object.defineProperty(exports, "WATERX_MAX_PRICE_AGE_MS", { enumerable: true, get: function () { return waterx_rule_ts_1.WATERX_MAX_PRICE_AGE_MS; } });
|
|
105
|
+
Object.defineProperty(exports, "isFreshWaterxEntry", { enumerable: true, get: function () { return waterx_rule_ts_1.isFreshWaterxEntry; } });
|
|
100
106
|
// Rule-owned payload accessors (kind-check + unwrap in one place) — never
|
|
101
107
|
// hand-cast the payload shape, and never assume which variant it is.
|
|
102
108
|
Object.defineProperty(exports, "waterxLeavesOf", { enumerable: true, get: function () { return waterx_rule_ts_1.waterxLeavesOf; } });
|
|
103
109
|
Object.defineProperty(exports, "waterxEnvelopeOf", { enumerable: true, get: function () { return waterx_rule_ts_1.waterxEnvelopeOf; } });
|
|
104
110
|
// `resolveOracleRule` is the ONE source→rule registry — exported so external
|
|
105
111
|
// consumers (e.g. a BE prefetch cache that keys per source and needs each
|
|
106
|
-
// source's `supportedTickers`/`fetchUpdateData`)
|
|
107
|
-
// hand-mirroring the map and drifting.
|
|
108
|
-
// its `instanceof`-able failure (same
|
|
109
|
-
// above).
|
|
112
|
+
// source's `supportedTickers`/`fetchUpdateData`/`updateIdentityBySymbol`)
|
|
113
|
+
// resolve through it instead of hand-mirroring the map and drifting.
|
|
114
|
+
// `OracleSourceNotImplementedError` is its `instanceof`-able failure (same
|
|
115
|
+
// reason as `FetchPolicyError` above).
|
|
110
116
|
var rule_registry_ts_1 = require("./rule-registry.js");
|
|
111
117
|
Object.defineProperty(exports, "OracleSourceNotImplementedError", { enumerable: true, get: function () { return rule_registry_ts_1.OracleSourceNotImplementedError; } });
|
|
112
118
|
Object.defineProperty(exports, "resolveOracleRule", { enumerable: true, get: function () { return rule_registry_ts_1.resolveOracleRule; } });
|
|
113
119
|
// Aggregation orchestrator
|
|
114
120
|
var aggregate_ts_1 = require("./aggregate.js");
|
|
115
121
|
Object.defineProperty(exports, "aggregateTicker", { enumerable: true, get: function () { return aggregate_ts_1.aggregateTicker; } });
|
|
116
|
-
Object.defineProperty(exports, "aggregateTickerWithPyth", { enumerable: true, get: function () { return aggregate_ts_1.aggregateTickerWithPyth; } });
|
|
117
122
|
Object.defineProperty(exports, "aggregateTickerWithConstant", { enumerable: true, get: function () { return aggregate_ts_1.aggregateTickerWithConstant; } });
|
|
118
123
|
Object.defineProperty(exports, "refreshOraclePrices", { enumerable: true, get: function () { return aggregate_ts_1.refreshOraclePrices; } });
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Object.defineProperty(exports, "
|
|
124
|
+
// Market hours: the Pyth schedule-grammar parser + the pure market-status
|
|
125
|
+
// walker (the one cross-repo implementation — see `schedule.ts`'s header).
|
|
126
|
+
var schedule_ts_1 = require("./schedule.js");
|
|
127
|
+
Object.defineProperty(exports, "PythScheduleParseError", { enumerable: true, get: function () { return schedule_ts_1.PythScheduleParseError; } });
|
|
128
|
+
Object.defineProperty(exports, "parsePythSchedule", { enumerable: true, get: function () { return schedule_ts_1.parsePythSchedule; } });
|
|
129
|
+
Object.defineProperty(exports, "getMarketStatus", { enumerable: true, get: function () { return schedule_ts_1.getMarketStatus; } });
|
|
130
|
+
// Pyth Pro symbol catalog (keyless; schedule strings + hex↔integer id map)
|
|
131
|
+
// and Bearer-keyed chart history.
|
|
132
|
+
var symbol_catalog_ts_1 = require("./symbol-catalog.js");
|
|
133
|
+
Object.defineProperty(exports, "fetchPythSymbolCatalog", { enumerable: true, get: function () { return symbol_catalog_ts_1.fetchPythSymbolCatalog; } });
|
|
134
|
+
var pyth_pro_history_ts_1 = require("./pyth-pro-history.js");
|
|
135
|
+
Object.defineProperty(exports, "fetchPythProHistory", { enumerable: true, get: function () { return pyth_pro_history_ts_1.fetchPythProHistory; } });
|