public class Runtime
extends java.lang.Object
| Constructor and Description |
|---|
Runtime() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkWitness(byte[] scriptHashOrPubkey)
Verifies whether the container (e.g.
|
static long |
getGasLeft()
Gets the amount of GAS left in the current invocation of the contract.
|
static int |
getInvocationCounter()
Gets the call number of the current contract.
|
static Notification[] |
getNotifications(byte[] hash)
Gets current invocation notifications matching the given sender script hash.
|
static java.lang.String |
getPlatform()
Gets information of the platform on which the smart contract is currently executed.
|
static long |
getTime()
Gets the timestamp of the current block.
|
static byte |
getTrigger()
Gets the
TriggerType with which the the smart contract has been triggered. |
static void |
log(java.lang.String message)
Issues a log message, notifying the client that invoked the contract.
|
static void |
notify(java.lang.Object... state)
Issues a notification, notifying the client that invoked the contract.
|
public static byte getTrigger()
TriggerType with which the the smart contract has been triggered.TriggerType.public static java.lang.String getPlatform()
public static long getTime()
public static int getInvocationCounter()
public static long getGasLeft()
public static Notification[] getNotifications(byte[] hash)
hash - The sender script hash to get the notifications for.public static boolean checkWitness(byte[] scriptHashOrPubkey)
scriptHashOrPubkey - The script hash or public key to check.public static void notify(java.lang.Object... state)
The given state can be a list of any types, e.g. `notify("Notification reason", Blockchain .getHeight()`. The client developer needs to know what types to expect when reading the notification.
state - The state to send with the notification.public static void log(java.lang.String message)
This is similar to notify(Object...) but restricted to a string message.
message - The message to log.