Function promise_batch_action_add_key_with_full_access

Source
pub fn promise_batch_action_add_key_with_full_access(
    promise_index: PromiseIndex,
    public_key: &PublicKey,
    nonce: u64,
)
Expand description

Attach promise action that adds a full access key to the NEAR promise index with the provided promise index.

More info about batching here

ยงExamples

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

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

let pk: PublicKey = "secp256k1:qMoRgcoXai4mBPsdbHi1wfyxF9TdbPCF4qSDQTRP3TfescSRoUdSx6nmeQoN3aiwGzwMyGXAb1gUjBTv5AY8DXj".parse().unwrap();
let nonce = 55;
promise_batch_action_add_key_with_full_access(
    promise,
    &pk,
    nonce
);

More low-level info here: near_vm_runner::logic::VMLogic::promise_batch_action_add_key_with_full_access See example of usage here