Function promise_batch_action_stake

Source
pub fn promise_batch_action_stake(
    promise_index: PromiseIndex,
    amount: NearToken,
    public_key: &PublicKey,
)
Expand description

Attach a stake promise action to the NEAR promise index with the provided promise index.

More info about batching here

ยงExamples

use near_sdk::env::{promise_batch_action_stake, promise_batch_create};
use near_sdk::{NearToken, PublicKey, AccountId};
use std::str::FromStr;

let promise = promise_batch_create(
    &AccountId::from_str("receiver.near").unwrap()
);

let pk: PublicKey = "secp256k1:qMoRgcoXai4mBPsdbHi1wfyxF9TdbPCF4qSDQTRP3TfescSRoUdSx6nmeQoN3aiwGzwMyGXAb1gUjBTv5AY8DXj".parse().unwrap();
promise_batch_action_stake(
    promise,
    NearToken::from_near(1),
    &pk
);

More low-level info here: near_vm_runner::logic::VMLogic::promise_batch_action_stake