algorand

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(tx Transaction) (result blockatlas.Tx, ok bool)

func NormalizeTxs

func NormalizeTxs(txs []Transaction) []blockatlas.Tx

Types

type Account

type Account struct {
	Amount                      uint64 `json:"amount"`
	Pendingrewards              uint64 `json:"pendingrewards"`
	Address                     string `json:"address"`
	Round                       uint64 `json:"round"`
	Amountwithoutpendingrewards uint64 `json:"amountwithoutpendingrewards"`
	Rewards                     uint64 `json:"rewards"`
	Status                      string `json:"status"`
}

type BlockResponse

type BlockResponse struct {
	Timestamp    uint64            `json:"timestamp"`
	Transactions BlockTransactions `json:"txns"`
}

type BlockTransactions

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

type Client

type Client struct {
	blockatlas.Request
}

func InitClient

func InitClient(baseUrl string) Client

func (*Client) GetAccount

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

func (*Client) GetBlock

func (c *Client) GetBlock(number int64) (BlockResponse, error)

func (*Client) GetLatestBlock

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

func (*Client) GetTxsInBlock

func (c *Client) GetTxsInBlock(number int64) ([]Transaction, error)

func (*Client) GetTxsOfAddress

func (c *Client) GetTxsOfAddress(address string) ([]Transaction, error)

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

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

func (*Platform) GetActiveValidators added in v1.1.4

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

func (*Platform) GetBlockByNumber

func (p *Platform) GetBlockByNumber(num int64) (*blockatlas.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) GetTxsByAddress

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

func (*Platform) GetValidators

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

func (*Platform) UndelegatedBalance

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

type Status

type Status struct {
	LastRound int64 `json:"lastRound"`
}

type Transaction

type Transaction struct {
	Type      TransactionType    `json:"type"`
	Hash      string             `json:"tx"`
	From      string             `json:"from"`
	Fee       uint64             `json:"fee"`
	Round     uint64             `json:"round"`
	Payment   TransactionPayment `json:"payment"`
	Timestamp uint64             `json:"timestamp,omitempty"`
}

type TransactionPayment

type TransactionPayment struct {
	To     string `json:"to"`
	Amount uint64 `json:"amount"`
}

type TransactionType

type TransactionType string
const (
	TransactionTypePay TransactionType = "pay"
)

type TransactionsResponse

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

Jump to

Keyboard shortcuts

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