nimiq

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeBlock

func NormalizeBlock(srcBlock *Block) types.Block

NormalizeBlock converts a Nimiq block into the generic model

func NormalizeTx

func NormalizeTx(srcTx *Tx) types.Tx

NormalizeTx converts a Nimiq transaction into the generic model

func NormalizeTxs

func NormalizeTxs(srcTxs []Tx) types.Txs

NormalizeTxs converts multiple Nimiq transactions

Types

type Block

type Block struct {
	Number       int64  `json:"number"`
	Hash         string `json:"hash"`
	PoW          string `json:"pow"`
	ParentHash   string `json:"parentHash"`
	Nonce        uint32 `json:"nonce"`
	BodyHash     string `json:"bodyHash"`
	AccountsHash string `json:"accountsHash"`
	MinerHex     string `json:"miner"`
	Miner        string `json:"minerAddress"`
	Difficulty   string `json:"difficulty"`
	ExtraData    string `json:"extraData"`
	Size         int64  `json:"size"`
	Timestamp    int64  `json:"timestamp"`
	Txs          []Tx   `json:"transactions"`
}

type Client

type Client struct {
	client.Request
}

func (*Client) CurrentBlockNumber

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

func (*Client) GetBlockByNumber

func (c *Client) GetBlockByNumber(num int64) (b *Block, err error)

func (*Client) GetTxsOfAddress

func (c *Client) GetTxsOfAddress(address string) (tx []Tx, 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)

type Tx

type Tx struct {
	Hash          string       `json:"hash"`
	BlockHash     string       `json:"blockHash"`
	BlockNumber   uint64       `json:"blockNumber"`
	Timestamp     json.Number  `json:"timestamp"`
	Confirmations int          `json:"confirmations"`
	TxIndex       int          `json:"transactionIndex"`
	FromAddress   string       `json:"fromAddress"`
	ToAddress     string       `json:"toAddress"`
	Value         types.Amount `json:"value"`
	Fee           types.Amount `json:"fee"`
}

Jump to

Keyboard shortcuts

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