npm i @nirvanalabs/chain-query-sdk
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;
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.