-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "remove the inbox state and revoke installations code"
This reverts commit 10cf325.
- Loading branch information
1 parent
8ac886b
commit 6157e8f
Showing
8 changed files
with
1,994 additions
and
1,767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
android/src/main/java/expo/modules/xmtpreactnativesdk/wrappers/InboxStateWrapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package expo.modules.xmtpreactnativesdk.wrappers | ||
|
||
import com.google.gson.GsonBuilder | ||
import uniffi.xmtpv3.org.xmtp.android.library.libxmtp.InboxState | ||
|
||
class InboxStateWrapper { | ||
companion object { | ||
fun encodeToObj(inboxState: InboxState): Map<String, Any> { | ||
return mapOf( | ||
"inboxId" to inboxState.inboxId, | ||
"addresses" to inboxState.addresses, | ||
"installationIds" to inboxState.installationIds, | ||
"recoveryAddress" to inboxState.recoveryAddress | ||
) | ||
} | ||
|
||
fun encode(inboxState: InboxState): String { | ||
val gson = GsonBuilder().create() | ||
val obj = encodeToObj(inboxState) | ||
return gson.toJson(obj) | ||
} | ||
} | ||
} |
Oops, something went wrong.