Skip to content
Mitra/ labUnaudited · testnet

009 /Lab

CodeCard

White code card with window dots and a RUN button.

RUN here really calls the public testnet RPC (read-only, no wallet) and prints the chain ID and latest block. On the home page the card will show the actual contract call.

testnet · read only
Fetch the latest block number from Robinhood Chain testnet
// Read-only call to Robinhood Chain testnet
const res = await fetch(RPC_URL, {
  method: "POST",
  body: JSON.stringify({
    jsonrpc: "2.0", id: 1,
    method: "eth_blockNumber", params: [],
  }),
});

Props

PropTypeDefaultDescription
codestring–Source shown in the card.
titlestring–Accessible name (figcaption).
labelstring–Top-right tag.
onRun() => Promise<string>–Must be a real action. Omit and there is no RUN button.
runLabelstringRunButton label.