diff --git a/target_chains/ethereum/sdk/js/.eslintrc.js b/target_chains/ethereum/sdk/js/.eslintrc.js deleted file mode 100644 index bb71486c02..0000000000 --- a/target_chains/ethereum/sdk/js/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - root: true, - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint"], - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], - rules: { - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/ban-ts-comment": "off", - }, -}; diff --git a/target_chains/ethereum/sdk/js/.gitignore b/target_chains/ethereum/sdk/js/.gitignore deleted file mode 100644 index 86cfbb24c7..0000000000 --- a/target_chains/ethereum/sdk/js/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -lib -.dccache -*mnemonic* diff --git a/target_chains/ethereum/sdk/js/README.md b/target_chains/ethereum/sdk/js/README.md deleted file mode 100644 index 8f0c2747f8..0000000000 --- a/target_chains/ethereum/sdk/js/README.md +++ /dev/null @@ -1,174 +0,0 @@ -# Pyth EVM JS - -[Pyth](https://pyth.network/) provides real-time pricing data in a variety of asset classes, including cryptocurrency, -equities, FX and commodities. This library allows you to use these real-time prices on EVM-based networks. - -## Installation - -### npm - -``` -$ npm install --save @pythnetwork/pyth-evm-js -``` - -### Yarn - -``` -$ yarn add @pythnetwork/pyth-evm-js -``` - -## Quickstart - -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 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://hermes.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-stable - "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43", // BTC/USD price id - "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", // ETH/USD price id -]; - -// In order to use Pyth prices in your protocol you need to submit the price update data to Pyth contract in your target -// chain. `getPriceFeedsUpdateData` creates the update data which can be submitted to your contract. Then your contract should -// call the Pyth Contract with this data. -const priceUpdateData = await connection.getPriceFeedsUpdateData(priceIds); - -// If the user is paying the price update fee, you need to fetch it from the Pyth contract. -// Please refer to https://docs.pyth.network/documentation/pythnet-price-feeds/on-demand#fees for more information. -// -// `pythContract` below is a web3.js contract; if you wish to use ethers, you need to change it accordingly. -// You can find the Pyth interface ABI in @pythnetwork/pyth-sdk-solidity npm package. -const updateFee = await pythContract.methods - .getUpdateFee(priceUpdateData) - .call(); - -// Calling someContract method -// `someContract` below is a web3.js contract; if you wish to use ethers, you need to change it accordingly. -// Note: In Hedera you need to pass updateFee * 10^10 as value to the send method as there is an -// inconsistency in the way the value is handled in Hedera RPC and the way it is handled on-chain. -await someContract.methods - .doSomething(someArg, otherArg, priceUpdateData) - .send({ value: updateFee }); -``` - -`SomeContract` looks like so: - -```solidity -pragma solidity ^0.8.0; - -import "@pythnetwork/pyth-sdk-solidity/IPyth.sol"; -import "@pythnetwork/pyth-sdk-solidity/PythStructs.sol"; - -contract SomeContract { - IPyth pyth; - - constructor(address pythContract) { - pyth = IPyth(pythContract); - } - - function doSomething( - uint someArg, - string memory otherArg, - bytes[] calldata priceUpdateData - ) public payable { - // Update the prices to be set to the latest values - uint fee = pyth.getUpdateFee(priceUpdateData); - pyth.updatePriceFeeds{ value: fee }(priceUpdateData); - - // Doing other things that uses prices - bytes32 priceId = 0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b; - // Get the price if it is not older than 10 seconds from the current time. - PythStructs.Price price = pyth.getPriceNoOlderThan(priceId, 10); - } -} - -``` - -We strongly recommend reading our guide which explains [how to work with Pyth price feeds](https://docs.pyth.network/documentation/pythnet-price-feeds/best-practices). - -### Off-chain prices - -Many applications additionally need to display Pyth prices off-chain, for example, in their frontend application. -The `EvmPriceServiceConnection` provides two different ways to fetch the current Pyth price. -The code blocks below assume that the `connection` and `priceIds` objects have been initialized as shown above. -The first method is a single-shot query: - -```typescript -// `getLatestPriceFeeds` returns a `PriceFeed` for each price id. It contains all information about a price and has -// utility functions to get the current and exponentially-weighted moving average price, and other functionality. -const priceFeeds = await connection.getLatestPriceFeeds(priceIds); -// Get the price if it is not older than 60 seconds from the current time. -console.log(priceFeeds[0].getPriceNoOlderThan(60)); // Price { conf: '1234', expo: -8, price: '12345678' } -// Get the exponentially-weighted moving average price if it is not older than 60 seconds from the current time. -console.log(priceFeeds[1].getEmaPriceNoOlderThan(60)); -``` - -The object also supports a streaming websocket connection that allows you to subscribe to every new price update for a given feed. -This method is useful if you want to show continuously updating real-time prices in your frontend: - -```typescript -// Subscribe to the price feeds given by `priceId`. The callback will be invoked every time the requested feed -// gets a price update. -connection.subscribePriceFeedUpdates(priceIds, (priceFeed) => { - console.log( - `Received update for ${priceFeed.id}: ${priceFeed.getPriceNoOlderThan(60)}` - ); -}); - -// When using the subscription, make sure to close the websocket upon termination to finish the process gracefully. -setTimeout(() => { - connection.closeWebSocket(); -}, 60000); -``` - -### Examples - -There are two examples in [examples](./src/examples/). - -#### EvmPriceServiceClient - -[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://hermes.pyth.network \ - --price-ids \ - 0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43 \ - 0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace -``` - -#### EvmRelay - -[This example](./src/examples/EvmRelay.ts) shows how to update prices on an EVM network. It does the following: - -1. Gets update data to update given price feeds. -2. Calls the pyth contract with the update data. -3. Submits it to the network and prints the txhash if successful. - -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 so: - -```bash -npm run example-relay -- \ - --network "https://data-seed-prebsc-1-s1.binance.org:8545" \ - --pyth-contract "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb"\ - --mnemonic "my good mnemonic" \ - --endpoint https://hermes.pyth.network \ - --price-ids \ - "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43" \ - "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace" -``` - -## Hermes endpoints - -Pyth offers a free public endpoint at [https://hermes.pyth.network](https://hermes.pyth.network). However, it is -recommended to obtain a private endpoint from one of the Hermes RPC providers for more reliability. You can find more -information about Hermes RPC providers -[here](https://docs.pyth.network/documentation/pythnet-price-feeds/hermes#public-endpoint). diff --git a/target_chains/ethereum/sdk/js/jest.config.js b/target_chains/ethereum/sdk/js/jest.config.js deleted file mode 100644 index 21a1e973ab..0000000000 --- a/target_chains/ethereum/sdk/js/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ -module.exports = { - preset: "ts-jest", - testEnvironment: "node", -}; diff --git a/target_chains/ethereum/sdk/js/package.json b/target_chains/ethereum/sdk/js/package.json deleted file mode 100644 index 1a1326adbb..0000000000 --- a/target_chains/ethereum/sdk/js/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "@pythnetwork/pyth-evm-js", - "version": "1.83.0", - "description": "Pyth Network EVM Utils in JS", - "homepage": "https://pyth.network", - "author": { - "name": "Pyth Data Association" - }, - "main": "lib/index.js", - "types": "lib/index.d.ts", - "files": [ - "lib/**/*" - ], - "repository": { - "type": "git", - "url": "https://github.com/pyth-network/pyth-crosschain", - "directory": "target_chains/ethereum/sdk/js" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "build": "tsc", - "example-client": "pnpm run build && node lib/examples/EvmPriceServiceClient.js", - "example-relay": "pnpm run build && node lib/examples/EvmRelay.js", - "example-benchmark": "pnpm run build && node lib/examples/EvmBenchmark.js", - "format": "prettier --write \"src/**/*.ts\"", - "test:lint": "eslint src/ --max-warnings 0", - "prepublishOnly": "pnpm run build && pnpm run test:lint", - "preversion": "pnpm run test:lint", - "version": "pnpm run format && git add -A src" - }, - "keywords": [ - "pyth", - "oracle" - ], - "license": "Apache-2.0", - "devDependencies": { - "@pythnetwork/pyth-sdk-solidity": "workspace:*", - "@truffle/hdwallet-provider": "^2.1.5", - "@types/ethereum-protocol": "^1.0.2", - "@types/jest": "^29.4.0", - "@types/node": "^18.11.18", - "@types/web3-provider-engine": "^14.0.1", - "@types/yargs": "^17.0.10", - "@typescript-eslint/eslint-plugin": "^5.21.0", - "@typescript-eslint/parser": "^5.21.0", - "eslint": "^8.14.0", - "jest": "^29.4.1", - "prettier": "^2.6.2", - "ts-jest": "^29.0.5", - "typescript": "^4.6.3", - "web3": "^1.8.2", - "yargs": "^17.4.1" - }, - "dependencies": { - "@pythnetwork/price-service-client": "workspace:*", - "buffer": "^6.0.3" - } -} diff --git a/target_chains/ethereum/sdk/js/src/EvmPriceServiceConnection.ts b/target_chains/ethereum/sdk/js/src/EvmPriceServiceConnection.ts deleted file mode 100644 index 3272c86a67..0000000000 --- a/target_chains/ethereum/sdk/js/src/EvmPriceServiceConnection.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { - PriceServiceConnection, - HexString, -} from "@pythnetwork/price-service-client"; -import { Buffer } from "buffer"; - -export class EvmPriceServiceConnection extends PriceServiceConnection { - /** - * Gets price update data which then can be submitted to Pyth contract to update the prices. - * This will throw an axios error if there is a network problem or the price service returns a non-ok response (e.g: Invalid price ids) - * - * @param priceIds Array of hex-encoded price ids. - * @returns Array of price update data. - */ - async getPriceFeedsUpdateData(priceIds: HexString[]): Promise { - const latestVaas = await this.getLatestVaas(priceIds); - return latestVaas.map( - (vaa) => "0x" + Buffer.from(vaa, "base64").toString("hex") - ); - } -} diff --git a/target_chains/ethereum/sdk/js/src/examples/EvmBenchmark.ts b/target_chains/ethereum/sdk/js/src/examples/EvmBenchmark.ts deleted file mode 100644 index 6fcde0434b..0000000000 --- a/target_chains/ethereum/sdk/js/src/examples/EvmBenchmark.ts +++ /dev/null @@ -1,117 +0,0 @@ -import Web3 from "web3"; -import yargs from "yargs"; -import { hideBin } from "yargs/helpers"; - -import { EvmPriceServiceConnection } from "../index"; -import HDWalletProvider from "@truffle/hdwallet-provider"; -import PythInterfaceAbi from "@pythnetwork/pyth-sdk-solidity/abis/IPyth.json"; - -const argv = yargs(hideBin(process.argv)) - .option("network", { - description: "RPC of the network to relay on.", - type: "string", - required: true, - }) - .option("endpoint", { - description: - "Endpoint URL for the price service. e.g: https://endpoint/example", - type: "string", - required: true, - }) - .option("pyth-contract", { - description: "Pyth contract address.", - type: "string", - required: true, - }) - .option("price-id", { - description: - "Price feed id (in hex) to fetch" + " e.g: 0xf9c0172ba10dfa4d19088d...", - type: "string", - required: true, - }) - .option("timestamp", { - description: "Timestamp of the prices to fetch" + " e.g., 2022-", // TODO - type: "string", - required: true, - }) - .option("mnemonic", { - description: "Mnemonic (private key) for sender", - type: "string", - required: true, - }) - .help() - .alias("help", "h") - .parserConfiguration({ - "parse-numbers": false, - }) - .parseSync(); - -const network = argv.network; -const pythContractAddr = argv.pythContract; - -const connection = new EvmPriceServiceConnection(argv.endpoint); - -async function run() { - const provider = new HDWalletProvider({ - mnemonic: { - phrase: argv.mnemonic, - }, - providerOrUrl: network, - }); - - // @ts-ignore - const web3 = new Web3(provider); - const priceId = argv.priceId as string; - // The unix timestamp in seconds - const unixTimestamp = Date.parse(argv.timestamp) / 1000; - - console.log(`Querying unix timestamp: ${unixTimestamp}`); - - const [priceFeedUpdateVaa, updateTimestamp] = await connection.getVaa( - priceId, - unixTimestamp - ); - console.log(`Next pyth update was at: ${updateTimestamp}`); - console.log(priceFeedUpdateVaa); - - const priceFeedUpdate = - "0x" + Buffer.from(priceFeedUpdateVaa, "base64").toString("hex"); - - const pythContract = new web3.eth.Contract( - PythInterfaceAbi as any, - pythContractAddr, - { - from: provider.getAddress(0), - } - ); - - const updateFee = await pythContract.methods - .getUpdateFee([priceFeedUpdate]) - .call(); - console.log(`Update fee: ${updateFee}`); - - // In real use cases, you would pass the update to your contract, then call parsePriceFeedUpdates within your contract. - // When invoked on-chain, this function will return a PriceFeed struct containing the data in the price update - // (such as the current price). - await pythContract.methods - .parsePriceFeedUpdates( - [priceFeedUpdate], - [priceId], - // parsePriceFeedUpdates will reject any price update outside of the time window provided in the following - // two arguments. Integrators can use this to specify the timestamp of the update they are expecting. - unixTimestamp, - unixTimestamp + 5 - ) - .send({ value: updateFee }) - .on("transactionHash", (hash: string) => { - console.log(`Tx hash: ${hash}`); - }) - .on("error", (err: any, receipt: any) => { - console.error(receipt); - throw err; - }); - - provider.engine.stop(); -} - -run(); diff --git a/target_chains/ethereum/sdk/js/src/examples/EvmPriceServiceClient.ts b/target_chains/ethereum/sdk/js/src/examples/EvmPriceServiceClient.ts deleted file mode 100644 index 9e7d2be05a..0000000000 --- a/target_chains/ethereum/sdk/js/src/examples/EvmPriceServiceClient.ts +++ /dev/null @@ -1,64 +0,0 @@ -import yargs from "yargs"; -import { hideBin } from "yargs/helpers"; - -import { EvmPriceServiceConnection } from "../index"; - -function sleep(ms: number) { - return new Promise((resolve) => setTimeout(resolve, ms)); -} - -const argv = yargs(hideBin(process.argv)) - .option("endpoint", { - description: - "Endpoint URL for the Price Service. e.g: https://endpoint/example", - type: "string", - required: true, - }) - .option("price-ids", { - description: - "Space separated price feed ids (in hex) to fetch" + - " e.g: 0xf9c0172ba10dfa4d19088d...", - type: "array", - required: true, - }) - .help() - .alias("help", "h") - .parserConfiguration({ - "parse-numbers": false, - }) - .parseSync(); - -async function run() { - const connection = new EvmPriceServiceConnection(argv.endpoint, { - logger: console, // Providing logger will allow the connection to log its events. - }); - - const priceIds = argv.priceIds as string[]; - console.log(priceIds); - const priceFeeds = await connection.getLatestPriceFeeds(priceIds); - console.log(priceFeeds); - console.log(priceFeeds?.at(0)?.getPriceNoOlderThan(60)); - - const updateData = await connection.getPriceFeedsUpdateData(priceIds); - console.log(updateData); - - console.log("Subscribing to price feed updates."); - - await connection.subscribePriceFeedUpdates(priceIds, (priceFeed) => { - console.log( - `Current price for ${priceFeed.id}: ${JSON.stringify( - priceFeed.getPriceNoOlderThan(60) - )}.` - ); - }); - - await sleep(600000); - - // To close the websocket you should either unsubscribe from all - // price feeds or call `connection.closeWebSocket()` directly. - - console.log("Unsubscribing from price feed updates."); - await connection.unsubscribePriceFeedUpdates(priceIds); -} - -run(); diff --git a/target_chains/ethereum/sdk/js/src/examples/EvmRelay.ts b/target_chains/ethereum/sdk/js/src/examples/EvmRelay.ts deleted file mode 100644 index 1d51cd7f88..0000000000 --- a/target_chains/ethereum/sdk/js/src/examples/EvmRelay.ts +++ /dev/null @@ -1,121 +0,0 @@ -import Web3 from "web3"; -import yargs from "yargs"; -import { hideBin } from "yargs/helpers"; - -import { EvmPriceServiceConnection } from "../index"; -import HDWalletProvider from "@truffle/hdwallet-provider"; -import PythInterfaceAbi from "@pythnetwork/pyth-sdk-solidity/abis/IPyth.json"; - -const argv = yargs(hideBin(process.argv)) - .option("network", { - description: "RPC of the network to relay on.", - type: "string", - required: true, - }) - .option("endpoint", { - description: - "Endpoint URL for the price service. e.g: https://endpoint/example", - type: "string", - required: true, - }) - .option("pyth-contract", { - description: "Pyth contract address.", - type: "string", - required: true, - }) - .option("price-ids", { - description: - "Space separated price feed ids (in hex) to fetch" + - " e.g: 0xf9c0172ba10dfa4d19088d...", - type: "array", - required: true, - }) - .option("mnemonic", { - description: "Mnemonic (private key) for sender", - type: "string", - required: true, - }) - .help() - .alias("help", "h") - .parserConfiguration({ - "parse-numbers": false, - }) - .parseSync(); - -const network = argv.network; -const pythContractAddr = argv.pythContract; - -const connection = new EvmPriceServiceConnection(argv.endpoint); - -async function run() { - const provider = new HDWalletProvider({ - mnemonic: { - phrase: argv.mnemonic, - }, - providerOrUrl: network, - }); - - // @ts-ignore - const web3 = new Web3(provider); - const priceIds = argv.priceIds as string[]; - - const priceFeeds = await connection.getLatestPriceFeeds(priceIds); - console.log(priceFeeds); - - const priceFeedUpdateData = await connection.getPriceFeedsUpdateData( - priceIds - ); - console.log(priceFeedUpdateData); - - const pythContract = new web3.eth.Contract( - PythInterfaceAbi as any, - pythContractAddr, - { - from: provider.getAddress(0), - } - ); - - const updateFee = await pythContract.methods - .getUpdateFee(priceFeedUpdateData) - .call(); - console.log(`Update fee: ${updateFee}`); - - let txHash = undefined; - await pythContract.methods - .updatePriceFeeds(priceFeedUpdateData) - .send({ value: updateFee }) - .on("transactionHash", (hash: string) => { - txHash = hash; - }) - .on("error", (err: any, receipt: any) => { - console.error(receipt); - throw err; - }); - - console.log(`Tx hash: ${txHash}`); - if (txHash === undefined) { - console.error("Something went wrong. Could not send price update tx."); - } else { - console.log("Awaiting tx confirmation..."); - let receipt = undefined; - while (!receipt) { - receipt = await web3.eth.getTransactionReceipt(txHash); - } - - // For on-chain use, you will typically perform the getPriceNoOlderThan call within the same transaction as updatePriceFeeds. - // The call to getPriceNoOlderThan below simply demonstrates that the on-chain price was in fact updated. - // Note that the code above for waiting for tx confirmation is a little flaky -- if so, you may see an old price printed here. - for (const priceId of priceIds) { - const [price, conf, expo, publishTime] = await pythContract.methods - .getPriceNoOlderThan(priceId, 60) // 60 seconds staleness tolerance - .call(); - console.log( - `Updated ${priceId} to (${price} +- ${conf}) * 10^${expo} at unix timestamp ${publishTime}` - ); - } - } - - provider.engine.stop(); -} - -run(); diff --git a/target_chains/ethereum/sdk/js/src/index.ts b/target_chains/ethereum/sdk/js/src/index.ts deleted file mode 100644 index 2d2c097228..0000000000 --- a/target_chains/ethereum/sdk/js/src/index.ts +++ /dev/null @@ -1,175 +0,0 @@ -export { EvmPriceServiceConnection } from "./EvmPriceServiceConnection"; - -export { - DurationInMs, - HexString, - Price, - PriceFeed, - PriceServiceConnectionConfig, - UnixTimestamp, -} from "@pythnetwork/price-service-client"; - -export const CONTRACT_ADDR: Record = { - // Mainnets - apechain_mainnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - arbitrum: "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C", - astar_zkevm: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - aurora: "0xF89C7b475821EC3fDC2dC8099032c05c6c0c9AB9", - avalanche: "0x4305FB66699C3B2702D4d05CF36551390A4c69C6", - blast: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - bnb: "0x4D7E825f80bDf85e913E0DD2A2D54927e9dE1594", - base: "0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a", - boba: "0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF", - bttc: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - canto: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603", - celo: "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C", - chiliz: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - conflux_espace: "0xe9d69CdD6Fe41e7B621B4A688C5D1a68cB5c8ADc", - core_dao: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - cronos: "0xE0d0e68297772Dd5a1f1D99897c581E2082dbA5B", - cronos_zkevm_mainnet: "0x056f829183ec806a78c26c98961678c24fab71af", - eos: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - evmos: "0x354bF866A4B006C9AF9d9e06d9364217A8616E12", - ethereum: "0x4305FB66699C3B2702D4d05CF36551390A4c69C6", - etherlink: "0x2880aB155794e7179c9eE2e38200202908C17B43", - eventum_mainnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - fantom: "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C", - fantom_sonic_mainnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - filecoin: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - flow_mainnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - gnosis: "0x2880aB155794e7179c9eE2e38200202908C17B43", - gravity: "0x2880aB155794e7179c9eE2e38200202908C17B43", - hedera: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - hemi_mainnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - horizen_eon: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - idex_xchain_mainnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - injective_inevm: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - iota: "0x8D254a21b3C86D32F7179855531CE99164721933", - kava: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - kcc: "0xE0d0e68297772Dd5a1f1D99897c581E2082dbA5B", - kaia: "0x2880aB155794e7179c9eE2e38200202908C17B43", - lightlink: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - linea: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - manta: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - mantle: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - merlin: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - meter: "0xbFe3f445653f2136b2FD1e6DdDb5676392E3AF16", - mode: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - morph: "0x2880aB155794e7179c9eE2e38200202908C17B43", - neon: "0x7f2dB085eFC3560AFF33865dD727225d91B4f9A5", - opbnb: "0x2880aB155794e7179c9eE2e38200202908C17B43", - optimism: "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C", - parallel: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - polygon: "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C", - polygon_zkevm: "0xC5E56d6b40F3e3B5fbfa266bCd35C37426537c65", - polynomial: "0x2880aB155794e7179c9eE2e38200202908C17B43", - ronin: "0x2880aB155794e7179c9eE2e38200202908C17B43", - scroll: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - sei_evm_mainnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - shimmer: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - skate: "0x2880aB155794e7179c9eE2e38200202908C17B43", - superseed_mainnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - viction: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - wemix: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - zetachain: "0x2880aB155794e7179c9eE2e38200202908C17B43", - zkfair: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - zksync_era: "0xf087c864AEccFb6A2Bf1Af6A0382B0d0f6c5D834", - // Testnets (Stable sources) - abstract_testnet: "0x47F2A9BDAd52d65b66287253cf5ca0D2b763b486", - apechain_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - arbitrum_blueberry: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - arbitrum_sepolia: "0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF", - astar_zkevm_testnet: "0x8D254a21b3C86D32F7179855531CE99164721933", - astar_zkyoto_testnet: "0x8D254a21b3C86D32F7179855531CE99164721933", - aurora_testnet: "0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E", - bnb_testnet: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb", - base_sepolia: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - berachain_testnet_v2: "0x2880aB155794e7179c9eE2e38200202908C17B43", - blackbird: "0x2880aB155794e7179c9eE2e38200202908C17B43", - blast_s2_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - boba_goerli: "0x8D254a21b3C86D32F7179855531CE99164721933", - boba_sepolia: "0x8D254a21b3C86D32F7179855531CE99164721933", - bttc_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - cant_testnet: "0x26DD80569a8B23768A1d80869Ed7339e07595E85", - celo_alfajores: "0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E", - chiado: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603", - chiliz_testnet: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509", - conflux_espace_testnet: "0xDd24F84d36BF92C65F92307595335bdFab5Bbd21", - core_dao_testnet: "0x8D254a21b3C86D32F7179855531CE99164721933", - coredao_testnet_v2: "0x2880aB155794e7179c9eE2e38200202908C17B43", - cronos_testnet: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320", - cronos_zkevm_testnet: "0xB1DB1498902F08E16E11F1a423ec9CCB9537E1D6", - dela_deperp_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - dela_mithreum_deperp_testnet: "0xe9d69CdD6Fe41e7B621B4A688C5D1a68cB5c8ADc", - ethena_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - etherlink_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - eos_testnet: "0x0708325268dF9F66270F1401206434524814508b", - eventum_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - evmos_testnet: "0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E", - fantom_sonic_devnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - fantom_sonic_testnet: "0x96124d1F6E44FfDf1fb5D6d74BB2DE1B7Fbe7376", - fantom_testnet: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb", - filecoin_calibration: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - flow_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - fuji: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509", - hedera_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - idex_xchain_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - injective_inevm_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - kakarot_sepolia: "0xe9d69CdD6Fe41e7B621B4A688C5D1a68cB5c8ADc", - kava_testnet: "0xfA25E653b44586dBbe27eE9d252192F0e4956683", - kcc_testnet: "0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E", - kinto: "0x2880aB155794e7179c9eE2e38200202908C17B43", - kaia_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - kraken_ink_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - lightlink_pegasus_testnet: "0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167", - linea_goerli: "0xdF21D137Aadc95588205586636710ca2890538d5", - linea_sepolia: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - manta_testnet: "0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c", - manta_sepolia: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - mantle_sepolia: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603", - merlin_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - meter_testnet: "0x5a71C07a0588074443545eE0c08fb0375564c3E4", - mode_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - monad_devnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - monad_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - morph_holesky_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - morph_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - movement_evm_devnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - movement_evm_devnet_imola: "0x2880aB155794e7179c9eE2e38200202908C17B43", - mumbai: "0xFC6bd9F9f0c6481c6Af3A7Eb46b296A5B85ed379", - neon_devnet: "0x0708325268dF9F66270F1401206434524814508b", - nighthawk: "0x2880aB155794e7179c9eE2e38200202908C17B43", - olive_testnet: "0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c", - opbnb_testnet: "0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c", - optimism_celestia_raspberry: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - optimism_goerli: "0xDd24F84d36BF92C65F92307595335bdFab5Bbd21", - optimism_sepolia: "0x0708325268dF9F66270F1401206434524814508b", - orange_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - parallel_testnet: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509", - polygon_amoy: "0x2880aB155794e7179c9eE2e38200202908C17B43", - polygon_blackberry: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - polygon_zkevm_testnet: "0xFf255f800044225f54Af4510332Aa3D67CC77635", - polynomial_testnet: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509", - reya_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - saigon: "0xEbe57e8045F2F230872523bbff7374986E45C486", - sei_evm_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - scroll_sepolia: "0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c", - sepolia: "0xDd24F84d36BF92C65F92307595335bdFab5Bbd21", - shimmer_testnet: "0x8D254a21b3C86D32F7179855531CE99164721933", - skate_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - soneium_minato_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - story_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - superseed_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - tabi_testnet: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb", - taiko_hekla: "0x2880aB155794e7179c9eE2e38200202908C17B43", - taiko_mainnet: "0x2880aB155794e7179c9eE2e38200202908C17B43", - unichain_sepolia: "0x2880aB155794e7179c9eE2e38200202908C17B43", - viction_testnet: "0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167", - wemix_testnet: "0x26DD80569a8B23768A1d80869Ed7339e07595E85", - zetachain_testnet: "0x0708325268dF9F66270F1401206434524814508b", - zkfair_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", - zksync_era_goerli: "0x8739d5024B5143278E2b15Bd9e7C26f6CEc658F1", - zksync_era_sepolia: "0x056f829183Ec806A78c26C98961678c24faB71af", - // Testnets (Beta sources) - horizen_gobi_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", -}; diff --git a/target_chains/ethereum/sdk/js/tsconfig.json b/target_chains/ethereum/sdk/js/tsconfig.json deleted file mode 100644 index 462f0d5983..0000000000 --- a/target_chains/ethereum/sdk/js/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "target": "esnext", - "module": "commonjs", - "declaration": true, - "rootDir": "src/", - "outDir": "./lib", - "strict": true, - "esModuleInterop": true, - "resolveJsonModule": true - }, - "include": ["src"], - "exclude": ["node_modules", "**/__tests__/*"] -} diff --git a/target_chains/ethereum/sdk/solidity/PythAggregatorV3.sol b/target_chains/ethereum/sdk/solidity/PythAggregatorV3.sol index 1d8ba4509c..9cfbb3ba64 100644 --- a/target_chains/ethereum/sdk/solidity/PythAggregatorV3.sol +++ b/target_chains/ethereum/sdk/solidity/PythAggregatorV3.sol @@ -25,7 +25,7 @@ contract PythAggregatorV3 { // Wrapper function to update the underlying Pyth price feeds. Not part of the AggregatorV3 interface but useful. function updateFeeds(bytes[] calldata priceUpdateData) public payable { // Update the prices to the latest available values and pay the required fee for it. The `priceUpdateData` data - // should be retrieved from our off-chain Price Service API using the `pyth-evm-js` package. + // should be retrieved from our off-chain Price Service API using the `hermes-client` package. // See section "How Pyth Works on EVM Chains" below for more information. uint fee = pyth.getUpdateFee(priceUpdateData); pyth.updatePriceFeeds{value: fee}(priceUpdateData); diff --git a/target_chains/ethereum/sdk/solidity/README.md b/target_chains/ethereum/sdk/solidity/README.md index 1e489261e0..dca750fff7 100644 --- a/target_chains/ethereum/sdk/solidity/README.md +++ b/target_chains/ethereum/sdk/solidity/README.md @@ -57,7 +57,7 @@ contract ExampleContract { bytes[] calldata priceUpdateData ) public payable returns (PythStructs.Price memory) { // Update the prices to the latest available values and pay the required fee for it. The `priceUpdateData` data - // should be retrieved from our off-chain Price Service API using the `pyth-evm-js` package. + // should be retrieved from our off-chain Price Service API using the `hermes-client` package. // See section "How Pyth Works on EVM Chains" below for more information. uint fee = pyth.getUpdateFee(priceUpdateData); pyth.updatePriceFeeds{ value: fee }(priceUpdateData);