pub enum ContractCaller {
Local(NearSigner),
Wallet {
api: ApiClient,
wallet_key: String,
contract_id: String,
},
}Expand description
Unified interface for calling NEAR contracts — either with a local key (NearSigner) or via the coordinator wallet API (wallet_key).
Variants§
Implementations§
Source§impl ContractCaller
impl ContractCaller
Sourcepub fn from_credentials(
creds: &Credentials,
network: &NetworkConfig,
) -> Result<Self>
pub fn from_credentials( creds: &Credentials, network: &NetworkConfig, ) -> Result<Self>
Build a ContractCaller from stored credentials.
Sourcepub async fn call_contract(
&self,
method_name: &str,
args: Value,
gas: u64,
deposit: u128,
) -> Result<ContractCallResult>
pub async fn call_contract( &self, method_name: &str, args: Value, gas: u64, deposit: u128, ) -> Result<ContractCallResult>
Call a method on the OutLayer contract. Returns parsed result value and tx hash.
Auto Trait Implementations§
impl Freeze for ContractCaller
impl !RefUnwindSafe for ContractCaller
impl Send for ContractCaller
impl Sync for ContractCaller
impl Unpin for ContractCaller
impl UnsafeUnpin for ContractCaller
impl !UnwindSafe for ContractCaller
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> 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