Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Models = []storage.Model{ &State{}, &Address{}, &TokenMetadata{}, }
Models - list all models
View Source
var TokenUpdateID = types.NewCounter(0)
TokenUpdateID - incremental counter
Functions ¶
func SetLastUpdateID ¶
func SetLastUpdateID(value int64)
Types ¶
type Address ¶
type Address struct { bun.BaseModel `bun:"table:address" comment:"Table with starknet addresses."` ID uint64 `bun:"id,type:bigint,pk,notnull" comment:"Unique internal identity"` Hash []byte `bun:",unique:address_hash" comment:"Address hash."` }
Address -
type IState ¶
type IState interface { storage.Table[*State] ByName(ctx context.Context, name string) (State, error) }
IState -
type ITokenMetadata ¶
type ITokenMetadata interface { storage.Table[*TokenMetadata] GetByStatus(ctx context.Context, status Status, limit, offset, attempts, delay int) ([]TokenMetadata, error) }
ITokenMetadata -
type State ¶
type State struct { bun.BaseModel `bun:"table:state" comment:"Table contains current indexer's state"` ID uint64 `bun:"id,pk,autoincrement" comment:"Unique internal identity"` Name string `bun:"name,unique:state_name" comment:"Indexer human-readable name"` LastHeight uint64 `comment:"Last block height"` LastTime time.Time `comment:"Time of last block"` }
State -
type TokenMetadata ¶
type TokenMetadata struct { bun.BaseModel `bun:"table:token_metadata" comment:"Table contains token metadata"` Id uint64 `bun:"id,notnull,type:bigint,pk" comment:"Unique internal identity"` CreatedAt int64 `comment:"Time when row was created"` UpdatedAt int64 `comment:"Time when row was last updated"` UpdateID int64 `bun:",notnull" comment:"Update counter, increments on each and any token metadata update"` ContractID uint64 `comment:"Token contract id"` TokenId decimal.Decimal `bun:",type:numeric" comment:"Token id"` Type TokenType `bun:",type:token_type" comment:"Token type"` Status Status `bun:",type:status" comment:"Status of resolving metadata"` Uri *string `comment:"Metadata URI"` Metadata map[string]any `bun:",type:jsonb" comment:"Token metadata as JSON"` Attempts uint `bun:",type:SMALLINT" comment:"Attempts count of receiving metadata from third-party sources"` Error *string `comment:"If metadata is failed this field contains error string"` Contract Address `bun:"rel:belongs-to,join:contract_id=id" hasura:"table:address,field:contract_id,remote_field:id,type:oto,name:contract"` }
TokenMetadata -
func (*TokenMetadata) BeforeAppendModel ¶
BeforeAppendModel -
Source Files ¶
Click to show internal directories.
Click to hide internal directories.