From e1768c27534f56140a85cb7a8d7780c05d7dc9ae Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Wed, 18 Oct 2023 18:31:38 +0200 Subject: [PATCH] chore: remove price service mentions in the repo --- README.md | 28 +++++-------------- contract_manager/scripts/update_pricefeed.ts | 6 ++-- package-lock.json | 8 +++--- price_pusher/README.md | 6 ++-- price_pusher/config.aptos.testnet.sample.json | 2 +- price_pusher/config.evm.testnet.sample.json | 2 +- .../config.injective.testnet.sample.json | 2 +- price_pusher/config.sui.mainnet.sample.json | 2 +- price_pusher/config.sui.testnet.sample.json | 2 +- price_service/client/js/README.md | 21 ++++++-------- price_service/client/js/package.json | 2 +- price_service/server/README.md | 16 ++--------- .../aptos/examples/mint_nft/app/src/App.tsx | 4 +-- target_chains/aptos/sdk/js/README.md | 23 ++++++++------- target_chains/aptos/sdk/js/package.json | 2 +- .../examples/oracle_swap/app/src/App.tsx | 25 ++++++++--------- .../oracle_swap/app/src/OrderEntry.tsx | 8 +++--- target_chains/ethereum/sdk/js/README.md | 19 +++++-------- target_chains/ethereum/sdk/js/package.json | 2 +- target_chains/sui/sdk/js/README.md | 10 ++++--- target_chains/sui/sdk/js/package.json | 2 +- 21 files changed, 77 insertions(+), 115 deletions(-) diff --git a/README.md b/README.md index c3027cdb3..fccea7594 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,6 @@ Pyth Crosschain. Within this monorepo you will find the following subprojects: -## Wormhole Attester - -> wormhole_attester - -The main Pyth implementation currently exists as an [on-chain contract][] on -Pythnet, a separate instance of the Solana blockchain. In order to expose -these prices cross-chain, the Wormhole Attester contract acts as a sender for Pyth prices. At regular intervals the Pyth -contract will observe the current Pyth price for selected products, and produce -an attestation which is then relayed over Wormhole to be consumed by the -various receiver contracts. - -[on-chain contract]: https://github.com/pyth-network/pyth-client - ## Target Chains > target_chains @@ -27,17 +14,16 @@ blockchain runtimes that Pyth supports. Each subdirectory corresponds to a blockchain runtime. Inside each subdirectory, there are subfolders for contracts, SDKs, and examples. -## Price Service +## Hermes -> price_service +> hermes -The Price Service is an off-chain service which constantly observes the -Wormhole network watching for price attestations emitted from the Pyth -contract. It exposes all observed attestations via a public API over HTTPS/WSS -which can be consumed by client-side applications that wish to use Pyth pricing -data. +Hermesis an off-chain service which constantly observes Pythnet and the +Wormhole network watching for price updates emitted from the Pyth contract. It +exposes all observed attestations via a public API over HTTPS/WSS which can be +consumed by client-side applications that wish to use Pyth pricing data. -The `client` subdirectory provides an SDK for interacting with the price service. +The `price_service/client` directory provides an SDK for interacting with Hermes. However, most users will interact with the price service via a chain-specific SDK For a guide on utilising this service in your project, see the chain-specific SDK diff --git a/contract_manager/scripts/update_pricefeed.ts b/contract_manager/scripts/update_pricefeed.ts index cd16c4a8d..ec520936a 100644 --- a/contract_manager/scripts/update_pricefeed.ts +++ b/contract_manager/scripts/update_pricefeed.ts @@ -25,7 +25,7 @@ const parser = yargs(hideBin(process.argv)) }, endpoint: { type: "string", - desc: "Price service endpoint to use, defaults to https://xc-mainnet.pyth.network for mainnet and https://xc-testnet.pyth.network for testnet", + desc: "Hermes endpoint to use, defaults to https://hermes.pyth.network for mainnet and https://hermes-beta.pyth.network for testnet", }, }); @@ -40,8 +40,8 @@ async function main() { ); } const defaultEndpoint = contract.getChain().isMainnet() - ? "https://xc-mainnet.pyth.network" - : "https://xc-testnet.pyth.network"; + ? "https://hermes.pyth.network" + : "https://hermes-beta.pyth.network"; const priceService = new PriceServiceConnection( argv.endpoint || defaultEndpoint ); diff --git a/package-lock.json b/package-lock.json index a9c20b3f3..bfd0d36f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56241,7 +56241,7 @@ }, "price_service/client/js": { "name": "@pythnetwork/price-service-client", - "version": "1.8.1", + "version": "1.8.2", "license": "Apache-2.0", "dependencies": { "@pythnetwork/price-service-sdk": "*", @@ -56748,7 +56748,7 @@ }, "target_chains/aptos/sdk/js": { "name": "@pythnetwork/pyth-aptos-js", - "version": "1.4.1", + "version": "1.4.2", "license": "Apache-2.0", "dependencies": { "@pythnetwork/price-service-client": "*", @@ -58309,7 +58309,7 @@ }, "target_chains/ethereum/sdk/js": { "name": "@pythnetwork/pyth-evm-js", - "version": "1.29.1", + "version": "1.29.2", "license": "Apache-2.0", "dependencies": { "@pythnetwork/price-service-client": "*", @@ -59008,7 +59008,7 @@ }, "target_chains/sui/sdk/js": { "name": "@pythnetwork/pyth-sui-js", - "version": "1.2.3", + "version": "1.2.4", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.37.1", diff --git a/price_pusher/README.md b/price_pusher/README.md index b19c15327..898bf6469 100644 --- a/price_pusher/README.md +++ b/price_pusher/README.md @@ -85,7 +85,7 @@ npm run start -- injective --grpc-endpoint https://grpc-endpoint.com \ # For Aptos npm run start -- aptos --endpoint https://fullnode.testnet.aptoslabs.com/v1 \ - --pyth-contract-address 0x7e783b349d3e89cf5931af376ebeadbfab855b3fa239b7ada8f5a92fbea6b387 --price-service-endpoint "https://xc-testnet.pyth.network" \ + --pyth-contract-address 0x7e783b349d3e89cf5931af376ebeadbfab855b3fa239b7ada8f5a92fbea6b387 --price-service-endpoint "https://hermes-beta.pyth.network" \ --price-config-file "./price-config.testnet.sample.yaml" \ --mnemonic-file "path/to/mnemonic.txt" \ [--pushing-frequency 10] \ @@ -99,7 +99,7 @@ npm run start -- sui \ --wormhole-package-id 0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e \ --wormhole-state-id 0xebba4cc4d614f7a7cdbe883acc76d1cc767922bc96778e7b68be0d15fce27c02 \ --price-feed-to-price-info-object-table-id 0xf8929174008c662266a1adde78e1e8e33016eb7ad37d379481e860b911e40ed5 \ - --price-service-endpoint https://xc-testnet.pyth.network \ + --price-service-endpoint https://hermes-beta.pyth.network \ --mnemonic-file ./mnemonic \ --price-config-file ./price-config.testnet.sample.yaml \ [--pushing-frequency 10] \ @@ -128,7 +128,7 @@ For example, to push `BTC/USD` and `BNB/USD` prices on Fantom testnet, run the f ```sh npm run dev -- evm --endpoint https://endpoints.omniatech.io/v1/fantom/testnet/public \ - --pyth-contract-address 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C --price-service-endpoint https://xc-testnet.pyth.network \ + --pyth-contract-address 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C --price-service-endpoint https://hermes-beta.pyth.network \ --mnemonic-file "./mnemonic" --price-config-file "./price-config.testnet.sample.yaml" ``` diff --git a/price_pusher/config.aptos.testnet.sample.json b/price_pusher/config.aptos.testnet.sample.json index bb994095e..9cc38fa0d 100644 --- a/price_pusher/config.aptos.testnet.sample.json +++ b/price_pusher/config.aptos.testnet.sample.json @@ -1,7 +1,7 @@ { "endpoint": "https://fullnode.testnet.aptoslabs.com/v1", "pyth-contract-address": "0x7e783b349d3e89cf5931af376ebeadbfab855b3fa239b7ada8f5a92fbea6b387", - "price-service-endpoint": "https://xc-testnet.pyth.network", + "price-service-endpoint": "https://hermes-beta.pyth.network", "mnemonic-file": "./mnemonic", "price-config-file": "./price-config.testnet.sample.yaml" } diff --git a/price_pusher/config.evm.testnet.sample.json b/price_pusher/config.evm.testnet.sample.json index b4aaded1b..3c37887ea 100644 --- a/price_pusher/config.evm.testnet.sample.json +++ b/price_pusher/config.evm.testnet.sample.json @@ -1,7 +1,7 @@ { "endpoint": "https://endpoints.omniatech.io/v1/fantom/testnet/public", "pyth-contract-address": "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C", - "price-service-endpoint": "https://xc-testnet.pyth.network", + "price-service-endpoint": "https://hermes-beta.pyth.network", "mnemonic-file": "./mnemonic", "price-config-file": "./price-config.testnet.sample.yaml" } diff --git a/price_pusher/config.injective.testnet.sample.json b/price_pusher/config.injective.testnet.sample.json index 880f94bfe..1ef0e0f0e 100644 --- a/price_pusher/config.injective.testnet.sample.json +++ b/price_pusher/config.injective.testnet.sample.json @@ -1,7 +1,7 @@ { "grpc-endpoint": "https://k8s.testnet.chain.grpc-web.injective.network", "pyth-contract-address": "inj1z60tg0tekdzcasenhuuwq3htjcd5slmgf7gpez", - "price-service-endpoint": "https://xc-testnet.pyth.network", + "price-service-endpoint": "https://hermes-beta.pyth.network", "mnemonic-file": "./mnemonic", "price-config-file": "./price-config.testnet.sample.yaml", "network": "testnet" diff --git a/price_pusher/config.sui.mainnet.sample.json b/price_pusher/config.sui.mainnet.sample.json index 00f098adc..8dc64b78a 100644 --- a/price_pusher/config.sui.mainnet.sample.json +++ b/price_pusher/config.sui.mainnet.sample.json @@ -5,7 +5,7 @@ "wormhole-package-id": "0x5306f64e312b581766351c07af79c72fcb1cd25147157fdc2f8ad76de9a3fb6a", "wormhole-state-id": "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c", "price-feed-to-price-info-object-table-id": "0x14b4697477d24c30c8eecc31dd1bd49a3115a9fe0db6bd4fd570cf14640b79a0", - "price-service-endpoint": "https://xc-mainnet.pyth.network", + "price-service-endpoint": "https://hermes.pyth.network", "mnemonic-file": "./mnemonic", "price-config-file": "./price-config.mainnet.sample.yaml" } diff --git a/price_pusher/config.sui.testnet.sample.json b/price_pusher/config.sui.testnet.sample.json index 4baf1a3c0..87e7e47f9 100644 --- a/price_pusher/config.sui.testnet.sample.json +++ b/price_pusher/config.sui.testnet.sample.json @@ -5,7 +5,7 @@ "wormhole-package-id": "0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e", "wormhole-state-id": "0xebba4cc4d614f7a7cdbe883acc76d1cc767922bc96778e7b68be0d15fce27c02", "price-feed-to-price-info-object-table-id": "0xf8929174008c662266a1adde78e1e8e33016eb7ad37d379481e860b911e40ed5", - "price-service-endpoint": "https://xc-testnet.pyth.network", + "price-service-endpoint": "https://hermes-beta.pyth.network", "mnemonic-file": "./mnemonic", "price-config-file": "./price-config.testnet.sample.yaml" } diff --git a/price_service/client/js/README.md b/price_service/client/js/README.md index ec42e40f0..266197a33 100644 --- a/price_service/client/js/README.md +++ b/price_service/client/js/README.md @@ -1,8 +1,8 @@ # Price Service Client [Pyth Network](https://pyth.network/) provides real-time pricing data in a variety of asset classes, including cryptocurrency, equities, FX and commodities. -These prices are available either via HTTP or WebSocket from Pyth's [price service](https://github.com/pyth-network/pyth-crosschain/tree/main/price_service/server). -This library is a client for interacting with the price service, allowing your application to consume Pyth real-time prices in on- and off-chain Javascript/Typescript applications. +These prices are available either via HTTP or WebSocket from [Hermes](https://github.com/pyth-network/pyth-crosschain/tree/main/hermes). +This library is a client for interacting with Hermes, allowing your application to consume Pyth real-time prices in on- and off-chain Javascript/Typescript applications. ## Installation @@ -24,7 +24,7 @@ Typical usage of the connection is along the following lines: ```typescript const connection = new PriceServiceConnection( - "https://xc-testnet.pyth.network", + "https://hermes-beta.pyth.network", { priceFeedRequestConfig: { // Provide this option to retrieve signed price updates for on-chain contracts. @@ -32,7 +32,7 @@ const connection = new PriceServiceConnection( binary: true, }, } -); // See Price Service endpoints section below for other endpoints +); // See Hermes endpoints section below for other endpoints const priceIds = [ // You can find the ids of prices at https://pyth.network/developers/price-feed-ids#pyth-evm-testnet @@ -67,7 +67,7 @@ setTimeout(() => { ### On-chain Applications -On-chain applications will need to submit the price updates returned by the price service to the Pyth contract on their blockchain. +On-chain applications will need to submit the price updates returned by Hermes to the Pyth contract on their blockchain. These applications should pass the `binary: true` option to the constructor as shown above, to ensure that all methods on `PriceServiceConnection` return the required information. This option will add a `vaa` field to `PriceFeed` that represents a signed price update. The `vaa` is a binary blob serialized as a base64 string. @@ -80,14 +80,9 @@ You can run it with `npm run example`. A full command that prints BTC and ETH price feeds, in the testnet network, looks like so: ```bash -npm run example -- --endpoint https://xc-testnet.pyth.network --price-ids 0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b 0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6 +npm run example -- --endpoint https://hermes-beta.pyth.network --price-ids 0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b 0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6 ``` -## Price Service endpoints +## Hermes endpoints -Public endpoints for the Price Service are provided for both mainnet and testnet. These can be used regardless of which network you deploy your own contracts to as long as it is a Pyth supported network. For example, you can use the testnet Price Service whether you are deploying your contract to the BNB or Polygon testnet. - -| network | url | -| ------- | ------------------------------- | -| mainnet | https://xc-mainnet.pyth.network | -| testnet | https://xc-testnet.pyth.network | +You can find the list of Hermes public endpoints [here](https://docs.pyth.network/documentation/pythnet-price-feeds/hermes#public-endpoints). diff --git a/price_service/client/js/package.json b/price_service/client/js/package.json index 4bff7fff2..34cf163a8 100644 --- a/price_service/client/js/package.json +++ b/price_service/client/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/price-service-client", - "version": "1.8.1", + "version": "1.8.2", "description": "Pyth price service client", "author": { "name": "Pyth Data Association" diff --git a/price_service/server/README.md b/price_service/server/README.md index b1a329395..76565680b 100644 --- a/price_service/server/README.md +++ b/price_service/server/README.md @@ -1,24 +1,12 @@ # Pyth Price Service +** Pyth price service is deprecated. Please use [Hermes](../../hermes/) instead. ** + The Pyth price service is a webservice that listens to the Wormhole Network for Pyth price updates and serves them via a convenient web API. The service allows users to easily query for recent price updates via a REST API, or subscribe to a websocket for streaming updates. [Price service JS client](https://github.com/pyth-network/pyth-crosschain/tree/main/price_service/sdk/js) connects to an instance of the price service in order to fetch on-demand price updates. -## Public Endpoints - -The Pyth Data Association operates two public endpoints for the price service, for mainnet and testnet respectively. -These endpoints can be used to test integrations with Pyth Network: - -| network | url | -| ------- | ------------------------------- | -| mainnet | https://xc-mainnet.pyth.network | -| testnet | https://xc-testnet.pyth.network | - -For production deployments, developers integrating with Pyth Network are **strongly encouraged** to host their own instance of the price service for maximum resilience and decentralization. -By running an independent instance of this service, developers tap directly into Wormhole's peer-to-peer network to stream Pyth price updates. -This peer-to-peer network has built-in redundancy and is therefore inherently more reliable than a centralized service operated by the PDA. - ## Wormhole Spy The price service depends on a Wormhole Spy to stream Pyth messages from the Wormhole Network to it. The diff --git a/target_chains/aptos/examples/mint_nft/app/src/App.tsx b/target_chains/aptos/examples/mint_nft/app/src/App.tsx index 1a29acf07..83d856422 100644 --- a/target_chains/aptos/examples/mint_nft/app/src/App.tsx +++ b/target_chains/aptos/examples/mint_nft/app/src/App.tsx @@ -7,11 +7,11 @@ import logo from "./logo.svg"; // Please read https://docs.pyth.network/documentation/pythnet-price-feeds before building on Pyth // Rpc endpoint -const TESTNET_PRICE_SERVICE = "https://xc-testnet.pyth.network"; +const TESTNET_HERMES_ENDPOINT = "https://hermes-beta.pyth.network"; // Connection const testnetConnection = new AptosPriceServiceConnection( - TESTNET_PRICE_SERVICE + TESTNET_HERMES_ENDPOINT ); // Price service client used to retrieve the offchain VAAs to update the onchain price // Price id : this is not an aptos account but instead an opaque identifier for each price https://pyth.network/developers/price-feed-ids/#pyth-cross-chain-testnet diff --git a/target_chains/aptos/sdk/js/README.md b/target_chains/aptos/sdk/js/README.md index f5f94788a..96c3fb9f0 100644 --- a/target_chains/aptos/sdk/js/README.md +++ b/target_chains/aptos/sdk/js/README.md @@ -21,14 +21,14 @@ $ yarn add @pythnetwork/pyth-aptos-js Pyth stores prices off-chain to minimize gas fees, which allows us to offer a wider selection of products and faster update times. See [On-Demand Updates](https://docs.pyth.network/documentation/pythnet-price-feeds/on-demand) for more information about this approach. To use Pyth prices on chain, -they must be fetched from an off-chain price service. The `AptosPriceServiceConnection` class can be used to interact with these services, +they must be fetched from a Hermes instance. The `AptosPriceServiceConnection` class can be used to interact with these services, providing a way to fetch these prices directly in your code. The following example wraps an existing RPC provider and shows how to obtain Pyth prices and submit them to the network: ```typescript const connection = new AptosPriceServiceConnection( - "https://xc-testnet.pyth.network" -); // See Price Service endpoints section below for other endpoints + "https://hermes-beta.pyth.network" +); // See Hermes endpoints section below for other endpoints const priceIds = [ // You can find the ids of prices at https://pyth.network/developers/price-feed-ids#aptos-testnet @@ -120,21 +120,20 @@ setTimeout(() => { [This example](./src/examples/AptosRelay.ts) shows how to update prices on an Aptos network. It does the following: -1. Fetches update data from the Price Service for the given price feeds. +1. Fetches update data from Hermes for the given price feeds. 2. Calls the Pyth Aptos contract with the update data. You can run this example with `npm run example-relay`. A full command that updates BTC and ETH prices on the BNB Chain testnet network looks like this: ```bash export APTOS_KEY = "0x..."; -npm run example-relay -- --endpoint https://xc-testnet.pyth.network --price-ids 0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b 0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6 --full-node https://fullnode.testnet.aptoslabs.com/v1 --pyth-contract 0xaa706d631cde8c634fe1876b0c93e4dec69d0c6ccac30a734e9e257042e81541 +npm run example-relay -- \ + --endpoint https://hermes-beta.pyth.network \ + --full-node https://fullnode.testnet.aptoslabs.com/v1 \ + --pyth-contract 0xaa706d631cde8c634fe1876b0c93e4dec69d0c6ccac30a734e9e257042e81541 \ + --price-ids 0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b 0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6 ``` -## Price Service endpoints +## Hermes endpoints -We provide public endpoints for the price service, although it is strongly recommended to host your own instance. - -| Aptos Network | Price Service URL | -| ------------- | ------------------------------- | -| Testnet | https://xc-testnet.pyth.network | -| Mainnet | https://xc-mainnet.pyth.network | +Please find the list of public Hermes endpoints [here](https://docs.pyth.network/documentation/pythnet-price-feeds/hermes#public-endpoints). diff --git a/target_chains/aptos/sdk/js/package.json b/target_chains/aptos/sdk/js/package.json index 4d6f5f427..5c90ea0dd 100644 --- a/target_chains/aptos/sdk/js/package.json +++ b/target_chains/aptos/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-aptos-js", - "version": "1.4.1", + "version": "1.4.2", "description": "Pyth Network Aptos Utilities", "homepage": "https://pyth.network", "author": { diff --git a/target_chains/ethereum/examples/oracle_swap/app/src/App.tsx b/target_chains/ethereum/examples/oracle_swap/app/src/App.tsx index bc2c489d1..b78780b45 100644 --- a/target_chains/ethereum/examples/oracle_swap/app/src/App.tsx +++ b/target_chains/ethereum/examples/oracle_swap/app/src/App.tsx @@ -34,7 +34,7 @@ const CONFIG = { }, swapContractAddress: "0x15F9ccA28688F5E6Cbc8B00A8f33e8cE73eD7B02", pythContractAddress: "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C", - priceServiceUrl: "https://xc-testnet.pyth.network", + hermesUrl: "https://hermes-beta.pyth.network", mintQty: 100, }; @@ -98,18 +98,15 @@ function App() { useEffect(() => { // The Pyth price service client is used to retrieve the current Pyth prices and the price update data that // needs to be posted on-chain with each transaction. - const pythPriceService = new EvmPriceServiceConnection( - CONFIG.priceServiceUrl, - { - logger: { - error: console.error, - warn: console.warn, - info: () => undefined, - debug: () => undefined, - trace: () => undefined, - }, - } - ); + const pythPriceService = new EvmPriceServiceConnection(CONFIG.hermesUrl, { + logger: { + error: console.error, + warn: console.warn, + info: () => undefined, + debug: () => undefined, + trace: () => undefined, + }, + }); pythPriceService.subscribePriceFeedUpdates( [CONFIG.baseToken.pythPriceFeedId, CONFIG.quoteToken.pythPriceFeedId], @@ -289,7 +286,7 @@ function App() { approxPrice={exchangeRateMeta?.rate} baseToken={CONFIG.baseToken} quoteToken={CONFIG.quoteToken} - priceServiceUrl={CONFIG.priceServiceUrl} + hermesUrl={CONFIG.hermesUrl} pythContractAddress={CONFIG.pythContractAddress} swapContractAddress={CONFIG.swapContractAddress} /> diff --git a/target_chains/ethereum/examples/oracle_swap/app/src/OrderEntry.tsx b/target_chains/ethereum/examples/oracle_swap/app/src/OrderEntry.tsx index d5a71a6b8..0082e8c98 100644 --- a/target_chains/ethereum/examples/oracle_swap/app/src/OrderEntry.tsx +++ b/target_chains/ethereum/examples/oracle_swap/app/src/OrderEntry.tsx @@ -19,7 +19,7 @@ export function OrderEntry(props: { approxPrice: number | undefined; baseToken: TokenConfig; quoteToken: TokenConfig; - priceServiceUrl: string; + hermesUrl: string; pythContractAddress: string; swapContractAddress: string; }) { @@ -156,7 +156,7 @@ export function OrderEntry(props: { onClick={async () => { await sendSwapTx( props.web3!, - props.priceServiceUrl, + props.hermesUrl, props.baseToken.pythPriceFeedId, props.quoteToken.pythPriceFeedId, props.pythContractAddress, @@ -180,7 +180,7 @@ export function OrderEntry(props: { async function sendSwapTx( web3: Web3, - priceServiceUrl: string, + hermesUrl: string, baseTokenPriceFeedId: string, quoteTokenPriceFeedId: string, pythContractAddress: string, @@ -189,7 +189,7 @@ async function sendSwapTx( qtyWei: BigNumber, isBuy: boolean ) { - const pythPriceService = new EvmPriceServiceConnection(priceServiceUrl); + const pythPriceService = new EvmPriceServiceConnection(hermesUrl); const priceFeedUpdateData = await pythPriceService.getPriceFeedsUpdateData([ baseTokenPriceFeedId, quoteTokenPriceFeedId, diff --git a/target_chains/ethereum/sdk/js/README.md b/target_chains/ethereum/sdk/js/README.md index 07ab1793e..34540b95c 100644 --- a/target_chains/ethereum/sdk/js/README.md +++ b/target_chains/ethereum/sdk/js/README.md @@ -20,14 +20,14 @@ $ yarn add @pythnetwork/pyth-evm-js Pyth stores prices off-chain to minimize gas fees, which allows us to offer a wider selection of products and faster update times. See [On-Demand Updates](https://docs.pyth.network/documentation/pythnet-price-feeds/on-demand) for more information about this approach. In order to use Pyth prices on chain, -they must be fetched from an off-chain price service. The `EvmPriceServiceConnection` class can be used to interact with these services, +they must be fetched from an off-chain Hermes instance. The `EvmPriceServiceConnection` class can be used to interact with these services, providing a way to fetch these prices directly in your code. The following example wraps an existing RPC provider and shows how to obtain Pyth prices and submit them to the network: ```typescript const connection = new EvmPriceServiceConnection( - "https://xc-testnet.pyth.network" -); // See Price Service endpoints section below for other endpoints + "https://hermes-beta.pyth.network" +); // See Hermes endpoints section below for other endpoints const priceIds = [ // You can find the ids of prices at https://pyth.network/developers/price-feed-ids#pyth-evm-testnet @@ -133,7 +133,7 @@ There are two examples in [examples](./src/examples/). [This example](./src/examples/EvmPriceServiceClient.ts) fetches `PriceFeed` updates using both a HTTP-request API and a streaming websocket API. You can run it with `npm run example-client`. A full command that prints BTC and ETH price feeds, in the testnet network, looks like so: ```bash -npm run example-client -- --endpoint https://xc-testnet.pyth.network --price-ids 0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b 0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6 +npm run example-client -- --endpoint https://hermes-beta.pyth.network --price-ids 0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b 0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6 ``` #### EvmRelay @@ -151,17 +151,12 @@ npm run example-relay -- \ --network "https://data-seed-prebsc-1-s1.binance.org:8545" \ --pyth-contract "0xd7308b14BF4008e7C7196eC35610B1427C5702EA"\ --mnemonic "my good mnemonic" \ - --endpoint https://xc-testnet.pyth.network \ + --endpoint https://hermes-beta.pyth.network \ --price-ids \ "0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b" \ "0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6" ``` -## Price Service endpoints +## Hermes endpoints -Public endpoints for the Price Service are provided for both mainnet and testnet. These can be used regardless of which network you deploy your own contracts to as long as it is a Pyth supported network. For example, you can use the testnet Price Service whether you are deploying your contract to the BNB or Polygon testnet. - -| network | url | -| ------- | ------------------------------- | -| mainnet | https://xc-mainnet.pyth.network | -| testnet | https://xc-testnet.pyth.network | +You can find the list of Hermes public endpoints [here](https://docs.pyth.network/documentation/pythnet-price-feeds/hermes#public-endpoints). diff --git a/target_chains/ethereum/sdk/js/package.json b/target_chains/ethereum/sdk/js/package.json index 40db2b374..50da290b3 100644 --- a/target_chains/ethereum/sdk/js/package.json +++ b/target_chains/ethereum/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-evm-js", - "version": "1.29.1", + "version": "1.29.2", "description": "Pyth Network EVM Utils in JS", "homepage": "https://pyth.network", "author": { diff --git a/target_chains/sui/sdk/js/README.md b/target_chains/sui/sdk/js/README.md index 21f8966e6..ae4dc4940 100644 --- a/target_chains/sui/sdk/js/README.md +++ b/target_chains/sui/sdk/js/README.md @@ -21,14 +21,14 @@ $ yarn add @pythnetwork/pyth-sui-js Pyth stores prices off-chain to minimize gas fees, which allows us to offer a wider selection of products and faster update times. See [On-Demand Updates](https://docs.pyth.network/documentation/pythnet-price-feeds/on-demand) for more information about this approach. Typically, to use Pyth prices on chain, -they must be fetched from an off-chain price service. The `SuiPriceServiceConnection` class can be used to interact with these services, +they must be fetched from an off-chain Hermes instance. The `SuiPriceServiceConnection` class can be used to interact with these services, providing a way to fetch these prices directly in your code. The following example wraps an existing RPC provider and shows how to obtain Pyth prices and submit them to the network: ```typescript const connection = new SuiPriceServiceConnection( "https://hermes-beta.pyth.network" -); // See Price Service endpoints section below for other endpoints +); // See Hermes endpoints section below for other endpoints const priceIds = [ // You can find the ids of prices at https://pyth.network/developers/price-feed-ids#sui-testnet @@ -99,7 +99,7 @@ Now in your contract you can consume the price by calling `pyth::get_price` or o [This example](./src/examples/SuiRelay.ts) shows how to update prices on an Sui network. It does the following: -1. Fetches update data from the Price Service for the given price feeds. +1. Fetches update data from Hermes for the given price feeds. 2. Calls the Pyth Sui contract with the update data. You can run this example with `npm run example-relay`. A full command that updates prices on Sui testnet looks like: @@ -148,4 +148,6 @@ setTimeout(() => { }, 60000); ``` -## [Price Service endpoints](https://docs.pyth.network/documentation/pythnet-price-feeds/price-service#public-endpoints) +## Hermes endpoints + +You can find the list of Hermes public endpoints [here](https://docs.pyth.network/documentation/pythnet-price-feeds/hermes#public-endpoints). diff --git a/target_chains/sui/sdk/js/package.json b/target_chains/sui/sdk/js/package.json index 63971a9ee..7ea58a846 100644 --- a/target_chains/sui/sdk/js/package.json +++ b/target_chains/sui/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-sui-js", - "version": "1.2.3", + "version": "1.2.4", "description": "Pyth Network Sui Utilities", "homepage": "https://pyth.network", "author": {