1
0
mirror of https://github.com/oceanprotocol/react.git synced 2025-02-14 21:10:38 +01:00
react/src/hooks/useMetadata
..
2020-04-27 10:34:22 +02:00
2020-05-19 18:26:26 +02:00
2020-05-11 18:43:02 +03:00

useMetadata

Get metadata for a specific data asset.

Usage

import React from 'react'
import { useMetadata } from '@oceanprotocol/react'

const did = 'did:op:0x000000000'

export default function MyComponent() {
  // Get metadata for this asset
  const { title, metadata } = useMetadata(did)

  const { main, additionalInformation } = metadata

  return (
    <div>
      <h1>{title}</h1>
      <p>Price: {main.price}</p>
    </div>
  )
}