pub enum PromiseAction {
    CreateAccount,
    DeployContract {
        code: Vec<u8>,
    },
    FunctionCall {
        function_name: String,
        arguments: Vec<u8>,
        amount: U128,
        gas: U64,
    },
    Transfer {
        amount: U128,
    },
    Stake {
        amount: U128,
        public_key: String,
    },
    AddFullAccessKey {
        public_key: String,
        nonce: Option<U64>,
    },
    AddAccessKey {
        public_key: String,
        allowance: U128,
        receiver_id: AccountId,
        function_names: Vec<String>,
        nonce: Option<U64>,
    },
    DeleteKey {
        public_key: String,
    },
    DeleteAccount {
        beneficiary_id: AccountId,
    },
}
Expand description

Every native NEAR action can be mapped to a Promise action. NOTE: The native ADD_KEY action is split into two: one for adding a full-access key, one for a function call access key.

Variants§

§

CreateAccount

Native CREATE_ACCOUNT action

§

DeployContract

Fields

§code: Vec<u8>

WASM binary blob

Native DEPLOY_CONTRACT action

§

FunctionCall

Fields

§function_name: String

Name of function to call on receiver

§arguments: Vec<u8>

Function input (optional)

§amount: U128

Attached deposit

§gas: U64

Attached gas

Native FUNCTION_CALL action

§

Transfer

Fields

§amount: U128

Amount of NEAR tokens to transfer to receiver

Native TRANSFER action

§

Stake

Fields

§amount: U128

Amount of tokens to stake

§public_key: String

Public key of validator node

Native STAKE action

§

AddFullAccessKey

Fields

§public_key: String

Public key to add to account

§nonce: Option<U64>

Starting nonce (default: 0)

Native ADD_KEY action for full-access keys

§

AddAccessKey

Fields

§public_key: String

Public key to add to account

§allowance: U128

Gas allowance

§receiver_id: AccountId

Target contract account ID

§function_names: Vec<String>

Restrict this key to calls to these functions

§nonce: Option<U64>

Starting nonce (default: 0)

Native ADD_KEY action for function call keys

§

DeleteKey

Fields

§public_key: String

Public key to remove

Native DELETE_KEY action

§

DeleteAccount

Fields

§beneficiary_id: AccountId

Remaining account balance transferred to beneficiary

Native DELETE_ACCOUNT action

Trait Implementations§

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes. Read more
Deserialize this instance from a slice of bytes.
Serialize this instance into a vector of bytes.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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.

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.