Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ETHAddress represents ether type in address type ETHAddress = common.BytesToAddress([]byte("ETH")) // ETHBytes represents ether type in bytes array type ETHBytes = ETHAddress.Bytes() )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ContractAddress []byte `gorm:"-"`
BlockNumber int64 `gorm:"size:8;index;unique_index:idx_block_number_address"`
Address []byte `gorm:"size:20;index;unique_index:idx_block_number_address"`
Balance string `gorm:"size:32"`
}
Account represents the either ERC20 or ETH balances of externally owned accounts in Ethereum at given block The account is considered an eth account and insert to account table if ContractAddress is ETHBytes, or considered an erc20 account and insert to erc20_balance_{ContractAddress} table.
type ERC20 ¶
type ERC20 struct {
BlockNumber int64
Address []byte
Code []byte
TotalSupply string
Decimals int
Name string
}
ERC20 represents the ERC20 contract
type ERC20Storage ¶
type ERC20Storage struct {
Address []byte `gorm:"-"`
BlockNumber int64 `gorm:"size:8;index;unique_index:idx_block_number_key_hash"`
Key []byte `gorm:"column:key_hash;size:32;unique_index:idx_block_number_key_hash"`
Value []byte `gorm:"size:32"`
}
ERC20Storage represents the contract storage
func (ERC20Storage) TableName ¶
func (s ERC20Storage) TableName() string
TableName retruns the table name of this erc20 contract
type Header ¶
type Header struct {
Hash []byte
ParentHash []byte
UncleHash []byte
Coinbase []byte
Root []byte
TxHash []byte
ReceiptHash []byte
Difficulty int64
Number int64
GasLimit int64
GasUsed int64
Time int64
ExtraData []byte
MixDigest []byte
Nonce []byte
}
Header represents the header of a block
type Log ¶
type Log struct {
TxHash []byte
BlockNumber int64
ContractAddress []byte
// The sha3 of the event method
EventName []byte
// Indexed parameters of event. At most 3 topics.
Topic1 []byte
Topic2 []byte
Topic3 []byte
Data []byte
}
Log represents a receipt log
type QueryParameters ¶ added in v0.2.0
func (*QueryParameters) OrderString ¶ added in v0.2.0
func (q *QueryParameters) OrderString() string
type Receipt ¶
type Receipt struct {
Root []byte
Status uint
CumulativeGasUsed int64
Bloom []byte
TxHash []byte
ContractAddress []byte
GasUsed int64
BlockNumber int64
Logs []*Log
}
Receipt represents a transaction receipt
type Subscription ¶ added in v0.2.0
type Subscription struct {
ID int64
BlockNumber int64
Group int64
Address []byte
CreatedAt time.Time `deepequal:"-"`
UpdatedAt time.Time `deepequal:"-"`
}
Subscription represents the Subscription model
func (Subscription) TableName ¶ added in v0.2.0
func (s Subscription) TableName() string
TableName retruns the table name of this erc20 contract
type TotalBalance ¶ added in v0.2.0
TotalBalance represents the total balance of subscription accounts in different group
func (TotalBalance) TableName ¶ added in v0.2.0
func (s TotalBalance) TableName() string
TableName retruns the table name of this model
type TotalDifficulty ¶
TotalDifficulty represents total difficulty for this block
func (TotalDifficulty) TableName ¶
func (t TotalDifficulty) TableName() string
TableName returns the table name of this model
type Transaction ¶
type Transaction struct {
Hash []byte
BlockHash []byte
From []byte
To []byte
Nonce int64
GasPrice string
GasLimit int64
Amount string
Payload []byte
BlockNumber int64
}
Transaction represents a transaction
func (Transaction) TableName ¶
func (t Transaction) TableName() string
TableName returns the table name of this model
type Transfer ¶ added in v0.2.0
type Transfer struct {
Address []byte `gorm:"-"`
BlockNumber int64 `gorm:"size:8;index"`
TxHash []byte `gorm:"size:32;index"`
From []byte `gorm:"size:20;index"`
To []byte `gorm:"size:20;index"`
Value string `gorm:"size:32"`
}
Transfer represents the transfer event in either ether or ERC20 tokens The event is considered an eth transfer event and insert to eth_transfer table if Address is ETHBytes, or considered an erc20 transfer event and insert to erc20_transfer_{Address} table.