pub struct TempoSession { /* private fields */ }Expand description
Deep session wrapping a signer, keystore file lock, and RPC transport.
Implementations§
Source§impl TempoSession
impl TempoSession
Sourcepub fn new(
signer: PrivateKeySigner,
keystore_path: Option<PathBuf>,
rpc: TempoRpcClient,
receipt_timeout: Duration,
) -> Self
pub fn new( signer: PrivateKeySigner, keystore_path: Option<PathBuf>, rpc: TempoRpcClient, receipt_timeout: Duration, ) -> Self
Create a new session with a live RPC client.
pub fn signer(&self) -> &PrivateKeySigner
pub fn address(&self) -> Address
Sourcepub fn acquire_lock(&self) -> Result<Option<WalletGuard>, CmdError>
pub fn acquire_lock(&self) -> Result<Option<WalletGuard>, CmdError>
Acquire the exclusive wallet lock for the keystore path, if configured.
Sourcepub async fn eth_call_from(
&self,
from: Address,
to: Address,
calldata: &Bytes,
) -> Result<Vec<u8>, CmdError>
pub async fn eth_call_from( &self, from: Address, to: Address, calldata: &Bytes, ) -> Result<Vec<u8>, CmdError>
Read-only call impersonating an explicit sender (TIP-20 privacy compliance).
Sourcepub async fn erc20_balance_of(
&self,
token: Address,
account: Address,
) -> Result<U256, CmdError>
pub async fn erc20_balance_of( &self, token: Address, account: Address, ) -> Result<U256, CmdError>
Query ERC-20 balance for an account.
Sourcepub async fn erc20_allowance(
&self,
token: Address,
owner: Address,
spender: Address,
) -> Result<U256, CmdError>
pub async fn erc20_allowance( &self, token: Address, owner: Address, spender: Address, ) -> Result<U256, CmdError>
Query ERC-20 allowance for (owner, spender).
Sourcepub async fn send_transaction(
&self,
to: Address,
calldata: Bytes,
) -> Result<TxHash, CmdError>
pub async fn send_transaction( &self, to: Address, calldata: Bytes, ) -> Result<TxHash, CmdError>
Send a mutating transaction under the exclusive wallet lock without waiting for receipt.
Trait Implementations§
Source§impl Clone for TempoSession
impl Clone for TempoSession
Auto Trait Implementations§
impl !RefUnwindSafe for TempoSession
impl !UnwindSafe for TempoSession
impl Forget for TempoSession
impl Freeze for TempoSession
impl Move for TempoSession
impl Send for TempoSession
impl Sync for TempoSession
impl Unpin for TempoSession
impl UnsafeUnpin for TempoSession
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more