소스 검색

(fix) Add notes for deprecated apis (#1821)

Aditya Arora 1 년 전
부모
커밋
9bdcfc5199

+ 6 - 3
apps/api-reference/src/apis/evm/get-ema-price.ts

@@ -2,9 +2,12 @@ import { readApi, solidity, ethersJS } from "./common";
 import { ParameterType } from "../../components/EvmApi";
 
 export const getEmaPrice = readApi<"id">({
-  name: "getEmaPrice",
-  summary:
-    "Get the **latest** exponentially weighted moving average (EMA) price object for the requested price feed ID.",
+  name: "getEmaPrice (deprecated)",
+  summary: `
+  Get the **latest** exponentially weighted moving average (EMA) price object for the requested price feed ID.
+
+  **Note**: We recommend using [\`getEmaPriceNoOlderThan()\`](getEmaPriceNoOlderThan) instead of this endpoint
+  as it gives more flexibility to specify the maximum age of the price.`,
   description: `
   This method returns the latest price object containing **exponentially-weighted moving average** price for the requested price feed ID.
   The \`price\` object contains the following fields:

+ 6 - 1
apps/api-reference/src/apis/evm/get-price.ts

@@ -3,7 +3,12 @@ import { ParameterType } from "../../components/EvmApi";
 
 export const getPrice = readApi<"id">({
   name: "getPrice (deprecated)",
-  summary: "Get the **latest** price object for the requested price feed ID.",
+  summary: `
+Get the **latest** price object for the requested price feed ID.
+
+**Note**: We recommend using [\`getPriceNoOlderThan()\`](getPriceNoOlderThan) instead of this endpoint
+as it gives more flexibility to specify the maximum age of the price.
+`,
   description: `
 This method returns the latest price object for the requested price feed ID.
 

+ 6 - 1
apps/api-reference/src/apis/evm/get-valid-time-period.ts

@@ -2,13 +2,18 @@ import { readApi, solidity, ethersJS } from "./common";
 
 export const getValidTimePeriod = readApi<never>({
   name: "getValidTimePeriod (deprecated)",
-  summary: "Get the default valid time period of price freshness in seconds.",
+  summary: `
+  Get the default valid time period of price freshness in seconds.
+  `,
   description: `
   This method returns the default valid time period of price freshness in **seconds**.
   This quantity is the maximum age of price updates returned by functions like [getPrice](getPrice) and
   [getEmaPrice](getEmaPrice); these functions revert if the current on-chain price
   is older than this period.
 
+  **NOTE**: We recommend using [\`getPriceNoOlderThan()\`](getPriceNoOlderThan) or [\`getEmaPriceNoOlderThan()\`](getEmaPriceNoOlderThan) instead of [getPrice](getPrice) and
+  [getEmaPrice](getEmaPrice).
+
 The valid time period is configured to be a same default for each blockchain.
   `,
   parameters: [],