starknet_getClass 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)
class_hash
string
REQUIRED
The hash of the requested contract class
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
1curl --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_getClass",8"params": [9"latest",10"0x05327164fa21dca89a92e8eae8a5b7ab90f58373e71f0a16d285e5a4abe5a3cf"11]12}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free