Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - Variables
 - type Address
 - type AddressFilter
 - type BetweenFilter
 - type Block
 - type Bytes
 - type BytesFilter
 - type CallType
 - type Class
 - type ClassReplace
 - type ClassType
 - type CopiableModel
 - type Countable
 - type Declare
 - type DeclareFilter
 - type Deploy
 - type DeployAccount
 - type DeployAccountFilter
 - type DeployFilter
 - type DeployedContract
 - type EntityType
 - type EntrypointType
 - type EnumFilter
 - type EnumStringFilter
 - type EqualityFilter
 - type Event
 - type EventFilter
 - type Fee
 - type FeeFilter
 - type FilterOption
 - func WithAscSortByIdFilter() FilterOption
 - func WithCursor(id uint64) FilterOption
 - func WithDescSortByIdFilter() FilterOption
 - func WithLimitFilter(limit int) FilterOption
 - func WithMaxHeight(height uint64, columnName string) FilterOption
 - func WithMultiSort(fields ...string) FilterOption
 - func WithOffsetFilter(offset int) FilterOption
 - func WithSortFilter(field string, order storage.SortOrder) FilterOption
 
- type FilterOptions
 - type Filterable
 - type HashByHeight
 - type Heightable
 - type IAddress
 - type IBlock
 - type IClass
 - type IClassReplace
 - type IDeclare
 - type IDeploy
 - type IDeployAccount
 - type IEvent
 - type IFee
 - type IInternal
 - type IInvoke
 - type IL1Handler
 - type IMessage
 - type IProxy
 - type IProxyUpgrade
 - type IState
 - type IStorageDiff
 - type IToken
 - type ITokenBalance
 - type ITransfer
 - type IdFilter
 - type IntegerFilter
 - type Internal
 - type InternalFilter
 - type Invoke
 - type InvokeFilter
 - type L1Handler
 - type L1HandlerFilter
 - type Message
 - type MessageFilter
 - type Proxy
 - type ProxyAction
 - type ProxyUpgrade
 - type Rollback
 - type State
 - type Status
 - type StorageDiff
 - type StorageDiffFilter
 - type StringFilter
 - type TimeFilter
 - type Token
 - type TokenBalance
 - type TokenBalanceFilter
 - type TokenFilter
 - type TokenType
 - type TransactionType
 - type Transfer
 - type TransferFilter
 
Constants ¶
const ( EntityTypeClass = iota EntityTypeContract )
entity types
const (
	Unknown = "UNKNOWN"
)
    unknown
Variables ¶
var Models = []storage.Model{ &State{}, &Address{}, &Class{}, &ClassReplace{}, &StorageDiff{}, &Block{}, &Invoke{}, &Declare{}, &Deploy{}, &DeployAccount{}, &L1Handler{}, &Internal{}, &Event{}, &Message{}, &Transfer{}, &Fee{}, &Token{}, &TokenBalance{}, &ProxyUpgrade{}, &Proxy{}, }
Models - list all models
var ModelsAny = []any{ &State{}, &Address{}, &Class{}, &ClassReplace{}, &StorageDiff{}, &Block{}, &Invoke{}, &Declare{}, &Deploy{}, &DeployAccount{}, &L1Handler{}, &Internal{}, &Event{}, &Message{}, &Transfer{}, &Fee{}, &Token{}, &TokenBalance{}, &ProxyUpgrade{}, &Proxy{}, }
ModelsAny - list all models with any type
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
	bun.BaseModel `bun:"address" comment:"Table with starknet and ethereum addresses."`
	ID      uint64    `bun:"id,type:bigint,pk,notnull" comment:"Unique internal identity"`
	ClassID *uint64   `bun:"class_id" comment:"Class identity. It is NULL for ethereum addresses."`
	Height  uint64    `comment:"Block number of the first address occurrence."`
	Hash    types.Hex `bun:",unique:address_hash" comment:"Address hash."`
	Class Class `bun:"rel:belongs-to,join:class_id=id" hasura:"table:class,field:class_id,remote_field:id,type:oto,name:class"`
}
    Address -
type AddressFilter ¶
type AddressFilter struct {
	ID           IntegerFilter
	Height       IntegerFilter
	OnlyStarknet bool
}
    AddressFilter -
type Block ¶
type Block struct {
	bun.BaseModel `bun:"block" comment:"Block table"`
	ID      uint64    `bun:",pk,autoincrement" comment:"Unique internal identity"`
	Height  uint64    `comment:"The number (height) of this block"`
	Time    time.Time `comment:"The time the sequencer created this block before executing transactions"`
	Version *string   `comment:"The version of the Starknet protocol used when creating this block"`
	TxCount            int `comment:"Transactions count in block"`
	InvokeCount        int `comment:"Invokes count in block"`
	DeclareCount       int `comment:"Declares count in block"`
	DeployCount        int `comment:"Deploys count in block"`
	DeployAccountCount int `comment:"Deploy accounts count in block"`
	L1HandlerCount     int `bun:"l1_handler_count" comment:"L1 handlers count in block"`
	StorageDiffCount   int `comment:"Storage diffs count in block"`
	Status           Status    `comment:"Block status"`
	Hash             types.Hex `comment:"Block hash"`
	ParentHash       types.Hex `comment:"The hash of this block’s parent"`
	NewRoot          types.Hex `comment:"The state commitment after this block"`
	SequencerAddress types.Hex `comment:"The Starknet address of the sequencer who created this block"`
	Invoke        []Invoke        `bun:"rel:has-many"`
	Declare       []Declare       `bun:"rel:has-many"`
	Deploy        []Deploy        `bun:"rel:has-many"`
	DeployAccount []DeployAccount `bun:"rel:has-many"`
	L1Handler     []L1Handler     `bun:"rel:has-many"`
	Fee           []Fee           `bun:"rel:has-many"`
	StorageDiffs  []StorageDiff   `bun:"rel:has-many"`
}
    Block -
type Bytes ¶
type Bytes stdJSON.RawMessage
Bytes -
func (Bytes) MarshalJSON ¶
MarshalJSON returns b as the JSON encoding of b.
func (*Bytes) UnmarshalJSON ¶
UnmarshalJSON sets *b to a copy of data.
func (*Bytes) UnmarshalYAML ¶
Implements the Unmarshaler interface of the yaml pkg.
type Class ¶
type Class struct {
	bun.BaseModel `bun:"class" comment:"Classes table"`
	ID     uint64    `bun:"id,type:bigint,pk,notnull,nullzero" comment:"Unique internal identity"`
	Type   ClassType `comment:"Class type. It’s a binary mask."`
	Hash   []byte    `bun:",unique:class_hash" comment:"Class hash"`
	Abi    Bytes     `bun:",type:bytea" comment:"Class abi in a raw"`
	Height uint64    `comment:"Block height of the first class occurance"`
	Cairo  int       `bun:",default:0,type:SMALLINT" comment:"Cairo version of class"`
}
    Class -
type ClassReplace ¶
type ClassReplace struct {
	bun.BaseModel `bun:"class_replace" comment:"Table with class replace history"`
	ID          uint64 `bun:"id,pk,notnull,autoincrement" comment:"Unique internal identity"`
	ContractId  uint64 `bun:"contract_id"                 comment:"Contract id"`
	PrevClassId uint64 `bun:"prev_class_id"               comment:"Previous class id"`
	NextClassId uint64 `bun:"next_class_id"               comment:"Next class id"`
	Height      uint64 `bun:"height"                      comment:"Block height"`
	Contract  Address `bun:"rel:belongs-to" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
	PrevClass Class   `bun:"rel:belongs-to,join:prev_class_id=id" hasura:"table:class,field:prev_class_id,remote_field:id,type:oto,name:prev_class"`
	NextClass Class   `bun:"rel:belongs-to,join:next_class_id=id" hasura:"table:class,field:next_class_id,remote_field:id,type:oto,name:next_class"`
}
    ClassReplace -
type ClassType ¶
type ClassType uint64
ClassType -
type CopiableModel ¶
CopiableModel -
type Declare ¶
type Declare struct {
	bun.BaseModel `bun:"declare" comment:"Table with declare transactions" partition:"RANGE(time)"`
	ID         uint64          `bun:"id,type:bigint,pk,notnull,nullzero" comment:"Unique internal identity"`
	Height     uint64          `comment:"Block height"`
	ClassID    uint64          `comment:"Declared class id"`
	Version    uint64          `comment:"Declare transaction version"`
	Position   int             `comment:"Order in block"`
	SenderID   *uint64         `comment:"Sender address id"`
	ContractID *uint64         `comment:"Contract address id"`
	Time       time.Time       `bun:",pk" comment:"Time of block"`
	Status     Status          `comment:"Status of block"`
	Hash       types.Hex       `comment:"Transaction hash"`
	MaxFee     decimal.Decimal `bun:",type:numeric" comment:"The maximum fee that the sender is willing to pay for the transaction"`
	Nonce      decimal.Decimal `bun:",type:numeric" comment:"The transaction nonce"`
	Error      *string         `bun:"error" comment:"Reverted error"`
	Class     Class      `bun:"rel:belongs-to" hasura:"table:class,field:class_id,remote_field:id,type:oto,name:class"`
	Sender    Address    `bun:"rel:belongs-to" hasura:"table:address,field:sender_id,remote_field:id,type:oto,name:sender"`
	Contract  Address    `bun:"rel:belongs-to" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
	Internals []Internal `bun:"rel:has-many"`
	Messages  []Message  `bun:"rel:has-many"`
	Events    []Event    `bun:"rel:has-many"`
	Transfers []Transfer `bun:"rel:has-many"`
	Fee       *Fee       `bun:"rel:belongs-to"`
}
    Declare -
type DeclareFilter ¶
type DeclareFilter struct {
	ID      IntegerFilter
	Height  IntegerFilter
	Time    TimeFilter
	Hash    BytesFilter
	Status  EnumFilter
	Version EnumFilter
}
    DeclareFilter -
type Deploy ¶
type Deploy struct {
	bun.BaseModel `bun:"deploy" comment:"Table with deploy transactions" partition:"RANGE(time)"`
	ID                  uint64         `bun:"id,type:bigint,pk,notnull" comment:"Unique internal identity"`
	Height              uint64         `comment:"Block height"`
	ClassID             uint64         `comment:"Class id"`
	ContractID          uint64         `comment:"Contract address id"`
	Position            int            `comment:"Order in block"`
	Time                time.Time      `bun:",pk" comment:"Time of block"`
	Status              Status         ``
	Hash                types.Hex      `comment:"Transaction hash"`
	ContractAddressSalt types.Hex      `comment:"A random salt that determines the account address"`
	ConstructorCalldata []string       `bun:",array" comment:"Raw constructor calldata"`
	ParsedCalldata      map[string]any `bun:",nullzero" comment:"Calldata parsed according to contract ABI"`
	Error               *string        `bun:"error" comment:"Reverted error"`
	Class     Class      `bun:"rel:belongs-to" hasura:"table:class,field:class_id,remote_field:id,type:oto,name:class"`
	Contract  Address    `bun:"rel:belongs-to" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
	Internals []Internal `bun:"rel:has-many"`
	Messages  []Message  `bun:"rel:has-many"`
	Events    []Event    `bun:"rel:has-many"`
	Transfers []Transfer `bun:"rel:has-many"`
	Fee       *Fee       `bun:"rel:belongs-to"`
	Token     *Token     `bun:"-"`
}
    Deploy -
type DeployAccount ¶
type DeployAccount struct {
	bun.BaseModel `bun:"deploy_account" comment:"table with deploy account transactions" partition:"RANGE(time)"`
	ID                  uint64          `bun:"id,type:bigint,pk,notnull" comment:"Unique internal identity"`
	Height              uint64          `comment:"Block height"`
	ClassID             uint64          `comment:"Class id"`
	ContractID          uint64          `comment:"Contract address id"`
	Position            int             `comment:"Order in block"`
	Time                time.Time       `bun:",pk" comment:"Time of block"`
	Status              Status          ``
	Hash                types.Hex       `comment:"Transaction hash"`
	ContractAddressSalt types.Hex       `comment:"A random salt that determines the account address"`
	MaxFee              decimal.Decimal `bun:",type:numeric" comment:"The maximum fee that the sender is willing to pay for the transaction"`
	Nonce               decimal.Decimal `bun:",type:numeric" comment:"The transaction nonce"`
	ConstructorCalldata []string        `bun:",array" comment:"Raw constructor calldata"`
	ParsedCalldata      map[string]any  `bun:",nullzero" comment:"Calldata parsed according to contract ABI"`
	Error               *string         `bun:"error" comment:"Reverted error"`
	Class     Class      `bun:"rel:belongs-to" hasura:"table:class,field:class_id,remote_field:id,type:oto,name:class"`
	Contract  Address    `bun:"rel:belongs-to" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
	Internals []Internal `bun:"rel:has-many"`
	Messages  []Message  `bun:"rel:has-many"`
	Events    []Event    `bun:"rel:has-many"`
	Transfers []Transfer `bun:"rel:has-many"`
	Fee       *Fee       `bun:"rel:belongs-to"`
}
    DeployAccount -
type DeployAccountFilter ¶
type DeployAccountFilter struct {
	ID             IntegerFilter
	Height         IntegerFilter
	Time           TimeFilter
	Status         EnumFilter
	Class          BytesFilter
	Hash           BytesFilter
	ParsedCalldata map[string]string
}
    DeployAccountFilter -
type DeployFilter ¶
type DeployFilter struct {
	ID             IntegerFilter
	Height         IntegerFilter
	Time           TimeFilter
	Status         EnumFilter
	Class          BytesFilter
	Hash           BytesFilter
	ParsedCalldata map[string]string
}
    DeployFilter -
type DeployedContract ¶
type EntrypointType ¶
type EntrypointType int
EntrypointType -
const ( EntrypointTypeUnknown EntrypointType = iota + 1 EntrypointTypeExternal EntrypointTypeConstructor EntrypointTypeL1Handler )
type EnumFilter ¶
EnumFilter -
type EnumStringFilter ¶
EnumStringFilter -
type Event ¶
type Event struct {
	bun.BaseModel `bun:"event" comment:"Table with events" partition:"RANGE(time)"`
	ID     uint64    `bun:"id,type:bigint,pk,notnull" comment:"Unique internal identity"`
	Height uint64    `comment:"Block height"`
	Time   time.Time `bun:",pk" comment:"Time of block"`
	InvokeID        *uint64 `comment:"Parent invoke id"`
	DeclareID       *uint64 `comment:"Parent declare id"`
	DeployID        *uint64 `comment:"Parent deploy id"`
	DeployAccountID *uint64 `comment:"Parent deploy account id"`
	L1HandlerID     *uint64 `comment:"Parent l1 handler id"`
	FeeID           *uint64 `comment:"Parent fee invocation id"`
	InternalID      *uint64 `comment:"Parent internal transaction id"`
	Order      uint64         `comment:"Order in block"`
	ContractID uint64         `comment:"Contract address id"`
	FromID     uint64         `comment:"From address id"`
	Keys       []string       `bun:",array" comment:"Raw event keys"`
	Data       []string       `bun:",array" comment:"Raw event data"`
	Name       string         `comment:"Event name"`
	ParsedData map[string]any `bun:",nullzero" comment:"Event data parsed according to contract ABI"`
	From     Address `bun:"rel:belongs-to" hasura:"table:address,field:from_id,remote_field:id,type:oto,name:from"`
	Contract Address `bun:"rel:belongs-to" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
}
    Event -
type EventFilter ¶
type EventFilter struct {
	ID         IntegerFilter
	Height     IntegerFilter
	Time       TimeFilter
	Contract   IdFilter
	From       IdFilter
	Name       StringFilter
	ParsedData map[string]string
}
    EventFilter -
type Fee ¶
type Fee struct {
	bun.BaseModel `bun:"fee" comment:"Table with fee invocations" partition:"RANGE(time)"`
	ID     uint64    `bun:"id,type:bigint,pk,notnull" comment:"Unique internal identity"`
	Height uint64    `comment:"Block height"`
	Time   time.Time `bun:",pk" comment:"Time of block"`
	ContractID uint64 `comment:"Contract address id"`
	CallerID   uint64 `comment:"Caller address id"`
	ClassID    uint64 `comment:"Class id"`
	InvokeID        *uint64 `comment:"Parent invoke id"`
	DeclareID       *uint64 `comment:"Parent declare id"`
	DeployID        *uint64 `comment:"Parent deploy id"`
	DeployAccountID *uint64 `comment:"Parent deploy account id"`
	L1HandlerID     *uint64 `comment:"Parent l1 handler id"`
	EntrypointType EntrypointType `bun:",type:SMALLINT" comment:"Entrypoint type (unknown - 1 | external - 2 | constructor - 3 | l1 handler - 4)"`
	CallType       CallType       `bun:",type:SMALLINT" comment:"Call type (unknown - 1 | call - 2 | delegate - 3)"`
	Status         Status         `` /* 172-byte string literal not displayed */
	Selector       []byte         `comment:"Called selector"`
	Entrypoint     string         `comment:"Entrypoint name"`
	Calldata       []string       `bun:",array" comment:"Raw calldata"`
	Result         []string       `bun:",array" comment:"Raw result"`
	ParsedCalldata map[string]any `bun:",nullzero" comment:"Calldata parsed according to contract ABI"`
	Class     Class      `bun:"rel:belongs-to" hasura:"table:class,field:class_id,remote_field:id,type:oto,name:class"`
	Caller    Address    `bun:"rel:belongs-to" hasura:"table:address,field:caller_id,remote_field:id,type:oto,name:caller"`
	Contract  Address    `bun:"rel:belongs-to" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
	Internals []Internal `bun:"rel:has-many"`
	Messages  []Message  `bun:"rel:has-many"`
	Events    []Event    `bun:"rel:has-many"`
	Transfers []Transfer `bun:"rel:has-many"`
}
    Fee -
type FeeFilter ¶
type FeeFilter struct {
	ID             IntegerFilter
	Height         IntegerFilter
	Time           TimeFilter
	Status         EnumFilter
	Contract       BytesFilter
	Caller         BytesFilter
	Class          BytesFilter
	Selector       EqualityFilter
	Entrypoint     StringFilter
	EntrypointType EnumFilter
	CallType       EnumFilter
	ParsedCalldata map[string]string
}
    FeeFilter -
type FilterOption ¶
type FilterOption func(opt *FilterOptions)
FilterOption -
func WithMaxHeight ¶
func WithMaxHeight(height uint64, columnName string) FilterOption
WithMaxHeight -
func WithSortFilter ¶
func WithSortFilter(field string, order storage.SortOrder) FilterOption
WithSortFilter -
type FilterOptions ¶
type FilterOptions struct {
	Limit  int
	Offset int
	SortField string
	SortOrder storage.SortOrder
	SortFields []string
	MaxHeight        uint64
	HeightColumnName string
	Cursor           uint64
}
    FilterOptions -
type Filterable ¶
type Filterable[M storage.Model, F any] interface { Filter(ctx context.Context, flt []F, opts ...FilterOption) ([]M, error) }
Filterable -
type HashByHeight ¶
type Heightable ¶
Heightable -
type IClassReplace ¶
type IClassReplace interface {
	storage.Table[*ClassReplace]
	ByHeight(ctx context.Context, height uint64) ([]ClassReplace, error)
}
    type IDeclare ¶
type IDeclare interface {
	storage.Table[*Declare]
	Filterable[Declare, DeclareFilter]
	HashByHeight
}
    type IDeploy ¶
type IDeploy interface {
	storage.Table[*Deploy]
	Filterable[Deploy, DeployFilter]
	HashByHeight
}
    type IDeployAccount ¶
type IDeployAccount interface {
	storage.Table[*DeployAccount]
	Filterable[DeployAccount, DeployAccountFilter]
	HashByHeight
}
    type IEvent ¶
type IEvent interface {
	storage.Table[*Event]
	Filterable[Event, EventFilter]
	Countable[EventFilter]
}
    type IInternal ¶
type IInternal interface {
	storage.Table[*Internal]
	Filterable[Internal, InternalFilter]
	GetDeployedContracts(context.Context, types.Hex) ([]DeployedContract, error)
}
    type IInvoke ¶
type IInvoke interface {
	storage.Table[*Invoke]
	Filterable[Invoke, InvokeFilter]
	Countable[InvokeFilter]
	HashByHeight
}
    type IL1Handler ¶
type IL1Handler interface {
	storage.Table[*L1Handler]
	Filterable[L1Handler, L1HandlerFilter]
	HashByHeight
}
    type IMessage ¶
type IMessage interface {
	storage.Table[*Message]
	Filterable[Message, MessageFilter]
}
    type IProxyUpgrade ¶
type IProxyUpgrade interface {
	storage.Table[*ProxyUpgrade]
	LastBefore(ctx context.Context, hash, selector []byte, height uint64) (ProxyUpgrade, error)
	ListWithHeight(ctx context.Context, height uint64, limit, offset int) ([]ProxyUpgrade, error)
}
    type IStorageDiff ¶
type IStorageDiff interface {
	storage.Table[*StorageDiff]
	Filterable[StorageDiff, StorageDiffFilter]
	GetOnBlock(ctx context.Context, height, contractId uint64, key []byte) (StorageDiff, error)
}
    type ITokenBalance ¶
type ITokenBalance interface {
	storage.Table[*TokenBalance]
	Filterable[TokenBalance, TokenBalanceFilter]
	Balances(ctx context.Context, contractId uint64, tokenId int64, limit, offset int) ([]TokenBalance, error)
}
    type ITransfer ¶
type ITransfer interface {
	storage.Table[*Transfer]
	Filterable[Transfer, TransferFilter]
	Countable[TransferFilter]
}
    type IntegerFilter ¶
type IntegerFilter struct {
	Eq      uint64
	Neq     uint64
	Gt      uint64
	Gte     uint64
	Lt      uint64
	Lte     uint64
	Between *BetweenFilter
}
    IntegerFilter -
type Internal ¶
type Internal struct {
	bun.BaseModel `bun:"internal_tx" comment:"Table with internal transactions" partition:"RANGE(time)"`
	ID     uint64    `bun:"id,type:bigint,pk,notnull" comment:"Unique internal identity"`
	Height uint64    `comment:"Block height"`
	Time   time.Time `bun:",pk" comment:"Time of block"`
	InvokeID        *uint64 `comment:"Parent invoke id"`
	DeclareID       *uint64 `comment:"Parent declare id"`
	DeployID        *uint64 `comment:"Parent deploy id"`
	DeployAccountID *uint64 `comment:"Parent deploy account id"`
	L1HandlerID     *uint64 `comment:"Parent l1 handler id"`
	InternalID      *uint64 `comment:"Parent internal transaction id"`
	ClassID         uint64  `comment:"Class id"`
	CallerID        uint64  `comment:"Caller address id"`
	ContractID      uint64  `comment:"Contract address id"`
	Status         Status         `` /* 172-byte string literal not displayed */
	EntrypointType EntrypointType `bun:",type:SMALLINT" comment:"Entrypoint type (unknown - 1 | external - 2 | constructor - 3 | l1 handler - 4)"`
	CallType       CallType       `bun:",type:SMALLINT" comment:"Call type (unknown - 1 | call - 2 | delegate - 3)"`
	Hash           []byte         `comment:"Transaction hash"`
	Selector       []byte         `comment:"Called selector"`
	Entrypoint     string         `comment:"Entrypoint name"`
	Result         []string       `bun:",array" comment:"Raw result"`
	Calldata       []string       `bun:",array" comment:"Raw calldata"`
	ParsedCalldata map[string]any `bun:",nullzero" comment:"Calldata parsed according to contract ABI"`
	ParsedResult   map[string]any `bun:",nullzero" comment:"Result parsed according to contract ABI"`
	Class     Class      `bun:"rel:belongs-to" hasura:"table:class,field:class_id,remote_field:id,type:oto,name:class"`
	Caller    Address    `bun:"rel:belongs-to" hasura:"table:address,field:caller_id,remote_field:id,type:oto,name:caller"`
	Contract  Address    `bun:"rel:belongs-to" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
	Internals []Internal `bun:"rel:has-many"`
	Messages  []Message  `bun:"rel:has-many"`
	Events    []Event    `bun:"rel:has-many"`
	Transfers []Transfer `bun:"rel:has-many"`
}
    Internal -
type InternalFilter ¶
type InternalFilter struct {
	ID             IntegerFilter
	Height         IntegerFilter
	Time           TimeFilter
	Status         EnumFilter
	Contract       BytesFilter
	Caller         BytesFilter
	Class          BytesFilter
	Selector       EqualityFilter
	Entrypoint     StringFilter
	EntrypointType EnumFilter
	CallType       EnumFilter
	ParsedCalldata map[string]string
}
    InternalFilter -
type Invoke ¶
type Invoke struct {
	bun.BaseModel `bun:"invoke" comment:"Table with invokes" partition:"RANGE(time)"`
	ID                 uint64          `bun:"id,type:bigint,pk,notnull" comment:"Unique internal identity"`
	Height             uint64          `comment:"Block height"`
	Time               time.Time       `bun:",pk" comment:"Time of block"`
	Status             Status          `` /* 151-byte string literal not displayed */
	Hash               types.Hex       `comment:"Transaction hash"`
	Version            uint64          `comment:"Version of invoke transaction"`
	Position           int             `comment:"Order in block"`
	ContractID         uint64          `comment:"Contract address id"`
	EntrypointSelector types.Hex       `comment:"Called selector"`
	Entrypoint         string          `comment:"Entrypoint name"`
	MaxFee             decimal.Decimal `bun:",type:numeric" comment:"The maximum fee that the sender is willing to pay for the transaction"`
	Nonce              decimal.Decimal `bun:",type:numeric" comment:"The transaction nonce"`
	CallData           []string        `bun:",array" comment:"Raw calldata"`
	ParsedCalldata     map[string]any  `bun:",nullzero" comment:"Calldata parsed according to contract ABI"`
	Error              *string         `bun:"error" comment:"Reverted error"`
	Contract  Address    `bun:"rel:belongs-to" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
	Internals []Internal `bun:"rel:has-many"`
	Messages  []Message  `bun:"rel:has-many"`
	Events    []Event    `bun:"rel:has-many"`
	Transfers []Transfer `bun:"rel:has-many"`
	Fee       *Fee       `bun:"rel:belongs-to"`
}
    Invoke -
type InvokeFilter ¶
type InvokeFilter struct {
	ID             IntegerFilter
	Hash           BytesFilter
	Height         IntegerFilter
	Time           TimeFilter
	Status         EnumFilter
	Version        EnumFilter
	Contract       BytesFilter
	Selector       EqualityFilter
	Entrypoint     StringFilter
	ParsedCalldata map[string]string
}
    InvokeFilter -
type L1Handler ¶
type L1Handler struct {
	bun.BaseModel `bun:"l1_handler" comment:"Table with l1 handler transactions" partition:"RANGE(time)"`
	ID             uint64          `bun:"id,type:bigint,pk,notnull" comment:"Unique internal identity"`
	Height         uint64          `comment:"Block height"`
	Time           time.Time       `bun:",pk" comment:"Time of block"`
	Status         Status          `` /* 165-byte string literal not displayed */
	Hash           types.Hex       `comment:"Transaction hash"`
	ContractID     uint64          `comment:"Contract address id"`
	Position       int             `comment:"Order in block"`
	Selector       types.Hex       `comment:"Called selector"`
	Entrypoint     string          `comment:"Entrypoint name"`
	MaxFee         decimal.Decimal `bun:",type:numeric" comment:"The maximum fee that the sender is willing to pay for the transaction"`
	Nonce          decimal.Decimal `bun:",type:numeric" comment:"The transaction nonce"`
	CallData       []string        `bun:",array" comment:"Raw calldata"`
	ParsedCalldata map[string]any  `bun:",nullzero" comment:"Calldata parsed according to contract ABI"`
	Error          *string         `bun:"error" comment:"Reverted error"`
	Contract  Address    `bun:"rel:belongs-to" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
	Internals []Internal `bun:"rel:has-many"`
	Messages  []Message  `bun:"rel:has-many"`
	Transfers []Transfer `bun:"rel:has-many"`
	Events    []Event    `bun:"rel:has-many"`
	Fee       *Fee       `bun:"rel:belongs-to"`
}
    L1Handler -
type L1HandlerFilter ¶
type L1HandlerFilter struct {
	ID             IntegerFilter
	Height         IntegerFilter
	Time           TimeFilter
	Status         EnumFilter
	Contract       BytesFilter
	Hash           BytesFilter
	Selector       EqualityFilter
	Entrypoint     StringFilter
	ParsedCalldata map[string]string
}
    L1HandlerFilter -
type Message ¶
type Message struct {
	bun.BaseModel `bun:"message" comment:"Table with messages" partition:"RANGE(time)"`
	ID     uint64    `bun:",pk,autoincrement,nullzero" comment:"Unique internal identity"`
	Height uint64    `comment:"Block height"`
	Time   time.Time `bun:",pk" comment:"Time of block"`
	InvokeID        *uint64 `comment:"Parent invoke id"`
	DeclareID       *uint64 `comment:"Parent declare id"`
	DeployID        *uint64 `comment:"Parent deploy id"`
	DeployAccountID *uint64 `comment:"Parent deploy account id"`
	L1HandlerID     *uint64 `comment:"Parent l1 handler id"`
	FeeID           *uint64 `comment:"Parent fee invocation id"`
	InternalID      *uint64 `comment:"Parent internal transaction id"`
	ContractID uint64          `comment:"Contract address id"`
	Order      uint64          `comment:"Order in block"`
	FromID     uint64          `comment:"From address id"`
	ToID       uint64          `comment:"To address id"`
	Selector   string          `comment:"Called selector"`
	Nonce      decimal.Decimal `bun:",type:numeric" comment:"The transaction nonce"`
	Payload    []string        `bun:",array" comment:"Message payload"`
	From     Address `bun:"rel:belongs-to" hasura:"table:address,field:from_id,remote_field:id,type:oto,name:from"`
	To       Address `bun:"rel:belongs-to" hasura:"table:address,field:to_id,remote_field:id,type:oto,name:to"`
	Contract Address `bun:"rel:belongs-to" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
}
    Message -
type MessageFilter ¶
type MessageFilter struct {
	ID       IntegerFilter
	Height   IntegerFilter
	Time     TimeFilter
	Contract BytesFilter
	From     BytesFilter
	To       BytesFilter
	Selector EqualityFilter
}
    MessageFilter -
type Proxy ¶
type Proxy struct {
	bun.BaseModel `bun:"proxy"`
	ID         uint64     `bun:",pk,autoincrement" comment:"Unique internal identity"`
	ContractID uint64     `comment:"Proxy contract id"`
	Hash       []byte     `comment:"Proxy contract hash"`
	Selector   []byte     `comment:"Proxy contract selector (for modules)"`
	EntityType EntityType `comment:"Entity type behind proxy (0 - class | 1 - contract)"`
	EntityID   uint64     `comment:"Entity id behind proxy"`
	EntityHash []byte     `comment:"Entity hash behind proxy"`
	Contract Address `bun:"rel:belongs-to,join:contract_id=id" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
	Entity   Address `bun:"rel:belongs-to,join:entity_id=id" hasura:"table:address,field:entity_id,remote_field:id,type:oto,name:entity"`
}
    Proxy -
type ProxyAction ¶
type ProxyAction int
ProxyAction -
const ( ProxyActionAdd ProxyAction = iota ProxyActionUpdate ProxyActionDelete )
default proxy actions
type ProxyUpgrade ¶
type ProxyUpgrade struct {
	bun.BaseModel `bun:"proxy_upgrade"`
	ID         uint64      `bun:",pk,autoincrement" comment:":Unique internal identity"`
	ContractID uint64      `comment:":Proxy contract id"`
	Hash       []byte      `comment:":Proxy contract hash"`
	Selector   []byte      `comment:":Proxy contract selector (for modules)"`
	EntityType EntityType  `comment:"Entity type behind proxy (0 - class | 1 - contract)"`
	EntityID   uint64      `comment:":Entity id behind proxy"`
	EntityHash []byte      `comment:":Entity hash behind proxy"`
	Height     uint64      `comment:":Height when event occured"`
	Action     ProxyAction `comment:":Action which occured with proxy (0 - add | 1 - update | 2 - delete)"`
}
    ProxyUpgrade -
type State ¶
type State struct {
	bun.BaseModel `bun:"state"`
	ID         uint64    `bun:",pk,autoincrement" comment:"Unique internal identity"`
	Name       string    `bun:",unique:state_name"`
	LastHeight uint64    `comment:"Last block height"`
	LastTime   time.Time `comment:"Time of last block"`
	InvokesCount        uint64 `comment:"Total invokes count"`
	DeploysCount        uint64 `comment:"Total deploys count"`
	DeployAccountsCount uint64 `comment:"Total deploy accounts count"`
	DeclaresCount       uint64 `comment:"Total declares count"`
	L1HandlersCount     uint64 `comment:"Total l1 handlers count"`
	TxCount             uint64 `comment:"Total transactions count"`
	LastClassID   uint64 `comment:"Last internal class id"`
	LastAddressID uint64 `comment:"Last internal address id"`
	LastTxID      uint64 `comment:"Last internal transaction id"`
	LastEventID   uint64 `comment:"Last internal event id"`
}
    State -
type StorageDiff ¶
type StorageDiff struct {
	bun.BaseModel `bun:"storage_diff"`
	ID         uint64 `bun:",pk,autoincrement" comment:"Unique internal identity"`
	Height     uint64 `comment:"Block height"`
	ContractID uint64 `comment:"Contract id which storage was changed"`
	Key        []byte `comment:"Storage key"`
	Value      []byte `comment:"Data"`
	Contract Address `bun:"rel:belongs-to" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
}
    StorageDiff -
type StorageDiffFilter ¶
type StorageDiffFilter struct {
	ID       IntegerFilter
	Height   IntegerFilter
	Contract BytesFilter
	Key      EqualityFilter
}
    StorageDiffFilter -
type TimeFilter ¶
type TimeFilter struct {
	Gt      uint64
	Gte     uint64
	Lt      uint64
	Lte     uint64
	Between *BetweenFilter
}
    TimeFilter -
type Token ¶
type Token struct {
	bun.BaseModel `bun:"token"`
	ID          uint64          `bun:"id,pk,autoincrement" comment:"Unique internal identity"`
	FirstHeight uint64          `comment:"Block height when token was first time transferred or minted"`
	ContractId  uint64          `bun:",unique:token_unique_id" comment:"Token contract id"`
	TokenId     decimal.Decimal `bun:",unique:token_unique_id,type:numeric" comment:"Token id"`
	Type        TokenType       `bun:",type:token_type" comment:"Token type"`
	Contract Address `bun:"rel:belongs-to,join:contract_id=id" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
}
    Token -
type TokenBalance ¶
type TokenBalance struct {
	bun.BaseModel `bun:"token_balance" comment:"Table with token balances"`
	OwnerID    uint64          `bun:",pk" comment:"Identity of owner address"`
	ContractID uint64          `bun:",pk" comment:"Identity of contract address"`
	TokenID    decimal.Decimal `bun:",pk,type:numeric" comment:"Token id"`
	Balance    decimal.Decimal `bun:",type:numeric" comment:"Token balance"`
	Contract Address `bun:"rel:belongs-to,join:contract_id=id" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
	Owner    Address `bun:"rel:belongs-to,join:owner_id=id" hasura:"table:address,field:owner_id,remote_field:id,type:oto,name:owner"`
}
    TokenBalance -
type TokenBalanceFilter ¶
type TokenBalanceFilter struct {
	Owner    BytesFilter
	Contract BytesFilter
	TokenId  StringFilter
}
    TokenBalanceFilter -
type TokenFilter ¶
type TokenFilter struct {
	ID       IntegerFilter
	Contract IdFilter
	TokenId  StringFilter
	Type     EnumStringFilter
}
    TokenFilter -
type TransactionType ¶
type TransactionType int
TransactionType -
const ( TransactionTypeUnknown TransactionType = iota + 1 TransactionTypeInvoke TransactionTypeDeclare TransactionTypeDeploy TransactionTypeDeployAccount TransactionTypeL1Handler )
func NewTransactionType ¶
func NewTransactionType(value string) TransactionType
NewTransactionType -
type Transfer ¶
type Transfer struct {
	bun.BaseModel `bun:"transfer" comment:"Trandfer table" partition:"RANGE(time)"`
	ID         uint64          `bun:",pk,autoincrement" comment:"Unique internal identity"`
	Height     uint64          `comment:"Block height"`
	Time       time.Time       `bun:",pk" comment:"Block time"`
	ContractID uint64          `comment:"Token contract id"`
	FromID     uint64          `comment:"Id address which transfer from"`
	ToID       uint64          `comment:"Id address which transfer to"`
	Amount     decimal.Decimal `bun:",type:numeric" comment:"Amount of transfer"`
	TokenID    decimal.Decimal `bun:",type:numeric" comment:"Id token which was transferred"`
	InvokeID        *uint64 `comment:"Parent invoke id"`
	DeclareID       *uint64 `comment:"Parent declare id"`
	DeployID        *uint64 `comment:"Parent deploy id"`
	DeployAccountID *uint64 `comment:"Parent deploy account id"`
	L1HandlerID     *uint64 `comment:"Parent l1 handler id"`
	FeeID           *uint64 `comment:"Parent fee invocation id"`
	InternalID      *uint64 `comment:"Parent internal transaction id"`
	From     Address `bun:"rel:belongs-to" hasura:"table:address,field:from_id,remote_field:id,type:oto,name:from"`
	To       Address `bun:"rel:belongs-to" hasura:"table:address,field:to_id,remote_field:id,type:oto,name:to"`
	Contract Address `bun:"rel:belongs-to" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"`
	Token    Token   `bun:"-" hasura:"table:token,field:contract_id,remote_field:contract_id,type:oto,name:token"`
}
    Transfer -
func (Transfer) TokenBalanceUpdates ¶
func (transfer Transfer) TokenBalanceUpdates() []TokenBalance
TokenBalanceUpdates -
type TransferFilter ¶
type TransferFilter struct {
	ID       IntegerFilter
	Height   IntegerFilter
	Time     TimeFilter
	Contract BytesFilter
	From     BytesFilter
	To       BytesFilter
	TokenId  StringFilter
}
    TransferFilter -
      
      Source Files
      ¶
    
- address.go
 - block.go
 - bytes.go
 - call_type.go
 - class.go
 - class_replace.go
 - class_type.go
 - declare.go
 - deploy.go
 - deploy_account.go
 - entrypoint_type.go
 - event.go
 - fee.go
 - filters.go
 - interface.go
 - internal.go
 - invoke.go
 - l1_handler.go
 - message.go
 - proxy.go
 - proxy_upgrade.go
 - state.go
 - status.go
 - storage_diff.go
 - token.go
 - token_balance.go
 - transaction_type.go
 - transfer.go