pub struct Colibri { /* private fields */ }Expand description
High-level Colibri client. Cheap to clone once constructed
(backed by an Arc<HttpClient>).
Implementations§
Source§impl Colibri
impl Colibri
Sourcepub fn builder(chain_id: u64) -> ColibriBuilder
pub fn builder(chain_id: u64) -> ColibriBuilder
Start a builder configured with default endpoints for
chain_id. See ColibriBuilder.
Sourcepub fn config(&self) -> &ColibriConfig
pub fn config(&self) -> &ColibriConfig
Access the underlying configuration.
Sourcepub async fn rpc(
&self,
method: &str,
params: &JsonValue,
) -> Result<JsonValue, ColibriError>
pub async fn rpc( &self, method: &str, params: &JsonValue, ) -> Result<JsonValue, ColibriError>
Execute an RPC call through the unified state machine (the
recommended entry point). Depending on
ColibriConfig::prover_mode this runs proof generation and
verification locally, remotely, or in a hybrid mode.
Returns the verified result as raw JSON. Reverts produce
ColibriError::Revert.
Sourcepub async fn create_proof(
&self,
method: &str,
params: &JsonValue,
) -> Result<Vec<u8>, ColibriError>
pub async fn create_proof( &self, method: &str, params: &JsonValue, ) -> Result<Vec<u8>, ColibriError>
Generate a proof for method(params) and return the raw proof
bytes. Skips verification – use [verify_proof] afterwards.
Sourcepub async fn verify_proof(
&self,
proof: &[u8],
method: &str,
params: &JsonValue,
) -> Result<JsonValue, ColibriError>
pub async fn verify_proof( &self, proof: &[u8], method: &str, params: &JsonValue, ) -> Result<JsonValue, ColibriError>
Verify a previously generated proof and return the verified
result. Reverts produce ColibriError::Revert.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Colibri
impl !UnwindSafe for Colibri
impl Freeze for Colibri
impl Send for Colibri
impl Sync for Colibri
impl Unpin for Colibri
impl UnsafeUnpin for Colibri
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