@pythnetwork/hermes-client 1.2.0 → 1.3.1
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/LICENSE +1 -1
- package/README.md +5 -2
- package/lib/HermesClient.d.ts +22 -0
- package/lib/HermesClient.d.ts.map +1 -1
- package/lib/HermesClient.js +39 -6
- package/lib/examples/HermesClient.js +8 -0
- package/lib/zodSchemas.d.ts +817 -11
- package/lib/zodSchemas.d.ts.map +1 -1
- package/lib/zodSchemas.js +61 -0
- package/package.json +2 -2
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -32,7 +32,10 @@ const priceIds = [
|
|
|
32
32
|
];
|
|
33
33
|
|
|
34
34
|
// Get price feeds
|
|
35
|
-
const priceFeeds = await connection.getPriceFeeds(
|
|
35
|
+
const priceFeeds = await connection.getPriceFeeds({
|
|
36
|
+
query: "btc",
|
|
37
|
+
filter: "crypto",
|
|
38
|
+
});
|
|
36
39
|
console.log(priceFeeds);
|
|
37
40
|
|
|
38
41
|
// Latest price updates
|
|
@@ -44,7 +47,7 @@ console.log(priceUpdates);
|
|
|
44
47
|
|
|
45
48
|
```typescript
|
|
46
49
|
// Streaming price updates
|
|
47
|
-
const eventSource = await connection.
|
|
50
|
+
const eventSource = await connection.getPriceUpdatesStream(priceIds);
|
|
48
51
|
|
|
49
52
|
eventSource.onmessage = (event) => {
|
|
50
53
|
console.log("Received price update:", event.data);
|
package/lib/HermesClient.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type EncodingType = z.infer<typeof schemas.EncodingType>;
|
|
|
7
7
|
export type PriceFeedMetadata = z.infer<typeof schemas.PriceFeedMetadata>;
|
|
8
8
|
export type PriceIdInput = z.infer<typeof schemas.PriceIdInput>;
|
|
9
9
|
export type PriceUpdate = z.infer<typeof schemas.PriceUpdate>;
|
|
10
|
+
export type TwapsResponse = z.infer<typeof schemas.TwapsResponse>;
|
|
10
11
|
export type PublisherCaps = z.infer<typeof schemas.LatestPublisherStakeCapsUpdateDataResponse>;
|
|
11
12
|
export type UnixTimestamp = number;
|
|
12
13
|
export type DurationInSeconds = number;
|
|
@@ -130,6 +131,27 @@ export declare class HermesClient {
|
|
|
130
131
|
benchmarksOnly?: boolean;
|
|
131
132
|
ignoreInvalidPriceIds?: boolean;
|
|
132
133
|
}): Promise<EventSource>;
|
|
134
|
+
/**
|
|
135
|
+
* Fetch the latest TWAP (time weighted average price) for a set of price feed IDs.
|
|
136
|
+
* This endpoint can be customized by specifying the encoding type and whether the results should also return the calculated TWAP using the options object.
|
|
137
|
+
* This will throw an error if there is a network problem or the price service returns a non-ok response.
|
|
138
|
+
*
|
|
139
|
+
* @param ids Array of hex-encoded price feed IDs for which updates are requested.
|
|
140
|
+
* @param window_seconds The time window in seconds over which to calculate the TWAP, ending at the current time.
|
|
141
|
+
* For example, a value of 300 would return the most recent 5 minute TWAP. Must be greater than 0 and less than or equal to 600 seconds (10 minutes).
|
|
142
|
+
* @param options Optional parameters:
|
|
143
|
+
* - encoding: Encoding type. If specified, return the TWAP binary data in the encoding specified by the encoding parameter. Default is hex.
|
|
144
|
+
* - parsed: Boolean to specify if the calculated TWAP should be included in the response. Default is false.
|
|
145
|
+
* - ignoreInvalidPriceIds: Boolean to specify if invalid price IDs should be ignored instead of returning an error. Default is false.
|
|
146
|
+
*
|
|
147
|
+
* @returns TwapsResponse object containing the latest TWAPs.
|
|
148
|
+
*/
|
|
149
|
+
getLatestTwaps(ids: HexString[], window_seconds: number, options?: {
|
|
150
|
+
encoding?: EncodingType;
|
|
151
|
+
parsed?: boolean;
|
|
152
|
+
ignoreInvalidPriceIds?: boolean;
|
|
153
|
+
}): Promise<TwapsResponse>;
|
|
133
154
|
private appendUrlSearchParams;
|
|
155
|
+
private buildURL;
|
|
134
156
|
}
|
|
135
157
|
//# sourceMappingURL=HermesClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HermesClient.d.ts","sourceRoot":"","sources":["../src/Hermes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O,CAAC;QACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;KACjC,GACA,OAAO,CAAC,WAAW,CAAC;IAcvB;;;;;;;;;;;;;;;;OAgBG;IACG,qBAAqB,CACzB,GAAG,EAAE,SAAS,EAAE,EAChB,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,YAAY,CAAC;QACxB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,qBAAqB,CAAC,EAAE,OAAO,CAAC;KACjC,GACA,OAAO,CAAC,WAAW,CAAC;IAcvB;;;;;;;;;;;;;;OAcG;IACG,cAAc,CAClB,GAAG,EAAE,SAAS,EAAE,EAChB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,YAAY,CAAC;QACxB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;KACjC,GACA,OAAO,CAAC,aAAa,CAAC;IAczB,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,QAAQ;CAQjB"}
|
package/lib/HermesClient.js
CHANGED
|
@@ -41,7 +41,8 @@ class HermesClient {
|
|
|
41
41
|
const response = await fetch(url, options);
|
|
42
42
|
clearTimeout(timeout); // Clear the timeout if the request completes in time
|
|
43
43
|
if (!response.ok) {
|
|
44
|
-
|
|
44
|
+
const errorBody = await response.text();
|
|
45
|
+
throw new Error(`HTTP error! status: ${response.status}${errorBody ? `, body: ${errorBody}` : ""}`);
|
|
45
46
|
}
|
|
46
47
|
const data = await response.json();
|
|
47
48
|
return schema.parse(data);
|
|
@@ -69,7 +70,7 @@ class HermesClient {
|
|
|
69
70
|
* @returns Array of PriceFeedMetadata objects.
|
|
70
71
|
*/
|
|
71
72
|
async getPriceFeeds(options) {
|
|
72
|
-
const url =
|
|
73
|
+
const url = this.buildURL("price_feeds");
|
|
73
74
|
if (options) {
|
|
74
75
|
this.appendUrlSearchParams(url, options);
|
|
75
76
|
}
|
|
@@ -87,7 +88,7 @@ class HermesClient {
|
|
|
87
88
|
* @returns PublisherCaps object containing the latest publisher stake caps.
|
|
88
89
|
*/
|
|
89
90
|
async getLatestPublisherCaps(options) {
|
|
90
|
-
const url =
|
|
91
|
+
const url = this.buildURL("updates/publisher_stake_caps/latest");
|
|
91
92
|
if (options) {
|
|
92
93
|
this.appendUrlSearchParams(url, options);
|
|
93
94
|
}
|
|
@@ -107,7 +108,7 @@ class HermesClient {
|
|
|
107
108
|
* @returns PriceUpdate object containing the latest updates.
|
|
108
109
|
*/
|
|
109
110
|
async getLatestPriceUpdates(ids, options) {
|
|
110
|
-
const url =
|
|
111
|
+
const url = this.buildURL("updates/price/latest");
|
|
111
112
|
for (const id of ids) {
|
|
112
113
|
url.searchParams.append("ids[]", id);
|
|
113
114
|
}
|
|
@@ -132,7 +133,7 @@ class HermesClient {
|
|
|
132
133
|
* @returns PriceUpdate object containing the updates at the specified timestamp.
|
|
133
134
|
*/
|
|
134
135
|
async getPriceUpdatesAtTimestamp(publishTime, ids, options) {
|
|
135
|
-
const url =
|
|
136
|
+
const url = this.buildURL(`updates/price/${publishTime}`);
|
|
136
137
|
for (const id of ids) {
|
|
137
138
|
url.searchParams.append("ids[]", id);
|
|
138
139
|
}
|
|
@@ -160,7 +161,7 @@ class HermesClient {
|
|
|
160
161
|
* @returns An EventSource instance for receiving streaming updates.
|
|
161
162
|
*/
|
|
162
163
|
async getPriceUpdatesStream(ids, options) {
|
|
163
|
-
const url =
|
|
164
|
+
const url = this.buildURL("updates/price/stream");
|
|
164
165
|
ids.forEach((id) => {
|
|
165
166
|
url.searchParams.append("ids[]", id);
|
|
166
167
|
});
|
|
@@ -170,6 +171,32 @@ class HermesClient {
|
|
|
170
171
|
}
|
|
171
172
|
return new eventsource_1.default(url.toString(), { headers: this.headers });
|
|
172
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Fetch the latest TWAP (time weighted average price) for a set of price feed IDs.
|
|
176
|
+
* This endpoint can be customized by specifying the encoding type and whether the results should also return the calculated TWAP using the options object.
|
|
177
|
+
* This will throw an error if there is a network problem or the price service returns a non-ok response.
|
|
178
|
+
*
|
|
179
|
+
* @param ids Array of hex-encoded price feed IDs for which updates are requested.
|
|
180
|
+
* @param window_seconds The time window in seconds over which to calculate the TWAP, ending at the current time.
|
|
181
|
+
* For example, a value of 300 would return the most recent 5 minute TWAP. Must be greater than 0 and less than or equal to 600 seconds (10 minutes).
|
|
182
|
+
* @param options Optional parameters:
|
|
183
|
+
* - encoding: Encoding type. If specified, return the TWAP binary data in the encoding specified by the encoding parameter. Default is hex.
|
|
184
|
+
* - parsed: Boolean to specify if the calculated TWAP should be included in the response. Default is false.
|
|
185
|
+
* - ignoreInvalidPriceIds: Boolean to specify if invalid price IDs should be ignored instead of returning an error. Default is false.
|
|
186
|
+
*
|
|
187
|
+
* @returns TwapsResponse object containing the latest TWAPs.
|
|
188
|
+
*/
|
|
189
|
+
async getLatestTwaps(ids, window_seconds, options) {
|
|
190
|
+
const url = this.buildURL(`updates/twap/${window_seconds}/latest`);
|
|
191
|
+
for (const id of ids) {
|
|
192
|
+
url.searchParams.append("ids[]", id);
|
|
193
|
+
}
|
|
194
|
+
if (options) {
|
|
195
|
+
const transformedOptions = (0, utils_1.camelToSnakeCaseObject)(options);
|
|
196
|
+
this.appendUrlSearchParams(url, transformedOptions);
|
|
197
|
+
}
|
|
198
|
+
return this.httpRequest(url.toString(), zodSchemas_1.schemas.TwapsResponse);
|
|
199
|
+
}
|
|
173
200
|
appendUrlSearchParams(url, params) {
|
|
174
201
|
Object.entries(params).forEach(([key, value]) => {
|
|
175
202
|
if (value !== undefined) {
|
|
@@ -177,5 +204,11 @@ class HermesClient {
|
|
|
177
204
|
}
|
|
178
205
|
});
|
|
179
206
|
}
|
|
207
|
+
buildURL(endpoint) {
|
|
208
|
+
return new URL(`./v2/${endpoint}`,
|
|
209
|
+
// We ensure the `baseURL` ends with a `/` so that URL doesn't resolve the
|
|
210
|
+
// path relative to the parent.
|
|
211
|
+
`${this.baseURL}${this.baseURL.endsWith("/") ? "" : "/"}`);
|
|
212
|
+
}
|
|
180
213
|
}
|
|
181
214
|
exports.HermesClient = HermesClient;
|
|
@@ -48,15 +48,22 @@ async function run() {
|
|
|
48
48
|
const connection = new HermesClient_1.HermesClient(endpoint, { headers });
|
|
49
49
|
const priceIds = argv.priceIds;
|
|
50
50
|
// Get price feeds
|
|
51
|
+
console.log(`Price feeds matching "btc" with asset type "crypto":`);
|
|
51
52
|
const priceFeeds = await connection.getPriceFeeds({
|
|
52
53
|
query: "btc",
|
|
53
54
|
filter: "crypto",
|
|
54
55
|
});
|
|
55
56
|
console.log(priceFeeds);
|
|
56
57
|
// Latest price updates
|
|
58
|
+
console.log(`Latest price updates for price IDs ${priceIds}:`);
|
|
57
59
|
const priceUpdates = await connection.getLatestPriceUpdates(priceIds);
|
|
58
60
|
console.log(priceUpdates);
|
|
61
|
+
// Get the latest 5 second TWAPs
|
|
62
|
+
console.log(`Latest 5 second TWAPs for price IDs ${priceIds}`);
|
|
63
|
+
const twapUpdates = await connection.getLatestTwaps(priceIds, 5);
|
|
64
|
+
console.log(twapUpdates);
|
|
59
65
|
// Streaming price updates
|
|
66
|
+
console.log(`Streaming latest prices for price IDs ${priceIds}...`);
|
|
60
67
|
const eventSource = await connection.getPriceUpdatesStream(priceIds, {
|
|
61
68
|
encoding: "hex",
|
|
62
69
|
parsed: true,
|
|
@@ -65,6 +72,7 @@ async function run() {
|
|
|
65
72
|
});
|
|
66
73
|
eventSource.onmessage = (event) => {
|
|
67
74
|
console.log("Received price update:", event.data);
|
|
75
|
+
const _priceUpdate = JSON.parse(event.data);
|
|
68
76
|
};
|
|
69
77
|
eventSource.onerror = (error) => {
|
|
70
78
|
console.error("Error receiving updates:", error);
|
package/lib/zodSchemas.d.ts
CHANGED
|
@@ -837,6 +837,296 @@ export declare const schemas: {
|
|
|
837
837
|
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
838
838
|
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
839
839
|
}, z.ZodTypeAny, "passthrough">>;
|
|
840
|
+
ParsedPriceFeedTwap: z.ZodObject<{
|
|
841
|
+
down_slots_ratio: z.ZodString;
|
|
842
|
+
end_timestamp: z.ZodNumber;
|
|
843
|
+
id: z.ZodString;
|
|
844
|
+
start_timestamp: z.ZodNumber;
|
|
845
|
+
twap: z.ZodObject<{
|
|
846
|
+
conf: z.ZodString;
|
|
847
|
+
expo: z.ZodNumber;
|
|
848
|
+
price: z.ZodString;
|
|
849
|
+
publish_time: z.ZodNumber;
|
|
850
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
851
|
+
conf: z.ZodString;
|
|
852
|
+
expo: z.ZodNumber;
|
|
853
|
+
price: z.ZodString;
|
|
854
|
+
publish_time: z.ZodNumber;
|
|
855
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
856
|
+
conf: z.ZodString;
|
|
857
|
+
expo: z.ZodNumber;
|
|
858
|
+
price: z.ZodString;
|
|
859
|
+
publish_time: z.ZodNumber;
|
|
860
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
861
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
862
|
+
down_slots_ratio: z.ZodString;
|
|
863
|
+
end_timestamp: z.ZodNumber;
|
|
864
|
+
id: z.ZodString;
|
|
865
|
+
start_timestamp: z.ZodNumber;
|
|
866
|
+
twap: z.ZodObject<{
|
|
867
|
+
conf: z.ZodString;
|
|
868
|
+
expo: z.ZodNumber;
|
|
869
|
+
price: z.ZodString;
|
|
870
|
+
publish_time: z.ZodNumber;
|
|
871
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
872
|
+
conf: z.ZodString;
|
|
873
|
+
expo: z.ZodNumber;
|
|
874
|
+
price: z.ZodString;
|
|
875
|
+
publish_time: z.ZodNumber;
|
|
876
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
877
|
+
conf: z.ZodString;
|
|
878
|
+
expo: z.ZodNumber;
|
|
879
|
+
price: z.ZodString;
|
|
880
|
+
publish_time: z.ZodNumber;
|
|
881
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
882
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
883
|
+
down_slots_ratio: z.ZodString;
|
|
884
|
+
end_timestamp: z.ZodNumber;
|
|
885
|
+
id: z.ZodString;
|
|
886
|
+
start_timestamp: z.ZodNumber;
|
|
887
|
+
twap: z.ZodObject<{
|
|
888
|
+
conf: z.ZodString;
|
|
889
|
+
expo: z.ZodNumber;
|
|
890
|
+
price: z.ZodString;
|
|
891
|
+
publish_time: z.ZodNumber;
|
|
892
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
893
|
+
conf: z.ZodString;
|
|
894
|
+
expo: z.ZodNumber;
|
|
895
|
+
price: z.ZodString;
|
|
896
|
+
publish_time: z.ZodNumber;
|
|
897
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
898
|
+
conf: z.ZodString;
|
|
899
|
+
expo: z.ZodNumber;
|
|
900
|
+
price: z.ZodString;
|
|
901
|
+
publish_time: z.ZodNumber;
|
|
902
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
903
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
904
|
+
TwapsResponse: z.ZodObject<{
|
|
905
|
+
binary: z.ZodObject<{
|
|
906
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
907
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
908
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
909
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
910
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
911
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
912
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
913
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
914
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
915
|
+
parsed: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
916
|
+
down_slots_ratio: z.ZodString;
|
|
917
|
+
end_timestamp: z.ZodNumber;
|
|
918
|
+
id: z.ZodString;
|
|
919
|
+
start_timestamp: z.ZodNumber;
|
|
920
|
+
twap: z.ZodObject<{
|
|
921
|
+
conf: z.ZodString;
|
|
922
|
+
expo: z.ZodNumber;
|
|
923
|
+
price: z.ZodString;
|
|
924
|
+
publish_time: z.ZodNumber;
|
|
925
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
926
|
+
conf: z.ZodString;
|
|
927
|
+
expo: z.ZodNumber;
|
|
928
|
+
price: z.ZodString;
|
|
929
|
+
publish_time: z.ZodNumber;
|
|
930
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
931
|
+
conf: z.ZodString;
|
|
932
|
+
expo: z.ZodNumber;
|
|
933
|
+
price: z.ZodString;
|
|
934
|
+
publish_time: z.ZodNumber;
|
|
935
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
936
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
937
|
+
down_slots_ratio: z.ZodString;
|
|
938
|
+
end_timestamp: z.ZodNumber;
|
|
939
|
+
id: z.ZodString;
|
|
940
|
+
start_timestamp: z.ZodNumber;
|
|
941
|
+
twap: z.ZodObject<{
|
|
942
|
+
conf: z.ZodString;
|
|
943
|
+
expo: z.ZodNumber;
|
|
944
|
+
price: z.ZodString;
|
|
945
|
+
publish_time: z.ZodNumber;
|
|
946
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
947
|
+
conf: z.ZodString;
|
|
948
|
+
expo: z.ZodNumber;
|
|
949
|
+
price: z.ZodString;
|
|
950
|
+
publish_time: z.ZodNumber;
|
|
951
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
952
|
+
conf: z.ZodString;
|
|
953
|
+
expo: z.ZodNumber;
|
|
954
|
+
price: z.ZodString;
|
|
955
|
+
publish_time: z.ZodNumber;
|
|
956
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
957
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
958
|
+
down_slots_ratio: z.ZodString;
|
|
959
|
+
end_timestamp: z.ZodNumber;
|
|
960
|
+
id: z.ZodString;
|
|
961
|
+
start_timestamp: z.ZodNumber;
|
|
962
|
+
twap: z.ZodObject<{
|
|
963
|
+
conf: z.ZodString;
|
|
964
|
+
expo: z.ZodNumber;
|
|
965
|
+
price: z.ZodString;
|
|
966
|
+
publish_time: z.ZodNumber;
|
|
967
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
968
|
+
conf: z.ZodString;
|
|
969
|
+
expo: z.ZodNumber;
|
|
970
|
+
price: z.ZodString;
|
|
971
|
+
publish_time: z.ZodNumber;
|
|
972
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
973
|
+
conf: z.ZodString;
|
|
974
|
+
expo: z.ZodNumber;
|
|
975
|
+
price: z.ZodString;
|
|
976
|
+
publish_time: z.ZodNumber;
|
|
977
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
978
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
979
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
980
|
+
binary: z.ZodObject<{
|
|
981
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
982
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
983
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
984
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
985
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
986
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
987
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
988
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
989
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
990
|
+
parsed: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
991
|
+
down_slots_ratio: z.ZodString;
|
|
992
|
+
end_timestamp: z.ZodNumber;
|
|
993
|
+
id: z.ZodString;
|
|
994
|
+
start_timestamp: z.ZodNumber;
|
|
995
|
+
twap: z.ZodObject<{
|
|
996
|
+
conf: z.ZodString;
|
|
997
|
+
expo: z.ZodNumber;
|
|
998
|
+
price: z.ZodString;
|
|
999
|
+
publish_time: z.ZodNumber;
|
|
1000
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1001
|
+
conf: z.ZodString;
|
|
1002
|
+
expo: z.ZodNumber;
|
|
1003
|
+
price: z.ZodString;
|
|
1004
|
+
publish_time: z.ZodNumber;
|
|
1005
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1006
|
+
conf: z.ZodString;
|
|
1007
|
+
expo: z.ZodNumber;
|
|
1008
|
+
price: z.ZodString;
|
|
1009
|
+
publish_time: z.ZodNumber;
|
|
1010
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
1011
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1012
|
+
down_slots_ratio: z.ZodString;
|
|
1013
|
+
end_timestamp: z.ZodNumber;
|
|
1014
|
+
id: z.ZodString;
|
|
1015
|
+
start_timestamp: z.ZodNumber;
|
|
1016
|
+
twap: z.ZodObject<{
|
|
1017
|
+
conf: z.ZodString;
|
|
1018
|
+
expo: z.ZodNumber;
|
|
1019
|
+
price: z.ZodString;
|
|
1020
|
+
publish_time: z.ZodNumber;
|
|
1021
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1022
|
+
conf: z.ZodString;
|
|
1023
|
+
expo: z.ZodNumber;
|
|
1024
|
+
price: z.ZodString;
|
|
1025
|
+
publish_time: z.ZodNumber;
|
|
1026
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1027
|
+
conf: z.ZodString;
|
|
1028
|
+
expo: z.ZodNumber;
|
|
1029
|
+
price: z.ZodString;
|
|
1030
|
+
publish_time: z.ZodNumber;
|
|
1031
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
1032
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1033
|
+
down_slots_ratio: z.ZodString;
|
|
1034
|
+
end_timestamp: z.ZodNumber;
|
|
1035
|
+
id: z.ZodString;
|
|
1036
|
+
start_timestamp: z.ZodNumber;
|
|
1037
|
+
twap: z.ZodObject<{
|
|
1038
|
+
conf: z.ZodString;
|
|
1039
|
+
expo: z.ZodNumber;
|
|
1040
|
+
price: z.ZodString;
|
|
1041
|
+
publish_time: z.ZodNumber;
|
|
1042
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1043
|
+
conf: z.ZodString;
|
|
1044
|
+
expo: z.ZodNumber;
|
|
1045
|
+
price: z.ZodString;
|
|
1046
|
+
publish_time: z.ZodNumber;
|
|
1047
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1048
|
+
conf: z.ZodString;
|
|
1049
|
+
expo: z.ZodNumber;
|
|
1050
|
+
price: z.ZodString;
|
|
1051
|
+
publish_time: z.ZodNumber;
|
|
1052
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
1053
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
1054
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1055
|
+
binary: z.ZodObject<{
|
|
1056
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
1057
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
1058
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1059
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
1060
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
1061
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1062
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
1063
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
1064
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
1065
|
+
parsed: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1066
|
+
down_slots_ratio: z.ZodString;
|
|
1067
|
+
end_timestamp: z.ZodNumber;
|
|
1068
|
+
id: z.ZodString;
|
|
1069
|
+
start_timestamp: z.ZodNumber;
|
|
1070
|
+
twap: z.ZodObject<{
|
|
1071
|
+
conf: z.ZodString;
|
|
1072
|
+
expo: z.ZodNumber;
|
|
1073
|
+
price: z.ZodString;
|
|
1074
|
+
publish_time: z.ZodNumber;
|
|
1075
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1076
|
+
conf: z.ZodString;
|
|
1077
|
+
expo: z.ZodNumber;
|
|
1078
|
+
price: z.ZodString;
|
|
1079
|
+
publish_time: z.ZodNumber;
|
|
1080
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1081
|
+
conf: z.ZodString;
|
|
1082
|
+
expo: z.ZodNumber;
|
|
1083
|
+
price: z.ZodString;
|
|
1084
|
+
publish_time: z.ZodNumber;
|
|
1085
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
1086
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1087
|
+
down_slots_ratio: z.ZodString;
|
|
1088
|
+
end_timestamp: z.ZodNumber;
|
|
1089
|
+
id: z.ZodString;
|
|
1090
|
+
start_timestamp: z.ZodNumber;
|
|
1091
|
+
twap: z.ZodObject<{
|
|
1092
|
+
conf: z.ZodString;
|
|
1093
|
+
expo: z.ZodNumber;
|
|
1094
|
+
price: z.ZodString;
|
|
1095
|
+
publish_time: z.ZodNumber;
|
|
1096
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1097
|
+
conf: z.ZodString;
|
|
1098
|
+
expo: z.ZodNumber;
|
|
1099
|
+
price: z.ZodString;
|
|
1100
|
+
publish_time: z.ZodNumber;
|
|
1101
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1102
|
+
conf: z.ZodString;
|
|
1103
|
+
expo: z.ZodNumber;
|
|
1104
|
+
price: z.ZodString;
|
|
1105
|
+
publish_time: z.ZodNumber;
|
|
1106
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
1107
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1108
|
+
down_slots_ratio: z.ZodString;
|
|
1109
|
+
end_timestamp: z.ZodNumber;
|
|
1110
|
+
id: z.ZodString;
|
|
1111
|
+
start_timestamp: z.ZodNumber;
|
|
1112
|
+
twap: z.ZodObject<{
|
|
1113
|
+
conf: z.ZodString;
|
|
1114
|
+
expo: z.ZodNumber;
|
|
1115
|
+
price: z.ZodString;
|
|
1116
|
+
publish_time: z.ZodNumber;
|
|
1117
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1118
|
+
conf: z.ZodString;
|
|
1119
|
+
expo: z.ZodNumber;
|
|
1120
|
+
price: z.ZodString;
|
|
1121
|
+
publish_time: z.ZodNumber;
|
|
1122
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1123
|
+
conf: z.ZodString;
|
|
1124
|
+
expo: z.ZodNumber;
|
|
1125
|
+
price: z.ZodString;
|
|
1126
|
+
publish_time: z.ZodNumber;
|
|
1127
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
1128
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
1129
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
840
1130
|
};
|
|
841
1131
|
export declare const api: import("@zodios/core").ZodiosInstance<[{
|
|
842
1132
|
method: "get";
|
|
@@ -2474,22 +2764,280 @@ export declare const api: import("@zodios/core").ZodiosInstance<[{
|
|
|
2474
2764
|
cap: z.ZodNumber;
|
|
2475
2765
|
publisher: z.ZodString;
|
|
2476
2766
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2477
|
-
cap: z.ZodNumber;
|
|
2478
|
-
publisher: z.ZodString;
|
|
2479
|
-
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
2767
|
+
cap: z.ZodNumber;
|
|
2768
|
+
publisher: z.ZodString;
|
|
2769
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
2770
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2771
|
+
publisher_stake_caps: z.ZodArray<z.ZodObject<{
|
|
2772
|
+
cap: z.ZodNumber;
|
|
2773
|
+
publisher: z.ZodString;
|
|
2774
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2775
|
+
cap: z.ZodNumber;
|
|
2776
|
+
publisher: z.ZodString;
|
|
2777
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2778
|
+
cap: z.ZodNumber;
|
|
2779
|
+
publisher: z.ZodString;
|
|
2780
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
2781
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
2782
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2783
|
+
}, {
|
|
2784
|
+
method: "get";
|
|
2785
|
+
path: "/v2/updates/twap/:window_seconds/latest";
|
|
2786
|
+
alias: "latest_twaps";
|
|
2787
|
+
description: "Get the latest TWAP by price feed id with a custom time window.\n\nGiven a collection of price feed ids, retrieve the latest Pyth TWAP price for each price feed.";
|
|
2788
|
+
requestFormat: "json";
|
|
2789
|
+
parameters: [{
|
|
2790
|
+
name: "window_seconds";
|
|
2791
|
+
type: "Path";
|
|
2792
|
+
schema: z.ZodNumber;
|
|
2793
|
+
}, {
|
|
2794
|
+
name: "ids[]";
|
|
2795
|
+
type: "Query";
|
|
2796
|
+
schema: z.ZodArray<z.ZodString, "many">;
|
|
2797
|
+
}, {
|
|
2798
|
+
name: "encoding";
|
|
2799
|
+
type: "Query";
|
|
2800
|
+
schema: z.ZodOptional<z.ZodEnum<["hex", "base64"]>>;
|
|
2801
|
+
}, {
|
|
2802
|
+
name: "parsed";
|
|
2803
|
+
type: "Query";
|
|
2804
|
+
schema: z.ZodOptional<z.ZodBoolean>;
|
|
2805
|
+
}, {
|
|
2806
|
+
name: "ignore_invalid_price_ids";
|
|
2807
|
+
type: "Query";
|
|
2808
|
+
schema: z.ZodOptional<z.ZodBoolean>;
|
|
2809
|
+
}];
|
|
2810
|
+
response: z.ZodObject<{
|
|
2811
|
+
binary: z.ZodObject<{
|
|
2812
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
2813
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
2814
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2815
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
2816
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
2817
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2818
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
2819
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
2820
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2821
|
+
parsed: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
2822
|
+
down_slots_ratio: z.ZodString;
|
|
2823
|
+
end_timestamp: z.ZodNumber;
|
|
2824
|
+
id: z.ZodString;
|
|
2825
|
+
start_timestamp: z.ZodNumber;
|
|
2826
|
+
twap: z.ZodObject<{
|
|
2827
|
+
conf: z.ZodString;
|
|
2828
|
+
expo: z.ZodNumber;
|
|
2829
|
+
price: z.ZodString;
|
|
2830
|
+
publish_time: z.ZodNumber;
|
|
2831
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2832
|
+
conf: z.ZodString;
|
|
2833
|
+
expo: z.ZodNumber;
|
|
2834
|
+
price: z.ZodString;
|
|
2835
|
+
publish_time: z.ZodNumber;
|
|
2836
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2837
|
+
conf: z.ZodString;
|
|
2838
|
+
expo: z.ZodNumber;
|
|
2839
|
+
price: z.ZodString;
|
|
2840
|
+
publish_time: z.ZodNumber;
|
|
2841
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2842
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2843
|
+
down_slots_ratio: z.ZodString;
|
|
2844
|
+
end_timestamp: z.ZodNumber;
|
|
2845
|
+
id: z.ZodString;
|
|
2846
|
+
start_timestamp: z.ZodNumber;
|
|
2847
|
+
twap: z.ZodObject<{
|
|
2848
|
+
conf: z.ZodString;
|
|
2849
|
+
expo: z.ZodNumber;
|
|
2850
|
+
price: z.ZodString;
|
|
2851
|
+
publish_time: z.ZodNumber;
|
|
2852
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2853
|
+
conf: z.ZodString;
|
|
2854
|
+
expo: z.ZodNumber;
|
|
2855
|
+
price: z.ZodString;
|
|
2856
|
+
publish_time: z.ZodNumber;
|
|
2857
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2858
|
+
conf: z.ZodString;
|
|
2859
|
+
expo: z.ZodNumber;
|
|
2860
|
+
price: z.ZodString;
|
|
2861
|
+
publish_time: z.ZodNumber;
|
|
2862
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2863
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2864
|
+
down_slots_ratio: z.ZodString;
|
|
2865
|
+
end_timestamp: z.ZodNumber;
|
|
2866
|
+
id: z.ZodString;
|
|
2867
|
+
start_timestamp: z.ZodNumber;
|
|
2868
|
+
twap: z.ZodObject<{
|
|
2869
|
+
conf: z.ZodString;
|
|
2870
|
+
expo: z.ZodNumber;
|
|
2871
|
+
price: z.ZodString;
|
|
2872
|
+
publish_time: z.ZodNumber;
|
|
2873
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2874
|
+
conf: z.ZodString;
|
|
2875
|
+
expo: z.ZodNumber;
|
|
2876
|
+
price: z.ZodString;
|
|
2877
|
+
publish_time: z.ZodNumber;
|
|
2878
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2879
|
+
conf: z.ZodString;
|
|
2880
|
+
expo: z.ZodNumber;
|
|
2881
|
+
price: z.ZodString;
|
|
2882
|
+
publish_time: z.ZodNumber;
|
|
2883
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2884
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
2885
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2886
|
+
binary: z.ZodObject<{
|
|
2887
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
2888
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
2889
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2890
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
2891
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
2892
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2893
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
2894
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
2895
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2896
|
+
parsed: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
2897
|
+
down_slots_ratio: z.ZodString;
|
|
2898
|
+
end_timestamp: z.ZodNumber;
|
|
2899
|
+
id: z.ZodString;
|
|
2900
|
+
start_timestamp: z.ZodNumber;
|
|
2901
|
+
twap: z.ZodObject<{
|
|
2902
|
+
conf: z.ZodString;
|
|
2903
|
+
expo: z.ZodNumber;
|
|
2904
|
+
price: z.ZodString;
|
|
2905
|
+
publish_time: z.ZodNumber;
|
|
2906
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2907
|
+
conf: z.ZodString;
|
|
2908
|
+
expo: z.ZodNumber;
|
|
2909
|
+
price: z.ZodString;
|
|
2910
|
+
publish_time: z.ZodNumber;
|
|
2911
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2912
|
+
conf: z.ZodString;
|
|
2913
|
+
expo: z.ZodNumber;
|
|
2914
|
+
price: z.ZodString;
|
|
2915
|
+
publish_time: z.ZodNumber;
|
|
2916
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2917
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2918
|
+
down_slots_ratio: z.ZodString;
|
|
2919
|
+
end_timestamp: z.ZodNumber;
|
|
2920
|
+
id: z.ZodString;
|
|
2921
|
+
start_timestamp: z.ZodNumber;
|
|
2922
|
+
twap: z.ZodObject<{
|
|
2923
|
+
conf: z.ZodString;
|
|
2924
|
+
expo: z.ZodNumber;
|
|
2925
|
+
price: z.ZodString;
|
|
2926
|
+
publish_time: z.ZodNumber;
|
|
2927
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2928
|
+
conf: z.ZodString;
|
|
2929
|
+
expo: z.ZodNumber;
|
|
2930
|
+
price: z.ZodString;
|
|
2931
|
+
publish_time: z.ZodNumber;
|
|
2932
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2933
|
+
conf: z.ZodString;
|
|
2934
|
+
expo: z.ZodNumber;
|
|
2935
|
+
price: z.ZodString;
|
|
2936
|
+
publish_time: z.ZodNumber;
|
|
2937
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2938
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2939
|
+
down_slots_ratio: z.ZodString;
|
|
2940
|
+
end_timestamp: z.ZodNumber;
|
|
2941
|
+
id: z.ZodString;
|
|
2942
|
+
start_timestamp: z.ZodNumber;
|
|
2943
|
+
twap: z.ZodObject<{
|
|
2944
|
+
conf: z.ZodString;
|
|
2945
|
+
expo: z.ZodNumber;
|
|
2946
|
+
price: z.ZodString;
|
|
2947
|
+
publish_time: z.ZodNumber;
|
|
2948
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2949
|
+
conf: z.ZodString;
|
|
2950
|
+
expo: z.ZodNumber;
|
|
2951
|
+
price: z.ZodString;
|
|
2952
|
+
publish_time: z.ZodNumber;
|
|
2953
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2954
|
+
conf: z.ZodString;
|
|
2955
|
+
expo: z.ZodNumber;
|
|
2956
|
+
price: z.ZodString;
|
|
2957
|
+
publish_time: z.ZodNumber;
|
|
2958
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2959
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
2960
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2961
|
+
binary: z.ZodObject<{
|
|
2962
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
2963
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
2964
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2965
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
2966
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
2967
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2968
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
2969
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
2970
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2971
|
+
parsed: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
2972
|
+
down_slots_ratio: z.ZodString;
|
|
2973
|
+
end_timestamp: z.ZodNumber;
|
|
2974
|
+
id: z.ZodString;
|
|
2975
|
+
start_timestamp: z.ZodNumber;
|
|
2976
|
+
twap: z.ZodObject<{
|
|
2977
|
+
conf: z.ZodString;
|
|
2978
|
+
expo: z.ZodNumber;
|
|
2979
|
+
price: z.ZodString;
|
|
2980
|
+
publish_time: z.ZodNumber;
|
|
2981
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2982
|
+
conf: z.ZodString;
|
|
2983
|
+
expo: z.ZodNumber;
|
|
2984
|
+
price: z.ZodString;
|
|
2985
|
+
publish_time: z.ZodNumber;
|
|
2986
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2987
|
+
conf: z.ZodString;
|
|
2988
|
+
expo: z.ZodNumber;
|
|
2989
|
+
price: z.ZodString;
|
|
2990
|
+
publish_time: z.ZodNumber;
|
|
2991
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2992
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2993
|
+
down_slots_ratio: z.ZodString;
|
|
2994
|
+
end_timestamp: z.ZodNumber;
|
|
2995
|
+
id: z.ZodString;
|
|
2996
|
+
start_timestamp: z.ZodNumber;
|
|
2997
|
+
twap: z.ZodObject<{
|
|
2998
|
+
conf: z.ZodString;
|
|
2999
|
+
expo: z.ZodNumber;
|
|
3000
|
+
price: z.ZodString;
|
|
3001
|
+
publish_time: z.ZodNumber;
|
|
3002
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
3003
|
+
conf: z.ZodString;
|
|
3004
|
+
expo: z.ZodNumber;
|
|
3005
|
+
price: z.ZodString;
|
|
3006
|
+
publish_time: z.ZodNumber;
|
|
3007
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
3008
|
+
conf: z.ZodString;
|
|
3009
|
+
expo: z.ZodNumber;
|
|
3010
|
+
price: z.ZodString;
|
|
3011
|
+
publish_time: z.ZodNumber;
|
|
3012
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2480
3013
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
3014
|
+
down_slots_ratio: z.ZodString;
|
|
3015
|
+
end_timestamp: z.ZodNumber;
|
|
3016
|
+
id: z.ZodString;
|
|
3017
|
+
start_timestamp: z.ZodNumber;
|
|
3018
|
+
twap: z.ZodObject<{
|
|
3019
|
+
conf: z.ZodString;
|
|
3020
|
+
expo: z.ZodNumber;
|
|
3021
|
+
price: z.ZodString;
|
|
3022
|
+
publish_time: z.ZodNumber;
|
|
2484
3023
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2485
|
-
|
|
2486
|
-
|
|
3024
|
+
conf: z.ZodString;
|
|
3025
|
+
expo: z.ZodNumber;
|
|
3026
|
+
price: z.ZodString;
|
|
3027
|
+
publish_time: z.ZodNumber;
|
|
2487
3028
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
3029
|
+
conf: z.ZodString;
|
|
3030
|
+
expo: z.ZodNumber;
|
|
3031
|
+
price: z.ZodString;
|
|
3032
|
+
publish_time: z.ZodNumber;
|
|
3033
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
2491
3034
|
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
2492
3035
|
}, z.ZodTypeAny, "passthrough">>;
|
|
3036
|
+
errors: [{
|
|
3037
|
+
status: 404;
|
|
3038
|
+
description: string;
|
|
3039
|
+
schema: z.ZodVoid;
|
|
3040
|
+
}];
|
|
2493
3041
|
}]>;
|
|
2494
3042
|
export declare function createApiClient(baseUrl: string, options?: ZodiosOptions): import("@zodios/core").ZodiosInstance<[{
|
|
2495
3043
|
method: "get";
|
|
@@ -4143,5 +4691,263 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
|
|
|
4143
4691
|
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
4144
4692
|
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
4145
4693
|
}, z.ZodTypeAny, "passthrough">>;
|
|
4694
|
+
}, {
|
|
4695
|
+
method: "get";
|
|
4696
|
+
path: "/v2/updates/twap/:window_seconds/latest";
|
|
4697
|
+
alias: "latest_twaps";
|
|
4698
|
+
description: "Get the latest TWAP by price feed id with a custom time window.\n\nGiven a collection of price feed ids, retrieve the latest Pyth TWAP price for each price feed.";
|
|
4699
|
+
requestFormat: "json";
|
|
4700
|
+
parameters: [{
|
|
4701
|
+
name: "window_seconds";
|
|
4702
|
+
type: "Path";
|
|
4703
|
+
schema: z.ZodNumber;
|
|
4704
|
+
}, {
|
|
4705
|
+
name: "ids[]";
|
|
4706
|
+
type: "Query";
|
|
4707
|
+
schema: z.ZodArray<z.ZodString, "many">;
|
|
4708
|
+
}, {
|
|
4709
|
+
name: "encoding";
|
|
4710
|
+
type: "Query";
|
|
4711
|
+
schema: z.ZodOptional<z.ZodEnum<["hex", "base64"]>>;
|
|
4712
|
+
}, {
|
|
4713
|
+
name: "parsed";
|
|
4714
|
+
type: "Query";
|
|
4715
|
+
schema: z.ZodOptional<z.ZodBoolean>;
|
|
4716
|
+
}, {
|
|
4717
|
+
name: "ignore_invalid_price_ids";
|
|
4718
|
+
type: "Query";
|
|
4719
|
+
schema: z.ZodOptional<z.ZodBoolean>;
|
|
4720
|
+
}];
|
|
4721
|
+
response: z.ZodObject<{
|
|
4722
|
+
binary: z.ZodObject<{
|
|
4723
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
4724
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
4725
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4726
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
4727
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
4728
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4729
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
4730
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
4731
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4732
|
+
parsed: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
4733
|
+
down_slots_ratio: z.ZodString;
|
|
4734
|
+
end_timestamp: z.ZodNumber;
|
|
4735
|
+
id: z.ZodString;
|
|
4736
|
+
start_timestamp: z.ZodNumber;
|
|
4737
|
+
twap: z.ZodObject<{
|
|
4738
|
+
conf: z.ZodString;
|
|
4739
|
+
expo: z.ZodNumber;
|
|
4740
|
+
price: z.ZodString;
|
|
4741
|
+
publish_time: z.ZodNumber;
|
|
4742
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4743
|
+
conf: z.ZodString;
|
|
4744
|
+
expo: z.ZodNumber;
|
|
4745
|
+
price: z.ZodString;
|
|
4746
|
+
publish_time: z.ZodNumber;
|
|
4747
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4748
|
+
conf: z.ZodString;
|
|
4749
|
+
expo: z.ZodNumber;
|
|
4750
|
+
price: z.ZodString;
|
|
4751
|
+
publish_time: z.ZodNumber;
|
|
4752
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4753
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4754
|
+
down_slots_ratio: z.ZodString;
|
|
4755
|
+
end_timestamp: z.ZodNumber;
|
|
4756
|
+
id: z.ZodString;
|
|
4757
|
+
start_timestamp: z.ZodNumber;
|
|
4758
|
+
twap: z.ZodObject<{
|
|
4759
|
+
conf: z.ZodString;
|
|
4760
|
+
expo: z.ZodNumber;
|
|
4761
|
+
price: z.ZodString;
|
|
4762
|
+
publish_time: z.ZodNumber;
|
|
4763
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4764
|
+
conf: z.ZodString;
|
|
4765
|
+
expo: z.ZodNumber;
|
|
4766
|
+
price: z.ZodString;
|
|
4767
|
+
publish_time: z.ZodNumber;
|
|
4768
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4769
|
+
conf: z.ZodString;
|
|
4770
|
+
expo: z.ZodNumber;
|
|
4771
|
+
price: z.ZodString;
|
|
4772
|
+
publish_time: z.ZodNumber;
|
|
4773
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4774
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4775
|
+
down_slots_ratio: z.ZodString;
|
|
4776
|
+
end_timestamp: z.ZodNumber;
|
|
4777
|
+
id: z.ZodString;
|
|
4778
|
+
start_timestamp: z.ZodNumber;
|
|
4779
|
+
twap: z.ZodObject<{
|
|
4780
|
+
conf: z.ZodString;
|
|
4781
|
+
expo: z.ZodNumber;
|
|
4782
|
+
price: z.ZodString;
|
|
4783
|
+
publish_time: z.ZodNumber;
|
|
4784
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4785
|
+
conf: z.ZodString;
|
|
4786
|
+
expo: z.ZodNumber;
|
|
4787
|
+
price: z.ZodString;
|
|
4788
|
+
publish_time: z.ZodNumber;
|
|
4789
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4790
|
+
conf: z.ZodString;
|
|
4791
|
+
expo: z.ZodNumber;
|
|
4792
|
+
price: z.ZodString;
|
|
4793
|
+
publish_time: z.ZodNumber;
|
|
4794
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4795
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
4796
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4797
|
+
binary: z.ZodObject<{
|
|
4798
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
4799
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
4800
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4801
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
4802
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
4803
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4804
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
4805
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
4806
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4807
|
+
parsed: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
4808
|
+
down_slots_ratio: z.ZodString;
|
|
4809
|
+
end_timestamp: z.ZodNumber;
|
|
4810
|
+
id: z.ZodString;
|
|
4811
|
+
start_timestamp: z.ZodNumber;
|
|
4812
|
+
twap: z.ZodObject<{
|
|
4813
|
+
conf: z.ZodString;
|
|
4814
|
+
expo: z.ZodNumber;
|
|
4815
|
+
price: z.ZodString;
|
|
4816
|
+
publish_time: z.ZodNumber;
|
|
4817
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4818
|
+
conf: z.ZodString;
|
|
4819
|
+
expo: z.ZodNumber;
|
|
4820
|
+
price: z.ZodString;
|
|
4821
|
+
publish_time: z.ZodNumber;
|
|
4822
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4823
|
+
conf: z.ZodString;
|
|
4824
|
+
expo: z.ZodNumber;
|
|
4825
|
+
price: z.ZodString;
|
|
4826
|
+
publish_time: z.ZodNumber;
|
|
4827
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4828
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4829
|
+
down_slots_ratio: z.ZodString;
|
|
4830
|
+
end_timestamp: z.ZodNumber;
|
|
4831
|
+
id: z.ZodString;
|
|
4832
|
+
start_timestamp: z.ZodNumber;
|
|
4833
|
+
twap: z.ZodObject<{
|
|
4834
|
+
conf: z.ZodString;
|
|
4835
|
+
expo: z.ZodNumber;
|
|
4836
|
+
price: z.ZodString;
|
|
4837
|
+
publish_time: z.ZodNumber;
|
|
4838
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4839
|
+
conf: z.ZodString;
|
|
4840
|
+
expo: z.ZodNumber;
|
|
4841
|
+
price: z.ZodString;
|
|
4842
|
+
publish_time: z.ZodNumber;
|
|
4843
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4844
|
+
conf: z.ZodString;
|
|
4845
|
+
expo: z.ZodNumber;
|
|
4846
|
+
price: z.ZodString;
|
|
4847
|
+
publish_time: z.ZodNumber;
|
|
4848
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4849
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4850
|
+
down_slots_ratio: z.ZodString;
|
|
4851
|
+
end_timestamp: z.ZodNumber;
|
|
4852
|
+
id: z.ZodString;
|
|
4853
|
+
start_timestamp: z.ZodNumber;
|
|
4854
|
+
twap: z.ZodObject<{
|
|
4855
|
+
conf: z.ZodString;
|
|
4856
|
+
expo: z.ZodNumber;
|
|
4857
|
+
price: z.ZodString;
|
|
4858
|
+
publish_time: z.ZodNumber;
|
|
4859
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4860
|
+
conf: z.ZodString;
|
|
4861
|
+
expo: z.ZodNumber;
|
|
4862
|
+
price: z.ZodString;
|
|
4863
|
+
publish_time: z.ZodNumber;
|
|
4864
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4865
|
+
conf: z.ZodString;
|
|
4866
|
+
expo: z.ZodNumber;
|
|
4867
|
+
price: z.ZodString;
|
|
4868
|
+
publish_time: z.ZodNumber;
|
|
4869
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4870
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
4871
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4872
|
+
binary: z.ZodObject<{
|
|
4873
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
4874
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
4875
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4876
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
4877
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
4878
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4879
|
+
data: z.ZodArray<z.ZodString, "many">;
|
|
4880
|
+
encoding: z.ZodEnum<["hex", "base64"]>;
|
|
4881
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4882
|
+
parsed: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
4883
|
+
down_slots_ratio: z.ZodString;
|
|
4884
|
+
end_timestamp: z.ZodNumber;
|
|
4885
|
+
id: z.ZodString;
|
|
4886
|
+
start_timestamp: z.ZodNumber;
|
|
4887
|
+
twap: z.ZodObject<{
|
|
4888
|
+
conf: z.ZodString;
|
|
4889
|
+
expo: z.ZodNumber;
|
|
4890
|
+
price: z.ZodString;
|
|
4891
|
+
publish_time: z.ZodNumber;
|
|
4892
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4893
|
+
conf: z.ZodString;
|
|
4894
|
+
expo: z.ZodNumber;
|
|
4895
|
+
price: z.ZodString;
|
|
4896
|
+
publish_time: z.ZodNumber;
|
|
4897
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4898
|
+
conf: z.ZodString;
|
|
4899
|
+
expo: z.ZodNumber;
|
|
4900
|
+
price: z.ZodString;
|
|
4901
|
+
publish_time: z.ZodNumber;
|
|
4902
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4903
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4904
|
+
down_slots_ratio: z.ZodString;
|
|
4905
|
+
end_timestamp: z.ZodNumber;
|
|
4906
|
+
id: z.ZodString;
|
|
4907
|
+
start_timestamp: z.ZodNumber;
|
|
4908
|
+
twap: z.ZodObject<{
|
|
4909
|
+
conf: z.ZodString;
|
|
4910
|
+
expo: z.ZodNumber;
|
|
4911
|
+
price: z.ZodString;
|
|
4912
|
+
publish_time: z.ZodNumber;
|
|
4913
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4914
|
+
conf: z.ZodString;
|
|
4915
|
+
expo: z.ZodNumber;
|
|
4916
|
+
price: z.ZodString;
|
|
4917
|
+
publish_time: z.ZodNumber;
|
|
4918
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4919
|
+
conf: z.ZodString;
|
|
4920
|
+
expo: z.ZodNumber;
|
|
4921
|
+
price: z.ZodString;
|
|
4922
|
+
publish_time: z.ZodNumber;
|
|
4923
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4924
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4925
|
+
down_slots_ratio: z.ZodString;
|
|
4926
|
+
end_timestamp: z.ZodNumber;
|
|
4927
|
+
id: z.ZodString;
|
|
4928
|
+
start_timestamp: z.ZodNumber;
|
|
4929
|
+
twap: z.ZodObject<{
|
|
4930
|
+
conf: z.ZodString;
|
|
4931
|
+
expo: z.ZodNumber;
|
|
4932
|
+
price: z.ZodString;
|
|
4933
|
+
publish_time: z.ZodNumber;
|
|
4934
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4935
|
+
conf: z.ZodString;
|
|
4936
|
+
expo: z.ZodNumber;
|
|
4937
|
+
price: z.ZodString;
|
|
4938
|
+
publish_time: z.ZodNumber;
|
|
4939
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4940
|
+
conf: z.ZodString;
|
|
4941
|
+
expo: z.ZodNumber;
|
|
4942
|
+
price: z.ZodString;
|
|
4943
|
+
publish_time: z.ZodNumber;
|
|
4944
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4945
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
4946
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4947
|
+
errors: [{
|
|
4948
|
+
status: 404;
|
|
4949
|
+
description: string;
|
|
4950
|
+
schema: z.ZodVoid;
|
|
4951
|
+
}];
|
|
4146
4952
|
}]>;
|
|
4147
4953
|
//# sourceMappingURL=zodSchemas.d.ts.map
|
package/lib/zodSchemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zodSchemas.d.ts","sourceRoot":"","sources":["../src/zodSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"zodSchemas.d.ts","sourceRoot":"","sources":["../src/zodSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8ExB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEvE"}
|
package/lib/zodSchemas.js
CHANGED
|
@@ -63,6 +63,21 @@ const LatestPublisherStakeCapsUpdateDataResponse = zod_1.z
|
|
|
63
63
|
parsed: zod_1.z.array(ParsedPublisherStakeCapsUpdate).nullish(),
|
|
64
64
|
})
|
|
65
65
|
.passthrough();
|
|
66
|
+
const ParsedPriceFeedTwap = zod_1.z
|
|
67
|
+
.object({
|
|
68
|
+
down_slots_ratio: zod_1.z.string(),
|
|
69
|
+
end_timestamp: zod_1.z.number().int(),
|
|
70
|
+
id: RpcPriceIdentifier,
|
|
71
|
+
start_timestamp: zod_1.z.number().int(),
|
|
72
|
+
twap: RpcPrice,
|
|
73
|
+
})
|
|
74
|
+
.passthrough();
|
|
75
|
+
const TwapsResponse = zod_1.z
|
|
76
|
+
.object({
|
|
77
|
+
binary: BinaryUpdate,
|
|
78
|
+
parsed: zod_1.z.array(ParsedPriceFeedTwap).nullish(),
|
|
79
|
+
})
|
|
80
|
+
.passthrough();
|
|
66
81
|
exports.schemas = {
|
|
67
82
|
AssetType,
|
|
68
83
|
asset_type,
|
|
@@ -78,6 +93,8 @@ exports.schemas = {
|
|
|
78
93
|
ParsedPublisherStakeCap,
|
|
79
94
|
ParsedPublisherStakeCapsUpdate,
|
|
80
95
|
LatestPublisherStakeCapsUpdateDataResponse,
|
|
96
|
+
ParsedPriceFeedTwap,
|
|
97
|
+
TwapsResponse,
|
|
81
98
|
};
|
|
82
99
|
const endpoints = (0, core_1.makeApi)([
|
|
83
100
|
{
|
|
@@ -253,6 +270,50 @@ Given a collection of price feed ids, retrieve the latest Pyth price for each pr
|
|
|
253
270
|
],
|
|
254
271
|
response: LatestPublisherStakeCapsUpdateDataResponse,
|
|
255
272
|
},
|
|
273
|
+
{
|
|
274
|
+
method: "get",
|
|
275
|
+
path: "/v2/updates/twap/:window_seconds/latest",
|
|
276
|
+
alias: "latest_twaps",
|
|
277
|
+
description: `Get the latest TWAP by price feed id with a custom time window.
|
|
278
|
+
|
|
279
|
+
Given a collection of price feed ids, retrieve the latest Pyth TWAP price for each price feed.`,
|
|
280
|
+
requestFormat: "json",
|
|
281
|
+
parameters: [
|
|
282
|
+
{
|
|
283
|
+
name: "window_seconds",
|
|
284
|
+
type: "Path",
|
|
285
|
+
schema: zod_1.z.number().int().gte(0),
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
name: "ids[]",
|
|
289
|
+
type: "Query",
|
|
290
|
+
schema: zod_1.z.array(PriceIdInput),
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
name: "encoding",
|
|
294
|
+
type: "Query",
|
|
295
|
+
schema: zod_1.z.enum(["hex", "base64"]).optional(),
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: "parsed",
|
|
299
|
+
type: "Query",
|
|
300
|
+
schema: zod_1.z.boolean().optional(),
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: "ignore_invalid_price_ids",
|
|
304
|
+
type: "Query",
|
|
305
|
+
schema: zod_1.z.boolean().optional(),
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
response: TwapsResponse,
|
|
309
|
+
errors: [
|
|
310
|
+
{
|
|
311
|
+
status: 404,
|
|
312
|
+
description: `Price ids not found`,
|
|
313
|
+
schema: zod_1.z.void(),
|
|
314
|
+
},
|
|
315
|
+
],
|
|
316
|
+
},
|
|
256
317
|
]);
|
|
257
318
|
exports.api = new core_1.Zodios(endpoints);
|
|
258
319
|
function createApiClient(baseUrl, options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pythnetwork/hermes-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Pyth Hermes Client",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Pyth Data Association"
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"eventsource": "^2.0.2",
|
|
56
56
|
"zod": "^3.23.8"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "cdaf99e8629cd6af655a5f1c2c5750de9bc485dd"
|
|
59
59
|
}
|