Skip to content

Commit 9bdcfc5

Browse files
authored
(fix) Add notes for deprecated apis (#1821)
1 parent 371286d commit 9bdcfc5

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ import { readApi, solidity, ethersJS } from "./common";
22
import { ParameterType } from "../../components/EvmApi";
33

44
export const getEmaPrice = readApi<"id">({
5-
name: "getEmaPrice",
6-
summary:
7-
"Get the **latest** exponentially weighted moving average (EMA) price object for the requested price feed ID.",
5+
name: "getEmaPrice (deprecated)",
6+
summary: `
7+
Get the **latest** exponentially weighted moving average (EMA) price object for the requested price feed ID.
8+
9+
**Note**: We recommend using [\`getEmaPriceNoOlderThan()\`](getEmaPriceNoOlderThan) instead of this endpoint
10+
as it gives more flexibility to specify the maximum age of the price.`,
811
description: `
912
This method returns the latest price object containing **exponentially-weighted moving average** price for the requested price feed ID.
1013
The \`price\` object contains the following fields:

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import { ParameterType } from "../../components/EvmApi";
33

44
export const getPrice = readApi<"id">({
55
name: "getPrice (deprecated)",
6-
summary: "Get the **latest** price object for the requested price feed ID.",
6+
summary: `
7+
Get the **latest** price object for the requested price feed ID.
8+
9+
**Note**: We recommend using [\`getPriceNoOlderThan()\`](getPriceNoOlderThan) instead of this endpoint
10+
as it gives more flexibility to specify the maximum age of the price.
11+
`,
712
description: `
813
This method returns the latest price object for the requested price feed ID.
914

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@ import { readApi, solidity, ethersJS } from "./common";
22

33
export const getValidTimePeriod = readApi<never>({
44
name: "getValidTimePeriod (deprecated)",
5-
summary: "Get the default valid time period of price freshness in seconds.",
5+
summary: `
6+
Get the default valid time period of price freshness in seconds.
7+
`,
68
description: `
79
This method returns the default valid time period of price freshness in **seconds**.
810
This quantity is the maximum age of price updates returned by functions like [getPrice](getPrice) and
911
[getEmaPrice](getEmaPrice); these functions revert if the current on-chain price
1012
is older than this period.
1113
14+
**NOTE**: We recommend using [\`getPriceNoOlderThan()\`](getPriceNoOlderThan) or [\`getEmaPriceNoOlderThan()\`](getEmaPriceNoOlderThan) instead of [getPrice](getPrice) and
15+
[getEmaPrice](getEmaPrice).
16+
1217
The valid time period is configured to be a same default for each blockchain.
1318
`,
1419
parameters: [],

0 commit comments

Comments
 (0)