pub struct VMContext {
Show 16 fields pub current_account_id: String, pub signer_account_id: String, pub signer_account_pk: Vec<u8, Global>, pub predecessor_account_id: String, pub input: Vec<u8, Global>, pub block_index: u64, pub block_timestamp: u64, pub epoch_height: u64, pub account_balance: u128, pub account_locked_balance: u128, pub storage_usage: u64, pub attached_deposit: u128, pub prepaid_gas: u64, pub random_seed: Vec<u8, Global>, pub is_view: bool, pub output_data_receivers: Vec<String, Global>,
}
Expand description

Context for the contract execution.

Fields

current_account_id: String

The account id of the current contract that we are executing.

signer_account_id: String

The account id of that signed the original transaction that led to this execution.

signer_account_pk: Vec<u8, Global>

The public key that was used to sign the original transaction that led to this execution.

predecessor_account_id: String

If this execution is the result of cross-contract call or a callback then predecessor is the account that called it. If this execution is the result of direct execution of transaction then it is equal to signer_account_id.

input: Vec<u8, Global>

The input to the contract call. Encoded as base64 string to be able to pass input in borsh binary format.

block_index: u64

The current block height.

block_timestamp: u64

The current block timestamp (number of non-leap-nanoseconds since January 1, 1970 0:00:00 UTC).

epoch_height: u64

The current epoch height.

account_balance: u128

The balance attached to the given account. Excludes the attached_deposit that was attached to the transaction.

account_locked_balance: u128

The balance of locked tokens on the given account.

storage_usage: u64

The account’s storage usage before the contract execution

attached_deposit: u128

The balance that was attached to the call that will be immediately deposited before the contract execution starts.

prepaid_gas: u64

The gas attached to the call that can be used to pay for the gas fees.

random_seed: Vec<u8, Global>

Initial seed for randomness

is_view: bool

Whether the execution should not charge any costs.

output_data_receivers: Vec<String, Global>

How many DataReceipt’s should receive this execution result. This should be empty if this function call is a part of a batch and it is not the last action.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.