Skip to main content

starknet_getClassAt RPC Method

Get the contract class definition in the given block at the given address.

Updated on
Mar 18, 2024

starknet_getClassAt RPC Method

Parameters

block_id
string
REQUIRED
The hash of the requested block, the block number (height) of the requested block, or a block tag (latest or pending)
contract_address
string
REQUIRED
The address of the contract whose class definition will be returned

Returns

result
string
The result object which contains one of the following objects
DEPRECATED_CONTRACT_CLASS
object
The definition of a StarkNet contract class
program
string
A base64 representation of the compressed program code
entry_points_by_type
object
Deprecated entry points by type
CONSTRUCTOR
object
Deprecated constructor
offset
string
The offset of the entry point in the program
selector
string
A unique identifier of the entry point (function) in the program
EXTERNAL
object
Deprecated external
offset
string
The offset of the entry point in the program
selector
string
A unique identifier of the entry point (function) in the program
L1_HANDLER
object
Deprecated L1 handler
offset
string
The offset of the entry point in the program
selector
string
A unique identifier of the entry point (function) in the program
abi
array
The contract ABI which contains one of the following objects:
FUNCTION_ABI_ENTRY
object
The function ABI entry object whicb contains the following fields:
type
string
The function ABI type. It can take value such as - 'function', 'l1_handler' or 'constructor'
name
string
The function name
inputs
array
The typed parameter, which have following fields:
name
string
The parameter's name
type
string
The parameter's type
outputs
array
The typed parameter, which have following fields:
name
string
The parameter's name
type
string
The parameter's type
stateMutability
string
The Function state mutability type which can take value as - view'
EVENT_ABI_ENTRY
object
The Event ABI entry object which contains the following fields:
type
string
The Event ABI type. It can take value such as - 'function', 'l1_handler' or 'constructor'
name
string
The event name
keys
array
The Typed parameter
name
string
The parameter's name
type
string
The parameter's type
data
array
The Typed parameter
name
string
The parameter's name
type
string
The parameter's type
STRUCT_ABI_ENTRY
object
The Struct ABI entry object which contains the following fields:
type
string
The Struct ABI type. It can take value such as - 'struct'
name
string
The struct name
size
integer
The size
members
array
The Typed parameter
name
string
The parameter's name
type
string
The parameter's type
Offset
integer
The offset of this property within the struct
CONTRACT_CLASS
object
sierra_program
object
The list of Sierra instructions of which the program consists
contract_class_version
string
The version of the contract class object. Currently, the Starknet OS supports version 0.1.0
entry_points_by_type
object
Deprecated entry points by type
CONSTRUCTOR
object
The sierra entry point
selector
string
A unique identifier of the entry point (function) in the program
function_idx
string
The index of the function in the program
EXTERNAL
object
Deprecated external
selector
string
A unique identifier of the entry point (function) in the program
function_idx
string
The index of the function in the program
L1_HANDLER
object
Deprecated L1 handler
selector
string
A unique identifier of the entry point (function) in the program
function_idx
string
The index of the function in the program
abi
string
The class ABI, as supplied by the user declaring the class
Request
1
curl --location 'https://docs-demo.strk-mainnet.quiknode.pro/' \
2
--header 'accept: application/json' \
3
--header 'content-type: application/json' \
4
--data '{
5
"id": 1,
6
"jsonrpc": "2.0",
7
"method": "starknet_getClassAt",
8
"params": [
9
"latest",
10
"0x066733193503019e4e9472f598ff32f15951a0ddb8fb5001f0beaa8bd1fb6840"
11
]
12
}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free