Skip to content

Commit

Permalink
bump to the latest rust
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Aug 21, 2024
1 parent 3b464ce commit c8be938
Show file tree
Hide file tree
Showing 2 changed files with 232 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/src/main/java/libxmtp-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 28646190
Version: abe93739
Branch: main
Date: 2024-08-20 18:09:12 +0000
Date: 2024-08-21 21:35:33 +0000
230 changes: 230 additions & 0 deletions library/src/main/java/xmtpv3.kt
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,10 @@ internal interface UniffiLib : Library {
`ptr`: Pointer,
): Long

fun uniffi_xmtpv3_fn_method_fficonversations_sync_all_groups(
`ptr`: Pointer,
): Long

fun uniffi_xmtpv3_fn_clone_ffigroup(
`ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus,
): Pointer
Expand Down Expand Up @@ -1208,6 +1212,10 @@ internal interface UniffiLib : Library {
`ptr`: Pointer, `address`: RustBuffer.ByValue,
): Long

fun uniffi_xmtpv3_fn_method_ffixmtpclient_get_latest_inbox_state(
`ptr`: Pointer, `inboxId`: RustBuffer.ByValue,
): Long

fun uniffi_xmtpv3_fn_method_ffixmtpclient_group(
`ptr`: Pointer, `groupId`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus,
): Pointer
Expand All @@ -1216,6 +1224,10 @@ internal interface UniffiLib : Library {
`ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus,
): RustBuffer.ByValue

fun uniffi_xmtpv3_fn_method_ffixmtpclient_inbox_state(
`ptr`: Pointer, `refreshFromNetwork`: Byte,
): Long

fun uniffi_xmtpv3_fn_method_ffixmtpclient_installation_id(
`ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus,
): RustBuffer.ByValue
Expand All @@ -1236,6 +1248,10 @@ internal interface UniffiLib : Library {
`ptr`: Pointer,
): Long

fun uniffi_xmtpv3_fn_method_ffixmtpclient_revoke_all_other_installations(
`ptr`: Pointer,
): Long

fun uniffi_xmtpv3_fn_method_ffixmtpclient_revoke_wallet(
`ptr`: Pointer, `walletAddress`: RustBuffer.ByValue,
): Long
Expand Down Expand Up @@ -1648,6 +1664,9 @@ internal interface UniffiLib : Library {
fun uniffi_xmtpv3_checksum_method_fficonversations_sync(
): Short

fun uniffi_xmtpv3_checksum_method_fficonversations_sync_all_groups(
): Short

fun uniffi_xmtpv3_checksum_method_ffigroup_add_admin(
): Short

Expand Down Expand Up @@ -1831,12 +1850,18 @@ internal interface UniffiLib : Library {
fun uniffi_xmtpv3_checksum_method_ffixmtpclient_find_inbox_id(
): Short

fun uniffi_xmtpv3_checksum_method_ffixmtpclient_get_latest_inbox_state(
): Short

fun uniffi_xmtpv3_checksum_method_ffixmtpclient_group(
): Short

fun uniffi_xmtpv3_checksum_method_ffixmtpclient_inbox_id(
): Short

fun uniffi_xmtpv3_checksum_method_ffixmtpclient_inbox_state(
): Short

fun uniffi_xmtpv3_checksum_method_ffixmtpclient_installation_id(
): Short

Expand All @@ -1852,6 +1877,9 @@ internal interface UniffiLib : Library {
fun uniffi_xmtpv3_checksum_method_ffixmtpclient_request_history_sync(
): Short

fun uniffi_xmtpv3_checksum_method_ffixmtpclient_revoke_all_other_installations(
): Short

fun uniffi_xmtpv3_checksum_method_ffixmtpclient_revoke_wallet(
): Short

Expand Down Expand Up @@ -1959,6 +1987,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_xmtpv3_checksum_method_fficonversations_sync() != 9054.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_fficonversations_sync_all_groups() != 62850.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_ffigroup_add_admin() != 4600.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -2142,12 +2173,18 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_find_inbox_id() != 59020.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_get_latest_inbox_state() != 3165.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_group() != 64533.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_inbox_id() != 25128.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_inbox_state() != 7826.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_installation_id() != 37173.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand All @@ -2163,6 +2200,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_request_history_sync() != 22295.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_revoke_all_other_installations() != 36450.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_revoke_wallet() != 12211.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -2616,6 +2656,8 @@ public interface FfiConversationsInterface {

suspend fun `sync`()

suspend fun `syncAllGroups`()

companion object
}

Expand Down Expand Up @@ -2896,6 +2938,39 @@ open class FfiConversations : Disposable, AutoCloseable, FfiConversationsInterfa
}


@Throws(GenericException::class)
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
override suspend fun `syncAllGroups`() {
return uniffiRustCallAsync(
callWithPointer { thisPtr ->
UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_fficonversations_sync_all_groups(
thisPtr,

)
},
{ future, callback, continuation ->
UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(
future,
callback,
continuation
)
},
{ future, continuation ->
UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(
future,
continuation
)
},
{ future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) },
// lift function
{ Unit },

// Error FFI converter
GenericException.ErrorHandler,
)
}


companion object

}
Expand Down Expand Up @@ -6059,10 +6134,20 @@ public interface FfiXmtpClientInterface {

suspend fun `findInboxId`(`address`: kotlin.String): kotlin.String?

suspend fun `getLatestInboxState`(`inboxId`: kotlin.String): FfiInboxState

fun `group`(`groupId`: kotlin.ByteArray): FfiGroup

fun `inboxId`(): kotlin.String

/**
* * Get the client's inbox state.
* *
* * If `refresh_from_network` is true, the client will go to the network first to refresh the state.
* * Otherwise, the state will be read from the local database.
*/
suspend fun `inboxState`(`refreshFromNetwork`: kotlin.Boolean): FfiInboxState

fun `installationId`(): kotlin.ByteArray

fun `message`(`messageId`: kotlin.ByteArray): FfiMessage
Expand All @@ -6073,6 +6158,11 @@ public interface FfiXmtpClientInterface {

suspend fun `requestHistorySync`()

/**
* * Revokes all installations except the one the client is currently using
*/
suspend fun `revokeAllOtherInstallations`(): FfiSignatureRequest

/**
* Revokes or removes an identity - really a wallet address - from the existing client
*/
Expand Down Expand Up @@ -6346,6 +6436,38 @@ open class FfiXmtpClient : Disposable, AutoCloseable, FfiXmtpClientInterface {
}


@Throws(GenericException::class)
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
override suspend fun `getLatestInboxState`(`inboxId`: kotlin.String): FfiInboxState {
return uniffiRustCallAsync(
callWithPointer { thisPtr ->
UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_get_latest_inbox_state(
thisPtr,
FfiConverterString.lower(`inboxId`),
)
},
{ future, callback, continuation ->
UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer(
future,
callback,
continuation
)
},
{ future, continuation ->
UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer(
future,
continuation
)
},
{ future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) },
// lift function
{ FfiConverterTypeFfiInboxState.lift(it) },
// Error FFI converter
GenericException.ErrorHandler,
)
}


@Throws(GenericException::class)
override fun `group`(`groupId`: kotlin.ByteArray): FfiGroup {
return FfiConverterTypeFfiGroup.lift(
Expand Down Expand Up @@ -6373,6 +6495,43 @@ open class FfiXmtpClient : Disposable, AutoCloseable, FfiXmtpClientInterface {
}


/**
* * Get the client's inbox state.
* *
* * If `refresh_from_network` is true, the client will go to the network first to refresh the state.
* * Otherwise, the state will be read from the local database.
*/
@Throws(GenericException::class)
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
override suspend fun `inboxState`(`refreshFromNetwork`: kotlin.Boolean): FfiInboxState {
return uniffiRustCallAsync(
callWithPointer { thisPtr ->
UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_inbox_state(
thisPtr,
FfiConverterBoolean.lower(`refreshFromNetwork`),
)
},
{ future, callback, continuation ->
UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer(
future,
callback,
continuation
)
},
{ future, continuation ->
UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer(
future,
continuation
)
},
{ future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) },
// lift function
{ FfiConverterTypeFfiInboxState.lift(it) },
// Error FFI converter
GenericException.ErrorHandler,
)
}

override fun `installationId`(): kotlin.ByteArray {
return FfiConverterByteArray.lift(
callWithPointer {
Expand Down Expand Up @@ -6477,6 +6636,41 @@ open class FfiXmtpClient : Disposable, AutoCloseable, FfiXmtpClientInterface {
}


/**
* * Revokes all installations except the one the client is currently using
*/
@Throws(GenericException::class)
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
override suspend fun `revokeAllOtherInstallations`(): FfiSignatureRequest {
return uniffiRustCallAsync(
callWithPointer { thisPtr ->
UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_revoke_all_other_installations(
thisPtr,

)
},
{ future, callback, continuation ->
UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer(
future,
callback,
continuation
)
},
{ future, continuation ->
UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer(
future,
continuation
)
},
{ future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) },
// lift function
{ FfiConverterTypeFfiSignatureRequest.lift(it) },
// Error FFI converter
GenericException.ErrorHandler,
)
}


/**
* Revokes or removes an identity - really a wallet address - from the existing client
*/
Expand Down Expand Up @@ -6695,6 +6889,42 @@ public object FfiConverterTypeFfiGroupMember : FfiConverterRustBuffer<FfiGroupMe
}


data class FfiInboxState(
var `inboxId`: kotlin.String,
var `recoveryAddress`: kotlin.String,
var `installationIds`: List<kotlin.ByteArray>,
var `accountAddresses`: List<kotlin.String>,
) {

companion object
}

public object FfiConverterTypeFfiInboxState : FfiConverterRustBuffer<FfiInboxState> {
override fun read(buf: ByteBuffer): FfiInboxState {
return FfiInboxState(
FfiConverterString.read(buf),
FfiConverterString.read(buf),
FfiConverterSequenceByteArray.read(buf),
FfiConverterSequenceString.read(buf),
)
}

override fun allocationSize(value: FfiInboxState) = (
FfiConverterString.allocationSize(value.`inboxId`) +
FfiConverterString.allocationSize(value.`recoveryAddress`) +
FfiConverterSequenceByteArray.allocationSize(value.`installationIds`) +
FfiConverterSequenceString.allocationSize(value.`accountAddresses`)
)

override fun write(value: FfiInboxState, buf: ByteBuffer) {
FfiConverterString.write(value.`inboxId`, buf)
FfiConverterString.write(value.`recoveryAddress`, buf)
FfiConverterSequenceByteArray.write(value.`installationIds`, buf)
FfiConverterSequenceString.write(value.`accountAddresses`, buf)
}
}


data class FfiListConversationsOptions(
var `createdAfterNs`: kotlin.Long?,
var `createdBeforeNs`: kotlin.Long?,
Expand Down

0 comments on commit c8be938

Please sign in to comment.