Skip to content
This repository was archived by the owner on Apr 3, 2023. It is now read-only.

Commit 1df1e32

Browse files
authored
Fix wrong method name in README example (#77)
* Fix wrong method name in README example The method `getPriceData` does not exist on `EvmPriceServiceConnection`, I assume the example should use the method `getPriceFeedsData` instead: https://github.com/pyth-network/pyth-js/blob/eadb2c5386ada06eb99b5b56cd7805d7fed713d9/pyth-evm-js/src/EvmPriceServiceConnection.ts#L12 * Fix wrong method name in comment * Fix wrong variable name in example
1 parent 2e0ed09 commit 1df1e32

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pyth-evm-js/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ const priceIds = [
3636
];
3737

3838
// In order to use Pyth prices in your protocol you need to submit the price update data to Pyth contract in your target
39-
// chain. `getPriceUpdateData` creates the update data which can be submitted to your contract. Then your contract should
39+
// chain. `getPriceFeedsUpdateData` creates the update data which can be submitted to your contract. Then your contract should
4040
// call the Pyth Contract with this data.
41-
const priceUpdateData = await connection.getPriceUpdateData(priceIds);
41+
const priceUpdateData = await connection.getPriceFeedsUpdateData(priceIds);
4242

4343
// If the user is paying the price update fee, you need to fetch it from the Pyth contract.
4444
// Please refer to https://docs.pyth.network/consume-data/on-demand#fees for more information.
4545
//
4646
// `pythContract` below is a web3.js contract; if you wish to use ethers, you need to change it accordingly.
4747
// You can find the Pyth interface ABI in @pythnetwork/pyth-sdk-solidity npm package.
4848
const updateFee = await pythContract.methods
49-
.getUpdateFee(priceFeedUpdateData)
49+
.getUpdateFee(priceUpdateData)
5050
.call();
5151
// Calling someContract method
5252
// `someContract` below is a web3.js contract; if you wish to use ethers, you need to change it accordingly.

0 commit comments

Comments
 (0)