Răsfoiți Sursa

chore(Dev-hub) Final Edits

Aditya Arora 2 luni în urmă
părinte
comite
d1a7386a7a

+ 1 - 0
apps/developer-hub/content/docs/entropy/best-practices.mdx

@@ -1,6 +1,7 @@
 ---
 title: Best Practices
 description: Best practices for using Pyth Entropy in your applications
+icon: Book
 ---
 
 import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock";

+ 1 - 0
apps/developer-hub/content/docs/entropy/contract-addresses.mdx

@@ -1,6 +1,7 @@
 ---
 title: Contract & Provider Addresses
 description: Pyth Entropy contract addresses on EVM networks
+icon: FileText
 ---
 
 import { EntropyTable } from "../../../src/components/EntropyTable";

+ 1 - 0
apps/developer-hub/content/docs/entropy/create-your-first-entropy-app.mdx

@@ -1,6 +1,7 @@
 ---
 title: Create your first Entropy app on EVM
 description: Build a coin flip example using Pyth Entropy
+icon: RocketLaunch
 ---
 
 import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock";

+ 1 - 0
apps/developer-hub/content/docs/entropy/debug-callback-failures.mdx

@@ -1,6 +1,7 @@
 ---
 title: Debug Callback Failures
 description: How to identify and resolve issues with Entropy callbacks
+icon: Bug
 ---
 
 import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock";

+ 1 - 0
apps/developer-hub/content/docs/entropy/error-codes.mdx

@@ -1,6 +1,7 @@
 ---
 title: Error Codes
 description: On chain error codes from the Pyth Entropy EVM contracts
+icon: Bug
 ---
 
 The following table contains the errors used in the Pyth Network's Entropy [EVM contracts](https://github.com/pyth-network/pyth-crosschain/blob/d290f4ec47a73636cf77711f5f68c3455bb8a8ca/target_chains/ethereum/contracts/contracts/entropy/Entropy.sol).

+ 1 - 0
apps/developer-hub/content/docs/entropy/fees.mdx

@@ -1,6 +1,7 @@
 ---
 title: Fees
 description: Understanding Pyth Entropy fee structure
+icon: CurrencyDollar
 ---
 
 The Entropy protocol has been designed to charge fees on a per-request basis. The total fee is

+ 1 - 0
apps/developer-hub/content/docs/entropy/generate-random-numbers-evm.mdx

@@ -1,6 +1,7 @@
 ---
 title: Generate Random Numbers onchain
 description: Learn how to integrate Pyth Entropy to generate random numbers in your dapp
+icon: Code
 ---
 
 import { Step, Steps } from "fumadocs-ui/components/steps";

+ 16 - 14
apps/developer-hub/content/docs/entropy/index.mdx

@@ -9,6 +9,7 @@ import {
   RocketLaunch,
   FileText,
   DiceSix,
+  MagnifyingGlass,
 } from "@phosphor-icons/react/dist/ssr";
 
 **Pyth Entropy** is an on-chain random number generator (RNG) designed for developers who need fair, unbiased, and cryptographically secure randomness.
@@ -24,19 +25,6 @@ Whether you're building a blockchain game, NFT mint, lottery, or simulation, Ent
 
 Entropy v2 introduces several improvements and new features to make random number generation more flexible and efficient.
 See [What's New in Entropy v2](whats-new-entropyv2) for more details.
-(TODO: Add an infographic here)
-
-## Getting Started
-
-Using Pyth Entropy is permissionless and developers can integrate in a few minutes.
-Please see [How to Generate Random Numbers Using Pyth Entropy](generate-random-numbers) to start integrating Pyth Entropy into your application.
-
-## Reference Material
-
-- [Protocol design](protocol-design)
-- [Contract Addresses/Supported Networks](contract-addresses)
-- [Error Codes](error-codes)
-- [Entropy Debugger](https://entropy-debugger.pyth.network/) - Interactive tool for diagnosing callback issues
 
 ## Start Building
 
@@ -57,9 +45,23 @@ Please see [How to Generate Random Numbers Using Pyth Entropy](generate-random-n
   />
   <IntegrationCard
     href="/entropy/contract-addresses"
-    title="Contracts & Providers"
+    title="Contract Addresses"
     description="Find Entropy addresses, reveal delays, gas limits, and fees."
     icon={<FileText size={16} />}
     colorScheme="purple"
   />
+  <IntegrationCard
+    href="/entropy/protocol-design"
+    title="Protocol Design"
+    description="Understanding how Pyth Entropy generates secure random numbers."
+    icon={<FileText size={16} />}
+    colorScheme="purple"
+  />
+  <IntegrationCard
+    href="https://entropy-debugger.pyth.network/"
+    title="Entropy Explorer"
+    description="Interactive tool to diagnose callback issues on-chain."
+    icon={<MagnifyingGlass size={16} />}
+    colorScheme="yellow"
+  />
 </div>

+ 1 - 0
apps/developer-hub/content/docs/entropy/protocol-design.mdx

@@ -1,6 +1,7 @@
 ---
 title: Protocol Design
 description: Understanding how Pyth Entropy generates secure random numbers
+icon: Book
 ---
 
 The Entropy protocol implements a secure 2-party random number generation procedure. The protocol

+ 1 - 0
apps/developer-hub/content/docs/entropy/request-callback-variants.mdx

@@ -1,6 +1,7 @@
 ---
 title: Request Callback Variants
 description: Different ways to request random numbers with Pyth Entropy
+icon: Code
 ---
 
 The [`IEntropyV2`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropyV2.sol) interface provides multiple variants of the `requestV2` function:

+ 2 - 1
apps/developer-hub/content/docs/entropy/set-custom-gas-limits.mdx

@@ -1,12 +1,13 @@
 ---
 title: Set Custom Gas Limits
 description: How to set custom gas limits for Entropy callbacks
+icon: Gauge
 ---
 
 import { Step, Steps } from "fumadocs-ui/components/steps";
 import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock";
 
-Custom gas limits are useful when your callback function requires more gas than the [default provider limit]TODO(../contract-addresses), or when you want to optimize gas costs for simpler callbacks.
+Custom gas limits are useful when your callback function requires more gas than the [default provider limit](./entropy/contract-addresses), or when you want to optimize gas costs for simpler callbacks.
 
 ## Prerequisites
 

+ 3 - 4
apps/developer-hub/content/docs/entropy/whats-new-entropyv2.mdx

@@ -54,11 +54,10 @@ Improved contract efficiency reduces overall gas costs for entropy requests.
 ## Migration Guide
 
 If you're upgrading from Entropy v1 to v2:
-(TODO: Add links to the interface)
 
-1. Update your imports to use `IEntropyV2`
-2. Replace `request()` calls with `requestV2()`
-3. Update fee calculation to use `getFeeV2()`
+1. Update your imports to use [`IEntropyV2`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropyV2.sol).
+2. Replace `request()` calls with [`requestV2()`](https://github.com/pyth-network/pyth-crosschain/blob/f5402df8e44158c519496bcd2fac5d3afe856a0e/target_chains/ethereum/entropy_sdk/solidity/IEntropyV2.sol#L26)
+3. Update fee calculation to use [`getFeeV2()`](https://github.com/pyth-network/pyth-crosschain/blob/f5402df8e44158c519496bcd2fac5d3afe856a0e/target_chains/ethereum/entropy_sdk/solidity/IEntropyV2.sol#L135)
 4. Test thoroughly with the new interface
 
 ## Backward Compatibility

+ 17 - 4
apps/developer-hub/src/components/IntegrationCard/index.tsx

@@ -5,7 +5,7 @@ type IntegrationCardProps = {
   icon: React.ReactNode;
   title: string;
   description: string;
-  colorScheme?: "blue" | "green" | "purple";
+  colorScheme?: "blue" | "green" | "purple" | "yellow";
   external?: boolean;
   showArrow?: boolean;
 };
@@ -26,6 +26,11 @@ const colorClasses = {
     text: "text-purple-600 dark:text-purple-400",
     hoverText: "group-hover:text-purple-600 dark:group-hover:text-purple-400",
   },
+  yellow: {
+    bg: "bg-yellow-100 dark:bg-yellow-900",
+    text: "text-yellow-600 dark:text-yellow-400",
+    hoverText: "group-hover:text-yellow-600 dark:group-hover:text-yellow-400",
+  },
 };
 
 export function IntegrationCard({
@@ -45,7 +50,9 @@ export function IntegrationCard({
 
   return (
     <Wrapper
-      {...(wrapperProps as { href: string } | { href: string; target: string; rel: string })}
+      {...(wrapperProps as
+        | { href: string }
+        | { href: string; target: string; rel: string })}
       className="not-prose group no-underline grid h-full grid-rows-[auto_1fr] gap-3 rounded-xl border bg-[var(--color-fd-card)] border-[var(--color-fd-border)] p-5 md:p-6 shadow-sm outline-none transition-colors hover:border-[var(--color-fd-accent)] focus-visible:ring-2 focus-visible:ring-[var(--color-fd-accent)]"
       aria-label={title}
     >
@@ -55,7 +62,11 @@ export function IntegrationCard({
         >
           <div className={`h-4 w-4 ${colors.text}`}>{icon}</div>
         </div>
-        <h3 className={`m-0 text-base font-semibold text-[var(--color-fd-foreground)] ${colors.hoverText}`}>{title}</h3>
+        <h3
+          className={`m-0 text-base font-semibold text-[var(--color-fd-foreground)] ${colors.hoverText}`}
+        >
+          {title}
+        </h3>
         {showArrow && (
           <span
             className="ml-auto translate-x-0 opacity-0 transition-all duration-200 ease-out group-hover:translate-x-1 group-hover:opacity-100"
@@ -65,7 +76,9 @@ export function IntegrationCard({
           </span>
         )}
       </div>
-      <p className="m-0 text-sm text-[var(--color-fd-muted-foreground)] line-clamp-2">{description}</p>
+      <p className="m-0 text-sm text-[var(--color-fd-muted-foreground)] line-clamp-2">
+        {description}
+      </p>
     </Wrapper>
   );
 }

+ 24 - 0
apps/developer-hub/src/source.ts

@@ -7,6 +7,18 @@ import {
   Shuffle,
   DiceSix,
   Sparkle,
+  RocketLaunch,
+  FileText,
+  MagnifyingGlass,
+  Shield,
+  Gauge,
+  Bug,
+  ShieldCheck,
+  ArrowsClockwise,
+  WarningCircle,
+  Code,
+  Book,
+  CurrencyDollar,
 } from "@phosphor-icons/react/dist/ssr";
 import type { InferMetaType, InferPageType } from "fumadocs-core/source";
 import { loader } from "fumadocs-core/source";
@@ -22,6 +34,18 @@ const icons: Record<string, React.ComponentType> = {
   Shuffle,
   DiceSix,
   Sparkle,
+  RocketLaunch,
+  FileText,
+  MagnifyingGlass,
+  Shield,
+  Gauge,
+  Bug,
+  ShieldCheck,
+  ArrowsClockwise,
+  WarningCircle,
+  Code,
+  Book,
+  CurrencyDollar,
 };
 
 export const source = loader({