getUpdateFee
Get the fee required to update the on-chain price feeds with the provided updateData
.
Description
This method returns the fee required to update the on-chain price feeds for the given updateData
.
The fee returned is in wei.
The caller should send the returned fee amount as the transaction value when calling updatePriceFeeds.
The updateData
can be retrieved from the Hermes API.
Arguments
The price updates that you would like to submit to updatePriceFeeds. Fetch this data from Hermes API.
Examples
import "@pythnetwork/pyth-sdk-solidity/IPyth.sol";import "@pythnetwork/pyth-sdk-solidity/PythStructs.sol";// address contractAddress = IPyth pyth = IPyth(contractAddress);bytes[] memory updateData = new bytes[](1);updateData[0] = /* <updateData> */;uint feeAmount = pyth.getUpdateFee(updateData);