blockchain

package
v0.78.5-pre Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package blockchain provides functions to access various blockchain data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccount

func GetAccount(scriptHash []byte) account.Account

GetAccount returns account found by the given script hash (160 bit in BE format represented as a slice of 20 bytes). Refer to the `account` package for details on how to use the returned structure. This function uses `Neo.Blockchain.GetAccount` syscall.

func GetAsset

func GetAsset(assetID []byte) asset.Asset

GetAsset returns asset found by the given asset ID (256 bit in BE format represented as a slice of 32 bytes). Refer to the `asset` package for possible uses of returned structure. This function uses `Neo.Blockchain.GetAsset` syscall.

func GetBlock

func GetBlock(heightOrHash interface{}) block.Block

GetBlock returns block found by the given hash or index (with the same encoding as for GetHeader). Refer to the `block` package for possible uses of returned structure. This function uses `Neo.Blockchain.GetBlock` syscall.

func GetContract

func GetContract(scriptHash []byte) contract.Contract

GetContract returns contract found by the given script hash (160 bit in BE format represented as a slice of 20 bytes). Refer to the `contract` package for details on how to use the returned structure. This function uses `Neo.Blockchain.GetContract` syscall.

func GetHeader

func GetHeader(heightOrHash interface{}) header.Header

GetHeader returns header found by the given hash (256 bit hash in BE format represented as a slice of 32 bytes) or index (integer). Refer to the `header` package for possible uses of returned structure. This function uses `Neo.Blockchain.GetHeader` syscall.

func GetHeight

func GetHeight() int

GetHeight returns current block height (index of the last accepted block). Note that when transaction is being run as a part of new block this block is considered as not yet accepted (persisted) and thus you'll get an index of the previous (already accepted) block. This function uses `Neo.Blockchain.GetHeight` syscall.

func GetTransaction

func GetTransaction(hash []byte) transaction.Transaction

GetTransaction returns transaction found by the given (256 bit in BE format represented as a slice of 32 bytes). Refer to the `transaction` package for possible uses of returned structure. This function uses `Neo.Blockchain.GetTransaction` syscall.

func GetTransactionHeight added in v0.75.0

func GetTransactionHeight(hash []byte) int

GetTransactionHeight returns transaction's height (index of the block that includes it) by the given ID (256 bit in BE format represented as a slice of 32 bytes). This function uses `Neo.Blockchain.GetTransactionHeight` syscall.

func GetValidators

func GetValidators() [][]byte

GetValidators returns a slice of current validators public keys represented as a compressed serialized byte slice (33 bytes long). This function uses `Neo.Blockchain.GetValidators` syscall.

Types

This section is empty.

Jump to

Keyboard shortcuts

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