|
|
@@ -18,32 +18,38 @@ export const parsePriceFeedUpdatesUnique = writeApi<
|
|
|
summary:
|
|
|
"Parse `updateData` to return the **first updated** prices if the prices are published within the given time range.",
|
|
|
description: `
|
|
|
-Parse \`updateData\` and return the price feeds for the given \`priceIds\`
|
|
|
-within, if they are all **the first updates** published between
|
|
|
-\`minPublishTime\` and \`maxPublishTime\`. That is to say, if \`prevPublishTime
|
|
|
-< minPublishTime <= publishTime <= maxPublishTime\` where \`prevPublishTime\` is
|
|
|
-the publish time of the previous update for the given price feed. These updates
|
|
|
-are unique per \`priceId\` and \`minPublishTime\`. This will guarantee no
|
|
|
-updates exist for the given \`priceIds\` earlier than the returned updates and
|
|
|
-still in the given time range. If you do not need the uniqueness guarantee,
|
|
|
-consider using [parsePriceFeedUpdates](parse-price-feed-updates) instead. Use
|
|
|
-this function if you want to use a Pyth price for a fixed time and not the most
|
|
|
-recent price; otherwise, consider using [updatePriceFeeds](update-price-feeds)
|
|
|
-followed by [getPrice](get-price) or one of its variants. Unlike
|
|
|
-\`updatePriceFeeds\`, calling this function will not update the on-chain price.
|
|
|
+ This method parse \`updateData\` and return the price feeds for the given \`priceIds\`
|
|
|
+ within, if they are all **the first updates** published between \`minPublishTime\` and
|
|
|
+ \`maxPublishTime\`
|
|
|
+
|
|
|
+ That is to say, if \`prevPublishTime
|
|
|
+ < minPublishTime <= publishTime <= maxPublishTime\` where \`prevPublishTime\` is
|
|
|
+ the publish time of the previous update for the given price feed.
|
|
|
|
|
|
-This method requires the caller to pay a fee in wei; the required fee can be
|
|
|
-computed by calling [getUpdateFee](get-update-fee) with \`updateData\`.
|
|
|
+ These updates are unique per \`priceId\` and \`minPublishTime\`. This will guarantee no
|
|
|
+ updates exist for the given \`priceIds\` earlier than the returned updates and
|
|
|
+ still in the given time range. If you do not need the uniqueness guarantee,
|
|
|
+ consider using [parsePriceFeedUpdates](parse-price-feed-updates) instead.
|
|
|
|
|
|
-Reverts if the transferred fee is not sufficient, or \`updateData\` is invalid,
|
|
|
-or \`updateData\` does not contain an update for any of the given \`priceIds\`
|
|
|
-within the given time range.
|
|
|
+ Use this function if you want to use a Pyth price for a fixed time and not the most
|
|
|
+ recent price; otherwise, consider using [updatePriceFeeds](update-price-feeds)
|
|
|
+ followed by [getPrice](get-price) or one of its variants.
|
|
|
+
|
|
|
+ Unlike [updatePriceFeeds](updatePriceFeeds), calling this function will **not** update the on-chain price.
|
|
|
+
|
|
|
+ This method requires the caller to pay a fee in wei; the required fee can be
|
|
|
+ computed by calling [getUpdateFee](get-update-fee) with \`updateData\`.
|
|
|
+
|
|
|
+ The above method can return the following error response:
|
|
|
+ - \`PriceFeedNotFoundWithinRange\`: No price feed was found within the given time range.
|
|
|
+ - \`InvalidUpdateData\`: The provided update data is invalid or incorrectly signed.
|
|
|
+ - \`InsufficientFee\`: The fee provided is less than the required fee. Try calling [getUpdateFee](getUpdateFee) to get the required fee.
|
|
|
`,
|
|
|
parameters: [
|
|
|
{
|
|
|
name: "updateData",
|
|
|
type: ParameterType.HexArray,
|
|
|
- description: "The price update data to parse.",
|
|
|
+ description: "The price update data for the contract to verify. Fetch this data from [Hermes API](https://hermes.pyth.network/docs/#/rest/latest_price_updates).",
|
|
|
},
|
|
|
{
|
|
|
name: "priceId",
|