Skip to content

Database structure

Artem Poltorzhitskiy edited this page Apr 19, 2023 · 2 revisions

Database documentation

erc20
Name Type Description
id bigint Unique internal identity
deploy_height bigint Block height when token was deployed
deploy_time timestamp with time zone Time of block when token was deployed
contract_id bigint Token contract id
name text Token name
symbol text Token symbol
decimals bigint Token decimals
erc721
Name Type Description
id bigint Unique internal identity
deploy_height bigint Block height when token was deployed
deploy_time timestamp with time zone Time of block when token was deployed
contract_id bigint Token contract id
name text Token name
symbol text Token symbol
owner_id bigint Token owner id
fee
Name Type Description
id bigint Unique internal identity
height bigint Block height
time timestamp with time zone Time of block
contract_id bigint Contract address id
caller_id bigint Caller address id
class_id bigint Class id
invoke_id bigint Parent invoke id
declare_id bigint Parent declare id
deploy_id bigint Parent deploy id
deploy_account_id bigint Parent deploy account id
l1_handler_id bigint Parent l1 handler id
entrypoint_type smallint Entrypoint type (unknown - 1
call_type smallint Call type (unknwown - 1
status smallint Status in blockchain (unknown - 1
selector bytea Called selector
entrypoint text Entrypoint name
calldata ARRAY Raw calldata
result ARRAY Raw result
parsed_calldata jsonb Calldata parsed according to contract ABI
transfer
Name Type Description
id bigint Unique internal identity
height bigint Block height
time timestamp with time zone Block time
contract_id bigint Token contract id
from_id bigint Id address which transfer from
to_id bigint Id address which transfer to
amount numeric Amount of transfer
token_id numeric Id token which was transferred
invoke_id bigint Parent invoke id
declare_id bigint Parent declare id
deploy_id bigint Parent deploy id
deploy_account_id bigint Parent deploy account id
l1_handler_id bigint Parent l1 handler id
fee_id bigint Parent fee invocation id
internal_id bigint Parent internal transaction id
declare
Name Type Description
id bigint Unique internal identity
height bigint Block height
class_id bigint Declared class id
version bigint Declare transaction version
position bigint Order in block
sender_id bigint Sender address id
contract_id bigint Contract address id
time timestamp with time zone Time of block
status bigint Status of block
hash bytea Transaction hash
max_fee numeric The maximum fee that the sender is willing to pay for the transaction
nonce numeric The transaction nonce
event
Name Type Description
id bigint Unique internal identity
height bigint Block height
time timestamp with time zone Time of block
declare_id bigint Parent declare id
deploy_id bigint Parent deploy id
deploy_account_id bigint Parent deploy account id
invoke_id bigint Parent invoke id
l1_handler_id bigint Parent l1 handler id
fee_id bigint Parent fee invocation id
internal_id bigint Parent internal transaction id
order bigint Order in block
contract_id bigint Contract address id
from_id bigint From address id
keys ARRAY Raw event keys
data ARRAY Raw event data
name text Event name
parsed_data jsonb Event data parsed according to contract ABI
deploy_account
Name Type Description
id bigint Unique internal identity
height bigint Block height
class_id bigint Class id
contract_id bigint Contract address id
position bigint Order in block
time timestamp with time zone Time of block
status bigint
hash bytea Transaction hash
contract_address_salt bytea A random salt that determines the account address
max_fee numeric The maximum fee that the sender is willing to pay for the transaction
nonce numeric The transaction nonce
constructor_calldata ARRAY Raw constructor calldata
parsed_calldata jsonb Calldata parsed according to contract ABI
erc1155
Name Type Description
id bigint Unique internal identity
deploy_height bigint Block height when token was deployed
deploy_time timestamp with time zone Time of block when token was deployed
contract_id bigint Token contract id
token_uri text Token uri
owner_id bigint Token owner id
invoke
Name Type Description
id bigint Unique internal identity
height bigint Block height
time timestamp with time zone Time of block
status bigint Status in blockchain (unknown - 1
hash bytea Transaction hash
version bigint Version of invoke transaction
position bigint Order in block
contract_id bigint Contract address id
entrypoint_selector bytea Called selector
entrypoint text Entrypoint name
max_fee numeric The maximum fee that the sender is willing to pay for the transaction
nonce numeric The transaction nonce
call_data ARRAY Raw calldata
parsed_calldata jsonb Calldata parsed according to contract ABI
l1_handler
Name Type Description
id bigint Unique internal identity
height bigint Block height
time timestamp with time zone Time of block
status bigint Status in blockchain (unknown - 1
hash bytea Transaction hash
contract_id bigint Contract address id
position bigint Order in block
selector bytea Called selector
entrypoint text Entrypoint name
max_fee numeric The maximum fee that the sender is willing to pay for the transaction
nonce numeric The transaction nonce
call_data ARRAY Raw calldata
parsed_calldata jsonb Calldata parsed according to contract ABI
address
Name Type Description
id bigint Unique internal identity
class_id bigint Class identity. It is NULL for ethereum addresses.
height bigint Block number of the first address occurrence.
hash bytea Address hash.
block
Name Type Description
id bigint Unique internal identity
height bigint The number (height) of this block
time timestamp with time zone The time the sequencer created this block before executing transactions
version text The version of the Starknet protocol used when creating this block
tx_count bigint Transactions count in block
invoke_count bigint Ivokes count in block
declare_count bigint Declares count in block
deploy_count bigint Deploys count in block
deploy_account_count bigint Deploy accounts count in block
l1_handler_count bigint L1 handlers count in block
storage_diff_count bigint Storage diffs count in block
status bigint Block status
hash bytea Block hash
parent_hash bytea The hash of this block’s parent
new_root bytea The state commitment after this block
sequencer_address bytea The Starknet address of the sequencer who created this block
class
Name Type Description
id bigint Unique internal identity
type bigint Class type. It’s a binary mask.
hash bytea Class hash
abi bytea Class abi in a raw
height bigint Block height of the first class occurance
cairo smallint Cairo version of class
deploy
Name Type Description
id bigint Unique internal identity
height bigint Block height
class_id bigint Class id
contract_id bigint Contract address id
position bigint Order in block
time timestamp with time zone Time of block
status bigint
hash bytea Transaction hash
contract_address_salt bytea A random salt that determines the account address
constructor_calldata ARRAY Raw constructor calldata
parsed_calldata jsonb Calldata parsed according to contract ABI
storage_diff
Name Type Description
id bigint Unique internal identity
height bigint Block height
contract_id bigint Contract id which storage was changed
key bytea Storage key
value bytea Data
token_balance
Name Type Description
owner_id bigint Identity of owner address
contract_id bigint Identity of contract address
token_id numeric Token id
balance numeric Token balance
internal_tx
Name Type Description
id bigint Unique internal identity
height bigint Block height
time timestamp with time zone Time of block
declare_id bigint Parent declare id
deploy_id bigint Parent deploy id
deploy_account_id bigint Parent deploy account id
invoke_id bigint Parent invoke id
l1_handler_id bigint Parent l1 handler id
internal_id bigint Parent internal transaction id
class_id bigint Class id
caller_id bigint Caller address id
contract_id bigint Contract address id
status smallint Status in blockchain (unknown - 1
entrypoint_type smallint Entrypoint type (unknown - 1
call_type smallint Call type (unknwown - 1
hash bytea Transaction hash
selector bytea Called selector
entrypoint text Entrypoint name
result ARRAY Raw result
calldata ARRAY Raw calldata
parsed_calldata jsonb Calldata parsed according to contract ABI
parsed_result jsonb Result parsed according to contract ABI
message
Name Type Description
id bigint Unique internal identity
height bigint Block height
time timestamp with time zone Time of block
declare_id bigint Parent declare id
deploy_id bigint Parent deploy id
deploy_account_id bigint Parent deploy account id
invoke_id bigint Parent invoke id
l1_handler_id bigint Parent l1 handler id
fee_id bigint Parent fee invocation id
internal_id bigint Parent internal transaction id
contract_id bigint Contract address id
order bigint Order in block
from_id bigint From address id
to_id bigint To address id
selector text Called selector
nonce numeric The transaction nonce
payload ARRAY Message payload
proxy
Name Type Description
id bigint Unique internal identity
contract_id bigint Proxy contract id
hash bytea Proxy contract hash
selector bytea Proxy contract selector (for modules)
entity_type smallint Entity type behind proxy (0 - class
entity_id bigint Entity id behind proxy
entity_hash bytea Entity hash behind proxy
state
Name Type Description
id bigint Unique internal identity
name text
last_height bigint Last block height
last_time timestamp with time zone Time of last block
invokes_count bigint Total invokes count
deploys_count bigint Total deploys count
deploy_accounts_count bigint Total deploy accounts count
declares_count bigint Total declares count
l1_handlers_count bigint Total l1 handlers count
tx_count bigint Total transactions count
last_class_id bigint Last internal class id
last_address_id bigint Last internal address id
last_tx_id bigint Last internal transaction id
last_event_id bigint Last internal event id
Clone this wiki locally