model

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2018 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ERC20ContractTableName

func ERC20ContractTableName(address []byte) string

ERC20ContractTableName returns its contract table

func ERC20TransferTableName

func ERC20TransferTableName(address []byte) string

ERC20TransferTableName returns its contract table

Types

type Account

type Account struct {
	BlockNumber int64
	Address     []byte
	Balance     string
}

Account represents the state of externally owned accounts in Ethereum at given block

func (Account) TableName

func (a Account) TableName() string

TableName returns the table name of this model

type ERC20

type ERC20 struct {
	BlockNumber int64
	Address     []byte
	Code        []byte
	TotalSupply string
	Decimals    int
	Name        string
}

ERC20 represents the ERC20 contract

func (ERC20) TableName

func (e ERC20) TableName() string

TableName returns the table name of this model

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 ERC20Transfer

type ERC20Transfer 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"`
}

ERC20Transfer represents the transfer event in erc20

func (ERC20Transfer) TableName

func (s ERC20Transfer) TableName() string

TableName retruns the table name of this erc20 contract

type ETHTransfer

type ETHTransfer struct {
	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"`
}

ETHTransfer represents the transfer event in ether

func (ETHTransfer) TableName

func (e ETHTransfer) TableName() string

TableName retruns the table name of this erc20 contract

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

func (Header) TableName

func (h Header) TableName() string

TableName returns the table name of this model

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

func (Log) TableName

func (l Log) TableName() string

TableName returns the table name of this model

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

func (Receipt) TableName

func (r Receipt) TableName() string

TableName returns the table name of this model

type TotalDifficulty

type TotalDifficulty struct {
	Block int64
	Hash  []byte
	Td    string
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL