From e50f8befeafaa2ac45742f86db3ed5ff984e9b6f Mon Sep 17 00:00:00 2001 From: thunderbiscuit Date: Mon, 25 Sep 2023 11:30:22 -0400 Subject: [PATCH] Temp 5: hello world library working on JVM --- bdk-ffi/src/bdk.udl | 4 +- bdk-ffi/src/lib.rs | 8 +- bdk-ffi/src/wallet.rs | 4 + .../kotlin/org/bitcoindevkit/JvmLibTest.kt | 128 ++++++++++-------- .../bitcoindevkit/plugins/UniFfiJvmPlugin.kt | 14 +- 5 files changed, 93 insertions(+), 65 deletions(-) diff --git a/bdk-ffi/src/bdk.udl b/bdk-ffi/src/bdk.udl index c562e1ee..a94b250e 100644 --- a/bdk-ffi/src/bdk.udl +++ b/bdk-ffi/src/bdk.udl @@ -1 +1,3 @@ -namespace bdk {}; +namespace bdk { + string hello_world(); +}; diff --git a/bdk-ffi/src/lib.rs b/bdk-ffi/src/lib.rs index dcdd0da3..8be20ac2 100644 --- a/bdk-ffi/src/lib.rs +++ b/bdk-ffi/src/lib.rs @@ -46,8 +46,12 @@ mod wallet; // use std::str::FromStr; // use std::sync::Arc; // -// uniffi::include_scaffolding!("bdk"); -// +uniffi::include_scaffolding!("bdk"); + +pub fn hello_world() -> String { + String::from("Hello World") +} + // /// A output script and an amount of satoshis. // pub struct ScriptAmount { // pub script: Arc