vechain

package
v1.1.16-0...-5f6d184 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 12 Imported by: 0

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

func NormalizeTokenTransaction

func NormalizeTokenTransaction(srcTx Tx, receipt TxReceipt) (types.Txs, error)

Types

type Account

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

type Block

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 {
	client.Request
}

func (*Client) GetAccount

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

func (*Client) GetBlockByNumber

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

func (*Client) GetCurrentBlock

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

func (*Client) GetLogsEvent

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

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

func (*Client) GetTransactionReceiptByID

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

func (*Client) GetTransactions

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

type CriteriaSet

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

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

type LogEvent

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

type LogMeta

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

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

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

type Options

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

type Output

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

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

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

func (*Platform) GetBlockByNumber

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

func (*Platform) GetDelegations

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

func (*Platform) GetDetails

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

func (*Platform) GetTokenTxsByAddress

func (p *Platform) GetTokenTxsByAddress(address, token string) (page types.Txs, err error)

func (*Platform) GetTxsByAddress

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

func (*Platform) GetValidators

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

func (*Platform) NormalizeTransaction

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

func (*Platform) UndelegatedBalance

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

type Range

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

type TxReceipt struct {
	Reverted bool     `json:"reverted"`
	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