tezos

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: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TxTypeTransaction string = "transaction"
	TxTypeDelegation  string = "delegation"

	TxStatusApplied string = "applied"
)
View Source
const (
	Annual             = 6.09
	LockTime           = 0
	MinimumStakeAmount = "0"
)

Variables

This section is empty.

Functions

func NormalizeDelegation added in v1.0.37

func NormalizeDelegation(account Account, validators blockatlas.ValidatorMap) (blockatlas.DelegationsPage, error)

func NormalizeRpcBlock added in v1.1.15

func NormalizeRpcBlock(block RpcBlock) (*types.Block, error)

func NormalizeRpcTransaction added in v1.1.15

func NormalizeRpcTransaction(tx RpcTransaction, header RpcBlockHeader) (types.Tx, error)

func NormalizeStakeValidator added in v1.1.15

func NormalizeStakeValidator(baker Baker, assetValidator assets.AssetValidator) blockatlas.StakeValidator

func NormalizeTx added in v1.0.37

func NormalizeTx(srcTx Transaction, address string) (types.Tx, bool)

NormalizeTx converts a Tezos transaction into the generic model

func NormalizeTxs added in v1.0.37

func NormalizeTxs(srcTxs []Transaction, address string) (txs []types.Tx)

Types

type Account added in v1.0.37

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

type ActivityValidatorInfo added in v1.1.4

type ActivityValidatorInfo struct {
	Deactivated bool `json:"deactivated"`
}

type Baker added in v1.1.15

type Baker struct {
	Address           string  `json:"address"`
	Name              string  `json:"name"`
	FreeSpace         float64 `json:"freeSpace"`
	Fee               float64 `json:"fee"`
	MinDelegation     float64 `json:"minDelegation"`
	OpenForDelegation bool    `json:"openForDelegation"`
	EstimatedRoi      float64 `json:"estimatedRoi"`
	ServiceHealth     string  `json:"serviceHealth"`
}

type BakerClient added in v1.1.15

type BakerClient struct {
	client.Request
}

func (*BakerClient) GetBakers added in v1.1.15

func (c *BakerClient) GetBakers() (validators blockatlas.StakeValidators, err error)

type Client added in v1.0.0

type Client struct {
	client.Request
}

func (*Client) GetTxsOfAddress added in v1.0.0

func (c *Client) GetTxsOfAddress(address string, txType []string) (txs ExplorerAccount, err error)

type Error added in v1.1.0

type Error struct {
	ID   string `json:"id"`
	Kind string `json:"kind"`
}

type ExplorerAccount added in v1.1.0

type ExplorerAccount struct {
	Transactions []Transaction `json:"ops"`
}

type OperationResult added in v1.1.15

type OperationResult struct {
	Status string `json:"status"`
}

type PeriodType added in v1.1.0

type PeriodType string
const (
	TestingPeriodType PeriodType = "testing"
)

type Platform added in v1.0.0

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

func Init added in v1.1.0

func Init(api, rpc, baker string) *Platform

func (*Platform) Coin added in v1.0.0

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

func (*Platform) GetDelegations added in v1.0.37

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

func (*Platform) GetDetails added in v1.0.37

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

func (*Platform) GetTxsByAddress added in v1.0.0

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

func (*Platform) GetValidators added in v1.0.37

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

func (*Platform) UndelegatedBalance added in v1.0.37

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

type RpcBlock added in v1.1.15

type RpcBlock struct {
	Header     RpcBlockHeader         `json:"header"`
	Operations []RpcOperationContents `json:"operations"`
}

type RpcBlockHeader added in v1.1.15

type RpcBlockHeader struct {
	Level     int64  `json:"level"`
	Timestamp string `json:"timestamp"`
}

type RpcClient added in v1.0.37

type RpcClient struct {
	client.Request
}

func (*RpcClient) GetAccount added in v1.0.37

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

func (*RpcClient) GetBlockByNumber added in v1.1.15

func (c *RpcClient) GetBlockByNumber(num int64) (block RpcBlock, err error)

func (*RpcClient) GetBlockHead added in v1.1.15

func (c *RpcClient) GetBlockHead() (int64, error)

func (*RpcClient) GetPeriodType added in v1.1.0

func (c *RpcClient) GetPeriodType() (periodType PeriodType, err error)

func (*RpcClient) GetValidators added in v1.0.37

func (c *RpcClient) GetValidators(blockID string) (validators []Validator, err error)

type RpcMetadata added in v1.1.15

type RpcMetadata struct {
	OperationResult OperationResult `json:"operation_result"`
}

type RpcOperationContent added in v1.1.15

type RpcOperationContent struct {
	Hash     string        `json:"hash"`
	Contents []interface{} `json:"contents"`
}

type RpcOperationContents added in v1.1.15

type RpcOperationContents []RpcOperationContent

type RpcTransaction added in v1.1.15

type RpcTransaction struct {
	Kind         string      `json:"kind"`
	Source       string      `json:"source"`
	Fee          string      `json:"fee"`
	Counter      string      `json:"counter"`
	GasLimit     string      `json:"gas_limit"`
	StorageLimit string      `json:"storage_limit"`
	Amount       string      `json:"amount,omitempty"`
	Destination  string      `json:"destination,omitempty"`
	Delegate     string      `json:"delegate,omitempty"`
	Metadata     RpcMetadata `json:"metadata"`
}

type Transaction added in v1.0.37

type Transaction struct {
	Delegate  string  `json:"delegate"` // Current delegate (may be self when registered as delegate).
	Errors    []Error `json:"errors"`   // Operation status applied, failed, backtracked, skipped.
	Fee       float64 `json:"fee"`      // Total fee paid (and frozen) by all operations.
	Hash      string  `json:"hash"`     // Operation hash.
	Height    uint64  `json:"height"`
	IsSuccess bool    `json:"is_success"` // Flag indicating operation was successfully applied.
	Receiver  string  `json:"receiver"`
	Sender    string  `json:"sender"`
	Stat      string  `json:"status"` // Operation status applied, failed, backtracked, skipped.
	Time      string  `json:"time"`   // Block time at which the operation was included on-chain e.g: 2019-09-28T13:10:51Z
	Type      string  `json:"type"`   // Operation type, one of activate_account, double_baking_evidence, double_endorsement_evidence, seed_nonce_revelation, transaction, origination, delegation, reveal, endorsement, proposals, ballot.
	Volume    float64 `json:"volume"`
}

func (*Transaction) BlockTimestamp added in v1.1.0

func (t *Transaction) BlockTimestamp() int64

func (*Transaction) Direction added in v1.1.0

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

func (*Transaction) ErrorMsg added in v1.1.0

func (t *Transaction) ErrorMsg() string

func (*Transaction) GetReceiver added in v1.1.0

func (t *Transaction) GetReceiver() string

func (*Transaction) Status added in v1.0.37

func (t *Transaction) Status() types.Status

func (*Transaction) Title added in v1.1.0

func (t *Transaction) Title(address string) (types.KeyTitle, bool)

func (*Transaction) TransferType added in v1.1.0

func (t *Transaction) TransferType() (types.TransactionType, bool)

type Validator added in v1.0.37

type Validator struct {
	Address string `json:"pkh"`
}

Jump to

Keyboard shortcuts

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