currentAccountId : () -> String
Gets the account ID of the current contract that we are executing. This function will overwrite the contents of register 0.
Returns:
type | description |
---|---|
String |
The account ID |
Examples:
Context.currentAccountId()
signerAccountId : () -> String
All contract calls are a result of some transaction that was signed by some account using some access key and submitted into a memory pool (either through the wallet using RPC or by a node itself). This function returns the ID of that account. This function will overwrite the contents of register 0.
Returns:
type | description |
---|---|
String |
The account ID |
Examples:
Context.signerAccountId()
signerAccountPublicKey : () -> Bytes
Saves the public key of the access key that was used by the signer into the register. In rare situations smart contract might want to know the exact access key that was used to send the original transaction, e.g. to increase the allowance or manipulate with the public key. This function will overwrite the contents of register 0.
Returns:
type | description |
---|---|
Bytes |
The account public key |
Examples:
Context.signerAccountPublicKey()
predecessorAccountId : () -> String
All contract calls are a result of a receipt, this receipt might be created by a transaction that does function invocation on the contract or another contract as a result of cross-contract call. This function will overwrite the contents of register 0.
Returns:
type | description |
---|---|
String |
The account ID |
Examples:
Context.predecessorAccountId()
blockHeight : () -> Int64
Returns the current block height.
Returns:
type | description |
---|---|
Int64 |
The current block height |
Examples:
Context.blockHeight()
blockTimestamp : () -> Int64
Returns the current block timestamp (number of non-leap-nanoseconds since January 1, 1970 0:00:00 UTC).
Returns:
type | description |
---|---|
Int64 |
The current block timestamp |
Examples:
Context.blockTimestamp()
epochHeight : () -> Int64
Returns the current epoch height.
Returns:
type | description |
---|---|
Int64 |
The current epoch height |
Examples:
Context.epochHeight()
storageUsage : () -> Int64
Returns the number of bytes used by the contract if it was saved to the trie as of the invocation. This includes:
Returns:
type | description |
---|---|
Int64 |
The current storage usage |
Examples:
Context.storageUsage()
inputBytes : () -> Bytes
Reads the input to the contract call, formatted as a byte sequence. This function overwrites the contents of register 0.
Returns:
type | description |
---|---|
Bytes |
The input to the contract |
Examples:
Context.inputBytes()
inputStringUnsafe : () -> String
Reads the input to the contract call, formatted as a string. This function is “unsafe” because it does not perform any validation on the input byte sequence to ensure that it is a valid UTF-8 string. This function overwrites the contents of register 0.
Returns:
type | description |
---|---|
String |
The input to the contract |
Examples:
Context.inputStringUnsafe()