/// Prepares and serializes a CBOR query request.
Prepares and serializes a CBOR query request.
Prepares and serializes a CBOR query request .
pub fn prepare_query(
        &self,
        canister_id: &CanisterId,
        method: &str,
        arguments: Vec<u8>,
    ) -> Result<Vec<u8>, Box<dyn Error>> {
        let content = HttpQueryContent::Query {
            query: HttpUserQuery {
                canister_id: to_blob(canister_id),
                method_name: method.to_string(),
                arg: Blob(arguments),
                sender: self.sender_field.clone(),
                nonce: None,
                ingress_expiry: current_time_and_expiry_time().1.as_nanos_since_unix_epoch(),
            },
        };
        let request = sign_query(content, &self.sender)?;
        Ok(SignedRequestBytes::try_from(request)?.into())
    }
pub fn prepare_query ( & self , canister_id : & CanisterId , method : & str , arguments : Vec < u8 > , ) -> Result < Vec < u8 > , Box < dyn Error > > { let content = HttpQueryContent :: Query { query : HttpUserQuery { canister_id : to_blob ( canister_id ) , method_name : method . to_string ( ) , arg : Blob ( arguments ) , sender : self . sender_field . clone ( ) , nonce : None , ingress_expiry : current_time_and_expiry_time ( ) . 1 . as_nanos_since_unix_epoch ( ) , } , } ; let request = sign_query ( content , & self . sender ) ? ; Ok ( SignedRequestBytes :: try_from ( request ) ? . into ( ) ) }
Prepares and serializes a CBOR query request.
Prepares and serializes a CBOR query request .
&self
canister_id
&CanisterId
method
&str
arguments
Vec<u8>