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";
// Ethereum
address contractAddress = 0x4305FB66699C3B2702D4d05CF36551390A4c69C6
IPyth pyth = IPyth(contractAddress);
bytes[] memory updateData = new bytes[](1);
updateData[0] = /* <updateData> */;
uint feeAmount = pyth.getUpdateFee(updateData);