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

Commit 9a775a2

Browse files
authored
Merge pull request #61 from pyth-network/abehjati/update-readme-aptos-js
Update Aptos JS README.md
2 parents 77417cb + 44b97cb commit 9a775a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pyth-aptos-js/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const priceIds = [
3838
// In order to use Pyth prices in your protocol you need to submit the price update data to Pyth contract in your target
3939
// chain. `getPriceUpdateData` 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
// Create a transaction and submit to your contract using the price update data
4444
const client = new AptosClient(endpoint);
@@ -64,9 +64,9 @@ module example::your_module {
6464
use aptos_framework::coin;
6565
6666
public fun do_something(user: &signer, pyth_update_data: vector<vector<u8>>) {
67-
6867
// First update the Pyth price feeds. The user pays the fee for the update.
69-
let coins = coin::withdraw(user, pyth::get_update_fee());
68+
let coins = coin::withdraw(user, pyth::get_update_fee(pyth_update_data));
69+
7070
pyth::update_price_feeds(pyth_update_data, coins);
7171
7272
// Now we can use the prices which we have just updated

0 commit comments

Comments
 (0)