pub struct Caller { /* private fields */ }Expand description
An agent’s account bound to the network it submits to.
Clones share the account’s nonce sequence, so transactions submitted through any clone never collide. Nonces (and so the addresses of deployed contracts) are assigned in submission order: submissions made one after another are deterministic for a given seed, while submissions raced from concurrent tasks are numbered in whatever order the tasks reach them.
Implementations§
Source§impl Caller
impl Caller
Sourcepub fn address(&self) -> ContractAddress
pub fn address(&self) -> ContractAddress
The on-chain wallet address transactions are submitted from.
Sourcepub async fn call(
&self,
target: ContractAddress,
entrypoint: ContractEntrypointID,
calldata: &[u8],
) -> Result<TransactionReceipt>
pub async fn call( &self, target: ContractAddress, entrypoint: ContractEntrypointID, calldata: &[u8], ) -> Result<TransactionReceipt>
Call a deployed contract method from this account, awaiting the receipt. The receipt is returned even when execution reverted.
Sourcepub async fn submit_call(
&self,
target: ContractAddress,
entrypoint: ContractEntrypointID,
calldata: &[u8],
) -> Result<SubmittedTransaction>
pub async fn submit_call( &self, target: ContractAddress, entrypoint: ContractEntrypointID, calldata: &[u8], ) -> Result<SubmittedTransaction>
Submit a contract call without waiting for its receipt.
Trait Implementations§
Source§impl AsRef<Caller> for AgentContext
impl AsRef<Caller> for AgentContext
Source§impl RemoteInvoker for Caller
impl RemoteInvoker for Caller
Source§type Call<R> = ContractCall<R>
type Call<R> = ContractCall<R>
A prepared invocation of a method that may change state.
Source§type View<R> = ContractView<R>
type View<R> = ContractView<R>
A prepared read of a
pure or readOnly method.Source§fn call<R, A>(
&self,
target: &ContractAddress,
method: RemoteMethod,
args: &A,
) -> ContractCall<R>
fn call<R, A>( &self, target: &ContractAddress, method: RemoteMethod, args: &A, ) -> ContractCall<R>
Prepare an invocation of
method on target.Source§fn view<R, A>(
&self,
target: &ContractAddress,
method: RemoteMethod,
args: &A,
) -> ContractView<R>
fn view<R, A>( &self, target: &ContractAddress, method: RemoteMethod, args: &A, ) -> ContractView<R>
Prepare a read of
method on target.Auto Trait Implementations§
impl !RefUnwindSafe for Caller
impl !UnwindSafe for Caller
impl Freeze for Caller
impl Send for Caller
impl Sync for Caller
impl Unpin for Caller
impl UnsafeUnpin for Caller
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
Mutably borrows from an owned value. Read more