harmony

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const Annual = 10

Variables

This section is empty.

Functions

func GetNormalizationError

func GetNormalizationError(err error) error

func NormalizeDelegations added in v1.1.4

func NormalizeDelegations(delegations []Delegation, validators blockatlas.ValidatorMap) []blockatlas.Delegation

func NormalizeTx

func NormalizeTx(trx *Transaction) (tx blockatlas.Tx, b bool, err error)

func NormalizeTxs

func NormalizeTxs(txs []Transaction) blockatlas.TxPage

Types

type BlockInfo

type BlockInfo struct {
	Hash         string        `json:"hash"`
	Number       string        `json:"number"`
	Transactions []Transaction `json:"transactions"`
}

type Client

type Client struct {
	blockatlas.Request
}

func (*Client) CurrentBlockNumber

func (c *Client) CurrentBlockNumber() (int64, error)

func (*Client) GetBalance added in v1.1.4

func (c *Client) GetBalance(address string) (string, error)

func (*Client) GetBlockByNumber

func (c *Client) GetBlockByNumber(num int64) (info BlockInfo, err error)

func (*Client) GetDelegations added in v1.1.4

func (c *Client) GetDelegations(address string) (delegations Delegations, err error)

func (*Client) GetTxsOfAddress

func (c *Client) GetTxsOfAddress(address string) (txPage *TxResult, err error)

func (*Client) GetValidators added in v1.1.4

func (c *Client) GetValidators() (validators Validators, err error)

type Delegation added in v1.1.4

type Delegation struct {
	DelegatorAddress string  `json:"delegator_address"`
	ValidatorAddress string  `json:"validator_address"`
	Amount           float64 `json:"amount"`
}

type Delegations added in v1.1.4

type Delegations struct {
	List []Delegation `json:"result"`
}

type LifetimeInfo added in v1.1.4

type LifetimeInfo struct {
	Apr string `json:"apr"`
}

type Platform

type Platform struct {
	// contains filtered or unexported fields
}

func Init added in v1.1.0

func Init(api string) *Platform

func (*Platform) Coin

func (p *Platform) Coin() coin.Coin

func (*Platform) CurrentBlockNumber

func (p *Platform) CurrentBlockNumber() (int64, error)

func (*Platform) GetActiveValidators added in v1.1.4

func (p *Platform) GetActiveValidators() (blockatlas.StakeValidators, error)

func (*Platform) GetBlockByNumber

func (p *Platform) GetBlockByNumber(num int64) (*blockatlas.Block, error)

func (*Platform) GetDelegations added in v1.1.4

func (p *Platform) GetDelegations(address string) (blockatlas.DelegationsPage, error)

func (*Platform) GetDetails added in v1.1.4

func (p *Platform) GetDetails() blockatlas.StakingDetails

func (*Platform) GetMaxAPR added in v1.1.4

func (p *Platform) GetMaxAPR() float64

func (*Platform) GetTxsByAddress

func (p *Platform) GetTxsByAddress(address string) (blockatlas.TxPage, error)

func (*Platform) GetValidators added in v1.1.4

func (p *Platform) GetValidators() (blockatlas.ValidatorPage, error)

func (*Platform) NormalizeBlock

func (p *Platform) NormalizeBlock(block *BlockInfo) blockatlas.Block

func (*Platform) UndelegatedBalance added in v1.1.4

func (p *Platform) UndelegatedBalance(address string) (string, error)

type Transaction

type Transaction struct {
	BlockHash   string `json:"blockHash"`
	BlockNumber string `json:"blockNumber"`
	From        string `json:"from"`
	Gas         string `json:"gas"`
	GasPrice    string `json:"gasPrice"`
	Hash        string `json:"hash"`
	Nonce       string `json:"nonce"`
	To          string `json:"to"`
	Value       string `json:"value"`
	Timestamp   string `json:"timestamp"`
}

type TxResponse

type TxResponse struct {
	Result TxResult `json:"result"`
}

type TxResult

type TxResult struct {
	Transactions []Transaction `json:"transactions"`
}

type Validator added in v1.1.4

type Validator struct {
	Info     ValidatorInfo `json:"validator"`
	Active   bool          `json:"currently-in-committee"`
	Lifetime LifetimeInfo  `json:"lifetime"`
}

type ValidatorInfo added in v1.1.4

type ValidatorInfo struct {
	Address string `json:"address"`
}

type Validators added in v1.1.4

type Validators struct {
	Validators []Validator `json:"result"`
}

Jump to

Keyboard shortcuts

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