algorand

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

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

func NormalizeTxs

func NormalizeTxs(txs []Transaction) []types.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 []Transaction `json:"transactions"`
}

type Client

type Client struct {
	client.Request
}

func InitClient

func InitClient(url, apiKey string) Client

func (*Client) GetAccount

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

deprecated, no longer need to support staking

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, apiKey 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) (*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) GetTxsByAddress

func (p *Platform) GetTxsByAddress(address string) (types.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 {
	Block string `json:"message"`
}

type Transaction

type Transaction struct {
	Type      TransactionType    `json:"tx-type"`
	Hash      string             `json:"id"`
	From      string             `json:"sender"`
	Fee       uint64             `json:"fee"`
	Round     uint64             `json:"confirmed-round"`
	Payment   TransactionPayment `json:"payment-transaction"`
	Timestamp uint64             `json:"round-time"`
}

type TransactionPayment

type TransactionPayment struct {
	Receiver string `json:"receiver"`
	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