Documentation ¶
Overview ¶
Package blockchain provides functions to access various blockchain data.
Index ¶
- func GetAccount(scriptHash []byte) account.Account
- func GetAsset(assetID []byte) asset.Asset
- func GetBlock(heightOrHash interface{}) block.Block
- func GetContract(scriptHash []byte) contract.Contract
- func GetHeader(heightOrHash interface{}) header.Header
- func GetHeight() int
- func GetTransaction(hash []byte) transaction.Transaction
- func GetTransactionHeight(hash []byte) int
- func GetValidators() [][]byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAccount ¶
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 ¶
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 ¶
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 ¶
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 ¶
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
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.