Skip to main content
POST
starknet_getClassHashAt
Starknet OpenRPC specFor the latest version of the publicly maintained OpenRPC spec, see the Starknet specs GitHub repo.
Starknet API method that returns the hash of the class at a given address. It provides the hash of the class at the specified address. This can be useful for verifying the type of contract deployed at a given address.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • block_id — the hash of the requested block, or number (height) of the requested block, or a block tag:
    • latest — the latest Starknet block finalized by consensus on L2.
    • pre_confirmed — the block that the block proposer is building at height latest + 1.
    • l1_accepted — the latest Starknet block included in a state update on L1 and finalized by consensus on L1.
    The Ethereum tags safe, finalized, and earliest aren’t valid on Starknet. JSON-RPC API version 0.9 replaced the pending tag with pre_confirmed.
  • contract_address — the address of the contract.

Response

  • result — the hash of the class at the given address, represented as a hexadecimal string.

Use case

A practical use case for starknet_getClassHashAt is to verify the type of contract deployed at a given address. This can be useful for developers to ensure that the correct contract has been deployed at the expected address.

Body

application/json
id
integer
default:1
jsonrpc
string
default:2.0
method
string
default:starknet_getClassHashAt
params
(object | string)[]

Response

200

Successful response

Last modified on November 13, 2026