Skip to content

Commit f8c9733

Browse files
committed
chore: update bindings
1 parent c946736 commit f8c9733

File tree

18 files changed

+684
-190
lines changed

18 files changed

+684
-190
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bitkitcore"
3-
version = "0.1.18"
3+
version = "0.1.19"
44
edition = "2021"
55

66
[lib]

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import PackageDescription
55

6-
let tag = "v0.1.18"
7-
let checksum = "6d3f142a7082b42a12d1b2c89dd9fb04c7db92cc56a430e52c78d2a95128c7f2"
6+
let tag = "v0.1.19"
7+
let checksum = "7bd7f3caea9d996839ca5cf6bae8d16cc81b8439789f5faad4f3bf66e5fcf958"
88
let url = "https://github.com/synonymdev/bitkit-core/releases/download/\(tag)/BitkitCore.xcframework.zip"
99

1010
let package = Package(

bindings/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ android.useAndroidX=true
33
android.enableJetifier=true
44
kotlin.code.style=official
55
group=com.synonym
6-
version=0.1.18
6+
version=0.1.19
Binary file not shown.
Binary file not shown.
123 KB
Binary file not shown.
114 KB
Binary file not shown.

bindings/android/lib/src/main/kotlin/com/synonym/bitkitcore/bitkitcore.android.kt

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import kotlinx.coroutines.CancellableContinuation
2424
import kotlinx.coroutines.DelicateCoroutinesApi
2525
import kotlinx.coroutines.Dispatchers
2626
import kotlinx.coroutines.GlobalScope
27+
import kotlinx.coroutines.IO
2728
import kotlinx.coroutines.Job
2829
import kotlinx.coroutines.launch
2930
import kotlinx.coroutines.suspendCancellableCoroutine
@@ -1098,6 +1099,16 @@ internal interface UniffiForeignFutureCompleteVoid: com.sun.jna.Callback {
10981099

10991100

11001101

1102+
1103+
1104+
1105+
1106+
1107+
1108+
1109+
1110+
1111+
11011112

11021113

11031114

@@ -1139,11 +1150,20 @@ internal interface UniffiLib : Library {
11391150

11401151
}
11411152

1153+
fun uniffi_bitkitcore_fn_func_activity_wipe_all(
1154+
uniffiCallStatus: UniffiRustCallStatus,
1155+
): Unit
11421156
fun uniffi_bitkitcore_fn_func_add_tags(
11431157
`activityId`: RustBufferByValue,
11441158
`tags`: RustBufferByValue,
11451159
uniffiCallStatus: UniffiRustCallStatus,
11461160
): Unit
1161+
fun uniffi_bitkitcore_fn_func_blocktank_remove_all_cjit_entries(
1162+
): Long
1163+
fun uniffi_bitkitcore_fn_func_blocktank_remove_all_orders(
1164+
): Long
1165+
fun uniffi_bitkitcore_fn_func_blocktank_wipe_all(
1166+
): Long
11471167
fun uniffi_bitkitcore_fn_func_create_channel_request_url(
11481168
`k1`: RustBufferByValue,
11491169
`callback`: RustBufferByValue,
@@ -1496,6 +1516,8 @@ internal interface UniffiLib : Library {
14961516
`mnemonicPhrase`: RustBufferByValue,
14971517
uniffiCallStatus: UniffiRustCallStatus,
14981518
): Unit
1519+
fun uniffi_bitkitcore_fn_func_wipe_all_databases(
1520+
): Long
14991521
fun ffi_bitkitcore_rustbuffer_alloc(
15001522
`size`: Long,
15011523
uniffiCallStatus: UniffiRustCallStatus,
@@ -1708,8 +1730,16 @@ internal interface UniffiLib : Library {
17081730
`handle`: Long,
17091731
uniffiCallStatus: UniffiRustCallStatus,
17101732
): Unit
1733+
fun uniffi_bitkitcore_checksum_func_activity_wipe_all(
1734+
): Short
17111735
fun uniffi_bitkitcore_checksum_func_add_tags(
17121736
): Short
1737+
fun uniffi_bitkitcore_checksum_func_blocktank_remove_all_cjit_entries(
1738+
): Short
1739+
fun uniffi_bitkitcore_checksum_func_blocktank_remove_all_orders(
1740+
): Short
1741+
fun uniffi_bitkitcore_checksum_func_blocktank_wipe_all(
1742+
): Short
17131743
fun uniffi_bitkitcore_checksum_func_create_channel_request_url(
17141744
): Short
17151745
fun uniffi_bitkitcore_checksum_func_create_cjit_entry(
@@ -1828,6 +1858,8 @@ internal interface UniffiLib : Library {
18281858
): Short
18291859
fun uniffi_bitkitcore_checksum_func_validate_mnemonic(
18301860
): Short
1861+
fun uniffi_bitkitcore_checksum_func_wipe_all_databases(
1862+
): Short
18311863
fun ffi_bitkitcore_uniffi_contract_version(
18321864
): Int
18331865

@@ -1845,9 +1877,21 @@ private fun uniffiCheckContractApiVersion(lib: UniffiLib) {
18451877

18461878

18471879
private fun uniffiCheckApiChecksums(lib: UniffiLib) {
1880+
if (lib.uniffi_bitkitcore_checksum_func_activity_wipe_all() != 19332.toShort()) {
1881+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1882+
}
18481883
if (lib.uniffi_bitkitcore_checksum_func_add_tags() != 63739.toShort()) {
18491884
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
18501885
}
1886+
if (lib.uniffi_bitkitcore_checksum_func_blocktank_remove_all_cjit_entries() != 40127.toShort()) {
1887+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1888+
}
1889+
if (lib.uniffi_bitkitcore_checksum_func_blocktank_remove_all_orders() != 38913.toShort()) {
1890+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1891+
}
1892+
if (lib.uniffi_bitkitcore_checksum_func_blocktank_wipe_all() != 41797.toShort()) {
1893+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
1894+
}
18511895
if (lib.uniffi_bitkitcore_checksum_func_create_channel_request_url() != 9305.toShort()) {
18521896
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
18531897
}
@@ -2025,6 +2069,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
20252069
if (lib.uniffi_bitkitcore_checksum_func_validate_mnemonic() != 31005.toShort()) {
20262070
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
20272071
}
2072+
if (lib.uniffi_bitkitcore_checksum_func_wipe_all_databases() != 54605.toShort()) {
2073+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
2074+
}
20282075
}
20292076

20302077
// Public interface members begin here.
@@ -8881,6 +8928,16 @@ object FfiConverterMapStringString: FfiConverterRustBuffer<Map<kotlin.String, ko
88818928

88828929

88838930

8931+
8932+
@Throws(ActivityException::class)
8933+
fun `activityWipeAll`() {
8934+
uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus ->
8935+
UniffiLib.INSTANCE.uniffi_bitkitcore_fn_func_activity_wipe_all(
8936+
uniffiRustCallStatus,
8937+
)
8938+
}
8939+
}
8940+
88848941
@Throws(ActivityException::class)
88858942
fun `addTags`(`activityId`: kotlin.String, `tags`: List<kotlin.String>) {
88868943
uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus ->
@@ -8892,6 +8949,57 @@ fun `addTags`(`activityId`: kotlin.String, `tags`: List<kotlin.String>) {
88928949
}
88938950
}
88948951

8952+
@Throws(BlocktankException::class, kotlin.coroutines.cancellation.CancellationException::class)
8953+
suspend fun `blocktankRemoveAllCjitEntries`() {
8954+
return uniffiRustCallAsync(
8955+
UniffiLib.INSTANCE.uniffi_bitkitcore_fn_func_blocktank_remove_all_cjit_entries(
8956+
),
8957+
{ future, callback, continuation -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_poll_void(future, callback, continuation) },
8958+
{ future, continuation -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_complete_void(future, continuation) },
8959+
{ future -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_free_void(future) },
8960+
{ future -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_cancel_void(future) },
8961+
// lift function
8962+
{ Unit },
8963+
8964+
// Error FFI converter
8965+
BlocktankExceptionErrorHandler,
8966+
)
8967+
}
8968+
8969+
@Throws(BlocktankException::class, kotlin.coroutines.cancellation.CancellationException::class)
8970+
suspend fun `blocktankRemoveAllOrders`() {
8971+
return uniffiRustCallAsync(
8972+
UniffiLib.INSTANCE.uniffi_bitkitcore_fn_func_blocktank_remove_all_orders(
8973+
),
8974+
{ future, callback, continuation -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_poll_void(future, callback, continuation) },
8975+
{ future, continuation -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_complete_void(future, continuation) },
8976+
{ future -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_free_void(future) },
8977+
{ future -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_cancel_void(future) },
8978+
// lift function
8979+
{ Unit },
8980+
8981+
// Error FFI converter
8982+
BlocktankExceptionErrorHandler,
8983+
)
8984+
}
8985+
8986+
@Throws(BlocktankException::class, kotlin.coroutines.cancellation.CancellationException::class)
8987+
suspend fun `blocktankWipeAll`() {
8988+
return uniffiRustCallAsync(
8989+
UniffiLib.INSTANCE.uniffi_bitkitcore_fn_func_blocktank_wipe_all(
8990+
),
8991+
{ future, callback, continuation -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_poll_void(future, callback, continuation) },
8992+
{ future, continuation -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_complete_void(future, continuation) },
8993+
{ future -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_free_void(future) },
8994+
{ future -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_cancel_void(future) },
8995+
// lift function
8996+
{ Unit },
8997+
8998+
// Error FFI converter
8999+
BlocktankExceptionErrorHandler,
9000+
)
9001+
}
9002+
88959003
@Throws(LnurlException::class)
88969004
fun `createChannelRequestUrl`(`k1`: kotlin.String, `callback`: kotlin.String, `localNodeId`: kotlin.String, `isPrivate`: kotlin.Boolean, `cancel`: kotlin.Boolean): kotlin.String {
88979005
return FfiConverterString.lift(uniffiRustCallWithError(LnurlExceptionErrorHandler) { uniffiRustCallStatus ->
@@ -9811,6 +9919,22 @@ fun `validateMnemonic`(`mnemonicPhrase`: kotlin.String) {
98119919
}
98129920
}
98139921

9922+
@Throws(DbException::class, kotlin.coroutines.cancellation.CancellationException::class)
9923+
suspend fun `wipeAllDatabases`(): kotlin.String {
9924+
return uniffiRustCallAsync(
9925+
UniffiLib.INSTANCE.uniffi_bitkitcore_fn_func_wipe_all_databases(
9926+
),
9927+
{ future, callback, continuation -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_poll_rust_buffer(future, callback, continuation) },
9928+
{ future, continuation -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_complete_rust_buffer(future, continuation) },
9929+
{ future -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_free_rust_buffer(future) },
9930+
{ future -> UniffiLib.INSTANCE.ffi_bitkitcore_rust_future_cancel_rust_buffer(future) },
9931+
// lift function
9932+
{ FfiConverterString.lift(it) },
9933+
// Error FFI converter
9934+
DbExceptionErrorHandler,
9935+
)
9936+
}
9937+
98149938

98159939
// Async support
98169940

0 commit comments

Comments
 (0)