From 4219e1bb4027919c66a97ddcd6d6dd5d5e55fbe3 Mon Sep 17 00:00:00 2001 From: Ross Savage Date: Wed, 12 Mar 2025 18:23:55 +0100 Subject: [PATCH 1/2] Add seed option to ConnectRequest --- .github/workflows/main.yml | 8 +- examples/python/cli/pyproject.toml | 2 +- snippets/dart_snippets/pubspec.lock | 8 +- snippets/dart_snippets/pubspec.yaml | 4 +- snippets/go/getting_started.go | 2 +- snippets/go/go.mod | 2 +- snippets/go/parsing_inputs.go | 2 +- .../kotlin_mpp_lib/shared/build.gradle.kts | 2 +- snippets/react-native/package.json | 2 +- snippets/react-native/yarn.lock | 8 +- snippets/rust/Cargo.lock | 635 +++++++++--------- snippets/rust/Cargo.toml | 2 +- snippets/rust/src/getting_started.rs | 3 +- snippets/rust/src/parsing_inputs.rs | 3 +- .../swift/BreezSDKExamples/Package.resolved | 4 +- snippets/swift/BreezSDKExamples/Package.swift | 2 +- src/guide/install.md | 2 +- 17 files changed, 344 insertions(+), 347 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 19b41d6b..27fb9ccd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,10 +11,10 @@ on: workflow_dispatch: inputs: sdk-ref: - description: 'sdk commit/tag/branch reference. Defaults to 0.7.0-rc5' + description: 'sdk commit/tag/branch reference. Defaults to 0.7.2' required: false type: string - default: 0.7.0-rc5 + default: 0.7.2 concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -26,9 +26,9 @@ jobs: runs-on: ubuntu-latest outputs: # Used only for Rust snippets - sdk-ref: ${{ inputs.sdk-ref || '0.7.0-rc5' }} + sdk-ref: ${{ inputs.sdk-ref || '0.7.2' }} # Used for RN and Flutter snippets - package-version: '0.7.0-rc5' + package-version: '0.7.2' steps: - run: echo "set pre-setup output variables" diff --git a/examples/python/cli/pyproject.toml b/examples/python/cli/pyproject.toml index c6cf75b1..529de012 100644 --- a/examples/python/cli/pyproject.toml +++ b/examples/python/cli/pyproject.toml @@ -7,7 +7,7 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.8.1" -breez-sdk-liquid = "0.7.0-rc5" +breez-sdk-liquid = "0.7.2" argparse = "^1.4.0" qrcode = "^7.4.2" colorama = "^0.4.6" diff --git a/snippets/dart_snippets/pubspec.lock b/snippets/dart_snippets/pubspec.lock index d6698d2e..9f974e8b 100644 --- a/snippets/dart_snippets/pubspec.lock +++ b/snippets/dart_snippets/pubspec.lock @@ -46,10 +46,10 @@ packages: description: path: "." ref: HEAD - resolved-ref: "0647370f6a2dc26a52f609b942cb3d93f765adae" + resolved-ref: "3111663fbc91aa918a9b44f7deadaf97f94462b9" url: "https://github.com/breez/breez-sdk-liquid-dart" source: git - version: "0.7.0-rc5" + version: "0.7.2" build_cli_annotations: dependency: transitive description: @@ -140,10 +140,10 @@ packages: description: path: "." ref: HEAD - resolved-ref: "22538ed87b3ad34faeb4c60f0defa10b56235093" + resolved-ref: "3635ca4abebd2ccd5455e1112eaa46cee10888d6" url: "https://github.com/breez/breez-sdk-liquid-flutter" source: git - version: "0.7.0-rc5" + version: "0.7.2" flutter_rust_bridge: dependency: transitive description: diff --git a/snippets/dart_snippets/pubspec.yaml b/snippets/dart_snippets/pubspec.yaml index 4857db6e..51f6e457 100644 --- a/snippets/dart_snippets/pubspec.yaml +++ b/snippets/dart_snippets/pubspec.yaml @@ -10,11 +10,11 @@ dependencies: breez_liquid: git: url: https://github.com/breez/breez-sdk-liquid-dart - tag: 0.7.0-rc5 + tag: 0.7.2 flutter_breez_liquid: git: url: https://github.com/breez/breez-sdk-liquid-flutter - tag: 0.7.0-rc5 + tag: 0.7.2 rxdart: ^0.28.0 dependency_overrides: diff --git a/snippets/go/getting_started.go b/snippets/go/getting_started.go index f49fc6d8..cbc333f6 100644 --- a/snippets/go/getting_started.go +++ b/snippets/go/getting_started.go @@ -22,7 +22,7 @@ func Start() (*breez_sdk_liquid.BindingLiquidSdk, error) { connectRequest := breez_sdk_liquid.ConnectRequest{ Config: config, - Mnemonic: mnemonic, + Mnemonic: &mnemonic, } sdk, err := breez_sdk_liquid.Connect(connectRequest) diff --git a/snippets/go/go.mod b/snippets/go/go.mod index 2914a468..a3fc820b 100644 --- a/snippets/go/go.mod +++ b/snippets/go/go.mod @@ -2,7 +2,7 @@ module main go 1.19 -require github.com/breez/breez-sdk-liquid-go v0.7.0-rc5 +require github.com/breez/breez-sdk-liquid-go v0.7.2 // Comment out to use published module replace github.com/breez/breez-sdk-liquid-go => ./packages/breez-sdk-liquid-go diff --git a/snippets/go/parsing_inputs.go b/snippets/go/parsing_inputs.go index add06331..1427fe4b 100644 --- a/snippets/go/parsing_inputs.go +++ b/snippets/go/parsing_inputs.go @@ -66,7 +66,7 @@ func ConfigureParsers() (*breez_sdk_liquid.BindingLiquidSdk, error) { connectRequest := breez_sdk_liquid.ConnectRequest{ Config: config, - Mnemonic: mnemonic, + Mnemonic: &mnemonic, } sdk, err := breez_sdk_liquid.Connect(connectRequest) diff --git a/snippets/kotlin_mpp_lib/shared/build.gradle.kts b/snippets/kotlin_mpp_lib/shared/build.gradle.kts index 63dec01e..d07e7267 100644 --- a/snippets/kotlin_mpp_lib/shared/build.gradle.kts +++ b/snippets/kotlin_mpp_lib/shared/build.gradle.kts @@ -29,7 +29,7 @@ kotlin { } val commonMain by getting { dependencies { - implementation("technology.breez.liquid:breez-sdk-liquid-kmp:0.7.0-rc5") + implementation("technology.breez.liquid:breez-sdk-liquid-kmp:0.7.2") } } } diff --git a/snippets/react-native/package.json b/snippets/react-native/package.json index e04fc589..b530cf5d 100644 --- a/snippets/react-native/package.json +++ b/snippets/react-native/package.json @@ -10,7 +10,7 @@ "compile": "tsc" }, "dependencies": { - "@breeztech/react-native-breez-sdk-liquid": "^0.7.0-rc5", + "@breeztech/react-native-breez-sdk-liquid": "^0.7.2", "react": "18.1.0", "react-native": "0.70.6" }, diff --git a/snippets/react-native/yarn.lock b/snippets/react-native/yarn.lock index a9c2f89c..d982c418 100644 --- a/snippets/react-native/yarn.lock +++ b/snippets/react-native/yarn.lock @@ -670,10 +670,10 @@ "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" -"@breeztech/react-native-breez-sdk-liquid@^0.7.0-rc5": - version "0.7.0-rc5" - resolved "https://registry.yarnpkg.com/@breeztech/react-native-breez-sdk-liquid/-/react-native-breez-sdk-liquid-0.7.0-rc5.tgz#17182ccd7b942f79d2fded76d11e363aaab2fdd4" - integrity sha512-asVf9YCjZLwV+ao9/80yhdrecPAvHd4SQt1/5uMQj7B08FLMU3fXppe8HAIyz2bsLULs2vqah5D5P7Dc4sEg9Q== +"@breeztech/react-native-breez-sdk-liquid@^0.7.2": + version "0.7.2" + resolved "https://registry.yarnpkg.com/@breeztech/react-native-breez-sdk-liquid/-/react-native-breez-sdk-liquid-0.7.2.tgz#cb5dfe2fccbe8fe413640d2a2aaf55b613ff13f1" + integrity sha512-sPQ0J1wnOm3m7cHXpbxiSUL+xCT4BWCtT4Y/WdWXrQQFIXi/FUYkUnxpS4EMkFTPrvj7OjQSvrevSjL3X2lwWw== "@esbuild/android-arm64@0.18.20": version "0.18.20" diff --git a/snippets/rust/Cargo.lock b/snippets/rust/Cargo.lock index c65013a0..a9a128cd 100644 --- a/snippets/rust/Cargo.lock +++ b/snippets/rust/Cargo.lock @@ -33,7 +33,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cipher", "cpufeatures", ] @@ -110,18 +110,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.3" @@ -453,7 +441,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", "object", @@ -687,21 +675,10 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "829a082bd3761fde7476dc2ed85ca56c11628948460ece621e4f56fef5046567" -[[package]] -name = "bollard-stubs" -version = "1.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2f2e73fffe9455141e170fb9c1feb0ac521ec7e7dcd47a7cab72a658490fb8" -dependencies = [ - "chrono", - "serde", - "serde_with", -] - [[package]] name = "boltz-client" version = "0.2.0" -source = "git+https://github.com/hydra-yse/boltz-rust?rev=5c2a7aebd1669d599d76e782952b876a901bfb05#5c2a7aebd1669d599d76e782952b876a901bfb05" +source = "git+https://github.com/SatoshiPortal/boltz-rust?rev=12c9e546f15706b563ba7e49f2be7e8a5e7ada90#12c9e546f15706b563ba7e49f2be7e8a5e7ada90" dependencies = [ "bip39", "bitcoin 0.32.5", @@ -721,14 +698,15 @@ dependencies = [ [[package]] name = "breez-sdk-liquid" -version = "0.7.0-rc5" -source = "git+https://github.com/breez/breez-sdk-liquid?tag=0.7.0-rc5#d6b8b572dc921ff1f3560bf3c89fe3eaa1a27815" +version = "0.7.2" +source = "git+https://github.com/breez/breez-sdk-liquid?tag=0.7.2#d564a8308ce24a953f046a2de089e9a961db28a3" dependencies = [ "anyhow", "async-trait", "bip39", "boltz-client", "chrono", + "console_log", "derivative", "ecies", "electrum-client", @@ -742,12 +720,13 @@ dependencies = [ "lwk_common", "lwk_signer", "lwk_wollet", - "openssl", + "maybe-sync", "prost 0.13.4", - "reqwest 0.11.20", + "reqwest", "rusqlite", "rusqlite_migration", "sdk-common", + "sdk-macros", "security-framework", "security-framework-sys", "semver", @@ -763,6 +742,7 @@ dependencies = [ "tonic 0.12.3", "tonic-build 0.12.3", "url", + "uuid", "x509-parser", "zbase32", ] @@ -815,6 +795,12 @@ dependencies = [ "shlex", ] +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + [[package]] name = "cfg-if" version = "1.0.0" @@ -833,7 +819,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cipher", "cpufeatures", ] @@ -861,7 +847,6 @@ dependencies = [ "iana-time-zone", "js-sys", "num-traits", - "serde", "wasm-bindgen", "windows-targets 0.52.6", ] @@ -877,6 +862,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "colorchoice" version = "1.0.3" @@ -889,10 +883,20 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "wasm-bindgen", ] +[[package]] +name = "console_log" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8aed40e4edbf4d3b4431ab260b63fdc40f5780a4766824329ea0f1eefe3c0f" +dependencies = [ + "log", + "web-sys", +] + [[package]] name = "cookie-factory" version = "0.3.3" @@ -933,7 +937,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -980,7 +984,7 @@ version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "curve25519-dalek-derive", "fiat-crypto", @@ -1000,41 +1004,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core", - "quote", - "syn 1.0.109", -] - [[package]] name = "dart-sys" version = "4.1.5" @@ -1050,7 +1019,7 @@ version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "num_cpus", ] @@ -1060,10 +1029,10 @@ version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "crossbeam-utils", "hashbrown 0.14.5", - "lock_api", + "lock_api 0.4.12", "once_cell", "parking_lot_core 0.9.10", ] @@ -1150,6 +1119,16 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "dns-parser" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea" +dependencies = [ + "byteorder", + "quick-error", +] + [[package]] name = "ecies" version = "0.2.7" @@ -1222,7 +1201,7 @@ version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -1394,9 +1373,9 @@ dependencies = [ [[package]] name = "flutter_rust_bridge" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419323ff3ae8b63ed20b7cd0fd0e3e73fa9234b3b212b87b5586fe76ae52318" +checksum = "fdc62f583dff79c7ea34b775b2cc4158adc17cb69ad4c1d276be7fe95c63d597" dependencies = [ "allo-isolate", "android_logger", @@ -1424,9 +1403,9 @@ dependencies = [ [[package]] name = "flutter_rust_bridge_macros" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c6fd06cacc0dfe931d00f3acdc5ac6c5dd9382b33dd78d71cce8f0a62e9458b" +checksum = "ac75354933904c334c13a7c9e08c65be528f0820ab587e03f255203a28d5efec" dependencies = [ "hex", "md-5", @@ -1441,6 +1420,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1465,6 +1450,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fragile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" + [[package]] name = "futures" version = "0.3.31" @@ -1579,7 +1570,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -1592,7 +1583,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "wasi 0.13.3+wasi-0.2.2", "windows-targets 0.52.6", @@ -1658,12 +1649,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "half" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" - [[package]] name = "hashbrown" version = "0.12.3" @@ -1675,23 +1660,23 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", -] [[package]] name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "foldhash", +] [[package]] name = "hashlink" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.2", ] [[package]] @@ -1755,7 +1740,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "447afdcdb8afb9d0a852af6dc65d9b285ce720ed7a59e42a8bf2e931c67bc1b5" dependencies = [ "async-trait", - "cfg-if", + "cfg-if 1.0.0", "data-encoding", "enum-as-inner", "futures-channel", @@ -1779,7 +1764,7 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a2e2aba9c389ce5267d31cf1e4dace82390ae276b0b364ea55630b1fa1b44b4" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "futures-util", "hickory-proto", "ipconfig", @@ -2005,15 +1990,18 @@ dependencies = [ [[package]] name = "hyper-tls" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", - "hyper 0.14.32", + "http-body-util", + "hyper 1.6.0", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", ] [[package]] @@ -2084,7 +2072,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.98", "unic-langid", ] @@ -2243,12 +2231,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "1.0.3" @@ -2300,15 +2282,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - [[package]] name = "intl-memoizer" version = "0.5.2" @@ -2463,9 +2436,8 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f" +version = "0.31.0" +source = "git+https://github.com/Spxg/rusqlite?rev=e36644127f31fa6e7ea0999b59432deb4a07f220#e36644127f31fa6e7ea0999b59432deb4a07f220" dependencies = [ "cc", "pkg-config", @@ -2558,6 +2530,15 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard", +] + [[package]] name = "lock_api" version = "0.4.12" @@ -2598,41 +2579,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "lwk_containers" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f88c9817902800ee931cc42ef91df10df1e98fdb14848c07996463b4c711f80" -dependencies = [ - "bitcoin 0.32.5", - "rand", - "tempfile", - "testcontainers", -] - -[[package]] -name = "lwk_jade" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237fb37f329df999a3f503536da0de035332256c821bc341cf4644590a8057c8" -dependencies = [ - "elements", - "elements-miniscript", - "hex", - "log", - "lwk_common", - "lwk_containers", - "rand", - "reqwest 0.12.12", - "serde", - "serde_bytes", - "serde_cbor", - "serde_json", - "tempfile", - "thiserror 1.0.69", - "wasm-timer", -] - [[package]] name = "lwk_signer" version = "0.8.0" @@ -2643,7 +2589,6 @@ dependencies = [ "bip39", "elements-miniscript", "lwk_common", - "lwk_jade", "thiserror 1.0.69", ] @@ -2668,7 +2613,7 @@ dependencies = [ "once_cell", "rand", "regex-lite", - "reqwest 0.12.12", + "reqwest", "serde", "serde_json", "thiserror 1.0.69", @@ -2690,13 +2635,22 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +[[package]] +name = "maybe-sync" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7551d6fcc47ecf769e6c8b2e5dd7f56f90361d3d1360e3a280c8d0d7c8e680b7" +dependencies = [ + "parking_lot 0.10.2", +] + [[package]] name = "md-5" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "digest 0.10.7", ] @@ -2883,7 +2837,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61cfb4e166a8bb8c9b55c500bc2308550148ece889be90f609377e58140f42c6" dependencies = [ "bitflags 2.8.0", - "cfg-if", + "cfg-if 1.0.0", "foreign-types", "libc", "once_cell", @@ -2943,13 +2897,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.11.2" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", + "lock_api 0.3.4", + "parking_lot_core 0.7.3", ] [[package]] @@ -2958,20 +2911,20 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ - "lock_api", + "lock_api 0.4.12", "parking_lot_core 0.9.10", ] [[package]] name = "parking_lot_core" -version = "0.8.6" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +checksum = "b93f386bb233083c799e6e642a9d73db98c24a5deeb95ffc85bf281255dffc98" dependencies = [ - "cfg-if", - "instant", + "cfg-if 0.1.10", + "cloudabi", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.1.57", "smallvec", "winapi", ] @@ -2982,7 +2935,7 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "redox_syscall 0.5.8", "smallvec", @@ -3076,7 +3029,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "opaque-debug", "universal-hash", @@ -3374,12 +3327,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" @@ -3427,46 +3377,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.11.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" -dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.32", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - -[[package]] -name = "reqwest" -version = "0.12.12" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" +checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254" dependencies = [ "base64 0.22.1", "bytes", @@ -3480,11 +3393,13 @@ dependencies = [ "http-body-util", "hyper 1.6.0", "hyper-rustls", + "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -3498,6 +3413,7 @@ dependencies = [ "sync_wrapper 1.0.2", "system-configuration", "tokio", + "tokio-native-tls", "tokio-rustls 0.26.1", "tower 0.5.2", "tower-service", @@ -3541,7 +3457,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "cfg-if", + "cfg-if 1.0.0", "getrandom 0.2.14", "libc", "spin 0.9.8", @@ -3551,9 +3467,8 @@ dependencies = [ [[package]] name = "rusqlite" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b838eba278d213a8beaf485bd313fd580ca4505a00d5871caeb1457c55322cae" +version = "0.33.0" +source = "git+https://github.com/Spxg/rusqlite?rev=e36644127f31fa6e7ea0999b59432deb4a07f220#e36644127f31fa6e7ea0999b59432deb4a07f220" dependencies = [ "bitflags 2.8.0", "fallible-iterator", @@ -3561,13 +3476,13 @@ dependencies = [ "hashlink", "libsqlite3-sys", "smallvec", + "sqlite-wasm-rs", ] [[package]] name = "rusqlite_migration" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55709bc01054c69e2f1cefdc886642b5e6376a8db3c86f761be0c423eebf178b" +version = "1.3.1" +source = "git+https://github.com/hydra-yse/rusqlite_migration?branch=rusqlite-v0.33.0#b18181b61b4c26549dff9f309e04915b6d2c39a7" dependencies = [ "log", "rusqlite", @@ -3802,15 +3717,18 @@ dependencies = [ [[package]] name = "sdk-common" version = "0.6.2" -source = "git+https://github.com/breez/breez-sdk?rev=5a20b38b4c3b574282e8d6e5a61750bb7f4bebed#5a20b38b4c3b574282e8d6e5a61750bb7f4bebed" +source = "git+https://github.com/breez/breez-sdk?rev=6c0cf15425f2ef83ade52976dbd88e8a75e73cf9#6c0cf15425f2ef83ade52976dbd88e8a75e73cf9" dependencies = [ "aes", "anyhow", + "async-trait", "base64 0.13.1", "bip21", "bitcoin 0.29.2", "cbc", + "dns-parser", "elements", + "getrandom 0.2.14", "hex", "hickory-resolver", "lazy_static", @@ -3820,18 +3738,34 @@ dependencies = [ "log", "percent-encoding", "prost 0.11.9", + "prost 0.13.4", "querystring", "regex", - "reqwest 0.11.20", + "reqwest", + "sdk-macros", "serde", "serde_json", "strum_macros", "thiserror 1.0.69", "tokio", + "tonic 0.12.3", "tonic 0.8.3", + "tonic-build 0.12.3", "tonic-build 0.8.4", + "tonic-web-wasm-client", "url", "urlencoding", + "wasm-bindgen", +] + +[[package]] +name = "sdk-macros" +version = "0.6.2" +source = "git+https://github.com/breez/breez-sdk?rev=6c0cf15425f2ef83ade52976dbd88e8a75e73cf9#6c0cf15425f2ef83ade52976dbd88e8a75e73cf9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", ] [[package]] @@ -3957,25 +3891,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde_bytes" -version = "0.11.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.217" @@ -4011,35 +3926,13 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_with" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" -dependencies = [ - "serde", - "serde_with_macros", -] - -[[package]] -name = "serde_with_macros" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "sha1" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest 0.10.7", ] @@ -4050,7 +3943,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest 0.10.7", ] @@ -4061,15 +3954,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - [[package]] name = "slab" version = "0.4.9" @@ -4108,16 +3992,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "sqlite-wasm-rs" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "84473e8335ed2f167c6f8040970d976990fb66aa62292ae58735de6d61ecfb73" +dependencies = [ + "fragile", + "js-sys", + "once_cell", + "parking_lot 0.12.3", + "thiserror 2.0.11", + "tokio", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "xshell", +] [[package]] -name = "strsim" -version = "0.10.0" +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "strsim" @@ -4225,7 +4121,7 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "fastrand", "getrandom 0.3.1", "once_cell", @@ -4242,23 +4138,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "testcontainers" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e2b1567ca8a2b819ea7b28c92be35d9f76fb9edb214321dcc86eb96023d1f87" -dependencies = [ - "bollard-stubs", - "futures", - "hex", - "hmac", - "log", - "rand", - "serde", - "serde_json", - "sha2", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -4374,9 +4253,7 @@ dependencies = [ "bytes", "libc", "mio", - "parking_lot 0.12.3", "pin-project-lite", - "signal-hook-registry", "socket2", "tokio-macros", "windows-sys 0.52.0", @@ -4578,6 +4455,31 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "tonic-web-wasm-client" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8957be1a1c7aa12d4c9d67882060dd57aed816bbc553fa60949312e839f4a8ea" +dependencies = [ + "base64 0.22.1", + "byteorder", + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "httparse", + "js-sys", + "pin-project", + "thiserror 1.0.69", + "tonic 0.12.3", + "tower-service", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + [[package]] name = "tower" version = "0.4.13" @@ -4823,6 +4725,17 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "uuid" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" +dependencies = [ + "getrandom 0.3.1", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "vcpkg" version = "0.2.15" @@ -4875,7 +4788,7 @@ version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "once_cell", "rustversion", "wasm-bindgen-macro", @@ -4901,7 +4814,7 @@ version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "once_cell", "wasm-bindgen", @@ -4941,15 +4854,13 @@ dependencies = [ ] [[package]] -name = "wasm-timer" -version = "0.2.5" +name = "wasm-streams" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ - "futures", + "futures-util", "js-sys", - "parking_lot 0.11.2", - "pin-utils", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -5049,7 +4960,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -5067,34 +4978,39 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-link" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" + [[package]] name = "windows-registry" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" dependencies = [ "windows-result", "windows-strings", - "windows-targets 0.52.6", + "windows-targets 0.53.0", ] [[package]] name = "windows-result" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" dependencies = [ - "windows-targets 0.52.6", + "windows-link", ] [[package]] name = "windows-strings" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" dependencies = [ - "windows-result", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -5148,13 +5064,29 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -5167,6 +5099,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -5179,6 +5117,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -5191,12 +5135,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -5209,6 +5165,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -5221,6 +5183,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -5233,6 +5201,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -5245,13 +5219,19 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winreg" version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "windows-sys 0.48.0", ] @@ -5305,6 +5285,21 @@ dependencies = [ "time", ] +[[package]] +name = "xshell" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e7290c623014758632efe00737145b6867b66292c42167f2ec381eb566a373d" +dependencies = [ + "xshell-macros", +] + +[[package]] +name = "xshell-macros" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ac00cd3f8ec9c1d33fb3e7958a82df6989c42d747bd326c822b1d625283547" + [[package]] name = "yoke" version = "0.7.5" diff --git a/snippets/rust/Cargo.toml b/snippets/rust/Cargo.toml index 1e717ff7..a59937d0 100644 --- a/snippets/rust/Cargo.toml +++ b/snippets/rust/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] anyhow = "1" bip39 = { version = "2", features = ["rand"] } -breez-sdk-liquid = { git = "https://github.com/breez/breez-sdk-liquid", tag = "0.7.0-rc5" } +breez-sdk-liquid = { git = "https://github.com/breez/breez-sdk-liquid", tag = "0.7.2" } log = "0.4" tokio = "1.42.0" diff --git a/snippets/rust/src/getting_started.rs b/snippets/rust/src/getting_started.rs index 28860e8e..6547df65 100644 --- a/snippets/rust/src/getting_started.rs +++ b/snippets/rust/src/getting_started.rs @@ -22,8 +22,9 @@ async fn getting_started() -> Result> { let connect_request = ConnectRequest { config, - mnemonic: mnemonic.to_string(), + mnemonic: Some(mnemonic.to_string()), passphrase: None, + seed: None, }; let sdk = LiquidSdk::connect(connect_request).await?; // ANCHOR_END: init-sdk diff --git a/snippets/rust/src/parsing_inputs.rs b/snippets/rust/src/parsing_inputs.rs index 8bfe6d1c..beee2b54 100644 --- a/snippets/rust/src/parsing_inputs.rs +++ b/snippets/rust/src/parsing_inputs.rs @@ -66,8 +66,9 @@ async fn configure_parsers() -> Result> { let connect_request = ConnectRequest { config, - mnemonic: mnemonic.to_string(), + mnemonic: Some(mnemonic.to_string()), passphrase: None, + seed: None, }; let sdk = LiquidSdk::connect(connect_request).await?; // ANCHOR_END: configure-external-parser diff --git a/snippets/swift/BreezSDKExamples/Package.resolved b/snippets/swift/BreezSDKExamples/Package.resolved index f2a62ec8..5ac2e26f 100644 --- a/snippets/swift/BreezSDKExamples/Package.resolved +++ b/snippets/swift/BreezSDKExamples/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/breez/breez-sdk-liquid-swift", "state" : { - "revision" : "35c0ae72239bdee83d2d0cc4e77cbeee60cb366f", - "version" : "0.7.0-rc5" + "revision" : "07a10ac02e1d7f364dfacbee8c74cab35d6864cd", + "version" : "0.7.2" } }, { diff --git a/snippets/swift/BreezSDKExamples/Package.swift b/snippets/swift/BreezSDKExamples/Package.swift index d71598d3..81289f01 100644 --- a/snippets/swift/BreezSDKExamples/Package.swift +++ b/snippets/swift/BreezSDKExamples/Package.swift @@ -8,7 +8,7 @@ let package = Package( platforms: [.macOS("15.0")], dependencies: [ .package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.3"), - .package(url: "https://github.com/breez/breez-sdk-liquid-swift", exact: "0.7.0-rc5") + .package(url: "https://github.com/breez/breez-sdk-liquid-swift", exact: "0.7.2") // To use a local version of breez-sdk-liquid, comment-out the above and un-comment: // .package(name: "bindings-swift", path: "/local-path/breez-sdk-liquid/lib/bindings/langs/swift") ], diff --git a/src/guide/install.md b/src/guide/install.md index a3fd750b..4e03addd 100644 --- a/src/guide/install.md +++ b/src/guide/install.md @@ -91,7 +91,7 @@ Check https://github.com/breez/breez-sdk-liquid/releases for the latest version. ```toml [dependencies] -breez-sdk-liquid = { git = "https://github.com/breez/breez-sdk-liquid", tag = "0.7.0-rc5" } +breez-sdk-liquid = { git = "https://github.com/breez/breez-sdk-liquid", tag = "0.7.2" } [patch.crates-io] secp256k1-zkp = {git = "https://github.com/sanket1729/rust-secp256k1-zkp.git", rev = "60e631c24588a0c9e271badd61959294848c665d"} From 4e667ff8ad125c13af4285608921e602ff4f4343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Granh=C3=A3o?= <32176319+danielgranhao@users.noreply.github.com> Date: Thu, 13 Mar 2025 10:12:10 +0000 Subject: [PATCH 2/2] Document BIP353 parsing (#86) --- snippets/csharp/LnurlPay.cs | 18 ++++++----- snippets/csharp/ParsingInputs.cs | 4 +-- snippets/dart_snippets/lib/lnurl_pay.dart | 1 + .../dart_snippets/lib/parsing_inputs.dart | 2 +- snippets/dart_snippets/lib/sdk_instance.dart | 1 - snippets/go/lnurl_pay.go | 1 + snippets/go/parsing_inputs.go | 4 +-- .../com/example/kotlinmpplib/LnurlPay.kt | 6 ++-- .../com/example/kotlinmpplib/ParsingInputs.kt | 2 +- snippets/python/src/lnurl_pay.py | 5 ++-- snippets/python/src/parsing_inputs.py | 2 +- snippets/react-native/lnurl_pay.ts | 1 + snippets/react-native/parsing_inputs.ts | 2 +- snippets/rust/src/lnurl_pay.rs | 4 ++- snippets/rust/src/parsing_inputs.rs | 6 ++-- .../BreezSDKExamples/Sources/LnurlPay.swift | 30 ++++++++++--------- .../Sources/ParsingInputs.swift | 26 +++++++++------- src/guide/parse.md | 2 ++ 18 files changed, 67 insertions(+), 50 deletions(-) diff --git a/snippets/csharp/LnurlPay.cs b/snippets/csharp/LnurlPay.cs index 05bcb672..50fc91d4 100644 --- a/snippets/csharp/LnurlPay.cs +++ b/snippets/csharp/LnurlPay.cs @@ -18,11 +18,12 @@ public void PrepareLnurlPay(BindingLiquidSdk sdk) var amount = new PayAmount.Bitcoin(5000); var optionalComment = ""; var optionalValidateSuccessActionUrl = true; - + var req = new PrepareLnUrlPayRequest( - lnurlp.data, - amount, - optionalComment, + lnurlp.data, + amount, + lnurlp.bip353Address, + optionalComment, optionalValidateSuccessActionUrl); var prepareResponse = sdk.PrepareLnurlPay(req); @@ -45,11 +46,12 @@ public void PrepareLnurlPayDrain(BindingLiquidSdk sdk, LnUrlPayRequestData data) var amount = new PayAmount.Drain(); var optionalComment = ""; var optionalValidateSuccessActionUrl = true; - + var req = new PrepareLnUrlPayRequest( - data, - amount, - optionalComment, + data, + amount, + null, + optionalComment, optionalValidateSuccessActionUrl); var prepareResponse = sdk.PrepareLnurlPay(req); } diff --git a/snippets/csharp/ParsingInputs.cs b/snippets/csharp/ParsingInputs.cs index df399f7a..7c83708e 100644 --- a/snippets/csharp/ParsingInputs.cs +++ b/snippets/csharp/ParsingInputs.cs @@ -26,7 +26,7 @@ public void ParseInput(BindingLiquidSdk sdk) case InputType.LnUrlPay lnUrlPay: Console.WriteLine( - $"Input is LNURL-Pay/Lightning address accepting min/max {lnUrlPay.data.minSendable}/{lnUrlPay.data.maxSendable} msats" + $"Input is LNURL-Pay/Lightning address accepting min/max {lnUrlPay.data.minSendable}/{lnUrlPay.data.maxSendable} msats - BIP353 was used: {lnUrlPay.bip353Address != null}" ); break; @@ -67,7 +67,7 @@ public void ConfigureParsers() parserUrl: "https://parser-domain.com/parser?input=" ), new( - providerId: "provider_b", + providerId: "provider_b", inputRegex: "^provider_b", parserUrl: "https://parser-domain.com/parser?input=" ) diff --git a/snippets/dart_snippets/lib/lnurl_pay.dart b/snippets/dart_snippets/lib/lnurl_pay.dart index 852565f2..27254313 100644 --- a/snippets/dart_snippets/lib/lnurl_pay.dart +++ b/snippets/dart_snippets/lib/lnurl_pay.dart @@ -17,6 +17,7 @@ Future prepareLnurlPay() async { PrepareLnUrlPayRequest req = PrepareLnUrlPayRequest( data: inputType.data, amount: amount, + bip353Address: inputType.bip353Address, comment: optionalComment, validateSuccessActionUrl: optionalValidateSuccessActionUrl, ); diff --git a/snippets/dart_snippets/lib/parsing_inputs.dart b/snippets/dart_snippets/lib/parsing_inputs.dart index 0f45be11..b3ec18aa 100644 --- a/snippets/dart_snippets/lib/parsing_inputs.dart +++ b/snippets/dart_snippets/lib/parsing_inputs.dart @@ -14,7 +14,7 @@ Future parseInput() async { print("Input is BOLT11 invoice for $amountStr msats"); } else if (inputType is InputType_LnUrlPay) { print( - "Input is LNURL-Pay/Lightning address accepting min/max ${inputType.data.minSendable}/${inputType.data.maxSendable} msats"); + "Input is LNURL-Pay/Lightning address accepting min/max ${inputType.data.minSendable}/${inputType.data.maxSendable} msats - BIP353 was used: ${inputType.bip353Address != null}"); } else if (inputType is InputType_LnUrlWithdraw) { print( "Input is LNURL-Withdraw for min/max ${inputType.data.minWithdrawable}/${inputType.data.maxWithdrawable} msats"); diff --git a/snippets/dart_snippets/lib/sdk_instance.dart b/snippets/dart_snippets/lib/sdk_instance.dart index 197f8614..25b2e722 100644 --- a/snippets/dart_snippets/lib/sdk_instance.dart +++ b/snippets/dart_snippets/lib/sdk_instance.dart @@ -197,7 +197,6 @@ extension ConfigCopyWith on liquid_sdk.Config { workingDir: workingDir ?? this.workingDir, network: network ?? this.network, paymentTimeoutSec: paymentTimeoutSec ?? this.paymentTimeoutSec, - zeroConfMinFeeRateMsat: zeroConfMinFeeRateMsat ?? this.zeroConfMinFeeRateMsat, syncServiceUrl: syncServiceUrl ?? this.syncServiceUrl, useDefaultExternalInputParsers: useDefaultExternalInputParsers ?? this.useDefaultExternalInputParsers, externalInputParsers: externalInputParsers ?? this.externalInputParsers, diff --git a/snippets/go/lnurl_pay.go b/snippets/go/lnurl_pay.go index dbc3f2fd..1ed969c9 100644 --- a/snippets/go/lnurl_pay.go +++ b/snippets/go/lnurl_pay.go @@ -25,6 +25,7 @@ func PrepareLnurlPay(sdk *breez_sdk_liquid.BindingLiquidSdk) { req := breez_sdk_liquid.PrepareLnUrlPayRequest{ Data: inputType.Data, Amount: amount, + Bip353Address: inputType.Bip353Address, Comment: &optionalComment, ValidateSuccessActionUrl: &optionalValidateSuccessActionUrl, } diff --git a/snippets/go/parsing_inputs.go b/snippets/go/parsing_inputs.go index 1427fe4b..6e38326f 100644 --- a/snippets/go/parsing_inputs.go +++ b/snippets/go/parsing_inputs.go @@ -24,8 +24,8 @@ func ParseInput(sdk *breez_sdk_liquid.BindingLiquidSdk) { log.Printf("Input is BOLT11 invoice for %s msats", amount) case breez_sdk_liquid.InputTypeLnUrlPay: - log.Printf("Input is LNURL-Pay/Lightning address accepting min/max %d/%d msats", - inputType.Data.MinSendable, inputType.Data.MaxSendable) + log.Printf("Input is LNURL-Pay/Lightning address accepting min/max %d/%d msats - BIP353 was used: %t", + inputType.Data.MinSendable, inputType.Data.MaxSendable, inputType.Bip353Address != nil) case breez_sdk_liquid.InputTypeLnUrlWithdraw: log.Printf("Input is LNURL-Withdraw for min/max %d/%d msats", diff --git a/snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/LnurlPay.kt b/snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/LnurlPay.kt index 7313e658..d55d6db2 100644 --- a/snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/LnurlPay.kt +++ b/snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/LnurlPay.kt @@ -18,7 +18,8 @@ class LnurlPay { val req = PrepareLnUrlPayRequest( lnurlData, - amount, + amount, + inputType.bip353Address, optionalComment, optionalValidateSuccessActionUrl) val prepareResponse = sdk.prepareLnurlPay(req) @@ -42,7 +43,8 @@ class LnurlPay { val req = PrepareLnUrlPayRequest( lnurlData, - amount, + amount, + null, optionalComment, optionalValidateSuccessActionUrl) val prepareResponse = sdk.prepareLnurlPay(req) diff --git a/snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/ParsingInputs.kt b/snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/ParsingInputs.kt index a0c12838..4491de6a 100644 --- a/snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/ParsingInputs.kt +++ b/snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/ParsingInputs.kt @@ -18,7 +18,7 @@ class ParsingInputs { } is InputType.LnUrlPay -> { println("Input is LNURL-Pay/Lightning address accepting min/max " + - "${inputType.data.minSendable}/${inputType.data.maxSendable} msats") + "${inputType.data.minSendable}/${inputType.data.maxSendable} msats - BIP353 was used: ${inputType.bip353Address != null}") } is InputType.LnUrlWithdraw -> { println("Input is LNURL-Withdraw for min/max " + diff --git a/snippets/python/src/lnurl_pay.py b/snippets/python/src/lnurl_pay.py index 3ac45b96..33ee5b97 100644 --- a/snippets/python/src/lnurl_pay.py +++ b/snippets/python/src/lnurl_pay.py @@ -17,8 +17,9 @@ def prepare_pay(sdk: BindingLiquidSdk): optional_validate_success_action_url = True req = PrepareLnUrlPayRequest(parsed_input.data, - amount, - optional_comment, + amount, + parsed_input.bip353_address, + optional_comment, optional_validate_success_action_url) prepare_response = sdk.prepare_lnurl_pay(req) diff --git a/snippets/python/src/parsing_inputs.py b/snippets/python/src/parsing_inputs.py index c0486492..5118249b 100644 --- a/snippets/python/src/parsing_inputs.py +++ b/snippets/python/src/parsing_inputs.py @@ -15,7 +15,7 @@ def parse_input(sdk: BindingLiquidSdk): amount = str(parsed_input.invoice.amount_msat) logging.debug(f"Input is BOLT11 invoice for {amount} msats") elif parsed_input.type == InputType.LN_URL_PAY: - logging.debug(f"Input is LNURL-Pay/Lightning address accepting min/max {parsed_input.data.min_sendable}/{parsed_input.data.max_sendable} msats") + logging.debug(f"Input is LNURL-Pay/Lightning address accepting min/max {parsed_input.data.min_sendable}/{parsed_input.data.max_sendable} msats - BIP353 was used: {parsed_input.bip353_address is not None}") elif parsed_input.type == InputType.LN_URL_WITHDRAW: logging.debug(f"Input is LNURL-Withdraw for min/max {parsed_input.data.min_withdrawable}/{parsed_input.data.max_withdrawable} msats") # Other input types are available diff --git a/snippets/react-native/lnurl_pay.ts b/snippets/react-native/lnurl_pay.ts index 58ef1e16..3586deb0 100644 --- a/snippets/react-native/lnurl_pay.ts +++ b/snippets/react-native/lnurl_pay.ts @@ -28,6 +28,7 @@ const examplePrepareLnurlPay = async () => { const prepareResponse = await prepareLnurlPay({ data: input.data, amount, + bip353Address: input.bip353Address, comment: optionalComment, validateSuccessActionUrl: optionalValidateSuccessActionUrl }) diff --git a/snippets/react-native/parsing_inputs.ts b/snippets/react-native/parsing_inputs.ts index a63dcac0..be496d56 100644 --- a/snippets/react-native/parsing_inputs.ts +++ b/snippets/react-native/parsing_inputs.ts @@ -29,7 +29,7 @@ const parseInputs = async () => { case InputTypeVariant.LN_URL_PAY: console.log( - `Input is LNURL-Pay/Lightning address accepting min/max ${parsed.data.minSendable}/${parsed.data.maxSendable} msats` + `Input is LNURL-Pay/Lightning address accepting min/max ${parsed.data.minSendable}/${parsed.data.maxSendable} msats - BIP353 was used: ${parsed.bip353Address != null}` ) break diff --git a/snippets/rust/src/lnurl_pay.rs b/snippets/rust/src/lnurl_pay.rs index 17617d91..0eba5c15 100644 --- a/snippets/rust/src/lnurl_pay.rs +++ b/snippets/rust/src/lnurl_pay.rs @@ -11,7 +11,7 @@ async fn prepare_pay(sdk: Arc) -> Result<()> { // lnurl1dp68gurn8ghj7mr0vdskc6r0wd6z7mrww4excttsv9un7um9wdekjmmw84jxywf5x43rvv35xgmr2enrxanr2cfcvsmnwe3jxcukvde48qukgdec89snwde3vfjxvepjxpjnjvtpxd3kvdnxx5crxwpjvyunsephsz36jf let lnurl_pay_url = "lightning@address.com"; - if let Ok(InputType::LnUrlPay { data }) = sdk.parse(lnurl_pay_url).await { + if let Ok(InputType::LnUrlPay { data, bip353_address }) = sdk.parse(lnurl_pay_url).await { let amount = PayAmount::Bitcoin { receiver_amount_sat: 5_000, }; @@ -22,6 +22,7 @@ async fn prepare_pay(sdk: Arc) -> Result<()> { .prepare_lnurl_pay(PrepareLnUrlPayRequest { data, amount, + bip353_address, comment: optional_comment, validate_success_action_url: optional_validate_success_action_url, }) @@ -45,6 +46,7 @@ async fn prepare_pay_drain(sdk: Arc, data: LnUrlPayRequestData) -> Re .prepare_lnurl_pay(PrepareLnUrlPayRequest { data, amount, + bip353_address: None, comment: optional_comment, validate_success_action_url: optional_validate_success_action_url, }) diff --git a/snippets/rust/src/parsing_inputs.rs b/snippets/rust/src/parsing_inputs.rs index beee2b54..b656c285 100644 --- a/snippets/rust/src/parsing_inputs.rs +++ b/snippets/rust/src/parsing_inputs.rs @@ -21,10 +21,10 @@ async fn parse_input(sdk: Arc) -> Result<()> { .map_or("unknown".to_string(), |a| a.to_string()) ); } - InputType::LnUrlPay { data } => { + InputType::LnUrlPay { data, bip353_address } => { println!( - "Input is LNURL-Pay/Lightning address accepting min/max {}/{} msats", - data.min_sendable, data.max_sendable + "Input is LNURL-Pay/Lightning address accepting min/max {}/{} msats - BIP353 was used: {}", + data.min_sendable, data.max_sendable, bip353_address.is_some() ); } InputType::LnUrlWithdraw { data } => { diff --git a/snippets/swift/BreezSDKExamples/Sources/LnurlPay.swift b/snippets/swift/BreezSDKExamples/Sources/LnurlPay.swift index b0fbae20..646f7dbd 100644 --- a/snippets/swift/BreezSDKExamples/Sources/LnurlPay.swift +++ b/snippets/swift/BreezSDKExamples/Sources/LnurlPay.swift @@ -9,22 +9,23 @@ func preparePay(sdk: BindingLiquidSdk) -> PrepareLnUrlPayResponse? { var response: PrepareLnUrlPayResponse? let lnurlPayUrl = "lightning@address.com" if let inputType = try? sdk.parse(input: lnurlPayUrl) { - if case.lnUrlPay(let `data`) = inputType { + if case .lnUrlPay(let `data`, let bip353Address) = inputType { let amount = PayAmount.bitcoin(receiverAmountSat: 5_000) let optionalComment = "" let optionalValidateSuccessActionUrl = true let req = PrepareLnUrlPayRequest( - data: data, - amount: amount, - comment: optionalComment, + data: data, + amount: amount, + bip353Address: bip353Address, + comment: optionalComment, validateSuccessActionUrl: optionalValidateSuccessActionUrl ) - let prepareResponse = try? sdk.prepareLnurlPay(req: req) - + response = try? sdk.prepareLnurlPay(req: req) + // If the fees are acceptable, continue to create the LNURL Pay - let feesSat = prepareResponse!.feesSat - print("Fees: {} sats", feesSat); + let feesSat = response!.feesSat + print("Fees: {} sats", feesSat) } } // ANCHOR_END: prepare-lnurl-pay @@ -38,9 +39,9 @@ func preparePayDrain(sdk: BindingLiquidSdk, data: LnUrlPayRequestData) -> Prepar let optionalValidateSuccessActionUrl = true let req = PrepareLnUrlPayRequest( - data: data, - amount: amount, - comment: optionalComment, + data: data, + amount: amount, + comment: optionalComment, validateSuccessActionUrl: optionalValidateSuccessActionUrl ) let prepareResponse = try? sdk.prepareLnurlPay(req: req) @@ -50,9 +51,10 @@ func preparePayDrain(sdk: BindingLiquidSdk, data: LnUrlPayRequestData) -> Prepar func pay(sdk: BindingLiquidSdk, prepareResponse: PrepareLnUrlPayResponse) -> LnUrlPayResult? { // ANCHOR: lnurl-pay - let result = try? sdk.lnurlPay(req: LnUrlPayRequest ( - prepareResponse: prepareResponse - )) + let result = try? sdk.lnurlPay( + req: LnUrlPayRequest( + prepareResponse: prepareResponse + )) // ANCHOR_END: lnurl-pay return result } diff --git a/snippets/swift/BreezSDKExamples/Sources/ParsingInputs.swift b/snippets/swift/BreezSDKExamples/Sources/ParsingInputs.swift index f6715d9f..1a4452be 100644 --- a/snippets/swift/BreezSDKExamples/Sources/ParsingInputs.swift +++ b/snippets/swift/BreezSDKExamples/Sources/ParsingInputs.swift @@ -10,19 +10,22 @@ func parseInput(sdk: BindingLiquidSdk) { switch inputType { case .bitcoinAddress(let address): print("Input is Bitcoin address \(address.address)") - + case .bolt11(let invoice): let amount = invoice.amountMsat.map { String($0) } ?? "unknown" print("Input is BOLT11 invoice for \(amount) msats") - - case .lnUrlPay(let data): - print("Input is LNURL-Pay/Lightning address accepting min/max \(data.minSendable)/\(data.maxSendable) msats") - + + case .lnUrlPay(let data, let bip353Address): + print( + "Input is LNURL-Pay/Lightning address accepting min/max \(data.minSendable)/\(data.maxSendable) msats - BIP353 was used: \(bip353Address != nil)" + ) case .lnUrlWithdraw(let data): - print("Input is LNURL-Withdraw for min/max \(data.minWithdrawable)/\(data.maxWithdrawable) msats") - + print( + "Input is LNURL-Withdraw for min/max \(data.minWithdrawable)/\(data.maxWithdrawable) msats" + ) + default: - break // Other input types are available + break // Other input types are available } } catch { print("Failed to parse input: \(error)") @@ -35,7 +38,8 @@ func configureParsers() throws -> BindingLiquidSdk? { let mnemonic = "" // Create the default config, providing your Breez API key - var config = try defaultConfig(network: LiquidNetwork.mainnet, breezApiKey: "") + var config = try defaultConfig( + network: LiquidNetwork.mainnet, breezApiKey: "") // Configure external parsers config.externalInputParsers = [ @@ -45,10 +49,10 @@ func configureParsers() throws -> BindingLiquidSdk? { parserUrl: "https://parser-domain.com/parser?input=" ), ExternalInputParser( - providerId: "provider_b", + providerId: "provider_b", inputRegex: "^provider_b", parserUrl: "https://parser-domain.com/parser?input=" - ) + ), ] let connectRequest = ConnectRequest(config: config, mnemonic: mnemonic) diff --git a/src/guide/parse.md b/src/guide/parse.md index c003a601..7eb6b79e 100644 --- a/src/guide/parse.md +++ b/src/guide/parse.md @@ -4,6 +4,8 @@ The SDK provides a versatile and extensible parsing module designed to process a Natively supported formats include: BOLT11 invoices, BOLT12 offers, LNURLs of different types, Bitcoin addresses, and others. For the complete list, consult the [API documentation](https://breez.github.io/breez-sdk-liquid/breez_sdk_liquid/enum.InputType.html). +BIP353 addresses are also supported, in which case they will be parsed into a BOLT12 offer or an LNURL-Pay. In these cases, the BIP353 address is also returned to indicate BIP353 was used. +
Rust