Starknet

On-chain Data Sources for Starknet

Some Starknet Data Sources convert between Cairo and Gate types. To assist in the conversion they receive a signature as a parameter, which includes info about the expected Cairo types, and will be converted to Gate types in the following way -

Cairo Type
Gate Type

felt / felt252 / u8 / u16 /u32 / u64 / u128 / u256 / u512 / usize / ContractAddress / address / ClassHash /

integer

bool

boolean

tuple

tuple

named tuple / struct

tuple

Array

list

StarknetCall

Name: StarknetCall

Type: varies

Calls a function and gets the return value.

The type of this source and it's parameters are determined by the signature provided. See the Example tab for more info.

Use the generics syntax to specify the type of the returned object. This type must be compatible with the Cairo type in the signature, as described above. Additionally, felt types can be converted to string for convenience.

StarknetEvents

Name: StarknetEvents

Type: list<tuple<varies>>

Get the parameters of all events with a specific signature emitted by a contract in the evaluated block.

The type of this source depends on the signature of the event. See the Example tab for more information.

StarknetCalls

Name: StarknetCalls

Type: list<tuple<varies>>

Get the arguments of all function calls with a specific signature to a contract in the evaluated block

The type of this source depends on the signature of the event. See the Example tab for more information.

Last updated