pub struct ApiClientWrapper<ApiClient> {
pub api_client: GuardedApi<ApiClient>,
/* private fields */
}Fields§
§api_client: GuardedApi<ApiClient>Implementations§
Source§impl<C: XmtpBackendClient> ApiClientWrapper<C>
impl<C: XmtpBackendClient> ApiClientWrapper<C>
Sourcepub async fn create_upload(
&self,
request: CreateUploadRequest,
) -> Result<CreateUploadResponse>
pub async fn create_upload( &self, request: CreateUploadRequest, ) -> Result<CreateUploadResponse>
Get the request to send to the configured storage target.
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.
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 comparison with the stored backend URL.
Sourcepub fn has_credential_source(&self) -> bool
pub fn has_credential_source(&self) -> bool
Whether a credential source was configured on the transport.
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 + XmtpBackendClient> ApiClientWrapper<C>where
C::GroupMessageStream: 'static,
C::WelcomeMessageStream: 'static,
impl<C: XmtpMlsStreams + XmtpBackendClient> ApiClientWrapper<C>where
C::GroupMessageStream: 'static,
C::WelcomeMessageStream: 'static,
pub async fn subscribe_group_messages( &self, groups: &[&GroupId], ) -> Result<<GuardedApi<C> as XmtpMlsStreams>::GroupMessageStream>
pub async fn subscribe_group_messages_with_cursors( &self, cursors: &TopicCursor, ) -> Result<<GuardedApi<C> as XmtpMlsStreams>::GroupMessageStream>
pub async fn subscribe_welcome_messages( &self, installations: &[&InstallationId], ) -> Result<<GuardedApi<C> as XmtpMlsStreams>::WelcomeMessageStream>
pub async fn subscribe_welcome_messages_with_cursors( &self, cursors: &TopicCursor, ) -> Result<<GuardedApi<C> as XmtpMlsStreams>::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.
Sourcepub async fn settle_units(
&self,
units: &[PublishUnit],
) -> Result<Vec<Option<EnvelopeMeta>>>
pub async fn settle_units( &self, units: &[PublishUnit], ) -> Result<Vec<Option<EnvelopeMeta>>>
Settle a publish whose outcome is unknown without resending it: a
Query of every topic in units, from the start, returns the stored
metadata of each envelope in envelope order, matched by its canonical
hash. None marks an envelope the backend did not store. Pages that
match nothing are dropped, and the read stops once every envelope matched.
A record without valid metadata fails the read: it could be any envelope,
so the read cannot prove one absent.
Source§impl<ApiClient> ApiClientWrapper<ApiClient>
impl<ApiClient> ApiClientWrapper<ApiClient>
pub fn new( api_client: ApiClient, retry_strategy: Retry<ExponentialBackoff>, ) -> Self
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.
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<A> Clone for ApiClientWrapper<A>
impl<A> Clone for ApiClientWrapper<A>
Source§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>
impl<ApiClient> !RefUnwindSafe for ApiClientWrapper<ApiClient>
impl<ApiClient> Send for ApiClientWrapper<ApiClient>
impl<ApiClient> Sync for ApiClientWrapper<ApiClient>
impl<ApiClient> Unpin for ApiClientWrapper<ApiClient>
impl<ApiClient> UnsafeUnpin for ApiClientWrapper<ApiClient>
impl<ApiClient> !UnwindSafe for ApiClientWrapper<ApiClient>
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].