elrond

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeTx

func NormalizeTx(srcTx Transaction, address string, block Block) (tx types.Tx, ok bool)

NormalizeTx converts an Elrond transaction into the generic model

func NormalizeTxs

func NormalizeTxs(srcTxs []Transaction, address string, block Block) (txs types.Txs)

NormalizeTx converts an slice of Elrond transaction info a slice of generic model transaction

Types

type Block

type Block struct {
	Nonce        uint64        `json:"nonce"`
	Round        uint64        `json:"round"`
	Hash         string        `json:"hash"`
	Transactions []Transaction `json:"transactions"`
}

type BlockResponse

type BlockResponse struct {
	Block Block `json:"hyperblock"`
}

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(height int64) (*types.Block, error)

func (*Client) GetTxsOfAddress

func (c *Client) GetTxsOfAddress(address string) (types.Txs, error)

type GenericResponse

type GenericResponse struct {
	Data  json.RawMessage `json:"data"`
	Code  string          `json:"code"`
	Error string          `json:"error"`
}

type NetworkStatus

type NetworkStatus struct {
	Status StatusDetails `json:"status"`
}

type Platform

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

func Init

func Init(coin uint, 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 StatusDetails

type StatusDetails struct {
	Round float64 `json:"erd_current_round"`
	Epoch float64 `json:"erd_epoch_number"`
	Nonce float64 `json:"erd_nonce"`
}

type Transaction

type Transaction struct {
	Hash      string        `json:"hash"`
	Nonce     uint64        `json:"nonce"`
	Value     string        `json:"value"`
	Receiver  string        `json:"receiver"`
	Sender    string        `json:"sender"`
	Data      string        `json:"data"`
	Timestamp time.Duration `json:"timestamp"`
	Status    string        `json:"status"`
	Fee       string        `json:"fee"`
	GasPrice  uint64        `json:"gasPrice,omitempty"`
	GasLimit  uint64        `json:"gasLimit,omitempty"`
}

func (*Transaction) Direction

func (tx *Transaction) Direction(address string) types.Direction

func (*Transaction) HasNegativeValue

func (tx *Transaction) HasNegativeValue() bool

func (*Transaction) TxFee

func (tx *Transaction) TxFee() types.Amount

func (*Transaction) TxStatus

func (tx *Transaction) TxStatus() types.Status

func (*Transaction) TxTimestamp

func (tx *Transaction) TxTimestamp(blockRound uint64) time.Duration

type TransactionsPage

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

Jump to

Keyboard shortcuts

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