From d21d5090e281fa1cd1a5b472edd7618dc62214a5 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Mon, 24 Jun 2024 15:49:00 -0700 Subject: [PATCH] return the inbox id for address --- src/index.ts | 2 +- src/lib/Client.ts | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 5b0054c8c..49534a6be 100644 --- a/src/index.ts +++ b/src/index.ts @@ -49,7 +49,7 @@ export function inboxId(): string { export async function findInboxIdFromAddress( inboxId: string, address: string -): Promise { +): Promise { return XMTPModule.findInboxIdFromAddress(inboxId, address) } diff --git a/src/lib/Client.ts b/src/lib/Client.ts index 13e11cb20..ca38ef872 100644 --- a/src/lib/Client.ts +++ b/src/lib/Client.ts @@ -349,6 +349,16 @@ export class Client< return await XMTPModule.canMessage(this.inboxId, peerAddress) } + /** + * Find the inboxId associated with this address + * + * @param {string} peerAddress - The address of the peer to check for inboxId. + * @returns {Promise} A Promise resolving to the InboxId. + */ + async findInboxIdFromAddress(peerAddress: string): Promise { + return await XMTPModule.findInboxIdFromAddress(this.inboxId, peerAddress) + } + /** * Deletes the local database. This cannot be undone and these stored messages will not be refetched from the network. */ @@ -370,6 +380,13 @@ export class Client< return await XMTPModule.reconnectLocalDatabase(this.inboxId) } + /** + * Make a request for a message history sync. + */ + async requestMessageHistorySync() { + return await XMTPModule.requestMessageHistorySync(this.inboxId) + } + /** * Determines whether the current user can send messages to the specified peers over groups. *