README
ΒΆ
BreezSDK β Go Package
The Breez SDK enables mobile developers to integrate lightning and bitcoin payments into their apps with a very shallow learning curve. More information can be found here.
π¨βπ§ Installation
To install the package:
$ go get github.com/breez/breez-sdk-go
Supported platforms
This library embeds the BreezSDK runtime compiled as shared library
objects, and uses cgo
to consume
it. A set of precompiled shared library objects are provided. Thus
this library works (and is tested) on the following platforms:
Platform | Architecture | Triple | Status |
---|---|---|---|
Android | amd64 |
x86_64-linux-android |
β |
aarch64 |
aarch64-linux-android |
β | |
aarch |
armv7-linux-androideabi |
β | |
386 |
i686-linux-android |
β | |
Darwin | amd64 |
x86_64-apple-darwin |
β |
aarch64 |
aarch64-apple-darwin |
β | |
Linux | amd64 |
x86_64-unknown-linux-gnu |
β |
aarch64 |
aarch64-unknown-linux-gnu |
β | |
Windows | amd64 |
x86_64-pc-windows-msvc |
β |
π Usage
package main
import (
"log"
"github.com/breez/breez-sdk-go/breez_sdk"
)
func main() {
seed, _ := breez_sdk.MnemonicToSeed("cruise clever syrup coil cute execute laundry general cover prevent law sheriff")
log.Printf("Seed: %v", seed)
}
Bundling
For some platforms the provided binding libraries need to be copied into a location where they need to be found during runtime.
Android
Copy the binding libraries into the jniLibs directory of your app
cp vendor/github.com/breez/breez-sdk-go/breez_sdk/lib/android-386/*.so android/app/src/main/jniLibs/x86/
cp vendor/github.com/breez/breez-sdk-go/breez_sdk/lib/android-aarch/*.so android/app/src/main/jniLibs/armeabi-v7a/
cp vendor/github.com/breez/breez-sdk-go/breez_sdk/lib/android-aarch64/*.so android/app/src/main/jniLibs/arm64-v8a/
cp vendor/github.com/breez/breez-sdk-go/breez_sdk/lib/android-amd64/*.so android/app/src/main/jniLibs/x86_64/
So they are in the following structure
βββ android
βββ app
βββ src
βββ main
βββ jniLibs
βββ arm64-v8a
βββ libbreez_sdk_bindings.so
βββ libc++_shared.so
βββ armeabi-v7a
βββ libbreez_sdk_bindings.so
βββ libc++_shared.so
βββ x86
βββ libbreez_sdk_bindings.so
βββ libc++_shared.so
βββ x86_64
βββ libbreez_sdk_bindings.so
βββ libc++_shared.so
βββ AndroidManifest.xml
βββ build.gradle
βββ build.gradle
Windows
Copy the binding library to the same directory as the executable file or include the library into the windows install packager.
cp vendor/github.com/breez/breez-sdk-go/breez_sdk/lib/windows-amd64/*.dll build/windows/
π‘ Information for Maintainers and Contributors
This repository is used to publish a Go package providing Go bindings to the Breez SDK's underlying Rust implementation. The Go bindings are generated using UniFFi Bindgen Go.
Any changes to the Breez SDK, the Go bindings, and the configuration of this Go package must be made via the breez-sdk repo.
To release a new version of this package, go to the Actions tab of the https://github.com/breez/breez-sdk GitHub repository. Then select the Publish All Packages workflow and fill in the form with the required version.
Directories
ΒΆ
Path | Synopsis |
---|---|
lib
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
lib/android-386
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
lib/android-aarch
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
lib/android-aarch64
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
lib/android-amd64
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
lib/darwin-aarch64
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
lib/darwin-amd64
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
lib/linux-aarch64
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
lib/linux-amd64
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
lib/windows-amd64
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |