curl --request POST \
--url https://starknet-mainnet.core.chainstack.com/365cf697a3ad6d950b4c4a911e2e4f4d \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "starknet_getClassHashAt",
"params": [
{
"block_number": 385940
},
"0x073314940630fd6dcda0d772d4c972c4e0a9946bef9dabf4ef84eda8ef542b82"
]
}'
starknet_getClassHashAt
curl --request POST \
--url https://starknet-mainnet.core.chainstack.com/365cf697a3ad6d950b4c4a911e2e4f4d \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "starknet_getClassHashAt",
"params": [
{
"block_number": 385940
},
"0x073314940630fd6dcda0d772d4c972c4e0a9946bef9dabf4ef84eda8ef542b82"
]
}'
address
— the address of the contract.
block_id
— the hash of the requested block, or number (height) of the requested block, or a block tag:
latest
— the most recent block in the blockchain and the current state of the blockchain at the most recent block. A chain reorganization is to be expected.safe
— the block that received justification from the beacon chain. Although this block could be involved in a chain reorganization, it would necessitate either a coordinated attack by the majority of validators or an instance of severe propagation latency.finalized
— the block accepted as canonical by more than 2/3 of the validators. A chain reorganization is extremely unlikely, and it would require at least 1/3 of the staked ETH to be burned.earliest
— the earliest available or genesis blockpending
— the pending state and transactions block. The current state of transactions that have been broadcast to the network but have not yet been included in a block.result
— the hash of the class at the given address, represented as a hexadecimal string.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.
curl 'https://alpha-mainnet.starknet.io/feeder_gateway/get_class_hash_at?contractAddress=0x073314940630fd6dcda0d772d4c972c4e0a9946bef9dabf4ef84eda8ef542b82'
Successful response