pub struct CallRequest<T = CallScope, A = AuthToken> {
pub scope: T,
pub layer1: Layer1,
pub api: Option<TypeName>,
pub call: Option<CallState>,
pub auth: A,
pub data: Option<StrictVal>,
pub lock: Option<Confined<Vec<u8>, amplify::::collection::confinement::TinyBlob::{constant#0}, amplify::::collection::confinement::TinyBlob::{constant#1}>>,
pub expiry: Option<DateTime<Utc>>,
pub endpoints: Confined<Vec<Endpoint>, 0, 10>,
pub unknown_query: IndexMap<String, String>,
}
Expand description
Call request provides information for constructing [hypersonic::CallParams
].
Request doesn’t specify the used capabilities of the contract (blockchain, if any; type of single-use seals) since each contract is strictly committed and can be used under one and just one type of capabilities.
§URI form
Call request can be represented as a URI using contract:
scheme in the following format:
contract:CONTRACT-ID/API/METHOD/STATE/AUTH/DATA+STON?expiry=DATETIME&lock=BASE64&endpoints=E1,
E2#CHECK
NB: Parsing and producing URI form requires use of uri
feature.
§Path
Instead of Contract ID a string query against a set of contracts can be used; for instance, describing contract capabilities.
Some path components of the URI may be skipped. In this case URI is parsed in the following way:
- 3-component path, starting with
/
, provides name of the used interface standard, authentication token and state information; - 3-component path, not starting with
/
, provides contract ID and auth token, and should use a default method and name state from the contract default API; - 4-component path - contract ID and state name are given in addition to the auth token, a default method used from the contract default API;
- 5-component path - all parameters except API name are given.
§Query
Supported URI query parameters are:
expiry
: ISO-8601 datetime string;lock
: Base64-encoded lock script conditions;endpoints
: comma-separated URLs with the endpoints for uploading a resulting deeds/consignment stream.
§Fragment
Optional fragment may be present and should represent a checksum value for the URI string preceding the fragment.
Fields§
§scope: T
§layer1: Layer1
§api: Option<TypeName>
§call: Option<CallState>
§auth: A
§data: Option<StrictVal>
§lock: Option<Confined<Vec<u8>, amplify::::collection::confinement::TinyBlob::{constant#0}, amplify::::collection::confinement::TinyBlob::{constant#1}>>
§expiry: Option<DateTime<Utc>>
§endpoints: Confined<Vec<Endpoint>, 0, 10>
§unknown_query: IndexMap<String, String>
Implementations§
Source§impl<Q, A> CallRequest<CallScope<Q>, A>
impl<Q, A> CallRequest<CallScope<Q>, A>
pub fn unwrap_contract_with<E>( self, f: impl FnOnce(Q) -> Result<ContractId, E>, ) -> Result<CallRequest<ContractId, A>, E>
Source§impl<T, A> CallRequest<T, A>
impl<T, A> CallRequest<T, A>
pub fn bitcoin_mainnet( scope: T, auth: A, data: Option<StrictVal>, ) -> CallRequest<T, A>
pub fn bitcoin_testnet( scope: T, auth: A, data: Option<StrictVal>, ) -> CallRequest<T, A>
pub fn liquid_mainnet( scope: T, auth: A, data: Option<StrictVal>, ) -> CallRequest<T, A>
pub fn liquid_testnet( scope: T, auth: A, data: Option<StrictVal>, ) -> CallRequest<T, A>
pub fn new( scope: T, consensus: Consensus, testnet: bool, auth: A, data: Option<StrictVal>, ) -> CallRequest<T, A>
pub fn use_api(self, api: impl Into<TypeName>) -> CallRequest<T, A>
pub fn use_method(self, method: VariantName) -> CallRequest<T, A>
pub fn use_state(self, state: VariantName) -> CallRequest<T, A>
pub fn use_expiry(self, expiry: DateTime<Utc>) -> CallRequest<T, A>
pub fn add_endpoint( self, endpoint: Endpoint, ) -> Result<CallRequest<T, A>, Error>
Trait Implementations§
Source§impl<T, A> Clone for CallRequest<T, A>
impl<T, A> Clone for CallRequest<T, A>
Source§fn clone(&self) -> CallRequest<T, A>
fn clone(&self) -> CallRequest<T, A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T, A> Debug for CallRequest<T, A>
impl<T, A> Debug for CallRequest<T, A>
Source§impl<'de, T, A> Deserialize<'de> for CallRequest<T, A>where
T: Deserialize<'de>,
A: Deserialize<'de>,
impl<'de, T, A> Deserialize<'de> for CallRequest<T, A>where
T: Deserialize<'de>,
A: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CallRequest<T, A>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CallRequest<T, A>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl<T, A> PartialEq for CallRequest<T, A>
impl<T, A> PartialEq for CallRequest<T, A>
Source§impl<T, A> Serialize for CallRequest<T, A>
impl<T, A> Serialize for CallRequest<T, A>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl<T, A> Eq for CallRequest<T, A>
impl<T, A> StructuralPartialEq for CallRequest<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for CallRequest<T, A>
impl<T, A> RefUnwindSafe for CallRequest<T, A>where
T: RefUnwindSafe,
A: RefUnwindSafe,
impl<T, A> Send for CallRequest<T, A>
impl<T, A> Sync for CallRequest<T, A>
impl<T, A> Unpin for CallRequest<T, A>
impl<T, A> UnwindSafe for CallRequest<T, A>where
T: UnwindSafe,
A: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.