harmony

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Annual = 10

Variables

This section is empty.

Functions

func NormalizeTx

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

func NormalizeTxs

func NormalizeTxs(txs []Transaction) types.Txs

Types

type BlockInfo

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

type Client

type Client struct {
	client.Request
}

func (*Client) CurrentBlockNumber

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

func (*Client) GetBalance

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

func (*Client) GetBlockByNumber

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

func (*Client) GetTxsOfAddress

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

type Platform

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

func Init

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) GetBlockByNumber

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

func (*Platform) GetTxsByAddress

func (p *Platform) GetTxsByAddress(address string) (types.Txs, error)

func (*Platform) NormalizeBlock

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

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"`
}

Jump to

Keyboard shortcuts

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