block

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceUpdates

type BalanceUpdates struct {
	Kind     string `json:"kind"`
	Contract string `json:"contract,omitempty"`
	Change   string `json:"change"`
	Category string `json:"category,omitempty"`
	Delegate string `json:"delegate,omitempty"`
	Cycle    int    `json:"cycle,omitempty"`
	Level    int    `json:"level,omitempty"`
}

BalanceUpdates is the BalanceUpdates found in the Metadata of a block returned by the Tezos RPC API.

type Block

type Block struct {
	Protocol   string         `json:"protocol"`
	ChainID    string         `json:"chain_id"`
	Hash       string         `json:"hash"`
	Header     Header         `json:"header"`
	Metadata   Metadata       `json:"metadata"`
	Operations [][]Operations `json:"operations"`
}

Block is a block returned by the Tezos RPC API.

type BlockService

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

BlockService is a struct wrapper for all block functions

func NewBlockService

func NewBlockService(tzclient tzc.TezosClient) *BlockService

NewBlockService creates a new BlockService

func (*BlockService) Get

func (b *BlockService) Get(id interface{}) (Block, error)

Get returns a Block at a specific level or hash

func (*BlockService) GetHead

func (b *BlockService) GetHead() (Block, error)

GetHead returns the head block

func (*BlockService) IDToString

func (b *BlockService) IDToString(id interface{}) (string, error)

IDToString returns a queryable block reference for a specific level or hash

type Contents

type Contents struct {
	Kind             string            `json:"kind,omitempty"`
	Source           string            `json:"source,omitempty"`
	Fee              string            `json:"fee,omitempty"`
	Counter          string            `json:"counter,omitempty"`
	GasLimit         string            `json:"gas_limit,omitempty"`
	StorageLimit     string            `json:"storage_limit,omitempty"`
	Amount           string            `json:"amount,omitempty"`
	Destination      string            `json:"destination,omitempty"`
	Delegate         string            `json:"delegate,omitempty"`
	Phk              string            `json:"phk,omitempty"`
	Secret           string            `json:"secret,omitempty"`
	Level            int               `json:"level,omitempty"`
	ManagerPublicKey string            `json:"managerPubkey,omitempty"`
	Balance          string            `json:"balance,omitempty"`
	Period           int               `json:"period,omitempty"`
	Proposal         string            `json:"proposal,omitempty"`
	Proposals        []string          `json:"proposals,omitempty"`
	Ballot           string            `json:"ballot,omitempty"`
	Metadata         *ContentsMetadata `json:"metadata,omitempty"`
}

Contents is the Contents found in a operation of a block returned by the Tezos RPC API.

type ContentsMetadata

type ContentsMetadata struct {
	BalanceUpdates  []BalanceUpdates `json:"balance_updates"`
	OperationResult *OperationResult `json:"operation_result,omitempty"`
	Slots           []int            `json:"slots"`
}

ContentsMetadata is the Metadata found in the Contents in a operation of a block returned by the Tezos RPC API.

type Error

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

Error is the Error found in the OperationResult in a metadata of operation of a block returned by the Tezos RPC API.

type Header struct {
	Level            int       `json:"level"`
	Proto            int       `json:"proto"`
	Predecessor      string    `json:"Predecessor"`
	Timestamp        time.Time `json:"timestamp"`
	ValidationPass   int       `json:"validation_pass"`
	OperationsHash   string    `json:"operations_hash"`
	Fitness          []string  `json:"fitness"`
	Context          string    `json:"context"`
	Priority         int       `json:"priority"`
	ProofOfWorkNonce string    `json:"proof_of_work_nonce"`
	Signature        string    `json:"signature"`
}

Header is a header in a block returned by the Tezos RPC API.

type Level

type Level struct {
	Level                int  `json:"level"`
	LevelPosition        int  `json:"level_position"`
	Cycle                int  `json:"cycle"`
	CyclePosition        int  `json:"cycle_position"`
	VotingPeriod         int  `json:"voting_period"`
	VotingPeriodPosition int  `json:"voting_period_position"`
	ExpectedCommitment   bool `json:"expected_commitment"`
}

Level the Level found in the Metadata of a block returned by the Tezos RPC API.

type MaxOperationListLength

type MaxOperationListLength struct {
	MaxSize int `json:"max_size"`
	MaxOp   int `json:"max_op,omitempty"`
}

MaxOperationListLength is the MaxOperationListLength found in the Metadata of a block returned by the Tezos RPC API.

type Metadata

type Metadata struct {
	Protocol               string                   `json:"protocol"`
	NextProtocol           string                   `json:"next_protocol"`
	TestChainStatus        TestChainStatus          `json:"test_chain_status"`
	MaxOperationsTTL       int                      `json:"max_operations_ttl"`
	MaxOperationDataLength int                      `json:"max_operation_data_length"`
	MaxBlockHeaderLength   int                      `json:"max_block_header_length"`
	MaxOperationListLength []MaxOperationListLength `json:"max_operation_list_length"`
	Baker                  string                   `json:"baker"`
	Level                  Level                    `json:"level"`
	VotingPeriodKind       string                   `json:"voting_period_kind"`
	NonceHash              interface{}              `json:"nonce_hash"`
	ConsumedGas            string                   `json:"consumed_gas"`
	Deactivated            []string                 `json:"deactivated"`
	BalanceUpdates         []BalanceUpdates         `json:"balance_updates"`
}

Metadata is the Metadata in a block returned by the Tezos RPC API.

type OperationResult

type OperationResult struct {
	Status      string  `json:"status"`
	ConsumedGas string  `json:"consumed_gas,omitempty"`
	Errors      []Error `json:"errors,omitempty"`
}

OperationResult is the OperationResult found in metadata of block returned by the Tezos RPC API.

type Operations

type Operations struct {
	Protocol  string     `json:"protocol"`
	ChainID   string     `json:"chain_id"`
	Hash      string     `json:"hash"`
	Branch    string     `json:"branch"`
	Contents  []Contents `json:"contents"`
	Signature string     `json:"signature"`
}

Operations is the Operations found in a block returned by the Tezos RPC API.

type TestChainStatus

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

TestChainStatus is the TestChainStatus found in the Metadata of a block returned by the Tezos RPC API.

type TezosBlockService

type TezosBlockService interface {
	GetHead() (Block, error)
	Get(id interface{}) (Block, error)
	IDToString(id interface{}) (string, error)
}

Jump to

Keyboard shortcuts

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