From 5a170245ff9b4a7bf26bd3c1d955114a80f89126 Mon Sep 17 00:00:00 2001 From: Andrew Plaza Date: Tue, 17 Dec 2024 16:23:10 -0500 Subject: [PATCH] use XmtpApiClient in getInboxIds --- Cargo.lock | 1 - bindings_ffi/src/mls.rs | 14 +++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5627ff5d8..cf5f4a245 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7518,7 +7518,6 @@ dependencies = [ "tracing-oslog", "tracing-subscriber", "uniffi", - "url", "uuid 1.11.0", "xmtp_api_grpc", "xmtp_common", diff --git a/bindings_ffi/src/mls.rs b/bindings_ffi/src/mls.rs index 339c9c23e..2b88eb4be 100644 --- a/bindings_ffi/src/mls.rs +++ b/bindings_ffi/src/mls.rs @@ -4,7 +4,6 @@ use crate::{FfiSubscribeError, GenericError}; use std::{collections::HashMap, convert::TryInto, sync::Arc}; use tokio::sync::Mutex; use xmtp_api_grpc::grpc_api_helper::Client as TonicApiClient; -use xmtp_common::retry::Retry; use xmtp_id::associations::verify_signed_with_public_context; use xmtp_id::scw_verifier::RemoteSignatureVerifier; use xmtp_id::{ @@ -155,18 +154,11 @@ pub async fn create_client( #[allow(unused)] #[uniffi::export(async_runtime = "tokio")] pub async fn get_inbox_id_for_address( - host: String, - is_secure: bool, + api: Arc, account_address: String, ) -> Result, GenericError> { - let api_client = ApiClientWrapper::new( - TonicApiClient::create(host.clone(), is_secure) - .await? - .into(), - Retry::default(), - ); - - let results = api_client + let api = ApiClientWrapper::new(Arc::new(api.0.clone()), Default::default()); + let results = api .get_inbox_ids(vec![account_address.clone()]) .await .map_err(GenericError::from_error)?;