Struct near_fetch::ops::Transaction
source · pub struct Transaction<'a, S> { /* 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.
Implementations§
source§impl<'a, S> Transaction<'a, S>where
S: Signer + ExposeAccountId + 'static,
impl<'a, S> Transaction<'a, S>where S: Signer + ExposeAccountId + 'static,
sourcepub async fn transact(self) -> Result<FinalExecutionOutcomeView>
pub async fn transact(self) -> Result<FinalExecutionOutcomeView>
Process the transaction, and return the result of the execution.
sourcepub async fn transact_async(self) -> Result<CryptoHash>
pub async fn transact_async(self) -> Result<CryptoHash>
Send the transaction to the network to be processed. This will be done asynchronously
without waiting for the transaction to complete. This returns us a [TransactionStatus]
for which we can call into status and/or .await to retrieve info about whether
the transaction has been completed or not. Note that .await will wait till completion
of the transaction.
source§impl<S> Transaction<'_, S>
impl<S> Transaction<'_, S>
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.
Auto Trait Implementations§
impl<'a, S> !RefUnwindSafe for Transaction<'a, S>
impl<'a, S> Send for Transaction<'a, S>where S: Send,
impl<'a, S> Sync for Transaction<'a, S>where S: Sync,
impl<'a, S> Unpin for Transaction<'a, S>where S: Unpin,
impl<'a, S> !UnwindSafe for Transaction<'a, S>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request