Skip to content
Logo

useNodeInfo

Fetches the chain ID, the semantic node version and the blockchain block tag the node reads the base layer at, in a single call.

It replaces useChainId and useNodeVersion, which are both deprecated.

Usage

import {  } from "@cartesi/react";
 
function () {
  const { ,  } = ();
  const { , ,  } =  || {};
  // render logic
}

Return Type

The data is a NodeInfo:

import type { ,  } from "@cartesi/client";