vechain

package
v1.1.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// The current value comes from https://www.stakingrewards.com/asset/vechain
	Annual = 1.35
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account added in v1.1.0

type Account struct {
	Balance string `json:"balance"`
}

type Block added in v1.0.37

type Block struct {
	Id           string   `json:"id"`
	Number       int64    `json:"number"`
	Transactions []string `json:"transactions"`
}

type Clause

type Clause struct {
	To   string `json:"to"`
	Data string `json:"data"`
}

type Client

type Client struct {
	blockatlas.Request
}

func (*Client) GetAccount added in v1.1.0

func (c *Client) GetAccount(address string) (account Account, err error)

func (*Client) GetBlockByNumber added in v1.0.37

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

func (*Client) GetCurrentBlock added in v1.0.37

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

func (*Client) GetLogsEvent added in v1.0.37

func (c *Client) GetLogsEvent(address, token string, block int64) (txs []LogEvent, err error)

Get events related to address and VIP180 contract address

func (*Client) GetTransactionByID added in v1.0.37

func (c *Client) GetTransactionByID(id string) (transaction Tx, err error)

func (*Client) GetTransactionReceiptByID added in v1.0.37

func (c *Client) GetTransactionReceiptByID(id string) (transaction TxReceipt, err error)

func (*Client) GetTransactions added in v1.0.37

func (c *Client) GetTransactions(address string, block int64) (txs []LogTransfer, err error)

type CriteriaSet added in v1.0.37

type CriteriaSet struct {
	Sender    string `json:"sender,omitempty"`
	Recipient string `json:"recipient,omitempty"`
	Address   string `json:"address,omitempty"`
	Topic0    string `json:"topic0,omitempty"` // Raw transaction hash
	Topic1    string `json:"topic1,omitempty"` // Sender
	Topic2    string `json:"topic2,omitempty"` // Receiver
}

type Event added in v1.0.37

type Event struct {
	Address string   `json:"address"`
	Topics  []string `json:"topics"`
	Data    string   `json:"data"`
}

type LogEvent added in v1.0.37

type LogEvent struct {
	Meta LogMeta `json:"meta"`
}

type LogMeta added in v1.0.37

type LogMeta struct {
	TxId           string `json:"txID,omitempty"`
	TxOrigin       string `json:"txOrigin,omitempty"`
	BlockId        string `json:"blockID,omitempty"`
	BlockNumber    uint64 `json:"blockNumber,omitempty"`
	BlockTimestamp int64  `json:"blockTimestamp,omitempty"`
}

type LogRequest added in v1.0.37

type LogRequest struct {
	Options     Options       `json:"options,omitempty"`
	CriteriaSet []CriteriaSet `json:"criteriaSet,omitempty"`
	Range       Range         `json:"range,omitempty"`
	Order       string        `json:"order,omitempty"`
}

type LogTransfer added in v1.0.37

type LogTransfer struct {
	Sender    string  `json:"sender"`
	Recipient string  `json:"recipient"`
	Amount    string  `json:"amount"`
	Meta      LogMeta `json:"meta"`
}

type Options added in v1.0.37

type Options struct {
	Offset int64 `json:"offset"`
	Limit  int64 `json:"limit"`
}

type Output added in v1.0.37

type Output struct {
	Events []Event `json:"events"`
}

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 added in v1.0.37

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

func (*Platform) GetActiveValidators added in v1.1.4

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

func (*Platform) GetBlockByNumber added in v1.0.37

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

func (*Platform) GetDelegations added in v1.1.0

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

func (*Platform) GetDetails added in v1.1.0

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

func (*Platform) GetTokenTxsByAddress added in v1.0.37

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

func (*Platform) GetTxsByAddress added in v1.0.37

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

func (*Platform) GetValidators added in v1.1.0

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

func (*Platform) NormalizeTokenTransaction added in v1.1.0

func (p *Platform) NormalizeTokenTransaction(srcTx Tx, receipt TxReceipt) (blockatlas.TxPage, error)

func (*Platform) NormalizeTransaction added in v1.1.0

func (p *Platform) NormalizeTransaction(srcTx LogTransfer, trxId Tx, addr string) (blockatlas.Tx, error)

func (*Platform) UndelegatedBalance added in v1.1.0

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

type Range added in v1.0.37

type Range struct {
	Unit string `json:"unit"`
	From int64  `json:"from"`
	To   int64  `json:"to"`
}

type Tx

type Tx struct {
	Id      string   `json:"id"`
	Origin  string   `json:"origin"`
	Clauses []Clause `json:"clauses"`
	Gas     int      `json:"gas"`
	Nonce   string   `json:"nonce"`
	Meta    LogMeta  `json:"meta"`
}

type TxReceipt added in v1.0.37

type TxReceipt struct {
	Paid    string   `json:"paid"`
	Outputs []Output `json:"outputs"`
}

Jump to

Keyboard shortcuts

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