Struct essential_rest_client::EssentialClient
source · pub struct EssentialClient { /* private fields */ }
Expand description
Client library for sending requests to the Essential REST Server.
Implementations§
source§impl EssentialClient
impl EssentialClient
sourcepub async fn deploy_contract(
&self,
signed_contract: SignedContract,
) -> Result<ContentAddress>
pub async fn deploy_contract( &self, signed_contract: SignedContract, ) -> Result<ContentAddress>
Deploy a signed contract to the server.
sourcepub async fn check_solution(
&self,
solution: Solution,
) -> Result<CheckSolutionOutput>
pub async fn check_solution( &self, solution: Solution, ) -> Result<CheckSolutionOutput>
Check a solution with the server. Contracts that this solves must be deployed.
sourcepub async fn check_solution_with_contracts(
&self,
solution: Solution,
contracts: Vec<Contract>,
) -> Result<CheckSolutionOutput>
pub async fn check_solution_with_contracts( &self, solution: Solution, contracts: Vec<Contract>, ) -> Result<CheckSolutionOutput>
Check a solution with these contracts. This uses the state on the server.
sourcepub async fn submit_solution(
&self,
solution: Solution,
) -> Result<ContentAddress>
pub async fn submit_solution( &self, solution: Solution, ) -> Result<ContentAddress>
Submit a solution to be included in an upcoming block.
sourcepub async fn solution_outcome(
&self,
solution_hash: &Hash,
) -> Result<Vec<SolutionOutcome>>
pub async fn solution_outcome( &self, solution_hash: &Hash, ) -> Result<Vec<SolutionOutcome>>
Get the outcome of a solution.
Note that a solution can have multiple outcomes because the same solution can be submitted multiple times.
sourcepub async fn get_predicate(
&self,
address: &PredicateAddress,
) -> Result<Option<Predicate>>
pub async fn get_predicate( &self, address: &PredicateAddress, ) -> Result<Option<Predicate>>
Get a deployed predicate.
sourcepub async fn get_contract(
&self,
address: &ContentAddress,
) -> Result<Option<SignedContract>>
pub async fn get_contract( &self, address: &ContentAddress, ) -> Result<Option<SignedContract>>
Get a deployed contract.
sourcepub async fn list_contracts(
&self,
time_range: Option<Range<Duration>>,
page: Option<u64>,
) -> Result<Vec<Contract>>
pub async fn list_contracts( &self, time_range: Option<Range<Duration>>, page: Option<u64>, ) -> Result<Vec<Contract>>
List deployed contracts.
sourcepub async fn list_solutions_pool(
&self,
page: Option<u64>,
) -> Result<Vec<Solution>>
pub async fn list_solutions_pool( &self, page: Option<u64>, ) -> Result<Vec<Solution>>
List solutions currently in the pool.
sourcepub async fn list_blocks(
&self,
time_range: Option<Range<Duration>>,
page: Option<u64>,
) -> Result<Vec<Block>>
pub async fn list_blocks( &self, time_range: Option<Range<Duration>>, page: Option<u64>, ) -> Result<Vec<Block>>
List blocks that have been successfully created.
sourcepub async fn query_state(
&self,
address: &ContentAddress,
key: &Key,
) -> Result<Vec<Word>>
pub async fn query_state( &self, address: &ContentAddress, key: &Key, ) -> Result<Vec<Word>>
Query the state of a contract.
sourcepub async fn query_state_reads(
&self,
query: QueryStateReads,
) -> Result<QueryStateReadsOutput>
pub async fn query_state_reads( &self, query: QueryStateReads, ) -> Result<QueryStateReadsOutput>
Query the state of a contract using state read programs.
Auto Trait Implementations§
impl Freeze for EssentialClient
impl !RefUnwindSafe for EssentialClient
impl Send for EssentialClient
impl Sync for EssentialClient
impl Unpin for EssentialClient
impl !UnwindSafe for EssentialClient
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