stats

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DailyNewAddrCount

type DailyNewAddrCount struct {
	Timestamp    time.Time `etherscan:"unixTimeStamp"`
	NewAddrCount uint64    `etherscan:"newAddressCount,num"`
}

DailyNewAddrCount describes the number of new Ethereum addresses created on a particular day.

type DailyTxFee

type DailyTxFee struct {
	Timestamp time.Time       `etherscan:"unixTimeStamp"`
	TxFeeETH  decimal.Decimal `etherscan:"transactionFee_Eth"`
}

DailyTxFee describes the total amount of transaction fees on a particular day.

type ETHClientTypeReq

type ETHClientTypeReq int32

ETHClientTypeReq is an enumeration of ethereum client types. ENUM(geth,parity)

const (
	// ETHClientTypeReqGeth is a ETHClientTypeReq of type Geth.
	ETHClientTypeReqGeth ETHClientTypeReq = iota
	// ETHClientTypeReqParity is a ETHClientTypeReq of type Parity.
	ETHClientTypeReqParity
)

func ParseETHClientTypeReq

func ParseETHClientTypeReq(name string) (ETHClientTypeReq, error)

ParseETHClientTypeReq attempts to convert a string to a ETHClientTypeReq

func (ETHClientTypeReq) MarshalText

func (x ETHClientTypeReq) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (ETHClientTypeReq) String

func (x ETHClientTypeReq) String() string

String implements the Stringer interface.

func (*ETHClientTypeReq) UnmarshalText

func (x *ETHClientTypeReq) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type ETHClientTypeResult

type ETHClientTypeResult int32

ETHClientTypeResult is an enumeration of ethereum client types. ENUM(Geth,Parity)

const (
	// ETHClientTypeResultGeth is a ETHClientTypeResult of type Geth.
	ETHClientTypeResultGeth ETHClientTypeResult = iota
	// ETHClientTypeResultParity is a ETHClientTypeResult of type Parity.
	ETHClientTypeResultParity
)

func ParseETHClientTypeResult

func ParseETHClientTypeResult(name string) (ETHClientTypeResult, error)

ParseETHClientTypeResult attempts to convert a string to a ETHClientTypeResult

func (ETHClientTypeResult) MarshalText

func (x ETHClientTypeResult) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (ETHClientTypeResult) String

func (x ETHClientTypeResult) String() string

String implements the Stringer interface.

func (*ETHClientTypeResult) UnmarshalText

func (x *ETHClientTypeResult) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type ETHNodeSize

type ETHNodeSize struct {
	BlockNumber    uint64              `etherscan:"blockNumber"`
	ChainTimestamp time.Time           `etherscan:"chainTimeStamp,date"`
	ChainSize      *big.Int            `etherscan:"chainSize"`
	ClientType     ETHClientTypeResult `etherscan:"clientType"`
	SyncMode       NodeSyncModeResult  `etherscan:"syncMode"`
}

ETHNodeSize describes the size of the ethereum blockchain at a particular block number.

type ETHPrice

type ETHPrice struct {
	ETHBTC          decimal.Decimal
	ETHBTCTimestamp time.Time `etherscan:"ethbtc_timestamp"`
	ETHUSD          decimal.Decimal
	ETHUSDTimestamp time.Time `etherscan:"ethusd_timestamp"`
}

ETHPrice describes the price of Ether at a particular time.

type HistoricalETHPrice

type HistoricalETHPrice struct {
	Timestamp time.Time       `etherscan:"unixTimeStamp"`
	USDValue  decimal.Decimal `etherscan:"value"`
}

HistoricalETHPrice describes the price of Ether on a particular day.

type HistoricalMarketCap

type HistoricalMarketCap struct {
	Timestamp time.Time `etherscan:"unixTimeStamp"`
	Supply    decimal.Decimal
	MarketCap decimal.Decimal `etherscan:"marketCap"`
	Price     decimal.Decimal
}

HistoricalMarketCap describes the market cap of Ether on a particular day.

type NetDifficulty

type NetDifficulty struct {
	Difficulty decimal.Decimal `etherscan:"networkDifficulty,comma"`
	Timestamp  time.Time       `etherscan:"unixTimeStamp"`
}

NetDifficulty describes the mining difficulty on a particular day.

type NetworkHashRate

type NetworkHashRate struct {
	NetworkHashRate decimal.Decimal `etherscan:"networkHashRate"`
	Timestamp       time.Time       `etherscan:"unixTimeStamp"`
}

NetworkHashRate describes the total processing power of the ethereum network on a particular day.

type NetworkUtil

type NetworkUtil struct {
	NetworkUtil decimal.Decimal `etherscan:"networkUtilization"`
	Timestamp   time.Time       `etherscan:"unixTimeStamp"`
}

NetworkUtil describes the ethereum network utilization on a particular day.

type NodeCount

type NodeCount struct {
	Date           time.Time `etherscan:"UTCDate,date"`
	TotalNodeCount uint64    `etherscan:"TotalNodeCount"`
}

NodeCount describes the total count of nodes on the ethereum network on a particular date.

type NodeSyncModeReq

type NodeSyncModeReq int32

NodeSyncModeReq is an enumeration of ethereum node sync modes. ENUM(default,archive)

const (
	// NodeSyncModeReqDefault is a NodeSyncModeReq of type Default.
	NodeSyncModeReqDefault NodeSyncModeReq = iota
	// NodeSyncModeReqArchive is a NodeSyncModeReq of type Archive.
	NodeSyncModeReqArchive
)

func ParseNodeSyncModeReq

func ParseNodeSyncModeReq(name string) (NodeSyncModeReq, error)

ParseNodeSyncModeReq attempts to convert a string to a NodeSyncModeReq

func (NodeSyncModeReq) MarshalText

func (x NodeSyncModeReq) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (NodeSyncModeReq) String

func (x NodeSyncModeReq) String() string

String implements the Stringer interface.

func (*NodeSyncModeReq) UnmarshalText

func (x *NodeSyncModeReq) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type NodeSyncModeResult

type NodeSyncModeResult int32

NodeSyncModeResult is an enumeration of ethereum node sync modes. ENUM(Default,Archive)

const (
	// NodeSyncModeResultDefault is a NodeSyncModeResult of type Default.
	NodeSyncModeResultDefault NodeSyncModeResult = iota
	// NodeSyncModeResultArchive is a NodeSyncModeResult of type Archive.
	NodeSyncModeResultArchive
)

func ParseNodeSyncModeResult

func ParseNodeSyncModeResult(name string) (NodeSyncModeResult, error)

ParseNodeSyncModeResult attempts to convert a string to a NodeSyncModeResult

func (NodeSyncModeResult) MarshalText

func (x NodeSyncModeResult) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (NodeSyncModeResult) String

func (x NodeSyncModeResult) String() string

String implements the Stringer interface.

func (*NodeSyncModeResult) UnmarshalText

func (x *NodeSyncModeResult) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type NodesSizeReq

type NodesSizeReq struct {
	StartDate  time.Time `etherscan:"startdate,date"`
	EndDate    time.Time `etherscan:"enddate,date"`
	ClientType ETHClientTypeReq
	SyncMode   NodeSyncModeReq
	Sort       ecommon.SortingPreference
}

NodesSizeReq contains the request parameters for GetEthereumNodesSize.

type StatsClient

type StatsClient struct {
	API *httpapi.APIClient
}

StatsClient is the client for stats actions.

func (*StatsClient) GetDailyAvgHashRate

func (c *StatsClient) GetDailyAvgHashRate(
	ctx context.Context, dates *ecommon.DateRange,
) (result []NetworkHashRate, err error)

GetDailyAvgHashRate returns the historical measure of processing power of the Ethereum network.

func (*StatsClient) GetDailyAvgNetDifficulty

func (c *StatsClient) GetDailyAvgNetDifficulty(
	ctx context.Context, dates *ecommon.DateRange,
) (result []NetDifficulty, err error)

GetDailyAvgNetDifficulty returns the historical mining difficulty of the Ethereum network.

func (*StatsClient) GetDailyNetworkTxFee

func (c *StatsClient) GetDailyNetworkTxFee(
	ctx context.Context, dates *ecommon.DateRange,
) (result []DailyTxFee, err error)

GetDailyNetworkTxFee returns the amount of transaction fees paid to miners per day.

func (*StatsClient) GetDailyNetworkUtil

func (c *StatsClient) GetDailyNetworkUtil(
	ctx context.Context, dates *ecommon.DateRange,
) (result []NetworkUtil, err error)

GetDailyNetworkUtil returns the daily average gas used over gas limit, in percentage.

func (*StatsClient) GetDailyNewAddrCount

func (c *StatsClient) GetDailyNewAddrCount(
	ctx context.Context, dates *ecommon.DateRange,
) (result []DailyNewAddrCount, err error)

GetDailyNewAddrCount returns the number of new Ethereum addresses created per day.

func (*StatsClient) GetDailyTxCount

func (c *StatsClient) GetDailyTxCount(
	ctx context.Context, dates *ecommon.DateRange,
) (result []TxCount, err error)

GetDailyTxCount returns the number of transactions performed on the Ethereum blockchain per day.

func (*StatsClient) GetETHHistoricalDailyMarketCap

func (c *StatsClient) GetETHHistoricalDailyMarketCap(
	ctx context.Context, dates *ecommon.DateRange,
) (result []HistoricalMarketCap, err error)

GetETHHistoricalDailyMarketCap returns the historical Ether daily market capitalization.

func (*StatsClient) GetETHHistoricalPrice

func (c *StatsClient) GetETHHistoricalPrice(
	ctx context.Context, dates *ecommon.DateRange,
) (result []HistoricalETHPrice, err error)

GetETHHistoricalPrice returns the historical price of 1 ETH.

func (*StatsClient) GetEthereumNodesSize

func (c *StatsClient) GetEthereumNodesSize(
	ctx context.Context, req *NodesSizeReq,
) (result []ETHNodeSize, err error)

GetEthereumNodesSize returns the size of the Ethereum blockchain, in bytes, over a date range.

func (*StatsClient) GetLastETHPrice

func (c *StatsClient) GetLastETHPrice(ctx context.Context) (*ETHPrice, error)

GetLastETHPrice returns the latest price of 1 ETH.

func (*StatsClient) GetTotalETHSupply

func (c *StatsClient) GetTotalETHSupply(ctx context.Context) (*big.Int, error)

GetToalETHSupply returns the current amount of Ether in circulation.

func (*StatsClient) GetTotalNodesCount

func (c *StatsClient) GetTotalNodesCount(ctx context.Context) (*NodeCount, error)

GetToalNodesCount returns the total number of discoverable Ethereum nodes.

type TxCount

type TxCount struct {
	Timestamp time.Time `etherscan:"unixTimeStamp"`
	TxCount   *big.Int  `etherscan:"transactionCount,num"`
}

TxCount describes the total transaction count on a particular day.

Jump to

Keyboard shortcuts

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