Explorar o código

wip-api-reference

Aditya Arora hai 1 ano
pai
achega
6f403e1b90

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

@@ -5,6 +5,23 @@ export const getPrice = readApi<"id">({
   name: "getPrice",
   summary: "Get the **latest** price object for the requested price feed ID.",
   description: `
+  This method returns the latest price object for the requested price feed ID.
+
+  The \`Price\` object contains the following fields:
+  1. \`price\`: The price of the asset.
+  2. \`conf\`: The confidence level of the price.
+  3. \`expo\`: The exponent of the price.
+  4. \`publishTime\`: The timestamp of the price update.
+
+  Sample \`Price\` object:
+  \`\`\`json
+  {
+    "price": "1234",
+    "conf": "1000",
+    "expo": "-2",
+    "publishTime": 1626892800
+  }
+  \`\`\`
 Get the latest price and confidence interval for the requested price feed id.
 The price feed id is a 32-byte id written as a hexadecimal string; see the
 [price feed ids](https://pyth.network/developers/price-feed-ids) page to look up

+ 1 - 0
apps/api-reference/src/components/InlineCode/index.tsx

@@ -13,3 +13,4 @@ export const InlineCode = ({
     {...props}
   />
 );
+

+ 4 - 0
apps/api-reference/src/components/List/index.tsx

@@ -0,0 +1,4 @@
+import { Styled } from "../Styled";
+
+export const NumberedList = Styled("ol", "list-decimal list-inside mb-6 last:mb-0");
+export const BulletList = Styled("ul", "list-disc list-inside mb-6 last:mb-0");

+ 1 - 1
apps/api-reference/src/components/Paragraph/index.tsx

@@ -1,3 +1,3 @@
 import { Styled } from "../Styled";
 
-export const Paragraph = Styled("p", "mb-6 last:mb-0");
+export const Paragraph = Styled("p", "mb-6 last:mb-0");

+ 3 - 0
apps/api-reference/src/markdown-components.tsx

@@ -2,6 +2,7 @@ import { InlineCode } from "./components/InlineCode";
 import { InlineLink } from "./components/InlineLink";
 import { Paragraph } from "./components/Paragraph";
 import { Styled } from "./components/Styled";
+import { NumberedList, BulletList } from "./components/List";
 
 export const MARKDOWN_COMPONENTS = {
   h1: Styled("h1", "mb-8 text-4xl font-medium"),
@@ -9,4 +10,6 @@ export const MARKDOWN_COMPONENTS = {
   a: InlineLink,
   code: InlineCode,
   strong: Styled("strong", "font-semibold"),
+  ul: BulletList,
+  ol: NumberedList,
 };