This repository was archived by the owner on Apr 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ const priceIds = [
38
38
// In order to use Pyth prices in your protocol you need to submit the price update data to Pyth contract in your target
39
39
// chain. `getPriceUpdateData` creates the update data which can be submitted to your contract. Then your contract should
40
40
// call the Pyth Contract with this data.
41
- const priceUpdateData = await connection .getPriceUpdateData (priceIds );
41
+ const priceUpdateData = await connection .getPriceFeedsUpdateData (priceIds );
42
42
43
43
// Create a transaction and submit to your contract using the price update data
44
44
const client = new AptosClient (endpoint );
@@ -64,9 +64,9 @@ module example::your_module {
64
64
use aptos_framework::coin;
65
65
66
66
public fun do_something(user: &signer, pyth_update_data: vector<vector<u8>>) {
67
-
68
67
// 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
+
70
70
pyth::update_price_feeds(pyth_update_data, coins);
71
71
72
72
// Now we can use the prices which we have just updated
You can’t perform that action at this time.
0 commit comments