Blockchain

Const
Holds properties about the current state of the blockchain, the current Transaction and the current caller Contract. See the Standard Library chapter of the main guide for more information.
export interface Blockchain { 
  readonly currentBlockTime: number; 
  readonly currentHeight: number; 
  readonly currentTransaction: InvocationTransaction; 
  readonly currentCallerContract: Address | undefined; 
  readonly [OpaqueTagSymbol0]: unique symbol; 
} 

Properties

currentBlockTime
number
Time of the current Block. During execution, this is the timestamp of the Block that this Transaction will be included in. During verification, this is the timestamp of the latest Block + 15 seconds which represents the earliest possible timestamp of the Block that this Transaction will be included in.
currentHeight
number
Index of the latest Block persisted to the blockchain.
currentTransaction
InvocationTransaction this smart contract is executed in.
currentCallerContract
Address | undefined
The Address of the smart contract that directly invoked the contract. Will be undefined if the smart contract method was not invoked by another smart contract, but instead was invoked by a user directly.
  • @neo-one/client
  • @neo-one/smart-contract
DOCS
InstallationMain ConceptsAdvanced GuidesAPI ReferenceContributing
CHANNELS
GitHubStack OverflowDiscord ChatTwitterYouTube
COPYRIGHT © 2021 NEO•ONE