API ReferencePricing and oraclesFunction
getOraclePriceUpdate()
function getOraclePriceUpdate(ctx, params): Promise<OraclePriceUpdate>;Gets the Pyth Oracle Price update necessary to send to the LetterOfCredit contract to execute any function call that depends on accurate prices. This includes the fee that Pyth charges to process the price update on-chain. This fee must be passed along in the value of any transaction including this price update.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | SDKContext | The SDK context. |
params | GetOraclePriceUpdateParams | The parameters indicating the tokens for the update. |
Returns
Promise<OraclePriceUpdate>
The oracle price update.
Throws
StalePythPriceError If Hermes returns a price outside
oracleConfig.maxPriceAgeSeconds.