Version
Show / Hide Table of Contents

Blockchain Class

This class provides a set of methods for accessing blockchain data.

Namespace: Neo.SmartContract.Framework.Services.Neo

Assembly: Neo.SmartContract.Framework

Syntax

public static class Blockchain

Methods

NameDescription
GetBlock(UInt256 hash) Returns a block from the given block hash
GetBlock(uint height) Returns a block from the given block height
GetHeight() Returns the current block height
Height = Index = Count - 1
GetTransaction(UInt256 hash) Returns a transaction from the given transaction ID
GetTransactionFromBlock(UInt256 blockHash, int txIndex) Returns a transaction from the given block hash and transaction index
GetTransactionFromBlock(uint blockIndex, int txIndex) Returns a transaction from the given block index and transaction index
GetTransactionHeight(UInt256 hash) Returns the transaction height from the given block hash
Height = Index = Count - 1

Constructor

The Blockchain class is a static class and does not require a constructor.