Block Hash
GET /v2/blocks/{round}/hash
Get the block hash for the block on the given round.
Properties
| Name | Type | Description |
|---|---|---|
| round* | string | The round from which to fetch block hash information. |
* indicates required property
Packages
Node.js
Install
npm install algosdk --saveUsage
import { Algodv2 } from "algosdk";
const data = {round: 1}const client = new Algodv2( "", "https://testnet-api.algonode.cloud", 443 );const result = await client.getBlockHash(data.round).do(); Algosdk Documentation Learn more at the official documentation for algosdk
Coming Soon!
Algokit Documentation Learn more at the official documentation for algokit
import { AlgodClient } from '@awesome-algorand/algod-fetch';
const data = {round: 1}const client = new AlgodClient();const result = await client.public.getBlockHash(data); Algo-fetch Documentation Learn more at the experimental documentation for algo-fetch
React
Install
npm install @awesome-algorand/react-query @txnlab/use-wallet-react @tanstack/react-query algosdk --saveUsage
import { useBlockHash } from '@awesome-algorand/react-query';
export function BlockInformationViewer() { const data = {round: 1} const query = useBlockHash(data);} Tutorial Learn how to use the useBlockHash hook in a React application.
Install
npm install @awesome-algorand/query-core @txnlab/use-wallet-react @tanstack/react-query algosdk --saveUsage
import { useQuery } from 'react-query';import { getBlockHash } from '@awesome-algorand/query-core';import { useWallet } from "@txnlab/use-wallet-react";
export function BlockInformationViewer() { const walletManager = useWallet(); const data = {round: 1} const query = useQuery(getBlockHash(data));} Svelte [WIP]
Coming Soon!
Solid [WIP]
Coming Soon!
Vue [WIP]
Coming Soon!
Angular [WIP]
Coming Soon!