Skip to content

Commit

Permalink
return the inbox id for address
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Jun 24, 2024
1 parent dc39445 commit d21d509
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function inboxId(): string {
export async function findInboxIdFromAddress(
inboxId: string,
address: string
): Promise<string> {
): Promise<InboxId> {
return XMTPModule.findInboxIdFromAddress(inboxId, address)
}

Expand Down
17 changes: 17 additions & 0 deletions src/lib/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<InboxId>} A Promise resolving to the InboxId.
*/
async findInboxIdFromAddress(peerAddress: string): Promise<InboxId> {
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.
*/
Expand All @@ -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.
*
Expand Down

0 comments on commit d21d509

Please sign in to comment.