0.0.13 • Published 1 year ago

chain-query-rest-api v0.0.13

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Getting started

npm i @nirvanalabs/chain-query-sdk

How to use the react hooks after installing the package

import { useContractMetadata } from "@nirvanalabs/chain-query-sdk";

function App() {
  const address = "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d";
  const apiKey = 'your-api-key-here'; // This API key is optional
  const request = {
    address: address,
    apiKey: apiKey
  }

  const { data , error, loading } = useContractMetadata(request);

  if (loading) return(<div>Loading</div>);

  if (error) return(<div>Error occured ${error.message}</div>);

  return (
    <div className="App">
      {
        data.map((d, index) => {
          return(<h1 key={index}>{d.address}</h1>)
        })
      }
    </div>
  );
}

export default App;

Full list of supported React hooks

Please refer https://docs.nirvanalabs.io/docs-chain-query for more REST APIs.

  • useContractMetadata(): Retrieve the contract level metadata for a given address
  • useContractTxns(): Get all transfers of NFTs for a given contract address
  • useContractOwners(): Retrieves all owners within a given contract address
  • useContractStatistics(): Retrieve stats about an NFT collection such as sales floor price, volume, token supply etc.
  • useContractSearch(): Retrieves all owners within a given contract address Search by contract name, address & symbol
  • useAllNftContracts(): Retrieves all tokens in a contract & metadata
  • useLatestTransactions(): Gets the transfer of the tokens matching the given address
  • useLatestTransferTransactionByAddress(): Get all transfers of NFTs for a given contract address
  • useTransferGetFromtoBlock(): Gets transfers of the tokens from_block -> to_block OR from_date -> to_date
  • useTransactionByHash(): Gets Latest NFT Txns BY HASH
  • useTokenNews(): Retrieves all news related to a key word for Tokens or NFTs.
0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

1.0.0

1 year ago