Documentation
¶
Index ¶
- Variables
- func SanitizeUint32(hex string) uint32
- type Block
- type Connection
- func (conn *Connection) Close()
- func (conn *Connection) Error() error
- func (conn *Connection) GetReceipt(txhash string) (*TransactionReceipt, error)
- func (conn *Connection) GetTransactionErc20History(address string, contractAddress string, pageFrom, pageTo int) ([]*Transaction, error)
- func (conn *Connection) GetTransactionEthHistory(address string, pageFrom, pageTo int) ([]*Transaction, error)
- func (conn *Connection) GetTransactionHistory(address string, pageFrom, pageTo int) ([]*Transaction, error)
- func (conn *Connection) GetUserTokens(address string) ([]*Contract, error)
- func (conn *Connection) MaxBlockNumber() (uint64, error)
- type Contract
- type Transaction
- type TransactionReceipt
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TableNameBlock = "block" TableNameTransaction = "transaction" TableNameTransactionReceipt = "transaction_receipt" TableNameContract = "erc20_contract" TableNameUserTokens = "user_tokens" )
Functions ¶
Types ¶
type Block ¶
type Block struct { Number string Hash string Size string Timestamp string GasLimit string GasUsed string Difficulty string TotalDifficulty string Miner string ParentHash string MixHash string ReceiptsRoot string Sha3Uncles string StateRoot string TransactionsRoot string Nonce string ExtraData string LogsBloom string Transactions []*Transaction Uncles interface{} }
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(dsn string) *Connection
func (*Connection) Close ¶
func (conn *Connection) Close()
func (*Connection) Error ¶
func (conn *Connection) Error() error
func (*Connection) GetReceipt ¶
func (conn *Connection) GetReceipt(txhash string) (*TransactionReceipt, error)
func (*Connection) GetTransactionErc20History ¶
func (conn *Connection) GetTransactionErc20History(address string, contractAddress string, pageFrom, pageTo int) ([]*Transaction, error)
仅ERC20交易历史
func (*Connection) GetTransactionEthHistory ¶
func (conn *Connection) GetTransactionEthHistory(address string, pageFrom, pageTo int) ([]*Transaction, error)
仅EOA交易历史
func (*Connection) GetTransactionHistory ¶
func (conn *Connection) GetTransactionHistory(address string, pageFrom, pageTo int) ([]*Transaction, error)
所有交易历史
func (*Connection) GetUserTokens ¶
func (conn *Connection) GetUserTokens(address string) ([]*Contract, error)
func (*Connection) MaxBlockNumber ¶
func (conn *Connection) MaxBlockNumber() (uint64, error)
type Transaction ¶
type Transaction struct { Id uint32 `json:"id"` Hash string `json:"hash"` BlockNumber string `json:"blockNumber"` BlockHash string `json:"blockHash"` From string `json:"from"` To string `json:"to"` Receipt string `json:"receipt"` Gas string `json:"gas"` GasPrice string `json:"gasPrice"` Nonce string `json:"nonce"` TransactionIndex string `json:"transactionIndex"` Value string `json:"value"` V string `json:"v"` R string `json:"r"` S string `json:"s"` Input string `json:"input"` IsContract int `json:"is_contract_tx"` TimeStamp string `json:"time_stamp"` }
type TransactionReceipt ¶
type TransactionReceipt struct { Id uint32 `json:"id"` BlockHash string `json:"block_hash"` BlockNumber string `json:"block_number"` ContractAddress string `json:"contract_address"` CumulativeGasUsed string `json:"-"` From string `json:"from"` To string `json:"to"` GasUsed string `json:"gas_used"` TransactionHash string `json:"transaction_hash"` TransactionIndex string `json:"transaction_index"` Status string `json:"status"` LogsBloom string `json:"-"` Logs interface{} `json:"-"` }
logs https://codeburst.io/deep-dive-into-ethereum-logs-a8d2047c7371
func (*TransactionReceipt) String ¶
func (receipt *TransactionReceipt) String() []byte
Click to show internal directories.
Click to hide internal directories.