Docs

starknet_getClass - Get the contract class...

Get the contract class definition in the given block associated with the given hash

Get the contract class definition in the given block associated with the given hash

Request Parameters

Request
block_idstring

Block reference ("latest", "l1_accepted", block hash, or block number)

class_hashfelt252

Class hash

Response Body

Response
resultOBJECT

The contract class, if found Contract class definition with Sierra program, entry points, and ABI

Errors

CodeMessage
24Block not found
28Class hash not found

Examples

Bash
curl -X POST https://api-starknet-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "starknet_getClass",
    "params": [
      "latest",
      "0x7f3777c99f3700505ea966676aac4a0d692c2a9f5e667f4c606b51ca1dd3420"
    ],
    "id": 1
  }'

On this page