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

Parameters

block_id
string
REQUIRED

The hash of the requested block, the block number (height) of the requested block, or a block tag (latest, pre_confirmed, or l1_accepted)

contract_address
string
REQUIRED

The address of the contract whose class definition will be returned

Returns

result
object

The result object which contains one of the following objects

DEPRECATED_CONTRACT_CLASS
object

(Optional) 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

function_idx
string

An integer index of the function

selector
string

A unique identifier of the entry point (function) in the program

EXTERNAL
object

Deprecated external

function_idx
string

An integer index of the function

selector
string

A unique identifier of the entry point (function) in the program

L1_HANDLER
object

Deprecated L1 handler

function_idx
string

An integer index of the function

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

(Optional)

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
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free