cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.1+v0.25.0
cd examples
MNEMONIC="YOUR TWELVE WORD MNEMONIC HERE" cargo run --bin get-info
cargo build --release
uniffi-bindgen-go src/ldkalby.udl -o ffi/golang -c ./uniffi.toml
cp target/release/libldkalby_bindings.so ffi/golang/ldkalby
cp -r ffi/golang/ldkalby tests/bindings/golang/
cargo test -- --nocapture
Make sure to set YOUR_NWC_NEXT_DIR
cargo build --release && uniffi-bindgen-go src/ldkalby.udl -o ffi/golang -c ./uniffi.toml && cp target/release/libldkalby_bindings.so ffi/golang/ldkalby && cp ffi/golang/ldkalby YOUR_NWC_NEXT_DIR -r
Copy libldkalby_bindings.so
into ldkalby
folder and then copy ldkalby
folder into NWC app.
Import with import ("github.com/getAlby/nostr-wallet-connect/ldkalby")
And then you can call functions e.g. ldkalby.GetInfo()
CGO_LDFLAGS="-lldkalby_bindings -L./ldkalby -Wl,-rpath,./ldkalby" go run .