Procházet zdrojové kódy

Merge pull request #354 from metaplex-foundation/das/playground

move playground
Tony Boyle před 5 měsíci
rodič
revize
dd944a5468
38 změnil soubory, kde provedl 313 přidání a 543 odebrání
  1. 7 1
      src/components/Layout.jsx
  2. 59 14
      src/components/apiComponents/apiComponentWrapper.jsx
  3. 13 82
      src/components/apiComponents/endPointSelector.jsx
  4. 61 17
      src/components/apiComponents/exampleSelector.jsx
  5. 10 10
      src/components/apiComponents/languageRenderer.jsx
  6. 0 50
      src/components/products/aura/index.js
  7. 7 10
      src/components/products/das-api/index.js
  8. 40 0
      src/lib/api/aura/das/getAsset.js
  9. 12 2
      src/lib/api/aura/das/getAssetProof.js
  10. 3 3
      src/lib/api/aura/das/getAssetProofs.js
  11. 15 5
      src/lib/api/aura/das/getAssetSignatures.js
  12. 4 4
      src/lib/api/aura/das/getAssets.js
  13. 1 1
      src/lib/api/aura/das/getTokenAccounts.js
  14. 6 6
      src/lib/api/aura/methods.js
  15. 13 0
      src/middleware.js
  16. 0 10
      src/pages/aura/api/v1/das/get-asset-batch.md
  17. 0 9
      src/pages/aura/api/v1/das/get-asset-proof-batch.md
  18. 0 10
      src/pages/aura/api/v1/das/get-asset-proof.md
  19. 0 9
      src/pages/aura/api/v1/das/get-asset.md
  20. 0 10
      src/pages/aura/api/v1/das/get-assets-by-authority.md
  21. 0 10
      src/pages/aura/api/v1/das/get-assets-by-creator.md
  22. 0 9
      src/pages/aura/api/v1/das/get-assets-by-group.md
  23. 0 9
      src/pages/aura/api/v1/das/get-assets-by-owner.md
  24. 0 9
      src/pages/aura/api/v1/das/get-signatures-for-asset.md
  25. 0 9
      src/pages/aura/api/v1/das/get-token-accounts.md
  26. 0 9
      src/pages/aura/api/v1/das/search-assets.md
  27. 0 8
      src/pages/aura/api/v1/testApiMethod.md
  28. 5 19
      src/pages/das-api/methods/get-asset-proof.md
  29. 5 22
      src/pages/das-api/methods/get-asset-proofs.md
  30. 4 19
      src/pages/das-api/methods/get-asset-signatures.md
  31. 4 19
      src/pages/das-api/methods/get-asset.md
  32. 6 22
      src/pages/das-api/methods/get-assets-by-authority.md
  33. 6 24
      src/pages/das-api/methods/get-assets-by-creator.md
  34. 6 23
      src/pages/das-api/methods/get-assets-by-group.md
  35. 6 23
      src/pages/das-api/methods/get-assets-by-owner.md
  36. 15 33
      src/pages/das-api/methods/get-assets.md
  37. 4 22
      src/pages/das-api/methods/search-assets.md
  38. 1 1
      src/shared/usePage.js

+ 7 - 1
src/components/Layout.jsx

@@ -112,6 +112,10 @@ export function Layout({ children, page }) {
         </div>
 
         {/* Table of contents. */}
+        {/* <pre>
+          {JSON.stringify(page.tableOfContents, null, 2)}
+        </pre> */}
+        {page.tableOfContents.length === 0 ? "" :
         <div
           className={clsx(
             'hidden',
@@ -120,10 +124,12 @@ export function Layout({ children, page }) {
               : 'lg:sticky lg:top-[7rem] lg:-mr-6 lg:block lg:h-[calc(100vh-7rem)] lg:flex-none lg:overflow-y-auto lg:py-16 lg:pr-6'
           )}
         >
-          <TableOfContent
+           <TableOfContent
             tableOfContents={page.tableOfContents}
           ></TableOfContent>
+          
         </div>
+}
       </div>
     </>
   )

+ 59 - 14
src/components/apiComponents/apiComponentWrapper.jsx

@@ -6,7 +6,6 @@ import { Fence } from '../Fence'
 import Spinner from '../icons/spinner'
 import { Totem, TotemAccordion } from '../Totem'
 import ApiParameterDisplay from './apiParams'
-import { endpoints } from './endPointSelector'
 import ApiExampleSelector from './exampleSelector'
 import LanguageRenderer from './languageRenderer'
 import Responce from './responce'
@@ -18,7 +17,19 @@ const ApiComponentWrapper = (args) => {
   const [responce, setResponce] = useState(null)
   const [isLoading, setIsLoading] = useState(false)
   const [selectedExample, setSelectedExample] = useState(-1)
-  const [activeEndpoint, setActiveEndpoint] = useState(endpoints.solanaMainnet)
+  const [activeEndpoint, setActiveEndpoint] = useState("https://api.devnet.solana.com")
+
+  useEffect(() => {
+    // Load saved endpoint from localStorage on component mount
+    try {
+      const savedEndpoint = localStorage.getItem('customEndPoint')
+      if (savedEndpoint) {
+        setActiveEndpoint(savedEndpoint)
+      }
+    } catch (error) {
+      console.warn('Failed to load endpoint from localStorage:', error)
+    }
+  }, [])
 
   const handleSetExample = (index) => {
     if (index == -1) {
@@ -38,8 +49,21 @@ const ApiComponentWrapper = (args) => {
     })
 
     setSelectedExample(index)
-    if (activeEndpoint.name !== 'Custom') {
-      setActiveEndpoint(endpoints[api.examples[index].chain])
+    
+    // Update endpoint based on example chain if available
+    if (api.examples[index].chain) {
+      const chainEndpoint = api.examples[index].chain === 'devnet' 
+        ? 'https://api.devnet.solana.com'
+        : api.examples[index].chain === 'mainnet'
+          ? 'https://api.mainnet-beta.solana.com'
+          : activeEndpoint
+      
+      setActiveEndpoint(chainEndpoint)
+      try {
+        localStorage.setItem('customEndPoint', chainEndpoint)
+      } catch (error) {
+        console.warn('Failed to save endpoint to localStorage:', error)
+      }
     }
   }
 
@@ -118,19 +142,40 @@ const ApiComponentWrapper = (args) => {
     setResponce(null)
     setIsLoading(true)
 
-    const res = await fetch(activeEndpoint.uri, {
-      method: 'POST',
-      headers: {
-        'Content-Type': 'application/json',
-      },
-      body: JSON.stringify(body),
-    })
+    try {
+      if (!activeEndpoint) {
+        throw new Error('Endpoint URL is required')
+      }
+      
+      try {
+        new URL(activeEndpoint)
+      } catch {
+        throw new Error('Invalid endpoint URL. Please enter a valid URL starting with http:// or https://')
+      }
 
-    const resJson = await res.json()
+      const res = await fetch(activeEndpoint, {
+        method: 'POST',
+        headers: {
+          'Content-Type': 'application/json',
+        },
+        body: JSON.stringify(body),
+      })
 
-    setResponce(resJson)
+      if (!res.ok) {
+        throw new Error(`HTTP error! status: ${res.status}`)
+      }
 
-    setIsLoading(false)
+      const resJson = await res.json()
+      setResponce(resJson)
+    } catch (error) {
+      setResponce({
+        error: {
+          message: error.message || 'Failed to fetch. Please check your endpoint URL and try again.'
+        }
+      })
+    } finally {
+      setIsLoading(false)
+    }
   }
 
   return (

+ 13 - 82
src/components/apiComponents/endPointSelector.jsx

@@ -1,62 +1,21 @@
 import { Select } from '@headlessui/react'
 import { ChevronDownIcon } from '@heroicons/react/20/solid'
 import clsx from 'clsx'
-import { useState } from 'react'
-
-export const endpoints = {
-  solanaMainnet: {
-    name: 'Solana Mainnet',
-    uri: 'https://aura-mainnet.metaplex.com',
-    value: 'solanaMainnet',
-  },
-  solanaDevnet: {
-    name: 'Solana Devnet',
-    uri: 'https://aura-devnet.metaplex.com',
-    value: 'solanaDevnet',
-  },
-  eclipseAuraMainnet: {
-    name: 'Eclipse Mainnet',
-    uri: 'https://aura-eclipse-mainnet.metaplex.com',
-    value: 'eclipseAuraMainnet',
-    value: 'eclipseAuraMainnet',
-  },
-  custom: {
-    name: 'Custom',
-    uri: '',
-    value: 'custom',
-  },
-}
+import { useEffect, useState } from 'react'
 
 const EndPointSelector = ({ setActiveEndpoint, activeEndpoint }) => {
-  const [isCustom, setIsCustom] = useState(false)
-  const [customEndPoint, setCustomEndPoint] = useState('')
-
-  // read endpoint from local storage
+  useEffect(() => {
+    // Load saved endpoint from localStorage on component mount
+    const savedEndpoint = localStorage.getItem('customEndPoint')
+    if (savedEndpoint) {
+      setActiveEndpoint(savedEndpoint)
+    }
+  }, [])
 
   const handleSelectEndpoint = (e) => {
-
-    if (e.target.name === 'selectEndPoint') {
-      if (e.target.value === 'custom') {
-        setIsCustom(true)
-        const endpoint = localStorage.getItem('customEndPoint') || ''
-
-        setActiveEndpoint({
-          name: 'Custom',
-          uri: endpoint,
-        })
-        setCustomEndPoint(endpoint)
-      } else {
-        setIsCustom(false)
-        setActiveEndpoint(endpoints[e.target.value])
-      }
-    }
-    if (e.target.name === 'customEndPoint') {
-      setActiveEndpoint({
-        name: 'Custom',
-        uri: e.target.value,
-      })
-      setCustomEndPoint(e.target.value)
-    }
+    const newEndpoint = e.target.value
+    setActiveEndpoint(newEndpoint)
+    localStorage.setItem('customEndPoint', newEndpoint)
   }
 
   return (
@@ -67,42 +26,14 @@ const EndPointSelector = ({ setActiveEndpoint, activeEndpoint }) => {
       >
         Endpoint
       </label>
-      <div className="relative flex h-12 w-full">
-        <Select
-          id="endPoint"
-          name="selectEndPoint"
-          className={clsx(
-            'dark:white block w-full appearance-none rounded-lg border border-black/10 bg-white/5 px-3 py-1.5 text-sm/6 text-black dark:border-white/15 dark:bg-transparent',
-            'focus:outline-none data-[focus]:outline-2 data-[focus]:-outline-offset-2 data-[focus]:outline-white/25',
-            // Make the text of each option black on Windows
-            '*:text-black dark:text-white'
-          )}
-          onChange={(e) => handleSelectEndpoint(e)}
-          value={isCustom ? 'custom' : activeEndpoint.value}
-        >
-          {Object.entries(endpoints).map(([key, value]) => (
-            <option key={key} value={key}>
-              {value.name}
-            </option>
-          ))}
-        </Select>
-        <ChevronDownIcon
-          className="group pointer-events-none absolute right-2.5 top-4 my-auto size-4 fill-black/60 dark:fill-white"
-          aria-hidden="true"
-        />
-      </div>
 
       <input
         type="text"
         name="customEndPoint"
         placeholder="https://"
         className="block w-full rounded-lg border border-gray-200 px-2 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 disabled:pointer-events-none disabled:opacity-50 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-300 dark:placeholder-neutral-500"
-        onChange={(e) => {
-          handleSelectEndpoint(e)
-          localStorage.setItem('customEndPoint', e.target.value)
-        }}
-        disabled={!isCustom}
-        value={isCustom ? customEndPoint : activeEndpoint.uri}
+        onChange={handleSelectEndpoint}
+        value={activeEndpoint}
       />
     </div>
   )

+ 61 - 17
src/components/apiComponents/exampleSelector.jsx

@@ -1,12 +1,47 @@
-import { Select } from '@headlessui/react'
-import { ChevronDownIcon } from '@heroicons/react/20/solid'
-import clsx from 'clsx'
+import { Select } from '@headlessui/react';
+import { ChevronDownIcon } from '@heroicons/react/20/solid';
+import clsx from 'clsx';
 
 const ApiExampleSelector = ({
-  examples,
+  examples = [],
   selectedExample,
   handleSetExample,
 }) => {
+  if (!Array.isArray(examples)) {
+    console.error('ApiExampleSelector: examples prop must be an array');
+    return null;
+  }
+
+  const { mainnetExamples, devnetExamples } = examples.reduce(
+    (acc, example) => {
+      if (example?.chain === 'solanaMainnet') {
+        acc.mainnetExamples.push(example);
+      } else if (example?.chain === 'solanaDevnet') {
+        acc.devnetExamples.push(example);
+      }
+      return acc;
+    },
+    { mainnetExamples: [], devnetExamples: [] }
+  );
+
+  const currentExample = selectedExample >= 0 && selectedExample < examples.length 
+    ? examples[selectedExample] 
+    : null;
+
+  const handleExampleChange = (e) => {
+    const selectedName = e.target.value;
+    if (!selectedName) {
+      handleSetExample(-1);
+      return;
+    }
+
+    const example = examples.find(ex => ex.name === selectedName);
+    if (example) {
+      const index = examples.indexOf(example);
+      handleSetExample(index);
+    }
+  };
+
   return (
     <div className="w-full">
       <label
@@ -18,24 +53,33 @@ const ApiExampleSelector = ({
       <div className="relative flex w-full gap-2">
         <div className="relative flex h-12 w-full">
           <Select
-            onChange={(e) => handleSetExample(e.target.value)}
-            value={selectedExample}
+            onChange={handleExampleChange}
+            value={currentExample?.name || ''}
             className={clsx(
               'dark:white block w-full appearance-none rounded-lg border border-black/10 bg-white/5 px-3 py-1.5 text-sm/6 text-black dark:border-white/15 dark:bg-transparent',
               'focus:outline-none data-[focus]:outline-2 data-[focus]:-outline-offset-2 data-[focus]:outline-white/25',
               '*:text-black dark:text-white'
             )}
           >
-            <option value={-1}>-</option>
-            <optgroup label="Solana Mainnet">
-              {examples.map((example, index) => {
-                return (
-                  <option key={index} value={index}>
+            <option value="">-</option>
+            {devnetExamples.length > 0 && (
+              <optgroup label="Solana Devnet">
+                {devnetExamples.map((example) => (
+                  <option key={example.name} value={example.name}>
                     {example.name}
                   </option>
-                )
-              })}
-            </optgroup>
+                ))}
+              </optgroup>
+            )}
+            {mainnetExamples.length > 0 && (
+              <optgroup label="Solana Mainnet">
+                {mainnetExamples.map((example) => (
+                  <option key={example.name} value={example.name}>
+                    {example.name}
+                  </option>
+                ))}
+              </optgroup>
+            )}
           </Select>
           <ChevronDownIcon
             className="group pointer-events-none absolute right-2.5 top-4 my-auto size-4 fill-black/60 dark:fill-white"
@@ -51,7 +95,7 @@ const ApiExampleSelector = ({
         </button>
       </div>
     </div>
-  )
-}
+  );
+};
 
-export default ApiExampleSelector
+export default ApiExampleSelector;

+ 10 - 10
src/components/apiComponents/languageRenderer.jsx

@@ -33,7 +33,7 @@ const LanguageRenderer = ({ api, body, setActiveEndpoint, activeEndpoint }) => {
             </div>
             <JavascriptRequestRenderer
               method={api.method}
-              url={activeEndpoint.uri}
+              url={activeEndpoint}
               headers={headers}
               bodyMethod={body.method}
               bodyParams={body.params}
@@ -49,7 +49,7 @@ const LanguageRenderer = ({ api, body, setActiveEndpoint, activeEndpoint }) => {
             </div>
             <PythonRequestRenderer
               method={api.method}
-              url={activeEndpoint.uri}
+              url={activeEndpoint}
               headers={headers}
               bodyMethod={body.method}
               bodyParams={body.params}
@@ -65,7 +65,7 @@ const LanguageRenderer = ({ api, body, setActiveEndpoint, activeEndpoint }) => {
             </div>
             <CurlRequestRenderer
               method={api.method}
-              url={activeEndpoint.uri}
+              url={activeEndpoint}
               headers={headers}
               bodyMethod={body.method}
               bodyParams={body.params}
@@ -81,7 +81,7 @@ const LanguageRenderer = ({ api, body, setActiveEndpoint, activeEndpoint }) => {
             </div>
             <GoRequestRenderer
               method={api.method}
-              url={activeEndpoint.uri}
+              url={activeEndpoint}
               headers={headers}
               bodyMethod={body.method}
               bodyParams={body.params}
@@ -97,7 +97,7 @@ const LanguageRenderer = ({ api, body, setActiveEndpoint, activeEndpoint }) => {
             </div>
             <CSharpRequestRenderer
               method={api.method}
-              url={activeEndpoint.uri}
+              url={activeEndpoint}
               // headers={headers}
               bodyMethod={body.method}
               bodyParams={body.params}
@@ -113,7 +113,7 @@ const LanguageRenderer = ({ api, body, setActiveEndpoint, activeEndpoint }) => {
             </div>
             <JavaRenderer
               method={api.method}
-              url={activeEndpoint.uri}
+              url={activeEndpoint}
               headers={headers}
               bodyMethod={body.method}
               bodyParams={body.params}
@@ -129,7 +129,7 @@ const LanguageRenderer = ({ api, body, setActiveEndpoint, activeEndpoint }) => {
             </div>
             <PhpRenderer
               method={api.method}
-              url={activeEndpoint.uri}
+              url={activeEndpoint}
               headers={headers}
               bodyMethod={body.method}
               bodyParams={body.params}
@@ -159,7 +159,7 @@ const LanguageRenderer = ({ api, body, setActiveEndpoint, activeEndpoint }) => {
             </div>
             <RubyRenderer
               method={api.method}
-              url={activeEndpoint.uri}
+              url={activeEndpoint}
               headers={headers}
               bodyMethod={body.method}
               bodyParams={body.params}
@@ -174,7 +174,7 @@ const LanguageRenderer = ({ api, body, setActiveEndpoint, activeEndpoint }) => {
             </div>
             <RustRequestRenderer
               method={api.method}
-              url={activeEndpoint.uri}
+              url={activeEndpoint}
               headers={headers}
               bodyMethod={body.method}
               bodyParams={body.params}
@@ -189,7 +189,7 @@ const LanguageRenderer = ({ api, body, setActiveEndpoint, activeEndpoint }) => {
             </div>
             <SwiftRequestRenderer
               method={api.method}
-              url={activeEndpoint.uri}
+              url={activeEndpoint}
               headers={headers}
               bodyMethod={body.method}
               bodyParams={body.params}

+ 0 - 50
src/components/products/aura/index.js

@@ -41,56 +41,6 @@ export const aura = {
               href: '/aura/reading-solana-and-svm-data',
             },
           ],
-        },
-        {
-          title: 'DAS Methods',
-          collapsed: true,
-          links: [
-            {
-              title: 'Get Asset',
-              href: '/aura/api/v1/das/get-asset',
-            },
-            {
-              title: 'Get Asset Batch',
-              href: '/aura/api/v1/das/get-asset-batch',
-            },
-            {
-              title: 'Get Asset Proof',
-              href: '/aura/api/v1/das/get-asset-proof',
-            },
-            {
-              title: 'Get Asset Proof Batch',
-              href: '/aura/api/v1/das/get-asset-proof-batch',
-            },
-            {
-              title: 'Get Assets by Owner',
-              href: '/aura/api/v1/das/get-assets-by-owner',
-            },
-            {
-              title: 'Get Assets by Authority',
-              href: '/aura/api/v1/das/get-assets-by-authority',
-            },
-            {
-              title: 'Get Assets By Creator',
-              href: '/aura/api/v1/das/get-assets-by-creator',
-            },
-            {
-              title: 'Get Assets By Group',
-              href: '/aura/api/v1/das/get-assets-by-group',
-            },
-            {
-              title: 'Get Signatures For Asset',
-              href: '/aura/api/v1/das/get-signatures-for-asset',
-            },
-            {
-              title: 'Get Token Accounts',
-              href: '/aura/api/v1/das/get-token-accounts',
-            },
-            {
-              title: 'Search Assets',
-              href: '/aura/api/v1/das/search-assets',
-            },
-          ],
         }
       ],
     },

+ 7 - 10
src/components/products/das-api/index.js

@@ -1,8 +1,5 @@
 import {
-    changelogSection,
-    documentationSection,
-    recipesSection,
-    referencesSection,
+  documentationSection
 } from '@/shared/sections'
 import { TableCellsIcon } from '@heroicons/react/24/solid'
 import { Hero } from './Hero'
@@ -39,15 +36,15 @@ export const das = {
             { title: 'Get Asset Proof', href: '/das-api/methods/get-asset-proof' },
             { title: 'Get Asset Proofs', href: '/das-api/methods/get-asset-proofs' },
             { title: 'Get Asset Signatures', href: '/das-api/methods/get-asset-signatures' },
-            { title: 'Get Asset By Authority', href: '/das-api/methods/get-asset-by-authority' },
-            { title: 'Get Asset By Creator', href: '/das-api/methods/get-asset-by-creator' },
-            { title: 'Get Asset By Group', href: '/das-api/methods/get-asset-by-group' },
-            { title: 'Get Asset By Owner', href: '/das-api/methods/get-asset-by-owner' },
-            { title: 'Search Asset', href: '/das-api/methods/search-assets' },
+            { title: 'Get Assets By Authority', href: '/das-api/methods/get-assets-by-authority' },
+            { title: 'Get Assets By Creator', href: '/das-api/methods/get-assets-by-creator' },
+            { title: 'Get Assets By Group', href: '/das-api/methods/get-assets-by-group' },
+            { title: 'Get Assets By Owner', href: '/das-api/methods/get-assets-by-owner' },
+            { title: 'Search Assets', href: '/das-api/methods/search-assets' },
           ],
         },
         {
-          title: 'Core Extension',
+          title: 'Core Extension SDK',
           links: [
             { title: 'Extension Overview', href: '/das-api/core-extension' },
             { title: 'Get Core Asset', href: '/das-api/core-extension/methods/get-asset' },

+ 40 - 0
src/lib/api/aura/das/getAsset.js

@@ -84,6 +84,46 @@ const getAsset = {
         },
       },
     },
+    {
+      name: 'Metaplex NFT',
+      description: 'Get an asset by its ID',
+      chain: 'solanaDevnet',
+      body: {
+        params: {
+          id: '5fkyv7J5Jf8SaTVnE94A9oVeGBbhcEh9W3nP4cXUCQb8',
+        },
+      },
+    },
+    {
+      name: 'Metaplex pNFT',
+      description: 'Get an asset by its ID',
+      chain: 'solanaDevnet',
+      body: {
+        params: {
+          id: 'D7n1eLnUJSaNfp5qmEwh2E98w3m7Eg9Hfq9n1JLggDVp',
+        },
+      },
+    },
+    {
+      name: 'Metaplex cNFT V1',
+      description: 'Get an asset by its ID',
+      chain: 'solanaDevnet',
+      body: {
+        params: {
+          id: 'E1hi4uEdfe9gai3Y1Vg5eSA8A2oxotVUWv5LtVJXxxpv',
+        },
+      },
+    },
+    {
+      name: 'Metaplex Core Asset',
+      description: 'Get an asset by its ID',
+      chain: 'solanaDevnet',
+      body: {
+        params: {
+          id: 'G9pSgJrghwBMHuxYC4iHMkm3BnDuPvkLMtz9h3u7YzF5',
+        },
+      },
+    },
   ],
   exampleResponse : {
     "jsonrpc": "2.0",

+ 12 - 2
src/lib/api/aura/das/getAssetProof.js

@@ -12,15 +12,25 @@ const getAssetProof = {
     ],
     examples: [
       {
-        name: 'Saga Monkes #6233 (cNFT)',
+        name: 'Saga Monkes #6233 (cNFT V1)',
         chain: 'solanaMainnet',
-        description: 'Get an asset by its ID',
+        description: 'Get an asset proof by its ID',
         body: {
           params: {
             id: 'H6GDZujkpEcxbpDgEbSbNFxNtSi3RBJPJC5GZCvzagaP',
           },
         },
       },
+      {
+        name: 'Metaplex Test (cNFT V1)',
+        chain: 'solanaDevnet',
+        description: 'Get an asset proof by its ID',
+        body: {
+          params: {
+            id: 'E1hi4uEdfe9gai3Y1Vg5eSA8A2oxotVUWv5LtVJXxxpv',
+          },
+        },
+      },
     ],
     exampleResponse: {
       "jsonrpc": "2.0",

+ 3 - 3
src/lib/api/aura/das/getAssetProofBatch.js → src/lib/api/aura/das/getAssetProofs.js

@@ -1,7 +1,7 @@
-const getAssetProofBatch = {
+const getAssetProofs = {
   description:
     'Get the proof of a compressed Digital Asset NFT (cNFT) by its ID',
-  method: 'getAssetProofBatch',
+  method: 'getAssetProofs',
   params: [
     {
       type: 'array',
@@ -14,4 +14,4 @@ const getAssetProofBatch = {
   ],
 }
 
-export default getAssetProofBatch
+export default getAssetProofs

+ 15 - 5
src/lib/api/aura/das/getSignaturesForAsset.js → src/lib/api/aura/das/getAssetSignatures.js

@@ -1,7 +1,7 @@
-const getSignaturesForAsset = {
+const getAssetSignatures = {
   description:
-    'Get the proof of a compressed Digital Asset NFT (cNFT) by its ID',
-  method: 'getSignaturesForAsset',
+    'Get the transaction signatures for a compressed Digital Asset NFT (cNFT) by its ID',
+  method: 'getAssetSignatures',
   params: [
     {
       name: 'id',
@@ -39,7 +39,7 @@ const getSignaturesForAsset = {
   examples: [
     {
       name: 'Fetch signatures of Saga Monkes #6233 (cNFT)',
-      description: 'Fetch the signatures associated with an asset by its ID',
+      description: 'Get the transaction signatures for an asset by its ID',
       chain: "solanaMainnet",
       body: {
         params: {
@@ -47,6 +47,16 @@ const getSignaturesForAsset = {
         },
       },
     },
+    {
+      name: 'Metaplex Test (cNFT V1)',
+      chain: 'solanaDevnet',
+      description: 'Get the transaction signatures for an asset by its ID',
+      body: {
+        params: {
+          id: 'E1hi4uEdfe9gai3Y1Vg5eSA8A2oxotVUWv5LtVJXxxpv',
+        },
+      },
+    },
   ],
   exampleResponse: {
     "jsonrpc": "2.0",
@@ -166,4 +176,4 @@ const getSignaturesForAsset = {
   }
 }
 
-export default getSignaturesForAsset
+export default getAssetSignatures

+ 4 - 4
src/lib/api/aura/das/getAssetBatch.js → src/lib/api/aura/das/getAssets.js

@@ -1,6 +1,6 @@
-const getAssetBatch = {
-  description: 'Get an asset by its ID',
-  method: 'getAssetBatch',
+const getAssets = {
+  description: 'Get assets by their IDs',
+  method: 'getAssets',
   params: [
     {
       type: 'array',
@@ -386,4 +386,4 @@ const getAssetBatch = {
   }
 }
 
-export default getAssetBatch
+export default getAssets

+ 1 - 1
src/lib/api/aura/das/getTokenAccounts.js

@@ -11,7 +11,7 @@ const getTokenAccounts = {
       {
         name: 'owner',
       type: 'string',
-      description: 'Owner public key of the token accounts to revtrieve',
+      description: 'Owner public key of the token accounts to retrieve',
       placeholder: 'Owner public key',
     },
     {

+ 6 - 6
src/lib/api/aura/methods.js

@@ -1,12 +1,12 @@
 import getAssetsByAuthority from './das/getAssestByAuthority'
 import getAsset from './das/getAsset'
-import getAssetBatch from './das/getAssetBatch'
 import getAssetProof from './das/getAssetProof'
-import getAssetProofBatch from './das/getAssetProofBatch'
+import getAssetProofs from './das/getAssetProofs'
+import getAssets from './das/getAssets'
 import getAssetsByCreator from './das/getAssetsByCreator'
 import getAssetsByGroup from './das/getAssetsByGroup'
 import getAssetsByOwner from './das/getAssetsByOwner'
-import getSignaturesForAsset from './das/getSignaturesForAsset'
+import getAssetSignatures from './das/getAssetSignatures'
 import getTokenAccounts from './das/getTokenAccounts'
 import searchAssets from './das/searchAssest'
 
@@ -21,10 +21,10 @@ const apiMethods = {
   getAssetsByCreator: getAssetsByCreator,
   getAssetsByGroup: getAssetsByGroup,
   getAssetsByOwner: getAssetsByOwner,
-  getAssetBatch: getAssetBatch,
-  getAssetProofBatch: getAssetProofBatch,
+  getAssets: getAssets,
+  getAssetProofs: getAssetProofs,
   searchAssets: searchAssets,
-  getSignaturesForAsset: getSignaturesForAsset,
+  getAssetSignatures: getAssetSignatures,
   getTokenAccounts: getTokenAccounts,
 }
 export default apiMethods

+ 13 - 0
src/middleware.js

@@ -39,6 +39,18 @@ const redirectRules = {
     'guides/mpl-404-hyrbid-ui-template':
       '/mpl-hybrid/guides/mpl-404-hybrid-ui-template',
   },
+  '/aura': {
+    '/api/v1/das/get-asset': '/das-api/methods/get-asset',
+    '/api/v1/das/get-asset-batch': '/das-api/methods/get-assets',
+    '/api/v1/das/get-asset-proof': '/das-api/methods/get-asset-proof',
+    '/api/v1/das/get-asset-proof-batch': '/das-api/methods/get-asset-proofs',
+    '/api/v1/das/get-assets-by-owner': '/das-api/methods/get-assets-by-owner',
+    '/api/v1/das/get-assets-by-authority': '/das-api/methods/get-assets-by-authority',
+    '/api/v1/das/get-assets-by-creator': '/das-api/methods/get-assets-by-creator',
+    '/api/v1/das/get-assets-by-group': '/das-api/methods/get-assets-by-group',
+    '/api/v1/das/get-signatures-for-asset': '/das-api/methods/get-asset-signatures',
+    '/api/v1/das/search-assets': '/das-api/methods/search-assets',
+  },
 }
 
 export function middleware(request) {
@@ -72,5 +84,6 @@ export const config = {
     '/guides/javascript/how-to-create-an-spl-token-on-solana',
     '/core-candy-machine/:path*',
     '/bubblegum/:path*',
+    '/aura/:path*',
   ],
 }

+ 0 - 10
src/pages/aura/api/v1/das/get-asset-batch.md

@@ -1,10 +0,0 @@
----
-title: Get Asset Batch
-metaTitle: Get Asset Batch Method | Aura API
-description: Learn about the Get Asset Batch Aura API Method.
----
-
-Fetch a batch of NFT Digital Assets from the Solana blockchain including NFTs, pNFTs, cNFTs.
-
-{% apiRenderer method="getAssetBatch" /%}
-

+ 0 - 9
src/pages/aura/api/v1/das/get-asset-proof-batch.md

@@ -1,9 +0,0 @@
----
-title: Get Asset Proof Batch
-metaTitle: Get Asset Proof Batch Method | Aura API
-description: Learn about the Get Asset Proof Batch Aura API Method.
----
-
-Fetch a batch of Compressed NFT Digital Asset (cNFT) Proofs Metaplex Aura DAS API.
-
-{% apiRenderer method="getAssetProofBatch" /%}

+ 0 - 10
src/pages/aura/api/v1/das/get-asset-proof.md

@@ -1,10 +0,0 @@
----
-title: Get Asset Proof
-metaTitle: Get Asset Proof Method | Aura API
-description: Learn about the GetAsset Aura API Method.
----
-
-Fetch the proof of a Compressed NFT Digital Asset (cNFT) with Aura DAS API.
-
-{% apiRenderer method="getAssetProof" /%}
-

+ 0 - 9
src/pages/aura/api/v1/das/get-asset.md

@@ -1,9 +0,0 @@
----
-title: Get Asset
-metaTitle: Get Asset Method | Aura API
-description: Learn about the Get Asset Aura API Method.
----
-
-Fetch an NFT Digital Asset from the Solana blockchain including NFTs, pNFTs, cNFTs.
-
-{% apiRenderer method="getAsset" /%}

+ 0 - 10
src/pages/aura/api/v1/das/get-assets-by-authority.md

@@ -1,10 +0,0 @@
----
-title: Get Assets by Authority
-metaTitle: Get Assets by Authority Method | Aura API
-description: Learn about the Get Assets by Authority Aura API Method.
----
-
-Returns the list of assets given an authority address.
-
-{% apiRenderer method="getAssetsByAuthority" /%}
-

+ 0 - 10
src/pages/aura/api/v1/das/get-assets-by-creator.md

@@ -1,10 +0,0 @@
----
-title: Get Assets by Creator
-metaTitle: Get Assets by Creator Method | Aura API
-description: Learn about the Get Assets by Creator Aura API Method.
----
-
-Returns a list of assets based on a given creator address.
-
-{% apiRenderer method="getAssetsByCreator" /%}
-

+ 0 - 9
src/pages/aura/api/v1/das/get-assets-by-group.md

@@ -1,9 +0,0 @@
----
-title: Get Assets by Group
-metaTitle: Get Assets by Group Method | Aura API
-description: Learn about the Get Assets by Group Aura API Method.
----
-
-Return the list of assets given a group (key, value) pair. For example this can be used to get all assets in a collection.
-
-{% apiRenderer method="getAssetsByGroup" /%}

+ 0 - 9
src/pages/aura/api/v1/das/get-assets-by-owner.md

@@ -1,9 +0,0 @@
----
-title: Get Assets by Owner
-metaTitle: Get Assets by Owner Method | Aura API
-description: Learn about the Get Assets by Owner Aura API Method.
----
-
-Return a list of assets owned by a particular public key.
-
-{% apiRenderer method="getAssetsByOwner" /%}

+ 0 - 9
src/pages/aura/api/v1/das/get-signatures-for-asset.md

@@ -1,9 +0,0 @@
----
-title: Get Signatures For Asset
-metaTitle: Get Signatures For Asset | Aura API
-description: Learn about the Get Signatures For Asset Aura API Method.
----
-
-Search and return a list of signatures associated with a Compressed NFT Digital Asset (cNFT).
-
-{% apiRenderer method="getSignaturesForAsset" /%}

+ 0 - 9
src/pages/aura/api/v1/das/get-token-accounts.md

@@ -1,9 +0,0 @@
----
-title: Get Token Accounts
-metaTitle: Get Token Accounts | Aura API
-description: Learn about the Get Token Accounts Aura API Method.
----
-
-Search and return a list of token accounts based on criteria.
-
-{% apiRenderer method="getTokenAccounts" /%}

+ 0 - 9
src/pages/aura/api/v1/das/search-assets.md

@@ -1,9 +0,0 @@
----
-title: Search Asset
-metaTitle: Search Asset Method | Aura API
-description: Learn about the Search Asset Aura API Method.
----
-
-Return the list of assets given a search criteria.
-
-{% apiRenderer method="searchAssets" /%}

+ 0 - 8
src/pages/aura/api/v1/testApiMethod.md

@@ -1,8 +0,0 @@
----
-title: Test Api Method
-metaTitle: Test Api Method | Aura Api
-description: Learn how Batch Minting works.
----
-
-
-{% apiRenderer method="testApiMethod" /%}

+ 5 - 19
src/pages/das-api/methods/get-asset-proof.md

@@ -2,6 +2,7 @@
 title: Get Asset Proof
 metaTitle: Get Asset Proof | DAS API
 description: Returns the merkle tree proof information for a compressed asset
+tableOfContents: false
 ---
 
 Returns the merkle tree proof information for a compressed asset.
@@ -12,10 +13,8 @@ Returns the merkle tree proof information for a compressed asset.
 | --------------- | :------: | ------------------------------------------ |
 | `id`            |    ✅    | The id of the asset.                       |
 
-## Example
+## UMI w/ DAS SDK
 
-{% dialect-switcher title="getAssetProof Example" %}
-{% dialect title="JavaScript" id="js" %}
 {% totem %}
 
 ```js
@@ -31,21 +30,8 @@ console.log(proof);
 ```
 
 {% /totem %}
-{% /dialect %}
-{% dialect title="cURL" id="curl" %}
-{% totem %}
 
-```sh
-curl --request POST --url "<ENDPOINT>" --header 'Content-Type: application/json' --data '{
-    "jsonrpc": "2.0",
-    "method": "getAssetProof",
-    "params": [
-      "Ez6ezCMkRaUkWS5v6WVcP7uuCWiKadr3W2dHFkoZmteW"
-    ],
-    "id": 0
-}'
-```
 
-{% /totem %}
-{% /dialect %}
-{% /dialect-switcher %}
+## Playground
+
+{% apiRenderer method="getAssetProof" /%}

+ 5 - 22
src/pages/das-api/methods/get-asset-proofs.md

@@ -2,6 +2,7 @@
 title: Get Asset Proofs
 metaTitle: Get Asset Proofs | DAS API
 description: Returns the merkle tree proof information for multiple compressed assets
+tableOfContents: false
 ---
 
 Returns the merkle tree proof information for multiple compressed assets. This method is used to verify the authenticity of compressed NFTs by retrieving their merkle proofs.
@@ -12,10 +13,8 @@ Returns the merkle tree proof information for multiple compressed assets. This m
 | --------------- | :------: | ------------------------------------------ |
 | `ids`           |    ✅    | An array of asset ids to get proofs for.   |
 
-## Example
+## UMI w/ DAS SDK
 
-{% dialect-switcher title="getAssetProofs Example" %}
-{% dialect title="JavaScript" id="js" %}
 {% totem %}
 
 ```js
@@ -34,24 +33,8 @@ console.log(assets);
 ```
 
 {% /totem %}
-{% /dialect %}
-{% dialect title="cURL" id="curl" %}
-{% totem %}
 
-```sh
-curl --request POST --url "<ENDPOINT>" --header 'Content-Type: application/json' --data '{
-    "jsonrpc": "2.0",
-    "method": "getAssetProofs",
-    "params": [
-      [
-        "GGRbPQhwmo3dXBkJSAjMFc1QYTKGBt8qc11tTp3LkEKA",
-        "ELDjRRs5Wb478K4h3B5bMPEhqFD8FvoET5ctHku5uiYi"
-      ]
-    ],
-    "id": 0
-}'
-```
 
-{% /totem %}
-{% /dialect %}
-{% /dialect-switcher %} 
+## Playground
+
+{% apiRenderer method="getAssetProofs" /%}

+ 4 - 19
src/pages/das-api/methods/get-asset-signatures.md

@@ -2,6 +2,7 @@
 title: Get Asset Signatures
 metaTitle: Get Asset Signatures | DAS API
 description: Returns the transaction signatures for compressed assets
+tableOfContents: false
 ---
 
 Returns the transaction signatures associated with a compressed asset. You can identify the asset either by its ID or by its tree and leaf index.
@@ -20,10 +21,8 @@ Returns the transaction signatures associated with a compressed asset. You can i
 | `cursor`        |          | The cursor of the signatures.               |
 | `sortDirection` |          | Sort direction. Can be either "asc" or "desc". |
 
-## Example
+## UMI w/ DAS SDK
 
-{% dialect-switcher title="getAssetSignatures Example" %}
-{% dialect title="JavaScript" id="js" %}
 {% totem %}
 
 ```js
@@ -44,21 +43,7 @@ console.log(assets);
 ```
 
 {% /totem %}
-{% /dialect %}
-{% dialect title="cURL" id="curl" %}
-{% totem %}
 
-```sh
-curl --request POST --url "<ENDPOINT>" --header 'Content-Type: application/json' --data '{
-    "jsonrpc": "2.0",
-    "method": "getAssetSignaturesV2",
-    "params": {
-        "id": "GGRbPQhwmo3dXBkJSAjMFc1QYTKGBt8qc11tTp3LkEKA"
-    },
-    "id": 0
-}'
-```
+## Playground
 
-{% /totem %}
-{% /dialect %}
-{% /dialect-switcher %} 
+{% apiRenderer method="getAssetSignatures" /%}

+ 4 - 19
src/pages/das-api/methods/get-asset.md

@@ -2,6 +2,7 @@
 title: Get Asset
 metaTitle: Get Asset | DAS API
 description: Returns the information of a compressed/standard asset
+tableOfContents: false
 ---
 
 Returns the information of a compressed/standard asset including metadata and owner.
@@ -12,10 +13,8 @@ Returns the information of a compressed/standard asset including metadata and ow
 | --------------- | :------: | ------------------------------------------ |
 | `id`            |    ✅    | The id of the asset.                       |
 
-## Example
+## UMI w/ DAS SDK
 
-{% dialect-switcher title="getAsset Example" %}
-{% dialect title="JavaScript" id="js" %}
 {% totem %}
 
 ```js
@@ -31,21 +30,7 @@ console.log(asset);
 ```
 
 {% /totem %}
-{% /dialect %}
-{% dialect title="cURL" id="curl" %}
-{% totem %}
 
-```sh
-curl --request POST --url "<ENDPOINT>" --header 'Content-Type: application/json' --data '{
-    "jsonrpc": "2.0",
-    "method": "getAsset",
-    "params": [
-      "8vw7tdLGE3FBjaetsJrZAarwsbc8UESsegiLyvWXxs5A"
-    ],
-    "id": 0
-}'
-```
+## Playground
 
-{% /totem %}
-{% /dialect %}
-{% /dialect-switcher %}
+{% apiRenderer method="getAsset" /%}

+ 6 - 22
src/pages/das-api/methods/get-asset-by-authority.md → src/pages/das-api/methods/get-assets-by-authority.md

@@ -1,7 +1,8 @@
 ---
-title: Get Asset By Authority
-metaTitle: Get Asset By Authority | DAS API
+title: Get Assets By Authority
+metaTitle: Get Assets By Authority | DAS API
 description: Returns the list of assets given an authority address
+tableOfContents: false
 ---
 
 Returns the list of assets given an authority address.
@@ -18,10 +19,8 @@ Returns the list of assets given an authority address.
 | `after`            |          | Retrieve assets after the specified ID.    |
 
 
-## Example
+## UMI w/ DAS SDK
 
-{% dialect-switcher title="getAssetByAuthority Example" %}
-{% dialect title="JavaScript" id="js" %}
 {% totem %}
 
 ```js
@@ -46,22 +45,7 @@ console.log(assets.items.length > 0);
 ```
 
 {% /totem %}
-{% /dialect %}
-{% dialect title="cURL" id="curl" %}
-{% totem %}
 
-```sh
-curl --request POST --url "<ENDPOINT>" --header 'Content-Type: application/json' --data '{
-    "jsonrpc": "2.0",
-    "method": "getAssetsByAuthority",
-    "params": {
-        "authorityAddress": "mRdta4rc2RtsxEUDYuvKLamMZAdW6qHcwuq866Skxxv",
-        "page": 1
-    },
-    "id": 0
-}'
-```
+## Playground
 
-{% /totem %}
-{% /dialect %}
-{% /dialect-switcher %}
+{% apiRenderer method="getAssetsByAuthority" /%}

+ 6 - 24
src/pages/das-api/methods/get-asset-by-creator.md → src/pages/das-api/methods/get-assets-by-creator.md

@@ -1,7 +1,8 @@
 ---
-title: Get Asset By Creator
-metaTitle: Get Asset By Creator | DAS API
+title: Get Assets By Creator
+metaTitle: Get Assets By Creator | DAS API
 description: Returns the list of assets given a creator address
+tableOfContents: false
 ---
 
 Return the list of assets given a creator address.
@@ -23,10 +24,8 @@ We recommend to fetch data with `onlyVerified: true` to make sure the asset actu
 | `after`            |          | Retrieve assets after the specified ID.    |
 
 
-## Example
+## UMI w/ DAS SDK
 
-{% dialect-switcher title="getAssetByCreator Example" %}
-{% dialect title="JavaScript" id="js" %}
 {% totem %}
 
 ```js
@@ -46,24 +45,7 @@ console.log(assets.items.length > 0);
 ```
 
 {% /totem %}
-{% /dialect %}
-{% dialect title="cURL" id="curl" %}
-{% totem %}
 
-```sh
-curl --request POST --url "<ENDPOINT>" --header 'Content-Type: application/json' --data '{
-    "jsonrpc": "2.0",
-    "method": "getAssetsByCreator",
-    "params": {
-        "creatorAddress": "D3XrkNZz6wx6cofot7Zohsf2KSsu2ArngNk8VqU9cTY3",
-        "onlyVerified": false,
-        "limit": 10,
-        "page": 1
-    },
-    "id": 0
-}'
-```
+## Playground
 
-{% /totem %}
-{% /dialect %}
-{% /dialect-switcher %}
+{% apiRenderer method="getAssetsByCreator" /%}

+ 6 - 23
src/pages/das-api/methods/get-asset-by-group.md → src/pages/das-api/methods/get-assets-by-group.md

@@ -1,7 +1,8 @@
 ---
-title: Get Asset By Group
-metaTitle: Get Asset By Group | DAS API
+title: Get Assets By Group
+metaTitle: Get Assets By Group | DAS API
 description: Return the list of assets given a group (key, value) pair
+tableOfContents: false
 ---
 
 Return the list of assets given a group (key, value) pair. For example this can be used to get all assets in a collection.
@@ -18,10 +19,8 @@ Return the list of assets given a group (key, value) pair. For example this can
 | `before`           |          | Retrieve assets before the specified ID.   |
 | `after`            |          | Retrieve assets after the specified ID.    |
 
-## Example
+## UMI w/ DAS SDK
 
-{% dialect-switcher title="getAssetByGroup Example" %}
-{% dialect title="JavaScript" id="js" %}
 {% totem %}
 
 ```js
@@ -39,23 +38,7 @@ console.log(assets.items.length > 0);
 ```
 
 {% /totem %}
-{% /dialect %}
-{% dialect title="cURL" id="curl" %}
-{% totem %}
 
-```sh
-curl --request POST --url "<ENDPOINT>" --header 'Content-Type: application/json' --data '{
-    "jsonrpc": "2.0",
-    "method": "getAssetsByGroup",
-    "params": {
-        "groupKey": "collection",
-        "groupValue": "J2ZfLdQsaZ3GCmbucJef3cPnPwGcgjDW1SSYtMdq3L9p",
-        "page": 1
-    },
-    "id": 0
-}'
-```
+## Playground
 
-{% /totem %}
-{% /dialect %}
-{% /dialect-switcher %}
+{% apiRenderer method="getAssetsByGroup" /%}

+ 6 - 23
src/pages/das-api/methods/get-asset-by-owner.md → src/pages/das-api/methods/get-assets-by-owner.md

@@ -1,7 +1,8 @@
 ---
-title: Get Asset By Owner
-metaTitle: Get Asset By Owner | DAS API
+title: Get Assets By Owner
+metaTitle: Get Assets By Owner | DAS API
 description: Return the list of assets given an owner address
+tableOfContents: false
 ---
 
 Return the list of assets given an owner address.
@@ -17,10 +18,8 @@ Return the list of assets given an owner address.
 | `before`           |          | Retrieve assets before the specified ID.   |
 | `after`            |          | Retrieve assets after the specified ID.    |
 
-## Example
+## UMI w/ DAS SDK
 
-{% dialect-switcher title="getAssetByOwner Example" %}
-{% dialect title="JavaScript" id="js" %}
 {% totem %}
 
 ```js
@@ -39,23 +38,7 @@ console.log(assets.items.length > 0);
 ```
 
 {% /totem %}
-{% /dialect %}
-{% dialect title="cURL" id="curl" %}
-{% totem %}
 
-```sh
-curl --request POST --url "<ENDPOINT>" --header 'Content-Type: application/json' --data '{
-    "jsonrpc": "2.0",
-    "method": "getAssetsByOwner",
-    "params": {
-        "ownerAddress": "N4f6zftYsuu4yT7icsjLwh4i6pB1zvvKbseHj2NmSQw",
-        "limit": 10,
-        "page": 1
-    },
-    "id": 0
-}'
-```
+## Playground
 
-{% /totem %}
-{% /dialect %}
-{% /dialect-switcher %}
+{% apiRenderer method="getAssetsByOwner" /%}

+ 15 - 33
src/pages/das-api/methods/get-assets.md

@@ -2,56 +2,38 @@
 title: Get Assets
 metaTitle: Get Assets | DAS API
 description: Returns the information of multiple compressed/standard assets
+tableOfContents: false
 ---
 
 Returns the information of multiple compressed/standard assets including their metadata and owners.
 
 ## Parameters
 
-| Name            | Required | Description                                |
-| --------------- | :------: | ------------------------------------------ |
-| `ids`           |    ✅    | An array of asset ids.                     |
+| Name  | Required | Description            |
+| ----- | :------: | ---------------------- |
+| `ids` |    ✅    | An array of asset ids. |
 
-## Example
+## UMI w/ DAS SDK
 
-{% dialect-switcher title="getAssets Example" %}
-{% dialect title="JavaScript" id="js" %}
 {% totem %}
 
 ```js
-import { publicKey } from '@metaplex-foundation/umi';
-import { createUmi } from '@metaplex-foundation/umi-bundle-defaults';
-import { dasApi } from '@metaplex-foundation/digital-asset-standard-api';
+import { publicKey } from '@metaplex-foundation/umi'
+import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
+import { dasApi } from '@metaplex-foundation/digital-asset-standard-api'
 
-const umi = createUmi('<ENDPOINT>').use(dasApi());
+const umi = createUmi('<ENDPOINT>').use(dasApi())
 const assetIds = [
   publicKey('GGRbPQhwmo3dXBkJSAjMFc1QYTKGBt8qc11tTp3LkEKA'),
-  publicKey('8bFQbnBrzeiYQabEJ1ghy5T7uFpqFzPjUGsVi3SzSMHB')
-];
+  publicKey('8bFQbnBrzeiYQabEJ1ghy5T7uFpqFzPjUGsVi3SzSMHB'),
+]
 
-const assets = await umi.rpc.getAssets(assetIds);
-console.log(assets);
+const assets = await umi.rpc.getAssets(assetIds)
+console.log(assets)
 ```
 
 {% /totem %}
-{% /dialect %}
-{% dialect title="cURL" id="curl" %}
-{% totem %}
 
-```sh
-curl --request POST --url "<ENDPOINT>" --header 'Content-Type: application/json' --data '{
-    "jsonrpc": "2.0",
-    "method": "getAssets",
-    "params": [
-      [
-        "GGRbPQhwmo3dXBkJSAjMFc1QYTKGBt8qc11tTp3LkEKA",
-        "8bFQbnBrzeiYQabEJ1ghy5T7uFpqFzPjUGsVi3SzSMHB"
-      ]
-    ],
-    "id": 0
-}'
-```
+## Playground
 
-{% /totem %}
-{% /dialect %}
-{% /dialect-switcher %} 
+{% apiRenderer method="getAssets" /%}

+ 4 - 22
src/pages/das-api/methods/search-assets.md

@@ -2,6 +2,7 @@
 title: Search Assets
 metaTitle: Search Assets | DAS API
 description: Return the list of assets given a search criteria
+tableOfContents: false
 ---
 
 Return the list of assets given a search criteria.
@@ -36,10 +37,8 @@ Return the list of assets given a search criteria.
 | `after`             |          | Retrieve assets after the specified ID.    |
 | `jsonUri`           |          | The value for the JSON URI.  |
 
-## Example
+## UMI w/ DAS SDK
 
-{% dialect-switcher title="searchAssets Example" %}
-{% dialect title="JavaScript" id="js" %}
 {% totem %}
 
 ```js
@@ -55,25 +54,8 @@ const assets = await umi.rpc.searchAssets({
 });
 console.log(assets.items.length == 1);
 ```
-
 {% /totem %}
-{% /dialect %}
-{% dialect title="cURL" id="curl" %}
-{% totem %}
 
-```sh
-curl --request POST --url "<ENDPOINT>" --header 'Content-Type: application/json' --data '{
-    "jsonrpc": "2.0",
-    "method": "searchAssets",
-    "params": {
-        "ownerAddress": "N4f6zftYsuu4yT7icsjLwh4i6pB1zvvKbseHj2NmSQw",
-        "jsonUri": "https://arweave.net/c9aGs5fOk7gD4wWnSvmzeqgtfxAGRgtI1jYzvl8-IVs/chiaki-violet-azure-common.json",
-        "page": 1
-    },
-    "id": 0
-}'
-```
+## Playground
 
-{% /totem %}
-{% /dialect %}
-{% /dialect-switcher %}
+{% apiRenderer method="searchAssets" /%}

+ 1 - 1
src/shared/usePage.js

@@ -21,7 +21,7 @@ export function usePage(pageProps) {
     activeHero,
     activeSection,
     isIndexPage: product?.path ? pathname === `/${product.path}` : false,
-    tableOfContents: pageProps.markdoc?.content
+    tableOfContents: pageProps.markdoc?.frontmatter.tableOfContents != false && pageProps.markdoc?.content
       ? parseTableOfContents(pageProps.markdoc.content)
       : [],
   }