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 currentBlockTimeMilliseconds: number; 
  readonly currentHeight: number; 
  readonly currentTransaction: Transaction; 
  readonly currentCallerContract: Address | undefined; 
  readonly currentNEOTransfers: readonly Transfer[]; 
  readonly currentGASTransfers: readonly Transfer[]; 
  readonly networkNumber: number; 
  readonly randomNumber: number; 
  readonly [OpaqueTagSymbol0]: unique symbol; 
} 

Properties

currentBlockTime
number
Time of the current Block in seconds. 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.
currentBlockTimeMilliseconds
number
Time of the current Block in milliseconds.
currentHeight
number
Index of the latest Block persisted to the blockchain.
currentTransaction
Transaction 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.
currentNEOTransfers
readonly Transfer[]
An array of recent NEO Transfers.
currentGASTransfers
readonly Transfer[]
An array of recent GAS Transfers.
networkNumber
number
The current number of the network.
randomNumber
number
Returns a cryptographically secure random number.
  • @neo-one/client
  • @neo-one/smart-contract
DOCS
InstallationMain ConceptsAdvanced GuidesAPI ReferenceContributing
CHANNELS
GitHubStack OverflowDiscord ChatTwitterYouTube
COPYRIGHT © 2021 NEO•ONE