Skip to content

Dart/Flutter bindings for Blockstream's Liquid Wallet Kit

License

Notifications You must be signed in to change notification settings

psyberfly/lwk-dart

 
 

Repository files navigation

lwk_dart

A dart/flutter library with language bindings for rust library lwk` - Liquid Wallet Kit.

Dependencies

Docker is required for linux builds.

dart pub global activate ffigen
cargo install flutter_rust_bridge_codegen
cargo install cargo-expand
cargo install cargo-ndk
@if [ $$(uname) == "Darwin" ] ; then cargo install cargo-lipo ; fi

For ios builds, make sure you have xcode installed.

Update & Build process

Add new types to types.rs and static functions to api.rs

api.rs contains an Api struct that holds all the static functions.

types.rs structures and enums are also re-exported via api.rs

# in the project root directory

./compile.native.sh # build for your native platform (linux/macos). adds binary to dart test folder.

MacOS as host

macos as the host machine can build binaries for all platforms using:

# requires dockerd running
./compile.all.sh

Compile will first build native binaries of the rust code and move them to the dart test folder.

It will then run flutter_rust_bridge_codegen and generate ffi code in rust and dart.

Non-debian linux users

On non-debian systems you will get some errors with the bridge_generated.dart files.

Error would be related to:

  void store_dart_post_cobject(
    int ptr,
  ) {
    return _store_dart_post_cobject(
      ptr,
    );
  }

You may need to set the path the clang in CPATH manually. Run the following:

export CPATH="$(clang -v 2>&1 | grep "Selected GCC installation" | rev | cut -d' ' -f1 | rev)/include"

About

Dart/Flutter bindings for Blockstream's Liquid Wallet Kit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 27.3%
  • C++ 22.8%
  • CMake 18.2%
  • Rust 16.6%
  • C 5.5%
  • Ruby 2.5%
  • Other 7.1%