diff --git a/pages/price-feeds/api-instances-and-providers/hermes.mdx b/pages/price-feeds/api-instances-and-providers/hermes.mdx index cc94db5d..0b2120af 100644 --- a/pages/price-feeds/api-instances-and-providers/hermes.mdx +++ b/pages/price-feeds/api-instances-and-providers/hermes.mdx @@ -5,7 +5,7 @@ import { Callout } from "nextra/components"; Hermes is an open-source service that listens to the Pythnet and the Wormhole Network for Pyth price updates, and serves them via a convenient web API. -Hermes allows users to easily [fetch price updates](../fetch-price-updates) via a REST API, or subscribe to a websocket for streaming +Hermes allows users to easily [fetch price updates](../fetch-price-updates) via a REST API, or subscribe to server-side streaming updates. ## Public Endpoints diff --git a/pages/price-feeds/create-your-first-pyth-app/evm/part-1.mdx b/pages/price-feeds/create-your-first-pyth-app/evm/part-1.mdx index b018228b..b6907a35 100644 --- a/pages/price-feeds/create-your-first-pyth-app/evm/part-1.mdx +++ b/pages/price-feeds/create-your-first-pyth-app/evm/part-1.mdx @@ -8,7 +8,7 @@ This tutorial will cover the following topics: - Create a contract that reads the ETH/USD price from Pyth using [pyth-sdk-solidity](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ethereum/sdk/solidity) - Learn how to update Pyth prices to avoid Stale data. - Deploy the contract to OP-sepolia testnet. -- Update and Fetch price using [pyth-evm-js](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ethereum/sdk/js). +- Update and Fetch price using [hermes-client](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes/client/js). This tutorial is divided into two parts: \ [Part 1:](./part-1) Create a contract and fetch prices from Pyth oracles. \ @@ -535,4 +535,4 @@ contract MyFirstPythContractTest is Test { ``` -Check out [Part 2](./part-2) to learn how to deploy our contract to OP-sepolia testnet and fetch prices using pyth-evm-js. +Check out [Part 2](./part-2) to learn how to deploy our contract to OP-sepolia testnet and fetch prices using hermes-client. diff --git a/pages/price-feeds/create-your-first-pyth-app/evm/part-2.mdx b/pages/price-feeds/create-your-first-pyth-app/evm/part-2.mdx index 4152353b..d740937d 100644 --- a/pages/price-feeds/create-your-first-pyth-app/evm/part-2.mdx +++ b/pages/price-feeds/create-your-first-pyth-app/evm/part-2.mdx @@ -8,7 +8,7 @@ This part of the tutorial will conver the following: - Deploy the contract on OP Sepolia testnet. - Interact with the contract from the command line. -- Update and fetch the price from the contract using [pyth-evm-js](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ethereum/sdk/js). +- Update and fetch the price from the contract using [hermes-client](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes/client/js). This tutorial is continuation of the [Part 1: Create a Contract](./part-1). If @@ -166,7 +166,7 @@ cd .. mkdir app cd app npm init -y -npm install --save typescript ts-node viem @pythnetwork/pyth-evm-js +npm install --save typescript ts-node viem @pythnetwork/hermes-client ``` Then open `src/mintNft.ts` and paste in the following content: @@ -175,7 +175,7 @@ Then open `src/mintNft.ts` and paste in the following content: import { createWalletClient, http, parseEther } from "viem"; import { privateKeyToAccount } from "viem/accounts"; import { optimismSepolia } from "viem/chains"; -import { EvmPriceServiceConnection } from "@pythnetwork/pyth-evm-js"; +import { EvmPriceServiceConnection } from "@pythnetwork/hermes-client"; import { getContract } from "viem"; export const abi = [ @@ -236,13 +236,9 @@ async function run() { client, }); - const connection = new EvmPriceServiceConnection( - "https://hermes.pyth.network" - ); + const connection = new HermesClient("https://hermes.pyth.network"); const priceIds = [process.env["ETH_USD_ID"] as string]; - const priceFeedUpdateData = await connection.getPriceFeedsUpdateData( - priceIds - ); + const priceFeedUpdateData = await connection.getLatestPriceUpdates(priceIds); console.log("Retrieved Pyth price update:"); console.log(priceFeedUpdateData); @@ -262,7 +258,7 @@ Notice: This `abi` variable which represents the interface of our contract and c The `run` function does two different things: - First, it instantiates an interface to our contract using the [`viem`](https://viem.sh/) library. -- Second, it uses `EvmPriceServiceConnection` from [`@pythnetwork/pyth-evm-js`](<(https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ethereum/sdk/js)>) to retrieve +- Second, it uses `HermesClient` from [`@pythnetwork/hermes-client`](<(https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes/client/js)>) to retrieve Run this script using: @@ -287,7 +283,7 @@ Congratulations! You've built your first app using Pyth price feeds. ## Conclusion In this tutorial, we created a Solidity contract that updates and reads Pyth prices, tested the contract locally, -then deployed the contract and interacted with it both via the command line and `pyth-evm-js` sdk. +then deployed the contract and interacted with it both via the command line and `hermes-client` sdk. ## Next Steps diff --git a/pages/price-feeds/how-pyth-works/cross-chain.mdx b/pages/price-feeds/how-pyth-works/cross-chain.mdx index 3e8bf179..ad6e39c8 100644 --- a/pages/price-feeds/how-pyth-works/cross-chain.mdx +++ b/pages/price-feeds/how-pyth-works/cross-chain.mdx @@ -12,7 +12,7 @@ then observe the Merkle root message and create a signed VAA for the Merkle root [Hermes](./hermes) continually listens to Wormhole for Pyth Merkle roots at each slot. It also listens to Pythnet to get all the price messages. It stores the latest price messages with their Merkle proof and signed -Merkle root in memory and exposes HTTP and websocket APIs for retrieving the latest update. (Anyone can run an instance +Merkle root in memory and exposes HTTP and server-side streaming APIs for retrieving the latest update. (Anyone can run an instance of this webservice, but the Pyth Data Association runs a public instance for convenience.) When a user wants to use a Pyth price in a transaction, they retrieve the latest update message from Hermes and submit it in their transaction. The update message includes the signed Merkle tree root, along with the Merkle proofs of each included price update. To diff --git a/pages/price-feeds/how-pyth-works/hermes.mdx b/pages/price-feeds/how-pyth-works/hermes.mdx index c230d485..80f3d26d 100644 --- a/pages/price-feeds/how-pyth-works/hermes.mdx +++ b/pages/price-feeds/how-pyth-works/hermes.mdx @@ -4,8 +4,8 @@ serves them via a convenient web API. It provides Pyth's latest price update data format that are more cost-effective to verify and use on-chain. -Hermes allows users to easily query for recent price updates via a REST API, or subscribe to a websocket for streaming -updates. The Pyth Network's Javascript SDKs connect to an instance of Hermes to fetch price updates. +Hermes allows users to easily query for recent price updates via a REST API, or subscribe to a server-side events stream +for streaming updates. The Pyth Network's Javascript SDKs connect to an instance of Hermes to fetch price updates. [hermes-repo]: https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes diff --git a/pages/price-feeds/sponsored-feeds/evm.mdx b/pages/price-feeds/sponsored-feeds/evm.mdx index fb39a80e..d3a0b553 100644 --- a/pages/price-feeds/sponsored-feeds/evm.mdx +++ b/pages/price-feeds/sponsored-feeds/evm.mdx @@ -179,7 +179,7 @@ Update Parameters: **1 hour heartbeat or 1% price deviation** ## Story Mainnet -The price feeds listed in the table below are currently sponsored in **Kraken mainnet**. +The price feeds listed in the table below are currently sponsored in **Story mainnet**. Update Parameters: **1 hour heartbeat or 1% price deviation**