API Reference

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

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);