Skip to content

Commit 0e2434d

Browse files
committed
feat: add docs for requestPriceUpdatesWithCallback and executeCallback functions to IPulse interface
1 parent facc520 commit 0e2434d

File tree

1 file changed

+18
-0
lines changed
  • target_chains/ethereum/contracts/contracts/pulse

1 file changed

+18
-0
lines changed

target_chains/ethereum/contracts/contracts/pulse/IPulse.sol

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,30 @@ interface IPulseConsumer {
1616

1717
interface IPulse is PulseEvents {
1818
// Core functions
19+
/**
20+
* @notice Requests price updates with a callback
21+
* @dev The msg.value must cover both the Pyth fee and gas costs
22+
* Note: The actual gas required for execution will be 1.5x the callbackGasLimit
23+
* to account for cross-contract call overhead + some gas for some other operations in the function before the callback
24+
* @param publishTime The minimum publish time for price updates
25+
* @param priceIds The price feed IDs to update
26+
* @param callbackGasLimit Gas limit for the callback execution
27+
* @return sequenceNumber The sequence number assigned to this request
28+
*/
1929
function requestPriceUpdatesWithCallback(
2030
uint256 publishTime,
2131
bytes32[] calldata priceIds,
2232
uint256 callbackGasLimit
2333
) external payable returns (uint64 sequenceNumber);
2434

35+
/**
36+
* @notice Executes the callback for a price update request
37+
* @dev Requires 1.5x the callback gas limit to account for cross-contract call overhead
38+
* For example, if callbackGasLimit is 1M, the transaction needs at least 1.5M gas + some gas for some other operations in the function before the callback
39+
* @param sequenceNumber The sequence number of the request
40+
* @param updateData The raw price update data from Pyth
41+
* @param priceIds The price feed IDs to update, must match the request
42+
*/
2543
function executeCallback(
2644
uint64 sequenceNumber,
2745
bytes[] calldata updateData,

0 commit comments

Comments
 (0)