Open thunderbiscuit opened 2 years ago
Also relevant to this conversation: https://gitlab.com/trixnity/uniffi-kotlin-multiplatform-bindings
I have something sorta working in this repo. Only Kotlin side at the moment. I'd love to pair program the iOS side of this if anyone is interested!
There is probably a few different ways to go about this (for example I have not tried trixnity's kmp bindings plugin yet.
A few small things I still need to figure out:
expect/actual
construct will throw
expect data class ElectrumConfig {}
// Modifier 'data' is incompatible with 'expect'
expect/actual
on sealed classes. This is what gets used on the bdk-android side to represent enums variants that contain data structures. For example, the BlockchainConfig
type in bdk-android is:
// bdk-android
sealed class BlockchainConfig {
data class Electrum(val config: ElectrumConfig) : BlockchainConfig()
data class Esplora(val config: EsploraConfig) : BlockchainConfig()
data class Rpc(val config: RpcConfig) : BlockchainConfig()
}
But I don't think you can use the expect/actual construct on inner classes
// bdk-kmp
// doesn't work: Modifier 'expect' is not applicable to 'nested class'
expect sealed class BlockchainConfig {
expect class Electrum(val config: ElectrumConfig) : BlockchainConfig()
expect class Esplora(val config: EsploraConfig) : BlockchainConfig()
expect class Rpc(val config: RpcConfig) : BlockchainConfig()
}
New link related to the plugin: https://github.com/wireapp/core-crypto/pull/214.
I have something sorta working in this repo. Only Kotlin side at the moment. I'd love to pair program the iOS side of this if anyone is interested!
Happy to pair program the iOS side if this is still something you're interested in working on-
I'm quite confident we should be able to build a Kotlin Multiplatform using the bdk-android and bdk-swift libraries.
I'm starting to explore this a bit more and will share an example repo soon.