Struct near_workspaces::operations::CallTransaction
source · [−]pub struct CallTransaction<'a, 'b, T> { /* private fields */ }Expand description
Similiar to a Transaction, but more specific to making a call into a contract.
Note, only one call can be made per CallTransaction.
Implementations
sourceimpl<'a, 'b, T: Network> CallTransaction<'a, 'b, T>
impl<'a, 'b, T: Network> CallTransaction<'a, 'b, T>
sourcepub fn args(self, args: Vec<u8>) -> Self
pub fn args(self, args: Vec<u8>) -> Self
Provide the arguments for the call. These args are serialized bytes from either
a JSON or Borsh serializable set of arguments. To use the more specific versions
with better quality of life, use args_json or args_borsh.
sourcepub fn args_json<U: Serialize>(self, args: U) -> Result<Self>
pub fn args_json<U: Serialize>(self, args: U) -> Result<Self>
Similiar to args, specify an argument that is JSON serializable and can be
accepted by the equivalent contract. Recommend to use something like
serde_json::json! macro to easily serialize the arguments.
sourcepub fn args_borsh<U: BorshSerialize>(self, args: U) -> Result<Self>
pub fn args_borsh<U: BorshSerialize>(self, args: U) -> Result<Self>
Similiar to args, specify an argument that is borsh serializable and can be
accepted by the equivalent contract.
sourcepub fn deposit(self, deposit: u128) -> Self
pub fn deposit(self, deposit: u128) -> Self
Specify the amount of tokens to be deposited where deposit is the amount of
tokens in yocto near.
sourcepub fn gas(self, gas: u64) -> Self
pub fn gas(self, gas: u64) -> Self
Specify the amount of gas to be used where gas is the amount of gas in yocto near.
sourcepub fn max_gas(self) -> Self
pub fn max_gas(self) -> Self
Use the maximum amount of gas possible to perform this transaction.
sourcepub async fn transact(self) -> Result<CallExecutionDetails>
pub async fn transact(self) -> Result<CallExecutionDetails>
Finally, send the transaction to the network. This will consume the CallTransaction
object and return us the execution details, along with any errors if the transaction
failed in any process along the way.
sourcepub async fn view(self) -> Result<ViewResultDetails>
pub async fn view(self) -> Result<ViewResultDetails>
Instead of transacting the transaction, call into the specified view function.
Auto Trait Implementations
impl<'a, 'b, T> RefUnwindSafe for CallTransaction<'a, 'b, T> where
T: RefUnwindSafe,
impl<'a, 'b, T> Send for CallTransaction<'a, 'b, T> where
T: Send + Sync,
impl<'a, 'b, T> Sync for CallTransaction<'a, 'b, T> where
T: Send + Sync,
impl<'a, 'b, T> Unpin for CallTransaction<'a, 'b, T>
impl<'a, 'b, T> UnwindSafe for CallTransaction<'a, 'b, T> where
T: RefUnwindSafe,
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