nebulas

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 TxTypeBinary = "binary"

Variables

This section is empty.

Functions

func NormalizeTx

func NormalizeTx(srcTx Transaction) types.Tx

func NormalizeTxs

func NormalizeTxs(txs []Transaction) types.Txs

Types

type Address

type Address struct {
	Hash string `json:"hash"`
}

type Block

type Block struct {
	Height uint64 `json:"height"`
}

type Client

type Client struct {
	client.Request
}

func (*Client) GetBlockByNumber

func (c *Client) GetBlockByNumber(num int64) ([]Transaction, error)

func (*Client) GetLatestBlock

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

func (*Client) GetTransactions

func (c *Client) GetTransactions(values url.Values) ([]Transaction, error)

func (*Client) GetTxs

func (c *Client) GetTxs(address string, page int) ([]Transaction, error)

type NewBlock

type NewBlock struct {
	Height int64 `json:"height"`
}

type NewBlockResponse

type NewBlockResponse struct {
	Data []NewBlock `json:"data"`
}

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 Response

type Response struct {
	Data ResponseData `json:"data"`
}

type ResponseData

type ResponseData struct {
	Transactions []Transaction `json:"txnList"`
}

type Transaction

type Transaction struct {
	Hash      string      `json:"hash"`
	Type      string      `json:"type"`
	Value     json.Number `json:"value"`
	TxFee     string      `json:"txFee"`
	Nonce     uint64      `json:"nonce"`
	Block     Block       `json:"block"`
	From      Address     `json:"from"`
	To        Address     `json:"to"`
	Timestamp int64       `json:"timestamp"`
	Status    int32       `json:"status"`
}

Jump to

Keyboard shortcuts

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