Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StringArrReflectType reflect.Type = reflect.TypeOf("string")
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Number int64 `json:"number" gorm:"primaryKey"` Hash common.Hash `json:"hash" gorm:"size:32;uniqueIndex"` ParentHash common.Hash `json:"parentHash" gorm:"size:32"` Nonce string `json:"nonce" gorm:"type:char(18)"` SHA3Uncles common.Hash `json:"sha3Uncles" gorm:"size:32"` LogsBloom string `json:"logsBloom" gorm:"size:514"` TransactionsRoot common.Hash `json:"transactionsRoot" gorm:"size:32"` StateRoot common.Hash `json:"stateRoot" gorm:"size:32"` ReceiptsRoot common.Hash `json:"receiptsRoot" gorm:"size:32"` Miner common.Address `json:"miner" gorm:"size:20"` ExtraData []byte `json:"extraData"` GasLimit int64 `json:"gasLimit"` GasUsed int64 `json:"gasUsed"` Timestamp int64 `json:"timestamp"` Difficulty string `json:"difficulty"` // Uncles will be of type text or longtext depending on the driver type Uncles []common.Hash `json:"uncles" gorm:"serializer:stringer_joiner"` // Transactions will be of type text or longtext depending on the driver type Transactions []common.Hash `json:"transactions" gorm:"serializer:stringer_joiner"` MixHash common.Hash `json:"mixHash" gorm:"size:32"` BaseFeePerGas *int64 `json:"baseFeePerGas"` }
type ByteArraySerializer ¶
type ByteArraySerializer struct{}
type Code ¶
type Contract ¶
type EventSignature ¶
func (EventSignature) TableName ¶
func (EventSignature) TableName() string
type FunctionSignature ¶
func (FunctionSignature) TableName ¶
func (FunctionSignature) TableName() string
type Interface ¶
type Log ¶
type Log struct { BlockNumber int64 `json:"blockNumber" gorm:"primaryKey"` LogIndex int64 `json:"logIndex" gorm:"primaryKey"` BlockHash common.Hash `json:"blockHash" gorm:"size:32"` TransactionHash common.Hash `json:"transactionHash" gorm:"size:32"` TransactionIndex int64 `json:"transactionIndex"` Address common.Address `json:"address" gorm:"size:20"` Data []byte `json:"data"` Topic0 common.Hash `json:"topic0" gorm:"size:32;index:idx_721,priority:1;index:idx_1155,priority:1"` Topic1 common.Hash `json:"topic1" gorm:"size:32"` Topic2 common.Hash `json:"topic2" gorm:"size:32;index:idx_721"` Topic3 common.Hash `json:"topic3" gorm:"size:32;index:idx_1155"` Removed bool `json:"removed"` }
Primary key: BlockNumber + LogIndex
func LogsAsArraysToLogs ¶
func LogsAsArraysToLogs(arr LogsAsArrays) []*Log
Assume all arrays are of same length
type LogsAsArrays ¶
type LogsAsArrays struct { BlockNumber []int64 `json:"blockNumber" gorm:"primaryKey"` LogIndex []int64 `json:"logIndex" gorm:"primaryKey"` BlockHash []common.Hash `json:"blockHash" gorm:"size:32"` TransactionHash []common.Hash `json:"transactionHash" gorm:"size:32"` TransactionIndex []int64 `json:"transactionIndex"` Address []common.Address `json:"address" gorm:"size:20"` Data [][]byte `json:"data"` Topic0 []common.Hash `json:"topic0" gorm:"size:32;index:idx_721,priority:1;index:idx_1155,priority:1"` Topic1 []common.Hash `json:"topic1" gorm:"size:32"` Topic2 []common.Hash `json:"topic2" gorm:"size:32;index:idx_721"` Topic3 []common.Hash `json:"topic3" gorm:"size:32;index:idx_1155"` Removed []bool `json:"removed"` }
func LogsToLogsAsArrays ¶
func LogsToLogsAsArrays(logs []*Log) LogsAsArrays
type StringerJoinerSerializer ¶
type StringerJoinerSerializer struct{}
func (StringerJoinerSerializer) Scan ¶
func (StringerJoinerSerializer) Scan(ctx context.Context, field *schema.Field, dst reflect.Value, dbValue interface{}) (err error)
Assumes field is a slice
func (StringerJoinerSerializer) String ¶
func (StringerJoinerSerializer) String() string
type SupportsInterface ¶
type SupportsInterface struct { Address common.Address `gorm:"size:20;primaryKey"` // Foreign Key into "eth_code" Interface string `gorm:"primaryKey;type:char(10)"` Supports bool }
func (SupportsInterface) TableName ¶
func (SupportsInterface) TableName() string
type Token ¶
type Transaction ¶
type Transaction struct { Hash common.Hash `json:"hash" gorm:"size:32;primaryKey"` BlockHash common.Hash `json:"blockHash" gorm:"size:32"` BlockNumber int64 `json:"blockNumber"` TransactionIndex int64 `json:"transactionIndex"` From common.Address `json:"from" gorm:"size:20"` To *common.Address `json:"to" gorm:"size:20"` ContractAddress *common.Address `json:"contractAddress" gorm:"size:20"` Value string `json:"value"` GasPrice int64 `json:"gasPrice"` Gas int64 `json:"gas"` GasUsed int64 `json:"gasUsed"` Input []byte `json:"input"` Nonce int64 `json:"nonce"` Logs []*Log `json:"logs"` }
NOTE: Pointers => nullable field, except for strings
func (*Transaction) MarshalJSON ¶
func (t *Transaction) MarshalJSON() ([]byte, error)
func (Transaction) TableName ¶
func (Transaction) TableName() string
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(data []byte) error
type TransactionsHash ¶
func (TransactionsHash) TableName ¶
func (TransactionsHash) TableName() string
Click to show internal directories.
Click to hide internal directories.