mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2025-12-18 14:34:24 +01:00
Rename namespace (#345)
* Rename namespace * Fix flutter build * Fix kotlin-multiplatform CI * Rename repositories
This commit is contained in:
4
.github/workflows/build-bindings-android.yml
vendored
4
.github/workflows/build-bindings-android.yml
vendored
@@ -67,7 +67,7 @@ jobs:
|
|||||||
- name: Copy build output
|
- name: Copy build output
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
cp lib/target/${{ matrix.target }}/release/libbreez_liquid_sdk_bindings.so dist
|
cp lib/target/${{ matrix.target }}/release/libbreez_sdk_liquid_bindings.so dist
|
||||||
|
|
||||||
- name: Copy libc++_shared
|
- name: Copy libc++_shared
|
||||||
if: ${{ matrix.target == 'armv7-linux-androideabi'}}
|
if: ${{ matrix.target == 'armv7-linux-androideabi'}}
|
||||||
@@ -129,7 +129,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Build Android ${{ matrix.target }} dummy
|
- name: Build Android ${{ matrix.target }} dummy
|
||||||
run: |
|
run: |
|
||||||
touch libbreez_liquid_sdk_bindings.so
|
touch libbreez_sdk_liquid_bindings.so
|
||||||
touch libc++_shared.so.so
|
touch libc++_shared.so.so
|
||||||
|
|
||||||
- name: Upload dummy Android ${{ matrix.target }} artifact
|
- name: Upload dummy Android ${{ matrix.target }} artifact
|
||||||
|
|||||||
16
.github/workflows/build-bindings-darwin.yml
vendored
16
.github/workflows/build-bindings-darwin.yml
vendored
@@ -66,8 +66,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: bindings-${{ matrix.target }}
|
name: bindings-${{ matrix.target }}
|
||||||
path: |
|
path: |
|
||||||
lib/target/${{ matrix.target }}/release/libbreez_liquid_sdk_bindings.dylib
|
lib/target/${{ matrix.target }}/release/libbreez_sdk_liquid_bindings.dylib
|
||||||
lib/target/${{ matrix.target }}/release/libbreez_liquid_sdk_bindings.a
|
lib/target/${{ matrix.target }}/release/libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
merge:
|
merge:
|
||||||
runs-on: macOS-latest
|
runs-on: macOS-latest
|
||||||
@@ -87,16 +87,16 @@ jobs:
|
|||||||
- name: Build Darwin universal
|
- name: Build Darwin universal
|
||||||
run: |
|
run: |
|
||||||
mkdir -p darwin-universal
|
mkdir -p darwin-universal
|
||||||
lipo -create -output darwin-universal/libbreez_liquid_sdk_bindings.dylib aarch64-apple-darwin/libbreez_liquid_sdk_bindings.dylib x86_64-apple-darwin/libbreez_liquid_sdk_bindings.dylib
|
lipo -create -output darwin-universal/libbreez_sdk_liquid_bindings.dylib aarch64-apple-darwin/libbreez_sdk_liquid_bindings.dylib x86_64-apple-darwin/libbreez_sdk_liquid_bindings.dylib
|
||||||
lipo -create -output darwin-universal/libbreez_liquid_sdk_bindings.a aarch64-apple-darwin/libbreez_liquid_sdk_bindings.a x86_64-apple-darwin/libbreez_liquid_sdk_bindings.a
|
lipo -create -output darwin-universal/libbreez_sdk_liquid_bindings.a aarch64-apple-darwin/libbreez_sdk_liquid_bindings.a x86_64-apple-darwin/libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
- name: Archive release
|
- name: Archive release
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-darwin-universal
|
name: bindings-darwin-universal
|
||||||
path: |
|
path: |
|
||||||
darwin-universal/libbreez_liquid_sdk_bindings.dylib
|
darwin-universal/libbreez_sdk_liquid_bindings.dylib
|
||||||
darwin-universal/libbreez_liquid_sdk_bindings.a
|
darwin-universal/libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
build-dummies:
|
build-dummies:
|
||||||
if: ${{ inputs.use-dummy-binaries }}
|
if: ${{ inputs.use-dummy-binaries }}
|
||||||
@@ -112,8 +112,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Build dummy darwin ${{ matrix.target }}
|
- name: Build dummy darwin ${{ matrix.target }}
|
||||||
run: |
|
run: |
|
||||||
touch libbreez_liquid_sdk_bindings.dylib
|
touch libbreez_sdk_liquid_bindings.dylib
|
||||||
touch libbreez_liquid_sdk_bindings.a
|
touch libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
- name: Upload dummy darwin ${{ matrix.target }} artifact
|
- name: Upload dummy darwin ${{ matrix.target }} artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
4
.github/workflows/build-bindings-flutter.yml
vendored
4
.github/workflows/build-bindings-flutter.yml
vendored
@@ -83,7 +83,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
cp lib/bindings/langs/flutter/platform-build/android.tar.gz dist
|
cp lib/bindings/langs/flutter/platform-build/android.tar.gz dist
|
||||||
cp lib/bindings/langs/flutter/platform-build/breez_liquid_sdk.xcframework.zip dist
|
cp lib/bindings/langs/flutter/platform-build/breez_sdk_liquid.xcframework.zip dist
|
||||||
cp lib/bindings/langs/flutter/platform-build/other.tar.gz dist
|
cp lib/bindings/langs/flutter/platform-build/other.tar.gz dist
|
||||||
|
|
||||||
- name: Archive Flutter bindings
|
- name: Archive Flutter bindings
|
||||||
@@ -100,7 +100,7 @@ jobs:
|
|||||||
- name: Create dummy files
|
- name: Create dummy files
|
||||||
run: |
|
run: |
|
||||||
touch android.tar.gz
|
touch android.tar.gz
|
||||||
touch breez_liquid_sdk.xcframework.zip
|
touch breez_sdk_liquid.xcframework.zip
|
||||||
touch other.tar.gz
|
touch other.tar.gz
|
||||||
|
|
||||||
- name: Archive Flutter dummy bindings
|
- name: Archive Flutter dummy bindings
|
||||||
|
|||||||
12
.github/workflows/build-bindings-ios.yml
vendored
12
.github/workflows/build-bindings-ios.yml
vendored
@@ -70,7 +70,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-${{ matrix.target }}
|
name: bindings-${{ matrix.target }}
|
||||||
path: lib/target/${{ matrix.target }}/release/libbreez_liquid_sdk_bindings.a
|
path: lib/target/${{ matrix.target }}/release/libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
merge:
|
merge:
|
||||||
runs-on: macOS-latest
|
runs-on: macOS-latest
|
||||||
@@ -95,24 +95,24 @@ jobs:
|
|||||||
- name: Build ios-universal
|
- name: Build ios-universal
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ios-universal
|
mkdir -p ios-universal
|
||||||
lipo -create -output ios-universal/libbreez_liquid_sdk_bindings.a aarch64-apple-ios/libbreez_liquid_sdk_bindings.a x86_64-apple-ios/libbreez_liquid_sdk_bindings.a
|
lipo -create -output ios-universal/libbreez_sdk_liquid_bindings.a aarch64-apple-ios/libbreez_sdk_liquid_bindings.a x86_64-apple-ios/libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
- name: Build ios-universal-sim
|
- name: Build ios-universal-sim
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ios-universal-sim
|
mkdir -p ios-universal-sim
|
||||||
lipo -create -output ios-universal-sim/libbreez_liquid_sdk_bindings.a aarch64-apple-ios-sim/libbreez_liquid_sdk_bindings.a x86_64-apple-ios/libbreez_liquid_sdk_bindings.a
|
lipo -create -output ios-universal-sim/libbreez_sdk_liquid_bindings.a aarch64-apple-ios-sim/libbreez_sdk_liquid_bindings.a x86_64-apple-ios/libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
- name: Archive ios-universal
|
- name: Archive ios-universal
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-ios-universal
|
name: bindings-ios-universal
|
||||||
path: ios-universal/libbreez_liquid_sdk_bindings.a
|
path: ios-universal/libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
- name: Archive ios-universal-sim
|
- name: Archive ios-universal-sim
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-ios-universal-sim
|
name: bindings-ios-universal-sim
|
||||||
path: ios-universal-sim/libbreez_liquid_sdk_bindings.a
|
path: ios-universal-sim/libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
build-dummies:
|
build-dummies:
|
||||||
if: ${{ inputs.use-dummy-binaries }}
|
if: ${{ inputs.use-dummy-binaries }}
|
||||||
@@ -130,7 +130,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Build dummy ios ${{ matrix.target }}
|
- name: Build dummy ios ${{ matrix.target }}
|
||||||
run: |
|
run: |
|
||||||
touch libbreez_liquid_sdk_bindings.a
|
touch libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
- name: Upload dummy ios ${{ matrix.target }} artifact
|
- name: Upload dummy ios ${{ matrix.target }} artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
4
.github/workflows/build-bindings-linux.yml
vendored
4
.github/workflows/build-bindings-linux.yml
vendored
@@ -79,7 +79,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-${{ matrix.target }}
|
name: bindings-${{ matrix.target }}
|
||||||
path: lib/target/${{ matrix.target }}/release/libbreez_liquid_sdk_bindings.so
|
path: lib/target/${{ matrix.target }}/release/libbreez_sdk_liquid_bindings.so
|
||||||
|
|
||||||
build-dummies:
|
build-dummies:
|
||||||
if: ${{ inputs.use-dummy-binaries }}
|
if: ${{ inputs.use-dummy-binaries }}
|
||||||
@@ -94,7 +94,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Build dummy linux ${{ matrix.target }}
|
- name: Build dummy linux ${{ matrix.target }}
|
||||||
run: |
|
run: |
|
||||||
touch libbreez_liquid_sdk_bindings.so
|
touch libbreez_sdk_liquid_bindings.so
|
||||||
|
|
||||||
- name: Upload dummy linux ${{ matrix.target }} artifact
|
- name: Upload dummy linux ${{ matrix.target }} artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
4
.github/workflows/build-bindings-windows.yml
vendored
4
.github/workflows/build-bindings-windows.yml
vendored
@@ -64,7 +64,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-${{ matrix.target }}
|
name: bindings-${{ matrix.target }}
|
||||||
path: lib/target/${{ matrix.target }}/release/breez_liquid_sdk_bindings.dll
|
path: lib/target/${{ matrix.target }}/release/breez_sdk_liquid_bindings.dll
|
||||||
|
|
||||||
build-dummies:
|
build-dummies:
|
||||||
if: ${{ inputs.use-dummy-binaries }}
|
if: ${{ inputs.use-dummy-binaries }}
|
||||||
@@ -79,7 +79,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Build dummy windows ${{ matrix.target }}
|
- name: Build dummy windows ${{ matrix.target }}
|
||||||
run: |
|
run: |
|
||||||
touch breez_liquid_sdk_bindings.dll
|
touch breez_sdk_liquid_bindings.dll
|
||||||
|
|
||||||
- name: Upload dummy windows ${{ matrix.target }} artifact
|
- name: Upload dummy windows ${{ matrix.target }} artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
24
.github/workflows/build-language-bindings.yml
vendored
24
.github/workflows/build-language-bindings.yml
vendored
@@ -61,7 +61,7 @@ jobs:
|
|||||||
build-language-bindings:
|
build-language-bindings:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout breez-liquid-sdk repo
|
- name: Checkout breez-sdk-liquid repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.repository || github.repository }}
|
repository: ${{ inputs.repository || github.repository }}
|
||||||
@@ -82,14 +82,14 @@ jobs:
|
|||||||
if: ${{ inputs.kotlin }}
|
if: ${{ inputs.kotlin }}
|
||||||
working-directory: lib/bindings
|
working-directory: lib/bindings
|
||||||
run: |
|
run: |
|
||||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_liquid_sdk.udl --language kotlin -o ffi/kotlin
|
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --language kotlin -o ffi/kotlin
|
||||||
|
|
||||||
- name: Archive Kotlin binding
|
- name: Archive Kotlin binding
|
||||||
if: ${{ inputs.kotlin }}
|
if: ${{ inputs.kotlin }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-kotlin
|
name: bindings-kotlin
|
||||||
path: lib/bindings/ffi/kotlin/breez_liquid_sdk/breez_liquid_sdk.kt
|
path: lib/bindings/ffi/kotlin/breez_sdk_liquid/breez_sdk_liquid.kt
|
||||||
|
|
||||||
- name: Archive Kotlin multiplatform binding
|
- name: Archive Kotlin multiplatform binding
|
||||||
if: ${{ inputs.kotlin }}
|
if: ${{ inputs.kotlin }}
|
||||||
@@ -102,53 +102,53 @@ jobs:
|
|||||||
if: ${{ inputs.swift }}
|
if: ${{ inputs.swift }}
|
||||||
working-directory: lib/bindings
|
working-directory: lib/bindings
|
||||||
run: |
|
run: |
|
||||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_liquid_sdk.udl --no-format --language swift --out-dir langs/swift/Sources/BreezLiquidSDK
|
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language swift --out-dir langs/swift/Sources/BreezSDKLiquid
|
||||||
mv langs/swift/Sources/BreezLiquidSDK/breez_liquid_sdk.swift langs/swift/Sources/BreezLiquidSDK/BreezLiquidSDK.swift
|
mv langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquid.swift langs/swift/Sources/BreezSDKLiquid/BreezSDKLiquid.swift
|
||||||
|
|
||||||
- name: Archive Swift binding
|
- name: Archive Swift binding
|
||||||
if: ${{ inputs.swift }}
|
if: ${{ inputs.swift }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-swift
|
name: bindings-swift
|
||||||
path: lib/bindings/langs/swift/Sources/BreezLiquidSDK/*
|
path: lib/bindings/langs/swift/Sources/BreezSDKLiquid/*
|
||||||
|
|
||||||
- name: Build Python binding
|
- name: Build Python binding
|
||||||
if: ${{ inputs.python }}
|
if: ${{ inputs.python }}
|
||||||
working-directory: lib/bindings
|
working-directory: lib/bindings
|
||||||
run: |
|
run: |
|
||||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_liquid_sdk.udl --language python -o ffi/python
|
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --language python -o ffi/python
|
||||||
|
|
||||||
- name: Archive Python binding
|
- name: Archive Python binding
|
||||||
if: ${{ inputs.python }}
|
if: ${{ inputs.python }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-python
|
name: bindings-python
|
||||||
path: lib/bindings/ffi/python/breez_liquid_sdk.py
|
path: lib/bindings/ffi/python/breez_sdk_liquid.py
|
||||||
|
|
||||||
# - name: Build C# binding
|
# - name: Build C# binding
|
||||||
# if: ${{ inputs.csharp }}
|
# if: ${{ inputs.csharp }}
|
||||||
# working-directory: lib/bindings
|
# working-directory: lib/bindings
|
||||||
# run: |
|
# run: |
|
||||||
# cargo install uniffi-bindgen-cs --git https://github.com/breez/uniffi-bindgen-cs --branch namespace
|
# cargo install uniffi-bindgen-cs --git https://github.com/breez/uniffi-bindgen-cs --branch namespace
|
||||||
# uniffi-bindgen-cs src/breez_liquid_sdk.udl -o ffi/csharp -c ./uniffi.toml
|
# uniffi-bindgen-cs src/breez_sdk_liquid.udl -o ffi/csharp -c ./uniffi.toml
|
||||||
#
|
#
|
||||||
# - name: Archive C# binding
|
# - name: Archive C# binding
|
||||||
# if: ${{ inputs.csharp }}
|
# if: ${{ inputs.csharp }}
|
||||||
# uses: actions/upload-artifact@v4
|
# uses: actions/upload-artifact@v4
|
||||||
# with:
|
# with:
|
||||||
# name: bindings-csharp
|
# name: bindings-csharp
|
||||||
# path: lib/bindings/ffi/csharp/breez_liquid_sdk.cs
|
# path: lib/bindings/ffi/csharp/breez_sdk_liquid.cs
|
||||||
#
|
#
|
||||||
# - name: Build golang binding
|
# - name: Build golang binding
|
||||||
# if: ${{ inputs.golang }}
|
# if: ${{ inputs.golang }}
|
||||||
# working-directory: lib/bindings
|
# working-directory: lib/bindings
|
||||||
# run: |
|
# run: |
|
||||||
# cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.1.5+v0.23.0
|
# cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.1.5+v0.23.0
|
||||||
# uniffi-bindgen-go src/breez_liquid_sdk.udl -o ffi/golang -c ./uniffi.toml
|
# uniffi-bindgen-go src/breez_sdk_liquid.udl -o ffi/golang -c ./uniffi.toml
|
||||||
#
|
#
|
||||||
# - name: Archive golang binding
|
# - name: Archive golang binding
|
||||||
# if: ${{ inputs.golang }}
|
# if: ${{ inputs.golang }}
|
||||||
# uses: actions/upload-artifact@v4
|
# uses: actions/upload-artifact@v4
|
||||||
# with:
|
# with:
|
||||||
# name: bindings-golang
|
# name: bindings-golang
|
||||||
# path: lib/bindings/ffi/golang/breez/breez_liquid_sdk/breez_liquid_sdk.*
|
# path: lib/bindings/ffi/golang/breez/breez_sdk_liquid/breez_sdk_liquid.*
|
||||||
|
|||||||
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -242,10 +242,10 @@ jobs:
|
|||||||
cargo init --name test_project --vcs none
|
cargo init --name test_project --vcs none
|
||||||
|
|
||||||
# A project might reference our SDK as a git repository
|
# A project might reference our SDK as a git repository
|
||||||
# cargo add --git https://github.com/breez/breez-liquid-sdk breez-liquid-sdk
|
# cargo add --git https://github.com/breez/breez-sdk-liquid breez-sdk-liquid
|
||||||
|
|
||||||
# In this test, we reference the checked out repo (e.g. this PR branch)
|
# In this test, we reference the checked out repo (e.g. this PR branch)
|
||||||
cargo add --path ../lib/core breez-liquid-sdk
|
cargo add --path ../lib/core breez-sdk-liquid
|
||||||
|
|
||||||
# Add the secp256k1-zkp patch: https://github.com/BlockstreamResearch/rust-secp256k1-zkp/pull/48/commits
|
# Add the secp256k1-zkp patch: https://github.com/BlockstreamResearch/rust-secp256k1-zkp/pull/48/commits
|
||||||
echo "[patch.crates-io]" >> Cargo.toml
|
echo "[patch.crates-io]" >> Cargo.toml
|
||||||
|
|||||||
6
.github/workflows/publish-android.yml
vendored
6
.github/workflows/publish-android.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
build-package:
|
build-package:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout breez-liquid-sdk repo
|
- name: Checkout breez-sdk-liquid repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.repository || github.repository }}
|
repository: ${{ inputs.repository || github.repository }}
|
||||||
@@ -84,7 +84,7 @@ jobs:
|
|||||||
# We're waiting for at most 60s before triggering the Jitpack build to give our Maven repo
|
# We're waiting for at most 60s before triggering the Jitpack build to give our Maven repo
|
||||||
# some time to process the just uploaded files (the Jitpack build is dependent upon them being available).
|
# some time to process the just uploaded files (the Jitpack build is dependent upon them being available).
|
||||||
# If anything fails here, we'll still finish sucessfully as this is an optional optimization.
|
# If anything fails here, we'll still finish sucessfully as this is an optional optimization.
|
||||||
timeout 60 bash -c 'while [[ "$(curl --output /dev/null --silent --head --write-out ''%{http_code}'' https://mvn.breez.technology/releases/breez_liquid_sdk/bindings-android/${{ inputs.package-version }}/bindings-android-${{ inputs.package-version }}.pom)" != "200" ]]; do echo "Waiting for package to be published on mvn.breez.technology..." && sleep 5; done && echo "Package found."' || echo "Package not found." && true
|
timeout 60 bash -c 'while [[ "$(curl --output /dev/null --silent --head --write-out ''%{http_code}'' https://mvn.breez.technology/releases/breez_sdk_liquid/bindings-android/${{ inputs.package-version }}/bindings-android-${{ inputs.package-version }}.pom)" != "200" ]]; do echo "Waiting for package to be published on mvn.breez.technology..." && sleep 5; done && echo "Package found."' || echo "Package not found." && true
|
||||||
echo "Attempting to trigger Jitpack build..."
|
echo "Attempting to trigger Jitpack build..."
|
||||||
curl -s -m 30 https://jitpack.io/api/builds/com.github.breez/breez-liquid-sdk/${{ inputs.package-version }} || true
|
curl -s -m 30 https://jitpack.io/api/builds/com.github.breez/breez-sdk-liquid/${{ inputs.package-version }} || true
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
|||||||
4
.github/workflows/publish-csharp.yml
vendored
4
.github/workflows/publish-csharp.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
|||||||
build-package:
|
build-package:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout breez-liquid-sdk repo
|
- name: Checkout breez-sdk-liquid repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.repository || github.repository }}
|
repository: ${{ inputs.repository || github.repository }}
|
||||||
@@ -110,7 +110,7 @@ jobs:
|
|||||||
macOS-latest,
|
macOS-latest,
|
||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout breez-liquid-sdk repo
|
- name: Checkout breez-sdk-liquid repo
|
||||||
if: ${{ !inputs.skip-tests }}
|
if: ${{ !inputs.skip-tests }}
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
10
.github/workflows/publish-dart.yml
vendored
10
.github/workflows/publish-dart.yml
vendored
@@ -21,22 +21,22 @@ on:
|
|||||||
default: true
|
default: true
|
||||||
secrets:
|
secrets:
|
||||||
REPO_SSH_KEY:
|
REPO_SSH_KEY:
|
||||||
description: 'ssh key to commit to the breez-liquid-sdk-dart repository'
|
description: 'ssh key to commit to the breez-sdk-liquid-dart repository'
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-tag-release:
|
build-tag-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout breez-liquid-sdk-dart repo
|
- name: Checkout breez-sdk-liquid-dart repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: breez/breez-liquid-sdk-dart
|
repository: breez/breez-sdk-liquid-dart
|
||||||
ssh-key: ${{ secrets.REPO_SSH_KEY }}
|
ssh-key: ${{ secrets.REPO_SSH_KEY }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
- name: Checkout breez-liquid-sdk repo
|
- name: Checkout breez-sdk-liquid repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.repository || github.repository }}
|
repository: ${{ inputs.repository || github.repository }}
|
||||||
@@ -67,7 +67,7 @@ jobs:
|
|||||||
- name: Archive Dart release
|
- name: Archive Dart release
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: breez-liquid-sdk-dart-${{ inputs.package-version || github.sha }}
|
name: breez-sdk-liquid-dart-${{ inputs.package-version || github.sha }}
|
||||||
path: |
|
path: |
|
||||||
dist/*
|
dist/*
|
||||||
!dist/.git
|
!dist/.git
|
||||||
|
|||||||
20
.github/workflows/publish-flutter.yml
vendored
20
.github/workflows/publish-flutter.yml
vendored
@@ -21,25 +21,25 @@ on:
|
|||||||
default: true
|
default: true
|
||||||
secrets:
|
secrets:
|
||||||
REPO_SSH_KEY:
|
REPO_SSH_KEY:
|
||||||
description: 'ssh key to commit to the breez-liquid-sdk-flutter repository'
|
description: 'ssh key to commit to the breez-sdk-liquid-flutter repository'
|
||||||
required: true
|
required: true
|
||||||
SWIFT_RELEASE_TOKEN:
|
SWIFT_RELEASE_TOKEN:
|
||||||
description: 'github token to release to the breez-liquid-sdk-flutter repository'
|
description: 'github token to release to the breez-sdk-liquid-flutter repository'
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-tag-release:
|
build-tag-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout breez-liquid-sdk-flutter repo
|
- name: Checkout breez-sdk-liquid-flutter repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: breez/breez-liquid-sdk-flutter
|
repository: breez/breez-sdk-liquid-flutter
|
||||||
ssh-key: ${{ secrets.REPO_SSH_KEY }}
|
ssh-key: ${{ secrets.REPO_SSH_KEY }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
- name: Checkout breez-liquid-sdk repo
|
- name: Checkout breez-sdk-liquid repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.repository || github.repository }}
|
repository: ${{ inputs.repository || github.repository }}
|
||||||
@@ -59,7 +59,7 @@ jobs:
|
|||||||
cp -r ../build/packages/flutter/android .
|
cp -r ../build/packages/flutter/android .
|
||||||
cp -r ../build/packages/flutter/ios .
|
cp -r ../build/packages/flutter/ios .
|
||||||
cp -r ../build/packages/flutter/lib .
|
cp -r ../build/packages/flutter/lib .
|
||||||
cp -r ../build/lib/bindings/langs/flutter/breez_liquid_sdk/include/breez_liquid_sdk.h ios/Classes
|
cp -r ../build/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h ios/Classes
|
||||||
cp ../build/packages/flutter/analysis_options.yaml .
|
cp ../build/packages/flutter/analysis_options.yaml .
|
||||||
cp ../build/packages/flutter/pubspec.yaml .
|
cp ../build/packages/flutter/pubspec.yaml .
|
||||||
cp ../build/packages/flutter/pubspec_overrides.yaml .
|
cp ../build/packages/flutter/pubspec_overrides.yaml .
|
||||||
@@ -80,7 +80,7 @@ jobs:
|
|||||||
working-directory: dist
|
working-directory: dist
|
||||||
run: |
|
run: |
|
||||||
sed -i.bak -e 's/version:.*/version: ${{ inputs.package-version }}/' pubspec.yaml
|
sed -i.bak -e 's/version:.*/version: ${{ inputs.package-version }}/' pubspec.yaml
|
||||||
sed -i.bak -e 's/path:.*/git:\n url: git@github.com:breez\/breez-liquid-sdk-dart.git\n ref: ${{ inputs.package-version }}/' pubspec_overrides.yaml
|
sed -i.bak -e 's/path:.*/git:\n url: git@github.com:breez\/breez-sdk-liquid-dart.git\n ref: ${{ inputs.package-version }}/' pubspec_overrides.yaml
|
||||||
sed -i.bak -e "s/^version .*/version '${{ inputs.package-version }}'/" android/build.gradle
|
sed -i.bak -e "s/^version .*/version '${{ inputs.package-version }}'/" android/build.gradle
|
||||||
sed -i.bak -e 's/set(TagName.*/set(TagName "v${{ inputs.package-version }}")/' android/CMakeLists.txt
|
sed -i.bak -e 's/set(TagName.*/set(TagName "v${{ inputs.package-version }}")/' android/CMakeLists.txt
|
||||||
sed -i.bak -e "s/^version = .*/version = '${{ inputs.package-version }}'/" ios/flutter_breez_liquid.podspec
|
sed -i.bak -e "s/^version = .*/version = '${{ inputs.package-version }}'/" ios/flutter_breez_liquid.podspec
|
||||||
@@ -93,7 +93,7 @@ jobs:
|
|||||||
- name: Archive flutter release
|
- name: Archive flutter release
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: breez-liquid-sdk-flutter-${{ inputs.package-version || github.sha }}
|
name: breez-sdk-liquid-flutter-${{ inputs.package-version || github.sha }}
|
||||||
path: |
|
path: |
|
||||||
dist/*
|
dist/*
|
||||||
!dist/.git
|
!dist/.git
|
||||||
@@ -114,10 +114,10 @@ jobs:
|
|||||||
if: ${{ inputs.publish }}
|
if: ${{ inputs.publish }}
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
repository: breez/breez-liquid-sdk-flutter
|
repository: breez/breez-sdk-liquid-flutter
|
||||||
files: |
|
files: |
|
||||||
bindings/android.tar.gz
|
bindings/android.tar.gz
|
||||||
bindings/breez_liquid_sdk.xcframework.zip
|
bindings/breez_sdk_liquid.xcframework.zip
|
||||||
bindings/other.tar.gz
|
bindings/other.tar.gz
|
||||||
tag_name: v${{ inputs.package-version || '0.0.1' }}
|
tag_name: v${{ inputs.package-version || '0.0.1' }}
|
||||||
generate_release_notes: false
|
generate_release_notes: false
|
||||||
|
|||||||
58
.github/workflows/publish-golang.yml
vendored
58
.github/workflows/publish-golang.yml
vendored
@@ -24,67 +24,67 @@ jobs:
|
|||||||
build-tag-release:
|
build-tag-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout breez-liquid-sdk-go repo
|
- name: Checkout breez-sdk-liquid-go repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: breez/breez-liquid-sdk-go
|
repository: breez/breez-sdk-liquid-go
|
||||||
ssh-key: ${{ secrets.REPO_SSH_KEY }}
|
ssh-key: ${{ secrets.REPO_SSH_KEY }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-golang
|
name: bindings-golang
|
||||||
path: breez_liquid_sdk
|
path: breez_sdk_liquid
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-i686-linux-android
|
name: bindings-i686-linux-android
|
||||||
path: breez_liquid_sdk/lib/android-386
|
path: breez_sdk_liquid/lib/android-386
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-armv7-linux-androideabi
|
name: bindings-armv7-linux-androideabi
|
||||||
path: breez_liquid_sdk/lib/android-aarch
|
path: breez_sdk_liquid/lib/android-aarch
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-aarch64-linux-android
|
name: bindings-aarch64-linux-android
|
||||||
path: breez_liquid_sdk/lib/android-aarch64
|
path: breez_sdk_liquid/lib/android-aarch64
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-x86_64-linux-android
|
name: bindings-x86_64-linux-android
|
||||||
path: breez_liquid_sdk/lib/android-amd64
|
path: breez_sdk_liquid/lib/android-amd64
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-aarch64-apple-darwin
|
name: bindings-aarch64-apple-darwin
|
||||||
path: breez_liquid_sdk/lib/darwin-aarch64
|
path: breez_sdk_liquid/lib/darwin-aarch64
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-x86_64-apple-darwin
|
name: bindings-x86_64-apple-darwin
|
||||||
path: breez_liquid_sdk/lib/darwin-amd64
|
path: breez_sdk_liquid/lib/darwin-amd64
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-aarch64-unknown-linux-gnu
|
name: bindings-aarch64-unknown-linux-gnu
|
||||||
path: breez_liquid_sdk/lib/linux-aarch64
|
path: breez_sdk_liquid/lib/linux-aarch64
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-x86_64-unknown-linux-gnu
|
name: bindings-x86_64-unknown-linux-gnu
|
||||||
path: breez_liquid_sdk/lib/linux-amd64
|
path: breez_sdk_liquid/lib/linux-amd64
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-x86_64-pc-windows-msvc
|
name: bindings-x86_64-pc-windows-msvc
|
||||||
path: breez_liquid_sdk/lib/windows-amd64
|
path: breez_sdk_liquid/lib/windows-amd64
|
||||||
|
|
||||||
- name: Archive Go release
|
- name: Archive Go release
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: breez-liquid-sdk-go-${{ inputs.package-version || github.sha }}
|
name: breez-sdk-liquid-go-${{ inputs.package-version || github.sha }}
|
||||||
path: |
|
path: |
|
||||||
./*
|
./*
|
||||||
!./.git
|
!./.git
|
||||||
@@ -94,22 +94,22 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --global user.email github-actions@github.com
|
git config --global user.email github-actions@github.com
|
||||||
git config --global user.name github-actions
|
git config --global user.name github-actions
|
||||||
git add breez_liquid_sdk/breez_liquid_sdk.h
|
git add breez_sdk_liquid/breez_sdk_liquid.h
|
||||||
git add breez_liquid_sdk/breez_liquid_sdk.c
|
git add breez_sdk_liquid/breez_sdk_liquid.c
|
||||||
git add breez_liquid_sdk/breez_liquid_sdk.go
|
git add breez_sdk_liquid/breez_sdk_liquid.go
|
||||||
git add breez_liquid_sdk/lib/android-386/libbreez_liquid_sdk_bindings.so
|
git add breez_sdk_liquid/lib/android-386/libbreez_sdk_liquid_bindings.so
|
||||||
git add breez_liquid_sdk/lib/android-386/libc++_shared.so
|
git add breez_sdk_liquid/lib/android-386/libc++_shared.so
|
||||||
git add breez_liquid_sdk/lib/android-aarch/libbreez_liquid_sdk_bindings.so
|
git add breez_sdk_liquid/lib/android-aarch/libbreez_sdk_liquid_bindings.so
|
||||||
git add breez_liquid_sdk/lib/android-aarch/libc++_shared.so
|
git add breez_sdk_liquid/lib/android-aarch/libc++_shared.so
|
||||||
git add breez_liquid_sdk/lib/android-aarch64/libbreez_liquid_sdk_bindings.so
|
git add breez_sdk_liquid/lib/android-aarch64/libbreez_sdk_liquid_bindings.so
|
||||||
git add breez_liquid_sdk/lib/android-aarch64/libc++_shared.so
|
git add breez_sdk_liquid/lib/android-aarch64/libc++_shared.so
|
||||||
git add breez_liquid_sdk/lib/android-amd64/libbreez_liquid_sdk_bindings.so
|
git add breez_sdk_liquid/lib/android-amd64/libbreez_sdk_liquid_bindings.so
|
||||||
git add breez_liquid_sdk/lib/android-amd64/libc++_shared.so
|
git add breez_sdk_liquid/lib/android-amd64/libc++_shared.so
|
||||||
git add breez_liquid_sdk/lib/darwin-aarch64/libbreez_liquid_sdk_bindings.dylib
|
git add breez_sdk_liquid/lib/darwin-aarch64/libbreez_sdk_liquid_bindings.dylib
|
||||||
git add breez_liquid_sdk/lib/darwin-amd64/libbreez_liquid_sdk_bindings.dylib
|
git add breez_sdk_liquid/lib/darwin-amd64/libbreez_sdk_liquid_bindings.dylib
|
||||||
git add breez_liquid_sdk/lib/linux-aarch64/libbreez_liquid_sdk_bindings.so
|
git add breez_sdk_liquid/lib/linux-aarch64/libbreez_sdk_liquid_bindings.so
|
||||||
git add breez_liquid_sdk/lib/linux-amd64/libbreez_liquid_sdk_bindings.so
|
git add breez_sdk_liquid/lib/linux-amd64/libbreez_sdk_liquid_bindings.so
|
||||||
git add breez_liquid_sdk/lib/windows-amd64/breez_liquid_sdk_bindings.dll
|
git add breez_sdk_liquid/lib/windows-amd64/breez_sdk_liquid_bindings.dll
|
||||||
git commit -m "Update Go bindings to version v${{ inputs.package-version }}"
|
git commit -m "Update Go bindings to version v${{ inputs.package-version }}"
|
||||||
git push
|
git push
|
||||||
git tag v${{ inputs.package-version }} -m "v${{ inputs.package-version }}"
|
git tag v${{ inputs.package-version }} -m "v${{ inputs.package-version }}"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ jobs:
|
|||||||
build-package:
|
build-package:
|
||||||
runs-on: macOS-latest
|
runs-on: macOS-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout breez-liquid-sdk repo
|
- name: Checkout breez-sdk-liquid repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.repository || github.repository }}
|
repository: ${{ inputs.repository || github.repository }}
|
||||||
@@ -45,44 +45,44 @@ jobs:
|
|||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-android-jniLibs
|
name: bindings-android-jniLibs
|
||||||
path: lib/bindings/langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/androidMain/jniLibs
|
path: lib/bindings/langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/androidMain/jniLibs
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-kotlin-multiplatform
|
name: bindings-kotlin-multiplatform
|
||||||
path: lib/bindings/langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src
|
path: lib/bindings/langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src
|
||||||
|
|
||||||
- name: Copy jvmMain
|
- name: Copy jvmMain
|
||||||
working-directory: lib/bindings
|
working-directory: lib/bindings
|
||||||
run: |
|
run: |
|
||||||
cp -r langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/jvmMain/kotlin langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/androidMain/
|
cp -r langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/jvmMain/kotlin langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/androidMain/
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-aarch64-apple-ios
|
name: bindings-aarch64-apple-ios
|
||||||
path: lib/bindings/langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/lib/ios-arm64
|
path: lib/bindings/langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/lib/ios-arm64
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-aarch64-apple-ios-sim
|
name: bindings-aarch64-apple-ios-sim
|
||||||
path: lib/bindings/langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/lib/ios-simulator-arm64
|
path: lib/bindings/langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/lib/ios-simulator-arm64
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-x86_64-apple-ios
|
name: bindings-x86_64-apple-ios
|
||||||
path: lib/bindings/langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/lib/ios-simulator-x64
|
path: lib/bindings/langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/lib/ios-simulator-x64
|
||||||
|
|
||||||
- name: Build Kotlin Multiplatform project
|
- name: Build Kotlin Multiplatform project
|
||||||
working-directory: lib/bindings/langs/kotlin-multiplatform
|
working-directory: lib/bindings/langs/kotlin-multiplatform
|
||||||
env:
|
env:
|
||||||
ORG_GRADLE_PROJECT_libraryVersion: ${{ inputs.package-version || '0.0.1' }}
|
ORG_GRADLE_PROJECT_libraryVersion: ${{ inputs.package-version || '0.0.1' }}
|
||||||
run: ./gradlew :breez-liquid-sdk-kmp:assemble
|
run: ./gradlew :breez-sdk-liquid-kmp:assemble
|
||||||
|
|
||||||
- name: Archive aar
|
- name: Archive aar
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: kotlin-multiplatform-release.aar
|
name: kotlin-multiplatform-release.aar
|
||||||
path: lib/bindings/langs/kotlin-multiplatform/breez-liquid-sdk-kmp/build/outputs/aar/breez-liquid-sdk-kmp-release.aar
|
path: lib/bindings/langs/kotlin-multiplatform/breez-sdk-liquid-kmp/build/outputs/aar/breez-sdk-liquid-kmp-release.aar
|
||||||
|
|
||||||
- name: Publish artifacts
|
- name: Publish artifacts
|
||||||
if: ${{ inputs.publish }}
|
if: ${{ inputs.publish }}
|
||||||
|
|||||||
22
.github/workflows/publish-python.yml
vendored
22
.github/workflows/publish-python.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout breez-liquid-sdk repo
|
- name: Checkout breez-sdk-liquid repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.repository || github.repository }}
|
repository: ${{ inputs.repository || github.repository }}
|
||||||
@@ -45,16 +45,16 @@ jobs:
|
|||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-darwin-universal
|
name: bindings-darwin-universal
|
||||||
path: lib/bindings/langs/python/src/breez_liquid_sdk
|
path: lib/bindings/langs/python/src/breez_sdk_liquid
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-python
|
name: bindings-python
|
||||||
path: lib/bindings/langs/python/src/breez_liquid_sdk
|
path: lib/bindings/langs/python/src/breez_sdk_liquid
|
||||||
|
|
||||||
- name: Clean up downloaded files
|
- name: Clean up downloaded files
|
||||||
run: |
|
run: |
|
||||||
rm -f lib/bindings/langs/python/src/breez_liquid_sdk/*.a
|
rm -f lib/bindings/langs/python/src/breez_sdk_liquid/*.a
|
||||||
ls -R lib/bindings/langs/python
|
ls -R lib/bindings/langs/python
|
||||||
|
|
||||||
- name: Update package version
|
- name: Update package version
|
||||||
@@ -101,12 +101,12 @@ jobs:
|
|||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-${{ matrix.arch }}-unknown-linux-gnu
|
name: bindings-${{ matrix.arch }}-unknown-linux-gnu
|
||||||
path: lib/bindings/langs/python/src/breez_liquid_sdk
|
path: lib/bindings/langs/python/src/breez_sdk_liquid
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-python
|
name: bindings-python
|
||||||
path: lib/bindings/langs/python/src/breez_liquid_sdk
|
path: lib/bindings/langs/python/src/breez_sdk_liquid
|
||||||
|
|
||||||
- name: Update package version
|
- name: Update package version
|
||||||
if: ${{ inputs.package-version }}
|
if: ${{ inputs.package-version }}
|
||||||
@@ -148,22 +148,22 @@ jobs:
|
|||||||
if: matrix.arch == 'win_amd64'
|
if: matrix.arch == 'win_amd64'
|
||||||
with:
|
with:
|
||||||
name: bindings-x86_64-pc-windows-msvc
|
name: bindings-x86_64-pc-windows-msvc
|
||||||
path: lib/bindings/langs/python/src/breez_liquid_sdk
|
path: lib/bindings/langs/python/src/breez_sdk_liquid
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
if: matrix.arch == 'win32'
|
if: matrix.arch == 'win32'
|
||||||
with:
|
with:
|
||||||
name: bindings-i686-pc-windows-msvc
|
name: bindings-i686-pc-windows-msvc
|
||||||
path: lib/bindings/langs/python/src/breez_liquid_sdk
|
path: lib/bindings/langs/python/src/breez_sdk_liquid
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bindings-python
|
name: bindings-python
|
||||||
path: lib/bindings/langs/python/src/breez_liquid_sdk
|
path: lib/bindings/langs/python/src/breez_sdk_liquid
|
||||||
|
|
||||||
- name: Copy VC redistributable DLLs for Windows
|
- name: Copy VC redistributable DLLs for Windows
|
||||||
if: matrix.arch == 'win_amd64'
|
if: matrix.arch == 'win_amd64'
|
||||||
working-directory: lib/bindings/langs/python/src/breez_liquid_sdk
|
working-directory: lib/bindings/langs/python/src/breez_sdk_liquid
|
||||||
run: |
|
run: |
|
||||||
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\msvcp140.dll') .
|
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\msvcp140.dll') .
|
||||||
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140.dll') .
|
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140.dll') .
|
||||||
@@ -171,7 +171,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Copy VC redistributable DLLs for Windows
|
- name: Copy VC redistributable DLLs for Windows
|
||||||
if: matrix.arch == 'win32'
|
if: matrix.arch == 'win32'
|
||||||
working-directory: lib/bindings/langs/python/src/breez_liquid_sdk
|
working-directory: lib/bindings/langs/python/src/breez_sdk_liquid
|
||||||
run: |
|
run: |
|
||||||
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x86\*\msvcp140.dll') .
|
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x86\*\msvcp140.dll') .
|
||||||
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x86\*\vcruntime140.dll') .
|
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x86\*\vcruntime140.dll') .
|
||||||
|
|||||||
6
.github/workflows/publish-react-native.yml
vendored
6
.github/workflows/publish-react-native.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
build-package:
|
build-package:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout breez-liquid-sdk repo
|
- name: Checkout breez-sdk-liquid repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.repository || github.repository }}
|
repository: ${{ inputs.repository || github.repository }}
|
||||||
@@ -51,13 +51,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Pack for archival
|
- name: Pack for archival
|
||||||
working-directory: packages/react-native
|
working-directory: packages/react-native
|
||||||
run: yarn pack --filename breez-liquid-sdk-react-native.tgz
|
run: yarn pack --filename breez-sdk-liquid-react-native.tgz
|
||||||
|
|
||||||
- name: Archive the package
|
- name: Archive the package
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: react-native-${{ inputs.package-version || '0.0.2' }}
|
name: react-native-${{ inputs.package-version || '0.0.2' }}
|
||||||
path: packages/react-native/breez-liquid-sdk-react-native.tgz
|
path: packages/react-native/breez-sdk-liquid-react-native.tgz
|
||||||
|
|
||||||
- name: Publish package to npm
|
- name: Publish package to npm
|
||||||
if: ${{ inputs.publish }}
|
if: ${{ inputs.publish }}
|
||||||
|
|||||||
48
.github/workflows/publish-swift.yml
vendored
48
.github/workflows/publish-swift.yml
vendored
@@ -21,10 +21,10 @@ on:
|
|||||||
default: false
|
default: false
|
||||||
secrets:
|
secrets:
|
||||||
REPO_SSH_KEY:
|
REPO_SSH_KEY:
|
||||||
description: 'ssh key to commit to the breez-liquid-sdk-swift repository'
|
description: 'ssh key to commit to the breez-sdk-liquid-swift repository'
|
||||||
required: true
|
required: true
|
||||||
SWIFT_RELEASE_TOKEN:
|
SWIFT_RELEASE_TOKEN:
|
||||||
description: 'github token to release to the breez-liquid-sdk-swift repository'
|
description: 'github token to release to the breez-sdk-liquid-swift repository'
|
||||||
required: true
|
required: true
|
||||||
COCOAPODS_TRUNK_TOKEN:
|
COCOAPODS_TRUNK_TOKEN:
|
||||||
description: 'cocoapods trunk token'
|
description: 'cocoapods trunk token'
|
||||||
@@ -34,16 +34,16 @@ jobs:
|
|||||||
build-swift-package:
|
build-swift-package:
|
||||||
runs-on: macOS-13
|
runs-on: macOS-13
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout breez-liquid-sdk repo
|
- name: Checkout breez-sdk-liquid repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.repository || github.repository }}
|
repository: ${{ inputs.repository || github.repository }}
|
||||||
path: build
|
path: build
|
||||||
|
|
||||||
- name: Checkout breez-liquid-sdk-swift repo
|
- name: Checkout breez-sdk-liquid-swift repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: breez/breez-liquid-sdk-swift
|
repository: breez/breez-sdk-liquid-swift
|
||||||
ref: main
|
ref: main
|
||||||
ssh-key: ${{ secrets.REPO_SSH_KEY }}
|
ssh-key: ${{ secrets.REPO_SSH_KEY }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@@ -75,32 +75,32 @@ jobs:
|
|||||||
|
|
||||||
- name: Copy swift bindings
|
- name: Copy swift bindings
|
||||||
run: |
|
run: |
|
||||||
mkdir -p build/lib/bindings/langs/swift/Sources/BreezLiquidSDK
|
mkdir -p build/lib/bindings/langs/swift/Sources/BreezSDKLiquid
|
||||||
cp swift/BreezLiquidSDK.swift build/lib/bindings/langs/swift/Sources/BreezLiquidSDK/BreezLiquidSDK.swift
|
cp swift/BreezSDKLiquid.swift build/lib/bindings/langs/swift/Sources/BreezSDKLiquid/BreezSDKLiquid.swift
|
||||||
cp swift/breez_liquid_sdkFFI.h build/lib/bindings/langs/swift/breez_liquid_sdkFFI.xcframework/ios-arm64/breez_liquid_sdkFFI.framework/Headers
|
cp swift/breez_sdk_liquidFFI.h build/lib/bindings/langs/swift/breez_sdk_liquidFFI.xcframework/ios-arm64/breez_sdk_liquidFFI.framework/Headers
|
||||||
cp swift/breez_liquid_sdkFFI.h build/lib/bindings/langs/swift/breez_liquid_sdkFFI.xcframework/ios-arm64_x86_64-simulator/breez_liquid_sdkFFI.framework/Headers
|
cp swift/breez_sdk_liquidFFI.h build/lib/bindings/langs/swift/breez_sdk_liquidFFI.xcframework/ios-arm64_x86_64-simulator/breez_sdk_liquidFFI.framework/Headers
|
||||||
cp swift/breez_liquid_sdkFFI.h build/lib/bindings/langs/swift/breez_liquid_sdkFFI.xcframework/macos-arm64_x86_64/breez_liquid_sdkFFI.framework/Headers
|
cp swift/breez_sdk_liquidFFI.h build/lib/bindings/langs/swift/breez_sdk_liquidFFI.xcframework/macos-arm64_x86_64/breez_sdk_liquidFFI.framework/Headers
|
||||||
cp aarch64-apple-ios/libbreez_liquid_sdk_bindings.a build/lib/bindings/langs/swift/breez_liquid_sdkFFI.xcframework/ios-arm64/breez_liquid_sdkFFI.framework/breez_liquid_sdkFFI
|
cp aarch64-apple-ios/libbreez_sdk_liquid_bindings.a build/lib/bindings/langs/swift/breez_sdk_liquidFFI.xcframework/ios-arm64/breez_sdk_liquidFFI.framework/breez_sdk_liquidFFI
|
||||||
cp ios-universal-sim/libbreez_liquid_sdk_bindings.a build/lib/bindings/langs/swift/breez_liquid_sdkFFI.xcframework/ios-arm64_x86_64-simulator/breez_liquid_sdkFFI.framework/breez_liquid_sdkFFI
|
cp ios-universal-sim/libbreez_sdk_liquid_bindings.a build/lib/bindings/langs/swift/breez_sdk_liquidFFI.xcframework/ios-arm64_x86_64-simulator/breez_sdk_liquidFFI.framework/breez_sdk_liquidFFI
|
||||||
cp darwin-universal/libbreez_liquid_sdk_bindings.a build/lib/bindings/langs/swift/breez_liquid_sdkFFI.xcframework/macos-arm64_x86_64/breez_liquid_sdkFFI.framework/breez_liquid_sdkFFI
|
cp darwin-universal/libbreez_sdk_liquid_bindings.a build/lib/bindings/langs/swift/breez_sdk_liquidFFI.xcframework/macos-arm64_x86_64/breez_sdk_liquidFFI.framework/breez_sdk_liquidFFI
|
||||||
|
|
||||||
- name: Compress XCFramework
|
- name: Compress XCFramework
|
||||||
working-directory: build/lib/bindings/langs/swift
|
working-directory: build/lib/bindings/langs/swift
|
||||||
run: |
|
run: |
|
||||||
zip -9 -r breez_liquid_sdkFFI.xcframework.zip breez_liquid_sdkFFI.xcframework
|
zip -9 -r breez_sdk_liquidFFI.xcframework.zip breez_sdk_liquidFFI.xcframework
|
||||||
echo "XCF_CHECKSUM=`swift package compute-checksum breez_liquid_sdkFFI.xcframework.zip`" >> $GITHUB_ENV
|
echo "XCF_CHECKSUM=`swift package compute-checksum breez_sdk_liquidFFI.xcframework.zip`" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Update Swift Package definition
|
- name: Update Swift Package definition
|
||||||
working-directory: build/lib/bindings/langs/swift
|
working-directory: build/lib/bindings/langs/swift
|
||||||
run: |
|
run: |
|
||||||
sed 's#.binaryTarget(name: "breez_liquid_sdkFFI", path: "./breez_liquid_sdkFFI.xcframework"),#.binaryTarget(name: "breez_liquid_sdkFFI", url: "https://github.com/breez/breez-liquid-sdk-swift/releases/download/${{ inputs.package-version || '0.0.1' }}/breez_liquid_sdkFFI.xcframework.zip", checksum: "${{ env.XCF_CHECKSUM }}"),#;/.testTarget(name: "BreezLiquidSDKTests", dependencies: \["BreezLiquidSDK"\]),/d' Package.swift > ../../../../../dist/Package.swift
|
sed 's#.binaryTarget(name: "breez_sdk_liquidFFI", path: "./breez_sdk_liquidFFI.xcframework"),#.binaryTarget(name: "breez_sdk_liquidFFI", url: "https://github.com/breez/breez-sdk-liquid-swift/releases/download/${{ inputs.package-version || '0.0.1' }}/breez_sdk_liquidFFI.xcframework.zip", checksum: "${{ env.XCF_CHECKSUM }}"),#;/.testTarget(name: "BreezSDKLiquidTests", dependencies: \["BreezSDKLiquid"\]),/d' Package.swift > ../../../../../dist/Package.swift
|
||||||
cp -r Sources ../../../../../dist
|
cp -r Sources ../../../../../dist
|
||||||
|
|
||||||
- name: Update Cocoapods definitions
|
- name: Update Cocoapods definitions
|
||||||
working-directory: dist
|
working-directory: dist
|
||||||
run: |
|
run: |
|
||||||
sed -i '' 's#^.\{2\}spec.version.*$# spec.version = "${{ inputs.package-version || '0.0.1' }}"#' breez_liquid_sdkFFI.podspec
|
sed -i '' 's#^.\{2\}spec.version.*$# spec.version = "${{ inputs.package-version || '0.0.1' }}"#' breez_sdk_liquidFFI.podspec
|
||||||
sed -i '' 's#^.\{2\}spec.version.*$# spec.version = "${{ inputs.package-version || '0.0.1' }}"#' BreezLiquidSDK.podspec
|
sed -i '' 's#^.\{2\}spec.version.*$# spec.version = "${{ inputs.package-version || '0.0.1' }}"#' BreezSDKLiquid.podspec
|
||||||
|
|
||||||
- name: Tag the Swift bindings
|
- name: Tag the Swift bindings
|
||||||
if: ${{ inputs.publish }}
|
if: ${{ inputs.publish }}
|
||||||
@@ -110,8 +110,8 @@ jobs:
|
|||||||
git config --global user.email "no-reply@breez.technology"
|
git config --global user.email "no-reply@breez.technology"
|
||||||
git add Package.swift
|
git add Package.swift
|
||||||
git add Sources
|
git add Sources
|
||||||
git add breez_liquid_sdkFFI.podspec
|
git add breez_sdk_liquidFFI.podspec
|
||||||
git add BreezLiquidSDK.podspec
|
git add BreezSDKLiquid.podspec
|
||||||
git commit -m "Update Swift bindings to version ${{ inputs.package-version || '0.0.1' }}"
|
git commit -m "Update Swift bindings to version ${{ inputs.package-version || '0.0.1' }}"
|
||||||
git push
|
git push
|
||||||
git tag ${{ inputs.package-version || '0.0.1' }} -m "${{ inputs.package-version || '0.0.1' }}"
|
git tag ${{ inputs.package-version || '0.0.1' }} -m "${{ inputs.package-version || '0.0.1' }}"
|
||||||
@@ -121,9 +121,9 @@ jobs:
|
|||||||
if: ${{ inputs.publish }}
|
if: ${{ inputs.publish }}
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
repository: breez/breez-liquid-sdk-swift
|
repository: breez/breez-sdk-liquid-swift
|
||||||
files: |
|
files: |
|
||||||
build/lib/bindings/langs/swift/breez_liquid_sdkFFI.xcframework.zip
|
build/lib/bindings/langs/swift/breez_sdk_liquidFFI.xcframework.zip
|
||||||
tag_name: ${{ inputs.package-version || '0.0.1' }}
|
tag_name: ${{ inputs.package-version || '0.0.1' }}
|
||||||
generate_release_notes: false
|
generate_release_notes: false
|
||||||
token: ${{ secrets.SWIFT_RELEASE_TOKEN }}
|
token: ${{ secrets.SWIFT_RELEASE_TOKEN }}
|
||||||
@@ -135,5 +135,5 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
COCOAPODS_TRUNK_TOKEN: ${{secrets.COCOAPODS_TRUNK_TOKEN}}
|
COCOAPODS_TRUNK_TOKEN: ${{secrets.COCOAPODS_TRUNK_TOKEN}}
|
||||||
run: |
|
run: |
|
||||||
pod trunk push breez_liquid_sdkFFI.podspec --allow-warnings
|
pod trunk push breez_sdk_liquidFFI.podspec --allow-warnings
|
||||||
pod trunk push BreezLiquidSDK.podspec --allow-warnings --synchronous
|
pod trunk push BreezSDKLiquid.podspec --allow-warnings --synchronous
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -3,8 +3,8 @@
|
|||||||
# fenv
|
# fenv
|
||||||
**/.flutter-version
|
**/.flutter-version
|
||||||
# symlink headers
|
# symlink headers
|
||||||
packages/flutter/ios/Classes/breez_liquid_sdk.h
|
packages/flutter/ios/Classes/breez_sdk_liquid.h
|
||||||
packages/flutter/macos/Classes/breez_liquid_sdk.h
|
packages/flutter/macos/Classes/breez_sdk_liquid.h
|
||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.idea/
|
.idea/
|
||||||
|
|||||||
4
cli/Cargo.lock
generated
4
cli/Cargo.lock
generated
@@ -507,7 +507,7 @@ version = "0.0.1"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bip39",
|
"bip39",
|
||||||
"breez-liquid-sdk",
|
"breez-sdk-liquid",
|
||||||
"clap",
|
"clap",
|
||||||
"log",
|
"log",
|
||||||
"qrcode-rs",
|
"qrcode-rs",
|
||||||
@@ -518,7 +518,7 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "breez-liquid-sdk"
|
name = "breez-sdk-liquid"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ version = "0.0.1"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.80"
|
anyhow = "1.0.80"
|
||||||
bip39 = "2.0.0"
|
bip39 = "2.0.0"
|
||||||
breez-liquid-sdk = { path = "../lib/core" }
|
breez-sdk-liquid = { path = "../lib/core" }
|
||||||
clap = { version = "4.5.1", features = ["derive"] }
|
clap = { version = "4.5.1", features = ["derive"] }
|
||||||
log = "0.4.20"
|
log = "0.4.20"
|
||||||
qrcode-rs = { version = "0.1", default-features = false }
|
qrcode-rs = { version = "0.1", default-features = false }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# breez-liquid-sdk-cli
|
# Breez Liquid SDK - CLI
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use std::thread;
|
|||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use breez_liquid_sdk::prelude::*;
|
use breez_sdk_liquid::prelude::*;
|
||||||
use clap::{arg, Parser};
|
use clap::{arg, Parser};
|
||||||
use qrcode_rs::render::unicode;
|
use qrcode_rs::render::unicode;
|
||||||
use qrcode_rs::{EcLevel, QrCode};
|
use qrcode_rs::{EcLevel, QrCode};
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ mod persist;
|
|||||||
use std::{fs, path::PathBuf};
|
use std::{fs, path::PathBuf};
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use breez_liquid_sdk::prelude::*;
|
use breez_sdk_liquid::prelude::*;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use commands::{handle_command, CliHelper, Command, CommandResult};
|
use commands::{handle_command, CliHelper, Command, CommandResult};
|
||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
@@ -42,7 +42,7 @@ fn show_results(result: Result<String>) -> Result<()> {
|
|||||||
struct CliEventListener {}
|
struct CliEventListener {}
|
||||||
|
|
||||||
impl EventListener for CliEventListener {
|
impl EventListener for CliEventListener {
|
||||||
fn on_event(&self, e: LiquidSdkEvent) {
|
fn on_event(&self, e: SdkEvent) {
|
||||||
info!("Received event: {:?}", e);
|
info!("Received event: {:?}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
6
lib/Cargo.lock
generated
6
lib/Cargo.lock
generated
@@ -622,7 +622,7 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "breez-liquid-sdk"
|
name = "breez-sdk-liquid"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@@ -661,11 +661,11 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "breez-liquid-sdk-bindings"
|
name = "breez-sdk-liquid-bindings"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"breez-liquid-sdk",
|
"breez-sdk-liquid",
|
||||||
"camino",
|
"camino",
|
||||||
"glob",
|
"glob",
|
||||||
"log",
|
"log",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "breez-liquid-sdk-bindings"
|
name = "breez-sdk-liquid-bindings"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
|
||||||
@@ -8,12 +8,12 @@ name = "uniffi-bindgen"
|
|||||||
path = "uniffi-bindgen.rs"
|
path = "uniffi-bindgen.rs"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "breez_liquid_sdk_bindings"
|
name = "breez_sdk_liquid_bindings"
|
||||||
crate-type = ["staticlib", "cdylib", "lib"]
|
crate-type = ["staticlib", "cdylib", "lib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
breez-liquid-sdk = { path = "../core" }
|
breez-sdk-liquid = { path = "../core" }
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
uniffi = { workspace = true, features = [ "bindgen-tests", "cli" ] }
|
uniffi = { workspace = true, features = [ "bindgen-tests", "cli" ] }
|
||||||
# Bindgen used by KMP, version has to match the one supported by KMP
|
# Bindgen used by KMP, version has to match the one supported by KMP
|
||||||
|
|||||||
@@ -32,5 +32,5 @@ fn setup_x86_64_android_workaround() {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
setup_x86_64_android_workaround();
|
setup_x86_64_android_workaround();
|
||||||
uniffi::generate_scaffolding("src/breez_liquid_sdk.udl").unwrap();
|
uniffi::generate_scaffolding("src/breez_sdk_liquid.udl").unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
2
lib/bindings/langs/android/.gitignore
vendored
2
lib/bindings/langs/android/.gitignore
vendored
@@ -45,4 +45,4 @@ gen-external-apklibs
|
|||||||
# End of https://www.toptal.com/developers/gitignore/api/android
|
# End of https://www.toptal.com/developers/gitignore/api/android
|
||||||
|
|
||||||
lib/src/main/jniLibs/
|
lib/src/main/jniLibs/
|
||||||
lib/src/main/kotlin/breez_liquid_sdk.kt
|
lib/src/main/kotlin/breez_sdk_liquid.kt
|
||||||
|
|||||||
@@ -9,15 +9,15 @@ fi
|
|||||||
echo "JitPack building version $VERSION."
|
echo "JitPack building version $VERSION."
|
||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
|
|
||||||
curl https://mvn.breez.technology/releases/breez_liquid_sdk/bindings-android/$VERSION/bindings-android-$VERSION.aar --output bindings-android-$VERSION.aar
|
curl https://mvn.breez.technology/releases/breez_sdk_liquid/bindings-android/$VERSION/bindings-android-$VERSION.aar --output bindings-android-$VERSION.aar
|
||||||
curl https://mvn.breez.technology/releases/breez_liquid_sdk/bindings-android/$VERSION/bindings-android-$VERSION.module --output bindings-android-$VERSION.module
|
curl https://mvn.breez.technology/releases/breez_sdk_liquid/bindings-android/$VERSION/bindings-android-$VERSION.module --output bindings-android-$VERSION.module
|
||||||
curl https://mvn.breez.technology/releases/breez_liquid_sdk/bindings-android/$VERSION/bindings-android-$VERSION-sources.jar --output bindings-android-$VERSION-sources.jar
|
curl https://mvn.breez.technology/releases/breez_sdk_liquid/bindings-android/$VERSION/bindings-android-$VERSION-sources.jar --output bindings-android-$VERSION-sources.jar
|
||||||
curl https://mvn.breez.technology/releases/breez_liquid_sdk/bindings-android/$VERSION/bindings-android-$VERSION.pom --output bindings-android-$VERSION.pom
|
curl https://mvn.breez.technology/releases/breez_sdk_liquid/bindings-android/$VERSION/bindings-android-$VERSION.pom --output bindings-android-$VERSION.pom
|
||||||
|
|
||||||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=bindings-android-$VERSION.aar -DpomFile=bindings-android-$VERSION.pom
|
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=bindings-android-$VERSION.aar -DpomFile=bindings-android-$VERSION.pom
|
||||||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=bindings-android-$VERSION.module -DpomFile=bindings-android-$VERSION.pom
|
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=bindings-android-$VERSION.module -DpomFile=bindings-android-$VERSION.pom
|
||||||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=bindings-android-$VERSION-sources.jar -DpomFile=bindings-android-$VERSION.pom -Dclassifier=sources
|
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=bindings-android-$VERSION-sources.jar -DpomFile=bindings-android-$VERSION.pom -Dclassifier=sources
|
||||||
|
|
||||||
ls /home/jitpack/.m2/repository/breez_liquid_sdk/bindings-android
|
ls /home/jitpack/.m2/repository/breez_sdk_liquid/bindings-android
|
||||||
echo "---"
|
echo "---"
|
||||||
ls /home/jitpack/.m2/repository/breez_liquid_sdk/bindings-android/$VERSION/
|
ls /home/jitpack/.m2/repository/breez_sdk_liquid/bindings-android/$VERSION/
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ publishing {
|
|||||||
}
|
}
|
||||||
maven {
|
maven {
|
||||||
name = "breezGitHubPackages"
|
name = "breezGitHubPackages"
|
||||||
url = uri("https://maven.pkg.github.com/breez/breez-liquid-sdk")
|
url = uri("https://maven.pkg.github.com/breez/breez-sdk-liquid")
|
||||||
credentials {
|
credentials {
|
||||||
username = System.getenv("GITHUB_ACTOR")
|
username = System.getenv("GITHUB_ACTOR")
|
||||||
password = System.getenv("GITHUB_TOKEN")
|
password = System.getenv("GITHUB_TOKEN")
|
||||||
@@ -68,7 +68,7 @@ publishing {
|
|||||||
}
|
}
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("maven") {
|
create<MavenPublication>("maven") {
|
||||||
groupId = "breez_liquid_sdk"
|
groupId = "breez_sdk_liquid"
|
||||||
artifactId = "bindings-android"
|
artifactId = "bindings-android"
|
||||||
version = libraryVersion
|
version = libraryVersion
|
||||||
|
|
||||||
@@ -77,19 +77,19 @@ publishing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pom {
|
pom {
|
||||||
name.set("breez-liquid-sdk")
|
name.set("breez-sdk-liquid")
|
||||||
description.set("The Breez Liquid SDK enables mobile developers to integrate Liquid swaps into their apps with a very shallow learning curve.")
|
description.set("The Breez Liquid SDK enables mobile developers to integrate Liquid swaps into their apps with a very shallow learning curve.")
|
||||||
url.set("https://breez.technology")
|
url.set("https://breez.technology")
|
||||||
licenses {
|
licenses {
|
||||||
license {
|
license {
|
||||||
name.set("MIT")
|
name.set("MIT")
|
||||||
url.set("https://github.com/breez/breez-liquid-sdk/blob/main/LICENSE")
|
url.set("https://github.com/breez/breez-sdk-liquid/blob/main/LICENSE")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scm {
|
scm {
|
||||||
connection.set("scm:git:github.com/breez/breez-liquid-sdk.git")
|
connection.set("scm:git:github.com/breez/breez-sdk-liquid.git")
|
||||||
developerConnection.set("scm:git:ssh://github.com/breez/breez-liquid-sdk.git")
|
developerConnection.set("scm:git:ssh://github.com/breez/breez-sdk-liquid.git")
|
||||||
url.set("https://github.com/breez/breez-liquid-sdk")
|
url.set("https://github.com/breez/breez-sdk-liquid")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
-dontwarn java.awt.*
|
-dontwarn java.awt.*
|
||||||
-keep class com.sun.jna.** { *; }
|
-keep class com.sun.jna.** { *; }
|
||||||
-keep class technology.breez.* { *; }
|
-keep class technology.breez.* { *; }
|
||||||
-keep class breez_liquid_sdk.** { *; }
|
-keep class breez_sdk_liquid.** { *; }
|
||||||
-keepclassmembers class * extends technology.breez.* { public *; }
|
-keepclassmembers class * extends technology.breez.* { public *; }
|
||||||
-keepclassmembers class * extends breez_liquid_sdk.** { public *; }
|
-keepclassmembers class * extends breez_sdk_liquid.** { public *; }
|
||||||
-keepclassmembers class * extends com.sun.jna.** { public *; }
|
-keepclassmembers class * extends com.sun.jna.** { public *; }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# breez_liquid_sdk_workspace
|
# breez_sdk_liquid_workspace
|
||||||
|
|
||||||
Binding generation & build scripts for Dart/Flutter packages of Breez Liquid SDK.
|
Binding generation & build scripts for Dart/Flutter packages of Breez Liquid SDK.
|
||||||
|
|
||||||
|
|||||||
@@ -159,43 +159,43 @@ typedef struct wire_cst_payment {
|
|||||||
int32_t status;
|
int32_t status;
|
||||||
} wire_cst_payment;
|
} wire_cst_payment;
|
||||||
|
|
||||||
typedef struct wire_cst_LiquidSdkEvent_PaymentFailed {
|
typedef struct wire_cst_SdkEvent_PaymentFailed {
|
||||||
struct wire_cst_payment *details;
|
struct wire_cst_payment *details;
|
||||||
} wire_cst_LiquidSdkEvent_PaymentFailed;
|
} wire_cst_SdkEvent_PaymentFailed;
|
||||||
|
|
||||||
typedef struct wire_cst_LiquidSdkEvent_PaymentPending {
|
typedef struct wire_cst_SdkEvent_PaymentPending {
|
||||||
struct wire_cst_payment *details;
|
struct wire_cst_payment *details;
|
||||||
} wire_cst_LiquidSdkEvent_PaymentPending;
|
} wire_cst_SdkEvent_PaymentPending;
|
||||||
|
|
||||||
typedef struct wire_cst_LiquidSdkEvent_PaymentRefunded {
|
typedef struct wire_cst_SdkEvent_PaymentRefunded {
|
||||||
struct wire_cst_payment *details;
|
struct wire_cst_payment *details;
|
||||||
} wire_cst_LiquidSdkEvent_PaymentRefunded;
|
} wire_cst_SdkEvent_PaymentRefunded;
|
||||||
|
|
||||||
typedef struct wire_cst_LiquidSdkEvent_PaymentRefundPending {
|
typedef struct wire_cst_SdkEvent_PaymentRefundPending {
|
||||||
struct wire_cst_payment *details;
|
struct wire_cst_payment *details;
|
||||||
} wire_cst_LiquidSdkEvent_PaymentRefundPending;
|
} wire_cst_SdkEvent_PaymentRefundPending;
|
||||||
|
|
||||||
typedef struct wire_cst_LiquidSdkEvent_PaymentSucceeded {
|
typedef struct wire_cst_SdkEvent_PaymentSucceeded {
|
||||||
struct wire_cst_payment *details;
|
struct wire_cst_payment *details;
|
||||||
} wire_cst_LiquidSdkEvent_PaymentSucceeded;
|
} wire_cst_SdkEvent_PaymentSucceeded;
|
||||||
|
|
||||||
typedef struct wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation {
|
typedef struct wire_cst_SdkEvent_PaymentWaitingConfirmation {
|
||||||
struct wire_cst_payment *details;
|
struct wire_cst_payment *details;
|
||||||
} wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation;
|
} wire_cst_SdkEvent_PaymentWaitingConfirmation;
|
||||||
|
|
||||||
typedef union LiquidSdkEventKind {
|
typedef union SdkEventKind {
|
||||||
struct wire_cst_LiquidSdkEvent_PaymentFailed PaymentFailed;
|
struct wire_cst_SdkEvent_PaymentFailed PaymentFailed;
|
||||||
struct wire_cst_LiquidSdkEvent_PaymentPending PaymentPending;
|
struct wire_cst_SdkEvent_PaymentPending PaymentPending;
|
||||||
struct wire_cst_LiquidSdkEvent_PaymentRefunded PaymentRefunded;
|
struct wire_cst_SdkEvent_PaymentRefunded PaymentRefunded;
|
||||||
struct wire_cst_LiquidSdkEvent_PaymentRefundPending PaymentRefundPending;
|
struct wire_cst_SdkEvent_PaymentRefundPending PaymentRefundPending;
|
||||||
struct wire_cst_LiquidSdkEvent_PaymentSucceeded PaymentSucceeded;
|
struct wire_cst_SdkEvent_PaymentSucceeded PaymentSucceeded;
|
||||||
struct wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation PaymentWaitingConfirmation;
|
struct wire_cst_SdkEvent_PaymentWaitingConfirmation PaymentWaitingConfirmation;
|
||||||
} LiquidSdkEventKind;
|
} SdkEventKind;
|
||||||
|
|
||||||
typedef struct wire_cst_liquid_sdk_event {
|
typedef struct wire_cst_sdk_event {
|
||||||
int32_t tag;
|
int32_t tag;
|
||||||
union LiquidSdkEventKind kind;
|
union SdkEventKind kind;
|
||||||
} wire_cst_liquid_sdk_event;
|
} wire_cst_sdk_event;
|
||||||
|
|
||||||
typedef struct wire_cst_config {
|
typedef struct wire_cst_config {
|
||||||
struct wire_cst_list_prim_u_8_strict *liquid_electrum_url;
|
struct wire_cst_list_prim_u_8_strict *liquid_electrum_url;
|
||||||
@@ -472,24 +472,6 @@ typedef struct wire_cst_lightning_payment_limits_response {
|
|||||||
struct wire_cst_limits receive;
|
struct wire_cst_limits receive;
|
||||||
} wire_cst_lightning_payment_limits_response;
|
} wire_cst_lightning_payment_limits_response;
|
||||||
|
|
||||||
typedef struct wire_cst_LiquidSdkError_Generic {
|
|
||||||
struct wire_cst_list_prim_u_8_strict *err;
|
|
||||||
} wire_cst_LiquidSdkError_Generic;
|
|
||||||
|
|
||||||
typedef struct wire_cst_LiquidSdkError_ServiceConnectivity {
|
|
||||||
struct wire_cst_list_prim_u_8_strict *err;
|
|
||||||
} wire_cst_LiquidSdkError_ServiceConnectivity;
|
|
||||||
|
|
||||||
typedef union LiquidSdkErrorKind {
|
|
||||||
struct wire_cst_LiquidSdkError_Generic Generic;
|
|
||||||
struct wire_cst_LiquidSdkError_ServiceConnectivity ServiceConnectivity;
|
|
||||||
} LiquidSdkErrorKind;
|
|
||||||
|
|
||||||
typedef struct wire_cst_liquid_sdk_error {
|
|
||||||
int32_t tag;
|
|
||||||
union LiquidSdkErrorKind kind;
|
|
||||||
} wire_cst_liquid_sdk_error;
|
|
||||||
|
|
||||||
typedef struct wire_cst_LnUrlAuthError_Generic {
|
typedef struct wire_cst_LnUrlAuthError_Generic {
|
||||||
struct wire_cst_list_prim_u_8_strict *err;
|
struct wire_cst_list_prim_u_8_strict *err;
|
||||||
} wire_cst_LnUrlAuthError_Generic;
|
} wire_cst_LnUrlAuthError_Generic;
|
||||||
@@ -747,6 +729,24 @@ typedef struct wire_cst_refund_response {
|
|||||||
struct wire_cst_list_prim_u_8_strict *refund_tx_id;
|
struct wire_cst_list_prim_u_8_strict *refund_tx_id;
|
||||||
} wire_cst_refund_response;
|
} wire_cst_refund_response;
|
||||||
|
|
||||||
|
typedef struct wire_cst_SdkError_Generic {
|
||||||
|
struct wire_cst_list_prim_u_8_strict *err;
|
||||||
|
} wire_cst_SdkError_Generic;
|
||||||
|
|
||||||
|
typedef struct wire_cst_SdkError_ServiceConnectivity {
|
||||||
|
struct wire_cst_list_prim_u_8_strict *err;
|
||||||
|
} wire_cst_SdkError_ServiceConnectivity;
|
||||||
|
|
||||||
|
typedef union SdkErrorKind {
|
||||||
|
struct wire_cst_SdkError_Generic Generic;
|
||||||
|
struct wire_cst_SdkError_ServiceConnectivity ServiceConnectivity;
|
||||||
|
} SdkErrorKind;
|
||||||
|
|
||||||
|
typedef struct wire_cst_sdk_error {
|
||||||
|
int32_t tag;
|
||||||
|
union SdkErrorKind kind;
|
||||||
|
} wire_cst_sdk_error;
|
||||||
|
|
||||||
typedef struct wire_cst_send_payment_response {
|
typedef struct wire_cst_send_payment_response {
|
||||||
struct wire_cst_payment payment;
|
struct wire_cst_payment payment;
|
||||||
} wire_cst_send_payment_response;
|
} wire_cst_send_payment_response;
|
||||||
@@ -847,7 +847,7 @@ void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_sync(int64_t po
|
|||||||
|
|
||||||
void frbgen_breez_liquid_wire__crate__bindings__binding_event_listener_on_event(int64_t port_,
|
void frbgen_breez_liquid_wire__crate__bindings__binding_event_listener_on_event(int64_t port_,
|
||||||
struct wire_cst_binding_event_listener *that,
|
struct wire_cst_binding_event_listener *that,
|
||||||
struct wire_cst_liquid_sdk_event *e);
|
struct wire_cst_sdk_event *e);
|
||||||
|
|
||||||
void frbgen_breez_liquid_wire__crate__bindings__breez_log_stream(int64_t port_,
|
void frbgen_breez_liquid_wire__crate__bindings__breez_log_stream(int64_t port_,
|
||||||
struct wire_cst_list_prim_u_8_strict *s);
|
struct wire_cst_list_prim_u_8_strict *s);
|
||||||
@@ -880,8 +880,6 @@ bool *frbgen_breez_liquid_cst_new_box_autoadd_bool(bool value);
|
|||||||
|
|
||||||
struct wire_cst_connect_request *frbgen_breez_liquid_cst_new_box_autoadd_connect_request(void);
|
struct wire_cst_connect_request *frbgen_breez_liquid_cst_new_box_autoadd_connect_request(void);
|
||||||
|
|
||||||
struct wire_cst_liquid_sdk_event *frbgen_breez_liquid_cst_new_box_autoadd_liquid_sdk_event(void);
|
|
||||||
|
|
||||||
struct wire_cst_ln_invoice *frbgen_breez_liquid_cst_new_box_autoadd_ln_invoice(void);
|
struct wire_cst_ln_invoice *frbgen_breez_liquid_cst_new_box_autoadd_ln_invoice(void);
|
||||||
|
|
||||||
struct wire_cst_ln_url_auth_request_data *frbgen_breez_liquid_cst_new_box_autoadd_ln_url_auth_request_data(void);
|
struct wire_cst_ln_url_auth_request_data *frbgen_breez_liquid_cst_new_box_autoadd_ln_url_auth_request_data(void);
|
||||||
@@ -928,6 +926,8 @@ struct wire_cst_refund_request *frbgen_breez_liquid_cst_new_box_autoadd_refund_r
|
|||||||
|
|
||||||
struct wire_cst_restore_request *frbgen_breez_liquid_cst_new_box_autoadd_restore_request(void);
|
struct wire_cst_restore_request *frbgen_breez_liquid_cst_new_box_autoadd_restore_request(void);
|
||||||
|
|
||||||
|
struct wire_cst_sdk_event *frbgen_breez_liquid_cst_new_box_autoadd_sdk_event(void);
|
||||||
|
|
||||||
struct wire_cst_success_action_processed *frbgen_breez_liquid_cst_new_box_autoadd_success_action_processed(void);
|
struct wire_cst_success_action_processed *frbgen_breez_liquid_cst_new_box_autoadd_success_action_processed(void);
|
||||||
|
|
||||||
struct wire_cst_symbol *frbgen_breez_liquid_cst_new_box_autoadd_symbol(void);
|
struct wire_cst_symbol *frbgen_breez_liquid_cst_new_box_autoadd_symbol(void);
|
||||||
@@ -964,7 +964,6 @@ static int64_t dummy_method_to_enforce_bundling(void) {
|
|||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_bitcoin_address_data);
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_bitcoin_address_data);
|
||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_bool);
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_bool);
|
||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_connect_request);
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_connect_request);
|
||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_liquid_sdk_event);
|
|
||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_invoice);
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_invoice);
|
||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_url_auth_request_data);
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_url_auth_request_data);
|
||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_url_error_data);
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_url_error_data);
|
||||||
@@ -988,6 +987,7 @@ static int64_t dummy_method_to_enforce_bundling(void) {
|
|||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_prepare_send_response);
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_prepare_send_response);
|
||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_refund_request);
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_refund_request);
|
||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_restore_request);
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_restore_request);
|
||||||
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_sdk_event);
|
||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_success_action_processed);
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_success_action_processed);
|
||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_symbol);
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_symbol);
|
||||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_u_32);
|
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_u_32);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
dartdoc:
|
dartdoc:
|
||||||
linkToSource:
|
linkToSource:
|
||||||
root: .
|
root: .
|
||||||
uriTemplate: 'https://github.com/breez/breez-liquid-sdk/blob/main/%f%#L%l%'
|
uriTemplate: 'https://github.com/breez/breez-sdk-liquid/blob/main/%f%#L%l%'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ rust_root: ../../../core/
|
|||||||
dart_output: ../../../../packages/dart/lib/src
|
dart_output: ../../../../packages/dart/lib/src
|
||||||
# flutter_rust_bridge has relative path issues with this new approach introduced in 2.0.0-dev.38
|
# flutter_rust_bridge has relative path issues with this new approach introduced in 2.0.0-dev.38
|
||||||
# rust_output: ../../../core/frb/bridge.rs
|
# rust_output: ../../../core/frb/bridge.rs
|
||||||
c_output: breez_liquid_sdk/include/breez_liquid_sdk.h
|
c_output: breez_sdk_liquid/include/breez_sdk_liquid.h
|
||||||
web: false
|
web: false
|
||||||
full_dep: true
|
full_dep: true
|
||||||
add_mod_to_lib: false
|
add_mod_to_lib: false
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ codegen:
|
|||||||
mkdir -p ../../../../packages/flutter/lib/src
|
mkdir -p ../../../../packages/flutter/lib/src
|
||||||
{{frb_bin}}
|
{{frb_bin}}
|
||||||
cd ../../../../packages/dart/lib/src && dart format -l 110 .
|
cd ../../../../packages/dart/lib/src && dart format -l 110 .
|
||||||
-ln -sf $(pwd)/breez_liquid_sdk/include/breez_liquid_sdk.h ../../../../packages/flutter/ios/Classes/breez_liquid_sdk.h
|
-ln -sf $(pwd)/breez_sdk_liquid/include/breez_sdk_liquid.h ../../../../packages/flutter/ios/Classes/breez_sdk_liquid.h
|
||||||
-ln -sf $(pwd)/breez_liquid_sdk/include/breez_liquid_sdk.h ../../../../packages/flutter/macos/Classes/breez_liquid_sdk.h
|
-ln -sf $(pwd)/breez_sdk_liquid/include/breez_sdk_liquid.h ../../../../packages/flutter/macos/Classes/breez_sdk_liquid.h
|
||||||
|
|
||||||
# Generate FFI bindings
|
# Generate FFI bindings
|
||||||
ffigen:
|
ffigen:
|
||||||
@@ -43,7 +43,7 @@ ffigen:
|
|||||||
|
|
||||||
# Builds the local library for testing
|
# Builds the local library for testing
|
||||||
build *args:
|
build *args:
|
||||||
cargo build --package breez-liquid-sdk --manifest-path ../../../core/Cargo.toml --features frb {{args}}
|
cargo build --package breez-sdk-liquid --manifest-path ../../../core/Cargo.toml --features frb {{args}}
|
||||||
|
|
||||||
build-apple profile='frb-min':
|
build-apple profile='frb-min':
|
||||||
dart scripts/build_apple.dart --profile {{profile}}
|
dart scripts/build_apple.dart --profile {{profile}}
|
||||||
@@ -71,8 +71,8 @@ test-dart build='true':
|
|||||||
|
|
||||||
# Softlinks library archives from platform-build to their expected locations
|
# Softlinks library archives from platform-build to their expected locations
|
||||||
link:
|
link:
|
||||||
-ln -sf $(pwd)/platform-build/breez_liquid_sdk.xcframework.zip ../../../../packages/flutter/macos/Frameworks/{{curr_version}}.zip
|
-ln -sf $(pwd)/platform-build/breez_sdk_liquid.xcframework.zip ../../../../packages/flutter/macos/Frameworks/{{curr_version}}.zip
|
||||||
-ln -sf $(pwd)/platform-build/breez_liquid_sdk.xcframework.zip ../../../../packages/flutter/ios/Frameworks/{{curr_version}}.zip
|
-ln -sf $(pwd)/platform-build/breez_sdk_liquid.xcframework.zip ../../../../packages/flutter/ios/Frameworks/{{curr_version}}.zip
|
||||||
-ln -sf $(pwd)/platform-build/other.tar.gz ../../../../packages/flutter/linux/{{curr_version}}.tar.gz
|
-ln -sf $(pwd)/platform-build/other.tar.gz ../../../../packages/flutter/linux/{{curr_version}}.tar.gz
|
||||||
-ln -sf $(pwd)/platform-build/other.tar.gz ../../../../packages/flutter/windows/{{curr_version}}.tar.gz
|
-ln -sf $(pwd)/platform-build/other.tar.gz ../../../../packages/flutter/windows/{{curr_version}}.tar.gz
|
||||||
-ln -sf $(pwd)/platform-build/android.tar.gz ../../../../packages/flutter/android/{{curr_version}}.tar.gz
|
-ln -sf $(pwd)/platform-build/android.tar.gz ../../../../packages/flutter/android/{{curr_version}}.tar.gz
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: breez_liquid_sdk
|
name: breez_sdk_liquid
|
||||||
repository: https://github.com/breez/breez-liquid-sdk
|
repository: https://github.com/breez/breez-sdk-liquid
|
||||||
packages:
|
packages:
|
||||||
- ../../../../packages/**
|
- ../../../../packages/**
|
||||||
- scripts
|
- scripts
|
||||||
@@ -39,7 +39,7 @@ scripts:
|
|||||||
build-other-local: dart scripts/build_other.dart --local
|
build-other-local: dart scripts/build_other.dart --local
|
||||||
|
|
||||||
test:
|
test:
|
||||||
cargo build --package breez-liquid-sdk --profile=frb &&
|
cargo build --package breez-sdk-liquid --profile=frb &&
|
||||||
melos run test-dart &&
|
melos run test-dart &&
|
||||||
melos run test-flutter
|
melos run test-flutter
|
||||||
|
|
||||||
|
|||||||
@@ -285,10 +285,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
|
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.2"
|
version: "0.7.3"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name: breez_liquid_sdk_workspace
|
name: breez_sdk_liquid_workspace
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.4.0 <4.0.0'
|
sdk: '>=3.4.0 <4.0.0'
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import 'package:cli_script/cli_script.dart';
|
|||||||
|
|
||||||
import 'utils.dart';
|
import 'utils.dart';
|
||||||
|
|
||||||
const framework = 'breez_liquid_sdk.xcframework';
|
const framework = 'breez_sdk_liquid.xcframework';
|
||||||
const frameworkZip = '$framework.zip';
|
const frameworkZip = '$framework.zip';
|
||||||
const libName = 'libbreez_liquid_sdk.a';
|
const libName = 'libbreez_sdk_liquid.a';
|
||||||
const iosSimLipo = 'ios-sim-lipo/$libName';
|
const iosSimLipo = 'ios-sim-lipo/$libName';
|
||||||
const macLipo = 'mac-lipo/$libName';
|
const macLipo = 'mac-lipo/$libName';
|
||||||
const headers = '../breez_liquid_sdk/include';
|
const headers = '../breez_sdk_liquid/include';
|
||||||
const buildDir = 'platform-build';
|
const buildDir = 'platform-build';
|
||||||
|
|
||||||
Future<void> mainImpl(List<String> args) async {
|
Future<void> mainImpl(List<String> args) async {
|
||||||
@@ -74,7 +74,7 @@ Future<void> mainImpl(List<String> args) async {
|
|||||||
for (final target in targets) {
|
for (final target in targets) {
|
||||||
print(' Building target $target');
|
print(' Building target $target');
|
||||||
await run('rustup target add $target');
|
await run('rustup target add $target');
|
||||||
await run('cargo build --package breez-liquid-sdk --target=$target $profileArg');
|
await run('cargo build --package breez-sdk-liquid --target=$target $profileArg');
|
||||||
}
|
}
|
||||||
|
|
||||||
await run('mkdir -p mac-lipo ios-sim-lipo');
|
await run('mkdir -p mac-lipo ios-sim-lipo');
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import 'package:cli_script/cli_script.dart';
|
|||||||
|
|
||||||
import 'utils.dart';
|
import 'utils.dart';
|
||||||
|
|
||||||
const libName = 'breez_liquid_sdk';
|
const libName = 'breez_sdk_liquid';
|
||||||
const linuxLibName = 'lib$libName.so';
|
const linuxLibName = 'lib$libName.so';
|
||||||
const windowsLibName = '$libName.dll';
|
const windowsLibName = '$libName.dll';
|
||||||
const buildDir = 'platform-build';
|
const buildDir = 'platform-build';
|
||||||
@@ -46,7 +46,7 @@ Future<void> mainImpl(List<String> args) async {
|
|||||||
final triple = target.triple;
|
final triple = target.triple;
|
||||||
final flutterIdentifier = target.flutterIdentifier;
|
final flutterIdentifier = target.flutterIdentifier;
|
||||||
await run('rustup target add $triple');
|
await run('rustup target add $triple');
|
||||||
await run('${target.compiler} --package breez-liquid-sdk --target $triple $profileArg',
|
await run('${target.compiler} --package breez-sdk-liquid --target $triple $profileArg',
|
||||||
args: compilerOpts);
|
args: compilerOpts);
|
||||||
await run('mkdir -p $flutterIdentifier');
|
await run('mkdir -p $flutterIdentifier');
|
||||||
await run('cp ../../../../target/$triple/$profile/${target.libName} $flutterIdentifier/');
|
await run('cp ../../../../target/$triple/$profile/${target.libName} $flutterIdentifier/');
|
||||||
@@ -89,6 +89,6 @@ enum Targets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String get compiler =>
|
String get compiler =>
|
||||||
isWindows ? 'cargo xwin build --package breez-liquid-sdk' : 'cargo zigbuild --package breez-liquid-sdk';
|
isWindows ? 'cargo xwin build --package breez-sdk-liquid' : 'cargo zigbuild --package breez-sdk-liquid';
|
||||||
String get libName => isWindows ? windowsLibName : linuxLibName;
|
String get libName => isWindows ? windowsLibName : linuxLibName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ zig_build () {
|
|||||||
local LIBNAME="$3"
|
local LIBNAME="$3"
|
||||||
local PROFILE="$4"
|
local PROFILE="$4"
|
||||||
rustup target add "$TARGET"
|
rustup target add "$TARGET"
|
||||||
cargo zigbuild --package breez-liquid-sdk --target "$TARGET" --profile $PROFILE
|
cargo zigbuild --package breez-sdk-liquid --target "$TARGET" --profile $PROFILE
|
||||||
mkdir -p "$PLATFORM_NAME"
|
mkdir -p "$PLATFORM_NAME"
|
||||||
cp "../../../../target/$TARGET/$PROFILE/$LIBNAME" "$PLATFORM_NAME/"
|
cp "../../../../target/$TARGET/$PROFILE/$LIBNAME" "$PLATFORM_NAME/"
|
||||||
}
|
}
|
||||||
@@ -28,14 +28,14 @@ win_build () {
|
|||||||
local LIBNAME="$3"
|
local LIBNAME="$3"
|
||||||
local PROFILE="$4"
|
local PROFILE="$4"
|
||||||
rustup target add "$TARGET"
|
rustup target add "$TARGET"
|
||||||
cargo xwin build --package breez-liquid-sdk --target "$TARGET" --profile $PROFILE
|
cargo xwin build --package breez-sdk-liquid --target "$TARGET" --profile $PROFILE
|
||||||
mkdir -p "$PLATFORM_NAME"
|
mkdir -p "$PLATFORM_NAME"
|
||||||
cp "../../../../target/$TARGET/$PROFILE/$LIBNAME" "$PLATFORM_NAME/"
|
cp "../../../../target/$TARGET/$PROFILE/$LIBNAME" "$PLATFORM_NAME/"
|
||||||
}
|
}
|
||||||
|
|
||||||
PROFILE=frb-min
|
PROFILE=frb-min
|
||||||
# Build all the dynamic libraries
|
# Build all the dynamic libraries
|
||||||
LIBNAME=breez_liquid_sdk
|
LIBNAME=breez_sdk_liquid
|
||||||
LINUX_LIBNAME=lib$LIBNAME.so
|
LINUX_LIBNAME=lib$LIBNAME.so
|
||||||
zig_build aarch64-unknown-linux-gnu linux-arm64 $LINUX_LIBNAME $PROFILE
|
zig_build aarch64-unknown-linux-gnu linux-arm64 $LINUX_LIBNAME $PROFILE
|
||||||
zig_build x86_64-unknown-linux-gnu linux-x64 $LINUX_LIBNAME $PROFILE
|
zig_build x86_64-unknown-linux-gnu linux-x64 $LINUX_LIBNAME $PROFILE
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: scripts
|
|||||||
description: Supporting scripts
|
description: Supporting scripts
|
||||||
version: 0.0.1
|
version: 0.0.1
|
||||||
homepage: https://breez.technology
|
homepage: https://breez.technology
|
||||||
repository: https://github.com/breez/breez-liquid-sdk
|
repository: https://github.com/breez/breez-sdk-liquid
|
||||||
publish_to: none
|
publish_to: none
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container py-3">
|
<div class="container py-3">
|
||||||
<h1 class="text-center mb-3">breez-liquid-sdk</h1>
|
<h1 class="text-center mb-3">breez-sdk-liquid</h1>
|
||||||
<p class="mono text-center">
|
<p class="mono text-center">
|
||||||
View documentation for:
|
View documentation for:
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ gen-external-apklibs
|
|||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/android
|
# End of https://www.toptal.com/developers/gitignore/api/android
|
||||||
|
|
||||||
breez-liquid-sdk-kmp/src/androiddMain/jniLibs/
|
breez-sdk-liquid-kmp/src/androiddMain/jniLibs/
|
||||||
breez-liquid-sdk-kmp/src/jvmMain/jniLibs/
|
breez-sdk-liquid-kmp/src/jvmMain/jniLibs/
|
||||||
|
|
||||||
breez-liquid-sdk-kmp/src/commonMain/kotlin/breez_liquid_sdk
|
breez-sdk-liquid-kmp/src/commonMain/kotlin/breez_sdk_liquid
|
||||||
breez-liquid-sdk-kmp/src/jvmMain/kotlin/breez_liquid_sdk
|
breez-sdk-liquid-kmp/src/jvmMain/kotlin/breez_sdk_liquid
|
||||||
breez-liquid-sdk-kmp/src/androidMain/kotlin/breez_liquid_sdk
|
breez-sdk-liquid-kmp/src/androidMain/kotlin/breez_sdk_liquid
|
||||||
breez-liquid-sdk-kmp/src/nativeMain/kotlin/breez_liquid_sdk
|
breez-sdk-liquid-kmp/src/nativeMain/kotlin/breez_sdk_liquid
|
||||||
breez-liquid-sdk-kmp/src/nativeInterop/cinterop/headers/breez_liquid_sdk
|
breez-sdk-liquid-kmp/src/nativeInterop/cinterop/headers/breez_sdk_liquid
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ kotlin {
|
|||||||
it.compilations["main"].cinterops {
|
it.compilations["main"].cinterops {
|
||||||
create("breezCInterop") {
|
create("breezCInterop") {
|
||||||
defFile(project.file("src/nativeInterop/cinterop/breez.def"))
|
defFile(project.file("src/nativeInterop/cinterop/breez.def"))
|
||||||
includeDirs(project.file("src/nativeInterop/cinterop/headers/breez_liquid_sdk"), project.file("src/lib/$platform"))
|
includeDirs(project.file("src/nativeInterop/cinterop/headers/breez_sdk_liquid"), project.file("src/lib/$platform"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -114,19 +114,19 @@ publishing {
|
|||||||
this.forEach {
|
this.forEach {
|
||||||
(it as MavenPublication).apply {
|
(it as MavenPublication).apply {
|
||||||
pom {
|
pom {
|
||||||
name.set("breez-liquid-sdk-kmp")
|
name.set("breez-sdk-liquid-kmp")
|
||||||
description.set("The Breez Liquid SDK enables mobile developers to integrate Liquid swaps into their apps with a very shallow learning curve.")
|
description.set("The Breez Liquid SDK enables mobile developers to integrate Liquid swaps into their apps with a very shallow learning curve.")
|
||||||
url.set("https://breez.technology")
|
url.set("https://breez.technology")
|
||||||
licenses {
|
licenses {
|
||||||
license {
|
license {
|
||||||
name.set("MIT")
|
name.set("MIT")
|
||||||
url.set("https://github.com/breez/breez-liquid-sdk/blob/main/LICENSE")
|
url.set("https://github.com/breez/breez-sdk-liquid/blob/main/LICENSE")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scm {
|
scm {
|
||||||
connection.set("scm:git:github.com/breez/breez-liquid-sdk.git")
|
connection.set("scm:git:github.com/breez/breez-sdk-liquid.git")
|
||||||
developerConnection.set("scm:git:ssh://github.com/breez/breez-liquid-sdk.git")
|
developerConnection.set("scm:git:ssh://github.com/breez/breez-sdk-liquid.git")
|
||||||
url.set("https://github.com/breez/breez-liquid-sdk")
|
url.set("https://github.com/breez/breez-sdk-liquid")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,6 @@
|
|||||||
-keep class com.sun.jna.* { *; }
|
-keep class com.sun.jna.* { *; }
|
||||||
-keepclassmembers class * extends com.sun.jna.* { public *; }
|
-keepclassmembers class * extends com.sun.jna.* { public *; }
|
||||||
-keep class technology.breez.* { *; }
|
-keep class technology.breez.* { *; }
|
||||||
-keep class breez_liquid_sdk.** { *; }
|
-keep class breez_sdk_liquid.** { *; }
|
||||||
-keepclassmembers class * extends technology.breez.* { public *; }
|
-keepclassmembers class * extends technology.breez.* { public *; }
|
||||||
-keepclassmembers class * extends breez_liquid_sdk.** { public *; }
|
-keepclassmembers class * extends breez_sdk_liquid.** { public *; }
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
headers = breez_liquid_sdk.h
|
headers = breez_sdk_liquid.h
|
||||||
package = breez_liquid_sdk.cinterop
|
package = breez_sdk_liquid.cinterop
|
||||||
|
|
||||||
staticLibraries = libbreez_liquid_sdk_bindings.a
|
staticLibraries = libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
libraryPaths.ios_arm64 = src/lib/ios-arm64
|
libraryPaths.ios_arm64 = src/lib/ios-arm64
|
||||||
libraryPaths.ios_simulator_arm64 = src/lib/ios-simulator-arm64
|
libraryPaths.ios_simulator_arm64 = src/lib/ios-simulator-arm64
|
||||||
@@ -13,4 +13,4 @@ dependencyResolutionManagement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
include(":breez-liquid-sdk-kmp")
|
include(":breez-sdk-liquid-kmp")
|
||||||
|
|||||||
4
lib/bindings/langs/python/.gitignore
vendored
4
lib/bindings/langs/python/.gitignore
vendored
@@ -1,5 +1,5 @@
|
|||||||
src/breez_liquid_sdk/*
|
src/breez_sdk_liquid/*
|
||||||
!src/breez_liquid_sdk/__init__.py
|
!src/breez_sdk_liquid/__init__.py
|
||||||
*.egg-info
|
*.egg-info
|
||||||
build
|
build
|
||||||
dist
|
dist
|
||||||
|
|||||||
@@ -3,17 +3,17 @@
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```
|
```
|
||||||
pip install breez_liquid_sdk
|
pip install breez_sdk_liquid
|
||||||
```
|
```
|
||||||
|
|
||||||
``` python
|
``` python
|
||||||
import breez_liquid_sdk
|
import breez_sdk_liquid
|
||||||
```
|
```
|
||||||
|
|
||||||
## Python Package
|
## Python Package
|
||||||
|
|
||||||
Run the GitHub workflow 'Publish Python Bindings' when creating a new release of Breez Liquid SDK.
|
Run the GitHub workflow 'Publish Python Bindings' when creating a new release of Breez Liquid SDK.
|
||||||
It will create wheels for the following Python versions and Platforms and upload them to [PyPi.org](https://pypi.org/project/breez-liquid-sdk/).
|
It will create wheels for the following Python versions and Platforms and upload them to [PyPi.org](https://pypi.org/project/breez-sdk-liquid/).
|
||||||
|
|
||||||
### Supported Wheels
|
### Supported Wheels
|
||||||
|
|
||||||
@@ -34,4 +34,4 @@ make darwin # builds the package for macos
|
|||||||
make linux # builds the package for linux
|
make linux # builds the package for linux
|
||||||
```
|
```
|
||||||
|
|
||||||
The artifacts will be placed in `src/breez_liquid_sdk/`.
|
The artifacts will be placed in `src/breez_sdk_liquid/`.
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ init:
|
|||||||
|
|
||||||
darwin:
|
darwin:
|
||||||
make -C ../../ python-darwin
|
make -C ../../ python-darwin
|
||||||
cp ../../ffi/python/breez_liquid_sdk.py src/breez_liquid_sdk
|
cp ../../ffi/python/breez_sdk_liquid.py src/breez_sdk_liquid
|
||||||
cp ../../ffi/python/libbreez_liquid_sdk_bindings.dylib src/breez_liquid_sdk
|
cp ../../ffi/python/libbreez_sdk_liquid_bindings.dylib src/breez_sdk_liquid
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
make -C ../../ python-linux
|
make -C ../../ python-linux
|
||||||
cp ../../ffi/python/breez_liquid_sdk.py src/breez_liquid_sdk
|
cp ../../ffi/python/breez_sdk_liquid.py src/breez_sdk_liquid
|
||||||
cp ../../ffi/python/libbreez_liquid_sdk_bindings.so src/breez_liquid_sdk
|
cp ../../ffi/python/libbreez_sdk_liquid_bindings.so src/breez_sdk_liquid
|
||||||
|
|||||||
@@ -3,26 +3,26 @@
|
|||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
LONG_DESCRIPTION = """# Breez Liquid SDK
|
LONG_DESCRIPTION = """# Breez Liquid SDK
|
||||||
Python language bindings for the [Breez Liquid SDK](https://github.com/breez/breez-liquid-sdk).
|
Python language bindings for the [Breez Liquid SDK](https://github.com/breez/breez-sdk-liquid).
|
||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pip install breez_liquid_sdk
|
pip install breez_sdk_liquid
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="breez_liquid_sdk",
|
name="breez_sdk_liquid",
|
||||||
version="0.2.7.dev9",
|
version="0.2.7.dev9",
|
||||||
description="Python language bindings for the Breez Liquid SDK",
|
description="Python language bindings for the Breez Liquid SDK",
|
||||||
long_description=LONG_DESCRIPTION,
|
long_description=LONG_DESCRIPTION,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
packages=["breez_liquid_sdk"],
|
packages=["breez_sdk_liquid"],
|
||||||
package_dir={"breez_liquid_sdk": "./src/breez_liquid_sdk"},
|
package_dir={"breez_sdk_liquid": "./src/breez_sdk_liquid"},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
package_data={"breez_liquid_sdk": ["*.dylib", "*.so", "*.dll"]},
|
package_data={"breez_sdk_liquid": ["*.dylib", "*.so", "*.dll"]},
|
||||||
url="https://github.com/breez/breez-liquid-sdk",
|
url="https://github.com/breez/breez-sdk-liquid",
|
||||||
author="Breez <contact@breez.technology>",
|
author="Breez <contact@breez.technology>",
|
||||||
license="MIT",
|
license="MIT",
|
||||||
has_ext_modules=lambda: True,
|
has_ext_modules=lambda: True,
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
from breez_liquid_sdk.breez_liquid_sdk import *
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
from breez_sdk_liquid.breez_sdk_liquid import *
|
||||||
@@ -49,7 +49,7 @@ fun as{{ type_name }}List(arr: ReadableArray): List<{{ type_name }}> {
|
|||||||
{%- else %}
|
{%- else %}
|
||||||
is ReadableMap -> list.add(as{{ type_name }}(value)!!)
|
is ReadableMap -> list.add(as{{ type_name }}(value)!!)
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
else -> throw LiquidSdkException.Generic(errUnexpectedType("${value::class.java.name}"))
|
else -> throw SdkException.Generic(errUnexpectedType("${value::class.java.name}"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list
|
return list
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ fun pushToArray(array: WritableArray, value: Any?) {
|
|||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
is Array<*> -> array.pushArray(readableArrayOf(value.asIterable()))
|
is Array<*> -> array.pushArray(readableArrayOf(value.asIterable()))
|
||||||
is List<*> -> array.pushArray(readableArrayOf(value))
|
is List<*> -> array.pushArray(readableArrayOf(value))
|
||||||
else -> throw LiquidSdkException.Generic(errUnexpectedType("${value::class.java.name}"))
|
else -> throw SdkException.Generic(errUnexpectedType("${value::class.java.name}"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ fun pushToMap(map: WritableMap, key: String, value: Any?) {
|
|||||||
is ULong -> map.putDouble(key, value.toDouble())
|
is ULong -> map.putDouble(key, value.toDouble())
|
||||||
is Array<*> -> map.putArray(key, readableArrayOf(value.asIterable()))
|
is Array<*> -> map.putArray(key, readableArrayOf(value.asIterable()))
|
||||||
is List<*> -> map.putArray(key, readableArrayOf(value))
|
is List<*> -> map.putArray(key, readableArrayOf(value))
|
||||||
else -> throw LiquidSdkException.Generic("Unexpected type ${value::class.java.name} for key [$key]")
|
else -> throw SdkException.Generic("Unexpected type ${value::class.java.name} for key [$key]")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ fun asUByteList(arr: ReadableArray): List<UByte> {
|
|||||||
is Double -> list.add(value.toInt().toUByte())
|
is Double -> list.add(value.toInt().toUByte())
|
||||||
is Int -> list.add(value.toUByte())
|
is Int -> list.add(value.toUByte())
|
||||||
is UByte -> list.add(value)
|
is UByte -> list.add(value)
|
||||||
else -> throw LiquidSdkException.Generic(errUnexpectedType("${value::class.java.name}"))
|
else -> throw SdkException.Generic(errUnexpectedType("${value::class.java.name}"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list
|
return list
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ fun as{{ type_name }}List(arr: ReadableArray): List<{{ type_name }}> {
|
|||||||
for (value in arr.toArrayList()) {
|
for (value in arr.toArrayList()) {
|
||||||
when (value) {
|
when (value) {
|
||||||
is ReadableMap -> list.add(as{{ type_name }}(value)!!)
|
is ReadableMap -> list.add(as{{ type_name }}(value)!!)
|
||||||
else -> throw LiquidSdkException.Generic(errUnexpectedType("${value::class.java.name}"))
|
else -> throw SdkException.Generic(errUnexpectedType("${value::class.java.name}"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list
|
return list
|
||||||
|
|||||||
@@ -10,12 +10,12 @@
|
|||||||
{%- if e.is_flat() %}
|
{%- if e.is_flat() %}
|
||||||
val {{arg.name()|var_name|unquote|temporary}} = as{{arg.type_()|type_name}}({{ arg.name()|var_name|unquote }})
|
val {{arg.name()|var_name|unquote|temporary}} = as{{arg.type_()|type_name}}({{ arg.name()|var_name|unquote }})
|
||||||
{%- else %}
|
{%- else %}
|
||||||
val {{arg.name()|var_name|unquote|temporary}} = as{{arg.type_()|type_name}}({{ arg.name()|var_name|unquote }}) ?: run { throw LiquidSdkException.Generic(errMissingMandatoryField("{{arg.name()|var_name|unquote}}", "{{ arg.type_()|type_name }}")) }
|
val {{arg.name()|var_name|unquote|temporary}} = as{{arg.type_()|type_name}}({{ arg.name()|var_name|unquote }}) ?: run { throw SdkException.Generic(errMissingMandatoryField("{{arg.name()|var_name|unquote}}", "{{ arg.type_()|type_name }}")) }
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- when Type::Optional(_) %}
|
{%- when Type::Optional(_) %}
|
||||||
val {{arg.name()|var_name|unquote|temporary}} = {{arg.name()|var_name|unquote}}{{ arg.type_()|rn_convert_type(ci) -}}
|
val {{arg.name()|var_name|unquote|temporary}} = {{arg.name()|var_name|unquote}}{{ arg.type_()|rn_convert_type(ci) -}}
|
||||||
{%- when Type::Record(_) %}
|
{%- when Type::Record(_) %}
|
||||||
val {{arg.type_()|type_name|var_name|unquote}} = as{{arg.type_()|type_name}}({{ arg.name()|var_name|unquote }}) ?: run { throw LiquidSdkException.Generic(errMissingMandatoryField("{{arg.name()|var_name|unquote}}", "{{ arg.type_()|type_name }}")) }
|
val {{arg.type_()|type_name|var_name|unquote}} = as{{arg.type_()|type_name}}({{ arg.name()|var_name|unquote }}) ?: run { throw SdkException.Generic(errMissingMandatoryField("{{arg.name()|var_name|unquote}}", "{{ arg.type_()|type_name }}")) }
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- endmatch %}
|
{%- endmatch %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
{%- when Some with (return_type) %}
|
{%- when Some with (return_type) %}
|
||||||
val res = {{ obj_interface }}{{ func.name()|fn_name|unquote }}({%- call kt::arg_list(func) -%})
|
val res = {{ obj_interface }}{{ func.name()|fn_name|unquote }}({%- call kt::arg_list(func) -%})
|
||||||
{%- if func.name() == "default_config" %}
|
{%- if func.name() == "default_config" %}
|
||||||
val workingDir = File(reactApplicationContext.filesDir.toString() + "/breezLiquidSdk")
|
val workingDir = File(reactApplicationContext.filesDir.toString() + "/breezSdkLiquid")
|
||||||
|
|
||||||
res.workingDir = workingDir.absolutePath
|
res.workingDir = workingDir.absolutePath
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{%- import "macros.kt" as kt -%}
|
{%- import "macros.kt" as kt -%}
|
||||||
package com.breezliquidsdk
|
package com.breezsdkliquid
|
||||||
import breez_liquid_sdk.*
|
import breez_sdk_liquid.*
|
||||||
import com.facebook.react.bridge.*
|
import com.facebook.react.bridge.*
|
||||||
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
|
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.breezliquidsdk
|
package com.breezsdkliquid
|
||||||
|
|
||||||
import breez_liquid_sdk.*
|
import breez_sdk_liquid.*
|
||||||
import com.facebook.react.bridge.*
|
import com.facebook.react.bridge.*
|
||||||
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
|
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@@ -9,12 +9,12 @@ import java.util.concurrent.ExecutorService
|
|||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
{% import "macros.kt" as kt %}
|
{% import "macros.kt" as kt %}
|
||||||
|
|
||||||
class BreezLiquidSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
class BreezSDKLiquidModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
||||||
private lateinit var executor: ExecutorService
|
private lateinit var executor: ExecutorService
|
||||||
private var bindingLiquidSdk: BindingLiquidSdk? = null
|
private var bindingLiquidSdk: BindingLiquidSdk? = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val TAG = "RNBreezLiquidSDK"
|
const val TAG = "RNBreezSDKLiquid"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun initialize() {
|
override fun initialize() {
|
||||||
@@ -27,25 +27,25 @@ class BreezLiquidSDKModule(reactContext: ReactApplicationContext) : ReactContext
|
|||||||
return TAG
|
return TAG
|
||||||
}
|
}
|
||||||
|
|
||||||
@Throws(LiquidSdkException::class)
|
@Throws(SdkException::class)
|
||||||
fun getBindingLiquidSdk(): BindingLiquidSdk {
|
fun getBindingLiquidSdk(): BindingLiquidSdk {
|
||||||
if (bindingLiquidSdk != null) {
|
if (bindingLiquidSdk != null) {
|
||||||
return bindingLiquidSdk!!
|
return bindingLiquidSdk!!
|
||||||
}
|
}
|
||||||
|
|
||||||
throw LiquidSdkException.Generic("Not initialized")
|
throw SdkException.Generic("Not initialized")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Throws(LiquidSdkException::class)
|
@Throws(SdkException::class)
|
||||||
private fun ensureWorkingDir(workingDir: String) {
|
private fun ensureWorkingDir(workingDir: String) {
|
||||||
try {
|
try {
|
||||||
val workingDirFile = File(workingDir)
|
val workingDirFile = File(workingDir)
|
||||||
|
|
||||||
if (!workingDirFile.exists() && !workingDirFile.mkdirs()) {
|
if (!workingDirFile.exists() && !workingDirFile.mkdirs()) {
|
||||||
throw LiquidSdkException.Generic("Mandatory field workingDir must contain a writable directory")
|
throw SdkException.Generic("Mandatory field workingDir must contain a writable directory")
|
||||||
}
|
}
|
||||||
} catch (e: SecurityException) {
|
} catch (e: SecurityException) {
|
||||||
throw LiquidSdkException.Generic("Mandatory field workingDir must contain a writable directory")
|
throw SdkException.Generic("Mandatory field workingDir must contain a writable directory")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ class BreezLiquidSDKModule(reactContext: ReactApplicationContext) : ReactContext
|
|||||||
try {
|
try {
|
||||||
val emitter = reactApplicationContext.getJSModule(RCTDeviceEventEmitter::class.java)
|
val emitter = reactApplicationContext.getJSModule(RCTDeviceEventEmitter::class.java)
|
||||||
|
|
||||||
setLogger(BreezLiquidSDKLogger(emitter))
|
setLogger(BreezSDKLiquidLogger(emitter))
|
||||||
promise.resolve(readableMapOf("status" to "ok"))
|
promise.resolve(readableMapOf("status" to "ok"))
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
@@ -85,7 +85,7 @@ class BreezLiquidSDKModule(reactContext: ReactApplicationContext) : ReactContext
|
|||||||
|
|
||||||
executor.execute {
|
executor.execute {
|
||||||
try {
|
try {
|
||||||
var connectRequest = asConnectRequest(req) ?: run { throw LiquidSdkException.Generic(errMissingMandatoryField("req", "ConnectRequest")) }
|
var connectRequest = asConnectRequest(req) ?: run { throw SdkException.Generic(errMissingMandatoryField("req", "ConnectRequest")) }
|
||||||
|
|
||||||
ensureWorkingDir(connectRequest.config.workingDir)
|
ensureWorkingDir(connectRequest.config.workingDir)
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ class BreezLiquidSDKModule(reactContext: ReactApplicationContext) : ReactContext
|
|||||||
executor.execute {
|
executor.execute {
|
||||||
try {
|
try {
|
||||||
val emitter = reactApplicationContext.getJSModule(RCTDeviceEventEmitter::class.java)
|
val emitter = reactApplicationContext.getJSModule(RCTDeviceEventEmitter::class.java)
|
||||||
var eventListener = BreezLiquidSDKEventListener(emitter)
|
var eventListener = BreezSDKEventListener(emitter)
|
||||||
val res = getBindingLiquidSdk().addEventListener(eventListener)
|
val res = getBindingLiquidSdk().addEventListener(eventListener)
|
||||||
|
|
||||||
eventListener.setId(res)
|
eventListener.setId(res)
|
||||||
|
|||||||
@@ -209,14 +209,14 @@ pub mod filters {
|
|||||||
}
|
}
|
||||||
match t {
|
match t {
|
||||||
Type::Enum(_) | Type::Record(_) => Ok(format!(
|
Type::Enum(_) | Type::Record(_) => Ok(format!(
|
||||||
"BreezLiquidSDKMapper.dictionaryOf({}: res{})",
|
"BreezSDKLiquidMapper.dictionaryOf({}: res{})",
|
||||||
name, optional_suffix
|
name, optional_suffix
|
||||||
)),
|
)),
|
||||||
Type::Sequence(inner) => {
|
Type::Sequence(inner) => {
|
||||||
let unboxed = inner.as_ref();
|
let unboxed = inner.as_ref();
|
||||||
match unboxed {
|
match unboxed {
|
||||||
Type::Enum(_) | Type::Record(_) => Ok(format!(
|
Type::Enum(_) | Type::Record(_) => Ok(format!(
|
||||||
"BreezLiquidSDKMapper.arrayOf({}List: res{})",
|
"BreezSDKLiquidMapper.arrayOf({}List: res{})",
|
||||||
name, optional_suffix
|
name, optional_suffix
|
||||||
)),
|
)),
|
||||||
_ => Ok(format!("res{}", optional_suffix)),
|
_ => Ok(format!("res{}", optional_suffix)),
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ static func as{{ type_name }}({{ type_name|var_name|unquote }}: String) throws -
|
|||||||
|
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
default: throw LiquidSdkError.Generic(message: "Invalid variant \({{ type_name|var_name|unquote }}) for enum {{ type_name }}")
|
default: throw SdkError.Generic(message: "Invalid variant \({{ type_name|var_name|unquote }}) for enum {{ type_name }}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,11 +52,11 @@ static func as{{ type_name }}({{ type_name|var_name|unquote }}: [String: Any?])
|
|||||||
{%- else %}
|
{%- else %}
|
||||||
{% if field.type_()|inline_optional_field(ci) -%}
|
{% if field.type_()|inline_optional_field(ci) -%}
|
||||||
guard let _{{field.name()|var_name|unquote}} = {{ type_name|var_name|unquote }}["{{field.name()|var_name|unquote}}"] as? {{field.type_()|rn_type_name(ci, true)}} else {
|
guard let _{{field.name()|var_name|unquote}} = {{ type_name|var_name|unquote }}["{{field.name()|var_name|unquote}}"] as? {{field.type_()|rn_type_name(ci, true)}} else {
|
||||||
throw LiquidSdkError.Generic(message: errMissingMandatoryField(fieldName: "{{field.name()|var_name|unquote}}", typeName: "{{ type_name }}"))
|
throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "{{field.name()|var_name|unquote}}", typeName: "{{ type_name }}"))
|
||||||
}
|
}
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
guard let {{field.name()|var_name|unquote|temporary}} = {{ type_name|var_name|unquote }}["{{field.name()|var_name|unquote}}"] as? {{field.type_()|rn_type_name(ci, true)}} else {
|
guard let {{field.name()|var_name|unquote|temporary}} = {{ type_name|var_name|unquote }}["{{field.name()|var_name|unquote}}"] as? {{field.type_()|rn_type_name(ci, true)}} else {
|
||||||
throw LiquidSdkError.Generic(message: errMissingMandatoryField(fieldName: "{{field.name()|var_name|unquote}}", typeName: "{{ type_name }}"))
|
throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "{{field.name()|var_name|unquote}}", typeName: "{{ type_name }}"))
|
||||||
}
|
}
|
||||||
let _{{field.name()|var_name|unquote}} = {{field.type_()|render_from_map(ci, field.name()|var_name|unquote|temporary)}}
|
let _{{field.name()|var_name|unquote}} = {{field.type_()|render_from_map(ci, field.name()|var_name|unquote|temporary)}}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
@@ -68,7 +68,7 @@ static func as{{ type_name }}({{ type_name|var_name|unquote }}: [String: Any?])
|
|||||||
}
|
}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
throw LiquidSdkError.Generic(message: "Unexpected type \(type) for enum {{ type_name }}")
|
throw SdkError.Generic(message: "Unexpected type \(type) for enum {{ type_name }}")
|
||||||
}
|
}
|
||||||
|
|
||||||
static func dictionaryOf({{ type_name|var_name|unquote }}: {{ type_name }}) -> [String: Any?] {
|
static func dictionaryOf({{ type_name|var_name|unquote }}: {{ type_name }}) -> [String: Any?] {
|
||||||
@@ -108,7 +108,7 @@ static func as{{ type_name }}List(arr: [Any]) throws -> [{{ type_name }}] {
|
|||||||
var {{ type_name|var_name|unquote }} = try as{{ type_name }}({{ type_name|var_name|unquote }}: val)
|
var {{ type_name|var_name|unquote }} = try as{{ type_name }}({{ type_name|var_name|unquote }}: val)
|
||||||
list.append({{ type_name|var_name|unquote }})
|
list.append({{ type_name|var_name|unquote }})
|
||||||
} else {
|
} else {
|
||||||
throw LiquidSdkError.Generic(message: errUnexpectedType(typeName: "{{ type_name }}"))
|
throw SdkError.Generic(message: errUnexpectedType(typeName: "{{ type_name }}"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list
|
return list
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ static func as{{ type_name }}({{ type_name|var_name|unquote }}: [String: Any?])
|
|||||||
{% if field.type_()|inline_optional_field(ci) -%}
|
{% if field.type_()|inline_optional_field(ci) -%}
|
||||||
if hasNonNilKey(data: {{ type_name|var_name|unquote }}, key: "{{field.name()|var_name|unquote}}") {
|
if hasNonNilKey(data: {{ type_name|var_name|unquote }}, key: "{{field.name()|var_name|unquote}}") {
|
||||||
guard let {{field.name()|var_name|unquote|temporary}} = {{ type_name|var_name|unquote }}["{{field.name()|var_name|unquote}}"] as? {{field.type_()|rn_type_name(ci, true)}} else {
|
guard let {{field.name()|var_name|unquote|temporary}} = {{ type_name|var_name|unquote }}["{{field.name()|var_name|unquote}}"] as? {{field.type_()|rn_type_name(ci, true)}} else {
|
||||||
throw LiquidSdkError.Generic(message: errUnexpectedValue(fieldName: "{{field.name()|var_name|unquote}}"))
|
throw SdkError.Generic(message: errUnexpectedValue(fieldName: "{{field.name()|var_name|unquote}}"))
|
||||||
}
|
}
|
||||||
{{field.name()|var_name|unquote}} = {{field.name()|var_name|unquote|temporary}}
|
{{field.name()|var_name|unquote}} = {{field.name()|var_name|unquote|temporary}}
|
||||||
}
|
}
|
||||||
@@ -19,11 +19,11 @@ static func as{{ type_name }}({{ type_name|var_name|unquote }}: [String: Any?])
|
|||||||
{%- else %}
|
{%- else %}
|
||||||
{% if field.type_()|inline_optional_field(ci) -%}
|
{% if field.type_()|inline_optional_field(ci) -%}
|
||||||
guard let {{field.name()|var_name|unquote}} = {{ type_name|var_name|unquote }}["{{field.name()|var_name|unquote}}"] as? {{field.type_()|rn_type_name(ci, true)}} else {
|
guard let {{field.name()|var_name|unquote}} = {{ type_name|var_name|unquote }}["{{field.name()|var_name|unquote}}"] as? {{field.type_()|rn_type_name(ci, true)}} else {
|
||||||
throw LiquidSdkError.Generic(message: errMissingMandatoryField(fieldName: "{{field.name()|var_name|unquote}}", typeName: "{{ type_name }}"))
|
throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "{{field.name()|var_name|unquote}}", typeName: "{{ type_name }}"))
|
||||||
}
|
}
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
guard let {{field.name()|var_name|unquote|temporary}} = {{ type_name|var_name|unquote }}["{{field.name()|var_name|unquote}}"] as? {{field.type_()|rn_type_name(ci, true)}} else {
|
guard let {{field.name()|var_name|unquote|temporary}} = {{ type_name|var_name|unquote }}["{{field.name()|var_name|unquote}}"] as? {{field.type_()|rn_type_name(ci, true)}} else {
|
||||||
throw LiquidSdkError.Generic(message: errMissingMandatoryField(fieldName: "{{field.name()|var_name|unquote}}", typeName: "{{ type_name }}"))
|
throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "{{field.name()|var_name|unquote}}", typeName: "{{ type_name }}"))
|
||||||
}
|
}
|
||||||
let {{field.name()|var_name|unquote}} = {{field.type_()|render_from_map(ci, field.name()|var_name|unquote|temporary)}}
|
let {{field.name()|var_name|unquote}} = {{field.type_()|render_from_map(ci, field.name()|var_name|unquote|temporary)}}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
@@ -48,7 +48,7 @@ static func as{{ type_name }}List(arr: [Any]) throws -> [{{ type_name }}] {
|
|||||||
var {{ type_name|var_name|unquote }} = try as{{ type_name }}({{ type_name|var_name|unquote }}: val)
|
var {{ type_name|var_name|unquote }} = try as{{ type_name }}({{ type_name|var_name|unquote }}: val)
|
||||||
list.append({{ type_name|var_name|unquote }})
|
list.append({{ type_name|var_name|unquote }})
|
||||||
} else {
|
} else {
|
||||||
throw LiquidSdkError.Generic(message: errUnexpectedType(typeName: "{{ type_name }}"))
|
throw SdkError.Generic(message: errUnexpectedType(typeName: "{{ type_name }}"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list
|
return list
|
||||||
|
|||||||
@@ -7,14 +7,14 @@
|
|||||||
{%- when Type::Enum(inner) %}
|
{%- when Type::Enum(inner) %}
|
||||||
{%- let e = ci.get_enum_definition(inner).unwrap() %}
|
{%- let e = ci.get_enum_definition(inner).unwrap() %}
|
||||||
{%- if e.is_flat() %}
|
{%- if e.is_flat() %}
|
||||||
let {{arg.name()|var_name|unquote|temporary}} = try BreezLiquidSDKMapper.as{{arg.type_()|type_name}}({{ arg.type_()|type_name|var_name|unquote }}: {{ arg.name()|var_name|unquote }})
|
let {{arg.name()|var_name|unquote|temporary}} = try BreezSDKLiquidMapper.as{{arg.type_()|type_name}}({{ arg.type_()|type_name|var_name|unquote }}: {{ arg.name()|var_name|unquote }})
|
||||||
{%- else %}
|
{%- else %}
|
||||||
let {{arg.name()|var_name|unquote|temporary}} = try BreezLiquidSDKMapper.as{{arg.type_()|type_name}}({{ arg.type_()|type_name|var_name|unquote }}: {{ arg.name()|var_name|unquote }})
|
let {{arg.name()|var_name|unquote|temporary}} = try BreezSDKLiquidMapper.as{{arg.type_()|type_name}}({{ arg.type_()|type_name|var_name|unquote }}: {{ arg.name()|var_name|unquote }})
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- when Type::Optional(_) %}
|
{%- when Type::Optional(_) %}
|
||||||
let {{arg.name()|var_name|unquote|temporary}} = {{ arg.type_()|rn_convert_type(arg.name()|var_name|unquote) -}}
|
let {{arg.name()|var_name|unquote|temporary}} = {{ arg.type_()|rn_convert_type(arg.name()|var_name|unquote) -}}
|
||||||
{%- when Type::Record(_) %}
|
{%- when Type::Record(_) %}
|
||||||
let {{arg.type_()|type_name|var_name|unquote}} = try BreezLiquidSDKMapper.as{{arg.type_()|type_name}}({{ arg.type_()|type_name|var_name|unquote }}: {{ arg.name()|var_name|unquote }})
|
let {{arg.type_()|type_name|var_name|unquote}} = try BreezSDKLiquidMapper.as{{arg.type_()|type_name}}({{ arg.type_()|type_name|var_name|unquote }}: {{ arg.name()|var_name|unquote }})
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- endmatch %}
|
{%- endmatch %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
{%- when Some with (return_type) %}
|
{%- when Some with (return_type) %}
|
||||||
var res = {%- call swift::throws_decl(func) -%}{{ obj_interface }}{{ func.name()|fn_name|unquote }}({%- call swift::arg_list(func) -%})
|
var res = {%- call swift::throws_decl(func) -%}{{ obj_interface }}{{ func.name()|fn_name|unquote }}({%- call swift::arg_list(func) -%})
|
||||||
{%- if func.name() == "default_config" %}
|
{%- if func.name() == "default_config" %}
|
||||||
res.workingDir = RNBreezLiquidSDK.breezLiquidSdkDirectory.path
|
res.workingDir = RNBreezSDKLiquid.breezSdkLiquidDirectory.path
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- match return_type %}
|
{%- match return_type %}
|
||||||
{%- when Type::Optional(inner) %}
|
{%- when Type::Optional(inner) %}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#import <React/RCTBridgeModule.h>
|
#import <React/RCTBridgeModule.h>
|
||||||
#import <React/RCTEventEmitter.h>
|
#import <React/RCTEventEmitter.h>
|
||||||
|
|
||||||
@interface RCT_EXTERN_MODULE(RNBreezLiquidSDK, RCTEventEmitter)
|
@interface RCT_EXTERN_MODULE(RNBreezSDKLiquid, RCTEventEmitter)
|
||||||
{% for func in ci.function_definitions() %}
|
{% for func in ci.function_definitions() %}
|
||||||
{%- if func.name()|ignored_function == false -%}
|
{%- if func.name()|ignored_function == false -%}
|
||||||
{% include "ExternFunctionTemplate.m" %}
|
{% include "ExternFunctionTemplate.m" %}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{%- import "macros.swift" as swift -%}
|
{%- import "macros.swift" as swift -%}
|
||||||
import Foundation
|
import Foundation
|
||||||
import BreezLiquidSDK
|
import BreezSDKLiquid
|
||||||
|
|
||||||
enum BreezLiquidSDKMapper {
|
enum BreezSDKLiquidMapper {
|
||||||
|
|
||||||
{%- include "Types.swift" %}
|
{%- include "Types.swift" %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import BreezLiquidSDK
|
import BreezSDKLiquid
|
||||||
|
|
||||||
@objc(RNBreezLiquidSDK)
|
@objc(RNBreezSDKLiquid)
|
||||||
class RNBreezLiquidSDK: RCTEventEmitter {
|
class RNBreezSDKLiquid: RCTEventEmitter {
|
||||||
static let TAG: String = "BreezLiquidSDK"
|
static let TAG: String = "BreezSDKLiquid"
|
||||||
|
|
||||||
public static var emitter: RCTEventEmitter!
|
public static var emitter: RCTEventEmitter!
|
||||||
public static var hasListeners: Bool = false
|
public static var hasListeners: Bool = false
|
||||||
public static var supportedEvents: [String] = ["breezLiquidSdkLog"]
|
public static var supportedEvents: [String] = ["breezSdkLiquidLog"]
|
||||||
|
|
||||||
private var bindingLiquidSdk: BindingLiquidSdk!
|
private var bindingLiquidSdk: BindingLiquidSdk!
|
||||||
|
|
||||||
|
|
||||||
static var breezLiquidSdkDirectory: URL {
|
static var breezSdkLiquidDirectory: URL {
|
||||||
let applicationDirectory = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first!
|
let applicationDirectory = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first!
|
||||||
let breezLiquidSdkDirectory = applicationDirectory.appendingPathComponent("breezLiquidSdk", isDirectory: true)
|
let breezSdkLiquidDirectory = applicationDirectory.appendingPathComponent("breezSdkLiquid", isDirectory: true)
|
||||||
|
|
||||||
if !FileManager.default.fileExists(atPath: breezLiquidSdkDirectory.path) {
|
if !FileManager.default.fileExists(atPath: breezSdkLiquidDirectory.path) {
|
||||||
try! FileManager.default.createDirectory(atPath: breezLiquidSdkDirectory.path, withIntermediateDirectories: true)
|
try! FileManager.default.createDirectory(atPath: breezSdkLiquidDirectory.path, withIntermediateDirectories: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
return breezLiquidSdkDirectory
|
return breezSdkLiquidDirectory
|
||||||
}
|
}
|
||||||
|
|
||||||
override init() {
|
override init() {
|
||||||
super.init()
|
super.init()
|
||||||
RNBreezLiquidSDK.emitter = self
|
RNBreezSDKLiquid.emitter = self
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
@@ -34,19 +34,19 @@ class RNBreezLiquidSDK: RCTEventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static func addSupportedEvent(name: String) {
|
static func addSupportedEvent(name: String) {
|
||||||
RNBreezLiquidSDK.supportedEvents.append(name)
|
RNBreezSDKLiquid.supportedEvents.append(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func supportedEvents() -> [String]! {
|
override func supportedEvents() -> [String]! {
|
||||||
return RNBreezLiquidSDK.supportedEvents
|
return RNBreezSDKLiquid.supportedEvents
|
||||||
}
|
}
|
||||||
|
|
||||||
override func startObserving() {
|
override func startObserving() {
|
||||||
RNBreezLiquidSDK.hasListeners = true
|
RNBreezSDKLiquid.hasListeners = true
|
||||||
}
|
}
|
||||||
|
|
||||||
override func stopObserving() {
|
override func stopObserving() {
|
||||||
RNBreezLiquidSDK.hasListeners = false
|
RNBreezSDKLiquid.hasListeners = false
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
@@ -59,7 +59,7 @@ class RNBreezLiquidSDK: RCTEventEmitter {
|
|||||||
return bindingLiquidSdk
|
return bindingLiquidSdk
|
||||||
}
|
}
|
||||||
|
|
||||||
throw LiquidSdkError.Generic(message: "Not initialized")
|
throw SdkError.Generic(message: "Not initialized")
|
||||||
}
|
}
|
||||||
|
|
||||||
private func ensureWorkingDir(workingDir: String) throws {
|
private func ensureWorkingDir(workingDir: String) throws {
|
||||||
@@ -68,11 +68,11 @@ class RNBreezLiquidSDK: RCTEventEmitter {
|
|||||||
try FileManager.default.createDirectory(atPath: workingDir, withIntermediateDirectories: true)
|
try FileManager.default.createDirectory(atPath: workingDir, withIntermediateDirectories: true)
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
throw LiquidSdkError.Generic(message: "Mandatory field workingDir must contain a writable directory")
|
throw SdkError.Generic(message: "Mandatory field workingDir must contain a writable directory")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{% let obj_interface = "BreezLiquidSDK." -%}
|
{% let obj_interface = "BreezSDKLiquid." -%}
|
||||||
{% for func in ci.function_definitions() %}
|
{% for func in ci.function_definitions() %}
|
||||||
{%- if func.name()|ignored_function == false -%}
|
{%- if func.name()|ignored_function == false -%}
|
||||||
{% include "TopLevelFunctionTemplate.swift" %}
|
{% include "TopLevelFunctionTemplate.swift" %}
|
||||||
@@ -81,7 +81,7 @@ class RNBreezLiquidSDK: RCTEventEmitter {
|
|||||||
@objc(setLogger:reject:)
|
@objc(setLogger:reject:)
|
||||||
func setLogger(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
func setLogger(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
||||||
do {
|
do {
|
||||||
try BreezLiquidSDK.setLogger(logger: BreezLiquidSDKLogger())
|
try BreezSDKLiquid.setLogger(logger: BreezSDKLiquidLogger())
|
||||||
resolve(["status": "ok"])
|
resolve(["status": "ok"])
|
||||||
} catch let err {
|
} catch let err {
|
||||||
rejectErr(err: err, reject: reject)
|
rejectErr(err: err, reject: reject)
|
||||||
@@ -96,10 +96,10 @@ class RNBreezLiquidSDK: RCTEventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
var connectRequest = try BreezLiquidSDKMapper.asConnectRequest(connectRequest: req)
|
var connectRequest = try BreezSDKLiquidMapper.asConnectRequest(connectRequest: req)
|
||||||
try ensureWorkingDir(workingDir: connectRequest.config.workingDir)
|
try ensureWorkingDir(workingDir: connectRequest.config.workingDir)
|
||||||
|
|
||||||
bindingLiquidSdk = try BreezLiquidSDK.connect(req: connectRequest)
|
bindingLiquidSdk = try BreezSDKLiquid.connect(req: connectRequest)
|
||||||
resolve(["status": "ok"])
|
resolve(["status": "ok"])
|
||||||
} catch let err {
|
} catch let err {
|
||||||
rejectErr(err: err, reject: reject)
|
rejectErr(err: err, reject: reject)
|
||||||
@@ -109,7 +109,7 @@ class RNBreezLiquidSDK: RCTEventEmitter {
|
|||||||
@objc(addEventListener:reject:)
|
@objc(addEventListener:reject:)
|
||||||
func addEventListener(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
func addEventListener(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
||||||
do {
|
do {
|
||||||
var eventListener = BreezLiquidSDKEventListener()
|
var eventListener = BreezSDKEventListener()
|
||||||
var res = try getBindingLiquidSdk().addEventListener(listener: eventListener)
|
var res = try getBindingLiquidSdk().addEventListener(listener: eventListener)
|
||||||
|
|
||||||
eventListener.setId(id: res)
|
eventListener.setId(id: res)
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
|
|
||||||
export type EventListener = (e: LiquidSdkEvent) => void
|
export type EventListener = (e: SdkEvent) => void
|
||||||
|
|
||||||
export type Logger = (logEntry: LogEntry) => void
|
export type Logger = (logEntry: LogEntry) => void
|
||||||
|
|
||||||
export const connect = async (req: ConnectRequest): Promise<void> => {
|
export const connect = async (req: ConnectRequest): Promise<void> => {
|
||||||
const response = await BreezLiquidSDK.connect(req)
|
const response = await BreezSDKLiquid.connect(req)
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
|
||||||
export const addEventListener = async (listener: EventListener): Promise<string> => {
|
export const addEventListener = async (listener: EventListener): Promise<string> => {
|
||||||
const response = await BreezLiquidSDK.addEventListener()
|
const response = await BreezSDKLiquid.addEventListener()
|
||||||
BreezLiquidSDKEmitter.addListener(`event-${response}`, listener)
|
BreezSDKLiquidEmitter.addListener(`event-${response}`, listener)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
|
||||||
export const setLogger = async (logger: Logger): Promise<EmitterSubscription> => {
|
export const setLogger = async (logger: Logger): Promise<EmitterSubscription> => {
|
||||||
const subscription = BreezLiquidSDKEmitter.addListener("breezLiquidSdkLog", logger)
|
const subscription = BreezSDKLiquidEmitter.addListener("breezSdkLiquidLog", logger)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await BreezLiquidSDK.setLogger()
|
await BreezSDKLiquid.setLogger()
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
return subscription
|
return subscription
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{%- match func.return_type() -%}
|
{%- match func.return_type() -%}
|
||||||
{%- when Some with (return_type) %}
|
{%- when Some with (return_type) %}
|
||||||
export const {{ func.name()|fn_name }} = async ({%- call ts::arg_list_decl(func) -%}): Promise<{{ return_type|return_type_name }}> => {
|
export const {{ func.name()|fn_name }} = async ({%- call ts::arg_list_decl(func) -%}): Promise<{{ return_type|return_type_name }}> => {
|
||||||
const response = await BreezLiquidSDK.{{func.name()|fn_name}}({%- call ts::arg_list(func) -%})
|
const response = await BreezSDKLiquid.{{func.name()|fn_name}}({%- call ts::arg_list(func) -%})
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
{%- when None %}
|
{%- when None %}
|
||||||
export const {{ func.name()|fn_name }} = async ({%- call ts::arg_list_decl(func) -%}): Promise<void> => {
|
export const {{ func.name()|fn_name }} = async ({%- call ts::arg_list_decl(func) -%}): Promise<void> => {
|
||||||
await BreezLiquidSDK.{{ func.name()|fn_name }}({%- call ts::arg_list(func) -%})
|
await BreezSDKLiquid.{{ func.name()|fn_name }}({%- call ts::arg_list(func) -%})
|
||||||
}
|
}
|
||||||
{%- endmatch %}
|
{%- endmatch %}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { NativeModules, Platform, EmitterSubscription, NativeEventEmitter } from "react-native"
|
import { NativeModules, Platform, EmitterSubscription, NativeEventEmitter } from "react-native"
|
||||||
|
|
||||||
const LINKING_ERROR =
|
const LINKING_ERROR =
|
||||||
`The package 'react-native-breez-liquid-sdk' doesn't seem to be linked. Make sure: \n\n` +
|
`The package 'react-native-breez-sdk-liquid' doesn't seem to be linked. Make sure: \n\n` +
|
||||||
Platform.select({ ios: "- You have run 'pod install'\n", default: "" }) +
|
Platform.select({ ios: "- You have run 'pod install'\n", default: "" }) +
|
||||||
"- You rebuilt the app after installing the package\n" +
|
"- You rebuilt the app after installing the package\n" +
|
||||||
"- You are not using Expo managed workflow\n"
|
"- You are not using Expo managed workflow\n"
|
||||||
|
|
||||||
const BreezLiquidSDK = NativeModules.RNBreezLiquidSDK
|
const BreezSDKLiquid = NativeModules.RNBreezSDKLiquid
|
||||||
? NativeModules.RNBreezLiquidSDK
|
? NativeModules.RNBreezSDKLiquid
|
||||||
: new Proxy(
|
: new Proxy(
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
@@ -17,7 +17,7 @@ const BreezLiquidSDK = NativeModules.RNBreezLiquidSDK
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const BreezLiquidSDKEmitter = new NativeEventEmitter(BreezLiquidSDK)
|
const BreezSDKLiquidEmitter = new NativeEventEmitter(BreezSDKLiquid)
|
||||||
{%- import "macros.ts" as ts %}
|
{%- import "macros.ts" as ts %}
|
||||||
{%- include "Types.ts" %}
|
{%- include "Types.ts" %}
|
||||||
{% include "Helpers.ts" %}
|
{% include "Helpers.ts" %}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ impl RNBindingGenerator {
|
|||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
// Create the path
|
// Create the path
|
||||||
let output_path =
|
let output_path =
|
||||||
base_output_path.join(Utf8Path::new("android/src/main/java/com/breezliquidsdk"));
|
base_output_path.join(Utf8Path::new("android/src/main/java/com/breezsdkliquid"));
|
||||||
// Generate and write the binding to file
|
// Generate and write the binding to file
|
||||||
let bindings_output = self::gen_kotlin::MapperGenerator::new(config.clone(), ci)
|
let bindings_output = self::gen_kotlin::MapperGenerator::new(config.clone(), ci)
|
||||||
.render()
|
.render()
|
||||||
@@ -46,7 +46,7 @@ impl RNBindingGenerator {
|
|||||||
.write_bindings(
|
.write_bindings(
|
||||||
&bindings_output,
|
&bindings_output,
|
||||||
&output_path,
|
&output_path,
|
||||||
Utf8Path::new("BreezLiquidSDKMapper.kt"),
|
Utf8Path::new("BreezSDKLiquidMapper.kt"),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// Lint binding
|
// Lint binding
|
||||||
@@ -62,7 +62,7 @@ impl RNBindingGenerator {
|
|||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
// Create the path
|
// Create the path
|
||||||
let output_path =
|
let output_path =
|
||||||
base_output_path.join(Utf8Path::new("android/src/main/java/com/breezliquidsdk"));
|
base_output_path.join(Utf8Path::new("android/src/main/java/com/breezsdkliquid"));
|
||||||
// Generate and write the binding to file
|
// Generate and write the binding to file
|
||||||
let bindings_output = self::gen_kotlin::ModuleGenerator::new(config.clone(), ci)
|
let bindings_output = self::gen_kotlin::ModuleGenerator::new(config.clone(), ci)
|
||||||
.render()
|
.render()
|
||||||
@@ -71,7 +71,7 @@ impl RNBindingGenerator {
|
|||||||
.write_bindings(
|
.write_bindings(
|
||||||
&bindings_output,
|
&bindings_output,
|
||||||
&output_path,
|
&output_path,
|
||||||
Utf8Path::new("BreezLiquidSDKModule.kt"),
|
Utf8Path::new("BreezSDKLiquidModule.kt"),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// Lint binding
|
// Lint binding
|
||||||
@@ -105,7 +105,7 @@ impl RNBindingGenerator {
|
|||||||
.write_bindings(
|
.write_bindings(
|
||||||
&bindings_output,
|
&bindings_output,
|
||||||
&output_path,
|
&output_path,
|
||||||
Utf8Path::new("BreezLiquidSDKMapper.swift"),
|
Utf8Path::new("BreezSDKLiquidMapper.swift"),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// Lint binding
|
// Lint binding
|
||||||
@@ -129,7 +129,7 @@ impl RNBindingGenerator {
|
|||||||
.write_bindings(
|
.write_bindings(
|
||||||
&bindings_output,
|
&bindings_output,
|
||||||
&output_path,
|
&output_path,
|
||||||
Utf8Path::new("RNBreezLiquidSDK.m"),
|
Utf8Path::new("RNBreezSDKLiquid.m"),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// Lint binding
|
// Lint binding
|
||||||
@@ -153,7 +153,7 @@ impl RNBindingGenerator {
|
|||||||
.write_bindings(
|
.write_bindings(
|
||||||
&bindings_output,
|
&bindings_output,
|
||||||
&output_path,
|
&output_path,
|
||||||
Utf8Path::new("RNBreezLiquidSDK.swift"),
|
Utf8Path::new("RNBreezSDKLiquid.swift"),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// Lint binding
|
// Lint binding
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ fn main() {
|
|||||||
let cli_binding_dir = cli.binding_dir.unwrap_or("../../".into());
|
let cli_binding_dir = cli.binding_dir.unwrap_or("../../".into());
|
||||||
let cli_out_dir = cli.out_dir.unwrap_or("./".into());
|
let cli_out_dir = cli.out_dir.unwrap_or("./".into());
|
||||||
let binding_dir = Utf8Path::new(cli_binding_dir.as_str());
|
let binding_dir = Utf8Path::new(cli_binding_dir.as_str());
|
||||||
let udl_file = binding_dir.join(Utf8Path::new("src/breez_liquid_sdk.udl"));
|
let udl_file = binding_dir.join(Utf8Path::new("src/breez_sdk_liquid.udl"));
|
||||||
let config = binding_dir.join(Utf8Path::new("uniffi.toml"));
|
let config = binding_dir.join(Utf8Path::new("uniffi.toml"));
|
||||||
let out_dir = Utf8Path::new(cli_out_dir.as_str());
|
let out_dir = Utf8Path::new(cli_out_dir.as_str());
|
||||||
|
|
||||||
|
|||||||
8
lib/bindings/langs/swift/.gitignore
vendored
8
lib/bindings/langs/swift/.gitignore
vendored
@@ -2,7 +2,7 @@
|
|||||||
.build/
|
.build/
|
||||||
*.xcodeproj
|
*.xcodeproj
|
||||||
*.podspec
|
*.podspec
|
||||||
Sources/BreezLiquidSDK/BreezLiquidSDK.swift
|
Sources/BreezSDKLiquid/BreezSDKLiquid.swift
|
||||||
**/breez_liquid_sdkFFI.h
|
**/breez_sdk_liquidFFI.h
|
||||||
**/breez_liquid_sdkFFI
|
**/breez_sdk_liquidFFI
|
||||||
**/breez_liquid_sdkFFI.modulemap
|
**/breez_sdk_liquidFFI.modulemap
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ let package = Package(
|
|||||||
.iOS(.v11),
|
.iOS(.v11),
|
||||||
],
|
],
|
||||||
products: [
|
products: [
|
||||||
.library(name: "BreezLiquidSDK", targets: ["breez_liquid_sdkFFI", "BreezLiquidSDK"]),
|
.library(name: "BreezSDKLiquid", targets: ["breez_sdk_liquidFFI", "BreezSDKLiquid"]),
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
||||||
.binaryTarget(name: "breez_liquid_sdkFFI", path: "./breez_liquid_sdkFFI.xcframework"),
|
.binaryTarget(name: "breez_sdk_liquidFFI", path: "./breez_sdk_liquidFFI.xcframework"),
|
||||||
.target(name: "BreezLiquidSDK", dependencies: ["breez_liquid_sdkFFI"]),
|
.target(name: "BreezSDKLiquid", dependencies: ["breez_sdk_liquidFFI"]),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
#import "breez_liquid_sdkFFI.h"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
framework module breez_liquid_sdkFFI {
|
|
||||||
umbrella header "breez_liquid_sdkFFI-umbrella.h"
|
|
||||||
|
|
||||||
export *
|
|
||||||
module * { export * }
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#import "breez_liquid_sdkFFI.h"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
framework module breez_liquid_sdkFFI {
|
|
||||||
umbrella header "breez_liquid_sdkFFI-umbrella.h"
|
|
||||||
|
|
||||||
export *
|
|
||||||
module * { export * }
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#import "breez_liquid_sdkFFI.h"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
framework module breez_liquid_sdkFFI {
|
|
||||||
umbrella header "breez_liquid_sdkFFI-umbrella.h"
|
|
||||||
|
|
||||||
export *
|
|
||||||
module * { export * }
|
|
||||||
}
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
<key>LibraryIdentifier</key>
|
<key>LibraryIdentifier</key>
|
||||||
<string>macos-arm64_x86_64</string>
|
<string>macos-arm64_x86_64</string>
|
||||||
<key>LibraryPath</key>
|
<key>LibraryPath</key>
|
||||||
<string>breez_liquid_sdkFFI.framework</string>
|
<string>breez_sdk_liquidFFI.framework</string>
|
||||||
<key>SupportedArchitectures</key>
|
<key>SupportedArchitectures</key>
|
||||||
<array>
|
<array>
|
||||||
<string>arm64</string>
|
<string>arm64</string>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<key>LibraryIdentifier</key>
|
<key>LibraryIdentifier</key>
|
||||||
<string>ios-arm64_x86_64-simulator</string>
|
<string>ios-arm64_x86_64-simulator</string>
|
||||||
<key>LibraryPath</key>
|
<key>LibraryPath</key>
|
||||||
<string>breez_liquid_sdkFFI.framework</string>
|
<string>breez_sdk_liquidFFI.framework</string>
|
||||||
<key>SupportedArchitectures</key>
|
<key>SupportedArchitectures</key>
|
||||||
<array>
|
<array>
|
||||||
<string>arm64</string>
|
<string>arm64</string>
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
<key>LibraryIdentifier</key>
|
<key>LibraryIdentifier</key>
|
||||||
<string>ios-arm64</string>
|
<string>ios-arm64</string>
|
||||||
<key>LibraryPath</key>
|
<key>LibraryPath</key>
|
||||||
<string>breez_liquid_sdkFFI.framework</string>
|
<string>breez_sdk_liquidFFI.framework</string>
|
||||||
<key>SupportedArchitectures</key>
|
<key>SupportedArchitectures</key>
|
||||||
<array>
|
<array>
|
||||||
<string>arm64</string>
|
<string>arm64</string>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#import "breez_sdk_liquidFFI.h"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
framework module breez_sdk_liquidFFI {
|
||||||
|
umbrella header "breez_sdk_liquidFFI-umbrella.h"
|
||||||
|
|
||||||
|
export *
|
||||||
|
module * { export * }
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#import "breez_sdk_liquidFFI.h"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
framework module breez_sdk_liquidFFI {
|
||||||
|
umbrella header "breez_sdk_liquidFFI-umbrella.h"
|
||||||
|
|
||||||
|
export *
|
||||||
|
module * { export * }
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#import "breez_sdk_liquidFFI.h"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
framework module breez_sdk_liquidFFI {
|
||||||
|
umbrella header "breez_sdk_liquidFFI-umbrella.h"
|
||||||
|
|
||||||
|
export *
|
||||||
|
module * { export * }
|
||||||
|
}
|
||||||
@@ -37,7 +37,7 @@ all: bindings-swift bindings-android python-darwin react-native
|
|||||||
## Android
|
## Android
|
||||||
.PHONY: android
|
.PHONY: android
|
||||||
android: aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
|
android: aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
|
||||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_liquid_sdk.udl --no-format --language kotlin -o ffi/kotlin
|
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language kotlin -o ffi/kotlin
|
||||||
|
|
||||||
aarch64-linux-android: $(SOURCES) ndk-home
|
aarch64-linux-android: $(SOURCES) ndk-home
|
||||||
cargo ndk -t aarch64-linux-android -o ffi/kotlin/jniLibs build --release
|
cargo ndk -t aarch64-linux-android -o ffi/kotlin/jniLibs build --release
|
||||||
@@ -57,7 +57,7 @@ x86_64-linux-android: $(SOURCES) ndk-home
|
|||||||
|
|
||||||
bindings-android: android
|
bindings-android: android
|
||||||
cp -r ffi/kotlin/jniLibs langs/android/lib/src/main
|
cp -r ffi/kotlin/jniLibs langs/android/lib/src/main
|
||||||
cp -r ffi/kotlin/breez_liquid_sdk langs/android/lib/src/main/kotlin/
|
cp -r ffi/kotlin/breez_sdk_liquid langs/android/lib/src/main/kotlin/
|
||||||
cd android && ./gradlew assemble
|
cd android && ./gradlew assemble
|
||||||
mkdir -p ffi/android
|
mkdir -p ffi/android
|
||||||
cp langs/android/lib/build/outputs/aar/lib-release.aar ffi/android
|
cp langs/android/lib/build/outputs/aar/lib-release.aar ffi/android
|
||||||
@@ -66,23 +66,23 @@ bindings-android: android
|
|||||||
.PHONY: kotlin
|
.PHONY: kotlin
|
||||||
kotlin: $(SOURCES)
|
kotlin: $(SOURCES)
|
||||||
cargo build --release --target $(TARGET)
|
cargo build --release --target $(TARGET)
|
||||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_liquid_sdk.udl --no-format --language kotlin -o ffi/kotlin
|
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language kotlin -o ffi/kotlin
|
||||||
|
|
||||||
bindings-kotlin-multiplatform: ios-universal android
|
bindings-kotlin-multiplatform: ios-universal android
|
||||||
mkdir -p langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/androidMain
|
mkdir -p langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/androidMain
|
||||||
cp -r ffi/kotlin/jniLibs/ langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/androidMain/jniLibs/
|
cp -r ffi/kotlin/jniLibs/ langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/androidMain/jniLibs/
|
||||||
cp -r ffi/kmp/* langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/
|
cp -r ffi/kmp/* langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/
|
||||||
|
|
||||||
cp -r langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/jvmMain/kotlin langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/androidMain/
|
cp -r langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/jvmMain/kotlin langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/androidMain/
|
||||||
|
|
||||||
mkdir -p langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/lib/ios-arm64/
|
mkdir -p langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/lib/ios-arm64/
|
||||||
mkdir -p langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/lib/ios-simulator-arm64/
|
mkdir -p langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/lib/ios-simulator-arm64/
|
||||||
mkdir -p langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/lib/ios-simulator-x64/
|
mkdir -p langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/lib/ios-simulator-x64/
|
||||||
|
|
||||||
cp ../target/aarch64-apple-ios/release/libbreez_liquid_sdk_bindings.a langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/lib/ios-arm64/
|
cp ../target/aarch64-apple-ios/release/libbreez_sdk_liquid_bindings.a langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/lib/ios-arm64/
|
||||||
cp ../target/aarch64-apple-ios-sim/release/libbreez_liquid_sdk_bindings.a langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/lib/ios-simulator-arm64/
|
cp ../target/aarch64-apple-ios-sim/release/libbreez_sdk_liquid_bindings.a langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/lib/ios-simulator-arm64/
|
||||||
cp ../target/x86_64-apple-ios/release/libbreez_liquid_sdk_bindings.a langs/kotlin-multiplatform/breez-liquid-sdk-kmp/src/lib/ios-simulator-x64/
|
cp ../target/x86_64-apple-ios/release/libbreez_sdk_liquid_bindings.a langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/lib/ios-simulator-x64/
|
||||||
cd langs/kotlin-multiplatform && ./gradlew :breez-liquid-sdk-kmp:assemble
|
cd langs/kotlin-multiplatform && ./gradlew :breez-sdk-liquid-kmp:assemble
|
||||||
|
|
||||||
## Apple
|
## Apple
|
||||||
ios-universal: $(SOURCES)
|
ios-universal: $(SOURCES)
|
||||||
@@ -92,50 +92,50 @@ ios-universal: $(SOURCES)
|
|||||||
cargo build --release --target x86_64-apple-ios ;\
|
cargo build --release --target x86_64-apple-ios ;\
|
||||||
cargo build --release --target aarch64-apple-ios-sim ;\
|
cargo build --release --target aarch64-apple-ios-sim ;\
|
||||||
# build universal lib for arm device and x86 sim
|
# build universal lib for arm device and x86 sim
|
||||||
lipo -create -output ../target/ios-universal/release/libbreez_liquid_sdk_bindings.a ../target/aarch64-apple-ios/release/libbreez_liquid_sdk_bindings.a ../target/x86_64-apple-ios/release/libbreez_liquid_sdk_bindings.a
|
lipo -create -output ../target/ios-universal/release/libbreez_sdk_liquid_bindings.a ../target/aarch64-apple-ios/release/libbreez_sdk_liquid_bindings.a ../target/x86_64-apple-ios/release/libbreez_sdk_liquid_bindings.a
|
||||||
# build universal lib for arm sim and x86 sim
|
# build universal lib for arm sim and x86 sim
|
||||||
lipo -create -output ../target/ios-universal-sim/release/libbreez_liquid_sdk_bindings.a ../target/aarch64-apple-ios-sim/release/libbreez_liquid_sdk_bindings.a ../target/x86_64-apple-ios/release/libbreez_liquid_sdk_bindings.a
|
lipo -create -output ../target/ios-universal-sim/release/libbreez_sdk_liquid_bindings.a ../target/aarch64-apple-ios-sim/release/libbreez_sdk_liquid_bindings.a ../target/x86_64-apple-ios/release/libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
darwin-universal: $(SOURCES)
|
darwin-universal: $(SOURCES)
|
||||||
mkdir -p ../target/darwin-universal/release
|
mkdir -p ../target/darwin-universal/release
|
||||||
cargo lipo --release --targets aarch64-apple-darwin
|
cargo lipo --release --targets aarch64-apple-darwin
|
||||||
cargo lipo --release --targets x86_64-apple-darwin
|
cargo lipo --release --targets x86_64-apple-darwin
|
||||||
lipo -create -output ../target/darwin-universal/release/libbreez_liquid_sdk_bindings.dylib ../target/aarch64-apple-darwin/release/libbreez_liquid_sdk_bindings.dylib ../target/x86_64-apple-darwin/release/libbreez_liquid_sdk_bindings.dylib
|
lipo -create -output ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.dylib ../target/aarch64-apple-darwin/release/libbreez_sdk_liquid_bindings.dylib ../target/x86_64-apple-darwin/release/libbreez_sdk_liquid_bindings.dylib
|
||||||
lipo -create -output ../target/darwin-universal/release/libbreez_liquid_sdk_bindings.a ../target/aarch64-apple-darwin/release/libbreez_liquid_sdk_bindings.a ../target/x86_64-apple-darwin/release/libbreez_liquid_sdk_bindings.a
|
lipo -create -output ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.a ../target/aarch64-apple-darwin/release/libbreez_sdk_liquid_bindings.a ../target/x86_64-apple-darwin/release/libbreez_sdk_liquid_bindings.a
|
||||||
|
|
||||||
## Swift
|
## Swift
|
||||||
swift-ios: ios-universal
|
swift-ios: ios-universal
|
||||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_liquid_sdk.udl -l swift -o ffi/swift-ios
|
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl -l swift -o ffi/swift-ios
|
||||||
cp ../target/ios-universal/release/libbreez_liquid_sdk_bindings.a ffi/swift-ios
|
cp ../target/ios-universal/release/libbreez_sdk_liquid_bindings.a ffi/swift-ios
|
||||||
cd ffi/swift-ios && "swiftc" "-emit-module" "-module-name" "breez_liquid_sdk_bindings" "-Xcc" "-fmodule-map-file=$(CURRENT_DIR)/ffi/swift-ios/breez_liquid_sdkFFI.modulemap" "-I" "." "-L" "." "-lbreez_liquid_sdk_bindings" breez_liquid_sdk.swift
|
cd ffi/swift-ios && "swiftc" "-emit-module" "-module-name" "breez_sdk_liquid_bindings" "-Xcc" "-fmodule-map-file=$(CURRENT_DIR)/ffi/swift-ios/breez_sdk_liquidFFI.modulemap" "-I" "." "-L" "." "-lbreez_sdk_liquid_bindings" breez_sdk_liquid.swift
|
||||||
|
|
||||||
swift-darwin: darwin-universal
|
swift-darwin: darwin-universal
|
||||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_liquid_sdk.udl -l swift -o ffi/swift-darwin
|
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl -l swift -o ffi/swift-darwin
|
||||||
cp ../target/darwin-universal/release/libbreez_liquid_sdk_bindings.dylib ffi/swift-darwin
|
cp ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.dylib ffi/swift-darwin
|
||||||
cd ffi/swift-darwin && "swiftc" "-emit-module" "-module-name" "breez_liquid_sdk_bindings" "-Xcc" "-fmodule-map-file=$(CURRENT_DIR)/ffi/swift-darwin/breez_liquid_sdkFFI.modulemap" "-I" "." "-L" "." "-lbreez_liquid_sdk_bindings" breez_liquid_sdk.swift
|
cd ffi/swift-darwin && "swiftc" "-emit-module" "-module-name" "breez_sdk_liquid_bindings" "-Xcc" "-fmodule-map-file=$(CURRENT_DIR)/ffi/swift-darwin/breez_sdk_liquidFFI.modulemap" "-I" "." "-L" "." "-lbreez_sdk_liquid_bindings" breez_sdk_liquid.swift
|
||||||
|
|
||||||
bindings-swift: ios-universal darwin-universal
|
bindings-swift: ios-universal darwin-universal
|
||||||
mkdir -p langs/swift/Sources/BreezLiquidSDK
|
mkdir -p langs/swift/Sources/BreezSDKLiquid
|
||||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_liquid_sdk.udl --no-format --language swift -o langs/swift/Sources/BreezLiquidSDK
|
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language swift -o langs/swift/Sources/BreezSDKLiquid
|
||||||
mv langs/swift/Sources/BreezLiquidSDK/breez_liquid_sdk.swift langs/swift/Sources/BreezLiquidSDK/BreezLiquidSDK.swift
|
mv langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquid.swift langs/swift/Sources/BreezSDKLiquid/BreezSDKLiquid.swift
|
||||||
cp langs/swift/Sources/BreezLiquidSDK/breez_liquid_sdkFFI.h langs/swift/breez_liquid_sdkFFI.xcframework/ios-arm64/breez_liquid_sdkFFI.framework/Headers
|
cp langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquidFFI.h langs/swift/breez_sdk_liquidFFI.xcframework/ios-arm64/breez_sdk_liquidFFI.framework/Headers
|
||||||
cp langs/swift/Sources/BreezLiquidSDK/breez_liquid_sdkFFI.h langs/swift/breez_liquid_sdkFFI.xcframework/ios-arm64_x86_64-simulator/breez_liquid_sdkFFI.framework/Headers
|
cp langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquidFFI.h langs/swift/breez_sdk_liquidFFI.xcframework/ios-arm64_x86_64-simulator/breez_sdk_liquidFFI.framework/Headers
|
||||||
cp langs/swift/Sources/BreezLiquidSDK/breez_liquid_sdkFFI.h langs/swift/breez_liquid_sdkFFI.xcframework/macos-arm64_x86_64/breez_liquid_sdkFFI.framework/Headers
|
cp langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquidFFI.h langs/swift/breez_sdk_liquidFFI.xcframework/macos-arm64_x86_64/breez_sdk_liquidFFI.framework/Headers
|
||||||
cp ../target/aarch64-apple-ios/release/libbreez_liquid_sdk_bindings.a langs/swift/breez_liquid_sdkFFI.xcframework/ios-arm64/breez_liquid_sdkFFI.framework/breez_liquid_sdkFFI
|
cp ../target/aarch64-apple-ios/release/libbreez_sdk_liquid_bindings.a langs/swift/breez_sdk_liquidFFI.xcframework/ios-arm64/breez_sdk_liquidFFI.framework/breez_sdk_liquidFFI
|
||||||
cp ../target/ios-universal-sim/release/libbreez_liquid_sdk_bindings.a langs/swift/breez_liquid_sdkFFI.xcframework/ios-arm64_x86_64-simulator/breez_liquid_sdkFFI.framework/breez_liquid_sdkFFI
|
cp ../target/ios-universal-sim/release/libbreez_sdk_liquid_bindings.a langs/swift/breez_sdk_liquidFFI.xcframework/ios-arm64_x86_64-simulator/breez_sdk_liquidFFI.framework/breez_sdk_liquidFFI
|
||||||
cp ../target/darwin-universal/release/libbreez_liquid_sdk_bindings.a langs/swift/breez_liquid_sdkFFI.xcframework/macos-arm64_x86_64/breez_liquid_sdkFFI.framework/breez_liquid_sdkFFI
|
cp ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.a langs/swift/breez_sdk_liquidFFI.xcframework/macos-arm64_x86_64/breez_sdk_liquidFFI.framework/breez_sdk_liquidFFI
|
||||||
rm langs/swift/Sources/BreezLiquidSDK/breez_liquid_sdkFFI.h
|
rm langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquidFFI.h
|
||||||
rm langs/swift/Sources/BreezLiquidSDK/breez_liquid_sdkFFI.modulemap
|
rm langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquidFFI.modulemap
|
||||||
|
|
||||||
## Python
|
## Python
|
||||||
python-linux: $(SOURCES)
|
python-linux: $(SOURCES)
|
||||||
cargo build --release --target $(TARGET)
|
cargo build --release --target $(TARGET)
|
||||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_liquid_sdk.udl --no-format --language python -o ffi/python
|
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language python -o ffi/python
|
||||||
cp ../target/$(TARGET)/release/libbreez_liquid_sdk_bindings.so ffi/python
|
cp ../target/$(TARGET)/release/libbreez_sdk_liquid_bindings.so ffi/python
|
||||||
|
|
||||||
python-darwin: darwin-universal
|
python-darwin: darwin-universal
|
||||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_liquid_sdk.udl --no-format --language python -o ffi/python
|
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language python -o ffi/python
|
||||||
cp ../target/darwin-universal/release/libbreez_liquid_sdk_bindings.dylib ffi/python
|
cp ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.dylib ffi/python
|
||||||
|
|
||||||
## React Native
|
## React Native
|
||||||
.PHONY: react-native
|
.PHONY: react-native
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ dictionary LnUrlPaySuccessData {
|
|||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|
||||||
[Error]
|
[Error]
|
||||||
enum LiquidSdkError {
|
enum SdkError {
|
||||||
"AlreadyStarted",
|
"AlreadyStarted",
|
||||||
"Generic",
|
"Generic",
|
||||||
"NotStarted",
|
"NotStarted",
|
||||||
@@ -446,7 +446,7 @@ dictionary RefundResponse {
|
|||||||
};
|
};
|
||||||
|
|
||||||
[Enum]
|
[Enum]
|
||||||
interface LiquidSdkEvent {
|
interface SdkEvent {
|
||||||
PaymentFailed(Payment details);
|
PaymentFailed(Payment details);
|
||||||
PaymentPending(Payment details);
|
PaymentPending(Payment details);
|
||||||
PaymentRefunded(Payment details);
|
PaymentRefunded(Payment details);
|
||||||
@@ -457,7 +457,7 @@ interface LiquidSdkEvent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
callback interface EventListener {
|
callback interface EventListener {
|
||||||
void on_event(LiquidSdkEvent e);
|
void on_event(SdkEvent e);
|
||||||
};
|
};
|
||||||
|
|
||||||
callback interface Logger {
|
callback interface Logger {
|
||||||
@@ -469,11 +469,11 @@ dictionary LogEntry {
|
|||||||
string level;
|
string level;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace breez_liquid_sdk {
|
namespace breez_sdk_liquid {
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
BindingLiquidSdk connect(ConnectRequest req);
|
BindingLiquidSdk connect(ConnectRequest req);
|
||||||
|
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
void set_logger(Logger logger);
|
void set_logger(Logger logger);
|
||||||
|
|
||||||
Config default_config(LiquidNetwork network);
|
Config default_config(LiquidNetwork network);
|
||||||
@@ -486,13 +486,13 @@ namespace breez_liquid_sdk {
|
|||||||
};
|
};
|
||||||
|
|
||||||
interface BindingLiquidSdk {
|
interface BindingLiquidSdk {
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
string add_event_listener(EventListener listener);
|
string add_event_listener(EventListener listener);
|
||||||
|
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
void remove_event_listener(string id);
|
void remove_event_listener(string id);
|
||||||
|
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
GetInfoResponse get_info();
|
GetInfoResponse get_info();
|
||||||
|
|
||||||
[Throws=PaymentError]
|
[Throws=PaymentError]
|
||||||
@@ -528,28 +528,28 @@ interface BindingLiquidSdk {
|
|||||||
[Throws=PaymentError]
|
[Throws=PaymentError]
|
||||||
sequence<Payment> list_payments();
|
sequence<Payment> list_payments();
|
||||||
|
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
sequence<RefundableSwap> list_refundables();
|
sequence<RefundableSwap> list_refundables();
|
||||||
|
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
PrepareRefundResponse prepare_refund(PrepareRefundRequest req);
|
PrepareRefundResponse prepare_refund(PrepareRefundRequest req);
|
||||||
|
|
||||||
[Throws=PaymentError]
|
[Throws=PaymentError]
|
||||||
RefundResponse refund(RefundRequest req);
|
RefundResponse refund(RefundRequest req);
|
||||||
|
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
void rescan_onchain_swaps();
|
void rescan_onchain_swaps();
|
||||||
|
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
void sync();
|
void sync();
|
||||||
|
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
void backup(BackupRequest req);
|
void backup(BackupRequest req);
|
||||||
|
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
void restore(RestoreRequest req);
|
void restore(RestoreRequest req);
|
||||||
|
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
void disconnect();
|
void disconnect();
|
||||||
|
|
||||||
[Throws=LnUrlPayError]
|
[Throws=LnUrlPayError]
|
||||||
@@ -561,9 +561,9 @@ interface BindingLiquidSdk {
|
|||||||
[Throws=LnUrlAuthError]
|
[Throws=LnUrlAuthError]
|
||||||
LnUrlCallbackStatus lnurl_auth(LnUrlAuthRequestData req_data);
|
LnUrlCallbackStatus lnurl_auth(LnUrlAuthRequestData req_data);
|
||||||
|
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
sequence<Rate> fetch_fiat_rates();
|
sequence<Rate> fetch_fiat_rates();
|
||||||
|
|
||||||
[Throws=LiquidSdkError]
|
[Throws=SdkError]
|
||||||
sequence<FiatCurrency> list_fiat_currencies();
|
sequence<FiatCurrency> list_fiat_currencies();
|
||||||
};
|
};
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use breez_liquid_sdk::logger::Logger;
|
use breez_sdk_liquid::logger::Logger;
|
||||||
use breez_liquid_sdk::{
|
use breez_sdk_liquid::{
|
||||||
error::*, model::*, sdk::LiquidSdk, AesSuccessActionDataDecrypted, AesSuccessActionDataResult,
|
error::*, model::*, sdk::LiquidSdk, AesSuccessActionDataDecrypted, AesSuccessActionDataResult,
|
||||||
BitcoinAddressData, CurrencyInfo, FiatCurrency, InputType, LNInvoice, LnUrlAuthError,
|
BitcoinAddressData, CurrencyInfo, FiatCurrency, InputType, LNInvoice, LnUrlAuthError,
|
||||||
LnUrlAuthRequestData, LnUrlCallbackStatus, LnUrlErrorData, LnUrlPayError, LnUrlPayErrorData,
|
LnUrlAuthRequestData, LnUrlCallbackStatus, LnUrlErrorData, LnUrlPayError, LnUrlPayErrorData,
|
||||||
@@ -39,7 +39,7 @@ impl UniffiBindingLogger {
|
|||||||
impl log::Log for UniffiBindingLogger {
|
impl log::Log for UniffiBindingLogger {
|
||||||
fn enabled(&self, m: &Metadata) -> bool {
|
fn enabled(&self, m: &Metadata) -> bool {
|
||||||
// ignore the internal uniffi log to prevent infinite loop.
|
// ignore the internal uniffi log to prevent infinite loop.
|
||||||
return m.level() <= Level::Trace && *m.target() != *"breez_liquid_sdk_bindings";
|
return m.level() <= Level::Trace && *m.target() != *"breez_sdk_liquid_bindings";
|
||||||
}
|
}
|
||||||
|
|
||||||
fn log(&self, record: &Record) {
|
fn log(&self, record: &Record) {
|
||||||
@@ -52,14 +52,14 @@ impl log::Log for UniffiBindingLogger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// If used, this must be called before `connect`
|
/// If used, this must be called before `connect`
|
||||||
pub fn set_logger(logger: Box<dyn Logger>) -> Result<(), LiquidSdkError> {
|
pub fn set_logger(logger: Box<dyn Logger>) -> Result<(), SdkError> {
|
||||||
UniffiBindingLogger::init(logger).map_err(|_| LiquidSdkError::Generic {
|
UniffiBindingLogger::init(logger).map_err(|_| SdkError::Generic {
|
||||||
err: "Logger already created".into(),
|
err: "Logger already created".into(),
|
||||||
})?;
|
})?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn connect(req: ConnectRequest) -> Result<Arc<BindingLiquidSdk>, LiquidSdkError> {
|
pub fn connect(req: ConnectRequest) -> Result<Arc<BindingLiquidSdk>, SdkError> {
|
||||||
rt().block_on(async {
|
rt().block_on(async {
|
||||||
let sdk = LiquidSdk::connect(req).await?;
|
let sdk = LiquidSdk::connect(req).await?;
|
||||||
Ok(Arc::from(BindingLiquidSdk { sdk }))
|
Ok(Arc::from(BindingLiquidSdk { sdk }))
|
||||||
@@ -82,15 +82,15 @@ pub struct BindingLiquidSdk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl BindingLiquidSdk {
|
impl BindingLiquidSdk {
|
||||||
pub fn add_event_listener(&self, listener: Box<dyn EventListener>) -> LiquidSdkResult<String> {
|
pub fn add_event_listener(&self, listener: Box<dyn EventListener>) -> SdkResult<String> {
|
||||||
rt().block_on(self.sdk.add_event_listener(listener))
|
rt().block_on(self.sdk.add_event_listener(listener))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn remove_event_listener(&self, id: String) -> LiquidSdkResult<()> {
|
pub fn remove_event_listener(&self, id: String) -> SdkResult<()> {
|
||||||
rt().block_on(self.sdk.remove_event_listener(id))
|
rt().block_on(self.sdk.remove_event_listener(id))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_info(&self) -> Result<GetInfoResponse, LiquidSdkError> {
|
pub fn get_info(&self) -> Result<GetInfoResponse, SdkError> {
|
||||||
rt().block_on(self.sdk.get_info()).map_err(Into::into)
|
rt().block_on(self.sdk.get_info()).map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,22 +178,19 @@ impl BindingLiquidSdk {
|
|||||||
rt().block_on(self.sdk.lnurl_auth(req_data))
|
rt().block_on(self.sdk.lnurl_auth(req_data))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fetch_fiat_rates(&self) -> Result<Vec<Rate>, LiquidSdkError> {
|
pub fn fetch_fiat_rates(&self) -> Result<Vec<Rate>, SdkError> {
|
||||||
rt().block_on(self.sdk.fetch_fiat_rates())
|
rt().block_on(self.sdk.fetch_fiat_rates())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn list_fiat_currencies(&self) -> Result<Vec<FiatCurrency>, LiquidSdkError> {
|
pub fn list_fiat_currencies(&self) -> Result<Vec<FiatCurrency>, SdkError> {
|
||||||
rt().block_on(self.sdk.list_fiat_currencies())
|
rt().block_on(self.sdk.list_fiat_currencies())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn list_refundables(&self) -> LiquidSdkResult<Vec<RefundableSwap>> {
|
pub fn list_refundables(&self) -> SdkResult<Vec<RefundableSwap>> {
|
||||||
rt().block_on(self.sdk.list_refundables())
|
rt().block_on(self.sdk.list_refundables())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn prepare_refund(
|
pub fn prepare_refund(&self, req: PrepareRefundRequest) -> SdkResult<PrepareRefundResponse> {
|
||||||
&self,
|
|
||||||
req: PrepareRefundRequest,
|
|
||||||
) -> LiquidSdkResult<PrepareRefundResponse> {
|
|
||||||
rt().block_on(self.sdk.prepare_refund(&req))
|
rt().block_on(self.sdk.prepare_refund(&req))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,29 +198,29 @@ impl BindingLiquidSdk {
|
|||||||
rt().block_on(self.sdk.refund(&req))
|
rt().block_on(self.sdk.refund(&req))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn rescan_onchain_swaps(&self) -> LiquidSdkResult<()> {
|
pub fn rescan_onchain_swaps(&self) -> SdkResult<()> {
|
||||||
rt().block_on(self.sdk.rescan_onchain_swaps())
|
rt().block_on(self.sdk.rescan_onchain_swaps())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn sync(&self) -> LiquidSdkResult<()> {
|
pub fn sync(&self) -> SdkResult<()> {
|
||||||
rt().block_on(self.sdk.sync()).map_err(Into::into)
|
rt().block_on(self.sdk.sync()).map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn empty_wallet_cache(&self) -> LiquidSdkResult<()> {
|
pub fn empty_wallet_cache(&self) -> SdkResult<()> {
|
||||||
self.sdk.empty_wallet_cache().map_err(Into::into)
|
self.sdk.empty_wallet_cache().map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn backup(&self, req: BackupRequest) -> LiquidSdkResult<()> {
|
pub fn backup(&self, req: BackupRequest) -> SdkResult<()> {
|
||||||
self.sdk.backup(req).map_err(Into::into)
|
self.sdk.backup(req).map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn restore(&self, req: RestoreRequest) -> LiquidSdkResult<()> {
|
pub fn restore(&self, req: RestoreRequest) -> SdkResult<()> {
|
||||||
self.sdk.restore(req).map_err(Into::into)
|
self.sdk.restore(req).map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn disconnect(&self) -> LiquidSdkResult<()> {
|
pub fn disconnect(&self) -> SdkResult<()> {
|
||||||
rt().block_on(self.sdk.disconnect())
|
rt().block_on(self.sdk.disconnect())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uniffi::include_scaffolding!("breez_liquid_sdk");
|
uniffi::include_scaffolding!("breez_sdk_liquid");
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
|
|
||||||
class SDKListener: breez_liquid_sdk.EventListener {
|
class SDKListener: breez_sdk_liquid.EventListener {
|
||||||
override fun onEvent(e: breez_liquid_sdk.LiquidSdkEvent) {
|
override fun onEvent(e: breez_sdk_liquid.SdkEvent) {
|
||||||
println(e.toString());
|
println(e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
|
var mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
|
||||||
var config = breez_liquid_sdk.defaultConfig(breez_liquid_sdk.LiquidNetwork.TESTNET)
|
var config = breez_sdk_liquid.defaultConfig(breez_sdk_liquid.LiquidNetwork.TESTNET)
|
||||||
var connectRequest = breez_liquid_sdk.ConnectRequest(config, mnemonic)
|
var connectRequest = breez_sdk_liquid.ConnectRequest(config, mnemonic)
|
||||||
var sdk = breez_liquid_sdk.connect(connectRequest)
|
var sdk = breez_sdk_liquid.connect(connectRequest)
|
||||||
|
|
||||||
var listenerId = sdk.addEventListener(SDKListener())
|
var listenerId = sdk.addEventListener(SDKListener())
|
||||||
|
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
import breez_liquid_sdk
|
import breez_sdk_liquid
|
||||||
|
|
||||||
|
|
||||||
class SDKListener(breez_liquid_sdk.EventListener):
|
class SDKListener(breez_sdk_liquid.EventListener):
|
||||||
def on_event(self, event):
|
def on_event(self, event):
|
||||||
print(event)
|
print(event)
|
||||||
|
|
||||||
|
|
||||||
def test():
|
def test():
|
||||||
mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
|
mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
|
||||||
config = breez_liquid_sdk.default_config(breez_liquid_sdk.LiquidNetwork.TESTNET)
|
config = breez_sdk_liquid.default_config(breez_sdk_liquid.LiquidNetwork.TESTNET)
|
||||||
connect_request = breez_liquid_sdk.ConnectRequest(config=config, mnemonic=mnemonic)
|
connect_request = breez_sdk_liquid.ConnectRequest(config=config, mnemonic=mnemonic)
|
||||||
sdk = breez_liquid_sdk.connect(connect_request)
|
sdk = breez_sdk_liquid.connect(connect_request)
|
||||||
|
|
||||||
listener_id = sdk.add_event_listener(SDKListener())
|
listener_id = sdk.add_event_listener(SDKListener())
|
||||||
|
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
import breez_liquid_sdk
|
import breez_sdk_liquid
|
||||||
|
|
||||||
class SDKListener: EventListener {
|
class SDKListener: EventListener {
|
||||||
func onEvent(e: LiquidSdkEvent) {
|
func onEvent(e: SdkEvent) {
|
||||||
print("Received event ", e);
|
print("Received event ", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";
|
let mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";
|
||||||
let config = breez_liquid_sdk.defaultConfig(network: .testnet);
|
let config = breez_sdk_liquid.defaultConfig(network: .testnet);
|
||||||
let connectRequest = breez_liquid_sdk.ConnectRequest(config: config, mnemonic: mnemonic);
|
let connectRequest = breez_sdk_liquid.ConnectRequest(config: config, mnemonic: mnemonic);
|
||||||
let sdk = try breez_liquid_sdk.connect(req: connectRequest);
|
let sdk = try breez_sdk_liquid.connect(req: connectRequest);
|
||||||
|
|
||||||
let listenerId = try sdk.addEventListener(listener: SDKListener());
|
let listenerId = try sdk.addEventListener(listener: SDKListener());
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
uniffi::build_foreign_language_testcases!(
|
uniffi::build_foreign_language_testcases!(
|
||||||
"tests/bindings/test_breez_liquid_sdk.swift",
|
"tests/bindings/test_breez_sdk_liquid.swift",
|
||||||
"tests/bindings/test_breez_liquid_sdk.kts",
|
"tests/bindings/test_breez_sdk_liquid.kts",
|
||||||
"tests/bindings/test_breez_liquid_sdk.py"
|
"tests/bindings/test_breez_sdk_liquid.py"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use uniffi_bindgen_kotlin_multiplatform::KotlinBindingGenerator;
|
|||||||
fn main() {
|
fn main() {
|
||||||
uniffi::uniffi_bindgen_main();
|
uniffi::uniffi_bindgen_main();
|
||||||
|
|
||||||
let udl_file = "./src/breez_liquid_sdk.udl";
|
let udl_file = "./src/breez_sdk_liquid.udl";
|
||||||
let out_dir = Utf8Path::new("ffi/kmp");
|
let out_dir = Utf8Path::new("ffi/kmp");
|
||||||
let config = Utf8Path::new("uniffi.toml");
|
let config = Utf8Path::new("uniffi.toml");
|
||||||
uniffi_bindgen::generate_external_bindings(
|
uniffi_bindgen::generate_external_bindings(
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# https://mozilla.github.io/uniffi-rs/swift/configuration.html
|
# https://mozilla.github.io/uniffi-rs/swift/configuration.html
|
||||||
[bindings.swift]
|
[bindings.swift]
|
||||||
cdylib_name = "breez_liquid_sdk_bindings"
|
cdylib_name = "breez_sdk_liquid_bindings"
|
||||||
|
|
||||||
# https://mozilla.github.io/uniffi-rs/kotlin/configuration.html
|
# https://mozilla.github.io/uniffi-rs/kotlin/configuration.html
|
||||||
[bindings.kotlin]
|
[bindings.kotlin]
|
||||||
package_name = "breez_liquid_sdk"
|
package_name = "breez_sdk_liquid"
|
||||||
cdylib_name = "breez_liquid_sdk_bindings"
|
cdylib_name = "breez_sdk_liquid_bindings"
|
||||||
|
|
||||||
# https://mozilla.github.io/uniffi-rs/python/configuration.html
|
# https://mozilla.github.io/uniffi-rs/python/configuration.html
|
||||||
[bindings.python]
|
[bindings.python]
|
||||||
cdylib_name = "breez_liquid_sdk_bindings"
|
cdylib_name = "breez_sdk_liquid_bindings"
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "breez-liquid-sdk"
|
name = "breez-sdk-liquid"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "breez_liquid_sdk"
|
name = "breez_sdk_liquid"
|
||||||
crate-type = ["lib", "cdylib", "staticlib"]
|
crate-type = ["lib", "cdylib", "staticlib"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ pub use sdk_common::prelude::{
|
|||||||
use crate::{error::*, frb_generated::StreamSink, model::*, sdk::LiquidSdk};
|
use crate::{error::*, frb_generated::StreamSink, model::*, sdk::LiquidSdk};
|
||||||
|
|
||||||
pub struct BindingEventListener {
|
pub struct BindingEventListener {
|
||||||
pub stream: StreamSink<LiquidSdkEvent>,
|
pub stream: StreamSink<SdkEvent>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EventListener for BindingEventListener {
|
impl EventListener for BindingEventListener {
|
||||||
fn on_event(&self, e: LiquidSdkEvent) {
|
fn on_event(&self, e: SdkEvent) {
|
||||||
let _ = self.stream.add(e);
|
let _ = self.stream.add(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,14 +53,14 @@ impl log::Log for DartBindingLogger {
|
|||||||
fn flush(&self) {}
|
fn flush(&self) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn connect(req: ConnectRequest) -> Result<BindingLiquidSdk, LiquidSdkError> {
|
pub async fn connect(req: ConnectRequest) -> Result<BindingLiquidSdk, SdkError> {
|
||||||
let ln_sdk = LiquidSdk::connect(req).await?;
|
let ln_sdk = LiquidSdk::connect(req).await?;
|
||||||
Ok(BindingLiquidSdk { sdk: ln_sdk })
|
Ok(BindingLiquidSdk { sdk: ln_sdk })
|
||||||
}
|
}
|
||||||
|
|
||||||
/// If used, this must be called before `connect`. It can only be called once.
|
/// If used, this must be called before `connect`. It can only be called once.
|
||||||
pub fn breez_log_stream(s: StreamSink<LogEntry>) -> Result<()> {
|
pub fn breez_log_stream(s: StreamSink<LogEntry>) -> Result<()> {
|
||||||
DartBindingLogger::init(s).map_err(|_| LiquidSdkError::Generic {
|
DartBindingLogger::init(s).map_err(|_| SdkError::Generic {
|
||||||
err: "Log stream already created".into(),
|
err: "Log stream already created".into(),
|
||||||
})?;
|
})?;
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -85,14 +85,14 @@ pub struct BindingLiquidSdk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl BindingLiquidSdk {
|
impl BindingLiquidSdk {
|
||||||
pub async fn get_info(&self) -> Result<GetInfoResponse, LiquidSdkError> {
|
pub async fn get_info(&self) -> Result<GetInfoResponse, SdkError> {
|
||||||
self.sdk.get_info().await.map_err(Into::into)
|
self.sdk.get_info().await.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn add_event_listener(
|
pub async fn add_event_listener(
|
||||||
&self,
|
&self,
|
||||||
listener: StreamSink<LiquidSdkEvent>,
|
listener: StreamSink<SdkEvent>,
|
||||||
) -> Result<String, LiquidSdkError> {
|
) -> Result<String, SdkError> {
|
||||||
self.sdk
|
self.sdk
|
||||||
.add_event_listener(Box::new(BindingEventListener { stream: listener }))
|
.add_event_listener(Box::new(BindingEventListener { stream: listener }))
|
||||||
.await
|
.await
|
||||||
@@ -197,22 +197,22 @@ impl BindingLiquidSdk {
|
|||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn fetch_fiat_rates(&self) -> Result<Vec<Rate>, LiquidSdkError> {
|
pub async fn fetch_fiat_rates(&self) -> Result<Vec<Rate>, SdkError> {
|
||||||
self.sdk.fetch_fiat_rates().await
|
self.sdk.fetch_fiat_rates().await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn list_fiat_currencies(&self) -> Result<Vec<FiatCurrency>, LiquidSdkError> {
|
pub async fn list_fiat_currencies(&self) -> Result<Vec<FiatCurrency>, SdkError> {
|
||||||
self.sdk.list_fiat_currencies().await
|
self.sdk.list_fiat_currencies().await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn list_refundables(&self) -> Result<Vec<RefundableSwap>, LiquidSdkError> {
|
pub async fn list_refundables(&self) -> Result<Vec<RefundableSwap>, SdkError> {
|
||||||
self.sdk.list_refundables().await
|
self.sdk.list_refundables().await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn prepare_refund(
|
pub async fn prepare_refund(
|
||||||
&self,
|
&self,
|
||||||
req: PrepareRefundRequest,
|
req: PrepareRefundRequest,
|
||||||
) -> Result<PrepareRefundResponse, LiquidSdkError> {
|
) -> Result<PrepareRefundResponse, SdkError> {
|
||||||
self.sdk.prepare_refund(&req).await
|
self.sdk.prepare_refund(&req).await
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,30 +220,30 @@ impl BindingLiquidSdk {
|
|||||||
self.sdk.refund(&req).await
|
self.sdk.refund(&req).await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn rescan_onchain_swaps(&self) -> Result<(), LiquidSdkError> {
|
pub async fn rescan_onchain_swaps(&self) -> Result<(), SdkError> {
|
||||||
self.sdk.rescan_onchain_swaps().await
|
self.sdk.rescan_onchain_swaps().await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn sync(&self) -> Result<(), LiquidSdkError> {
|
pub async fn sync(&self) -> Result<(), SdkError> {
|
||||||
self.sdk.sync().await.map_err(Into::into)
|
self.sdk.sync().await.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[frb(sync)]
|
#[frb(sync)]
|
||||||
pub fn empty_wallet_cache(&self) -> Result<(), LiquidSdkError> {
|
pub fn empty_wallet_cache(&self) -> Result<(), SdkError> {
|
||||||
self.sdk.empty_wallet_cache().map_err(Into::into)
|
self.sdk.empty_wallet_cache().map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[frb(sync)]
|
#[frb(sync)]
|
||||||
pub fn backup(&self, req: BackupRequest) -> Result<(), LiquidSdkError> {
|
pub fn backup(&self, req: BackupRequest) -> Result<(), SdkError> {
|
||||||
self.sdk.backup(req).map_err(Into::into)
|
self.sdk.backup(req).map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[frb(sync)]
|
#[frb(sync)]
|
||||||
pub fn restore(&self, req: RestoreRequest) -> Result<(), LiquidSdkError> {
|
pub fn restore(&self, req: RestoreRequest) -> Result<(), SdkError> {
|
||||||
self.sdk.restore(req).map_err(Into::into)
|
self.sdk.restore(req).map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn disconnect(&self) -> Result<(), LiquidSdkError> {
|
pub async fn disconnect(&self) -> Result<(), SdkError> {
|
||||||
self.sdk.disconnect().await
|
self.sdk.disconnect().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user