Documentation ¶
Index ¶
- type AggregatesData
- type BaseFeePercentiles
- type Block
- type BlockData
- type Client
- type CoinbaseSpotResponse
- type HTTPClient
- type Health
- type Hub
- type InitialData
- type LatestBlock
- type LatestBlocks
- type RPCClient
- type Stats
- type Syncing
- type Totals
- type TotalsList
- type TransactionLog
- type TransactionReceipt
- type TransactionReceiptWorker
- type USDPriceWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregatesData ¶
type AggregatesData struct { TotalsPerDay []Totals `json:"totalsPerDay"` TotalsPerHour []Totals `json:"totalsPerHour"` TotalsPerMonth []Totals `json:"totalsPerMonth"` }
ClientData type represents the data that the server sends at every new block.
type BaseFeePercentiles ¶
type Block ¶
type Block struct { BaseFeePerGas string `json:"baseFeePerGas"` Difficulty string `json:"difficulty"` ExtraData string `json:"extraData"` GasLimit string `json:"gasLimit"` GasUsed string `json:"gasUsed"` Hash string `json:"hash"` LogsBloom string `json:"logsBloom"` Miner string `json:"miner"` MixHash string `json:"mixHash"` Nonce string `json:"nonce"` Number string `json:"number"` ParentHash string `json:"parentHash"` ReceiptsRoot string `json:"receiptsRoot"` Sha3Uncles string `json:"sha3Uncles"` Size string `json:"size"` StateRoot string `json:"stateRoot"` Timestamp string `json:"timestamp"` TotalDifficulty string `json:"totalDifficulty"` Transactions []string `json:"transactions"` TransactionsRoot string `json:"transactionsRoot"` Uncles []interface{} `json:"uncles"` }
Block type represents a single ethereum Block.
type BlockData ¶
type BlockData struct { BaseFeeNext string `json:"baseFeeNext"` Block sql.BlockStats `json:"block"` Clients int16 `json:"clients"` Totals Totals `json:"totals"` TotalsDay Totals `json:"totalsDay"` TotalsHour Totals `json:"totalsHour"` TotalsMonth Totals `json:"totalsMonth"` TotalsWeek Totals `json:"totalsWeek"` Version string `json:"version"` USDPrice float64 `json:"usdPrice"` }
ClientData type represents the data that the server sends at every new block.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a middleman between the websocket connection and the hub.
type CoinbaseSpotResponse ¶
type HTTPClient ¶
HTTPClient is an interface for making HTTP requests
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains the set of active clients and subscriptions messages to the clients.
func New ¶
func New( debug bool, development bool, gethEndpointHTTP string, gethEndpointWebsocket string, dbPath string, ropsten bool, workerCount int, ) (*Hub, error)
New initializes a Hub instance.
func (*Hub) ListenAndServe ¶
ListenAndServe serves the hub on the given network address.
type InitialData ¶
type InitialData struct { Blocks []sql.BlockStats `json:"blocks"` Clients int16 `json:"clients"` Totals Totals `json:"totals"` TotalsDay Totals `json:"totalsDay"` TotalsHour Totals `json:"totalsHour"` TotalsMonth Totals `json:"totalsMonth"` TotalsWeek Totals `json:"totalsWeek"` BlockNumber uint64 `json:"blockNumber"` Version string `json:"version"` USDPrice float64 `json:"usdPrice"` }
InitialData type represents the initial data that the client requests.
type LatestBlock ¶
type LatestBlock struct {
// contains filtered or unexported fields
}
LatestBlock defines a mutexed block number
type LatestBlocks ¶
type LatestBlocks struct {
// contains filtered or unexported fields
}
LatestBlocks defines a mutexed list of latest blocks
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
RPCClient is a client for the RPC interface
func (*RPCClient) CallContext ¶
func (c *RPCClient) CallContext( version string, method string, blockNumber string, updateCache bool, args ...interface{}, ) (json.RawMessage, error)
CallContext is a context for a single RPC call
type Totals ¶
type Totals struct { ID string `json:"id"` BaseFee uint `json:"baseFee,omitempty"` BaseFeePercentiles BaseFeePercentiles `json:"baseFeePercentiles,omitempty"` Burned string `json:"burned"` Duration uint64 `json:"duration"` Issuance string `json:"issuance"` Rewards string `json:"rewards"` Tips string `json:"tips"` }
Totals type represents a single aggregate of all the data.
type TotalsList ¶
type TotalsList struct {
// contains filtered or unexported fields
}
TotalsList defines a mutexed list of latest totals
type TransactionLog ¶
type TransactionLog struct { Address string `json:"address"` Topics []string `json:"topics"` Data string `json:"data"` BlockNumber string `json:"blockNumber"` TransactionHash string `json:"transactionHash"` TransactionIndex string `json:"transactionIndex"` BlockHash string `json:"blockHash"` LogIndex string `json:"logIndex"` Removed bool `json:"removed"` }
TransactionLog type represents the transaction log.
type TransactionReceipt ¶
type TransactionReceipt struct { BlockHash string `json:"blockHash"` BlockNumber string `json:"blockNumber"` ContractAddress interface{} `json:"contractAddress"` CumulativeGasUsed string `json:"cumulativeGasUsed"` EffectiveGasPrice string `json:"effectiveGasPrice"` From string `json:"from"` GasUsed string `json:"gasUsed"` Logs []TransactionLog `json:"logs"` LogsBloom string `json:"logsBloom"` Status string `json:"status"` To string `json:"to"` TransactionHash string `json:"transactionHash"` TransactionIndex string `json:"transactionIndex"` Type string `json:"type"` }
TransactionReceipt type represents a single ethereum Transaction.
type TransactionReceiptWorker ¶
type TransactionReceiptWorker struct { NumWorkers int Endpoint string // contains filtered or unexported fields }
func (*TransactionReceiptWorker) Initialize ¶
func (h *TransactionReceiptWorker) Initialize()
type USDPriceWatcher ¶
type USDPriceWatcher struct {
// contains filtered or unexported fields
}
func (*USDPriceWatcher) GetPrice ¶
func (u *USDPriceWatcher) GetPrice() float64
func (*USDPriceWatcher) StartWatching ¶
func (u *USDPriceWatcher) StartWatching()