pub struct ApiClientWrapper<ApiClient> {
pub api_client: ApiClient,
/* private fields */
}Fields§
§api_client: ApiClientImplementations§
Source§impl<C: XmtpBackendClient> ApiClientWrapper<C>
impl<C: XmtpBackendClient> ApiClientWrapper<C>
Sourcepub async fn get_configuration(&self) -> Result<GetConfigurationResponse>
pub async fn get_configuration(&self) -> Result<GetConfigurationResponse>
Read what the deployment publishes about itself.
Not retried here: the caller decides what a failure means. build
fails with ConfigurationUnavailable; a refresh attempt logs and waits
out its own schedule (CFG-046).
Sourcepub fn backend_url(&self) -> Option<&str>
pub fn backend_url(&self) -> Option<&str>
The backend URL this client sends to, when the transport knows it.
None skips the URL comparison of CFG-042 and CFG-055.
Sourcepub fn has_credential_source(&self) -> bool
pub fn has_credential_source(&self) -> bool
Whether a credential source was configured on the transport (CFG-062).
Source§impl<C: XmtpBackendClient> ApiClientWrapper<C>
impl<C: XmtpBackendClient> ApiClientWrapper<C>
pub async fn publish_identity_update<U: Into<IdentityUpdate>>( &self, update: U, ) -> Result<Cursor>
pub async fn get_identity_updates_v2( &self, filters: Vec<GetIdentityUpdatesV2Filter>, ) -> Result<HashMap<String, Vec<IdentityUpdateLog>>>
Sourcepub async fn get_inbox_ids(
&self,
identifiers: Vec<ApiIdentifier>,
) -> Result<Vec<Option<String>>>
pub async fn get_inbox_ids( &self, identifiers: Vec<ApiIdentifier>, ) -> Result<Vec<Option<String>>>
Return one optional inbox id for every input, in the same order.
pub async fn verify_smart_contract_wallet_signatures( &self, request: VerifySmartContractWalletSignaturesRequest, ) -> Result<VerifySmartContractWalletSignaturesResponse>
Source§impl<C: XmtpBackendClient> ApiClientWrapper<C>
impl<C: XmtpBackendClient> ApiClientWrapper<C>
pub async fn query_group_messages( &self, group_id: GroupId, ) -> Result<Vec<GroupMessage>>
pub async fn query_group_messages_with_cursors( &self, cursors: TopicCursor, ) -> Result<Vec<GroupMessage>>
pub async fn query_latest_group_message( &self, group_id: GroupId, ) -> Result<Option<GroupMessage>>
pub async fn query_welcome_messages<Id: AsRef<[u8]> + Copy>( &self, installation_id: Id, ) -> Result<Vec<WelcomeMessage>>
pub async fn query_welcome_messages_with_cursors( &self, cursors: TopicCursor, ) -> Result<Vec<WelcomeMessage>>
pub async fn upload_key_package( &self, key_package: Vec<u8>, ) -> Result<EnvelopeMeta>
pub async fn fetch_key_packages( &self, keys: &[InstallationId], ) -> Result<KeyPackageMap>
pub async fn send_welcome_messages( &self, messages: &[WelcomeMessage], ) -> Result<Vec<EnvelopeMeta>>
pub async fn send_group_messages( &self, units: Vec<PublishUnit>, ) -> Result<Vec<EnvelopeMeta>>
pub async fn publish_commit_log( &self, entries: Vec<CommitLogEntry>, ) -> Result<Vec<EnvelopeMeta>>
pub async fn query_commit_log( &self, cursors: TopicCursor, ) -> Result<Vec<CommitLogEntry>>
pub async fn get_newest_message_metadata( &self, group_ids: &[GroupId], ) -> Result<HashMap<GroupId, GroupMessageMetadata>>
Source§impl<C: XmtpMlsStreams> ApiClientWrapper<C>
impl<C: XmtpMlsStreams> ApiClientWrapper<C>
pub async fn subscribe_group_messages( &self, groups: &[&GroupId], ) -> Result<C::GroupMessageStream>
pub async fn subscribe_group_messages_with_cursors( &self, cursors: &TopicCursor, ) -> Result<C::GroupMessageStream>
pub async fn subscribe_welcome_messages( &self, installations: &[&InstallationId], ) -> Result<C::WelcomeMessageStream>
pub async fn subscribe_welcome_messages_with_cursors( &self, cursors: &TopicCursor, ) -> Result<C::WelcomeMessageStream>
Source§impl<C: XmtpBackendClient> ApiClientWrapper<C>
impl<C: XmtpBackendClient> ApiClientWrapper<C>
Sourcepub async fn register(&self, request: RegisterRequest) -> Result<RecipientState>
pub async fn register(&self, request: RegisterRequest) -> Result<RecipientState>
Create or renew a notification recipient.
Sourcepub async fn unregister(
&self,
request: UnregisterRequest,
) -> Result<UnregisterResponse>
pub async fn unregister( &self, request: UnregisterRequest, ) -> Result<UnregisterResponse>
Delete a notification recipient and its subscriptions.
Sourcepub async fn update_subscriptions(
&self,
request: UpdateSubscriptionsRequest,
) -> Result<RecipientState>
pub async fn update_subscriptions( &self, request: UpdateSubscriptionsRequest, ) -> Result<RecipientState>
Atomically update notification subscriptions and renew the recipient.
Source§impl<C: XmtpBackendClient> ApiClientWrapper<C>
impl<C: XmtpBackendClient> ApiClientWrapper<C>
Sourcepub async fn publish_units(
&self,
units: Vec<PublishUnit>,
) -> Result<Vec<EnvelopeMeta>>
pub async fn publish_units( &self, units: Vec<PublishUnit>, ) -> Result<Vec<EnvelopeMeta>>
Publish each atomic unit and return metadata in envelope order.
Sourcepub async fn query_ordered_page(
&self,
cursors: TopicCursor,
limit: u32,
limits: IncomingBatchLimits,
) -> Result<OrderedQueryPage>
pub async fn query_ordered_page( &self, cursors: TopicCursor, limit: u32, limits: IncomingBatchLimits, ) -> Result<OrderedQueryPage>
Read one bounded ordered page without decoding MLS payloads.
Commit each batch before requesting more from the new received prefix F.
Sourcepub async fn newest_topic_cursors(
&self,
topics: Vec<Topic>,
) -> Result<TopicCursor>
pub async fn newest_topic_cursors( &self, topics: Vec<Topic>, ) -> Result<TopicCursor>
Capture fixed newest targets. Absent topics have target zero. Keep these targets unchanged while waiting for processing to reach them.
Sourcepub async fn query_all(
&self,
cursors: TopicCursor,
limit: u32,
) -> Result<Vec<ServerEnvelope>>
pub async fn query_all( &self, cursors: TopicCursor, limit: u32, ) -> Result<Vec<ServerEnvelope>>
Read every page. Each topic advances only to its own returned cursor.
Source§impl<ApiClient> ApiClientWrapper<ApiClient>
impl<ApiClient> ApiClientWrapper<ApiClient>
pub fn new( api_client: ApiClient, retry_strategy: Retry<ExponentialBackoff>, ) -> Self
pub fn map<F, NewApiClient>(self, f: F) -> ApiClientWrapper<NewApiClient>where
F: FnOnce(ApiClient) -> NewApiClient,
Sourcepub fn set_configuration(&mut self, configuration: Arc<ServerConfiguration>)
pub fn set_configuration(&mut self, configuration: Arc<ServerConfiguration>)
Chunk and pre-validate every later request against this snapshot
(CFG-064, CFG-065). Called once, by build, before the client runs.
Sourcepub fn configuration(&self) -> &ServerConfiguration
pub fn configuration(&self) -> &ServerConfiguration
What this wrapper chunks and pre-validates against.
Sourcepub fn limits(&self) -> &LimitsConfiguration
pub fn limits(&self) -> &LimitsConfiguration
The request shapes the deployment accepts.
Sourcepub fn attach_inbox_id(&mut self, inbox_id: Option<String>)
pub fn attach_inbox_id(&mut self, inbox_id: Option<String>)
Attach an InboxId to this API Client Wrapper. Attaches an inbox_id context to tracing logs, useful for debugging
Trait Implementations§
Source§impl<ApiClient: Clone> Clone for ApiClientWrapper<ApiClient>
impl<ApiClient: Clone> Clone for ApiClientWrapper<ApiClient>
Source§fn clone(&self) -> ApiClientWrapper<ApiClient>
fn clone(&self) -> ApiClientWrapper<ApiClient>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<ApiClient: Debug> Debug for ApiClientWrapper<ApiClient>
impl<ApiClient: Debug> Debug for ApiClientWrapper<ApiClient>
Source§impl<C> SmartContractSignatureVerifier for ApiClientWrapper<C>where
C: XmtpBackendClient,
impl<C> SmartContractSignatureVerifier for ApiClientWrapper<C>where
C: XmtpBackendClient,
Source§fn is_valid_signature<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
hash: [u8; 32],
signature: Bytes,
block_number: Option<BlockNumber>,
) -> Pin<Box<dyn Future<Output = Result<ValidationResponse, VerifierError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_valid_signature<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
hash: [u8; 32],
signature: Bytes,
block_number: Option<BlockNumber>,
) -> Pin<Box<dyn Future<Output = Result<ValidationResponse, VerifierError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Verifies an ERC-6492https://eips.ethereum.org/EIPS/eip-6492 signature.
§Arguments
signer- can be the smart wallet address or EOA address.hash- Message digest for the signature.signature- Could be encoded smart wallet signature or raw ECDSA signature.
Auto Trait Implementations§
impl<ApiClient> Freeze for ApiClientWrapper<ApiClient>where
ApiClient: Freeze,
impl<ApiClient> RefUnwindSafe for ApiClientWrapper<ApiClient>where
ApiClient: RefUnwindSafe,
impl<ApiClient> Send for ApiClientWrapper<ApiClient>where
ApiClient: Send,
impl<ApiClient> Sync for ApiClientWrapper<ApiClient>where
ApiClient: Sync,
impl<ApiClient> Unpin for ApiClientWrapper<ApiClient>where
ApiClient: Unpin,
impl<ApiClient> UnsafeUnpin for ApiClientWrapper<ApiClient>where
ApiClient: UnsafeUnpin,
impl<ApiClient> UnwindSafe for ApiClientWrapper<ApiClient>where
ApiClient: UnwindSafe,
Blanket Implementations§
§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read more§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read more§fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<T> IntoSql for T
impl<T> IntoSql for T
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].