breez-sdk-go

module
v0.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2024 License: MIT

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL