Documentation
¶
Index ¶
- Constants
- type AccountDataFetcher
- type Block
- type BlockChain
- type Contract
- type ContractDataFetcher
- type EthClient
- type FullSyncLog
- type Header
- type HeaderSyncLog
- type Node
- type NodeType
- type POAHeader
- type ParityNodeInfo
- type ParityVersion
- type Receipt
- type RpcClient
- type RpcTransaction
- type Topics
- type TransactionModel
- type Uncle
- type WatchedEvent
Constants ¶
View Source
const (
KOVAN_NETWORK_ID = 42
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountDataFetcher ¶
type Block ¶
type Block struct {
Reward string `db:"reward"`
Difficulty int64 `db:"difficulty"`
ExtraData string `db:"extra_data"`
GasLimit uint64 `db:"gas_limit"`
GasUsed uint64 `db:"gas_used"`
Hash string `db:"hash"`
IsFinal bool `db:"is_final"`
Miner string `db:"miner"`
Nonce string `db:"nonce"`
Number int64 `db:"number"`
ParentHash string `db:"parent_hash"`
Size string `db:"size"`
Time uint64 `db:"time"`
Transactions []TransactionModel
UncleHash string `db:"uncle_hash"`
UnclesReward string `db:"uncles_reward"`
Uncles []Uncle
}
type BlockChain ¶
type BlockChain interface {
ContractDataFetcher
AccountDataFetcher
GetBlockByNumber(blockNumber int64) (Block, error)
GetEthLogsWithCustomQuery(query ethereum.FilterQuery) ([]types.Log, error)
GetHeaderByNumber(blockNumber int64) (Header, error)
GetHeadersByNumbers(blockNumbers []int64) ([]Header, error)
GetFullSyncLogs(contract Contract, startingBlockNumber *big.Int, endingBlockNumber *big.Int) ([]FullSyncLog, error)
GetTransactions(transactionHashes []common.Hash) ([]TransactionModel, error)
LastBlock() (*big.Int, error)
Node() Node
}
type Contract ¶
type Contract struct {
Abi string
Hash string
Transactions []TransactionModel
}
type ContractDataFetcher ¶
type EthClient ¶
type EthClient interface {
BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)
HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error)
TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
}
type FullSyncLog ¶ added in v0.0.7
type HeaderSyncLog ¶ added in v0.0.7
type POAHeader ¶
type POAHeader struct {
ParentHash common.Hash `json:"parentHash" gencodec:"required"`
UncleHash common.Hash `json:"sha3Uncles" gencodec:"required"`
Coinbase common.Address `json:"miner" gencodec:"required"`
Root common.Hash `json:"stateRoot" gencodec:"required"`
TxHash common.Hash `json:"transactionsRoot" gencodec:"required"`
ReceiptHash common.Hash `json:"receiptsRoot" gencodec:"required"`
Bloom types.Bloom `json:"logsBloom" gencodec:"required"`
Difficulty *hexutil.Big `json:"difficulty" gencodec:"required"`
Number *hexutil.Big `json:"number" gencodec:"required"`
GasLimit hexutil.Uint64 `json:"gasLimit" gencodec:"required"`
GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
Time hexutil.Uint64 `json:"timestamp" gencodec:"required"`
Extra hexutil.Bytes `json:"extraData" gencodec:"required"`
Hash common.Hash `json:"hash"`
}
type ParityNodeInfo ¶
type ParityNodeInfo struct {
Track string
ParityVersion `json:"version"`
Hash string
}
func (ParityNodeInfo) String ¶
func (pn ParityNodeInfo) String() string
type ParityVersion ¶
type RpcTransaction ¶
type RpcTransaction struct {
Nonce string `json:"nonce"`
GasPrice string `json:"gasPrice"`
GasLimit string `json:"gas"`
Recipient string `json:"to"`
Amount string `json:"value"`
Payload string `json:"input"`
V string `json:"v"`
R string `json:"r"`
S string `json:"s"`
Hash string
From string
TransactionIndex string `json:"transactionIndex"`
}
type TransactionModel ¶
type WatchedEvent ¶
type WatchedEvent struct {
LogID int64 `json:"log_id" db:"id"`
Name string `json:"name"`
BlockNumber int64 `json:"block_number" db:"block_number"`
Address string `json:"address"`
TxHash string `json:"tx_hash" db:"tx_hash"`
Index int64 `json:"index"`
Topic0 string `json:"topic0"`
Topic1 string `json:"topic1"`
Topic2 string `json:"topic2"`
Topic3 string `json:"topic3"`
Data string `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.