File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
pages/price-feeds/use-real-time-data Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ pub fn sample_with_twap(
285
285
twap_window_seconds ,
286
286
& feed_id ,
287
287
)? ;
288
-
288
+
289
289
// Sample output:
290
290
// The TWAP price is (7160106530699 ± 5129162301) * 10^-8
291
291
msg! (" The TWAP price is ({} ± {}) * 10^{}" , price . price, price . conf, price . exponent);
@@ -308,16 +308,13 @@ import { HermesClient } from "@pythnetwork/hermes-client";
308
308
// The URL below is a public Hermes instance operated by the Pyth Data Association.
309
309
// Hermes is also available from several third-party providers listed here:
310
310
// https://docs.pyth.network/price-feeds/api-instances-and-providers/hermes
311
- const hermesClient = new HermesClient (
312
- " https://hermes.pyth.network/" ,
313
- {}
314
- );
311
+ const hermesClient = new HermesClient (" https://hermes.pyth.network/" , {});
315
312
316
313
// Specify the price feed ID and the TWAP window in seconds (maximum 600 seconds)
317
314
const twapWindowSeconds = 300 ; // 5 minutes
318
315
const twapUpdateData = await hermesClient .getLatestTwaps (
319
316
[" 0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43" ], // BTC/USD feed ID
320
- twapWindowSeconds ,
317
+ twapWindowSeconds ,
321
318
{ encoding: " base64" }
322
319
);
323
320
You can’t perform that action at this time.
0 commit comments