Struct near_workspaces::operations::Transaction
source · [−]pub struct Transaction<'a> { /* private fields */ }Expand description
A builder-like object that will allow specifying various actions to be performed in a single transaction. For details on each of the actions, find them in NEAR transactions.
All actions are performed on the account specified by receiver_id. This object
is most commonly constructed from Account::batch or [Contract::batch],
where receiver_id is specified in the Account::batch while Contract::id()
is used by default for Contract::batch.
Implementations
sourceimpl<'a> Transaction<'a>
impl<'a> Transaction<'a>
sourcepub fn add_key(self, pk: PublicKey, ak: AccessKey) -> Self
pub fn add_key(self, pk: PublicKey, ak: AccessKey) -> Self
Adds a key to the receiver_id’s account, where the public key can be used
later to delete the same key.
sourcepub fn call(self, function: Function<'_>) -> Self
pub fn call(self, function: Function<'_>) -> Self
Call into the receiver_id’s contract with the specific function arguments.
sourcepub fn create_account(self) -> Self
pub fn create_account(self) -> Self
Create a new account with the account id being receiver_id.
sourcepub fn delete_account(self, beneficiary_id: &AccountId) -> Self
pub fn delete_account(self, beneficiary_id: &AccountId) -> Self
Deletes the receiver_id’s account. The beneficiary specified by
beneficiary_id will receive the funds of the account deleted.
sourcepub fn delete_key(self, pk: PublicKey) -> Self
pub fn delete_key(self, pk: PublicKey) -> Self
Deletes a key from the receiver_id’s account, where the public key is
associated with the access key to be deleted.
sourcepub fn deploy(self, code: &[u8]) -> Self
pub fn deploy(self, code: &[u8]) -> Self
Deploy contract code or WASM bytes to the receiver_id’s account.
sourcepub fn stake(self, stake: Balance, pk: PublicKey) -> Self
pub fn stake(self, stake: Balance, pk: PublicKey) -> Self
An action which stakes the signer’s tokens and setups a validator public key.
sourcepub fn transfer(self, deposit: Balance) -> Self
pub fn transfer(self, deposit: Balance) -> Self
Transfer deposit amount from signer’s account into receiver_id’s account.
sourcepub async fn transact(self) -> Result<ExecutionFinalResult>
pub async fn transact(self) -> Result<ExecutionFinalResult>
Process the trannsaction, and return the result of the execution.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Transaction<'a>
impl<'a> Send for Transaction<'a>
impl<'a> Sync for Transaction<'a>
impl<'a> Unpin for Transaction<'a>
impl<'a> !UnwindSafe for Transaction<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more