diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000000..4a6a1abdd6 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[resolver] +incompatible-rust-versions = "fallback" diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index 0e6c3ba2e0..117f9c6fe5 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -1,5 +1,9 @@ name: Android Publish +env: + NDK_RELEASE: r28b + NDK_VERSION: 28.1.13356709 + on: release: types: [published] @@ -53,11 +57,16 @@ jobs: id: setup-ndk uses: nttld/setup-ndk@v1 with: - ndk-version: r28c + ndk-version: ${{ env.NDK_RELEASE }} add-to-path: true - - name: Export Android NDK root - run: echo "ANDROID_NDK_ROOT=${{ steps.setup-ndk.outputs.ndk-path }}" >> "$GITHUB_ENV" + - name: Verify and export Android NDK environment + env: + INSTALLED_NDK_VERSION: ${{ steps.setup-ndk.outputs.ndk-full-version }} + run: | + test "$INSTALLED_NDK_VERSION" = "$NDK_VERSION" + echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >> "$GITHUB_ENV" + echo "ANDROID_NDK_ROOT=${{ steps.setup-ndk.outputs.ndk-path }}" >> "$GITHUB_ENV" - name: Generate Android bindings run: scripts/uniffi_bindgen_generate_kotlin_android.sh diff --git a/.github/workflows/publish-jvm.yml b/.github/workflows/publish-jvm.yml deleted file mode 100644 index e0ac5ac877..0000000000 --- a/.github/workflows/publish-jvm.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: JVM Publish - -on: - release: - types: [published] - workflow_dispatch: - inputs: - version: - description: "Version/tag to publish (e.g., v0.7.0-rc.54 or 0.7.0-rc.54)" - required: true - -jobs: - publish: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Normalize release version - id: version - shell: bash - run: | - VERSION="${{ github.event.inputs.version || github.event.release.tag_name || github.ref_name }}" - TAG="$VERSION" - if [[ "$TAG" != v* ]]; then - TAG="v$TAG" - fi - echo "tag=$TAG" >> "$GITHUB_OUTPUT" - echo "version=${TAG#v}" >> "$GITHUB_OUTPUT" - - - uses: actions/checkout@v4 - with: - ref: ${{ steps.version.outputs.tag }} - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - server-id: github - settings-path: ${{ github.workspace }} - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - - name: Build with Gradle - working-directory: bindings/kotlin/ldk-node-jvm - run: ./gradlew build -x test -Pversion=${{ steps.version.outputs.version }} - - - name: Publish to GitHub Packages - working-directory: bindings/kotlin/ldk-node-jvm - env: - GITHUB_ACTOR: ${{ github.actor }} - GITHUB_TOKEN: ${{ github.token }} - GITHUB_REPO: ${{ github.repository }} - run: ./gradlew publish -Pversion=${{ steps.version.outputs.version }} diff --git a/.gitignore b/.gitignore index bf2487f5af..8766d8ce2c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,11 +2,13 @@ # will have compiled files and executables /target/ /bindings/uniffi-bindgen/target/ +/bindings/uniffi-bindgen/Cargo.lock /bindings/kotlin/ldk-node-android/native-debug-symbols.zip - -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock +# Built by publish-android.yml / uniffi_bindgen_generate_kotlin_android.sh +/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/ +# Generated Kotlin JVM bindings and native libraries +/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node*.kt +/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/ # These are backup files generated by rustfmt **/*.rs.bk diff --git a/AGENTS.md b/AGENTS.md index 47db706923..7f3c81b208 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -248,11 +248,12 @@ To regenerate ALL bindings (Swift, Kotlin, Python), run from the repo root: ## Version Bumping Checklist When bumping the version, ALWAYS update ALL of these files: 1. `Cargo.toml` - main crate version -2. `bindings/kotlin/ldk-node-android/gradle.properties` - Android version -3. `bindings/kotlin/ldk-node-jvm/gradle.properties` - JVM version -4. `bindings/python/pyproject.toml` - Python version -5. `Package.swift` - Swift tag (and checksum after building) -6. `CHANGELOG.md` - Add release notes section at top +2. `Cargo.lock` - refresh with `cargo update -w` after changing versions and before running `./bindgen.sh` +3. `bindings/kotlin/ldk-node-android/gradle.properties` - Android version +4. `bindings/kotlin/ldk-node-jvm/gradle.properties` - JVM version +5. `bindings/python/pyproject.toml` - Python version +6. `Package.swift` - Swift tag (and checksum after building) +7. `CHANGELOG.md` - Add release notes section at top ## CHANGELOG - The Synonym fork maintains a SINGLE section at the top: `# X.X.X (Synonym Fork)` diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000000..5be41f2822 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,4943 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "android_system_properties" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" +dependencies = [ + "libc", +] + +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + +[[package]] +name = "arrayvec" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" + +[[package]] +name = "askama" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" +dependencies = [ + "askama_derive", + "askama_escape", +] + +[[package]] +name = "askama_derive" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" +dependencies = [ + "askama_parser", + "basic-toml", + "mime", + "mime_guess", + "proc-macro2", + "quote", + "serde", + "syn 2.0.119", +] + +[[package]] +name = "askama_escape" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" + +[[package]] +name = "askama_parser" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" +dependencies = [ + "nom", +] + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "async-trait" +version = "0.1.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "aws-lc-rs" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b281d307588d634de920874890732659e2e7672f72b5e10e81badc1a8a83621e" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bff6c3b54fad79a2e60b8102caf565819711497c1f5f092f49508e2f5c31b27" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", + "pkg-config", +] + +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core 0.4.5", + "bytes", + "futures-util", + "http 1.5.0", + "http-body 1.1.0", + "http-body-util", + "itoa", + "matchit 0.7.3", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper 1.0.2", + "tower 0.5.3", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" +dependencies = [ + "axum-core 0.5.6", + "bytes", + "futures-util", + "http 1.5.0", + "http-body 1.1.0", + "http-body-util", + "itoa", + "matchit 0.8.4", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "sync_wrapper 1.0.2", + "tower 0.5.3", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.5.0", + "http-body 1.1.0", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.2", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http 1.5.0", + "http-body 1.1.0", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper 1.0.2", + "tower-layer", + "tower-service", +] + +[[package]] +name = "base58ck" +version = "0.1.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "365c0acd5b2e8dd0111a46c4faea83fb3cfb6e39a49a7c73a06e090db7b2eff0" +dependencies = [ + "bitcoin_hashes", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "basic-toml" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" +dependencies = [ + "serde", +] + +[[package]] +name = "bdk-wallet-aggregate" +version = "0.1.0" +dependencies = [ + "bdk_chain", + "bdk_wallet", + "bip39", + "bitcoin", + "log", +] + +[[package]] +name = "bdk_chain" +version = "0.23.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c290eff038799a8ac0c5a82b6160a9ca456baa299a6f22b262c771342d2846c0" +dependencies = [ + "bdk_core", + "bitcoin", + "miniscript", + "serde", +] + +[[package]] +name = "bdk_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3028782f6bf14a6df987244333d34e6b272b5a40a53e4879ec2dfd82275a3a" +dependencies = [ + "bitcoin", + "hashbrown 0.14.5", + "serde", +] + +[[package]] +name = "bdk_electrum" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b59a3f7fbe678874fa34354097644a171276e02a49934c13b3d61c54610ddf39" +dependencies = [ + "bdk_core", + "electrum-client 0.24.1", +] + +[[package]] +name = "bdk_esplora" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83986307ea92997c3d051e8c306af8115a05add601e22acb7c1903008e6b614e" +dependencies = [ + "async-trait", + "bdk_core", + "esplora-client 0.12.3", + "futures", +] + +[[package]] +name = "bdk_wallet" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c99821af39c7df004bd411ece2ef22d9fba5a631b4489f3d9a0ac0d19637e2d0" +dependencies = [ + "bdk_chain", + "bip39", + "bitcoin", + "miniscript", + "rand_core 0.6.4", + "serde", + "serde_json", +] + +[[package]] +name = "bech32" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32637268377fc7b10a8c6d51de3e7fba1ce5dd371a96e342b34e6078db558e7f" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bip21" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe7a7f5928d264879d5b65eb18a72ea1890c57f22d62ee2eba93f207a6a020b" +dependencies = [ + "bitcoin", + "percent-encoding-rfc3986", +] + +[[package]] +name = "bip39" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90dbd31c98227229239363921e60fcf5e558e43ec69094d46fc4996f08d1d5bc" +dependencies = [ + "bitcoin_hashes", + "rand 0.8.8", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitcoin" +version = "0.32.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0ce8bd5baaa0d303a19915a6d93afed161f528654e42da2a7a97d05c59499a" +dependencies = [ + "base58ck", + "base64 0.21.7", + "bech32", + "bitcoin-io", + "bitcoin-units", + "bitcoin_hashes", + "bitcoinconsensus", + "hex-conservative 0.2.3", + "hex_lit", + "secp256k1", + "serde", +] + +[[package]] +name = "bitcoin-consensus-encoding" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6712f9c6fd6785b3b270884e57c441c403dc5d7e19ca45368c97c7a1de3000ec" +dependencies = [ + "bitcoin-internals", + "hex-conservative 1.2.0", + "serde", +] + +[[package]] +name = "bitcoin-internals" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d573f4cf32996a8dce612e4348cece65a241f1882ed594047c9ba348e8869fa5" + +[[package]] +name = "bitcoin-io" +version = "0.1.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb5de036369d1ac59d3c1819ebc4d850f89466f5401c571a285b6ed564a4cb78" +dependencies = [ + "bitcoin-consensus-encoding", +] + +[[package]] +name = "bitcoin-units" +version = "0.1.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cb95693f371d089a4b5b6fc41c6f3ea6e01ee8c15388335dfac8ea685173b51" +dependencies = [ + "bitcoin-consensus-encoding", + "serde", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.14.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bca4c7abb40c8817d77403c880988cfd484f23ab2365726afb2f798363e2c4a2" +dependencies = [ + "bitcoin-io", + "hex-conservative 0.2.3", + "serde", +] + +[[package]] +name = "bitcoinconsensus" +version = "0.105.0+25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f260ac8fb2c621329013fc0ed371c940fcc512552dcbcb9095ed0179098c9e18" +dependencies = [ + "cc", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.13+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "camino" +version = "1.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb1307f12aa967b5a58416e87b3653360e0fd614a016b6e970db08fecbb1b80d" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cc" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "005ec2760ca554fae18df7a11195552ec576cd665632a881bc011d5bb2fd4d80" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[package]] +name = "chacha20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" +dependencies = [ + "cfg-if", + "cpufeatures", + "rand_core 0.10.1", +] + +[[package]] +name = "chacha20-poly1305" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b4b0fc281743d80256607bd65e8beedc42cb0787ea119c85b81b4c0eab85e5f" + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "num-traits", + "serde", + "windows-link", +] + +[[package]] +name = "chunked_transfer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" + +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clap" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "473c7e07f409a8d772161724aa8db6a765a2532a70f9667eeb7b49d3d02fbdca" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b48fea5a88e9ae728a2dcbedbfc0e730f7d60da42e1cb049a83c9fb8b789889" +dependencies = [ + "anstyle", + "clap_lex", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "clightningrpc" +version = "0.3.0-beta.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aa69cf638ea999080f22840c77d369b799f2826a638c2f0bffb7f28bd92639f" +dependencies = [ + "clightningrpc-common", + "serde", + "serde_json", +] + +[[package]] +name = "clightningrpc-common" +version = "0.3.0-beta.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dc4030d1ff7bf3c8705b48c8fd73319a2c7cfccae086399c6b3a6c07026cf5a" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "corepc-client" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7755b8b9219b23d166a5897b5e2d8266cbdd0de5861d351b96f6db26bcf415f3" +dependencies = [ + "bitcoin", + "corepc-types", + "jsonrpc", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "corepc-node" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "768391062ec3812e223bb3031c5b2fcdd6e0e60b816157f21df82fd3e6617dc0" +dependencies = [ + "anyhow", + "bitcoin_hashes", + "corepc-client", + "flate2", + "log", + "minreq", + "serde_json", + "tar", + "tempfile", + "which 3.1.1", + "zip", +] + +[[package]] +name = "corepc-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c22db78b0223b66f82f92b14345f06307078f76d94b18280431ea9bc6cd9cbb6" +dependencies = [ + "bitcoin", + "serde", + "serde_json", +] + +[[package]] +name = "cpufeatures" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8498c871161e1742aaa9d52551b2d6ebdd4c3d45a3be423e3728f33b955be550" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "criterion" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1c047a62b0cc3e145fa84415a3191f628e980b194c2755aa12300a4e6cbd928" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap", + "criterion-plot", + "itertools 0.13.0", + "num-traits", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_json", + "tinytemplate", + "tokio", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b1bcc0dc7dfae599d84ad0b1a55f80cde8af3725da8313b528da95ef783e338" +dependencies = [ + "cast", + "itertools 0.13.0", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "dnssec-prover" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9468f1a08c50bd1e5ad91b151e11ce8e806f8fa1c1eb9b07f66c7011de45a2e" + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "either" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" + +[[package]] +name = "electrsd" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8926868af723c2819807809e54585992aaea0e26a6f5089ac8c2598eaec8d01" +dependencies = [ + "bitcoin_hashes", + "corepc-client", + "corepc-node", + "electrum-client 0.24.1", + "log", + "minreq", + "nix", + "zip", +] + +[[package]] +name = "electrum-client" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a0bd443023f9f5c4b7153053721939accc7113cbdf810a024434eed454b3db1" +dependencies = [ + "bitcoin", + "byteorder", + "libc", + "log", + "rustls 0.23.43", + "serde", + "serde_json", + "webpki-roots 0.25.4", + "winapi", +] + +[[package]] +name = "electrum-client" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5059f13888a90486e7268bbce59b175f5f76b1c55e5b9c568ceaa42d2b8507c" +dependencies = [ + "bitcoin", + "byteorder", + "libc", + "log", + "rustls 0.23.43", + "serde", + "serde_json", + "webpki-roots 0.25.4", + "winapi", +] + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_logger" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "esplora-client" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0da3c186d286e046253ccdc4bb71aa87ef872e4eff2045947c0c4fe3d2b2efc" +dependencies = [ + "bitcoin", + "hex-conservative 0.2.3", + "log", + "reqwest 0.11.27", + "serde", + "tokio", +] + +[[package]] +name = "esplora-client" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f19e3ea99dbfbef0c1ec26d83e69de0c579f6aa6aaac4f44597805fcc27e97af" +dependencies = [ + "bitcoin", + "hex-conservative 0.2.3", + "log", + "reqwest 0.12.28", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "filetime" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759" +dependencies = [ + "cfg-if", + "libc", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0f1c7c3a72c66fd80abe965175f7523475c0489a87d3ff9d6e8c87d87a9d2d" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + +[[package]] +name = "flate2" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb" +dependencies = [ + "crc32fast", + "miniz_oxide", + "zlib-rs", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "futures" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-executor" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" + +[[package]] +name = "futures-macro" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "futures-sink" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 6.0.0", + "rand_core 0.10.1", + "wasm-bindgen", +] + +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + +[[package]] +name = "goblin" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47" +dependencies = [ + "log", + "plain", + "scroll", +] + +[[package]] +name = "h2" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.14.1", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef8e5e5a340588f4452631496976cf8636d4a7ecf600239fdc27615d2530bc16" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.5.0", + "indexmap 2.14.1", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "half" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" +dependencies = [ + "cfg-if", + "crunchy", + "zerocopy", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "serde", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "hashlink" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +dependencies = [ + "hashbrown 0.14.5", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-conservative" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3fef046dca3ca91ee1408a8c1b80ab777e80a4d308d1bf4e7adb3fcb047e08" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "hex-conservative" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35431185f361ccf3ffc58254628af5f1f5d5f28531da2e02e5d6c82bbc282a10" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "hex_lit" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" +dependencies = [ + "bytes", + "http 1.5.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c" +dependencies = [ + "bytes", + "futures-core", + "http 1.5.0", + "http-body 1.1.0", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15cdd26707701c53297e2fa6afb323d55fbc1d0810c3aec078ae3ef0424c3c15" + +[[package]] +name = "hyper" +version = "0.14.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.27", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.5.10", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b501faa50e7a26c3d3560ca625132f4078a17771f4810baf70475ae48cbe43" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2 0.4.19", + "http 1.5.0", + "http-body 1.1.0", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-openssl" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527d4d619ca2c2aafa31ec139a3d1d60bf557bf7578a1f20f743637eccd9ca19" +dependencies = [ + "http 1.5.0", + "hyper 1.11.1", + "hyper-util", + "linked_hash_set", + "once_cell", + "openssl", + "openssl-sys", + "parking_lot", + "pin-project", + "tower-layer", + "tower-service", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper 0.14.32", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http 1.5.0", + "hyper 1.11.1", + "hyper-util", + "rustls 0.23.43", + "tokio", + "tokio-rustls 0.26.5", + "tower-service", + "webpki-roots 1.0.9", +] + +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper 1.11.1", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-util", + "http 1.5.0", + "http-body 1.1.0", + "hyper 1.11.1", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2 0.6.5", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07aa2048142242915a31d35844fb311e0e53fcca590c3a0a40dcf1b841fa09eb" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", +] + +[[package]] +name = "ipnet" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a756c3fac73139e83f14c2d742155dd2b78d3ee56597b419a0579b7bdd6dd78" + +[[package]] +name = "is-terminal" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jobserver" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" +dependencies = [ + "getrandom 0.4.3", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "jsonrpc" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" +dependencies = [ + "base64 0.13.1", + "minreq", + "serde", + "serde_json", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "ldk-node" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78165f06c94ecdb568b1850cf075d60049c7b395dce65266ba1362da01511670" +dependencies = [ + "base64 0.22.1", + "bdk_chain", + "bdk_electrum", + "bdk_esplora", + "bdk_wallet", + "bip21", + "bip39", + "bitcoin", + "chrono", + "electrum-client 0.24.1", + "esplora-client 0.11.0", + "esplora-client 0.12.3", + "libc", + "lightning 0.1.12", + "lightning-background-processor 0.1.0", + "lightning-block-sync 0.1.0", + "lightning-invoice 0.33.3", + "lightning-liquidity 0.1.0", + "lightning-net-tokio 0.1.0", + "lightning-persister 0.1.10", + "lightning-rapid-gossip-sync 0.1.10", + "lightning-transaction-sync 0.1.10", + "lightning-types 0.2.12", + "log", + "prost 0.11.9", + "rand 0.8.8", + "reqwest 0.12.28", + "rusqlite", + "rustls 0.23.43", + "serde", + "serde_json", + "tokio", + "vss-client", + "winapi", +] + +[[package]] +name = "ldk-node" +version = "0.7.0-rc.66" +dependencies = [ + "base64 0.22.1", + "bdk-wallet-aggregate", + "bdk_chain", + "bdk_electrum", + "bdk_esplora", + "bdk_wallet", + "bip21", + "bip39", + "bitcoin", + "chrono", + "clightningrpc", + "corepc-node", + "criterion", + "electrsd", + "electrum-client 0.24.1", + "esplora-client 0.12.3", + "ldk-node 0.6.2", + "libc", + "lightning 0.2.5", + "lightning-background-processor 0.2.3", + "lightning-block-sync 0.2.0", + "lightning-invoice 0.34.1", + "lightning-liquidity 0.2.3", + "lightning-macros 0.2.1", + "lightning-net-tokio 0.2.0", + "lightning-persister 0.2.3", + "lightning-rapid-gossip-sync 0.2.3", + "lightning-transaction-sync 0.2.1", + "lightning-types 0.3.5", + "lnd_grpc_rust", + "log", + "proptest", + "prost 0.11.9", + "rand 0.9.5", + "regex", + "reqwest 0.12.28", + "rusqlite", + "rustls 0.23.43", + "serde", + "serde_json", + "tokio", + "tokio-util", + "uniffi", + "vss-client-ng", + "winapi", + "zeroize", +] + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "libsqlite3-sys" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "lightning" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a72edb7b4c49175030c52781796287b898e0e902c52d1ad39e0b72f441c1f836" +dependencies = [ + "bech32", + "bitcoin", + "dnssec-prover", + "hashbrown 0.13.2", + "libm", + "lightning-invoice 0.33.3", + "lightning-types 0.2.12", + "possiblyrandom", +] + +[[package]] +name = "lightning" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab16d2a714c0b26d7230bd388ac383a30fce231c8927c62752afc0471a36dc6" +dependencies = [ + "bech32", + "bitcoin", + "dnssec-prover", + "hashbrown 0.13.2", + "libm", + "lightning-invoice 0.34.1", + "lightning-macros 0.2.1", + "lightning-types 0.3.5", + "possiblyrandom", + "regex", +] + +[[package]] +name = "lightning-background-processor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04231b97fd7509d73ce9857a416eb1477a55d076d4e22cbf26c649a772bde909" +dependencies = [ + "bitcoin", + "bitcoin-io", + "bitcoin_hashes", + "lightning 0.1.12", + "lightning-rapid-gossip-sync 0.1.10", +] + +[[package]] +name = "lightning-background-processor" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "994fb200e17bbe125491cbe3f35602180a360484b9763837b9ea2130b7293b5f" +dependencies = [ + "bitcoin", + "bitcoin-io", + "bitcoin_hashes", + "lightning 0.2.5", + "lightning-liquidity 0.2.3", + "lightning-rapid-gossip-sync 0.2.3", + "possiblyrandom", +] + +[[package]] +name = "lightning-block-sync" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baab5bdee174a2047d939a4ca0dc2e1c23caa0f8cab0b4380aed77a20e116f1e" +dependencies = [ + "bitcoin", + "chunked_transfer", + "lightning 0.1.12", + "serde_json", + "tokio", +] + +[[package]] +name = "lightning-block-sync" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee5069846b07a62aaecdaf25233e067bc69f245b7c8fd00cc9c217053221f875" +dependencies = [ + "bitcoin", + "chunked_transfer", + "lightning 0.2.5", + "serde_json", + "tokio", +] + +[[package]] +name = "lightning-invoice" +version = "0.33.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39b494954ed8f1d774d86473224fadf9f0dfcca38c2d16a7dbdf2b5800c8943" +dependencies = [ + "bech32", + "bitcoin", + "lightning-types 0.2.12", + "serde", +] + +[[package]] +name = "lightning-invoice" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d83bd798e04ab9eecc8bbef1fa17d3808859bcdc0406bd16c55d51c8834444" +dependencies = [ + "bech32", + "bitcoin", + "lightning-types 0.3.5", + "serde", +] + +[[package]] +name = "lightning-liquidity" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfbed71e656557185f25e006c1bcd8773c5c83387c727166666d3b0bce0f0ca5" +dependencies = [ + "bitcoin", + "chrono", + "lightning 0.1.12", + "lightning-invoice 0.33.3", + "lightning-types 0.2.12", + "serde", + "serde_json", +] + +[[package]] +name = "lightning-liquidity" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42278510c9f71f32c6e292085747d1f9649f8a88a8d9dc32c0440da3c1356345" +dependencies = [ + "bitcoin", + "chrono", + "lightning 0.2.5", + "lightning-invoice 0.34.1", + "lightning-macros 0.2.1", + "lightning-types 0.3.5", + "serde", + "serde_json", +] + +[[package]] +name = "lightning-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d44a6fb8c698180c758fd391ae9631be92a4dbf0a82121e7dd8b1a28d0cfa75" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "lightning-macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c717494cdc2c8bb85bee7113031248f5f6c64f8802b33c1c9e2d98e594aa71" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "lightning-net-tokio" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6a6c93b1e592f1d46bb24233cac4a33b4015c99488ee229927a81d16226e45" +dependencies = [ + "bitcoin", + "lightning 0.1.12", + "tokio", +] + +[[package]] +name = "lightning-net-tokio" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8055737e3d2d06240a3fdf10e26b2716110fcea90011a0839e8e82fc6e58ff5e" +dependencies = [ + "bitcoin", + "lightning 0.2.5", + "tokio", +] + +[[package]] +name = "lightning-persister" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a37df08840daa8b000817330c1c7f94cde7e18850e07318bf4098b1414f4a793" +dependencies = [ + "bitcoin", + "lightning 0.1.12", + "windows-sys 0.48.0", +] + +[[package]] +name = "lightning-persister" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c374a770c3654b00fe3b57e30e79416fb30d773b4fefeea231171d3a82dfa1b" +dependencies = [ + "bitcoin", + "lightning 0.2.5", + "tokio", + "windows-sys 0.48.0", +] + +[[package]] +name = "lightning-rapid-gossip-sync" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23eef76e06c716cc5f1c56a5ccbb6b1bfe9dcae66df9b50b7412f08bac8a15b6" +dependencies = [ + "bitcoin", + "bitcoin-io", + "bitcoin_hashes", + "lightning 0.1.12", +] + +[[package]] +name = "lightning-rapid-gossip-sync" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38ac84d6862b3eaf5129c68a5df0fb8f1760adfccbaafadc18da140325f1168" +dependencies = [ + "bitcoin", + "bitcoin-io", + "bitcoin_hashes", + "lightning 0.2.5", +] + +[[package]] +name = "lightning-transaction-sync" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20a9d902fcbd1216137639b97014bb5b43f010f9c8210309c5a6b90b0e65fedb" +dependencies = [ + "bitcoin", + "electrum-client 0.21.0", + "esplora-client 0.11.0", + "futures", + "lightning 0.1.12", + "lightning-macros 0.1.0", +] + +[[package]] +name = "lightning-transaction-sync" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7260095a79a44b09ebd97e77855ec8b7996ab939223369f66244974a374bd2c" +dependencies = [ + "bitcoin", + "electrum-client 0.24.1", + "esplora-client 0.12.3", + "futures", + "lightning 0.2.5", + "lightning-macros 0.2.1", +] + +[[package]] +name = "lightning-types" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da19491efc72d10a13d5b8fd9c0cc6de7814742675adcb9996fa13f40a3b5ca" +dependencies = [ + "bitcoin", +] + +[[package]] +name = "lightning-types" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77c676d4a34cceb2ae3756916e446b4d17f9430a24107e099981f0f9aec77e6" +dependencies = [ + "bitcoin", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linked_hash_set" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "984fb35d06508d1e69fc91050cceba9c0b748f983e6739fa2c7a9237154c52c8" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "lnd_grpc_rust" +version = "2.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab830aa9c82cdd6b4d32d9d6b95ed70bf02695a1b22d47cd30a2f2c81056f53" +dependencies = [ + "bytes", + "hex", + "http-body-util", + "hyper 1.11.1", + "hyper-openssl", + "hyper-util", + "openssl", + "pretty_env_logger", + "prost 0.14.4", + "protoc-bin-vendored", + "serde", + "tokio", + "tokio-stream", + "tonic 0.14.5", + "tonic-openssl", + "tonic-prost", + "tonic-prost-build", + "tower 0.5.3", +] + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniscript" +version = "12.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8343cc1ef1408bd9bdbf69f7aef47017dfab7e6349ec26fddf62e0e9fb5a4cf" +dependencies = [ + "bech32", + "bitcoin", + "serde", +] + +[[package]] +name = "miniz_oxide" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "minreq" +version = "2.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05015102dad0f7d61691ca347e9d9d9006685a64aefb3d79eecf62665de2153d" +dependencies = [ + "rustls 0.21.12", + "rustls-webpki 0.101.7", + "serde", + "serde_json", + "webpki-roots 0.25.4", +] + +[[package]] +name = "mio" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b18443e9c262bfe8fa82f51666e2642c53393f7e5c27b3e1aeab922cff5b9d8" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "multimap" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" + +[[package]] +name = "nix" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset", + "pin-utils", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "oorandom" +version = "11.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" + +[[package]] +name = "openssl" +version = "0.10.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45" +dependencies = [ + "bitflags 2.13.1", + "cfg-if", + "foreign-types", + "libc", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "openssl-sys" +version = "0.9.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "percent-encoding-rfc3986" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3637c05577168127568a64e9dc5a6887da720efef07b3d9472d45f63ab191166" + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset 0.4.2", + "indexmap 2.14.1", +] + +[[package]] +name = "petgraph" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" +dependencies = [ + "fixedbitset 0.5.7", + "hashbrown 0.15.5", + "indexmap 2.14.1", +] + +[[package]] +name = "pin-project" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "plotters" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" + +[[package]] +name = "plotters-svg" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "possiblyrandom" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c564dbf654befd49035528299f1208a40508f6e07efb11c163444e304e4484f" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "zerovec", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "pretty_env_logger" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "865724d4dbe39d9f3dd3b52b88d859d66bcb2d6a0acfd5ea68a65fb66d4bdc1c" +dependencies = [ + "env_logger", + "log", +] + +[[package]] +name = "prettyplease" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.119", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.13.1", + "num-traits", + "rand 0.9.5", + "rand_chacha 0.9.0", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" +dependencies = [ + "bytes", +] + +[[package]] +name = "prost" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528ac67416ff8646872a3c02cad9cc4ee5dc9f9540c9b10771855c95cb2e5ae1" +dependencies = [ + "bytes", + "prost-derive 0.14.4", +] + +[[package]] +name = "prost-build" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +dependencies = [ + "bytes", + "heck 0.4.1", + "itertools 0.10.5", + "lazy_static", + "log", + "multimap 0.8.3", + "petgraph 0.6.5", + "prettyplease 0.1.25", + "prost 0.11.9", + "prost-types 0.11.9", + "regex", + "syn 1.0.109", + "tempfile", + "which 4.4.2", +] + +[[package]] +name = "prost-build" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042" +dependencies = [ + "heck 0.5.0", + "itertools 0.14.0", + "log", + "multimap 0.10.1", + "petgraph 0.8.3", + "prettyplease 0.2.37", + "prost 0.14.4", + "prost-types 0.14.4", + "pulldown-cmark", + "pulldown-cmark-to-cmark", + "regex", + "syn 2.0.119", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools 0.10.5", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-derive" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" +dependencies = [ + "anyhow", + "itertools 0.14.0", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "prost-types" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +dependencies = [ + "prost 0.11.9", +] + +[[package]] +name = "prost-types" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f94967dc7688f3054c7fac87473ffae4cc4c3904800e2d9f5b857246d8963b0a" +dependencies = [ + "prost 0.14.4", +] + +[[package]] +name = "protoc-bin-vendored" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1c381df33c98266b5f08186583660090a4ffa0889e76c7e9a5e175f645a67fa" +dependencies = [ + "protoc-bin-vendored-linux-aarch_64", + "protoc-bin-vendored-linux-ppcle_64", + "protoc-bin-vendored-linux-s390_64", + "protoc-bin-vendored-linux-x86_32", + "protoc-bin-vendored-linux-x86_64", + "protoc-bin-vendored-macos-aarch_64", + "protoc-bin-vendored-macos-x86_64", + "protoc-bin-vendored-win32", +] + +[[package]] +name = "protoc-bin-vendored-linux-aarch_64" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c350df4d49b5b9e3ca79f7e646fde2377b199e13cfa87320308397e1f37e1a4c" + +[[package]] +name = "protoc-bin-vendored-linux-ppcle_64" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55a63e6c7244f19b5c6393f025017eb5d793fd5467823a099740a7a4222440c" + +[[package]] +name = "protoc-bin-vendored-linux-s390_64" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dba5565db4288e935d5330a07c264a4ee8e4a5b4a4e6f4e83fad824cc32f3b0" + +[[package]] +name = "protoc-bin-vendored-linux-x86_32" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8854774b24ee28b7868cd71dccaae8e02a2365e67a4a87a6cd11ee6cdbdf9cf5" + +[[package]] +name = "protoc-bin-vendored-linux-x86_64" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b38b07546580df720fa464ce124c4b03630a6fb83e05c336fea2a241df7e5d78" + +[[package]] +name = "protoc-bin-vendored-macos-aarch_64" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89278a9926ce312e51f1d999fee8825d324d603213344a9a706daa009f1d8092" + +[[package]] +name = "protoc-bin-vendored-macos-x86_64" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81745feda7ccfb9471d7a4de888f0652e806d5795b61480605d4943176299756" + +[[package]] +name = "protoc-bin-vendored-win32" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95067976aca6421a523e491fce939a3e65249bac4b977adee0ee9771568e8aa3" + +[[package]] +name = "pulldown-cmark" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f068eba8e7071c5f9511831b44f32c740d5adf574e990f946ddb53db2f314e" +dependencies = [ + "bitflags 2.13.1", + "memchr", + "unicase", +] + +[[package]] +name = "pulldown-cmark-to-cmark" +version = "22.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab1ad36992cead65f02aa399a373a42730922f1525d988172634fdefdecb8a60" +dependencies = [ + "pulldown-cmark", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quinn" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c1a41e437b6bbd489372cd4971de128e85c855f56c57f283d20ff016cf7c0a8" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.23.43", + "socket2 0.6.5", + "thiserror 2.0.20", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04759210543be93709136e28212294a659ef5001836ff4eab4d663e4529bba83" +dependencies = [ + "bytes", + "getrandom 0.4.3", + "lru-slab", + "rand 0.10.2", + "rand_pcg", + "ring", + "rustc-hash", + "rustls 0.23.43", + "rustls-pki-types", + "slab", + "thiserror 2.0.20", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35a133f956daabe89a61a685c2649f13d82d5aa4bd5d12d1277e1072a21c0694" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2 0.6.5", + "tracing", + "windows-sys 0.61.2", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", +] + +[[package]] +name = "rand" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" +dependencies = [ + "chacha20", + "getrandom 0.4.3", + "rand_core 0.10.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rand_pcg" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a" +dependencies = [ + "rand_core 0.10.1", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core 0.9.5", +] + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.13.1", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.3.27", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.32", + "hyper-rustls 0.24.2", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.21.12", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration", + "tokio", + "tokio-rustls 0.24.1", + "tokio-socks", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.25.4", + "winreg", +] + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http 1.5.0", + "http-body 1.1.0", + "http-body-util", + "hyper 1.11.1", + "hyper-rustls 0.27.9", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls 0.23.43", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.2", + "tokio", + "tokio-rustls 0.26.5", + "tower 0.5.3", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 1.0.9", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rusqlite" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b838eba278d213a8beaf485bd313fd580ca4505a00d5871caeb1457c55322cae" +dependencies = [ + "bitflags 2.13.1", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.13.1", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags 2.13.1", + "errno", + "libc", + "linux-raw-sys 0.12.1", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.7", + "sct", +] + +[[package]] +name = "rustls" +version = "0.23.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0283386ce02abc0151e1761d08802dfe86c173b0b494af5cbc086574e453da06" +dependencies = [ + "aws-lc-rs", + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki 0.103.15", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-pki-types" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "rusty-fork" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scroll" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "secp256k1" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" +dependencies = [ + "bitcoin_hashes", + "rand 0.8.8", + "secp256k1-sys", + "serde", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "serde_json" +version = "1.0.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "simd-adler32" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9be42f50aa861c555654aa3a37f52f4b1074bacf4e48fe0ef7fa584e80f1f0f" + +[[package]] +name = "smawk" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8e2fb0f499abb4d162f2bedad68f5ef91a1682b5a03596ddb67efd37768d100" + +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "socket2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tar" +version = "0.4.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.3", + "once_cell", + "rustix 1.1.4", + "windows-sys 0.61.2", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "smawk", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" +dependencies = [ + "thiserror-impl 2.0.20", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "tinystr" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "tinyvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cf0ded5c4e56918d8f8a339e1bb67d038d3bc6d144ac407904015ba2e4cde9b" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2 0.6.5", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "tokio-openssl" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59df6849caa43bb7567f9a36f863c447d95a11d5903c9cc334ba32576a27eadd" +dependencies = [ + "openssl", + "openssl-sys", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c85f2c3ef0b1cd58b36682f4b17aaa995f0e5db534d85692b4903abce21f67" +dependencies = [ + "rustls 0.23.43", + "tokio", +] + +[[package]] +name = "tokio-socks" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7e2948f60dbe26b35f2c7fb74ac2854c1fddded0fe9d7548fcc674a246f7615" +dependencies = [ + "either", + "futures-util", + "thiserror 1.0.69", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d06f0b082ba57c26b79407372e57cf2a1e28124f78e9479fe80322cf53420b" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "futures-util", + "libc", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-stream", + "async-trait", + "axum 0.7.9", + "base64 0.22.1", + "bytes", + "h2 0.4.19", + "http 1.5.0", + "http-body 1.1.0", + "http-body-util", + "hyper 1.11.1", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "prost 0.13.5", + "socket2 0.5.10", + "tokio", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fec7c61a0695dc1887c1b53952990f3ad2e3a31453e1f49f10e75424943a93ec" +dependencies = [ + "async-trait", + "axum 0.8.9", + "base64 0.22.1", + "bytes", + "h2 0.4.19", + "http 1.5.0", + "http-body 1.1.0", + "http-body-util", + "hyper 1.11.1", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "socket2 0.6.5", + "sync_wrapper 1.0.2", + "tokio", + "tokio-stream", + "tower 0.5.3", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-build" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1882ac3bf5ef12877d7ed57aad87e75154c11931c2ba7e6cde5e22d63522c734" +dependencies = [ + "prettyplease 0.2.37", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tonic-openssl" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdbfb21caba7f65ed3db8d655ef1ee0bd4830520db89b37122cf9bdd9fba54bc" +dependencies = [ + "async-stream", + "futures", + "hyper 1.11.1", + "hyper-util", + "openssl", + "tokio", + "tokio-openssl", + "tonic 0.12.3", + "tower 0.5.3", + "tracing", +] + +[[package]] +name = "tonic-prost" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55376a0bbaa4975a3f10d009ad763d8f4108f067c7c2e74f3001fb49778d309" +dependencies = [ + "bytes", + "prost 0.14.4", + "tonic 0.14.5", +] + +[[package]] +name = "tonic-prost-build" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3144df636917574672e93d0f56d7edec49f90305749c668df5101751bb8f95a" +dependencies = [ + "prettyplease 0.2.37", + "proc-macro2", + "prost-build 0.14.4", + "prost-types 0.14.4", + "quote", + "syn 2.0.119", + "tempfile", + "tonic-build", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand 0.8.8", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 2.14.1", + "pin-project-lite", + "slab", + "sync_wrapper 1.0.2", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags 2.13.1", + "bytes", + "futures-util", + "http 1.5.0", + "http-body 1.1.0", + "pin-project-lite", + "tower 0.5.3", + "tower-layer", + "tower-service", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "uniffi" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cb08c58c7ed7033150132febe696bef553f891b1ede57424b40d87a89e3c170" +dependencies = [ + "anyhow", + "cargo_metadata", + "uniffi_bindgen", + "uniffi_build", + "uniffi_core", + "uniffi_macros", +] + +[[package]] +name = "uniffi_bindgen" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cade167af943e189a55020eda2c314681e223f1e42aca7c4e52614c2b627698f" +dependencies = [ + "anyhow", + "askama", + "camino", + "cargo_metadata", + "fs-err", + "glob", + "goblin", + "heck 0.5.0", + "once_cell", + "paste", + "serde", + "textwrap", + "toml", + "uniffi_meta", + "uniffi_udl", +] + +[[package]] +name = "uniffi_build" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7cf32576e08104b7dc2a6a5d815f37616e66c6866c2a639fe16e6d2286b75b" +dependencies = [ + "anyhow", + "camino", + "uniffi_bindgen", +] + +[[package]] +name = "uniffi_checksum_derive" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "802d2051a700e3ec894c79f80d2705b69d85844dafbbe5d1a92776f8f48b563a" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "uniffi_core" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7687007d2546c454d8ae609b105daceb88175477dac280707ad6d95bcd6f1f" +dependencies = [ + "anyhow", + "bytes", + "log", + "once_cell", + "paste", + "static_assertions", +] + +[[package]] +name = "uniffi_macros" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12c65a5b12ec544ef136693af8759fb9d11aefce740fb76916721e876639033b" +dependencies = [ + "bincode", + "camino", + "fs-err", + "once_cell", + "proc-macro2", + "quote", + "serde", + "syn 2.0.119", + "toml", + "uniffi_meta", +] + +[[package]] +name = "uniffi_meta" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a74ed96c26882dac1ca9b93ca23c827e284bacbd7ec23c6f0b0372f747d59e4" +dependencies = [ + "anyhow", + "bytes", + "siphasher", + "uniffi_checksum_derive", +] + +[[package]] +name = "uniffi_testing" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6f984f0781f892cc864a62c3a5c60361b1ccbd68e538e6c9fbced5d82268ac" +dependencies = [ + "anyhow", + "camino", + "cargo_metadata", + "fs-err", + "once_cell", +] + +[[package]] +name = "uniffi_udl" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037820a4cfc4422db1eaa82f291a3863c92c7d1789dc513489c36223f9b4cdfc" +dependencies = [ + "anyhow", + "textwrap", + "uniffi_meta", + "uniffi_testing", + "weedle2", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vss-client" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d787f7640ceae8caef95434f1b14936402b73e18d34868b052a502a5d5085490" +dependencies = [ + "async-trait", + "base64 0.21.7", + "bitcoin", + "bitcoin_hashes", + "prost 0.11.9", + "prost-build 0.11.9", + "rand 0.8.8", + "reqwest 0.11.27", + "serde", + "serde_json", + "tokio", + "url", +] + +[[package]] +name = "vss-client-ng" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05f61751537ec3e7cf744e6ed8a56830b8d048f9862871cb4b9c239e3d23b45" +dependencies = [ + "async-trait", + "base64 0.22.1", + "bitcoin", + "bitcoin_hashes", + "chacha20-poly1305", + "log", + "prost 0.11.9", + "prost-build 0.11.9", + "rand 0.8.8", + "reqwest 0.12.28", + "serde", + "serde_json", + "tokio", + "url", +] + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b7777d5cc23d0e91404e53ce2d5e8ec7acae3026b16233dba62cd3246457950" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.119", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c435338968042f4f59a557f690a253676d47ce13ceb55d70100e7facf6620a30" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "webpki-roots" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "weedle2" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e" +dependencies = [ + "nom", +] + +[[package]] +name = "which" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" +dependencies = [ + "libc", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix 0.38.44", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "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_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[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_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wit-bindgen" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "xattr" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" +dependencies = [ + "libc", + "rustix 1.1.4", +] + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "bzip2", + "crc32fast", + "crossbeam-utils", + "flate2", +] + +[[package]] +name = "zlib-rs" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34b31d188d9d685a4f9c7b46d6e36631b07058d2cfe190267adce54dc230bf12" + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/bindings/README.md b/bindings/README.md index 501d581825..217773e642 100644 --- a/bindings/README.md +++ b/bindings/README.md @@ -1,20 +1,20 @@ -## Generating the Bindings +## Generating the bindings + +Run from the repository root: -## Build All Bindings -Run in the root dir: ```sh ./bindgen.sh ``` ---- - -Detailed instructions for publishing a new version of the bindings. +## Publishing a binding release -1. Update `Cargo.toml` -2. Update `version` in: - - `bindings/kotlin/ldk-node-android/gradle.properties` - - `bindings/kotlin/ldk-node-jvm/gradle.properties` -3. Run the above command to build all bindings -4. Open a PR with the changes -5. Create a new GitHub release with a new tag like `v0.1.0`, uploading the following files: - - `bindings/swift/LDKNodeFFI.xcframework.zip` +1. Update the version in `Cargo.toml`, `bindings/kotlin/ldk-node-android/gradle.properties`, `bindings/kotlin/ldk-node-jvm/gradle.properties`, `bindings/python/pyproject.toml`, and the release tag in `Package.swift`. +2. Refresh `Cargo.lock` with `cargo update -w`. +3. Update the existing Synonym fork heading and additions subsection in `CHANGELOG.md`. +4. Run `./bindgen.sh` from the repository root. +5. Commit `Cargo.lock`, the generated Swift, Kotlin Android, and Python sources, and the updated `Package.swift` checksum. +6. Push every release change before tagging the release commit. +7. Verify that `shasum -a 256 bindings/swift/LDKNodeFFI.xcframework.zip` matches the checksum in `Package.swift`. +8. Write concise, consumer-facing release notes covering only Rust, FFI, and binding changes since the previous release. +9. Publish the tag as the latest GitHub release and upload `bindings/swift/LDKNodeFFI.xcframework.zip`. +10. Add the release link to the PR description. diff --git a/bindings/kotlin/ldk-node-android/README.md b/bindings/kotlin/ldk-node-android/README.md index 68f1b2955f..7007a5bd45 100644 --- a/bindings/kotlin/ldk-node-android/README.md +++ b/bindings/kotlin/ldk-node-android/README.md @@ -1,35 +1,33 @@ ## Publishing -Publishing new version guide. -1. Run in root dir - `sh scripts/uniffi_bindgen_generate_kotlin_android.sh` +Follow the [binding release guide](../../README.md). Run `./bindgen.sh` from the repository root; do not run the child generation scripts directly. Commit the generated Kotlin sources. The Android publishing workflow rebuilds the JNI libraries before packaging the AAR. -1. Update `version` in `bindings/kotlin/ldk-node-android/gradle.properties`. +## Consuming -1. Commit +In the Android project: -1. Push new branch (or new tag) +- In `settings.gradle.kts`, add the GitHub Packages repository: -1. In the android project: - - - in `settings.gradle.kts` add GitHub Packages repository: - - ```kt - dependencyResolutionManagement { - repositories { - google() - mavenCentral() - maven { - url = uri("https://maven.pkg.github.com/synonymdev/ldk-node") - credentials { - username = providers.gradleProperty("gpr.user").orNull ?: System.getenv("GITHUB_ACTOR") - password = providers.gradleProperty("gpr.key").orNull ?: System.getenv("GITHUB_TOKEN") - } + ```kt + dependencyResolutionManagement { + repositories { + google() + mavenCentral() + maven { + url = uri("https://maven.pkg.github.com/synonymdev/ldk-node") + credentials { + username = providers.gradleProperty("gpr.user").orNull ?: System.getenv("GITHUB_ACTOR") + password = providers.gradleProperty("gpr.key").orNull ?: System.getenv("GITHUB_TOKEN") } } - ``` - - add dependency in `libs.versions.toml`: - ```toml - ldk-node-android = { module = "com.synonym:ldk-node-android", version = "0.7.0-rc.26" } - ``` - - Run `Sync project with gradle files` action in android studio + } + } + ``` + +- Add the dependency in `libs.versions.toml`: + + ```toml + ldk-node-android = { module = "com.synonym:ldk-node-android", version = "0.7.0-rc.26" } + ``` + +- Run the `Sync project with gradle files` action in Android Studio. diff --git a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/arm64-v8a/libldk_node.so b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/arm64-v8a/libldk_node.so deleted file mode 100755 index d6447f3f2e..0000000000 Binary files a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/arm64-v8a/libldk_node.so and /dev/null differ diff --git a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/armeabi-v7a/libldk_node.so b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/armeabi-v7a/libldk_node.so deleted file mode 100755 index 5d503a817a..0000000000 Binary files a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/armeabi-v7a/libldk_node.so and /dev/null differ diff --git a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/x86_64/libldk_node.so b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/x86_64/libldk_node.so deleted file mode 100755 index a432cf6f4b..0000000000 Binary files a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/x86_64/libldk_node.so and /dev/null differ diff --git a/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt b/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt deleted file mode 100644 index c51632c07a..0000000000 --- a/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt +++ /dev/null @@ -1,2575 +0,0 @@ - - -@file:Suppress("RemoveRedundantBackticks") - -package org.lightningdevkit.ldknode - -// Common helper code. -// -// Ideally this would live in a separate .kt file where it can be unittested etc -// in isolation, and perhaps even published as a re-useable package. -// -// However, it's important that the details of how this helper code works (e.g. the -// way that different builtin types are passed across the FFI) exactly match what's -// expected by the Rust code on the other side of the interface. In practice right -// now that means coming from the exact some version of `uniffi` that was used to -// compile the Rust component. The easiest way to ensure this is to bundle the Kotlin -// helpers directly inline like we're doing here. - -class InternalException(message: String) : kotlin.Exception(message) - -// Public interface members begin here. - - -// Interface implemented by anything that can contain an object reference. -// -// Such types expose a `destroy()` method that must be called to cleanly -// dispose of the contained objects. Failure to call this method may result -// in memory leaks. -// -// The easiest way to ensure this method is called is to use the `.use` -// helper method to execute a block and destroy the object at the end. -@OptIn(ExperimentalStdlibApi::class) -interface Disposable : AutoCloseable { - fun destroy() - override fun close() = destroy() - companion object { - internal fun destroy(vararg args: Any?) { - for (arg in args) { - when (arg) { - is Disposable -> arg.destroy() - is Iterable<*> -> { - for (element in arg) { - if (element is Disposable) { - element.destroy() - } - } - } - is Map<*, *> -> { - for (element in arg.values) { - if (element is Disposable) { - element.destroy() - } - } - } - is Array<*> -> { - for (element in arg) { - if (element is Disposable) { - element.destroy() - } - } - } - } - } - } - } -} - -@OptIn(kotlin.contracts.ExperimentalContracts::class) -inline fun T.use(block: (T) -> R): R { - kotlin.contracts.contract { - callsInPlace(block, kotlin.contracts.InvocationKind.EXACTLY_ONCE) - } - return try { - block(this) - } finally { - try { - // N.B. our implementation is on the nullable type `Disposable?`. - this?.destroy() - } catch (e: Throwable) { - // swallow - } - } -} - -/** Used to instantiate an interface without an actual pointer, for fakes in tests, mostly. */ -object NoPointer - - - - - - - - - - - - - - - - - - - -interface Bolt11InvoiceInterface { - - fun `amountMilliSatoshis`(): kotlin.ULong? - - fun `currency`(): Currency - - fun `expiryTimeSeconds`(): kotlin.ULong - - fun `fallbackAddresses`(): List
- - fun `invoiceDescription`(): Bolt11InvoiceDescription - - fun `isExpired`(): kotlin.Boolean - - fun `minFinalCltvExpiryDelta`(): kotlin.ULong - - fun `network`(): Network - - fun `paymentHash`(): PaymentHash - - fun `paymentSecret`(): PaymentSecret - - fun `recoverPayeePubKey`(): PublicKey - - fun `routeHints`(): List> - - fun `secondsSinceEpoch`(): kotlin.ULong - - fun `secondsUntilExpiry`(): kotlin.ULong - - fun `signableHash`(): List - - fun `wouldExpire`(`atTimeSeconds`: kotlin.ULong): kotlin.Boolean - - companion object -} - - - - -interface Bolt11PaymentInterface { - - @Throws(NodeException::class) - fun `claimForHash`(`paymentHash`: PaymentHash, `claimableAmountMsat`: kotlin.ULong, `preimage`: PaymentPreimage) - - @Throws(NodeException::class) - fun `estimateRoutingFees`(`invoice`: Bolt11Invoice): kotlin.ULong - - @Throws(NodeException::class) - fun `estimateRoutingFeesUsingAmount`(`invoice`: Bolt11Invoice, `amountMsat`: kotlin.ULong): kotlin.ULong - - @Throws(NodeException::class) - fun `failForHash`(`paymentHash`: PaymentHash) - - @Throws(NodeException::class) - fun `receive`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt): Bolt11Invoice - - @Throws(NodeException::class) - fun `receiveForHash`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `paymentHash`: PaymentHash): Bolt11Invoice - - @Throws(NodeException::class) - fun `receiveVariableAmount`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt): Bolt11Invoice - - @Throws(NodeException::class) - fun `receiveVariableAmountForHash`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `paymentHash`: PaymentHash): Bolt11Invoice - - @Throws(NodeException::class) - fun `receiveVariableAmountViaJitChannel`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxProportionalLspFeeLimitPpmMsat`: kotlin.ULong?): Bolt11Invoice - - @Throws(NodeException::class) - fun `receiveVariableAmountViaJitChannelForHash`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxProportionalLspFeeLimitPpmMsat`: kotlin.ULong?, `paymentHash`: PaymentHash): Bolt11Invoice - - @Throws(NodeException::class) - fun `receiveViaJitChannel`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxLspFeeLimitMsat`: kotlin.ULong?): Bolt11Invoice - - @Throws(NodeException::class) - fun `receiveViaJitChannelForHash`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxLspFeeLimitMsat`: kotlin.ULong?, `paymentHash`: PaymentHash): Bolt11Invoice - - @Throws(NodeException::class) - fun `send`(`invoice`: Bolt11Invoice, `routeParameters`: RouteParametersConfig?): PaymentId - - @Throws(NodeException::class) - fun `sendProbes`(`invoice`: Bolt11Invoice, `routeParameters`: RouteParametersConfig?): List - - @Throws(NodeException::class) - fun `sendProbesUsingAmount`(`invoice`: Bolt11Invoice, `amountMsat`: kotlin.ULong, `routeParameters`: RouteParametersConfig?): List - - @Throws(NodeException::class) - fun `sendUsingAmount`(`invoice`: Bolt11Invoice, `amountMsat`: kotlin.ULong, `routeParameters`: RouteParametersConfig?): PaymentId - - companion object -} - - - - -interface Bolt12InvoiceInterface { - - fun `absoluteExpirySeconds`(): kotlin.ULong? - - fun `amount`(): OfferAmount? - - fun `amountMsats`(): kotlin.ULong - - fun `chain`(): List - - fun `createdAt`(): kotlin.ULong - - fun `encode`(): List - - fun `fallbackAddresses`(): List
- - fun `invoiceDescription`(): kotlin.String? - - fun `isExpired`(): kotlin.Boolean - - fun `issuer`(): kotlin.String? - - fun `issuerSigningPubkey`(): PublicKey? - - fun `metadata`(): List? - - fun `offerChains`(): List>? - - fun `payerNote`(): kotlin.String? - - fun `payerSigningPubkey`(): PublicKey - - fun `paymentHash`(): PaymentHash - - fun `quantity`(): kotlin.ULong? - - fun `relativeExpiry`(): kotlin.ULong - - fun `signableHash`(): List - - fun `signingPubkey`(): PublicKey - - companion object -} - - - - -interface Bolt12PaymentInterface { - - @Throws(NodeException::class) - fun `blindedPathsForAsyncRecipient`(`recipientId`: kotlin.ByteArray): kotlin.ByteArray - - @Throws(NodeException::class) - fun `initiateRefund`(`amountMsat`: kotlin.ULong, `expirySecs`: kotlin.UInt, `quantity`: kotlin.ULong?, `payerNote`: kotlin.String?, `routeParameters`: RouteParametersConfig?): Refund - - @Throws(NodeException::class) - fun `receive`(`amountMsat`: kotlin.ULong, `description`: kotlin.String, `expirySecs`: kotlin.UInt?, `quantity`: kotlin.ULong?): Offer - - @Throws(NodeException::class) - fun `receiveAsync`(): Offer - - @Throws(NodeException::class) - fun `receiveVariableAmount`(`description`: kotlin.String, `expirySecs`: kotlin.UInt?): Offer - - @Throws(NodeException::class) - fun `requestRefundPayment`(`refund`: Refund): Bolt12Invoice - - @Throws(NodeException::class) - fun `send`(`offer`: Offer, `quantity`: kotlin.ULong?, `payerNote`: kotlin.String?, `routeParameters`: RouteParametersConfig?): PaymentId - - @Throws(NodeException::class) - fun `sendUsingAmount`(`offer`: Offer, `amountMsat`: kotlin.ULong, `quantity`: kotlin.ULong?, `payerNote`: kotlin.String?, `routeParameters`: RouteParametersConfig?): PaymentId - - @Throws(NodeException::class) - fun `setPathsToStaticInvoiceServer`(`paths`: kotlin.ByteArray) - - companion object -} - - - - -interface BuilderInterface { - - @Throws(BuildException::class) - fun `build`(): Node - - @Throws(BuildException::class) - fun `buildWithFsStore`(): Node - - @Throws(BuildException::class) - fun `buildWithVssStore`(`vssUrl`: kotlin.String, `storeId`: kotlin.String, `lnurlAuthServerUrl`: kotlin.String, `fixedHeaders`: Map): Node - - @Throws(BuildException::class) - fun `buildWithVssStoreAndFixedHeaders`(`vssUrl`: kotlin.String, `storeId`: kotlin.String, `fixedHeaders`: Map): Node - - @Throws(BuildException::class) - fun `buildWithVssStoreAndHeaderProvider`(`vssUrl`: kotlin.String, `storeId`: kotlin.String, `headerProvider`: VssHeaderProvider): Node - - fun `setAddressType`(`addressType`: AddressType) - - fun `setAddressTypesToMonitor`(`addressTypesToMonitor`: List) - - @Throws(BuildException::class) - fun `setAnnouncementAddresses`(`announcementAddresses`: List) - - @Throws(BuildException::class) - fun `setAsyncPaymentsRole`(`role`: AsyncPaymentsRole?) - - fun `setChainSourceBitcoindRest`(`restHost`: kotlin.String, `restPort`: kotlin.UShort, `rpcHost`: kotlin.String, `rpcPort`: kotlin.UShort, `rpcUser`: kotlin.String, `rpcPassword`: kotlin.String) - - fun `setChainSourceBitcoindRpc`(`rpcHost`: kotlin.String, `rpcPort`: kotlin.UShort, `rpcUser`: kotlin.String, `rpcPassword`: kotlin.String) - - fun `setChainSourceElectrum`(`serverUrl`: kotlin.String, `config`: ElectrumSyncConfig?) - - fun `setChainSourceEsplora`(`serverUrl`: kotlin.String, `config`: EsploraSyncConfig?) - - fun `setChannelDataMigration`(`migration`: ChannelDataMigration) - - fun `setCustomLogger`(`logWriter`: LogWriter) - - fun `setEntropyBip39Mnemonic`(`mnemonic`: Mnemonic, `passphrase`: kotlin.String?) - - @Throws(BuildException::class) - fun `setEntropySeedBytes`(`seedBytes`: List) - - fun `setEntropySeedPath`(`seedPath`: kotlin.String) - - fun `setFilesystemLogger`(`logFilePath`: kotlin.String?, `maxLogLevel`: LogLevel?) - - fun `setGossipSourceP2p`() - - fun `setGossipSourceRgs`(`rgsServerUrl`: kotlin.String) - - fun `setLiquiditySourceLsps1`(`nodeId`: PublicKey, `address`: SocketAddress, `token`: kotlin.String?) - - fun `setLiquiditySourceLsps2`(`nodeId`: PublicKey, `address`: SocketAddress, `token`: kotlin.String?) - - @Throws(BuildException::class) - fun `setListeningAddresses`(`listeningAddresses`: List) - - fun `setLogFacadeLogger`() - - fun `setNetwork`(`network`: Network) - - @Throws(BuildException::class) - fun `setNodeAlias`(`nodeAlias`: kotlin.String) - - fun `setPathfindingScoresSource`(`url`: kotlin.String) - - fun `setScoringDecayParams`(`params`: ScoringDecayParameters) - - fun `setScoringFeeParams`(`params`: ScoringFeeParameters) - - fun `setStorageDirPath`(`storageDirPath`: kotlin.String) - - companion object -} - - - - -interface FeeRateInterface { - - fun `toSatPerKwu`(): kotlin.ULong - - fun `toSatPerVbCeil`(): kotlin.ULong - - fun `toSatPerVbFloor`(): kotlin.ULong - - companion object -} - - - - -interface Lsps1LiquidityInterface { - - @Throws(NodeException::class) - fun `checkOrderStatus`(`orderId`: Lsps1OrderId): Lsps1OrderStatus - - @Throws(NodeException::class) - fun `requestChannel`(`lspBalanceSat`: kotlin.ULong, `clientBalanceSat`: kotlin.ULong, `channelExpiryBlocks`: kotlin.UInt, `announceChannel`: kotlin.Boolean): Lsps1OrderStatus - - companion object -} - - - - -interface LogWriter { - - fun `log`(`record`: LogRecord) - - companion object -} - - - - -interface NetworkGraphInterface { - - fun `channel`(`shortChannelId`: kotlin.ULong): ChannelInfo? - - fun `listChannels`(): List - - fun `listNodes`(): List - - fun `node`(`nodeId`: NodeId): NodeInfo? - - companion object -} - - - - -interface NodeInterface { - - @Throws(NodeException::class) - fun `addAddressTypeToMonitor`(`addressType`: AddressType, `seedBytes`: List) - - @Throws(NodeException::class) - fun `addAddressTypeToMonitorWithMnemonic`(`addressType`: AddressType, `mnemonic`: Mnemonic, `passphrase`: kotlin.String?) - - @Throws(NodeException::class) - fun `addOnchainWalletAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt, `xpub`: kotlin.String) - - fun `announcementAddresses`(): List? - - fun `bolt11Payment`(): Bolt11Payment - - fun `bolt12Payment`(): Bolt12Payment - - @Throws(NodeException::class) - fun `closeChannel`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey) - - fun `config`(): Config - - @Throws(NodeException::class) - fun `connect`(`nodeId`: PublicKey, `address`: SocketAddress, `persist`: kotlin.Boolean) - - fun `currentSyncIntervals`(): RuntimeSyncIntervals - - @Throws(NodeException::class) - fun `disconnect`(`nodeId`: PublicKey) - - @Throws(NodeException::class) - fun `eventHandled`() - - @Throws(NodeException::class) - fun `exportOnchainWalletAccountXpub`(`addressType`: AddressType, `accountIndex`: kotlin.UInt): kotlin.String - - @Throws(NodeException::class) - fun `exportPathfindingScores`(): kotlin.ByteArray - - @Throws(NodeException::class) - fun `forceCloseChannel`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `reason`: kotlin.String?) - - @Throws(NodeException::class) - fun `getAddressBalance`(`addressStr`: kotlin.String): kotlin.ULong - - @Throws(NodeException::class) - fun `getBalanceForAddressType`(`addressType`: AddressType): AddressTypeBalance - - @Throws(NodeException::class) - fun `getBalanceForOnchainWalletAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt): AddressTypeBalance - - fun `getTransactionDetails`(`txid`: Txid): TransactionDetails? - - fun `listBalances`(): BalanceDetails - - fun `listChannels`(): List - - fun `listMonitoredAddressTypes`(): List - - fun `listOnchainWalletAccounts`(): List - - fun `listPayments`(): List - - fun `listPeers`(): List - - fun `listeningAddresses`(): List? - - fun `lsps1Liquidity`(): Lsps1Liquidity - - fun `networkGraph`(): NetworkGraph - - fun `nextEvent`(): Event? - - suspend fun `nextEventAsync`(): Event - - fun `nodeAlias`(): NodeAlias? - - fun `nodeId`(): PublicKey - - fun `onchainPayment`(): OnchainPayment - - @Throws(NodeException::class) - fun `openAnnouncedChannel`(`nodeId`: PublicKey, `address`: SocketAddress, `channelAmountSats`: kotlin.ULong, `pushToCounterpartyMsat`: kotlin.ULong?, `channelConfig`: ChannelConfig?): UserChannelId - - @Throws(NodeException::class) - fun `openChannel`(`nodeId`: PublicKey, `address`: SocketAddress, `channelAmountSats`: kotlin.ULong, `pushToCounterpartyMsat`: kotlin.ULong?, `channelConfig`: ChannelConfig?): UserChannelId - - fun `payment`(`paymentId`: PaymentId): PaymentDetails? - - @Throws(NodeException::class) - fun `removeAddressTypeFromMonitor`(`addressType`: AddressType) - - @Throws(NodeException::class) - fun `removeOnchainWalletAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt) - - @Throws(NodeException::class) - fun `removePayment`(`paymentId`: PaymentId) - - @Throws(NodeException::class) - fun `setPrimaryAddressType`(`addressType`: AddressType, `seedBytes`: List) - - @Throws(NodeException::class) - fun `setPrimaryAddressTypeWithMnemonic`(`addressType`: AddressType, `mnemonic`: Mnemonic, `passphrase`: kotlin.String?) - - fun `signMessage`(`msg`: List): kotlin.String - - @Throws(NodeException::class) - fun `spliceIn`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `spliceAmountSats`: kotlin.ULong) - - @Throws(NodeException::class) - fun `spliceOut`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `address`: Address, `spliceAmountSats`: kotlin.ULong) - - fun `spontaneousPayment`(): SpontaneousPayment - - @Throws(NodeException::class) - fun `start`() - - fun `status`(): NodeStatus - - @Throws(NodeException::class) - fun `stop`() - - @Throws(NodeException::class) - fun `syncWallets`() - - fun `unifiedQrPayment`(): UnifiedQrPayment - - @Throws(NodeException::class) - fun `updateChannelConfig`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `channelConfig`: ChannelConfig) - - @Throws(NodeException::class) - fun `updateSyncIntervals`(`intervals`: RuntimeSyncIntervals) - - fun `verifySignature`(`msg`: List, `sig`: kotlin.String, `pkey`: PublicKey): kotlin.Boolean - - fun `waitNextEvent`(): Event - - companion object -} - - - - -interface OfferInterface { - - fun `absoluteExpirySeconds`(): kotlin.ULong? - - fun `amount`(): OfferAmount? - - fun `chains`(): List - - fun `expectsQuantity`(): kotlin.Boolean - - fun `id`(): OfferId - - fun `isExpired`(): kotlin.Boolean - - fun `isValidQuantity`(`quantity`: kotlin.ULong): kotlin.Boolean - - fun `issuer`(): kotlin.String? - - fun `issuerSigningPubkey`(): PublicKey? - - fun `metadata`(): List? - - fun `offerDescription`(): kotlin.String? - - fun `supportsChain`(`chain`: Network): kotlin.Boolean - - companion object -} - - - - -interface OnchainPaymentInterface { - - @Throws(NodeException::class) - fun `accelerateByCpfp`(`txid`: Txid, `feeRate`: FeeRate?, `destinationAddress`: Address?): Txid - - @Throws(NodeException::class) - fun `addressInfoForAccountAtIndex`(`addressType`: AddressType, `accountIndex`: kotlin.UInt, `keychain`: KeychainKind, `index`: kotlin.UInt): AddressInfo - - @Throws(NodeException::class) - fun `addressInfoForTypeAtIndex`(`addressType`: AddressType, `keychain`: KeychainKind, `index`: kotlin.UInt): AddressInfo - - @Throws(NodeException::class) - fun `addressInfosForAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt, `keychain`: KeychainKind, `startIndex`: kotlin.UInt, `count`: kotlin.UInt): List - - @Throws(NodeException::class) - fun `addressInfosForType`(`addressType`: AddressType, `keychain`: KeychainKind, `startIndex`: kotlin.UInt, `count`: kotlin.UInt): List - - @Throws(NodeException::class) - fun `bumpFeeByRbf`(`txid`: Txid, `feeRate`: FeeRate): Txid - - @Throws(NodeException::class) - fun `calculateCpfpFeeRate`(`parentTxid`: Txid, `urgent`: kotlin.Boolean): FeeRate - - @Throws(NodeException::class) - fun `calculateSendAllFee`(`address`: Address, `retainReserves`: kotlin.Boolean, `feeRate`: FeeRate?): kotlin.ULong - - @Throws(NodeException::class) - fun `calculateTotalFee`(`address`: Address, `amountSats`: kotlin.ULong, `feeRate`: FeeRate?, `utxosToSpend`: List?): kotlin.ULong - - @Throws(NodeException::class) - fun `listSpendableOutputs`(): List - - @Throws(NodeException::class) - fun `newAddress`(): Address - - @Throws(NodeException::class) - fun `newAddressForAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt): Address - - @Throws(NodeException::class) - fun `newAddressForType`(`addressType`: AddressType): Address - - @Throws(NodeException::class) - fun `newAddressInfo`(): AddressInfo - - @Throws(NodeException::class) - fun `newAddressInfoForAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt): AddressInfo - - @Throws(NodeException::class) - fun `newAddressInfoForType`(`addressType`: AddressType): AddressInfo - - @Throws(NodeException::class) - fun `revealReceiveAddressesTo`(`addressType`: AddressType, `index`: kotlin.UInt) - - @Throws(NodeException::class) - fun `revealReceiveAddressesToAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt, `index`: kotlin.UInt) - - @Throws(NodeException::class) - fun `selectUtxosWithAlgorithm`(`targetAmountSats`: kotlin.ULong, `feeRate`: FeeRate?, `algorithm`: CoinSelectionAlgorithm, `utxos`: List?): List - - @Throws(NodeException::class) - fun `sendAllToAddress`(`address`: Address, `retainReserve`: kotlin.Boolean, `feeRate`: FeeRate?): Txid - - @Throws(NodeException::class) - fun `sendToAddress`(`address`: Address, `amountSats`: kotlin.ULong, `feeRate`: FeeRate?, `utxosToSpend`: List?): Txid - - companion object -} - - - - -interface RefundInterface { - - fun `absoluteExpirySeconds`(): kotlin.ULong? - - fun `amountMsats`(): kotlin.ULong - - fun `chain`(): Network? - - fun `isExpired`(): kotlin.Boolean - - fun `issuer`(): kotlin.String? - - fun `payerMetadata`(): List - - fun `payerNote`(): kotlin.String? - - fun `payerSigningPubkey`(): PublicKey - - fun `quantity`(): kotlin.ULong? - - fun `refundDescription`(): kotlin.String - - companion object -} - - - - -interface SpontaneousPaymentInterface { - - @Throws(NodeException::class) - fun `send`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `routeParameters`: RouteParametersConfig?): PaymentId - - @Throws(NodeException::class) - fun `sendProbes`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey): List - - @Throws(NodeException::class) - fun `sendWithCustomTlvs`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `routeParameters`: RouteParametersConfig?, `customTlvs`: List): PaymentId - - @Throws(NodeException::class) - fun `sendWithPreimage`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `preimage`: PaymentPreimage, `routeParameters`: RouteParametersConfig?): PaymentId - - @Throws(NodeException::class) - fun `sendWithPreimageAndCustomTlvs`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `customTlvs`: List, `preimage`: PaymentPreimage, `routeParameters`: RouteParametersConfig?): PaymentId - - companion object -} - - - - -interface UnifiedQrPaymentInterface { - - @Throws(NodeException::class) - fun `receive`(`amountSats`: kotlin.ULong, `message`: kotlin.String, `expirySec`: kotlin.UInt): kotlin.String - - @Throws(NodeException::class) - fun `send`(`uriStr`: kotlin.String, `routeParameters`: RouteParametersConfig?): QrPaymentResult - - companion object -} - - - - -interface VssHeaderProviderInterface { - - @Throws(VssHeaderProviderException::class, kotlin.coroutines.cancellation.CancellationException::class) - suspend fun `getHeaders`(`request`: List): Map - - companion object -} - - - - -@kotlinx.serialization.Serializable -data class AddressInfo ( - val `index`: kotlin.UInt, - val `address`: Address, - val `keychain`: KeychainKind -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class AddressTypeBalance ( - val `totalSats`: kotlin.ULong, - val `spendableSats`: kotlin.ULong -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class AnchorChannelsConfig ( - val `trustedPeersNoReserve`: List, - val `perChannelReserveSats`: kotlin.ULong -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class BackgroundSyncConfig ( - val `onchainWalletSyncIntervalSecs`: kotlin.ULong, - val `lightningWalletSyncIntervalSecs`: kotlin.ULong, - val `feeRateCacheUpdateIntervalSecs`: kotlin.ULong -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class BalanceDetails ( - val `totalOnchainBalanceSats`: kotlin.ULong, - val `spendableOnchainBalanceSats`: kotlin.ULong, - val `totalAnchorChannelsReserveSats`: kotlin.ULong, - val `totalLightningBalanceSats`: kotlin.ULong, - val `lightningBalances`: List, - val `pendingBalancesFromChannelClosures`: List -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class BestBlock ( - val `blockHash`: BlockHash, - val `height`: kotlin.UInt -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class ChannelConfig ( - val `forwardingFeeProportionalMillionths`: kotlin.UInt, - val `forwardingFeeBaseMsat`: kotlin.UInt, - val `cltvExpiryDelta`: kotlin.UShort, - val `maxDustHtlcExposure`: MaxDustHtlcExposure, - val `forceCloseAvoidanceMaxFeeSatoshis`: kotlin.ULong, - val `acceptUnderpayingHtlcs`: kotlin.Boolean -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class ChannelDataMigration ( - val `channelManager`: List?, - val `channelMonitors`: List> -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class ChannelDetails ( - val `channelId`: ChannelId, - val `counterpartyNodeId`: PublicKey, - val `fundingTxo`: OutPoint?, - val `shortChannelId`: kotlin.ULong?, - val `outboundScidAlias`: kotlin.ULong?, - val `inboundScidAlias`: kotlin.ULong?, - val `channelValueSats`: kotlin.ULong, - val `unspendablePunishmentReserve`: kotlin.ULong?, - val `userChannelId`: UserChannelId, - val `feerateSatPer1000Weight`: kotlin.UInt, - val `outboundCapacityMsat`: kotlin.ULong, - val `inboundCapacityMsat`: kotlin.ULong, - val `confirmationsRequired`: kotlin.UInt?, - val `confirmations`: kotlin.UInt?, - val `isOutbound`: kotlin.Boolean, - val `isChannelReady`: kotlin.Boolean, - val `isUsable`: kotlin.Boolean, - val `isAnnounced`: kotlin.Boolean, - val `cltvExpiryDelta`: kotlin.UShort?, - val `counterpartyUnspendablePunishmentReserve`: kotlin.ULong, - val `counterpartyOutboundHtlcMinimumMsat`: kotlin.ULong?, - val `counterpartyOutboundHtlcMaximumMsat`: kotlin.ULong?, - val `counterpartyForwardingInfoFeeBaseMsat`: kotlin.UInt?, - val `counterpartyForwardingInfoFeeProportionalMillionths`: kotlin.UInt?, - val `counterpartyForwardingInfoCltvExpiryDelta`: kotlin.UShort?, - val `nextOutboundHtlcLimitMsat`: kotlin.ULong, - val `nextOutboundHtlcMinimumMsat`: kotlin.ULong, - val `forceCloseSpendDelay`: kotlin.UShort?, - val `inboundHtlcMinimumMsat`: kotlin.ULong, - val `inboundHtlcMaximumMsat`: kotlin.ULong?, - val `config`: ChannelConfig, - val `claimableOnCloseSats`: kotlin.ULong? -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class ChannelInfo ( - val `nodeOne`: NodeId, - val `oneToTwo`: ChannelUpdateInfo?, - val `nodeTwo`: NodeId, - val `twoToOne`: ChannelUpdateInfo?, - val `capacitySats`: kotlin.ULong? -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class ChannelUpdateInfo ( - val `lastUpdate`: kotlin.UInt, - val `enabled`: kotlin.Boolean, - val `cltvExpiryDelta`: kotlin.UShort, - val `htlcMinimumMsat`: kotlin.ULong, - val `htlcMaximumMsat`: kotlin.ULong, - val `fees`: RoutingFees -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class Config ( - val `storageDirPath`: kotlin.String, - val `network`: Network, - val `listeningAddresses`: List?, - val `announcementAddresses`: List?, - val `nodeAlias`: NodeAlias?, - val `trustedPeers0conf`: List, - val `probingLiquidityLimitMultiplier`: kotlin.ULong, - val `anchorChannelsConfig`: AnchorChannelsConfig?, - val `routeParameters`: RouteParametersConfig?, - val `scoringFeeParams`: ScoringFeeParameters?, - val `scoringDecayParams`: ScoringDecayParameters?, - val `includeUntrustedPendingInSpendable`: kotlin.Boolean, - val `addressType`: AddressType, - val `addressTypesToMonitor`: List, - val `onchainWalletAccounts`: List -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class CustomTlvRecord ( - val `typeNum`: kotlin.ULong, - val `value`: List -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class ElectrumSyncConfig ( - val `backgroundSyncConfig`: BackgroundSyncConfig?, - val `connectionTimeoutSecs`: kotlin.ULong, - val `additionalWalletFullScanBatchSize`: kotlin.UInt, - val `additionalWalletFullScanStopGap`: kotlin.UInt -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class EsploraSyncConfig ( - val `backgroundSyncConfig`: BackgroundSyncConfig? -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class LspFeeLimits ( - val `maxTotalOpeningFeeMsat`: kotlin.ULong?, - val `maxProportionalOpeningFeePpmMsat`: kotlin.ULong? -) { - companion object -} - - - - -data class Lsps1Bolt11PaymentInfo ( - val `state`: Lsps1PaymentState, - val `expiresAt`: LspsDateTime, - val `feeTotalSat`: kotlin.ULong, - val `orderTotalSat`: kotlin.ULong, - val `invoice`: Bolt11Invoice -) : Disposable { - override fun destroy() { - Disposable.destroy( - this.`state`, - this.`expiresAt`, - this.`feeTotalSat`, - this.`orderTotalSat`, - this.`invoice`, - ) - } - companion object -} - - - -@kotlinx.serialization.Serializable -data class Lsps1ChannelInfo ( - val `fundedAt`: LspsDateTime, - val `fundingOutpoint`: OutPoint, - val `expiresAt`: LspsDateTime -) { - companion object -} - - - - -data class Lsps1OnchainPaymentInfo ( - val `state`: Lsps1PaymentState, - val `expiresAt`: LspsDateTime, - val `feeTotalSat`: kotlin.ULong, - val `orderTotalSat`: kotlin.ULong, - val `address`: Address, - val `minOnchainPaymentConfirmations`: kotlin.UShort?, - val `minFeeFor0conf`: FeeRate, - val `refundOnchainAddress`: Address? -) : Disposable { - override fun destroy() { - Disposable.destroy( - this.`state`, - this.`expiresAt`, - this.`feeTotalSat`, - this.`orderTotalSat`, - this.`address`, - this.`minOnchainPaymentConfirmations`, - this.`minFeeFor0conf`, - this.`refundOnchainAddress`, - ) - } - companion object -} - - - -@kotlinx.serialization.Serializable -data class Lsps1OrderParams ( - val `lspBalanceSat`: kotlin.ULong, - val `clientBalanceSat`: kotlin.ULong, - val `requiredChannelConfirmations`: kotlin.UShort, - val `fundingConfirmsWithinBlocks`: kotlin.UShort, - val `channelExpiryBlocks`: kotlin.UInt, - val `token`: kotlin.String?, - val `announceChannel`: kotlin.Boolean -) { - companion object -} - - - - -data class Lsps1OrderStatus ( - val `orderId`: Lsps1OrderId, - val `orderParams`: Lsps1OrderParams, - val `paymentOptions`: Lsps1PaymentInfo, - val `channelState`: Lsps1ChannelInfo? -) : Disposable { - override fun destroy() { - Disposable.destroy( - this.`orderId`, - this.`orderParams`, - this.`paymentOptions`, - this.`channelState`, - ) - } - companion object -} - - - - -data class Lsps1PaymentInfo ( - val `bolt11`: Lsps1Bolt11PaymentInfo?, - val `onchain`: Lsps1OnchainPaymentInfo? -) : Disposable { - override fun destroy() { - Disposable.destroy( - this.`bolt11`, - this.`onchain`, - ) - } - companion object -} - - - -@kotlinx.serialization.Serializable -data class Lsps2ServiceConfig ( - val `requireToken`: kotlin.String?, - val `advertiseService`: kotlin.Boolean, - val `channelOpeningFeePpm`: kotlin.UInt, - val `channelOverProvisioningPpm`: kotlin.UInt, - val `minChannelOpeningFeeMsat`: kotlin.ULong, - val `minChannelLifetime`: kotlin.UInt, - val `maxClientToSelfDelay`: kotlin.UInt, - val `minPaymentSizeMsat`: kotlin.ULong, - val `maxPaymentSizeMsat`: kotlin.ULong, - val `clientTrustsLsp`: kotlin.Boolean -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class LogRecord ( - val `level`: LogLevel, - val `args`: kotlin.String, - val `modulePath`: kotlin.String, - val `line`: kotlin.UInt -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class NodeAnnouncementInfo ( - val `lastUpdate`: kotlin.UInt, - val `alias`: kotlin.String, - val `addresses`: List -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class NodeInfo ( - val `channels`: List, - val `announcementInfo`: NodeAnnouncementInfo? -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class NodeStatus ( - val `isRunning`: kotlin.Boolean, - val `currentBestBlock`: BestBlock, - val `latestLightningWalletSyncTimestamp`: kotlin.ULong?, - val `latestOnchainWalletSyncTimestamp`: kotlin.ULong?, - val `latestFeeRateCacheUpdateTimestamp`: kotlin.ULong?, - val `latestRgsSnapshotTimestamp`: kotlin.ULong?, - val `latestPathfindingScoresSyncTimestamp`: kotlin.ULong?, - val `latestNodeAnnouncementBroadcastTimestamp`: kotlin.ULong?, - val `latestChannelMonitorArchivalHeight`: kotlin.UInt? -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class OnchainWalletAccount ( - val `addressType`: AddressType, - val `accountIndex`: kotlin.UInt -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class OnchainWalletAccountConfig ( - val `addressType`: AddressType, - val `accountIndex`: kotlin.UInt, - val `xpub`: kotlin.String -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class OutPoint ( - val `txid`: Txid, - val `vout`: kotlin.UInt -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class PaymentDetails ( - val `id`: PaymentId, - val `kind`: PaymentKind, - val `amountMsat`: kotlin.ULong?, - val `feePaidMsat`: kotlin.ULong?, - val `direction`: PaymentDirection, - val `status`: PaymentStatus, - val `latestUpdateTimestamp`: kotlin.ULong -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class PeerDetails ( - val `nodeId`: PublicKey, - val `address`: SocketAddress, - val `isPersisted`: kotlin.Boolean, - val `isConnected`: kotlin.Boolean -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class ProbeHandle ( - val `paymentHash`: PaymentHash, - val `paymentId`: PaymentId -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class RouteHintHop ( - val `srcNodeId`: PublicKey, - val `shortChannelId`: kotlin.ULong, - val `cltvExpiryDelta`: kotlin.UShort, - val `htlcMinimumMsat`: kotlin.ULong?, - val `htlcMaximumMsat`: kotlin.ULong?, - val `fees`: RoutingFees -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class RouteParametersConfig ( - val `maxTotalRoutingFeeMsat`: kotlin.ULong?, - val `maxTotalCltvExpiryDelta`: kotlin.UInt, - val `maxPathCount`: kotlin.UByte, - val `maxChannelSaturationPowerOfHalf`: kotlin.UByte -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class RoutingFees ( - val `baseMsat`: kotlin.UInt, - val `proportionalMillionths`: kotlin.UInt -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class RuntimeSyncIntervals ( - val `onchainWalletSyncIntervalSecs`: kotlin.ULong, - val `lightningWalletSyncIntervalSecs`: kotlin.ULong, - val `feeRateCacheUpdateIntervalSecs`: kotlin.ULong -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class ScoringDecayParameters ( - val `historicalNoUpdatesHalfLifeSecs`: kotlin.ULong, - val `liquidityOffsetHalfLifeSecs`: kotlin.ULong -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class ScoringFeeParameters ( - val `basePenaltyMsat`: kotlin.ULong, - val `basePenaltyAmountMultiplierMsat`: kotlin.ULong, - val `liquidityPenaltyMultiplierMsat`: kotlin.ULong, - val `liquidityPenaltyAmountMultiplierMsat`: kotlin.ULong, - val `historicalLiquidityPenaltyMultiplierMsat`: kotlin.ULong, - val `historicalLiquidityPenaltyAmountMultiplierMsat`: kotlin.ULong, - val `antiProbingPenaltyMsat`: kotlin.ULong, - val `consideredImpossiblePenaltyMsat`: kotlin.ULong, - val `linearSuccessProbability`: kotlin.Boolean, - val `probingDiversityPenaltyMsat`: kotlin.ULong -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class SpendableUtxo ( - val `outpoint`: OutPoint, - val `valueSats`: kotlin.ULong -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class TransactionDetails ( - val `amountSats`: kotlin.Long, - val `inputs`: List, - val `outputs`: List -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class TxInput ( - val `txid`: Txid, - val `vout`: kotlin.UInt, - val `scriptsig`: kotlin.String, - val `witness`: List, - val `sequence`: kotlin.UInt -) { - companion object -} - - - -@kotlinx.serialization.Serializable -data class TxOutput ( - val `scriptpubkey`: kotlin.String, - val `scriptpubkeyType`: kotlin.String?, - val `scriptpubkeyAddress`: kotlin.String?, - val `value`: kotlin.Long, - val `n`: kotlin.UInt -) { - companion object -} - - - - - -@kotlinx.serialization.Serializable -enum class AddressType { - - LEGACY, - NESTED_SEGWIT, - NATIVE_SEGWIT, - TAPROOT; - companion object -} - - - - - - - -@kotlinx.serialization.Serializable -enum class AsyncPaymentsRole { - - CLIENT, - SERVER; - companion object -} - - - - - - - -@kotlinx.serialization.Serializable -enum class BalanceSource { - - HOLDER_FORCE_CLOSED, - COUNTERPARTY_FORCE_CLOSED, - COOP_CLOSE, - HTLC; - companion object -} - - - - - - -@kotlinx.serialization.Serializable -sealed class Bolt11InvoiceDescription { - @kotlinx.serialization.Serializable - data class Hash( - val `hash`: kotlin.String, - ) : Bolt11InvoiceDescription() { - } - @kotlinx.serialization.Serializable - data class Direct( - val `description`: kotlin.String, - ) : Bolt11InvoiceDescription() { - } - -} - - - - - - - -sealed class BuildException(message: String): kotlin.Exception(message) { - - class InvalidSeedBytes(message: String) : BuildException(message) - - class InvalidSeedFile(message: String) : BuildException(message) - - class InvalidSystemTime(message: String) : BuildException(message) - - class InvalidChannelMonitor(message: String) : BuildException(message) - - class InvalidListeningAddresses(message: String) : BuildException(message) - - class InvalidAnnouncementAddresses(message: String) : BuildException(message) - - class InvalidNodeAlias(message: String) : BuildException(message) - - class RuntimeSetupFailed(message: String) : BuildException(message) - - class ReadFailed(message: String) : BuildException(message) - - class DangerousValue(message: String) : BuildException(message) - - class WriteFailed(message: String) : BuildException(message) - - class StoragePathAccessFailed(message: String) : BuildException(message) - - class KvStoreSetupFailed(message: String) : BuildException(message) - - class WalletSetupFailed(message: String) : BuildException(message) - - class LoggerSetupFailed(message: String) : BuildException(message) - - class NetworkMismatch(message: String) : BuildException(message) - - class AsyncPaymentsConfigMismatch(message: String) : BuildException(message) - -} - - - - -@kotlinx.serialization.Serializable -sealed class ClosureReason { - @kotlinx.serialization.Serializable - data class CounterpartyForceClosed( - val `peerMsg`: UntrustedString, - ) : ClosureReason() { - } - @kotlinx.serialization.Serializable - data class HolderForceClosed( - val `broadcastedLatestTxn`: kotlin.Boolean?, - val `message`: kotlin.String, - ) : ClosureReason() { - } - - @kotlinx.serialization.Serializable - data object LegacyCooperativeClosure : ClosureReason() - - - @kotlinx.serialization.Serializable - data object CounterpartyInitiatedCooperativeClosure : ClosureReason() - - - @kotlinx.serialization.Serializable - data object LocallyInitiatedCooperativeClosure : ClosureReason() - - - @kotlinx.serialization.Serializable - data object CommitmentTxConfirmed : ClosureReason() - - - @kotlinx.serialization.Serializable - data object FundingTimedOut : ClosureReason() - - @kotlinx.serialization.Serializable - data class ProcessingError( - val `err`: kotlin.String, - ) : ClosureReason() { - } - - @kotlinx.serialization.Serializable - data object DisconnectedPeer : ClosureReason() - - - @kotlinx.serialization.Serializable - data object OutdatedChannelManager : ClosureReason() - - - @kotlinx.serialization.Serializable - data object CounterpartyCoopClosedUnfundedChannel : ClosureReason() - - - @kotlinx.serialization.Serializable - data object LocallyCoopClosedUnfundedChannel : ClosureReason() - - - @kotlinx.serialization.Serializable - data object FundingBatchClosure : ClosureReason() - - @kotlinx.serialization.Serializable - data class HtlCsTimedOut( - val `paymentHash`: PaymentHash?, - ) : ClosureReason() { - } - @kotlinx.serialization.Serializable - data class PeerFeerateTooLow( - val `peerFeerateSatPerKw`: kotlin.UInt, - val `requiredFeerateSatPerKw`: kotlin.UInt, - ) : ClosureReason() { - } - -} - - - - - - - -@kotlinx.serialization.Serializable -enum class CoinSelectionAlgorithm { - - BRANCH_AND_BOUND, - LARGEST_FIRST, - OLDEST_FIRST, - SINGLE_RANDOM_DRAW; - companion object -} - - - - - - -@kotlinx.serialization.Serializable -sealed class ConfirmationStatus { - @kotlinx.serialization.Serializable - data class Confirmed( - val `blockHash`: BlockHash, - val `height`: kotlin.UInt, - val `timestamp`: kotlin.ULong, - ) : ConfirmationStatus() { - } - - @kotlinx.serialization.Serializable - data object Unconfirmed : ConfirmationStatus() - - -} - - - - - - - -@kotlinx.serialization.Serializable -enum class Currency { - - BITCOIN, - BITCOIN_TESTNET, - REGTEST, - SIMNET, - SIGNET; - companion object -} - - - - - - -@kotlinx.serialization.Serializable -sealed class Event { - @kotlinx.serialization.Serializable - data class PaymentSuccessful( - val `paymentId`: PaymentId?, - val `paymentHash`: PaymentHash, - val `paymentPreimage`: PaymentPreimage?, - val `feePaidMsat`: kotlin.ULong?, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class PaymentFailed( - val `paymentId`: PaymentId?, - val `paymentHash`: PaymentHash?, - val `reason`: PaymentFailureReason?, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class PaymentReceived( - val `paymentId`: PaymentId?, - val `paymentHash`: PaymentHash, - val `amountMsat`: kotlin.ULong, - val `customRecords`: List, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class PaymentClaimable( - val `paymentId`: PaymentId, - val `paymentHash`: PaymentHash, - val `claimableAmountMsat`: kotlin.ULong, - val `claimDeadline`: kotlin.UInt?, - val `customRecords`: List, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class PaymentForwarded( - val `prevChannelId`: ChannelId, - val `nextChannelId`: ChannelId, - val `prevUserChannelId`: UserChannelId?, - val `nextUserChannelId`: UserChannelId?, - val `prevNodeId`: PublicKey?, - val `nextNodeId`: PublicKey?, - val `totalFeeEarnedMsat`: kotlin.ULong?, - val `skimmedFeeMsat`: kotlin.ULong?, - val `claimFromOnchainTx`: kotlin.Boolean, - val `outboundAmountForwardedMsat`: kotlin.ULong?, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class ProbeSuccessful( - val `paymentId`: PaymentId, - val `paymentHash`: PaymentHash, - val `routeFeeMsat`: kotlin.ULong?, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class ProbeFailed( - val `paymentId`: PaymentId, - val `paymentHash`: PaymentHash, - val `shortChannelId`: kotlin.ULong?, - val `routeFeeMsat`: kotlin.ULong?, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class ChannelPending( - val `channelId`: ChannelId, - val `userChannelId`: UserChannelId, - val `formerTemporaryChannelId`: ChannelId, - val `counterpartyNodeId`: PublicKey, - val `fundingTxo`: OutPoint, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class ChannelReady( - val `channelId`: ChannelId, - val `userChannelId`: UserChannelId, - val `counterpartyNodeId`: PublicKey?, - val `fundingTxo`: OutPoint?, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class ChannelClosed( - val `channelId`: ChannelId, - val `userChannelId`: UserChannelId, - val `counterpartyNodeId`: PublicKey?, - val `reason`: ClosureReason?, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class SplicePending( - val `channelId`: ChannelId, - val `userChannelId`: UserChannelId, - val `counterpartyNodeId`: PublicKey, - val `newFundingTxo`: OutPoint, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class SpliceFailed( - val `channelId`: ChannelId, - val `userChannelId`: UserChannelId, - val `counterpartyNodeId`: PublicKey, - val `abandonedFundingTxo`: OutPoint?, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class OnchainTransactionConfirmed( - val `txid`: Txid, - val `blockHash`: BlockHash, - val `blockHeight`: kotlin.UInt, - val `confirmationTime`: kotlin.ULong, - val `details`: TransactionDetails, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class OnchainTransactionReceived( - val `txid`: Txid, - val `details`: TransactionDetails, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class OnchainTransactionReplaced( - val `txid`: Txid, - val `conflicts`: List, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class OnchainTransactionReorged( - val `txid`: Txid, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class OnchainTransactionEvicted( - val `txid`: Txid, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class SyncProgress( - val `syncType`: SyncType, - val `progressPercent`: kotlin.UByte, - val `currentBlockHeight`: kotlin.UInt, - val `targetBlockHeight`: kotlin.UInt, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class SyncCompleted( - val `syncType`: SyncType, - val `syncedBlockHeight`: kotlin.UInt, - ) : Event() { - } - @kotlinx.serialization.Serializable - data class BalanceChanged( - val `oldSpendableOnchainBalanceSats`: kotlin.ULong, - val `newSpendableOnchainBalanceSats`: kotlin.ULong, - val `oldTotalOnchainBalanceSats`: kotlin.ULong, - val `newTotalOnchainBalanceSats`: kotlin.ULong, - val `oldTotalLightningBalanceSats`: kotlin.ULong, - val `newTotalLightningBalanceSats`: kotlin.ULong, - ) : Event() { - } - -} - - - - - - - -@kotlinx.serialization.Serializable -enum class KeychainKind { - - EXTERNAL, - INTERNAL; - companion object -} - - - - - - - -@kotlinx.serialization.Serializable -enum class Lsps1PaymentState { - - EXPECT_PAYMENT, - PAID, - REFUNDED; - companion object -} - - - - - - -@kotlinx.serialization.Serializable -sealed class LightningBalance { - @kotlinx.serialization.Serializable - data class ClaimableOnChannelClose( - val `channelId`: ChannelId, - val `counterpartyNodeId`: PublicKey, - val `amountSatoshis`: kotlin.ULong, - val `transactionFeeSatoshis`: kotlin.ULong, - val `outboundPaymentHtlcRoundedMsat`: kotlin.ULong, - val `outboundForwardedHtlcRoundedMsat`: kotlin.ULong, - val `inboundClaimingHtlcRoundedMsat`: kotlin.ULong, - val `inboundHtlcRoundedMsat`: kotlin.ULong, - ) : LightningBalance() { - } - @kotlinx.serialization.Serializable - data class ClaimableAwaitingConfirmations( - val `channelId`: ChannelId, - val `counterpartyNodeId`: PublicKey, - val `amountSatoshis`: kotlin.ULong, - val `confirmationHeight`: kotlin.UInt, - val `source`: BalanceSource, - ) : LightningBalance() { - } - @kotlinx.serialization.Serializable - data class ContentiousClaimable( - val `channelId`: ChannelId, - val `counterpartyNodeId`: PublicKey, - val `amountSatoshis`: kotlin.ULong, - val `timeoutHeight`: kotlin.UInt, - val `paymentHash`: PaymentHash, - val `paymentPreimage`: PaymentPreimage, - ) : LightningBalance() { - } - @kotlinx.serialization.Serializable - data class MaybeTimeoutClaimableHtlc( - val `channelId`: ChannelId, - val `counterpartyNodeId`: PublicKey, - val `amountSatoshis`: kotlin.ULong, - val `claimableHeight`: kotlin.UInt, - val `paymentHash`: PaymentHash, - val `outboundPayment`: kotlin.Boolean, - ) : LightningBalance() { - } - @kotlinx.serialization.Serializable - data class MaybePreimageClaimableHtlc( - val `channelId`: ChannelId, - val `counterpartyNodeId`: PublicKey, - val `amountSatoshis`: kotlin.ULong, - val `expiryHeight`: kotlin.UInt, - val `paymentHash`: PaymentHash, - ) : LightningBalance() { - } - @kotlinx.serialization.Serializable - data class CounterpartyRevokedOutputClaimable( - val `channelId`: ChannelId, - val `counterpartyNodeId`: PublicKey, - val `amountSatoshis`: kotlin.ULong, - ) : LightningBalance() { - } - -} - - - - - - - -@kotlinx.serialization.Serializable -enum class LogLevel { - - GOSSIP, - TRACE, - DEBUG, - INFO, - WARN, - ERROR; - companion object -} - - - - - - -@kotlinx.serialization.Serializable -sealed class MaxDustHtlcExposure { - @kotlinx.serialization.Serializable - data class FixedLimit( - val `limitMsat`: kotlin.ULong, - ) : MaxDustHtlcExposure() { - } - @kotlinx.serialization.Serializable - data class FeeRateMultiplier( - val `multiplier`: kotlin.ULong, - ) : MaxDustHtlcExposure() { - } - -} - - - - - - - -@kotlinx.serialization.Serializable -enum class Network { - - BITCOIN, - TESTNET, - SIGNET, - REGTEST; - companion object -} - - - - - - - -sealed class NodeException(message: String): kotlin.Exception(message) { - - class AlreadyRunning(message: String) : NodeException(message) - - class NotRunning(message: String) : NodeException(message) - - class OnchainTxCreationFailed(message: String) : NodeException(message) - - class ConnectionFailed(message: String) : NodeException(message) - - class InvoiceCreationFailed(message: String) : NodeException(message) - - class InvoiceRequestCreationFailed(message: String) : NodeException(message) - - class OfferCreationFailed(message: String) : NodeException(message) - - class RefundCreationFailed(message: String) : NodeException(message) - - class PaymentSendingFailed(message: String) : NodeException(message) - - class InvalidCustomTlvs(message: String) : NodeException(message) - - class ProbeSendingFailed(message: String) : NodeException(message) - - class RouteNotFound(message: String) : NodeException(message) - - class ChannelCreationFailed(message: String) : NodeException(message) - - class ChannelClosingFailed(message: String) : NodeException(message) - - class ChannelSplicingFailed(message: String) : NodeException(message) - - class ChannelConfigUpdateFailed(message: String) : NodeException(message) - - class PersistenceFailed(message: String) : NodeException(message) - - class FeerateEstimationUpdateFailed(message: String) : NodeException(message) - - class FeerateEstimationUpdateTimeout(message: String) : NodeException(message) - - class WalletOperationFailed(message: String) : NodeException(message) - - class WalletOperationTimeout(message: String) : NodeException(message) - - class OnchainTxSigningFailed(message: String) : NodeException(message) - - class TxSyncFailed(message: String) : NodeException(message) - - class TxSyncTimeout(message: String) : NodeException(message) - - class GossipUpdateFailed(message: String) : NodeException(message) - - class GossipUpdateTimeout(message: String) : NodeException(message) - - class LiquidityRequestFailed(message: String) : NodeException(message) - - class UriParameterParsingFailed(message: String) : NodeException(message) - - class InvalidAddress(message: String) : NodeException(message) - - class InvalidSocketAddress(message: String) : NodeException(message) - - class InvalidPublicKey(message: String) : NodeException(message) - - class InvalidSecretKey(message: String) : NodeException(message) - - class InvalidOfferId(message: String) : NodeException(message) - - class InvalidNodeId(message: String) : NodeException(message) - - class InvalidPaymentId(message: String) : NodeException(message) - - class InvalidPaymentHash(message: String) : NodeException(message) - - class InvalidPaymentPreimage(message: String) : NodeException(message) - - class InvalidPaymentSecret(message: String) : NodeException(message) - - class InvalidAmount(message: String) : NodeException(message) - - class InvalidInvoice(message: String) : NodeException(message) - - class InvalidOffer(message: String) : NodeException(message) - - class InvalidRefund(message: String) : NodeException(message) - - class InvalidChannelId(message: String) : NodeException(message) - - class InvalidNetwork(message: String) : NodeException(message) - - class InvalidUri(message: String) : NodeException(message) - - class InvalidQuantity(message: String) : NodeException(message) - - class InvalidNodeAlias(message: String) : NodeException(message) - - class InvalidDateTime(message: String) : NodeException(message) - - class InvalidFeeRate(message: String) : NodeException(message) - - class DuplicatePayment(message: String) : NodeException(message) - - class UnsupportedCurrency(message: String) : NodeException(message) - - class InsufficientFunds(message: String) : NodeException(message) - - class LiquiditySourceUnavailable(message: String) : NodeException(message) - - class LiquidityFeeTooHigh(message: String) : NodeException(message) - - class InvalidBlindedPaths(message: String) : NodeException(message) - - class AsyncPaymentServicesDisabled(message: String) : NodeException(message) - - class CannotRbfFundingTransaction(message: String) : NodeException(message) - - class TransactionNotFound(message: String) : NodeException(message) - - class TransactionAlreadyConfirmed(message: String) : NodeException(message) - - class NoSpendableOutputs(message: String) : NodeException(message) - - class CoinSelectionFailed(message: String) : NodeException(message) - - class InvalidMnemonic(message: String) : NodeException(message) - - class BackgroundSyncNotEnabled(message: String) : NodeException(message) - - class AddressTypeAlreadyMonitored(message: String) : NodeException(message) - - class AddressTypeIsPrimary(message: String) : NodeException(message) - - class AddressTypeNotMonitored(message: String) : NodeException(message) - - class OnchainWalletAccountNotRegistered(message: String) : NodeException(message) - - class InvalidSeedBytes(message: String) : NodeException(message) - -} - - - - -@kotlinx.serialization.Serializable -sealed class OfferAmount { - @kotlinx.serialization.Serializable - data class Bitcoin( - val `amountMsats`: kotlin.ULong, - ) : OfferAmount() { - } - @kotlinx.serialization.Serializable - data class Currency( - val `iso4217Code`: kotlin.String, - val `amount`: kotlin.ULong, - ) : OfferAmount() { - } - -} - - - - - - - -@kotlinx.serialization.Serializable -enum class PaymentDirection { - - INBOUND, - OUTBOUND; - companion object -} - - - - - - - -@kotlinx.serialization.Serializable -enum class PaymentFailureReason { - - RECIPIENT_REJECTED, - USER_ABANDONED, - RETRIES_EXHAUSTED, - PAYMENT_EXPIRED, - ROUTE_NOT_FOUND, - UNEXPECTED_ERROR, - UNKNOWN_REQUIRED_FEATURES, - INVOICE_REQUEST_EXPIRED, - INVOICE_REQUEST_REJECTED, - BLINDED_PATH_CREATION_FAILED; - companion object -} - - - - - - -@kotlinx.serialization.Serializable -sealed class PaymentKind { - @kotlinx.serialization.Serializable - data class Onchain( - val `txid`: Txid, - val `status`: ConfirmationStatus, - ) : PaymentKind() { - } - @kotlinx.serialization.Serializable - data class Bolt11( - val `hash`: PaymentHash, - val `preimage`: PaymentPreimage?, - val `secret`: PaymentSecret?, - val `description`: kotlin.String?, - val `bolt11`: kotlin.String?, - ) : PaymentKind() { - } - @kotlinx.serialization.Serializable - data class Bolt11Jit( - val `hash`: PaymentHash, - val `preimage`: PaymentPreimage?, - val `secret`: PaymentSecret?, - val `counterpartySkimmedFeeMsat`: kotlin.ULong?, - val `lspFeeLimits`: LspFeeLimits, - val `description`: kotlin.String?, - val `bolt11`: kotlin.String?, - ) : PaymentKind() { - } - @kotlinx.serialization.Serializable - data class Bolt12Offer( - val `hash`: PaymentHash?, - val `preimage`: PaymentPreimage?, - val `secret`: PaymentSecret?, - val `offerId`: OfferId, - val `payerNote`: UntrustedString?, - val `quantity`: kotlin.ULong?, - ) : PaymentKind() { - } - @kotlinx.serialization.Serializable - data class Bolt12Refund( - val `hash`: PaymentHash?, - val `preimage`: PaymentPreimage?, - val `secret`: PaymentSecret?, - val `payerNote`: UntrustedString?, - val `quantity`: kotlin.ULong?, - ) : PaymentKind() { - } - @kotlinx.serialization.Serializable - data class Spontaneous( - val `hash`: PaymentHash, - val `preimage`: PaymentPreimage?, - ) : PaymentKind() { - } - -} - - - - - - - -@kotlinx.serialization.Serializable -enum class PaymentStatus { - - PENDING, - SUCCEEDED, - FAILED; - companion object -} - - - - - - -@kotlinx.serialization.Serializable -sealed class PendingSweepBalance { - @kotlinx.serialization.Serializable - data class PendingBroadcast( - val `channelId`: ChannelId?, - val `amountSatoshis`: kotlin.ULong, - ) : PendingSweepBalance() { - } - @kotlinx.serialization.Serializable - data class BroadcastAwaitingConfirmation( - val `channelId`: ChannelId?, - val `latestBroadcastHeight`: kotlin.UInt, - val `latestSpendingTxid`: Txid, - val `amountSatoshis`: kotlin.ULong, - ) : PendingSweepBalance() { - } - @kotlinx.serialization.Serializable - data class AwaitingThresholdConfirmations( - val `channelId`: ChannelId?, - val `latestSpendingTxid`: Txid, - val `confirmationHash`: BlockHash, - val `confirmationHeight`: kotlin.UInt, - val `amountSatoshis`: kotlin.ULong, - ) : PendingSweepBalance() { - } - -} - - - - - - -@kotlinx.serialization.Serializable -sealed class QrPaymentResult { - @kotlinx.serialization.Serializable - data class Onchain( - val `txid`: Txid, - ) : QrPaymentResult() { - } - @kotlinx.serialization.Serializable - data class Bolt11( - val `paymentId`: PaymentId, - ) : QrPaymentResult() { - } - @kotlinx.serialization.Serializable - data class Bolt12( - val `paymentId`: PaymentId, - ) : QrPaymentResult() { - } - -} - - - - - - - -@kotlinx.serialization.Serializable -enum class SyncType { - - ONCHAIN_WALLET, - LIGHTNING_WALLET, - FEE_RATE_CACHE; - companion object -} - - - - - - - -sealed class VssHeaderProviderException(message: String): kotlin.Exception(message) { - - class InvalidData(message: String) : VssHeaderProviderException(message) - - class RequestException(message: String) : VssHeaderProviderException(message) - - class AuthorizationException(message: String) : VssHeaderProviderException(message) - - class InternalException(message: String) : VssHeaderProviderException(message) - -} - - - - - -@kotlinx.serialization.Serializable -enum class WordCount { - - WORDS12, - WORDS15, - WORDS18, - WORDS21, - WORDS24; - companion object -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias Address = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias BlockHash = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias ChannelId = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias Lsps1OrderId = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias LspsDateTime = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias Mnemonic = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias NodeAlias = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias NodeId = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias OfferId = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias PaymentHash = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias PaymentId = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias PaymentPreimage = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias PaymentSecret = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias PublicKey = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias SocketAddress = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias Txid = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias UntrustedString = kotlin.String - - - -/** - * Typealias from the type name used in the UDL file to the builtin type. This - * is needed because the UDL type name is used in function/method signatures. - * It's also what we have an external type that references a custom type. - */ -typealias UserChannelId = kotlin.String diff --git a/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.jvm.kt b/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.jvm.kt deleted file mode 100644 index 945f76a53c..0000000000 --- a/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.jvm.kt +++ /dev/null @@ -1,15196 +0,0 @@ - - -@file:Suppress("RemoveRedundantBackticks") - -package org.lightningdevkit.ldknode - -// Common helper code. -// -// Ideally this would live in a separate .kt file where it can be unittested etc -// in isolation, and perhaps even published as a re-useable package. -// -// However, it's important that the details of how this helper code works (e.g. the -// way that different builtin types are passed across the FFI) exactly match what's -// expected by the Rust code on the other side of the interface. In practice right -// now that means coming from the exact some version of `uniffi` that was used to -// compile the Rust component. The easiest way to ensure this is to bundle the Kotlin -// helpers directly inline like we're doing here. - -import com.sun.jna.Library -import com.sun.jna.Native -import com.sun.jna.Structure -import kotlin.coroutines.resume -import kotlinx.coroutines.CancellableContinuation -import kotlinx.coroutines.DelicateCoroutinesApi -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.Job -import kotlinx.coroutines.launch -import kotlinx.coroutines.suspendCancellableCoroutine -import kotlinx.coroutines.withContext - - -internal typealias Pointer = com.sun.jna.Pointer -internal val NullPointer: Pointer? = com.sun.jna.Pointer.NULL -internal fun Pointer.toLong(): Long = Pointer.nativeValue(this) -internal fun kotlin.Long.toPointer() = com.sun.jna.Pointer(this) - - -@kotlin.jvm.JvmInline -value class ByteBuffer(private val inner: java.nio.ByteBuffer) { - init { - inner.order(java.nio.ByteOrder.BIG_ENDIAN) - } - - fun internal() = inner - - fun limit() = inner.limit() - - fun position() = inner.position() - - fun hasRemaining() = inner.hasRemaining() - - fun get() = inner.get() - - fun get(bytesToRead: Int): ByteArray = ByteArray(bytesToRead).apply(inner::get) - - fun getShort() = inner.getShort() - - fun getInt() = inner.getInt() - - fun getLong() = inner.getLong() - - fun getFloat() = inner.getFloat() - - fun getDouble() = inner.getDouble() - - - - fun put(value: Byte) { - inner.put(value) - } - - fun put(src: ByteArray) { - inner.put(src) - } - - fun putShort(value: Short) { - inner.putShort(value) - } - - fun putInt(value: Int) { - inner.putInt(value) - } - - fun putLong(value: Long) { - inner.putLong(value) - } - - fun putFloat(value: Float) { - inner.putFloat(value) - } - - fun putDouble(value: Double) { - inner.putDouble(value) - } - - - fun writeUtf8(value: String) { - Charsets.UTF_8.newEncoder().run { - onMalformedInput(java.nio.charset.CodingErrorAction.REPLACE) - encode(java.nio.CharBuffer.wrap(value), inner, false) - } - } -} -fun RustBuffer.setValue(array: RustBufferByValue) { - this.data = array.data - this.len = array.len - this.capacity = array.capacity -} - -internal object RustBufferHelper { - fun allocValue(size: ULong = 0UL): RustBufferByValue = uniffiRustCall { status -> - // Note: need to convert the size to a `Long` value to make this work with JVM. - UniffiLib.INSTANCE.ffi_ldk_node_rustbuffer_alloc(size.toLong(), status) - }.also { - if(it.data == null) { - throw RuntimeException("RustBuffer.alloc() returned null data pointer (size=${size})") - } - } - - fun free(buf: RustBufferByValue) = uniffiRustCall { status -> - UniffiLib.INSTANCE.ffi_ldk_node_rustbuffer_free(buf, status) - } -} - -@Structure.FieldOrder("capacity", "len", "data") -open class RustBufferStruct( - // Note: `capacity` and `len` are actually `ULong` values, but JVM only supports signed values. - // When dealing with these fields, make sure to call `toULong()`. - @JvmField internal var capacity: Long, - @JvmField internal var len: Long, - @JvmField internal var data: Pointer?, -) : Structure() { - constructor(): this(0.toLong(), 0.toLong(), null) - - class ByValue( - capacity: Long, - len: Long, - data: Pointer?, - ): RustBuffer(capacity, len, data), Structure.ByValue { - constructor(): this(0.toLong(), 0.toLong(), null) - } - - /** - * The equivalent of the `*mut RustBuffer` type. - * Required for callbacks taking in an out pointer. - * - * Size is the sum of all values in the struct. - */ - class ByReference( - capacity: Long, - len: Long, - data: Pointer?, - ): RustBuffer(capacity, len, data), Structure.ByReference { - constructor(): this(0.toLong(), 0.toLong(), null) - } -} - -typealias RustBuffer = RustBufferStruct -typealias RustBufferByValue = RustBufferStruct.ByValue - -internal fun RustBuffer.asByteBuffer(): ByteBuffer? { - require(this.len <= Int.MAX_VALUE) { - val length = this.len - "cannot handle RustBuffer longer than Int.MAX_VALUE bytes: length is $length" - } - return ByteBuffer(data?.getByteBuffer(0L, this.len) ?: return null) -} - -internal fun RustBufferByValue.asByteBuffer(): ByteBuffer? { - require(this.len <= Int.MAX_VALUE) { - val length = this.len - "cannot handle RustBuffer longer than Int.MAX_VALUE bytes: length is $length" - } - return ByteBuffer(data?.getByteBuffer(0L, this.len) ?: return null) -} - -internal class RustBufferByReference : com.sun.jna.ptr.ByReference(16) -internal fun RustBufferByReference.setValue(value: RustBufferByValue) { - // NOTE: The offsets are as they are in the C-like struct. - val pointer = getPointer() - pointer.setLong(0, value.capacity) - pointer.setLong(8, value.len) - pointer.setPointer(16, value.data) -} -internal fun RustBufferByReference.getValue(): RustBufferByValue { - val pointer = getPointer() - val value = RustBufferByValue() - value.writeField("capacity", pointer.getLong(0)) - value.writeField("len", pointer.getLong(8)) - value.writeField("data", pointer.getLong(16)) - return value -} - - - -// This is a helper for safely passing byte references into the rust code. -// It's not actually used at the moment, because there aren't many things that you -// can take a direct pointer to in the JVM, and if we're going to copy something -// then we might as well copy it into a `RustBuffer`. But it's here for API -// completeness. - -@Structure.FieldOrder("len", "data") -internal open class ForeignBytesStruct : Structure() { - @JvmField internal var len: Int = 0 - @JvmField internal var data: Pointer? = null - - internal class ByValue : ForeignBytes(), Structure.ByValue -} -internal typealias ForeignBytes = ForeignBytesStruct -internal typealias ForeignBytesByValue = ForeignBytesStruct.ByValue - -interface FfiConverter { - // Convert an FFI type to a Kotlin type - fun lift(value: FfiType): KotlinType - - // Convert an Kotlin type to an FFI type - fun lower(value: KotlinType): FfiType - - // Read a Kotlin type from a `ByteBuffer` - fun read(buf: ByteBuffer): KotlinType - - // Calculate bytes to allocate when creating a `RustBuffer` - // - // This must return at least as many bytes as the write() function will - // write. It can return more bytes than needed, for example when writing - // Strings we can't know the exact bytes needed until we the UTF-8 - // encoding, so we pessimistically allocate the largest size possible (3 - // bytes per codepoint). Allocating extra bytes is not really a big deal - // because the `RustBuffer` is short-lived. - fun allocationSize(value: KotlinType): ULong - - // Write a Kotlin type to a `ByteBuffer` - fun write(value: KotlinType, buf: ByteBuffer) - - // Lower a value into a `RustBuffer` - // - // This method lowers a value into a `RustBuffer` rather than the normal - // FfiType. It's used by the callback interface code. Callback interface - // returns are always serialized into a `RustBuffer` regardless of their - // normal FFI type. - fun lowerIntoRustBuffer(value: KotlinType): RustBufferByValue { - val rbuf = RustBufferHelper.allocValue(allocationSize(value)) - val bbuf = rbuf.asByteBuffer()!! - write(value, bbuf) - return RustBufferByValue( - capacity = rbuf.capacity, - len = bbuf.position().toLong(), - data = rbuf.data, - ) - } - - // Lift a value from a `RustBuffer`. - // - // This here mostly because of the symmetry with `lowerIntoRustBuffer()`. - // It's currently only used by the `FfiConverterRustBuffer` class below. - fun liftFromRustBuffer(rbuf: RustBufferByValue): KotlinType { - val byteBuf = rbuf.asByteBuffer()!! - try { - val item = read(byteBuf) - if (byteBuf.hasRemaining()) { - throw RuntimeException("junk remaining in buffer after lifting, something is very wrong!!") - } - return item - } finally { - RustBufferHelper.free(rbuf) - } - } -} - -// FfiConverter that uses `RustBuffer` as the FfiType -interface FfiConverterRustBuffer: FfiConverter { - override fun lift(value: RustBufferByValue) = liftFromRustBuffer(value) - override fun lower(value: KotlinType) = lowerIntoRustBuffer(value) -} - -internal const val UNIFFI_CALL_SUCCESS = 0.toByte() -internal const val UNIFFI_CALL_ERROR = 1.toByte() -internal const val UNIFFI_CALL_UNEXPECTED_ERROR = 2.toByte() - -// Default Implementations -internal fun UniffiRustCallStatus.isSuccess(): Boolean - = code == UNIFFI_CALL_SUCCESS - -internal fun UniffiRustCallStatus.isError(): Boolean - = code == UNIFFI_CALL_ERROR - -internal fun UniffiRustCallStatus.isPanic(): Boolean - = code == UNIFFI_CALL_UNEXPECTED_ERROR - -internal fun UniffiRustCallStatusByValue.isSuccess(): Boolean - = code == UNIFFI_CALL_SUCCESS - -internal fun UniffiRustCallStatusByValue.isError(): Boolean - = code == UNIFFI_CALL_ERROR - -internal fun UniffiRustCallStatusByValue.isPanic(): Boolean - = code == UNIFFI_CALL_UNEXPECTED_ERROR - -// Each top-level error class has a companion object that can lift the error from the call status's rust buffer -interface UniffiRustCallStatusErrorHandler { - fun lift(errorBuf: RustBufferByValue): E; -} - -// Helpers for calling Rust -// In practice we usually need to be synchronized to call this safely, so it doesn't -// synchronize itself - -// Call a rust function that returns a Result<>. Pass in the Error class companion that corresponds to the Err -internal inline fun uniffiRustCallWithError(errorHandler: UniffiRustCallStatusErrorHandler, crossinline callback: (UniffiRustCallStatus) -> U): U { - return UniffiRustCallStatusHelper.withReference() { status -> - val returnValue = callback(status) - uniffiCheckCallStatus(errorHandler, status) - returnValue - } -} - -// Check `status` and throw an error if the call wasn't successful -internal fun uniffiCheckCallStatus(errorHandler: UniffiRustCallStatusErrorHandler, status: UniffiRustCallStatus) { - if (status.isSuccess()) { - return - } else if (status.isError()) { - throw errorHandler.lift(status.errorBuf) - } else if (status.isPanic()) { - // when the rust code sees a panic, it tries to construct a rustbuffer - // with the message. but if that code panics, then it just sends back - // an empty buffer. - if (status.errorBuf.len > 0) { - throw InternalException(FfiConverterString.lift(status.errorBuf)) - } else { - throw InternalException("Rust panic") - } - } else { - throw InternalException("Unknown rust call status: $status.code") - } -} - -// UniffiRustCallStatusErrorHandler implementation for times when we don't expect a CALL_ERROR -object UniffiNullRustCallStatusErrorHandler: UniffiRustCallStatusErrorHandler { - override fun lift(errorBuf: RustBufferByValue): InternalException { - RustBufferHelper.free(errorBuf) - return InternalException("Unexpected CALL_ERROR") - } -} - -// Call a rust function that returns a plain value -internal inline fun uniffiRustCall(crossinline callback: (UniffiRustCallStatus) -> U): U { - return uniffiRustCallWithError(UniffiNullRustCallStatusErrorHandler, callback) -} - -internal inline fun uniffiTraitInterfaceCall( - callStatus: UniffiRustCallStatus, - makeCall: () -> T, - writeReturn: (T) -> Unit, -) { - try { - writeReturn(makeCall()) - } catch(e: kotlin.Exception) { - callStatus.code = UNIFFI_CALL_UNEXPECTED_ERROR - callStatus.errorBuf = FfiConverterString.lower(e.toString()) - } -} - -internal inline fun uniffiTraitInterfaceCallWithError( - callStatus: UniffiRustCallStatus, - makeCall: () -> T, - writeReturn: (T) -> Unit, - lowerError: (E) -> RustBufferByValue -) { - try { - writeReturn(makeCall()) - } catch(e: kotlin.Exception) { - if (e is E) { - callStatus.code = UNIFFI_CALL_ERROR - callStatus.errorBuf = lowerError(e) - } else { - callStatus.code = UNIFFI_CALL_UNEXPECTED_ERROR - callStatus.errorBuf = FfiConverterString.lower(e.toString()) - } - } -} - -@Structure.FieldOrder("code", "errorBuf") -internal open class UniffiRustCallStatusStruct( - @JvmField internal var code: Byte, - @JvmField internal var errorBuf: RustBufferByValue, -) : Structure() { - constructor(): this(0.toByte(), RustBufferByValue()) - - internal class ByValue( - code: Byte, - errorBuf: RustBufferByValue, - ): UniffiRustCallStatusStruct(code, errorBuf), Structure.ByValue { - constructor(): this(0.toByte(), RustBufferByValue()) - } - internal class ByReference( - code: Byte, - errorBuf: RustBufferByValue, - ): UniffiRustCallStatusStruct(code, errorBuf), Structure.ByReference { - constructor(): this(0.toByte(), RustBufferByValue()) - } -} - -internal typealias UniffiRustCallStatus = UniffiRustCallStatusStruct.ByReference -internal typealias UniffiRustCallStatusByValue = UniffiRustCallStatusStruct.ByValue - -internal object UniffiRustCallStatusHelper { - fun allocValue() = UniffiRustCallStatusByValue() - fun withReference(block: (UniffiRustCallStatus) -> U): U { - val status = UniffiRustCallStatus() - return block(status) - } -} - -internal class UniffiHandleMap { - private val map = java.util.concurrent.ConcurrentHashMap() - private val counter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - val size: Int - get() = map.size - - // Insert a new object into the handle map and get a handle for it - fun insert(obj: T): Long { - val handle = counter.getAndAdd(1) - map[handle] = obj - return handle - } - - // Get an object from the handle map - fun get(handle: Long): T { - return map[handle] ?: throw InternalException("UniffiHandleMap.get: Invalid handle") - } - - // Remove an entry from the handlemap and get the Kotlin object back - fun remove(handle: Long): T { - return map.remove(handle) ?: throw InternalException("UniffiHandleMap.remove: Invalid handle") - } -} - -typealias ByteByReference = com.sun.jna.ptr.ByteByReference - -typealias DoubleByReference = com.sun.jna.ptr.DoubleByReference - -typealias FloatByReference = com.sun.jna.ptr.FloatByReference - -typealias IntByReference = com.sun.jna.ptr.IntByReference - -typealias LongByReference = com.sun.jna.ptr.LongByReference - -typealias PointerByReference = com.sun.jna.ptr.PointerByReference - -typealias ShortByReference = com.sun.jna.ptr.ShortByReference - -// Contains loading, initialization code, -// and the FFI Function declarations in a com.sun.jna.Library. - -// Define FFI callback types -internal interface UniffiRustFutureContinuationCallback: com.sun.jna.Callback { - fun callback(`data`: Long,`pollResult`: Byte,) -} -internal interface UniffiForeignFutureFree: com.sun.jna.Callback { - fun callback(`handle`: Long,) -} -internal interface UniffiCallbackInterfaceFree: com.sun.jna.Callback { - fun callback(`handle`: Long,) -} -@Structure.FieldOrder("handle", "free") -internal open class UniffiForeignFutureStruct( - @JvmField internal var `handle`: Long, - @JvmField internal var `free`: UniffiForeignFutureFree?, -) : com.sun.jna.Structure() { - constructor(): this( - - `handle` = 0.toLong(), - - `free` = null, - - ) - - internal class UniffiByValue( - `handle`: Long, - `free`: UniffiForeignFutureFree?, - ): UniffiForeignFuture(`handle`,`free`,), Structure.ByValue -} - -internal typealias UniffiForeignFuture = UniffiForeignFutureStruct - -internal fun UniffiForeignFuture.uniffiSetValue(other: UniffiForeignFuture) { - `handle` = other.`handle` - `free` = other.`free` -} -internal fun UniffiForeignFuture.uniffiSetValue(other: UniffiForeignFutureUniffiByValue) { - `handle` = other.`handle` - `free` = other.`free` -} - -internal typealias UniffiForeignFutureUniffiByValue = UniffiForeignFutureStruct.UniffiByValue -@Structure.FieldOrder("returnValue", "callStatus") -internal open class UniffiForeignFutureStructU8Struct( - @JvmField internal var `returnValue`: Byte, - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `returnValue` = 0.toByte(), - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `returnValue`: Byte, - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructU8(`returnValue`,`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructU8 = UniffiForeignFutureStructU8Struct - -internal fun UniffiForeignFutureStructU8.uniffiSetValue(other: UniffiForeignFutureStructU8) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructU8.uniffiSetValue(other: UniffiForeignFutureStructU8UniffiByValue) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructU8UniffiByValue = UniffiForeignFutureStructU8Struct.UniffiByValue -internal interface UniffiForeignFutureCompleteU8: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructU8UniffiByValue,) -} -@Structure.FieldOrder("returnValue", "callStatus") -internal open class UniffiForeignFutureStructI8Struct( - @JvmField internal var `returnValue`: Byte, - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `returnValue` = 0.toByte(), - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `returnValue`: Byte, - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructI8(`returnValue`,`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructI8 = UniffiForeignFutureStructI8Struct - -internal fun UniffiForeignFutureStructI8.uniffiSetValue(other: UniffiForeignFutureStructI8) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructI8.uniffiSetValue(other: UniffiForeignFutureStructI8UniffiByValue) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructI8UniffiByValue = UniffiForeignFutureStructI8Struct.UniffiByValue -internal interface UniffiForeignFutureCompleteI8: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructI8UniffiByValue,) -} -@Structure.FieldOrder("returnValue", "callStatus") -internal open class UniffiForeignFutureStructU16Struct( - @JvmField internal var `returnValue`: Short, - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `returnValue` = 0.toShort(), - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `returnValue`: Short, - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructU16(`returnValue`,`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructU16 = UniffiForeignFutureStructU16Struct - -internal fun UniffiForeignFutureStructU16.uniffiSetValue(other: UniffiForeignFutureStructU16) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructU16.uniffiSetValue(other: UniffiForeignFutureStructU16UniffiByValue) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructU16UniffiByValue = UniffiForeignFutureStructU16Struct.UniffiByValue -internal interface UniffiForeignFutureCompleteU16: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructU16UniffiByValue,) -} -@Structure.FieldOrder("returnValue", "callStatus") -internal open class UniffiForeignFutureStructI16Struct( - @JvmField internal var `returnValue`: Short, - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `returnValue` = 0.toShort(), - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `returnValue`: Short, - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructI16(`returnValue`,`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructI16 = UniffiForeignFutureStructI16Struct - -internal fun UniffiForeignFutureStructI16.uniffiSetValue(other: UniffiForeignFutureStructI16) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructI16.uniffiSetValue(other: UniffiForeignFutureStructI16UniffiByValue) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructI16UniffiByValue = UniffiForeignFutureStructI16Struct.UniffiByValue -internal interface UniffiForeignFutureCompleteI16: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructI16UniffiByValue,) -} -@Structure.FieldOrder("returnValue", "callStatus") -internal open class UniffiForeignFutureStructU32Struct( - @JvmField internal var `returnValue`: Int, - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `returnValue` = 0, - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `returnValue`: Int, - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructU32(`returnValue`,`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructU32 = UniffiForeignFutureStructU32Struct - -internal fun UniffiForeignFutureStructU32.uniffiSetValue(other: UniffiForeignFutureStructU32) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructU32.uniffiSetValue(other: UniffiForeignFutureStructU32UniffiByValue) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructU32UniffiByValue = UniffiForeignFutureStructU32Struct.UniffiByValue -internal interface UniffiForeignFutureCompleteU32: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructU32UniffiByValue,) -} -@Structure.FieldOrder("returnValue", "callStatus") -internal open class UniffiForeignFutureStructI32Struct( - @JvmField internal var `returnValue`: Int, - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `returnValue` = 0, - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `returnValue`: Int, - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructI32(`returnValue`,`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructI32 = UniffiForeignFutureStructI32Struct - -internal fun UniffiForeignFutureStructI32.uniffiSetValue(other: UniffiForeignFutureStructI32) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructI32.uniffiSetValue(other: UniffiForeignFutureStructI32UniffiByValue) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructI32UniffiByValue = UniffiForeignFutureStructI32Struct.UniffiByValue -internal interface UniffiForeignFutureCompleteI32: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructI32UniffiByValue,) -} -@Structure.FieldOrder("returnValue", "callStatus") -internal open class UniffiForeignFutureStructU64Struct( - @JvmField internal var `returnValue`: Long, - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `returnValue` = 0.toLong(), - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `returnValue`: Long, - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructU64(`returnValue`,`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructU64 = UniffiForeignFutureStructU64Struct - -internal fun UniffiForeignFutureStructU64.uniffiSetValue(other: UniffiForeignFutureStructU64) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructU64.uniffiSetValue(other: UniffiForeignFutureStructU64UniffiByValue) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructU64UniffiByValue = UniffiForeignFutureStructU64Struct.UniffiByValue -internal interface UniffiForeignFutureCompleteU64: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructU64UniffiByValue,) -} -@Structure.FieldOrder("returnValue", "callStatus") -internal open class UniffiForeignFutureStructI64Struct( - @JvmField internal var `returnValue`: Long, - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `returnValue` = 0.toLong(), - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `returnValue`: Long, - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructI64(`returnValue`,`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructI64 = UniffiForeignFutureStructI64Struct - -internal fun UniffiForeignFutureStructI64.uniffiSetValue(other: UniffiForeignFutureStructI64) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructI64.uniffiSetValue(other: UniffiForeignFutureStructI64UniffiByValue) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructI64UniffiByValue = UniffiForeignFutureStructI64Struct.UniffiByValue -internal interface UniffiForeignFutureCompleteI64: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructI64UniffiByValue,) -} -@Structure.FieldOrder("returnValue", "callStatus") -internal open class UniffiForeignFutureStructF32Struct( - @JvmField internal var `returnValue`: Float, - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `returnValue` = 0.0f, - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `returnValue`: Float, - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructF32(`returnValue`,`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructF32 = UniffiForeignFutureStructF32Struct - -internal fun UniffiForeignFutureStructF32.uniffiSetValue(other: UniffiForeignFutureStructF32) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructF32.uniffiSetValue(other: UniffiForeignFutureStructF32UniffiByValue) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructF32UniffiByValue = UniffiForeignFutureStructF32Struct.UniffiByValue -internal interface UniffiForeignFutureCompleteF32: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructF32UniffiByValue,) -} -@Structure.FieldOrder("returnValue", "callStatus") -internal open class UniffiForeignFutureStructF64Struct( - @JvmField internal var `returnValue`: Double, - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `returnValue` = 0.0, - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `returnValue`: Double, - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructF64(`returnValue`,`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructF64 = UniffiForeignFutureStructF64Struct - -internal fun UniffiForeignFutureStructF64.uniffiSetValue(other: UniffiForeignFutureStructF64) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructF64.uniffiSetValue(other: UniffiForeignFutureStructF64UniffiByValue) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructF64UniffiByValue = UniffiForeignFutureStructF64Struct.UniffiByValue -internal interface UniffiForeignFutureCompleteF64: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructF64UniffiByValue,) -} -@Structure.FieldOrder("returnValue", "callStatus") -internal open class UniffiForeignFutureStructPointerStruct( - @JvmField internal var `returnValue`: Pointer?, - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `returnValue` = NullPointer, - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `returnValue`: Pointer?, - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructPointer(`returnValue`,`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructPointer = UniffiForeignFutureStructPointerStruct - -internal fun UniffiForeignFutureStructPointer.uniffiSetValue(other: UniffiForeignFutureStructPointer) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructPointer.uniffiSetValue(other: UniffiForeignFutureStructPointerUniffiByValue) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructPointerUniffiByValue = UniffiForeignFutureStructPointerStruct.UniffiByValue -internal interface UniffiForeignFutureCompletePointer: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructPointerUniffiByValue,) -} -@Structure.FieldOrder("returnValue", "callStatus") -internal open class UniffiForeignFutureStructRustBufferStruct( - @JvmField internal var `returnValue`: RustBufferByValue, - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `returnValue` = RustBufferHelper.allocValue(), - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `returnValue`: RustBufferByValue, - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructRustBuffer(`returnValue`,`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructRustBuffer = UniffiForeignFutureStructRustBufferStruct - -internal fun UniffiForeignFutureStructRustBuffer.uniffiSetValue(other: UniffiForeignFutureStructRustBuffer) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructRustBuffer.uniffiSetValue(other: UniffiForeignFutureStructRustBufferUniffiByValue) { - `returnValue` = other.`returnValue` - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructRustBufferUniffiByValue = UniffiForeignFutureStructRustBufferStruct.UniffiByValue -internal interface UniffiForeignFutureCompleteRustBuffer: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructRustBufferUniffiByValue,) -} -@Structure.FieldOrder("callStatus") -internal open class UniffiForeignFutureStructVoidStruct( - @JvmField internal var `callStatus`: UniffiRustCallStatusByValue, -) : com.sun.jna.Structure() { - constructor(): this( - - `callStatus` = UniffiRustCallStatusHelper.allocValue(), - - ) - - internal class UniffiByValue( - `callStatus`: UniffiRustCallStatusByValue, - ): UniffiForeignFutureStructVoid(`callStatus`,), Structure.ByValue -} - -internal typealias UniffiForeignFutureStructVoid = UniffiForeignFutureStructVoidStruct - -internal fun UniffiForeignFutureStructVoid.uniffiSetValue(other: UniffiForeignFutureStructVoid) { - `callStatus` = other.`callStatus` -} -internal fun UniffiForeignFutureStructVoid.uniffiSetValue(other: UniffiForeignFutureStructVoidUniffiByValue) { - `callStatus` = other.`callStatus` -} - -internal typealias UniffiForeignFutureStructVoidUniffiByValue = UniffiForeignFutureStructVoidStruct.UniffiByValue -internal interface UniffiForeignFutureCompleteVoid: com.sun.jna.Callback { - fun callback(`callbackData`: Long,`result`: UniffiForeignFutureStructVoidUniffiByValue,) -} -internal interface UniffiCallbackInterfaceLogWriterMethod0: com.sun.jna.Callback { - fun callback(`uniffiHandle`: Long,`record`: RustBufferByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) -} -internal interface UniffiCallbackInterfaceVssHeaderProviderMethod0: com.sun.jna.Callback { - fun callback(`uniffiHandle`: Long,`request`: RustBufferByValue,`uniffiFutureCallback`: UniffiForeignFutureCompleteRustBuffer,`uniffiCallbackData`: Long,`uniffiOutReturn`: UniffiForeignFuture,) -} -@Structure.FieldOrder("log", "uniffiFree") -internal open class UniffiVTableCallbackInterfaceLogWriterStruct( - @JvmField internal var `log`: UniffiCallbackInterfaceLogWriterMethod0?, - @JvmField internal var `uniffiFree`: UniffiCallbackInterfaceFree?, -) : com.sun.jna.Structure() { - constructor(): this( - - `log` = null, - - `uniffiFree` = null, - - ) - - internal class UniffiByValue( - `log`: UniffiCallbackInterfaceLogWriterMethod0?, - `uniffiFree`: UniffiCallbackInterfaceFree?, - ): UniffiVTableCallbackInterfaceLogWriter(`log`,`uniffiFree`,), Structure.ByValue -} - -internal typealias UniffiVTableCallbackInterfaceLogWriter = UniffiVTableCallbackInterfaceLogWriterStruct - -internal fun UniffiVTableCallbackInterfaceLogWriter.uniffiSetValue(other: UniffiVTableCallbackInterfaceLogWriter) { - `log` = other.`log` - `uniffiFree` = other.`uniffiFree` -} -internal fun UniffiVTableCallbackInterfaceLogWriter.uniffiSetValue(other: UniffiVTableCallbackInterfaceLogWriterUniffiByValue) { - `log` = other.`log` - `uniffiFree` = other.`uniffiFree` -} - -internal typealias UniffiVTableCallbackInterfaceLogWriterUniffiByValue = UniffiVTableCallbackInterfaceLogWriterStruct.UniffiByValue -@Structure.FieldOrder("getHeaders", "uniffiFree") -internal open class UniffiVTableCallbackInterfaceVssHeaderProviderStruct( - @JvmField internal var `getHeaders`: UniffiCallbackInterfaceVssHeaderProviderMethod0?, - @JvmField internal var `uniffiFree`: UniffiCallbackInterfaceFree?, -) : com.sun.jna.Structure() { - constructor(): this( - - `getHeaders` = null, - - `uniffiFree` = null, - - ) - - internal class UniffiByValue( - `getHeaders`: UniffiCallbackInterfaceVssHeaderProviderMethod0?, - `uniffiFree`: UniffiCallbackInterfaceFree?, - ): UniffiVTableCallbackInterfaceVssHeaderProvider(`getHeaders`,`uniffiFree`,), Structure.ByValue -} - -internal typealias UniffiVTableCallbackInterfaceVssHeaderProvider = UniffiVTableCallbackInterfaceVssHeaderProviderStruct - -internal fun UniffiVTableCallbackInterfaceVssHeaderProvider.uniffiSetValue(other: UniffiVTableCallbackInterfaceVssHeaderProvider) { - `getHeaders` = other.`getHeaders` - `uniffiFree` = other.`uniffiFree` -} -internal fun UniffiVTableCallbackInterfaceVssHeaderProvider.uniffiSetValue(other: UniffiVTableCallbackInterfaceVssHeaderProviderUniffiByValue) { - `getHeaders` = other.`getHeaders` - `uniffiFree` = other.`uniffiFree` -} - -internal typealias UniffiVTableCallbackInterfaceVssHeaderProviderUniffiByValue = UniffiVTableCallbackInterfaceVssHeaderProviderStruct.UniffiByValue - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@Synchronized -private fun findLibraryName(componentName: String): String { - val libOverride = System.getProperty("uniffi.component.$componentName.libraryOverride") - if (libOverride != null) { - return libOverride - } - return "ldk_node" -} - -private inline fun loadIndirect( - componentName: String -): Lib { - return Native.load(findLibraryName(componentName), Lib::class.java) -} - -// A JNA Library to expose the extern-C FFI definitions. -// This is an implementation detail which will be called internally by the public API. - -internal interface UniffiLib : Library { - companion object { - internal val INSTANCE: UniffiLib by lazy { - loadIndirect(componentName = "ldk_node") - .also { lib: UniffiLib -> - uniffiCheckContractApiVersion(lib) - uniffiCheckApiChecksums(lib) - uniffiCallbackInterfaceLogWriter.register(lib) - } - } - - // The Cleaner for the whole library - internal val CLEANER: UniffiCleaner by lazy { - UniffiCleaner.create() - } - } - - fun uniffi_ldk_node_fn_clone_bolt11invoice( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_bolt11invoice( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_constructor_bolt11invoice_from_str( - `invoiceStr`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt11invoice_amount_milli_satoshis( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11invoice_currency( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11invoice_expiry_time_seconds( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_bolt11invoice_fallback_addresses( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11invoice_invoice_description( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11invoice_is_expired( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_method_bolt11invoice_min_final_cltv_expiry_delta( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_bolt11invoice_network( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11invoice_payment_hash( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11invoice_payment_secret( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11invoice_recover_payee_pub_key( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11invoice_route_hints( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11invoice_seconds_since_epoch( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_bolt11invoice_seconds_until_expiry( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_bolt11invoice_signable_hash( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11invoice_would_expire( - `ptr`: Pointer?, - `atTimeSeconds`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_method_bolt11invoice_uniffi_trait_debug( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11invoice_uniffi_trait_display( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11invoice_uniffi_trait_eq_eq( - `ptr`: Pointer?, - `other`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_method_bolt11invoice_uniffi_trait_eq_ne( - `ptr`: Pointer?, - `other`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_clone_bolt11payment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_bolt11payment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_bolt11payment_claim_for_hash( - `ptr`: Pointer?, - `paymentHash`: RustBufferByValue, - `claimableAmountMsat`: Long, - `preimage`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_bolt11payment_estimate_routing_fees( - `ptr`: Pointer?, - `invoice`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_bolt11payment_estimate_routing_fees_using_amount( - `ptr`: Pointer?, - `invoice`: Pointer?, - `amountMsat`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_bolt11payment_fail_for_hash( - `ptr`: Pointer?, - `paymentHash`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_bolt11payment_receive( - `ptr`: Pointer?, - `amountMsat`: Long, - `description`: RustBufferByValue, - `expirySecs`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt11payment_receive_for_hash( - `ptr`: Pointer?, - `amountMsat`: Long, - `description`: RustBufferByValue, - `expirySecs`: Int, - `paymentHash`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt11payment_receive_variable_amount( - `ptr`: Pointer?, - `description`: RustBufferByValue, - `expirySecs`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt11payment_receive_variable_amount_for_hash( - `ptr`: Pointer?, - `description`: RustBufferByValue, - `expirySecs`: Int, - `paymentHash`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt11payment_receive_variable_amount_via_jit_channel( - `ptr`: Pointer?, - `description`: RustBufferByValue, - `expirySecs`: Int, - `maxProportionalLspFeeLimitPpmMsat`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt11payment_receive_variable_amount_via_jit_channel_for_hash( - `ptr`: Pointer?, - `description`: RustBufferByValue, - `expirySecs`: Int, - `maxProportionalLspFeeLimitPpmMsat`: RustBufferByValue, - `paymentHash`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt11payment_receive_via_jit_channel( - `ptr`: Pointer?, - `amountMsat`: Long, - `description`: RustBufferByValue, - `expirySecs`: Int, - `maxLspFeeLimitMsat`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt11payment_receive_via_jit_channel_for_hash( - `ptr`: Pointer?, - `amountMsat`: Long, - `description`: RustBufferByValue, - `expirySecs`: Int, - `maxLspFeeLimitMsat`: RustBufferByValue, - `paymentHash`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt11payment_send( - `ptr`: Pointer?, - `invoice`: Pointer?, - `routeParameters`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11payment_send_probes( - `ptr`: Pointer?, - `invoice`: Pointer?, - `routeParameters`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11payment_send_probes_using_amount( - `ptr`: Pointer?, - `invoice`: Pointer?, - `amountMsat`: Long, - `routeParameters`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt11payment_send_using_amount( - `ptr`: Pointer?, - `invoice`: Pointer?, - `amountMsat`: Long, - `routeParameters`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_clone_bolt12invoice( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_bolt12invoice( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_constructor_bolt12invoice_from_str( - `invoiceStr`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt12invoice_absolute_expiry_seconds( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_amount( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_amount_msats( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_bolt12invoice_chain( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_created_at( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_bolt12invoice_encode( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_fallback_addresses( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_invoice_description( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_is_expired( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_method_bolt12invoice_issuer( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_issuer_signing_pubkey( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_metadata( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_offer_chains( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_payer_note( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_payer_signing_pubkey( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_payment_hash( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_quantity( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_relative_expiry( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_bolt12invoice_signable_hash( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12invoice_signing_pubkey( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_clone_bolt12payment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_bolt12payment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_bolt12payment_blinded_paths_for_async_recipient( - `ptr`: Pointer?, - `recipientId`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12payment_initiate_refund( - `ptr`: Pointer?, - `amountMsat`: Long, - `expirySecs`: Int, - `quantity`: RustBufferByValue, - `payerNote`: RustBufferByValue, - `routeParameters`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt12payment_receive( - `ptr`: Pointer?, - `amountMsat`: Long, - `description`: RustBufferByValue, - `expirySecs`: RustBufferByValue, - `quantity`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt12payment_receive_async( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt12payment_receive_variable_amount( - `ptr`: Pointer?, - `description`: RustBufferByValue, - `expirySecs`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt12payment_request_refund_payment( - `ptr`: Pointer?, - `refund`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_bolt12payment_send( - `ptr`: Pointer?, - `offer`: Pointer?, - `quantity`: RustBufferByValue, - `payerNote`: RustBufferByValue, - `routeParameters`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12payment_send_using_amount( - `ptr`: Pointer?, - `offer`: Pointer?, - `amountMsat`: Long, - `quantity`: RustBufferByValue, - `payerNote`: RustBufferByValue, - `routeParameters`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_bolt12payment_set_paths_to_static_invoice_server( - `ptr`: Pointer?, - `paths`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_clone_builder( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_builder( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_constructor_builder_from_config( - `config`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_constructor_builder_new( - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_builder_build( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_builder_build_with_fs_store( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_builder_build_with_vss_store( - `ptr`: Pointer?, - `vssUrl`: RustBufferByValue, - `storeId`: RustBufferByValue, - `lnurlAuthServerUrl`: RustBufferByValue, - `fixedHeaders`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_builder_build_with_vss_store_and_fixed_headers( - `ptr`: Pointer?, - `vssUrl`: RustBufferByValue, - `storeId`: RustBufferByValue, - `fixedHeaders`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_builder_build_with_vss_store_and_header_provider( - `ptr`: Pointer?, - `vssUrl`: RustBufferByValue, - `storeId`: RustBufferByValue, - `headerProvider`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_builder_set_address_type( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_address_types_to_monitor( - `ptr`: Pointer?, - `addressTypesToMonitor`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_announcement_addresses( - `ptr`: Pointer?, - `announcementAddresses`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_async_payments_role( - `ptr`: Pointer?, - `role`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_chain_source_bitcoind_rest( - `ptr`: Pointer?, - `restHost`: RustBufferByValue, - `restPort`: Short, - `rpcHost`: RustBufferByValue, - `rpcPort`: Short, - `rpcUser`: RustBufferByValue, - `rpcPassword`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_chain_source_bitcoind_rpc( - `ptr`: Pointer?, - `rpcHost`: RustBufferByValue, - `rpcPort`: Short, - `rpcUser`: RustBufferByValue, - `rpcPassword`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_chain_source_electrum( - `ptr`: Pointer?, - `serverUrl`: RustBufferByValue, - `config`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_chain_source_esplora( - `ptr`: Pointer?, - `serverUrl`: RustBufferByValue, - `config`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_channel_data_migration( - `ptr`: Pointer?, - `migration`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_custom_logger( - `ptr`: Pointer?, - `logWriter`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_entropy_bip39_mnemonic( - `ptr`: Pointer?, - `mnemonic`: RustBufferByValue, - `passphrase`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_entropy_seed_bytes( - `ptr`: Pointer?, - `seedBytes`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_entropy_seed_path( - `ptr`: Pointer?, - `seedPath`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_filesystem_logger( - `ptr`: Pointer?, - `logFilePath`: RustBufferByValue, - `maxLogLevel`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_gossip_source_p2p( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_gossip_source_rgs( - `ptr`: Pointer?, - `rgsServerUrl`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_liquidity_source_lsps1( - `ptr`: Pointer?, - `nodeId`: RustBufferByValue, - `address`: RustBufferByValue, - `token`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_liquidity_source_lsps2( - `ptr`: Pointer?, - `nodeId`: RustBufferByValue, - `address`: RustBufferByValue, - `token`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_listening_addresses( - `ptr`: Pointer?, - `listeningAddresses`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_log_facade_logger( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_network( - `ptr`: Pointer?, - `network`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_node_alias( - `ptr`: Pointer?, - `nodeAlias`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_pathfinding_scores_source( - `ptr`: Pointer?, - `url`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_scoring_decay_params( - `ptr`: Pointer?, - `params`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_scoring_fee_params( - `ptr`: Pointer?, - `params`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_builder_set_storage_dir_path( - `ptr`: Pointer?, - `storageDirPath`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_clone_feerate( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_feerate( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_constructor_feerate_from_sat_per_kwu( - `satKwu`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_constructor_feerate_from_sat_per_vb_unchecked( - `satVb`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_feerate_to_sat_per_kwu( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_feerate_to_sat_per_vb_ceil( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_feerate_to_sat_per_vb_floor( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_clone_lsps1liquidity( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_lsps1liquidity( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_lsps1liquidity_check_order_status( - `ptr`: Pointer?, - `orderId`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_lsps1liquidity_request_channel( - `ptr`: Pointer?, - `lspBalanceSat`: Long, - `clientBalanceSat`: Long, - `channelExpiryBlocks`: Int, - `announceChannel`: Byte, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_clone_logwriter( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_logwriter( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_init_callback_vtable_logwriter( - `vtable`: UniffiVTableCallbackInterfaceLogWriter, - ): Unit - fun uniffi_ldk_node_fn_method_logwriter_log( - `ptr`: Pointer?, - `record`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_clone_networkgraph( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_networkgraph( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_networkgraph_channel( - `ptr`: Pointer?, - `shortChannelId`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_networkgraph_list_channels( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_networkgraph_list_nodes( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_networkgraph_node( - `ptr`: Pointer?, - `nodeId`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_clone_node( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_node( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_add_address_type_to_monitor( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `seedBytes`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_add_address_type_to_monitor_with_mnemonic( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `mnemonic`: RustBufferByValue, - `passphrase`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_add_onchain_wallet_account( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `accountIndex`: Int, - `xpub`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_announcement_addresses( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_bolt11_payment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_node_bolt12_payment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_node_close_channel( - `ptr`: Pointer?, - `userChannelId`: RustBufferByValue, - `counterpartyNodeId`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_config( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_connect( - `ptr`: Pointer?, - `nodeId`: RustBufferByValue, - `address`: RustBufferByValue, - `persist`: Byte, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_current_sync_intervals( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_disconnect( - `ptr`: Pointer?, - `nodeId`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_event_handled( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_export_onchain_wallet_account_xpub( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `accountIndex`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_export_pathfinding_scores( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_force_close_channel( - `ptr`: Pointer?, - `userChannelId`: RustBufferByValue, - `counterpartyNodeId`: RustBufferByValue, - `reason`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_get_address_balance( - `ptr`: Pointer?, - `addressStr`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_node_get_balance_for_address_type( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_get_balance_for_onchain_wallet_account( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `accountIndex`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_get_transaction_details( - `ptr`: Pointer?, - `txid`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_list_balances( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_list_channels( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_list_monitored_address_types( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_list_onchain_wallet_accounts( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_list_payments( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_list_peers( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_listening_addresses( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_lsps1_liquidity( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_node_network_graph( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_node_next_event( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_next_event_async( - `ptr`: Pointer?, - ): Long - fun uniffi_ldk_node_fn_method_node_node_alias( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_node_id( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_onchain_payment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_node_open_announced_channel( - `ptr`: Pointer?, - `nodeId`: RustBufferByValue, - `address`: RustBufferByValue, - `channelAmountSats`: Long, - `pushToCounterpartyMsat`: RustBufferByValue, - `channelConfig`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_open_channel( - `ptr`: Pointer?, - `nodeId`: RustBufferByValue, - `address`: RustBufferByValue, - `channelAmountSats`: Long, - `pushToCounterpartyMsat`: RustBufferByValue, - `channelConfig`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_payment( - `ptr`: Pointer?, - `paymentId`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_remove_address_type_from_monitor( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_remove_onchain_wallet_account( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `accountIndex`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_remove_payment( - `ptr`: Pointer?, - `paymentId`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_set_primary_address_type( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `seedBytes`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_set_primary_address_type_with_mnemonic( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `mnemonic`: RustBufferByValue, - `passphrase`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_sign_message( - `ptr`: Pointer?, - `msg`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_splice_in( - `ptr`: Pointer?, - `userChannelId`: RustBufferByValue, - `counterpartyNodeId`: RustBufferByValue, - `spliceAmountSats`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_splice_out( - `ptr`: Pointer?, - `userChannelId`: RustBufferByValue, - `counterpartyNodeId`: RustBufferByValue, - `address`: RustBufferByValue, - `spliceAmountSats`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_spontaneous_payment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_node_start( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_status( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_node_stop( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_sync_wallets( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_unified_qr_payment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_node_update_channel_config( - `ptr`: Pointer?, - `userChannelId`: RustBufferByValue, - `counterpartyNodeId`: RustBufferByValue, - `channelConfig`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_update_sync_intervals( - `ptr`: Pointer?, - `intervals`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_node_verify_signature( - `ptr`: Pointer?, - `msg`: RustBufferByValue, - `sig`: RustBufferByValue, - `pkey`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_method_node_wait_next_event( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_clone_offer( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_offer( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_constructor_offer_from_str( - `offerStr`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_offer_absolute_expiry_seconds( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_offer_amount( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_offer_chains( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_offer_expects_quantity( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_method_offer_id( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_offer_is_expired( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_method_offer_is_valid_quantity( - `ptr`: Pointer?, - `quantity`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_method_offer_issuer( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_offer_issuer_signing_pubkey( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_offer_metadata( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_offer_offer_description( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_offer_supports_chain( - `ptr`: Pointer?, - `chain`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_method_offer_uniffi_trait_debug( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_offer_uniffi_trait_display( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_offer_uniffi_trait_eq_eq( - `ptr`: Pointer?, - `other`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_method_offer_uniffi_trait_eq_ne( - `ptr`: Pointer?, - `other`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_clone_onchainpayment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_onchainpayment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_onchainpayment_accelerate_by_cpfp( - `ptr`: Pointer?, - `txid`: RustBufferByValue, - `feeRate`: RustBufferByValue, - `destinationAddress`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_address_info_for_account_at_index( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `accountIndex`: Int, - `keychain`: RustBufferByValue, - `index`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_address_info_for_type_at_index( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `keychain`: RustBufferByValue, - `index`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_address_infos_for_account( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `accountIndex`: Int, - `keychain`: RustBufferByValue, - `startIndex`: Int, - `count`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_address_infos_for_type( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `keychain`: RustBufferByValue, - `startIndex`: Int, - `count`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_bump_fee_by_rbf( - `ptr`: Pointer?, - `txid`: RustBufferByValue, - `feeRate`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_calculate_cpfp_fee_rate( - `ptr`: Pointer?, - `parentTxid`: RustBufferByValue, - `urgent`: Byte, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_onchainpayment_calculate_send_all_fee( - `ptr`: Pointer?, - `address`: RustBufferByValue, - `retainReserves`: Byte, - `feeRate`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_onchainpayment_calculate_total_fee( - `ptr`: Pointer?, - `address`: RustBufferByValue, - `amountSats`: Long, - `feeRate`: RustBufferByValue, - `utxosToSpend`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_onchainpayment_list_spendable_outputs( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_new_address( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_new_address_for_account( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `accountIndex`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_new_address_for_type( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_new_address_info( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_new_address_info_for_account( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `accountIndex`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_new_address_info_for_type( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_reveal_receive_addresses_to( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `index`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_onchainpayment_reveal_receive_addresses_to_account( - `ptr`: Pointer?, - `addressType`: RustBufferByValue, - `accountIndex`: Int, - `index`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_onchainpayment_select_utxos_with_algorithm( - `ptr`: Pointer?, - `targetAmountSats`: Long, - `feeRate`: RustBufferByValue, - `algorithm`: RustBufferByValue, - `utxos`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_send_all_to_address( - `ptr`: Pointer?, - `address`: RustBufferByValue, - `retainReserve`: Byte, - `feeRate`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_onchainpayment_send_to_address( - `ptr`: Pointer?, - `address`: RustBufferByValue, - `amountSats`: Long, - `feeRate`: RustBufferByValue, - `utxosToSpend`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_clone_refund( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_refund( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_constructor_refund_from_str( - `refundStr`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_method_refund_absolute_expiry_seconds( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_refund_amount_msats( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun uniffi_ldk_node_fn_method_refund_chain( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_refund_is_expired( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_method_refund_issuer( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_refund_payer_metadata( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_refund_payer_note( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_refund_payer_signing_pubkey( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_refund_quantity( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_refund_refund_description( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_refund_uniffi_trait_debug( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_refund_uniffi_trait_display( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_refund_uniffi_trait_eq_eq( - `ptr`: Pointer?, - `other`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_method_refund_uniffi_trait_eq_ne( - `ptr`: Pointer?, - `other`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun uniffi_ldk_node_fn_clone_spontaneouspayment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_spontaneouspayment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_spontaneouspayment_send( - `ptr`: Pointer?, - `amountMsat`: Long, - `nodeId`: RustBufferByValue, - `routeParameters`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_spontaneouspayment_send_probes( - `ptr`: Pointer?, - `amountMsat`: Long, - `nodeId`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_spontaneouspayment_send_with_custom_tlvs( - `ptr`: Pointer?, - `amountMsat`: Long, - `nodeId`: RustBufferByValue, - `routeParameters`: RustBufferByValue, - `customTlvs`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_spontaneouspayment_send_with_preimage( - `ptr`: Pointer?, - `amountMsat`: Long, - `nodeId`: RustBufferByValue, - `preimage`: RustBufferByValue, - `routeParameters`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_spontaneouspayment_send_with_preimage_and_custom_tlvs( - `ptr`: Pointer?, - `amountMsat`: Long, - `nodeId`: RustBufferByValue, - `customTlvs`: RustBufferByValue, - `preimage`: RustBufferByValue, - `routeParameters`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_clone_unifiedqrpayment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_unifiedqrpayment( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_unifiedqrpayment_receive( - `ptr`: Pointer?, - `amountSats`: Long, - `message`: RustBufferByValue, - `expirySec`: Int, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_method_unifiedqrpayment_send( - `ptr`: Pointer?, - `uriStr`: RustBufferByValue, - `routeParameters`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_clone_vssheaderprovider( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun uniffi_ldk_node_fn_free_vssheaderprovider( - `ptr`: Pointer?, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_fn_method_vssheaderprovider_get_headers( - `ptr`: Pointer?, - `request`: RustBufferByValue, - ): Long - fun uniffi_ldk_node_fn_func_battery_saving_sync_intervals( - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_func_default_config( - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_func_derive_node_secret_from_mnemonic( - `mnemonic`: RustBufferByValue, - `passphrase`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun uniffi_ldk_node_fn_func_generate_entropy_mnemonic( - `wordCount`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun ffi_ldk_node_rustbuffer_alloc( - `size`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun ffi_ldk_node_rustbuffer_from_bytes( - `bytes`: ForeignBytesByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun ffi_ldk_node_rustbuffer_free( - `buf`: RustBufferByValue, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun ffi_ldk_node_rustbuffer_reserve( - `buf`: RustBufferByValue, - `additional`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun ffi_ldk_node_rust_future_poll_u8( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_u8( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_u8( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_u8( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun ffi_ldk_node_rust_future_poll_i8( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_i8( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_i8( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_i8( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Byte - fun ffi_ldk_node_rust_future_poll_u16( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_u16( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_u16( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_u16( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Short - fun ffi_ldk_node_rust_future_poll_i16( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_i16( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_i16( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_i16( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Short - fun ffi_ldk_node_rust_future_poll_u32( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_u32( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_u32( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_u32( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Int - fun ffi_ldk_node_rust_future_poll_i32( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_i32( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_i32( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_i32( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Int - fun ffi_ldk_node_rust_future_poll_u64( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_u64( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_u64( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_u64( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun ffi_ldk_node_rust_future_poll_i64( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_i64( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_i64( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_i64( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Long - fun ffi_ldk_node_rust_future_poll_f32( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_f32( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_f32( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_f32( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Float - fun ffi_ldk_node_rust_future_poll_f64( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_f64( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_f64( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_f64( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Double - fun ffi_ldk_node_rust_future_poll_pointer( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_pointer( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_pointer( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_pointer( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Pointer? - fun ffi_ldk_node_rust_future_poll_rust_buffer( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_rust_buffer( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_rust_buffer( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_rust_buffer( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): RustBufferByValue - fun ffi_ldk_node_rust_future_poll_void( - `handle`: Long, - `callback`: UniffiRustFutureContinuationCallback, - `callbackData`: Long, - ): Unit - fun ffi_ldk_node_rust_future_cancel_void( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_free_void( - `handle`: Long, - ): Unit - fun ffi_ldk_node_rust_future_complete_void( - `handle`: Long, - uniffiCallStatus: UniffiRustCallStatus, - ): Unit - fun uniffi_ldk_node_checksum_func_battery_saving_sync_intervals( - ): Short - fun uniffi_ldk_node_checksum_func_default_config( - ): Short - fun uniffi_ldk_node_checksum_func_derive_node_secret_from_mnemonic( - ): Short - fun uniffi_ldk_node_checksum_func_generate_entropy_mnemonic( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_amount_milli_satoshis( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_currency( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_expiry_time_seconds( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_fallback_addresses( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_invoice_description( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_is_expired( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_min_final_cltv_expiry_delta( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_network( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_payment_hash( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_payment_secret( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_recover_payee_pub_key( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_route_hints( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_seconds_since_epoch( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_seconds_until_expiry( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_signable_hash( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11invoice_would_expire( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_claim_for_hash( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_estimate_routing_fees( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_estimate_routing_fees_using_amount( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_fail_for_hash( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_receive( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_receive_for_hash( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_receive_variable_amount( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_receive_variable_amount_for_hash( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_receive_variable_amount_via_jit_channel( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_receive_variable_amount_via_jit_channel_for_hash( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_receive_via_jit_channel( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_receive_via_jit_channel_for_hash( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_send( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_send_probes( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_send_probes_using_amount( - ): Short - fun uniffi_ldk_node_checksum_method_bolt11payment_send_using_amount( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_absolute_expiry_seconds( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_amount( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_amount_msats( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_chain( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_created_at( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_encode( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_fallback_addresses( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_invoice_description( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_is_expired( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_issuer( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_issuer_signing_pubkey( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_metadata( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_offer_chains( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_payer_note( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_payer_signing_pubkey( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_payment_hash( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_quantity( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_relative_expiry( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_signable_hash( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12invoice_signing_pubkey( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12payment_blinded_paths_for_async_recipient( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12payment_initiate_refund( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12payment_receive( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12payment_receive_async( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12payment_receive_variable_amount( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12payment_request_refund_payment( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12payment_send( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12payment_send_using_amount( - ): Short - fun uniffi_ldk_node_checksum_method_bolt12payment_set_paths_to_static_invoice_server( - ): Short - fun uniffi_ldk_node_checksum_method_builder_build( - ): Short - fun uniffi_ldk_node_checksum_method_builder_build_with_fs_store( - ): Short - fun uniffi_ldk_node_checksum_method_builder_build_with_vss_store( - ): Short - fun uniffi_ldk_node_checksum_method_builder_build_with_vss_store_and_fixed_headers( - ): Short - fun uniffi_ldk_node_checksum_method_builder_build_with_vss_store_and_header_provider( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_address_type( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_address_types_to_monitor( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_announcement_addresses( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_async_payments_role( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_chain_source_bitcoind_rest( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_chain_source_bitcoind_rpc( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_chain_source_electrum( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_chain_source_esplora( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_channel_data_migration( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_custom_logger( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_entropy_bip39_mnemonic( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_entropy_seed_bytes( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_entropy_seed_path( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_filesystem_logger( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_gossip_source_p2p( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_gossip_source_rgs( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_liquidity_source_lsps1( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_liquidity_source_lsps2( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_listening_addresses( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_log_facade_logger( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_network( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_node_alias( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_pathfinding_scores_source( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_scoring_decay_params( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_scoring_fee_params( - ): Short - fun uniffi_ldk_node_checksum_method_builder_set_storage_dir_path( - ): Short - fun uniffi_ldk_node_checksum_method_feerate_to_sat_per_kwu( - ): Short - fun uniffi_ldk_node_checksum_method_feerate_to_sat_per_vb_ceil( - ): Short - fun uniffi_ldk_node_checksum_method_feerate_to_sat_per_vb_floor( - ): Short - fun uniffi_ldk_node_checksum_method_lsps1liquidity_check_order_status( - ): Short - fun uniffi_ldk_node_checksum_method_lsps1liquidity_request_channel( - ): Short - fun uniffi_ldk_node_checksum_method_logwriter_log( - ): Short - fun uniffi_ldk_node_checksum_method_networkgraph_channel( - ): Short - fun uniffi_ldk_node_checksum_method_networkgraph_list_channels( - ): Short - fun uniffi_ldk_node_checksum_method_networkgraph_list_nodes( - ): Short - fun uniffi_ldk_node_checksum_method_networkgraph_node( - ): Short - fun uniffi_ldk_node_checksum_method_node_add_address_type_to_monitor( - ): Short - fun uniffi_ldk_node_checksum_method_node_add_address_type_to_monitor_with_mnemonic( - ): Short - fun uniffi_ldk_node_checksum_method_node_add_onchain_wallet_account( - ): Short - fun uniffi_ldk_node_checksum_method_node_announcement_addresses( - ): Short - fun uniffi_ldk_node_checksum_method_node_bolt11_payment( - ): Short - fun uniffi_ldk_node_checksum_method_node_bolt12_payment( - ): Short - fun uniffi_ldk_node_checksum_method_node_close_channel( - ): Short - fun uniffi_ldk_node_checksum_method_node_config( - ): Short - fun uniffi_ldk_node_checksum_method_node_connect( - ): Short - fun uniffi_ldk_node_checksum_method_node_current_sync_intervals( - ): Short - fun uniffi_ldk_node_checksum_method_node_disconnect( - ): Short - fun uniffi_ldk_node_checksum_method_node_event_handled( - ): Short - fun uniffi_ldk_node_checksum_method_node_export_onchain_wallet_account_xpub( - ): Short - fun uniffi_ldk_node_checksum_method_node_export_pathfinding_scores( - ): Short - fun uniffi_ldk_node_checksum_method_node_force_close_channel( - ): Short - fun uniffi_ldk_node_checksum_method_node_get_address_balance( - ): Short - fun uniffi_ldk_node_checksum_method_node_get_balance_for_address_type( - ): Short - fun uniffi_ldk_node_checksum_method_node_get_balance_for_onchain_wallet_account( - ): Short - fun uniffi_ldk_node_checksum_method_node_get_transaction_details( - ): Short - fun uniffi_ldk_node_checksum_method_node_list_balances( - ): Short - fun uniffi_ldk_node_checksum_method_node_list_channels( - ): Short - fun uniffi_ldk_node_checksum_method_node_list_monitored_address_types( - ): Short - fun uniffi_ldk_node_checksum_method_node_list_onchain_wallet_accounts( - ): Short - fun uniffi_ldk_node_checksum_method_node_list_payments( - ): Short - fun uniffi_ldk_node_checksum_method_node_list_peers( - ): Short - fun uniffi_ldk_node_checksum_method_node_listening_addresses( - ): Short - fun uniffi_ldk_node_checksum_method_node_lsps1_liquidity( - ): Short - fun uniffi_ldk_node_checksum_method_node_network_graph( - ): Short - fun uniffi_ldk_node_checksum_method_node_next_event( - ): Short - fun uniffi_ldk_node_checksum_method_node_next_event_async( - ): Short - fun uniffi_ldk_node_checksum_method_node_node_alias( - ): Short - fun uniffi_ldk_node_checksum_method_node_node_id( - ): Short - fun uniffi_ldk_node_checksum_method_node_onchain_payment( - ): Short - fun uniffi_ldk_node_checksum_method_node_open_announced_channel( - ): Short - fun uniffi_ldk_node_checksum_method_node_open_channel( - ): Short - fun uniffi_ldk_node_checksum_method_node_payment( - ): Short - fun uniffi_ldk_node_checksum_method_node_remove_address_type_from_monitor( - ): Short - fun uniffi_ldk_node_checksum_method_node_remove_onchain_wallet_account( - ): Short - fun uniffi_ldk_node_checksum_method_node_remove_payment( - ): Short - fun uniffi_ldk_node_checksum_method_node_set_primary_address_type( - ): Short - fun uniffi_ldk_node_checksum_method_node_set_primary_address_type_with_mnemonic( - ): Short - fun uniffi_ldk_node_checksum_method_node_sign_message( - ): Short - fun uniffi_ldk_node_checksum_method_node_splice_in( - ): Short - fun uniffi_ldk_node_checksum_method_node_splice_out( - ): Short - fun uniffi_ldk_node_checksum_method_node_spontaneous_payment( - ): Short - fun uniffi_ldk_node_checksum_method_node_start( - ): Short - fun uniffi_ldk_node_checksum_method_node_status( - ): Short - fun uniffi_ldk_node_checksum_method_node_stop( - ): Short - fun uniffi_ldk_node_checksum_method_node_sync_wallets( - ): Short - fun uniffi_ldk_node_checksum_method_node_unified_qr_payment( - ): Short - fun uniffi_ldk_node_checksum_method_node_update_channel_config( - ): Short - fun uniffi_ldk_node_checksum_method_node_update_sync_intervals( - ): Short - fun uniffi_ldk_node_checksum_method_node_verify_signature( - ): Short - fun uniffi_ldk_node_checksum_method_node_wait_next_event( - ): Short - fun uniffi_ldk_node_checksum_method_offer_absolute_expiry_seconds( - ): Short - fun uniffi_ldk_node_checksum_method_offer_amount( - ): Short - fun uniffi_ldk_node_checksum_method_offer_chains( - ): Short - fun uniffi_ldk_node_checksum_method_offer_expects_quantity( - ): Short - fun uniffi_ldk_node_checksum_method_offer_id( - ): Short - fun uniffi_ldk_node_checksum_method_offer_is_expired( - ): Short - fun uniffi_ldk_node_checksum_method_offer_is_valid_quantity( - ): Short - fun uniffi_ldk_node_checksum_method_offer_issuer( - ): Short - fun uniffi_ldk_node_checksum_method_offer_issuer_signing_pubkey( - ): Short - fun uniffi_ldk_node_checksum_method_offer_metadata( - ): Short - fun uniffi_ldk_node_checksum_method_offer_offer_description( - ): Short - fun uniffi_ldk_node_checksum_method_offer_supports_chain( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_accelerate_by_cpfp( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_address_info_for_account_at_index( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_address_info_for_type_at_index( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_address_infos_for_account( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_address_infos_for_type( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_bump_fee_by_rbf( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_calculate_cpfp_fee_rate( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_calculate_send_all_fee( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_calculate_total_fee( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_list_spendable_outputs( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_new_address( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_new_address_for_account( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_new_address_for_type( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_new_address_info( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_new_address_info_for_account( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_new_address_info_for_type( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_reveal_receive_addresses_to( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_reveal_receive_addresses_to_account( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_select_utxos_with_algorithm( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_send_all_to_address( - ): Short - fun uniffi_ldk_node_checksum_method_onchainpayment_send_to_address( - ): Short - fun uniffi_ldk_node_checksum_method_refund_absolute_expiry_seconds( - ): Short - fun uniffi_ldk_node_checksum_method_refund_amount_msats( - ): Short - fun uniffi_ldk_node_checksum_method_refund_chain( - ): Short - fun uniffi_ldk_node_checksum_method_refund_is_expired( - ): Short - fun uniffi_ldk_node_checksum_method_refund_issuer( - ): Short - fun uniffi_ldk_node_checksum_method_refund_payer_metadata( - ): Short - fun uniffi_ldk_node_checksum_method_refund_payer_note( - ): Short - fun uniffi_ldk_node_checksum_method_refund_payer_signing_pubkey( - ): Short - fun uniffi_ldk_node_checksum_method_refund_quantity( - ): Short - fun uniffi_ldk_node_checksum_method_refund_refund_description( - ): Short - fun uniffi_ldk_node_checksum_method_spontaneouspayment_send( - ): Short - fun uniffi_ldk_node_checksum_method_spontaneouspayment_send_probes( - ): Short - fun uniffi_ldk_node_checksum_method_spontaneouspayment_send_with_custom_tlvs( - ): Short - fun uniffi_ldk_node_checksum_method_spontaneouspayment_send_with_preimage( - ): Short - fun uniffi_ldk_node_checksum_method_spontaneouspayment_send_with_preimage_and_custom_tlvs( - ): Short - fun uniffi_ldk_node_checksum_method_unifiedqrpayment_receive( - ): Short - fun uniffi_ldk_node_checksum_method_unifiedqrpayment_send( - ): Short - fun uniffi_ldk_node_checksum_method_vssheaderprovider_get_headers( - ): Short - fun uniffi_ldk_node_checksum_constructor_bolt11invoice_from_str( - ): Short - fun uniffi_ldk_node_checksum_constructor_bolt12invoice_from_str( - ): Short - fun uniffi_ldk_node_checksum_constructor_builder_from_config( - ): Short - fun uniffi_ldk_node_checksum_constructor_builder_new( - ): Short - fun uniffi_ldk_node_checksum_constructor_feerate_from_sat_per_kwu( - ): Short - fun uniffi_ldk_node_checksum_constructor_feerate_from_sat_per_vb_unchecked( - ): Short - fun uniffi_ldk_node_checksum_constructor_offer_from_str( - ): Short - fun uniffi_ldk_node_checksum_constructor_refund_from_str( - ): Short - fun ffi_ldk_node_uniffi_contract_version( - ): Int - -} - -private fun uniffiCheckContractApiVersion(lib: UniffiLib) { - // Get the bindings contract version from our ComponentInterface - val bindings_contract_version = 26 - // Get the scaffolding contract version by calling the into the dylib - val scaffolding_contract_version = lib.ffi_ldk_node_uniffi_contract_version() - if (bindings_contract_version != scaffolding_contract_version) { - throw RuntimeException("UniFFI contract version mismatch: try cleaning and rebuilding your project") - } -} - - -private fun uniffiCheckApiChecksums(lib: UniffiLib) { - if (lib.uniffi_ldk_node_checksum_func_battery_saving_sync_intervals() != 25473.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_func_default_config() != 55381.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_func_derive_node_secret_from_mnemonic() != 15067.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_func_generate_entropy_mnemonic() != 48014.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_amount_milli_satoshis() != 50823.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_currency() != 32179.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_expiry_time_seconds() != 23625.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_fallback_addresses() != 55276.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_invoice_description() != 395.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_is_expired() != 15932.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_min_final_cltv_expiry_delta() != 8855.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_network() != 10420.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_payment_hash() != 42571.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_payment_secret() != 26081.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_recover_payee_pub_key() != 18874.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_route_hints() != 63051.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_seconds_since_epoch() != 53979.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_seconds_until_expiry() != 64193.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_signable_hash() != 30910.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11invoice_would_expire() != 30331.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_claim_for_hash() != 52848.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_estimate_routing_fees() != 5123.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_estimate_routing_fees_using_amount() != 46411.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_fail_for_hash() != 24516.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_receive() != 6073.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_receive_for_hash() != 27050.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_receive_variable_amount() != 4893.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_receive_variable_amount_for_hash() != 1402.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_receive_variable_amount_via_jit_channel() != 24506.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_receive_variable_amount_via_jit_channel_for_hash() != 38025.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_receive_via_jit_channel() != 16532.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_receive_via_jit_channel_for_hash() != 1143.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_send() != 12953.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_send_probes() != 16067.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_send_probes_using_amount() != 37281.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt11payment_send_using_amount() != 42793.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_absolute_expiry_seconds() != 28589.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_amount() != 5213.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_amount_msats() != 9297.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_chain() != 3308.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_created_at() != 56866.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_encode() != 13200.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_fallback_addresses() != 7925.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_invoice_description() != 1713.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_is_expired() != 39560.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_issuer() != 65270.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_issuer_signing_pubkey() != 55411.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_metadata() != 37374.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_offer_chains() != 39622.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_payer_note() != 28018.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_payer_signing_pubkey() != 12798.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_payment_hash() != 63778.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_quantity() != 43105.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_relative_expiry() != 14024.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_signable_hash() != 39303.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12invoice_signing_pubkey() != 35202.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12payment_blinded_paths_for_async_recipient() != 14695.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12payment_initiate_refund() != 15019.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12payment_receive() != 59252.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12payment_receive_async() != 23867.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12payment_receive_variable_amount() != 35484.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12payment_request_refund_payment() != 43248.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12payment_send() != 27679.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12payment_send_using_amount() != 33255.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_bolt12payment_set_paths_to_static_invoice_server() != 20921.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_build() != 785.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_build_with_fs_store() != 61304.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_build_with_vss_store() != 2871.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_build_with_vss_store_and_fixed_headers() != 24910.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_build_with_vss_store_and_header_provider() != 9090.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_address_type() != 647.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_address_types_to_monitor() != 23561.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_announcement_addresses() != 39271.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_async_payments_role() != 16463.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_chain_source_bitcoind_rest() != 37382.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_chain_source_bitcoind_rpc() != 2111.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_chain_source_electrum() != 55552.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_chain_source_esplora() != 1781.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_channel_data_migration() != 58453.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_custom_logger() != 51232.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_entropy_bip39_mnemonic() != 827.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_entropy_seed_bytes() != 44799.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_entropy_seed_path() != 64056.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_filesystem_logger() != 10249.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_gossip_source_p2p() != 9279.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_gossip_source_rgs() != 64312.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_liquidity_source_lsps1() != 51527.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_liquidity_source_lsps2() != 14430.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_listening_addresses() != 14051.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_log_facade_logger() != 58410.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_network() != 27539.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_node_alias() != 18342.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_pathfinding_scores_source() != 63501.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_scoring_decay_params() != 19869.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_scoring_fee_params() != 11588.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_builder_set_storage_dir_path() != 59019.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_feerate_to_sat_per_kwu() != 58911.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_feerate_to_sat_per_vb_ceil() != 58575.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_feerate_to_sat_per_vb_floor() != 59617.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_lsps1liquidity_check_order_status() != 57147.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_lsps1liquidity_request_channel() != 18153.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_logwriter_log() != 3299.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_networkgraph_channel() != 38070.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_networkgraph_list_channels() != 4693.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_networkgraph_list_nodes() != 36715.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_networkgraph_node() != 48925.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_add_address_type_to_monitor() != 14706.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_add_address_type_to_monitor_with_mnemonic() != 4517.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_add_onchain_wallet_account() != 37245.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_announcement_addresses() != 61426.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_bolt11_payment() != 41402.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_bolt12_payment() != 49254.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_close_channel() != 62479.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_config() != 7511.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_connect() != 34120.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_current_sync_intervals() != 51918.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_disconnect() != 43538.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_event_handled() != 38712.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_export_onchain_wallet_account_xpub() != 5977.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_export_pathfinding_scores() != 62331.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_force_close_channel() != 48831.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_get_address_balance() != 45284.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_get_balance_for_address_type() != 34906.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_get_balance_for_onchain_wallet_account() != 18159.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_get_transaction_details() != 65000.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_list_balances() != 57528.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_list_channels() != 7954.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_list_monitored_address_types() != 25084.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_list_onchain_wallet_accounts() != 4403.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_list_payments() != 35002.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_list_peers() != 14889.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_listening_addresses() != 2665.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_lsps1_liquidity() != 38201.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_network_graph() != 2695.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_next_event() != 7682.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_next_event_async() != 25426.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_node_alias() != 29526.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_node_id() != 51489.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_onchain_payment() != 6092.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_open_announced_channel() != 36623.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_open_channel() != 40283.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_payment() != 60296.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_remove_address_type_from_monitor() != 37081.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_remove_onchain_wallet_account() != 21186.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_remove_payment() != 47952.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_set_primary_address_type() != 11005.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_set_primary_address_type_with_mnemonic() != 50783.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_sign_message() != 49319.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_splice_in() != 46431.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_splice_out() != 22115.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_spontaneous_payment() != 37403.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_start() != 58480.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_status() != 55952.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_stop() != 42188.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_sync_wallets() != 32474.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_unified_qr_payment() != 9837.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_update_channel_config() != 37852.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_update_sync_intervals() != 42322.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_verify_signature() != 20486.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_node_wait_next_event() != 55101.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_offer_absolute_expiry_seconds() != 22836.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_offer_amount() != 59890.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_offer_chains() != 59522.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_offer_expects_quantity() != 58457.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_offer_id() != 8391.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_offer_is_expired() != 22651.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_offer_is_valid_quantity() != 58469.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_offer_issuer() != 41632.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_offer_issuer_signing_pubkey() != 38162.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_offer_metadata() != 18979.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_offer_offer_description() != 11122.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_offer_supports_chain() != 2135.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_accelerate_by_cpfp() != 31954.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_address_info_for_account_at_index() != 63246.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_address_info_for_type_at_index() != 42692.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_address_infos_for_account() != 39321.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_address_infos_for_type() != 3701.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_bump_fee_by_rbf() != 53877.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_calculate_cpfp_fee_rate() != 32879.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_calculate_send_all_fee() != 16052.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_calculate_total_fee() != 57218.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_list_spendable_outputs() != 19144.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_new_address() != 37251.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_new_address_for_account() != 9932.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_new_address_for_type() != 9083.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_new_address_info() != 9889.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_new_address_info_for_account() != 30767.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_new_address_info_for_type() != 62171.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_reveal_receive_addresses_to() != 44189.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_reveal_receive_addresses_to_account() != 53588.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_select_utxos_with_algorithm() != 14084.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_send_all_to_address() != 37748.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_onchainpayment_send_to_address() != 28826.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_refund_absolute_expiry_seconds() != 43722.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_refund_amount_msats() != 26467.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_refund_chain() != 36565.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_refund_is_expired() != 10232.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_refund_issuer() != 40306.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_refund_payer_metadata() != 23501.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_refund_payer_note() != 47799.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_refund_payer_signing_pubkey() != 40880.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_refund_quantity() != 15192.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_refund_refund_description() != 39295.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_spontaneouspayment_send() != 27905.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_spontaneouspayment_send_probes() != 44206.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_spontaneouspayment_send_with_custom_tlvs() != 17876.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_spontaneouspayment_send_with_preimage() != 30854.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_spontaneouspayment_send_with_preimage_and_custom_tlvs() != 12104.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_unifiedqrpayment_receive() != 913.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_unifiedqrpayment_send() != 28285.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_method_vssheaderprovider_get_headers() != 7788.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_constructor_bolt11invoice_from_str() != 349.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_constructor_bolt12invoice_from_str() != 22276.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_constructor_builder_from_config() != 994.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_constructor_builder_new() != 40499.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_constructor_feerate_from_sat_per_kwu() != 50548.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_constructor_feerate_from_sat_per_vb_unchecked() != 41808.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_constructor_offer_from_str() != 37070.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_ldk_node_checksum_constructor_refund_from_str() != 64884.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } -} - -// Public interface members begin here. - - - -object FfiConverterUByte: FfiConverter { - override fun lift(value: Byte): UByte { - return value.toUByte() - } - - override fun read(buf: ByteBuffer): UByte { - return lift(buf.get()) - } - - override fun lower(value: UByte): Byte { - return value.toByte() - } - - override fun allocationSize(value: UByte) = 1UL - - override fun write(value: UByte, buf: ByteBuffer) { - buf.put(value.toByte()) - } -} - - -object FfiConverterUShort: FfiConverter { - override fun lift(value: Short): UShort { - return value.toUShort() - } - - override fun read(buf: ByteBuffer): UShort { - return lift(buf.getShort()) - } - - override fun lower(value: UShort): Short { - return value.toShort() - } - - override fun allocationSize(value: UShort) = 2UL - - override fun write(value: UShort, buf: ByteBuffer) { - buf.putShort(value.toShort()) - } -} - - -object FfiConverterUInt: FfiConverter { - override fun lift(value: Int): UInt { - return value.toUInt() - } - - override fun read(buf: ByteBuffer): UInt { - return lift(buf.getInt()) - } - - override fun lower(value: UInt): Int { - return value.toInt() - } - - override fun allocationSize(value: UInt) = 4UL - - override fun write(value: UInt, buf: ByteBuffer) { - buf.putInt(value.toInt()) - } -} - - -object FfiConverterULong: FfiConverter { - override fun lift(value: Long): ULong { - return value.toULong() - } - - override fun read(buf: ByteBuffer): ULong { - return lift(buf.getLong()) - } - - override fun lower(value: ULong): Long { - return value.toLong() - } - - override fun allocationSize(value: ULong) = 8UL - - override fun write(value: ULong, buf: ByteBuffer) { - buf.putLong(value.toLong()) - } -} - - -object FfiConverterLong: FfiConverter { - override fun lift(value: Long): Long { - return value - } - - override fun read(buf: ByteBuffer): Long { - return buf.getLong() - } - - override fun lower(value: Long): Long { - return value - } - - override fun allocationSize(value: Long) = 8UL - - override fun write(value: Long, buf: ByteBuffer) { - buf.putLong(value) - } -} - - -object FfiConverterBoolean: FfiConverter { - override fun lift(value: Byte): Boolean { - return value.toInt() != 0 - } - - override fun read(buf: ByteBuffer): Boolean { - return lift(buf.get()) - } - - override fun lower(value: Boolean): Byte { - return if (value) 1.toByte() else 0.toByte() - } - - override fun allocationSize(value: Boolean) = 1UL - - override fun write(value: Boolean, buf: ByteBuffer) { - buf.put(lower(value)) - } -} - - -fun String.utf8Size(): Int = this.toByteArray(Charsets.UTF_8).size - -object FfiConverterString: FfiConverter { - // Note: we don't inherit from FfiConverterRustBuffer, because we use a - // special encoding when lowering/lifting. We can use `RustBuffer.len` to - // store our length and avoid writing it out to the buffer. - override fun lift(value: RustBufferByValue): String { - try { - require(value.len <= Int.MAX_VALUE) { - val length = value.len - "cannot handle RustBuffer longer than Int.MAX_VALUE bytes: length is $length" - } - val byteArr = value.asByteBuffer()!!.get(value.len.toInt()) - return byteArr.decodeToString() - } finally { - RustBufferHelper.free(value) - } - } - - override fun read(buf: ByteBuffer): String { - val len = buf.getInt() - val byteArr = buf.get(len) - return byteArr.decodeToString() - } - - override fun lower(value: String): RustBufferByValue { - return RustBufferHelper.allocValue(value.utf8Size().toULong()).apply { - asByteBuffer()!!.writeUtf8(value) - } - } - - // We aren't sure exactly how many bytes our string will be once it's UTF-8 - // encoded. Allocate 3 bytes per UTF-16 code unit which will always be - // enough. - override fun allocationSize(value: String): ULong { - val sizeForLength = 4UL - val sizeForString = value.length.toULong() * 3UL - return sizeForLength + sizeForString - } - - override fun write(value: String, buf: ByteBuffer) { - buf.putInt(value.utf8Size().toInt()) - buf.writeUtf8(value) - } -} - - -object FfiConverterByteArray: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ByteArray { - val len = buf.getInt() - val byteArr = buf.get(len) - return byteArr - } - override fun allocationSize(value: ByteArray): ULong { - return 4UL + value.size.toULong() - } - override fun write(value: ByteArray, buf: ByteBuffer) { - buf.putInt(value.size) - buf.put(value) - } -} - - - -open class Bolt11Invoice: Disposable, Bolt11InvoiceInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_bolt11invoice(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_bolt11invoice(pointer!!, status) - }!! - } - - - override fun `amountMilliSatoshis`(): kotlin.ULong? { - return FfiConverterOptionalULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_amount_milli_satoshis( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `currency`(): Currency { - return FfiConverterTypeCurrency.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_currency( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `expiryTimeSeconds`(): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_expiry_time_seconds( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `fallbackAddresses`(): List
{ - return FfiConverterSequenceTypeAddress.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_fallback_addresses( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `invoiceDescription`(): Bolt11InvoiceDescription { - return FfiConverterTypeBolt11InvoiceDescription.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_invoice_description( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `isExpired`(): kotlin.Boolean { - return FfiConverterBoolean.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_is_expired( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `minFinalCltvExpiryDelta`(): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_min_final_cltv_expiry_delta( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `network`(): Network { - return FfiConverterTypeNetwork.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_network( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `paymentHash`(): PaymentHash { - return FfiConverterTypePaymentHash.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_payment_hash( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `paymentSecret`(): PaymentSecret { - return FfiConverterTypePaymentSecret.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_payment_secret( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `recoverPayeePubKey`(): PublicKey { - return FfiConverterTypePublicKey.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_recover_payee_pub_key( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `routeHints`(): List> { - return FfiConverterSequenceSequenceTypeRouteHintHop.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_route_hints( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `secondsSinceEpoch`(): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_seconds_since_epoch( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `secondsUntilExpiry`(): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_seconds_until_expiry( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `signableHash`(): List { - return FfiConverterSequenceUByte.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_signable_hash( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `wouldExpire`(`atTimeSeconds`: kotlin.ULong): kotlin.Boolean { - return FfiConverterBoolean.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_would_expire( - it, - FfiConverterULong.lower(`atTimeSeconds`), - uniffiRustCallStatus, - ) - } - }) - } - - - - - override fun toString(): String { - return FfiConverterString.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_uniffi_trait_display( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is Bolt11Invoice) return false - return FfiConverterBoolean.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11invoice_uniffi_trait_eq_eq( - it, - FfiConverterTypeBolt11Invoice.lower(`other`), - uniffiRustCallStatus, - ) - } - }) - } - - - - companion object { - - @Throws(NodeException::class) - fun `fromStr`(`invoiceStr`: kotlin.String): Bolt11Invoice { - return FfiConverterTypeBolt11Invoice.lift(uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_constructor_bolt11invoice_from_str( - FfiConverterString.lower(`invoiceStr`), - uniffiRustCallStatus, - ) - }!!) - } - - - } - -} - - - - - -object FfiConverterTypeBolt11Invoice: FfiConverter { - - override fun lower(value: Bolt11Invoice): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): Bolt11Invoice { - return Bolt11Invoice(value) - } - - override fun read(buf: ByteBuffer): Bolt11Invoice { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: Bolt11Invoice) = 8UL - - override fun write(value: Bolt11Invoice, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} -// The cleaner interface for Object finalization code to run. -// This is the entry point to any implementation that we're using. -// -// The cleaner registers disposables and returns cleanables, so now we are -// defining a `UniffiCleaner` with a `UniffiClenaer.Cleanable` to abstract the -// different implementations available at compile time. -interface UniffiCleaner { - interface Cleanable { - fun clean() - } - - fun register(resource: Any, disposable: Disposable): UniffiCleaner.Cleanable - - companion object -} -// The fallback Jna cleaner, which is available for both Android, and the JVM. -private class UniffiJnaCleaner : UniffiCleaner { - private val cleaner = com.sun.jna.internal.Cleaner.getCleaner() - - override fun register(resource: Any, disposable: Disposable): UniffiCleaner.Cleanable = - UniffiJnaCleanable(cleaner.register(resource, UniffiCleanerAction(disposable))) -} - -private class UniffiJnaCleanable( - private val cleanable: com.sun.jna.internal.Cleaner.Cleanable, -) : UniffiCleaner.Cleanable { - override fun clean() = cleanable.clean() -} - -private class UniffiCleanerAction(private val disposable: Disposable): Runnable { - override fun run() { - disposable.destroy() - } -} - -private class JavaLangRefCleaner : UniffiCleaner { - private val cleaner: java.lang.ref.Cleaner = java.lang.ref.Cleaner.create() - - override fun register(resource: Any, disposable: Disposable): UniffiCleaner.Cleanable = - JavaLangRefCleanable(cleaner.register(resource, UniffiCleanerAction(disposable))) -} - -private class JavaLangRefCleanable( - val cleanable: java.lang.ref.Cleaner.Cleanable -) : UniffiCleaner.Cleanable { - override fun clean() = cleanable.clean() -} - -private fun UniffiCleaner.Companion.create(): UniffiCleaner = - try { - JavaLangRefCleaner() - } catch (e: ClassNotFoundException) { - UniffiJnaCleaner() - } - - - -open class Bolt11Payment: Disposable, Bolt11PaymentInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_bolt11payment(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_bolt11payment(pointer!!, status) - }!! - } - - - @Throws(NodeException::class) - override fun `claimForHash`(`paymentHash`: PaymentHash, `claimableAmountMsat`: kotlin.ULong, `preimage`: PaymentPreimage) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_claim_for_hash( - it, - FfiConverterTypePaymentHash.lower(`paymentHash`), - FfiConverterULong.lower(`claimableAmountMsat`), - FfiConverterTypePaymentPreimage.lower(`preimage`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `estimateRoutingFees`(`invoice`: Bolt11Invoice): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_estimate_routing_fees( - it, - FfiConverterTypeBolt11Invoice.lower(`invoice`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `estimateRoutingFeesUsingAmount`(`invoice`: Bolt11Invoice, `amountMsat`: kotlin.ULong): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_estimate_routing_fees_using_amount( - it, - FfiConverterTypeBolt11Invoice.lower(`invoice`), - FfiConverterULong.lower(`amountMsat`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `failForHash`(`paymentHash`: PaymentHash) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_fail_for_hash( - it, - FfiConverterTypePaymentHash.lower(`paymentHash`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `receive`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt): Bolt11Invoice { - return FfiConverterTypeBolt11Invoice.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_receive( - it, - FfiConverterULong.lower(`amountMsat`), - FfiConverterTypeBolt11InvoiceDescription.lower(`description`), - FfiConverterUInt.lower(`expirySecs`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `receiveForHash`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `paymentHash`: PaymentHash): Bolt11Invoice { - return FfiConverterTypeBolt11Invoice.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_receive_for_hash( - it, - FfiConverterULong.lower(`amountMsat`), - FfiConverterTypeBolt11InvoiceDescription.lower(`description`), - FfiConverterUInt.lower(`expirySecs`), - FfiConverterTypePaymentHash.lower(`paymentHash`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `receiveVariableAmount`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt): Bolt11Invoice { - return FfiConverterTypeBolt11Invoice.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_receive_variable_amount( - it, - FfiConverterTypeBolt11InvoiceDescription.lower(`description`), - FfiConverterUInt.lower(`expirySecs`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `receiveVariableAmountForHash`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `paymentHash`: PaymentHash): Bolt11Invoice { - return FfiConverterTypeBolt11Invoice.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_receive_variable_amount_for_hash( - it, - FfiConverterTypeBolt11InvoiceDescription.lower(`description`), - FfiConverterUInt.lower(`expirySecs`), - FfiConverterTypePaymentHash.lower(`paymentHash`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `receiveVariableAmountViaJitChannel`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxProportionalLspFeeLimitPpmMsat`: kotlin.ULong?): Bolt11Invoice { - return FfiConverterTypeBolt11Invoice.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_receive_variable_amount_via_jit_channel( - it, - FfiConverterTypeBolt11InvoiceDescription.lower(`description`), - FfiConverterUInt.lower(`expirySecs`), - FfiConverterOptionalULong.lower(`maxProportionalLspFeeLimitPpmMsat`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `receiveVariableAmountViaJitChannelForHash`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxProportionalLspFeeLimitPpmMsat`: kotlin.ULong?, `paymentHash`: PaymentHash): Bolt11Invoice { - return FfiConverterTypeBolt11Invoice.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_receive_variable_amount_via_jit_channel_for_hash( - it, - FfiConverterTypeBolt11InvoiceDescription.lower(`description`), - FfiConverterUInt.lower(`expirySecs`), - FfiConverterOptionalULong.lower(`maxProportionalLspFeeLimitPpmMsat`), - FfiConverterTypePaymentHash.lower(`paymentHash`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `receiveViaJitChannel`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxLspFeeLimitMsat`: kotlin.ULong?): Bolt11Invoice { - return FfiConverterTypeBolt11Invoice.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_receive_via_jit_channel( - it, - FfiConverterULong.lower(`amountMsat`), - FfiConverterTypeBolt11InvoiceDescription.lower(`description`), - FfiConverterUInt.lower(`expirySecs`), - FfiConverterOptionalULong.lower(`maxLspFeeLimitMsat`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `receiveViaJitChannelForHash`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxLspFeeLimitMsat`: kotlin.ULong?, `paymentHash`: PaymentHash): Bolt11Invoice { - return FfiConverterTypeBolt11Invoice.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_receive_via_jit_channel_for_hash( - it, - FfiConverterULong.lower(`amountMsat`), - FfiConverterTypeBolt11InvoiceDescription.lower(`description`), - FfiConverterUInt.lower(`expirySecs`), - FfiConverterOptionalULong.lower(`maxLspFeeLimitMsat`), - FfiConverterTypePaymentHash.lower(`paymentHash`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `send`(`invoice`: Bolt11Invoice, `routeParameters`: RouteParametersConfig?): PaymentId { - return FfiConverterTypePaymentId.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_send( - it, - FfiConverterTypeBolt11Invoice.lower(`invoice`), - FfiConverterOptionalTypeRouteParametersConfig.lower(`routeParameters`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `sendProbes`(`invoice`: Bolt11Invoice, `routeParameters`: RouteParametersConfig?): List { - return FfiConverterSequenceTypeProbeHandle.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_send_probes( - it, - FfiConverterTypeBolt11Invoice.lower(`invoice`), - FfiConverterOptionalTypeRouteParametersConfig.lower(`routeParameters`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `sendProbesUsingAmount`(`invoice`: Bolt11Invoice, `amountMsat`: kotlin.ULong, `routeParameters`: RouteParametersConfig?): List { - return FfiConverterSequenceTypeProbeHandle.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_send_probes_using_amount( - it, - FfiConverterTypeBolt11Invoice.lower(`invoice`), - FfiConverterULong.lower(`amountMsat`), - FfiConverterOptionalTypeRouteParametersConfig.lower(`routeParameters`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `sendUsingAmount`(`invoice`: Bolt11Invoice, `amountMsat`: kotlin.ULong, `routeParameters`: RouteParametersConfig?): PaymentId { - return FfiConverterTypePaymentId.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt11payment_send_using_amount( - it, - FfiConverterTypeBolt11Invoice.lower(`invoice`), - FfiConverterULong.lower(`amountMsat`), - FfiConverterOptionalTypeRouteParametersConfig.lower(`routeParameters`), - uniffiRustCallStatus, - ) - } - }) - } - - - - - - - - companion object - -} - - - - - -object FfiConverterTypeBolt11Payment: FfiConverter { - - override fun lower(value: Bolt11Payment): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): Bolt11Payment { - return Bolt11Payment(value) - } - - override fun read(buf: ByteBuffer): Bolt11Payment { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: Bolt11Payment) = 8UL - - override fun write(value: Bolt11Payment, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class Bolt12Invoice: Disposable, Bolt12InvoiceInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_bolt12invoice(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_bolt12invoice(pointer!!, status) - }!! - } - - - override fun `absoluteExpirySeconds`(): kotlin.ULong? { - return FfiConverterOptionalULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_absolute_expiry_seconds( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `amount`(): OfferAmount? { - return FfiConverterOptionalTypeOfferAmount.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_amount( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `amountMsats`(): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_amount_msats( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `chain`(): List { - return FfiConverterSequenceUByte.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_chain( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `createdAt`(): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_created_at( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `encode`(): List { - return FfiConverterSequenceUByte.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_encode( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `fallbackAddresses`(): List
{ - return FfiConverterSequenceTypeAddress.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_fallback_addresses( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `invoiceDescription`(): kotlin.String? { - return FfiConverterOptionalString.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_invoice_description( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `isExpired`(): kotlin.Boolean { - return FfiConverterBoolean.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_is_expired( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `issuer`(): kotlin.String? { - return FfiConverterOptionalString.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_issuer( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `issuerSigningPubkey`(): PublicKey? { - return FfiConverterOptionalTypePublicKey.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_issuer_signing_pubkey( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `metadata`(): List? { - return FfiConverterOptionalSequenceUByte.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_metadata( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `offerChains`(): List>? { - return FfiConverterOptionalSequenceSequenceUByte.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_offer_chains( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `payerNote`(): kotlin.String? { - return FfiConverterOptionalString.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_payer_note( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `payerSigningPubkey`(): PublicKey { - return FfiConverterTypePublicKey.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_payer_signing_pubkey( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `paymentHash`(): PaymentHash { - return FfiConverterTypePaymentHash.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_payment_hash( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `quantity`(): kotlin.ULong? { - return FfiConverterOptionalULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_quantity( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `relativeExpiry`(): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_relative_expiry( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `signableHash`(): List { - return FfiConverterSequenceUByte.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_signable_hash( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `signingPubkey`(): PublicKey { - return FfiConverterTypePublicKey.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12invoice_signing_pubkey( - it, - uniffiRustCallStatus, - ) - } - }) - } - - - - - - - companion object { - - @Throws(NodeException::class) - fun `fromStr`(`invoiceStr`: kotlin.String): Bolt12Invoice { - return FfiConverterTypeBolt12Invoice.lift(uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_constructor_bolt12invoice_from_str( - FfiConverterString.lower(`invoiceStr`), - uniffiRustCallStatus, - ) - }!!) - } - - - } - -} - - - - - -object FfiConverterTypeBolt12Invoice: FfiConverter { - - override fun lower(value: Bolt12Invoice): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): Bolt12Invoice { - return Bolt12Invoice(value) - } - - override fun read(buf: ByteBuffer): Bolt12Invoice { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: Bolt12Invoice) = 8UL - - override fun write(value: Bolt12Invoice, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class Bolt12Payment: Disposable, Bolt12PaymentInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_bolt12payment(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_bolt12payment(pointer!!, status) - }!! - } - - - @Throws(NodeException::class) - override fun `blindedPathsForAsyncRecipient`(`recipientId`: kotlin.ByteArray): kotlin.ByteArray { - return FfiConverterByteArray.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12payment_blinded_paths_for_async_recipient( - it, - FfiConverterByteArray.lower(`recipientId`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `initiateRefund`(`amountMsat`: kotlin.ULong, `expirySecs`: kotlin.UInt, `quantity`: kotlin.ULong?, `payerNote`: kotlin.String?, `routeParameters`: RouteParametersConfig?): Refund { - return FfiConverterTypeRefund.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12payment_initiate_refund( - it, - FfiConverterULong.lower(`amountMsat`), - FfiConverterUInt.lower(`expirySecs`), - FfiConverterOptionalULong.lower(`quantity`), - FfiConverterOptionalString.lower(`payerNote`), - FfiConverterOptionalTypeRouteParametersConfig.lower(`routeParameters`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `receive`(`amountMsat`: kotlin.ULong, `description`: kotlin.String, `expirySecs`: kotlin.UInt?, `quantity`: kotlin.ULong?): Offer { - return FfiConverterTypeOffer.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12payment_receive( - it, - FfiConverterULong.lower(`amountMsat`), - FfiConverterString.lower(`description`), - FfiConverterOptionalUInt.lower(`expirySecs`), - FfiConverterOptionalULong.lower(`quantity`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `receiveAsync`(): Offer { - return FfiConverterTypeOffer.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12payment_receive_async( - it, - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `receiveVariableAmount`(`description`: kotlin.String, `expirySecs`: kotlin.UInt?): Offer { - return FfiConverterTypeOffer.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12payment_receive_variable_amount( - it, - FfiConverterString.lower(`description`), - FfiConverterOptionalUInt.lower(`expirySecs`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `requestRefundPayment`(`refund`: Refund): Bolt12Invoice { - return FfiConverterTypeBolt12Invoice.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12payment_request_refund_payment( - it, - FfiConverterTypeRefund.lower(`refund`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `send`(`offer`: Offer, `quantity`: kotlin.ULong?, `payerNote`: kotlin.String?, `routeParameters`: RouteParametersConfig?): PaymentId { - return FfiConverterTypePaymentId.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12payment_send( - it, - FfiConverterTypeOffer.lower(`offer`), - FfiConverterOptionalULong.lower(`quantity`), - FfiConverterOptionalString.lower(`payerNote`), - FfiConverterOptionalTypeRouteParametersConfig.lower(`routeParameters`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `sendUsingAmount`(`offer`: Offer, `amountMsat`: kotlin.ULong, `quantity`: kotlin.ULong?, `payerNote`: kotlin.String?, `routeParameters`: RouteParametersConfig?): PaymentId { - return FfiConverterTypePaymentId.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12payment_send_using_amount( - it, - FfiConverterTypeOffer.lower(`offer`), - FfiConverterULong.lower(`amountMsat`), - FfiConverterOptionalULong.lower(`quantity`), - FfiConverterOptionalString.lower(`payerNote`), - FfiConverterOptionalTypeRouteParametersConfig.lower(`routeParameters`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `setPathsToStaticInvoiceServer`(`paths`: kotlin.ByteArray) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_bolt12payment_set_paths_to_static_invoice_server( - it, - FfiConverterByteArray.lower(`paths`), - uniffiRustCallStatus, - ) - } - } - } - - - - - - - - companion object - -} - - - - - -object FfiConverterTypeBolt12Payment: FfiConverter { - - override fun lower(value: Bolt12Payment): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): Bolt12Payment { - return Bolt12Payment(value) - } - - override fun read(buf: ByteBuffer): Bolt12Payment { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: Bolt12Payment) = 8UL - - override fun write(value: Bolt12Payment, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class Builder: Disposable, BuilderInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - constructor() : this( - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_constructor_builder_new( - uniffiRustCallStatus, - ) - }!! - ) - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_builder(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_builder(pointer!!, status) - }!! - } - - - @Throws(BuildException::class) - override fun `build`(): Node { - return FfiConverterTypeNode.lift(callWithPointer { - uniffiRustCallWithError(BuildExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_build( - it, - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(BuildException::class) - override fun `buildWithFsStore`(): Node { - return FfiConverterTypeNode.lift(callWithPointer { - uniffiRustCallWithError(BuildExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_build_with_fs_store( - it, - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(BuildException::class) - override fun `buildWithVssStore`(`vssUrl`: kotlin.String, `storeId`: kotlin.String, `lnurlAuthServerUrl`: kotlin.String, `fixedHeaders`: Map): Node { - return FfiConverterTypeNode.lift(callWithPointer { - uniffiRustCallWithError(BuildExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_build_with_vss_store( - it, - FfiConverterString.lower(`vssUrl`), - FfiConverterString.lower(`storeId`), - FfiConverterString.lower(`lnurlAuthServerUrl`), - FfiConverterMapStringString.lower(`fixedHeaders`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(BuildException::class) - override fun `buildWithVssStoreAndFixedHeaders`(`vssUrl`: kotlin.String, `storeId`: kotlin.String, `fixedHeaders`: Map): Node { - return FfiConverterTypeNode.lift(callWithPointer { - uniffiRustCallWithError(BuildExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_build_with_vss_store_and_fixed_headers( - it, - FfiConverterString.lower(`vssUrl`), - FfiConverterString.lower(`storeId`), - FfiConverterMapStringString.lower(`fixedHeaders`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(BuildException::class) - override fun `buildWithVssStoreAndHeaderProvider`(`vssUrl`: kotlin.String, `storeId`: kotlin.String, `headerProvider`: VssHeaderProvider): Node { - return FfiConverterTypeNode.lift(callWithPointer { - uniffiRustCallWithError(BuildExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_build_with_vss_store_and_header_provider( - it, - FfiConverterString.lower(`vssUrl`), - FfiConverterString.lower(`storeId`), - FfiConverterTypeVssHeaderProvider.lower(`headerProvider`), - uniffiRustCallStatus, - ) - }!! - }) - } - - override fun `setAddressType`(`addressType`: AddressType) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_address_type( - it, - FfiConverterTypeAddressType.lower(`addressType`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setAddressTypesToMonitor`(`addressTypesToMonitor`: List) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_address_types_to_monitor( - it, - FfiConverterSequenceTypeAddressType.lower(`addressTypesToMonitor`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(BuildException::class) - override fun `setAnnouncementAddresses`(`announcementAddresses`: List) { - callWithPointer { - uniffiRustCallWithError(BuildExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_announcement_addresses( - it, - FfiConverterSequenceTypeSocketAddress.lower(`announcementAddresses`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(BuildException::class) - override fun `setAsyncPaymentsRole`(`role`: AsyncPaymentsRole?) { - callWithPointer { - uniffiRustCallWithError(BuildExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_async_payments_role( - it, - FfiConverterOptionalTypeAsyncPaymentsRole.lower(`role`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setChainSourceBitcoindRest`(`restHost`: kotlin.String, `restPort`: kotlin.UShort, `rpcHost`: kotlin.String, `rpcPort`: kotlin.UShort, `rpcUser`: kotlin.String, `rpcPassword`: kotlin.String) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_chain_source_bitcoind_rest( - it, - FfiConverterString.lower(`restHost`), - FfiConverterUShort.lower(`restPort`), - FfiConverterString.lower(`rpcHost`), - FfiConverterUShort.lower(`rpcPort`), - FfiConverterString.lower(`rpcUser`), - FfiConverterString.lower(`rpcPassword`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setChainSourceBitcoindRpc`(`rpcHost`: kotlin.String, `rpcPort`: kotlin.UShort, `rpcUser`: kotlin.String, `rpcPassword`: kotlin.String) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_chain_source_bitcoind_rpc( - it, - FfiConverterString.lower(`rpcHost`), - FfiConverterUShort.lower(`rpcPort`), - FfiConverterString.lower(`rpcUser`), - FfiConverterString.lower(`rpcPassword`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setChainSourceElectrum`(`serverUrl`: kotlin.String, `config`: ElectrumSyncConfig?) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_chain_source_electrum( - it, - FfiConverterString.lower(`serverUrl`), - FfiConverterOptionalTypeElectrumSyncConfig.lower(`config`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setChainSourceEsplora`(`serverUrl`: kotlin.String, `config`: EsploraSyncConfig?) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_chain_source_esplora( - it, - FfiConverterString.lower(`serverUrl`), - FfiConverterOptionalTypeEsploraSyncConfig.lower(`config`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setChannelDataMigration`(`migration`: ChannelDataMigration) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_channel_data_migration( - it, - FfiConverterTypeChannelDataMigration.lower(`migration`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setCustomLogger`(`logWriter`: LogWriter) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_custom_logger( - it, - FfiConverterTypeLogWriter.lower(`logWriter`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setEntropyBip39Mnemonic`(`mnemonic`: Mnemonic, `passphrase`: kotlin.String?) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_entropy_bip39_mnemonic( - it, - FfiConverterTypeMnemonic.lower(`mnemonic`), - FfiConverterOptionalString.lower(`passphrase`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(BuildException::class) - override fun `setEntropySeedBytes`(`seedBytes`: List) { - callWithPointer { - uniffiRustCallWithError(BuildExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_entropy_seed_bytes( - it, - FfiConverterSequenceUByte.lower(`seedBytes`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setEntropySeedPath`(`seedPath`: kotlin.String) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_entropy_seed_path( - it, - FfiConverterString.lower(`seedPath`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setFilesystemLogger`(`logFilePath`: kotlin.String?, `maxLogLevel`: LogLevel?) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_filesystem_logger( - it, - FfiConverterOptionalString.lower(`logFilePath`), - FfiConverterOptionalTypeLogLevel.lower(`maxLogLevel`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setGossipSourceP2p`() { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_gossip_source_p2p( - it, - uniffiRustCallStatus, - ) - } - } - } - - override fun `setGossipSourceRgs`(`rgsServerUrl`: kotlin.String) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_gossip_source_rgs( - it, - FfiConverterString.lower(`rgsServerUrl`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setLiquiditySourceLsps1`(`nodeId`: PublicKey, `address`: SocketAddress, `token`: kotlin.String?) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_liquidity_source_lsps1( - it, - FfiConverterTypePublicKey.lower(`nodeId`), - FfiConverterTypeSocketAddress.lower(`address`), - FfiConverterOptionalString.lower(`token`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setLiquiditySourceLsps2`(`nodeId`: PublicKey, `address`: SocketAddress, `token`: kotlin.String?) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_liquidity_source_lsps2( - it, - FfiConverterTypePublicKey.lower(`nodeId`), - FfiConverterTypeSocketAddress.lower(`address`), - FfiConverterOptionalString.lower(`token`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(BuildException::class) - override fun `setListeningAddresses`(`listeningAddresses`: List) { - callWithPointer { - uniffiRustCallWithError(BuildExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_listening_addresses( - it, - FfiConverterSequenceTypeSocketAddress.lower(`listeningAddresses`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setLogFacadeLogger`() { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_log_facade_logger( - it, - uniffiRustCallStatus, - ) - } - } - } - - override fun `setNetwork`(`network`: Network) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_network( - it, - FfiConverterTypeNetwork.lower(`network`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(BuildException::class) - override fun `setNodeAlias`(`nodeAlias`: kotlin.String) { - callWithPointer { - uniffiRustCallWithError(BuildExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_node_alias( - it, - FfiConverterString.lower(`nodeAlias`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setPathfindingScoresSource`(`url`: kotlin.String) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_pathfinding_scores_source( - it, - FfiConverterString.lower(`url`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setScoringDecayParams`(`params`: ScoringDecayParameters) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_scoring_decay_params( - it, - FfiConverterTypeScoringDecayParameters.lower(`params`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setScoringFeeParams`(`params`: ScoringFeeParameters) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_scoring_fee_params( - it, - FfiConverterTypeScoringFeeParameters.lower(`params`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `setStorageDirPath`(`storageDirPath`: kotlin.String) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_storage_dir_path( - it, - FfiConverterString.lower(`storageDirPath`), - uniffiRustCallStatus, - ) - } - } - } - - - - - - - companion object { - - fun `fromConfig`(`config`: Config): Builder { - return FfiConverterTypeBuilder.lift(uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_constructor_builder_from_config( - FfiConverterTypeConfig.lower(`config`), - uniffiRustCallStatus, - ) - }!!) - } - - - } - -} - - - - - -object FfiConverterTypeBuilder: FfiConverter { - - override fun lower(value: Builder): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): Builder { - return Builder(value) - } - - override fun read(buf: ByteBuffer): Builder { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: Builder) = 8UL - - override fun write(value: Builder, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class FeeRate: Disposable, FeeRateInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_feerate(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_feerate(pointer!!, status) - }!! - } - - - override fun `toSatPerKwu`(): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_feerate_to_sat_per_kwu( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `toSatPerVbCeil`(): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_feerate_to_sat_per_vb_ceil( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `toSatPerVbFloor`(): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_feerate_to_sat_per_vb_floor( - it, - uniffiRustCallStatus, - ) - } - }) - } - - - - - - - companion object { - - fun `fromSatPerKwu`(`satKwu`: kotlin.ULong): FeeRate { - return FfiConverterTypeFeeRate.lift(uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_constructor_feerate_from_sat_per_kwu( - FfiConverterULong.lower(`satKwu`), - uniffiRustCallStatus, - ) - }!!) - } - - - fun `fromSatPerVbUnchecked`(`satVb`: kotlin.ULong): FeeRate { - return FfiConverterTypeFeeRate.lift(uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_constructor_feerate_from_sat_per_vb_unchecked( - FfiConverterULong.lower(`satVb`), - uniffiRustCallStatus, - ) - }!!) - } - - - } - -} - - - - - -object FfiConverterTypeFeeRate: FfiConverter { - - override fun lower(value: FeeRate): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): FeeRate { - return FeeRate(value) - } - - override fun read(buf: ByteBuffer): FeeRate { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: FeeRate) = 8UL - - override fun write(value: FeeRate, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class Lsps1Liquidity: Disposable, Lsps1LiquidityInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_lsps1liquidity(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_lsps1liquidity(pointer!!, status) - }!! - } - - - @Throws(NodeException::class) - override fun `checkOrderStatus`(`orderId`: Lsps1OrderId): Lsps1OrderStatus { - return FfiConverterTypeLSPS1OrderStatus.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_lsps1liquidity_check_order_status( - it, - FfiConverterTypeLSPS1OrderId.lower(`orderId`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `requestChannel`(`lspBalanceSat`: kotlin.ULong, `clientBalanceSat`: kotlin.ULong, `channelExpiryBlocks`: kotlin.UInt, `announceChannel`: kotlin.Boolean): Lsps1OrderStatus { - return FfiConverterTypeLSPS1OrderStatus.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_lsps1liquidity_request_channel( - it, - FfiConverterULong.lower(`lspBalanceSat`), - FfiConverterULong.lower(`clientBalanceSat`), - FfiConverterUInt.lower(`channelExpiryBlocks`), - FfiConverterBoolean.lower(`announceChannel`), - uniffiRustCallStatus, - ) - } - }) - } - - - - - - - - companion object - -} - - - - - -object FfiConverterTypeLSPS1Liquidity: FfiConverter { - - override fun lower(value: Lsps1Liquidity): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): Lsps1Liquidity { - return Lsps1Liquidity(value) - } - - override fun read(buf: ByteBuffer): Lsps1Liquidity { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: Lsps1Liquidity) = 8UL - - override fun write(value: Lsps1Liquidity, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class LogWriterImpl: Disposable, LogWriter { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_logwriter(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_logwriter(pointer!!, status) - }!! - } - - - override fun `log`(`record`: LogRecord) { - callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_logwriter_log( - it, - FfiConverterTypeLogRecord.lower(`record`), - uniffiRustCallStatus, - ) - } - } - } - - - - - - - - companion object - -} - - - - - -object FfiConverterTypeLogWriter: FfiConverter { - internal val handleMap = UniffiHandleMap() - - override fun lower(value: LogWriter): Pointer { - return handleMap.insert(value).toPointer() - } - - override fun lift(value: Pointer): LogWriter { - return LogWriterImpl(value) - } - - override fun read(buf: ByteBuffer): LogWriter { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: LogWriter) = 8UL - - override fun write(value: LogWriter, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - -internal const val IDX_CALLBACK_FREE = 0 -// Callback return codes -internal const val UNIFFI_CALLBACK_SUCCESS = 0 -internal const val UNIFFI_CALLBACK_ERROR = 1 -internal const val UNIFFI_CALLBACK_UNEXPECTED_ERROR = 2 - -abstract class FfiConverterCallbackInterface: FfiConverter { - internal val handleMap = UniffiHandleMap() - - internal fun drop(handle: Long) { - handleMap.remove(handle) - } - - override fun lift(value: Long): CallbackInterface { - return handleMap.get(value) - } - - override fun read(buf: ByteBuffer) = lift(buf.getLong()) - - override fun lower(value: CallbackInterface) = handleMap.insert(value) - - override fun allocationSize(value: CallbackInterface) = 8UL - - override fun write(value: CallbackInterface, buf: ByteBuffer) { - buf.putLong(lower(value)) - } -} - -// Put the implementation in an object so we don't pollute the top-level namespace -internal object uniffiCallbackInterfaceLogWriter { - internal object `log`: UniffiCallbackInterfaceLogWriterMethod0 { - override fun callback ( - `uniffiHandle`: Long, - `record`: RustBufferByValue, - `uniffiOutReturn`: Pointer, - uniffiCallStatus: UniffiRustCallStatus, - ) { - val uniffiObj = FfiConverterTypeLogWriter.handleMap.get(uniffiHandle) - val makeCall = { -> - uniffiObj.`log`( - FfiConverterTypeLogRecord.lift(`record`), - ) - } - val writeReturn = { _: Unit -> - @Suppress("UNUSED_EXPRESSION") - uniffiOutReturn - Unit - } - uniffiTraitInterfaceCall(uniffiCallStatus, makeCall, writeReturn) - } - } - internal object uniffiFree: UniffiCallbackInterfaceFree { - override fun callback(handle: Long) { - FfiConverterTypeLogWriter.handleMap.remove(handle) - } - } - - internal val vtable = UniffiVTableCallbackInterfaceLogWriter( - `log`, - uniffiFree, - ) - - internal fun register(lib: UniffiLib) { - lib.uniffi_ldk_node_fn_init_callback_vtable_logwriter(vtable) - } -} - - - -open class NetworkGraph: Disposable, NetworkGraphInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_networkgraph(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_networkgraph(pointer!!, status) - }!! - } - - - override fun `channel`(`shortChannelId`: kotlin.ULong): ChannelInfo? { - return FfiConverterOptionalTypeChannelInfo.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_networkgraph_channel( - it, - FfiConverterULong.lower(`shortChannelId`), - uniffiRustCallStatus, - ) - } - }) - } - - override fun `listChannels`(): List { - return FfiConverterSequenceULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_networkgraph_list_channels( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `listNodes`(): List { - return FfiConverterSequenceTypeNodeId.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_networkgraph_list_nodes( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `node`(`nodeId`: NodeId): NodeInfo? { - return FfiConverterOptionalTypeNodeInfo.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_networkgraph_node( - it, - FfiConverterTypeNodeId.lower(`nodeId`), - uniffiRustCallStatus, - ) - } - }) - } - - - - - - - - companion object - -} - - - - - -object FfiConverterTypeNetworkGraph: FfiConverter { - - override fun lower(value: NetworkGraph): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): NetworkGraph { - return NetworkGraph(value) - } - - override fun read(buf: ByteBuffer): NetworkGraph { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: NetworkGraph) = 8UL - - override fun write(value: NetworkGraph, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class Node: Disposable, NodeInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_node(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_node(pointer!!, status) - }!! - } - - - @Throws(NodeException::class) - override fun `addAddressTypeToMonitor`(`addressType`: AddressType, `seedBytes`: List) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_add_address_type_to_monitor( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterSequenceUByte.lower(`seedBytes`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `addAddressTypeToMonitorWithMnemonic`(`addressType`: AddressType, `mnemonic`: Mnemonic, `passphrase`: kotlin.String?) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_add_address_type_to_monitor_with_mnemonic( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterTypeMnemonic.lower(`mnemonic`), - FfiConverterOptionalString.lower(`passphrase`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `addOnchainWalletAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt, `xpub`: kotlin.String) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_add_onchain_wallet_account( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterUInt.lower(`accountIndex`), - FfiConverterString.lower(`xpub`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `announcementAddresses`(): List? { - return FfiConverterOptionalSequenceTypeSocketAddress.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_announcement_addresses( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `bolt11Payment`(): Bolt11Payment { - return FfiConverterTypeBolt11Payment.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_bolt11_payment( - it, - uniffiRustCallStatus, - ) - }!! - }) - } - - override fun `bolt12Payment`(): Bolt12Payment { - return FfiConverterTypeBolt12Payment.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_bolt12_payment( - it, - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `closeChannel`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_close_channel( - it, - FfiConverterTypeUserChannelId.lower(`userChannelId`), - FfiConverterTypePublicKey.lower(`counterpartyNodeId`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `config`(): Config { - return FfiConverterTypeConfig.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_config( - it, - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `connect`(`nodeId`: PublicKey, `address`: SocketAddress, `persist`: kotlin.Boolean) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_connect( - it, - FfiConverterTypePublicKey.lower(`nodeId`), - FfiConverterTypeSocketAddress.lower(`address`), - FfiConverterBoolean.lower(`persist`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `currentSyncIntervals`(): RuntimeSyncIntervals { - return FfiConverterTypeRuntimeSyncIntervals.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_current_sync_intervals( - it, - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `disconnect`(`nodeId`: PublicKey) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_disconnect( - it, - FfiConverterTypePublicKey.lower(`nodeId`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `eventHandled`() { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_event_handled( - it, - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `exportOnchainWalletAccountXpub`(`addressType`: AddressType, `accountIndex`: kotlin.UInt): kotlin.String { - return FfiConverterString.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_export_onchain_wallet_account_xpub( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterUInt.lower(`accountIndex`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `exportPathfindingScores`(): kotlin.ByteArray { - return FfiConverterByteArray.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_export_pathfinding_scores( - it, - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `forceCloseChannel`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `reason`: kotlin.String?) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_force_close_channel( - it, - FfiConverterTypeUserChannelId.lower(`userChannelId`), - FfiConverterTypePublicKey.lower(`counterpartyNodeId`), - FfiConverterOptionalString.lower(`reason`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `getAddressBalance`(`addressStr`: kotlin.String): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_get_address_balance( - it, - FfiConverterString.lower(`addressStr`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `getBalanceForAddressType`(`addressType`: AddressType): AddressTypeBalance { - return FfiConverterTypeAddressTypeBalance.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_get_balance_for_address_type( - it, - FfiConverterTypeAddressType.lower(`addressType`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `getBalanceForOnchainWalletAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt): AddressTypeBalance { - return FfiConverterTypeAddressTypeBalance.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_get_balance_for_onchain_wallet_account( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterUInt.lower(`accountIndex`), - uniffiRustCallStatus, - ) - } - }) - } - - override fun `getTransactionDetails`(`txid`: Txid): TransactionDetails? { - return FfiConverterOptionalTypeTransactionDetails.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_get_transaction_details( - it, - FfiConverterTypeTxid.lower(`txid`), - uniffiRustCallStatus, - ) - } - }) - } - - override fun `listBalances`(): BalanceDetails { - return FfiConverterTypeBalanceDetails.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_list_balances( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `listChannels`(): List { - return FfiConverterSequenceTypeChannelDetails.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_list_channels( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `listMonitoredAddressTypes`(): List { - return FfiConverterSequenceTypeAddressType.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_list_monitored_address_types( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `listOnchainWalletAccounts`(): List { - return FfiConverterSequenceTypeOnchainWalletAccount.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_list_onchain_wallet_accounts( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `listPayments`(): List { - return FfiConverterSequenceTypePaymentDetails.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_list_payments( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `listPeers`(): List { - return FfiConverterSequenceTypePeerDetails.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_list_peers( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `listeningAddresses`(): List? { - return FfiConverterOptionalSequenceTypeSocketAddress.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_listening_addresses( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `lsps1Liquidity`(): Lsps1Liquidity { - return FfiConverterTypeLSPS1Liquidity.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_lsps1_liquidity( - it, - uniffiRustCallStatus, - ) - }!! - }) - } - - override fun `networkGraph`(): NetworkGraph { - return FfiConverterTypeNetworkGraph.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_network_graph( - it, - uniffiRustCallStatus, - ) - }!! - }) - } - - override fun `nextEvent`(): Event? { - return FfiConverterOptionalTypeEvent.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_next_event( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override suspend fun `nextEventAsync`(): Event { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_next_event_async( - thisPtr, - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_ldk_node_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_ldk_node_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_ldk_node_rust_future_free_rust_buffer(future) }, - { future -> UniffiLib.INSTANCE.ffi_ldk_node_rust_future_cancel_rust_buffer(future) }, - // lift function - { FfiConverterTypeEvent.lift(it) }, - // Error FFI converter - UniffiNullRustCallStatusErrorHandler, - ) - } - - override fun `nodeAlias`(): NodeAlias? { - return FfiConverterOptionalTypeNodeAlias.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_node_alias( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `nodeId`(): PublicKey { - return FfiConverterTypePublicKey.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_node_id( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `onchainPayment`(): OnchainPayment { - return FfiConverterTypeOnchainPayment.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_onchain_payment( - it, - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `openAnnouncedChannel`(`nodeId`: PublicKey, `address`: SocketAddress, `channelAmountSats`: kotlin.ULong, `pushToCounterpartyMsat`: kotlin.ULong?, `channelConfig`: ChannelConfig?): UserChannelId { - return FfiConverterTypeUserChannelId.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_open_announced_channel( - it, - FfiConverterTypePublicKey.lower(`nodeId`), - FfiConverterTypeSocketAddress.lower(`address`), - FfiConverterULong.lower(`channelAmountSats`), - FfiConverterOptionalULong.lower(`pushToCounterpartyMsat`), - FfiConverterOptionalTypeChannelConfig.lower(`channelConfig`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `openChannel`(`nodeId`: PublicKey, `address`: SocketAddress, `channelAmountSats`: kotlin.ULong, `pushToCounterpartyMsat`: kotlin.ULong?, `channelConfig`: ChannelConfig?): UserChannelId { - return FfiConverterTypeUserChannelId.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_open_channel( - it, - FfiConverterTypePublicKey.lower(`nodeId`), - FfiConverterTypeSocketAddress.lower(`address`), - FfiConverterULong.lower(`channelAmountSats`), - FfiConverterOptionalULong.lower(`pushToCounterpartyMsat`), - FfiConverterOptionalTypeChannelConfig.lower(`channelConfig`), - uniffiRustCallStatus, - ) - } - }) - } - - override fun `payment`(`paymentId`: PaymentId): PaymentDetails? { - return FfiConverterOptionalTypePaymentDetails.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_payment( - it, - FfiConverterTypePaymentId.lower(`paymentId`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `removeAddressTypeFromMonitor`(`addressType`: AddressType) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_remove_address_type_from_monitor( - it, - FfiConverterTypeAddressType.lower(`addressType`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `removeOnchainWalletAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_remove_onchain_wallet_account( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterUInt.lower(`accountIndex`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `removePayment`(`paymentId`: PaymentId) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_remove_payment( - it, - FfiConverterTypePaymentId.lower(`paymentId`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `setPrimaryAddressType`(`addressType`: AddressType, `seedBytes`: List) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_set_primary_address_type( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterSequenceUByte.lower(`seedBytes`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `setPrimaryAddressTypeWithMnemonic`(`addressType`: AddressType, `mnemonic`: Mnemonic, `passphrase`: kotlin.String?) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_set_primary_address_type_with_mnemonic( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterTypeMnemonic.lower(`mnemonic`), - FfiConverterOptionalString.lower(`passphrase`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `signMessage`(`msg`: List): kotlin.String { - return FfiConverterString.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_sign_message( - it, - FfiConverterSequenceUByte.lower(`msg`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `spliceIn`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `spliceAmountSats`: kotlin.ULong) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_splice_in( - it, - FfiConverterTypeUserChannelId.lower(`userChannelId`), - FfiConverterTypePublicKey.lower(`counterpartyNodeId`), - FfiConverterULong.lower(`spliceAmountSats`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `spliceOut`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `address`: Address, `spliceAmountSats`: kotlin.ULong) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_splice_out( - it, - FfiConverterTypeUserChannelId.lower(`userChannelId`), - FfiConverterTypePublicKey.lower(`counterpartyNodeId`), - FfiConverterTypeAddress.lower(`address`), - FfiConverterULong.lower(`spliceAmountSats`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `spontaneousPayment`(): SpontaneousPayment { - return FfiConverterTypeSpontaneousPayment.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_spontaneous_payment( - it, - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `start`() { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_start( - it, - uniffiRustCallStatus, - ) - } - } - } - - override fun `status`(): NodeStatus { - return FfiConverterTypeNodeStatus.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_status( - it, - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `stop`() { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_stop( - it, - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `syncWallets`() { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_sync_wallets( - it, - uniffiRustCallStatus, - ) - } - } - } - - override fun `unifiedQrPayment`(): UnifiedQrPayment { - return FfiConverterTypeUnifiedQrPayment.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_unified_qr_payment( - it, - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `updateChannelConfig`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `channelConfig`: ChannelConfig) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_update_channel_config( - it, - FfiConverterTypeUserChannelId.lower(`userChannelId`), - FfiConverterTypePublicKey.lower(`counterpartyNodeId`), - FfiConverterTypeChannelConfig.lower(`channelConfig`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `updateSyncIntervals`(`intervals`: RuntimeSyncIntervals) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_update_sync_intervals( - it, - FfiConverterTypeRuntimeSyncIntervals.lower(`intervals`), - uniffiRustCallStatus, - ) - } - } - } - - override fun `verifySignature`(`msg`: List, `sig`: kotlin.String, `pkey`: PublicKey): kotlin.Boolean { - return FfiConverterBoolean.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_verify_signature( - it, - FfiConverterSequenceUByte.lower(`msg`), - FfiConverterString.lower(`sig`), - FfiConverterTypePublicKey.lower(`pkey`), - uniffiRustCallStatus, - ) - } - }) - } - - override fun `waitNextEvent`(): Event { - return FfiConverterTypeEvent.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_wait_next_event( - it, - uniffiRustCallStatus, - ) - } - }) - } - - - - - - - - companion object - -} - - - - - -object FfiConverterTypeNode: FfiConverter { - - override fun lower(value: Node): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): Node { - return Node(value) - } - - override fun read(buf: ByteBuffer): Node { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: Node) = 8UL - - override fun write(value: Node, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class Offer: Disposable, OfferInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_offer(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_offer(pointer!!, status) - }!! - } - - - override fun `absoluteExpirySeconds`(): kotlin.ULong? { - return FfiConverterOptionalULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_absolute_expiry_seconds( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `amount`(): OfferAmount? { - return FfiConverterOptionalTypeOfferAmount.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_amount( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `chains`(): List { - return FfiConverterSequenceTypeNetwork.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_chains( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `expectsQuantity`(): kotlin.Boolean { - return FfiConverterBoolean.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_expects_quantity( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `id`(): OfferId { - return FfiConverterTypeOfferId.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_id( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `isExpired`(): kotlin.Boolean { - return FfiConverterBoolean.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_is_expired( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `isValidQuantity`(`quantity`: kotlin.ULong): kotlin.Boolean { - return FfiConverterBoolean.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_is_valid_quantity( - it, - FfiConverterULong.lower(`quantity`), - uniffiRustCallStatus, - ) - } - }) - } - - override fun `issuer`(): kotlin.String? { - return FfiConverterOptionalString.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_issuer( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `issuerSigningPubkey`(): PublicKey? { - return FfiConverterOptionalTypePublicKey.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_issuer_signing_pubkey( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `metadata`(): List? { - return FfiConverterOptionalSequenceUByte.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_metadata( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `offerDescription`(): kotlin.String? { - return FfiConverterOptionalString.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_offer_description( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `supportsChain`(`chain`: Network): kotlin.Boolean { - return FfiConverterBoolean.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_supports_chain( - it, - FfiConverterTypeNetwork.lower(`chain`), - uniffiRustCallStatus, - ) - } - }) - } - - - - - override fun toString(): String { - return FfiConverterString.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_uniffi_trait_display( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is Offer) return false - return FfiConverterBoolean.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_offer_uniffi_trait_eq_eq( - it, - FfiConverterTypeOffer.lower(`other`), - uniffiRustCallStatus, - ) - } - }) - } - - - - companion object { - - @Throws(NodeException::class) - fun `fromStr`(`offerStr`: kotlin.String): Offer { - return FfiConverterTypeOffer.lift(uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_constructor_offer_from_str( - FfiConverterString.lower(`offerStr`), - uniffiRustCallStatus, - ) - }!!) - } - - - } - -} - - - - - -object FfiConverterTypeOffer: FfiConverter { - - override fun lower(value: Offer): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): Offer { - return Offer(value) - } - - override fun read(buf: ByteBuffer): Offer { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: Offer) = 8UL - - override fun write(value: Offer, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class OnchainPayment: Disposable, OnchainPaymentInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_onchainpayment(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_onchainpayment(pointer!!, status) - }!! - } - - - @Throws(NodeException::class) - override fun `accelerateByCpfp`(`txid`: Txid, `feeRate`: FeeRate?, `destinationAddress`: Address?): Txid { - return FfiConverterTypeTxid.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_accelerate_by_cpfp( - it, - FfiConverterTypeTxid.lower(`txid`), - FfiConverterOptionalTypeFeeRate.lower(`feeRate`), - FfiConverterOptionalTypeAddress.lower(`destinationAddress`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `addressInfoForAccountAtIndex`(`addressType`: AddressType, `accountIndex`: kotlin.UInt, `keychain`: KeychainKind, `index`: kotlin.UInt): AddressInfo { - return FfiConverterTypeAddressInfo.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_address_info_for_account_at_index( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterUInt.lower(`accountIndex`), - FfiConverterTypeKeychainKind.lower(`keychain`), - FfiConverterUInt.lower(`index`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `addressInfoForTypeAtIndex`(`addressType`: AddressType, `keychain`: KeychainKind, `index`: kotlin.UInt): AddressInfo { - return FfiConverterTypeAddressInfo.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_address_info_for_type_at_index( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterTypeKeychainKind.lower(`keychain`), - FfiConverterUInt.lower(`index`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `addressInfosForAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt, `keychain`: KeychainKind, `startIndex`: kotlin.UInt, `count`: kotlin.UInt): List { - return FfiConverterSequenceTypeAddressInfo.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_address_infos_for_account( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterUInt.lower(`accountIndex`), - FfiConverterTypeKeychainKind.lower(`keychain`), - FfiConverterUInt.lower(`startIndex`), - FfiConverterUInt.lower(`count`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `addressInfosForType`(`addressType`: AddressType, `keychain`: KeychainKind, `startIndex`: kotlin.UInt, `count`: kotlin.UInt): List { - return FfiConverterSequenceTypeAddressInfo.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_address_infos_for_type( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterTypeKeychainKind.lower(`keychain`), - FfiConverterUInt.lower(`startIndex`), - FfiConverterUInt.lower(`count`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `bumpFeeByRbf`(`txid`: Txid, `feeRate`: FeeRate): Txid { - return FfiConverterTypeTxid.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_bump_fee_by_rbf( - it, - FfiConverterTypeTxid.lower(`txid`), - FfiConverterTypeFeeRate.lower(`feeRate`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `calculateCpfpFeeRate`(`parentTxid`: Txid, `urgent`: kotlin.Boolean): FeeRate { - return FfiConverterTypeFeeRate.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_calculate_cpfp_fee_rate( - it, - FfiConverterTypeTxid.lower(`parentTxid`), - FfiConverterBoolean.lower(`urgent`), - uniffiRustCallStatus, - ) - }!! - }) - } - - @Throws(NodeException::class) - override fun `calculateSendAllFee`(`address`: Address, `retainReserves`: kotlin.Boolean, `feeRate`: FeeRate?): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_calculate_send_all_fee( - it, - FfiConverterTypeAddress.lower(`address`), - FfiConverterBoolean.lower(`retainReserves`), - FfiConverterOptionalTypeFeeRate.lower(`feeRate`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `calculateTotalFee`(`address`: Address, `amountSats`: kotlin.ULong, `feeRate`: FeeRate?, `utxosToSpend`: List?): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_calculate_total_fee( - it, - FfiConverterTypeAddress.lower(`address`), - FfiConverterULong.lower(`amountSats`), - FfiConverterOptionalTypeFeeRate.lower(`feeRate`), - FfiConverterOptionalSequenceTypeSpendableUtxo.lower(`utxosToSpend`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `listSpendableOutputs`(): List { - return FfiConverterSequenceTypeSpendableUtxo.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_list_spendable_outputs( - it, - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `newAddress`(): Address { - return FfiConverterTypeAddress.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_new_address( - it, - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `newAddressForAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt): Address { - return FfiConverterTypeAddress.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_new_address_for_account( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterUInt.lower(`accountIndex`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `newAddressForType`(`addressType`: AddressType): Address { - return FfiConverterTypeAddress.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_new_address_for_type( - it, - FfiConverterTypeAddressType.lower(`addressType`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `newAddressInfo`(): AddressInfo { - return FfiConverterTypeAddressInfo.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_new_address_info( - it, - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `newAddressInfoForAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt): AddressInfo { - return FfiConverterTypeAddressInfo.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_new_address_info_for_account( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterUInt.lower(`accountIndex`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `newAddressInfoForType`(`addressType`: AddressType): AddressInfo { - return FfiConverterTypeAddressInfo.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_new_address_info_for_type( - it, - FfiConverterTypeAddressType.lower(`addressType`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `revealReceiveAddressesTo`(`addressType`: AddressType, `index`: kotlin.UInt) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_reveal_receive_addresses_to( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterUInt.lower(`index`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `revealReceiveAddressesToAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt, `index`: kotlin.UInt) { - callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_reveal_receive_addresses_to_account( - it, - FfiConverterTypeAddressType.lower(`addressType`), - FfiConverterUInt.lower(`accountIndex`), - FfiConverterUInt.lower(`index`), - uniffiRustCallStatus, - ) - } - } - } - - @Throws(NodeException::class) - override fun `selectUtxosWithAlgorithm`(`targetAmountSats`: kotlin.ULong, `feeRate`: FeeRate?, `algorithm`: CoinSelectionAlgorithm, `utxos`: List?): List { - return FfiConverterSequenceTypeSpendableUtxo.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_select_utxos_with_algorithm( - it, - FfiConverterULong.lower(`targetAmountSats`), - FfiConverterOptionalTypeFeeRate.lower(`feeRate`), - FfiConverterTypeCoinSelectionAlgorithm.lower(`algorithm`), - FfiConverterOptionalSequenceTypeSpendableUtxo.lower(`utxos`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `sendAllToAddress`(`address`: Address, `retainReserve`: kotlin.Boolean, `feeRate`: FeeRate?): Txid { - return FfiConverterTypeTxid.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_send_all_to_address( - it, - FfiConverterTypeAddress.lower(`address`), - FfiConverterBoolean.lower(`retainReserve`), - FfiConverterOptionalTypeFeeRate.lower(`feeRate`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `sendToAddress`(`address`: Address, `amountSats`: kotlin.ULong, `feeRate`: FeeRate?, `utxosToSpend`: List?): Txid { - return FfiConverterTypeTxid.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_send_to_address( - it, - FfiConverterTypeAddress.lower(`address`), - FfiConverterULong.lower(`amountSats`), - FfiConverterOptionalTypeFeeRate.lower(`feeRate`), - FfiConverterOptionalSequenceTypeSpendableUtxo.lower(`utxosToSpend`), - uniffiRustCallStatus, - ) - } - }) - } - - - - - - - - companion object - -} - - - - - -object FfiConverterTypeOnchainPayment: FfiConverter { - - override fun lower(value: OnchainPayment): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): OnchainPayment { - return OnchainPayment(value) - } - - override fun read(buf: ByteBuffer): OnchainPayment { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: OnchainPayment) = 8UL - - override fun write(value: OnchainPayment, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class Refund: Disposable, RefundInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_refund(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_refund(pointer!!, status) - }!! - } - - - override fun `absoluteExpirySeconds`(): kotlin.ULong? { - return FfiConverterOptionalULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_refund_absolute_expiry_seconds( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `amountMsats`(): kotlin.ULong { - return FfiConverterULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_refund_amount_msats( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `chain`(): Network? { - return FfiConverterOptionalTypeNetwork.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_refund_chain( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `isExpired`(): kotlin.Boolean { - return FfiConverterBoolean.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_refund_is_expired( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `issuer`(): kotlin.String? { - return FfiConverterOptionalString.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_refund_issuer( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `payerMetadata`(): List { - return FfiConverterSequenceUByte.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_refund_payer_metadata( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `payerNote`(): kotlin.String? { - return FfiConverterOptionalString.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_refund_payer_note( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `payerSigningPubkey`(): PublicKey { - return FfiConverterTypePublicKey.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_refund_payer_signing_pubkey( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `quantity`(): kotlin.ULong? { - return FfiConverterOptionalULong.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_refund_quantity( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun `refundDescription`(): kotlin.String { - return FfiConverterString.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_refund_refund_description( - it, - uniffiRustCallStatus, - ) - } - }) - } - - - - - override fun toString(): String { - return FfiConverterString.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_refund_uniffi_trait_display( - it, - uniffiRustCallStatus, - ) - } - }) - } - - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is Refund) return false - return FfiConverterBoolean.lift(callWithPointer { - uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_refund_uniffi_trait_eq_eq( - it, - FfiConverterTypeRefund.lower(`other`), - uniffiRustCallStatus, - ) - } - }) - } - - - - companion object { - - @Throws(NodeException::class) - fun `fromStr`(`refundStr`: kotlin.String): Refund { - return FfiConverterTypeRefund.lift(uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_constructor_refund_from_str( - FfiConverterString.lower(`refundStr`), - uniffiRustCallStatus, - ) - }!!) - } - - - } - -} - - - - - -object FfiConverterTypeRefund: FfiConverter { - - override fun lower(value: Refund): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): Refund { - return Refund(value) - } - - override fun read(buf: ByteBuffer): Refund { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: Refund) = 8UL - - override fun write(value: Refund, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class SpontaneousPayment: Disposable, SpontaneousPaymentInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_spontaneouspayment(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_spontaneouspayment(pointer!!, status) - }!! - } - - - @Throws(NodeException::class) - override fun `send`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `routeParameters`: RouteParametersConfig?): PaymentId { - return FfiConverterTypePaymentId.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_spontaneouspayment_send( - it, - FfiConverterULong.lower(`amountMsat`), - FfiConverterTypePublicKey.lower(`nodeId`), - FfiConverterOptionalTypeRouteParametersConfig.lower(`routeParameters`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `sendProbes`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey): List { - return FfiConverterSequenceTypeProbeHandle.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_spontaneouspayment_send_probes( - it, - FfiConverterULong.lower(`amountMsat`), - FfiConverterTypePublicKey.lower(`nodeId`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `sendWithCustomTlvs`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `routeParameters`: RouteParametersConfig?, `customTlvs`: List): PaymentId { - return FfiConverterTypePaymentId.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_spontaneouspayment_send_with_custom_tlvs( - it, - FfiConverterULong.lower(`amountMsat`), - FfiConverterTypePublicKey.lower(`nodeId`), - FfiConverterOptionalTypeRouteParametersConfig.lower(`routeParameters`), - FfiConverterSequenceTypeCustomTlvRecord.lower(`customTlvs`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `sendWithPreimage`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `preimage`: PaymentPreimage, `routeParameters`: RouteParametersConfig?): PaymentId { - return FfiConverterTypePaymentId.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_spontaneouspayment_send_with_preimage( - it, - FfiConverterULong.lower(`amountMsat`), - FfiConverterTypePublicKey.lower(`nodeId`), - FfiConverterTypePaymentPreimage.lower(`preimage`), - FfiConverterOptionalTypeRouteParametersConfig.lower(`routeParameters`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `sendWithPreimageAndCustomTlvs`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `customTlvs`: List, `preimage`: PaymentPreimage, `routeParameters`: RouteParametersConfig?): PaymentId { - return FfiConverterTypePaymentId.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_spontaneouspayment_send_with_preimage_and_custom_tlvs( - it, - FfiConverterULong.lower(`amountMsat`), - FfiConverterTypePublicKey.lower(`nodeId`), - FfiConverterSequenceTypeCustomTlvRecord.lower(`customTlvs`), - FfiConverterTypePaymentPreimage.lower(`preimage`), - FfiConverterOptionalTypeRouteParametersConfig.lower(`routeParameters`), - uniffiRustCallStatus, - ) - } - }) - } - - - - - - - - companion object - -} - - - - - -object FfiConverterTypeSpontaneousPayment: FfiConverter { - - override fun lower(value: SpontaneousPayment): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): SpontaneousPayment { - return SpontaneousPayment(value) - } - - override fun read(buf: ByteBuffer): SpontaneousPayment { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: SpontaneousPayment) = 8UL - - override fun write(value: SpontaneousPayment, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class UnifiedQrPayment: Disposable, UnifiedQrPaymentInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_unifiedqrpayment(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_unifiedqrpayment(pointer!!, status) - }!! - } - - - @Throws(NodeException::class) - override fun `receive`(`amountSats`: kotlin.ULong, `message`: kotlin.String, `expirySec`: kotlin.UInt): kotlin.String { - return FfiConverterString.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_unifiedqrpayment_receive( - it, - FfiConverterULong.lower(`amountSats`), - FfiConverterString.lower(`message`), - FfiConverterUInt.lower(`expirySec`), - uniffiRustCallStatus, - ) - } - }) - } - - @Throws(NodeException::class) - override fun `send`(`uriStr`: kotlin.String, `routeParameters`: RouteParametersConfig?): QrPaymentResult { - return FfiConverterTypeQrPaymentResult.lift(callWithPointer { - uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_unifiedqrpayment_send( - it, - FfiConverterString.lower(`uriStr`), - FfiConverterOptionalTypeRouteParametersConfig.lower(`routeParameters`), - uniffiRustCallStatus, - ) - } - }) - } - - - - - - - - companion object - -} - - - - - -object FfiConverterTypeUnifiedQrPayment: FfiConverter { - - override fun lower(value: UnifiedQrPayment): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): UnifiedQrPayment { - return UnifiedQrPayment(value) - } - - override fun read(buf: ByteBuffer): UnifiedQrPayment { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: UnifiedQrPayment) = 8UL - - override fun write(value: UnifiedQrPayment, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - -open class VssHeaderProvider: Disposable, VssHeaderProviderInterface { - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiPointerDestroyer(null)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed: kotlinx.atomicfu.AtomicBoolean = kotlinx.atomicfu.atomic(false) - private val callCounter: kotlinx.atomicfu.AtomicLong = kotlinx.atomicfu.atomic(1L) - - private val lock = kotlinx.atomicfu.locks.ReentrantLock() - - private fun synchronized(block: () -> T): T { - lock.lock() - try { - return block() - } finally { - lock.unlock() - } - } - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - override fun close() { - synchronized { this.destroy() } - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.value - if (c == 0L) { - throw IllegalStateException("${this::class::simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this::class::simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiPointerDestroyer(private val pointer: Pointer?) : Disposable { - override fun destroy() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_free_vssheaderprovider(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_clone_vssheaderprovider(pointer!!, status) - }!! - } - - - @Throws(VssHeaderProviderException::class, kotlin.coroutines.cancellation.CancellationException::class) - override suspend fun `getHeaders`(`request`: List): Map { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_vssheaderprovider_get_headers( - thisPtr, - FfiConverterSequenceUByte.lower(`request`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_ldk_node_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_ldk_node_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_ldk_node_rust_future_free_rust_buffer(future) }, - { future -> UniffiLib.INSTANCE.ffi_ldk_node_rust_future_cancel_rust_buffer(future) }, - // lift function - { FfiConverterMapStringString.lift(it) }, - // Error FFI converter - VssHeaderProviderExceptionErrorHandler, - ) - } - - - - - - - - companion object - -} - - - - - -object FfiConverterTypeVssHeaderProvider: FfiConverter { - - override fun lower(value: VssHeaderProvider): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): VssHeaderProvider { - return VssHeaderProvider(value) - } - - override fun read(buf: ByteBuffer): VssHeaderProvider { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(buf.getLong().toPointer()) - } - - override fun allocationSize(value: VssHeaderProvider) = 8UL - - override fun write(value: VssHeaderProvider, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(lower(value).toLong()) - } -} - - - - -object FfiConverterTypeAddressInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): AddressInfo { - return AddressInfo( - FfiConverterUInt.read(buf), - FfiConverterTypeAddress.read(buf), - FfiConverterTypeKeychainKind.read(buf), - ) - } - - override fun allocationSize(value: AddressInfo) = ( - FfiConverterUInt.allocationSize(value.`index`) + - FfiConverterTypeAddress.allocationSize(value.`address`) + - FfiConverterTypeKeychainKind.allocationSize(value.`keychain`) - ) - - override fun write(value: AddressInfo, buf: ByteBuffer) { - FfiConverterUInt.write(value.`index`, buf) - FfiConverterTypeAddress.write(value.`address`, buf) - FfiConverterTypeKeychainKind.write(value.`keychain`, buf) - } -} - - - - -object FfiConverterTypeAddressTypeBalance: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): AddressTypeBalance { - return AddressTypeBalance( - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - ) - } - - override fun allocationSize(value: AddressTypeBalance) = ( - FfiConverterULong.allocationSize(value.`totalSats`) + - FfiConverterULong.allocationSize(value.`spendableSats`) - ) - - override fun write(value: AddressTypeBalance, buf: ByteBuffer) { - FfiConverterULong.write(value.`totalSats`, buf) - FfiConverterULong.write(value.`spendableSats`, buf) - } -} - - - - -object FfiConverterTypeAnchorChannelsConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): AnchorChannelsConfig { - return AnchorChannelsConfig( - FfiConverterSequenceTypePublicKey.read(buf), - FfiConverterULong.read(buf), - ) - } - - override fun allocationSize(value: AnchorChannelsConfig) = ( - FfiConverterSequenceTypePublicKey.allocationSize(value.`trustedPeersNoReserve`) + - FfiConverterULong.allocationSize(value.`perChannelReserveSats`) - ) - - override fun write(value: AnchorChannelsConfig, buf: ByteBuffer) { - FfiConverterSequenceTypePublicKey.write(value.`trustedPeersNoReserve`, buf) - FfiConverterULong.write(value.`perChannelReserveSats`, buf) - } -} - - - - -object FfiConverterTypeBackgroundSyncConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): BackgroundSyncConfig { - return BackgroundSyncConfig( - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - ) - } - - override fun allocationSize(value: BackgroundSyncConfig) = ( - FfiConverterULong.allocationSize(value.`onchainWalletSyncIntervalSecs`) + - FfiConverterULong.allocationSize(value.`lightningWalletSyncIntervalSecs`) + - FfiConverterULong.allocationSize(value.`feeRateCacheUpdateIntervalSecs`) - ) - - override fun write(value: BackgroundSyncConfig, buf: ByteBuffer) { - FfiConverterULong.write(value.`onchainWalletSyncIntervalSecs`, buf) - FfiConverterULong.write(value.`lightningWalletSyncIntervalSecs`, buf) - FfiConverterULong.write(value.`feeRateCacheUpdateIntervalSecs`, buf) - } -} - - - - -object FfiConverterTypeBalanceDetails: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): BalanceDetails { - return BalanceDetails( - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterSequenceTypeLightningBalance.read(buf), - FfiConverterSequenceTypePendingSweepBalance.read(buf), - ) - } - - override fun allocationSize(value: BalanceDetails) = ( - FfiConverterULong.allocationSize(value.`totalOnchainBalanceSats`) + - FfiConverterULong.allocationSize(value.`spendableOnchainBalanceSats`) + - FfiConverterULong.allocationSize(value.`totalAnchorChannelsReserveSats`) + - FfiConverterULong.allocationSize(value.`totalLightningBalanceSats`) + - FfiConverterSequenceTypeLightningBalance.allocationSize(value.`lightningBalances`) + - FfiConverterSequenceTypePendingSweepBalance.allocationSize(value.`pendingBalancesFromChannelClosures`) - ) - - override fun write(value: BalanceDetails, buf: ByteBuffer) { - FfiConverterULong.write(value.`totalOnchainBalanceSats`, buf) - FfiConverterULong.write(value.`spendableOnchainBalanceSats`, buf) - FfiConverterULong.write(value.`totalAnchorChannelsReserveSats`, buf) - FfiConverterULong.write(value.`totalLightningBalanceSats`, buf) - FfiConverterSequenceTypeLightningBalance.write(value.`lightningBalances`, buf) - FfiConverterSequenceTypePendingSweepBalance.write(value.`pendingBalancesFromChannelClosures`, buf) - } -} - - - - -object FfiConverterTypeBestBlock: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): BestBlock { - return BestBlock( - FfiConverterTypeBlockHash.read(buf), - FfiConverterUInt.read(buf), - ) - } - - override fun allocationSize(value: BestBlock) = ( - FfiConverterTypeBlockHash.allocationSize(value.`blockHash`) + - FfiConverterUInt.allocationSize(value.`height`) - ) - - override fun write(value: BestBlock, buf: ByteBuffer) { - FfiConverterTypeBlockHash.write(value.`blockHash`, buf) - FfiConverterUInt.write(value.`height`, buf) - } -} - - - - -object FfiConverterTypeChannelConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ChannelConfig { - return ChannelConfig( - FfiConverterUInt.read(buf), - FfiConverterUInt.read(buf), - FfiConverterUShort.read(buf), - FfiConverterTypeMaxDustHTLCExposure.read(buf), - FfiConverterULong.read(buf), - FfiConverterBoolean.read(buf), - ) - } - - override fun allocationSize(value: ChannelConfig) = ( - FfiConverterUInt.allocationSize(value.`forwardingFeeProportionalMillionths`) + - FfiConverterUInt.allocationSize(value.`forwardingFeeBaseMsat`) + - FfiConverterUShort.allocationSize(value.`cltvExpiryDelta`) + - FfiConverterTypeMaxDustHTLCExposure.allocationSize(value.`maxDustHtlcExposure`) + - FfiConverterULong.allocationSize(value.`forceCloseAvoidanceMaxFeeSatoshis`) + - FfiConverterBoolean.allocationSize(value.`acceptUnderpayingHtlcs`) - ) - - override fun write(value: ChannelConfig, buf: ByteBuffer) { - FfiConverterUInt.write(value.`forwardingFeeProportionalMillionths`, buf) - FfiConverterUInt.write(value.`forwardingFeeBaseMsat`, buf) - FfiConverterUShort.write(value.`cltvExpiryDelta`, buf) - FfiConverterTypeMaxDustHTLCExposure.write(value.`maxDustHtlcExposure`, buf) - FfiConverterULong.write(value.`forceCloseAvoidanceMaxFeeSatoshis`, buf) - FfiConverterBoolean.write(value.`acceptUnderpayingHtlcs`, buf) - } -} - - - - -object FfiConverterTypeChannelDataMigration: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ChannelDataMigration { - return ChannelDataMigration( - FfiConverterOptionalSequenceUByte.read(buf), - FfiConverterSequenceSequenceUByte.read(buf), - ) - } - - override fun allocationSize(value: ChannelDataMigration) = ( - FfiConverterOptionalSequenceUByte.allocationSize(value.`channelManager`) + - FfiConverterSequenceSequenceUByte.allocationSize(value.`channelMonitors`) - ) - - override fun write(value: ChannelDataMigration, buf: ByteBuffer) { - FfiConverterOptionalSequenceUByte.write(value.`channelManager`, buf) - FfiConverterSequenceSequenceUByte.write(value.`channelMonitors`, buf) - } -} - - - - -object FfiConverterTypeChannelDetails: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ChannelDetails { - return ChannelDetails( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypePublicKey.read(buf), - FfiConverterOptionalTypeOutPoint.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterTypeUserChannelId.read(buf), - FfiConverterUInt.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterOptionalUInt.read(buf), - FfiConverterOptionalUInt.read(buf), - FfiConverterBoolean.read(buf), - FfiConverterBoolean.read(buf), - FfiConverterBoolean.read(buf), - FfiConverterBoolean.read(buf), - FfiConverterOptionalUShort.read(buf), - FfiConverterULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalUInt.read(buf), - FfiConverterOptionalUInt.read(buf), - FfiConverterOptionalUShort.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterOptionalUShort.read(buf), - FfiConverterULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterTypeChannelConfig.read(buf), - FfiConverterOptionalULong.read(buf), - ) - } - - override fun allocationSize(value: ChannelDetails) = ( - FfiConverterTypeChannelId.allocationSize(value.`channelId`) + - FfiConverterTypePublicKey.allocationSize(value.`counterpartyNodeId`) + - FfiConverterOptionalTypeOutPoint.allocationSize(value.`fundingTxo`) + - FfiConverterOptionalULong.allocationSize(value.`shortChannelId`) + - FfiConverterOptionalULong.allocationSize(value.`outboundScidAlias`) + - FfiConverterOptionalULong.allocationSize(value.`inboundScidAlias`) + - FfiConverterULong.allocationSize(value.`channelValueSats`) + - FfiConverterOptionalULong.allocationSize(value.`unspendablePunishmentReserve`) + - FfiConverterTypeUserChannelId.allocationSize(value.`userChannelId`) + - FfiConverterUInt.allocationSize(value.`feerateSatPer1000Weight`) + - FfiConverterULong.allocationSize(value.`outboundCapacityMsat`) + - FfiConverterULong.allocationSize(value.`inboundCapacityMsat`) + - FfiConverterOptionalUInt.allocationSize(value.`confirmationsRequired`) + - FfiConverterOptionalUInt.allocationSize(value.`confirmations`) + - FfiConverterBoolean.allocationSize(value.`isOutbound`) + - FfiConverterBoolean.allocationSize(value.`isChannelReady`) + - FfiConverterBoolean.allocationSize(value.`isUsable`) + - FfiConverterBoolean.allocationSize(value.`isAnnounced`) + - FfiConverterOptionalUShort.allocationSize(value.`cltvExpiryDelta`) + - FfiConverterULong.allocationSize(value.`counterpartyUnspendablePunishmentReserve`) + - FfiConverterOptionalULong.allocationSize(value.`counterpartyOutboundHtlcMinimumMsat`) + - FfiConverterOptionalULong.allocationSize(value.`counterpartyOutboundHtlcMaximumMsat`) + - FfiConverterOptionalUInt.allocationSize(value.`counterpartyForwardingInfoFeeBaseMsat`) + - FfiConverterOptionalUInt.allocationSize(value.`counterpartyForwardingInfoFeeProportionalMillionths`) + - FfiConverterOptionalUShort.allocationSize(value.`counterpartyForwardingInfoCltvExpiryDelta`) + - FfiConverterULong.allocationSize(value.`nextOutboundHtlcLimitMsat`) + - FfiConverterULong.allocationSize(value.`nextOutboundHtlcMinimumMsat`) + - FfiConverterOptionalUShort.allocationSize(value.`forceCloseSpendDelay`) + - FfiConverterULong.allocationSize(value.`inboundHtlcMinimumMsat`) + - FfiConverterOptionalULong.allocationSize(value.`inboundHtlcMaximumMsat`) + - FfiConverterTypeChannelConfig.allocationSize(value.`config`) + - FfiConverterOptionalULong.allocationSize(value.`claimableOnCloseSats`) - ) - - override fun write(value: ChannelDetails, buf: ByteBuffer) { - FfiConverterTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypePublicKey.write(value.`counterpartyNodeId`, buf) - FfiConverterOptionalTypeOutPoint.write(value.`fundingTxo`, buf) - FfiConverterOptionalULong.write(value.`shortChannelId`, buf) - FfiConverterOptionalULong.write(value.`outboundScidAlias`, buf) - FfiConverterOptionalULong.write(value.`inboundScidAlias`, buf) - FfiConverterULong.write(value.`channelValueSats`, buf) - FfiConverterOptionalULong.write(value.`unspendablePunishmentReserve`, buf) - FfiConverterTypeUserChannelId.write(value.`userChannelId`, buf) - FfiConverterUInt.write(value.`feerateSatPer1000Weight`, buf) - FfiConverterULong.write(value.`outboundCapacityMsat`, buf) - FfiConverterULong.write(value.`inboundCapacityMsat`, buf) - FfiConverterOptionalUInt.write(value.`confirmationsRequired`, buf) - FfiConverterOptionalUInt.write(value.`confirmations`, buf) - FfiConverterBoolean.write(value.`isOutbound`, buf) - FfiConverterBoolean.write(value.`isChannelReady`, buf) - FfiConverterBoolean.write(value.`isUsable`, buf) - FfiConverterBoolean.write(value.`isAnnounced`, buf) - FfiConverterOptionalUShort.write(value.`cltvExpiryDelta`, buf) - FfiConverterULong.write(value.`counterpartyUnspendablePunishmentReserve`, buf) - FfiConverterOptionalULong.write(value.`counterpartyOutboundHtlcMinimumMsat`, buf) - FfiConverterOptionalULong.write(value.`counterpartyOutboundHtlcMaximumMsat`, buf) - FfiConverterOptionalUInt.write(value.`counterpartyForwardingInfoFeeBaseMsat`, buf) - FfiConverterOptionalUInt.write(value.`counterpartyForwardingInfoFeeProportionalMillionths`, buf) - FfiConverterOptionalUShort.write(value.`counterpartyForwardingInfoCltvExpiryDelta`, buf) - FfiConverterULong.write(value.`nextOutboundHtlcLimitMsat`, buf) - FfiConverterULong.write(value.`nextOutboundHtlcMinimumMsat`, buf) - FfiConverterOptionalUShort.write(value.`forceCloseSpendDelay`, buf) - FfiConverterULong.write(value.`inboundHtlcMinimumMsat`, buf) - FfiConverterOptionalULong.write(value.`inboundHtlcMaximumMsat`, buf) - FfiConverterTypeChannelConfig.write(value.`config`, buf) - FfiConverterOptionalULong.write(value.`claimableOnCloseSats`, buf) - } -} - - - - -object FfiConverterTypeChannelInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ChannelInfo { - return ChannelInfo( - FfiConverterTypeNodeId.read(buf), - FfiConverterOptionalTypeChannelUpdateInfo.read(buf), - FfiConverterTypeNodeId.read(buf), - FfiConverterOptionalTypeChannelUpdateInfo.read(buf), - FfiConverterOptionalULong.read(buf), - ) - } - - override fun allocationSize(value: ChannelInfo) = ( - FfiConverterTypeNodeId.allocationSize(value.`nodeOne`) + - FfiConverterOptionalTypeChannelUpdateInfo.allocationSize(value.`oneToTwo`) + - FfiConverterTypeNodeId.allocationSize(value.`nodeTwo`) + - FfiConverterOptionalTypeChannelUpdateInfo.allocationSize(value.`twoToOne`) + - FfiConverterOptionalULong.allocationSize(value.`capacitySats`) - ) - - override fun write(value: ChannelInfo, buf: ByteBuffer) { - FfiConverterTypeNodeId.write(value.`nodeOne`, buf) - FfiConverterOptionalTypeChannelUpdateInfo.write(value.`oneToTwo`, buf) - FfiConverterTypeNodeId.write(value.`nodeTwo`, buf) - FfiConverterOptionalTypeChannelUpdateInfo.write(value.`twoToOne`, buf) - FfiConverterOptionalULong.write(value.`capacitySats`, buf) - } -} - - - - -object FfiConverterTypeChannelUpdateInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ChannelUpdateInfo { - return ChannelUpdateInfo( - FfiConverterUInt.read(buf), - FfiConverterBoolean.read(buf), - FfiConverterUShort.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterTypeRoutingFees.read(buf), - ) - } - - override fun allocationSize(value: ChannelUpdateInfo) = ( - FfiConverterUInt.allocationSize(value.`lastUpdate`) + - FfiConverterBoolean.allocationSize(value.`enabled`) + - FfiConverterUShort.allocationSize(value.`cltvExpiryDelta`) + - FfiConverterULong.allocationSize(value.`htlcMinimumMsat`) + - FfiConverterULong.allocationSize(value.`htlcMaximumMsat`) + - FfiConverterTypeRoutingFees.allocationSize(value.`fees`) - ) - - override fun write(value: ChannelUpdateInfo, buf: ByteBuffer) { - FfiConverterUInt.write(value.`lastUpdate`, buf) - FfiConverterBoolean.write(value.`enabled`, buf) - FfiConverterUShort.write(value.`cltvExpiryDelta`, buf) - FfiConverterULong.write(value.`htlcMinimumMsat`, buf) - FfiConverterULong.write(value.`htlcMaximumMsat`, buf) - FfiConverterTypeRoutingFees.write(value.`fees`, buf) - } -} - - - - -object FfiConverterTypeConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Config { - return Config( - FfiConverterString.read(buf), - FfiConverterTypeNetwork.read(buf), - FfiConverterOptionalSequenceTypeSocketAddress.read(buf), - FfiConverterOptionalSequenceTypeSocketAddress.read(buf), - FfiConverterOptionalTypeNodeAlias.read(buf), - FfiConverterSequenceTypePublicKey.read(buf), - FfiConverterULong.read(buf), - FfiConverterOptionalTypeAnchorChannelsConfig.read(buf), - FfiConverterOptionalTypeRouteParametersConfig.read(buf), - FfiConverterOptionalTypeScoringFeeParameters.read(buf), - FfiConverterOptionalTypeScoringDecayParameters.read(buf), - FfiConverterBoolean.read(buf), - FfiConverterTypeAddressType.read(buf), - FfiConverterSequenceTypeAddressType.read(buf), - FfiConverterSequenceTypeOnchainWalletAccountConfig.read(buf), - ) - } - - override fun allocationSize(value: Config) = ( - FfiConverterString.allocationSize(value.`storageDirPath`) + - FfiConverterTypeNetwork.allocationSize(value.`network`) + - FfiConverterOptionalSequenceTypeSocketAddress.allocationSize(value.`listeningAddresses`) + - FfiConverterOptionalSequenceTypeSocketAddress.allocationSize(value.`announcementAddresses`) + - FfiConverterOptionalTypeNodeAlias.allocationSize(value.`nodeAlias`) + - FfiConverterSequenceTypePublicKey.allocationSize(value.`trustedPeers0conf`) + - FfiConverterULong.allocationSize(value.`probingLiquidityLimitMultiplier`) + - FfiConverterOptionalTypeAnchorChannelsConfig.allocationSize(value.`anchorChannelsConfig`) + - FfiConverterOptionalTypeRouteParametersConfig.allocationSize(value.`routeParameters`) + - FfiConverterOptionalTypeScoringFeeParameters.allocationSize(value.`scoringFeeParams`) + - FfiConverterOptionalTypeScoringDecayParameters.allocationSize(value.`scoringDecayParams`) + - FfiConverterBoolean.allocationSize(value.`includeUntrustedPendingInSpendable`) + - FfiConverterTypeAddressType.allocationSize(value.`addressType`) + - FfiConverterSequenceTypeAddressType.allocationSize(value.`addressTypesToMonitor`) + - FfiConverterSequenceTypeOnchainWalletAccountConfig.allocationSize(value.`onchainWalletAccounts`) - ) - - override fun write(value: Config, buf: ByteBuffer) { - FfiConverterString.write(value.`storageDirPath`, buf) - FfiConverterTypeNetwork.write(value.`network`, buf) - FfiConverterOptionalSequenceTypeSocketAddress.write(value.`listeningAddresses`, buf) - FfiConverterOptionalSequenceTypeSocketAddress.write(value.`announcementAddresses`, buf) - FfiConverterOptionalTypeNodeAlias.write(value.`nodeAlias`, buf) - FfiConverterSequenceTypePublicKey.write(value.`trustedPeers0conf`, buf) - FfiConverterULong.write(value.`probingLiquidityLimitMultiplier`, buf) - FfiConverterOptionalTypeAnchorChannelsConfig.write(value.`anchorChannelsConfig`, buf) - FfiConverterOptionalTypeRouteParametersConfig.write(value.`routeParameters`, buf) - FfiConverterOptionalTypeScoringFeeParameters.write(value.`scoringFeeParams`, buf) - FfiConverterOptionalTypeScoringDecayParameters.write(value.`scoringDecayParams`, buf) - FfiConverterBoolean.write(value.`includeUntrustedPendingInSpendable`, buf) - FfiConverterTypeAddressType.write(value.`addressType`, buf) - FfiConverterSequenceTypeAddressType.write(value.`addressTypesToMonitor`, buf) - FfiConverterSequenceTypeOnchainWalletAccountConfig.write(value.`onchainWalletAccounts`, buf) - } -} - - - - -object FfiConverterTypeCustomTlvRecord: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): CustomTlvRecord { - return CustomTlvRecord( - FfiConverterULong.read(buf), - FfiConverterSequenceUByte.read(buf), - ) - } - - override fun allocationSize(value: CustomTlvRecord) = ( - FfiConverterULong.allocationSize(value.`typeNum`) + - FfiConverterSequenceUByte.allocationSize(value.`value`) - ) - - override fun write(value: CustomTlvRecord, buf: ByteBuffer) { - FfiConverterULong.write(value.`typeNum`, buf) - FfiConverterSequenceUByte.write(value.`value`, buf) - } -} - - - - -object FfiConverterTypeElectrumSyncConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ElectrumSyncConfig { - return ElectrumSyncConfig( - FfiConverterOptionalTypeBackgroundSyncConfig.read(buf), - FfiConverterULong.read(buf), - FfiConverterUInt.read(buf), - FfiConverterUInt.read(buf), - ) - } - - override fun allocationSize(value: ElectrumSyncConfig) = ( - FfiConverterOptionalTypeBackgroundSyncConfig.allocationSize(value.`backgroundSyncConfig`) + - FfiConverterULong.allocationSize(value.`connectionTimeoutSecs`) + - FfiConverterUInt.allocationSize(value.`additionalWalletFullScanBatchSize`) + - FfiConverterUInt.allocationSize(value.`additionalWalletFullScanStopGap`) - ) - - override fun write(value: ElectrumSyncConfig, buf: ByteBuffer) { - FfiConverterOptionalTypeBackgroundSyncConfig.write(value.`backgroundSyncConfig`, buf) - FfiConverterULong.write(value.`connectionTimeoutSecs`, buf) - FfiConverterUInt.write(value.`additionalWalletFullScanBatchSize`, buf) - FfiConverterUInt.write(value.`additionalWalletFullScanStopGap`, buf) - } -} - - - - -object FfiConverterTypeEsploraSyncConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): EsploraSyncConfig { - return EsploraSyncConfig( - FfiConverterOptionalTypeBackgroundSyncConfig.read(buf), - ) - } - - override fun allocationSize(value: EsploraSyncConfig) = ( - FfiConverterOptionalTypeBackgroundSyncConfig.allocationSize(value.`backgroundSyncConfig`) - ) - - override fun write(value: EsploraSyncConfig, buf: ByteBuffer) { - FfiConverterOptionalTypeBackgroundSyncConfig.write(value.`backgroundSyncConfig`, buf) - } -} - - - - -object FfiConverterTypeLSPFeeLimits: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): LspFeeLimits { - return LspFeeLimits( - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - ) - } - - override fun allocationSize(value: LspFeeLimits) = ( - FfiConverterOptionalULong.allocationSize(value.`maxTotalOpeningFeeMsat`) + - FfiConverterOptionalULong.allocationSize(value.`maxProportionalOpeningFeePpmMsat`) - ) - - override fun write(value: LspFeeLimits, buf: ByteBuffer) { - FfiConverterOptionalULong.write(value.`maxTotalOpeningFeeMsat`, buf) - FfiConverterOptionalULong.write(value.`maxProportionalOpeningFeePpmMsat`, buf) - } -} - - - - -object FfiConverterTypeLSPS1Bolt11PaymentInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Lsps1Bolt11PaymentInfo { - return Lsps1Bolt11PaymentInfo( - FfiConverterTypeLSPS1PaymentState.read(buf), - FfiConverterTypeLSPSDateTime.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterTypeBolt11Invoice.read(buf), - ) - } - - override fun allocationSize(value: Lsps1Bolt11PaymentInfo) = ( - FfiConverterTypeLSPS1PaymentState.allocationSize(value.`state`) + - FfiConverterTypeLSPSDateTime.allocationSize(value.`expiresAt`) + - FfiConverterULong.allocationSize(value.`feeTotalSat`) + - FfiConverterULong.allocationSize(value.`orderTotalSat`) + - FfiConverterTypeBolt11Invoice.allocationSize(value.`invoice`) - ) - - override fun write(value: Lsps1Bolt11PaymentInfo, buf: ByteBuffer) { - FfiConverterTypeLSPS1PaymentState.write(value.`state`, buf) - FfiConverterTypeLSPSDateTime.write(value.`expiresAt`, buf) - FfiConverterULong.write(value.`feeTotalSat`, buf) - FfiConverterULong.write(value.`orderTotalSat`, buf) - FfiConverterTypeBolt11Invoice.write(value.`invoice`, buf) - } -} - - - - -object FfiConverterTypeLSPS1ChannelInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Lsps1ChannelInfo { - return Lsps1ChannelInfo( - FfiConverterTypeLSPSDateTime.read(buf), - FfiConverterTypeOutPoint.read(buf), - FfiConverterTypeLSPSDateTime.read(buf), - ) - } - - override fun allocationSize(value: Lsps1ChannelInfo) = ( - FfiConverterTypeLSPSDateTime.allocationSize(value.`fundedAt`) + - FfiConverterTypeOutPoint.allocationSize(value.`fundingOutpoint`) + - FfiConverterTypeLSPSDateTime.allocationSize(value.`expiresAt`) - ) - - override fun write(value: Lsps1ChannelInfo, buf: ByteBuffer) { - FfiConverterTypeLSPSDateTime.write(value.`fundedAt`, buf) - FfiConverterTypeOutPoint.write(value.`fundingOutpoint`, buf) - FfiConverterTypeLSPSDateTime.write(value.`expiresAt`, buf) - } -} - - - - -object FfiConverterTypeLSPS1OnchainPaymentInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Lsps1OnchainPaymentInfo { - return Lsps1OnchainPaymentInfo( - FfiConverterTypeLSPS1PaymentState.read(buf), - FfiConverterTypeLSPSDateTime.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterTypeAddress.read(buf), - FfiConverterOptionalUShort.read(buf), - FfiConverterTypeFeeRate.read(buf), - FfiConverterOptionalTypeAddress.read(buf), - ) - } - - override fun allocationSize(value: Lsps1OnchainPaymentInfo) = ( - FfiConverterTypeLSPS1PaymentState.allocationSize(value.`state`) + - FfiConverterTypeLSPSDateTime.allocationSize(value.`expiresAt`) + - FfiConverterULong.allocationSize(value.`feeTotalSat`) + - FfiConverterULong.allocationSize(value.`orderTotalSat`) + - FfiConverterTypeAddress.allocationSize(value.`address`) + - FfiConverterOptionalUShort.allocationSize(value.`minOnchainPaymentConfirmations`) + - FfiConverterTypeFeeRate.allocationSize(value.`minFeeFor0conf`) + - FfiConverterOptionalTypeAddress.allocationSize(value.`refundOnchainAddress`) - ) - - override fun write(value: Lsps1OnchainPaymentInfo, buf: ByteBuffer) { - FfiConverterTypeLSPS1PaymentState.write(value.`state`, buf) - FfiConverterTypeLSPSDateTime.write(value.`expiresAt`, buf) - FfiConverterULong.write(value.`feeTotalSat`, buf) - FfiConverterULong.write(value.`orderTotalSat`, buf) - FfiConverterTypeAddress.write(value.`address`, buf) - FfiConverterOptionalUShort.write(value.`minOnchainPaymentConfirmations`, buf) - FfiConverterTypeFeeRate.write(value.`minFeeFor0conf`, buf) - FfiConverterOptionalTypeAddress.write(value.`refundOnchainAddress`, buf) - } -} - - - - -object FfiConverterTypeLSPS1OrderParams: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Lsps1OrderParams { - return Lsps1OrderParams( - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterUShort.read(buf), - FfiConverterUShort.read(buf), - FfiConverterUInt.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterBoolean.read(buf), - ) - } - - override fun allocationSize(value: Lsps1OrderParams) = ( - FfiConverterULong.allocationSize(value.`lspBalanceSat`) + - FfiConverterULong.allocationSize(value.`clientBalanceSat`) + - FfiConverterUShort.allocationSize(value.`requiredChannelConfirmations`) + - FfiConverterUShort.allocationSize(value.`fundingConfirmsWithinBlocks`) + - FfiConverterUInt.allocationSize(value.`channelExpiryBlocks`) + - FfiConverterOptionalString.allocationSize(value.`token`) + - FfiConverterBoolean.allocationSize(value.`announceChannel`) - ) - - override fun write(value: Lsps1OrderParams, buf: ByteBuffer) { - FfiConverterULong.write(value.`lspBalanceSat`, buf) - FfiConverterULong.write(value.`clientBalanceSat`, buf) - FfiConverterUShort.write(value.`requiredChannelConfirmations`, buf) - FfiConverterUShort.write(value.`fundingConfirmsWithinBlocks`, buf) - FfiConverterUInt.write(value.`channelExpiryBlocks`, buf) - FfiConverterOptionalString.write(value.`token`, buf) - FfiConverterBoolean.write(value.`announceChannel`, buf) - } -} - - - - -object FfiConverterTypeLSPS1OrderStatus: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Lsps1OrderStatus { - return Lsps1OrderStatus( - FfiConverterTypeLSPS1OrderId.read(buf), - FfiConverterTypeLSPS1OrderParams.read(buf), - FfiConverterTypeLSPS1PaymentInfo.read(buf), - FfiConverterOptionalTypeLSPS1ChannelInfo.read(buf), - ) - } - - override fun allocationSize(value: Lsps1OrderStatus) = ( - FfiConverterTypeLSPS1OrderId.allocationSize(value.`orderId`) + - FfiConverterTypeLSPS1OrderParams.allocationSize(value.`orderParams`) + - FfiConverterTypeLSPS1PaymentInfo.allocationSize(value.`paymentOptions`) + - FfiConverterOptionalTypeLSPS1ChannelInfo.allocationSize(value.`channelState`) - ) - - override fun write(value: Lsps1OrderStatus, buf: ByteBuffer) { - FfiConverterTypeLSPS1OrderId.write(value.`orderId`, buf) - FfiConverterTypeLSPS1OrderParams.write(value.`orderParams`, buf) - FfiConverterTypeLSPS1PaymentInfo.write(value.`paymentOptions`, buf) - FfiConverterOptionalTypeLSPS1ChannelInfo.write(value.`channelState`, buf) - } -} - - - - -object FfiConverterTypeLSPS1PaymentInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Lsps1PaymentInfo { - return Lsps1PaymentInfo( - FfiConverterOptionalTypeLSPS1Bolt11PaymentInfo.read(buf), - FfiConverterOptionalTypeLSPS1OnchainPaymentInfo.read(buf), - ) - } - - override fun allocationSize(value: Lsps1PaymentInfo) = ( - FfiConverterOptionalTypeLSPS1Bolt11PaymentInfo.allocationSize(value.`bolt11`) + - FfiConverterOptionalTypeLSPS1OnchainPaymentInfo.allocationSize(value.`onchain`) - ) - - override fun write(value: Lsps1PaymentInfo, buf: ByteBuffer) { - FfiConverterOptionalTypeLSPS1Bolt11PaymentInfo.write(value.`bolt11`, buf) - FfiConverterOptionalTypeLSPS1OnchainPaymentInfo.write(value.`onchain`, buf) - } -} - - - - -object FfiConverterTypeLSPS2ServiceConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Lsps2ServiceConfig { - return Lsps2ServiceConfig( - FfiConverterOptionalString.read(buf), - FfiConverterBoolean.read(buf), - FfiConverterUInt.read(buf), - FfiConverterUInt.read(buf), - FfiConverterULong.read(buf), - FfiConverterUInt.read(buf), - FfiConverterUInt.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterBoolean.read(buf), - ) - } - - override fun allocationSize(value: Lsps2ServiceConfig) = ( - FfiConverterOptionalString.allocationSize(value.`requireToken`) + - FfiConverterBoolean.allocationSize(value.`advertiseService`) + - FfiConverterUInt.allocationSize(value.`channelOpeningFeePpm`) + - FfiConverterUInt.allocationSize(value.`channelOverProvisioningPpm`) + - FfiConverterULong.allocationSize(value.`minChannelOpeningFeeMsat`) + - FfiConverterUInt.allocationSize(value.`minChannelLifetime`) + - FfiConverterUInt.allocationSize(value.`maxClientToSelfDelay`) + - FfiConverterULong.allocationSize(value.`minPaymentSizeMsat`) + - FfiConverterULong.allocationSize(value.`maxPaymentSizeMsat`) + - FfiConverterBoolean.allocationSize(value.`clientTrustsLsp`) - ) - - override fun write(value: Lsps2ServiceConfig, buf: ByteBuffer) { - FfiConverterOptionalString.write(value.`requireToken`, buf) - FfiConverterBoolean.write(value.`advertiseService`, buf) - FfiConverterUInt.write(value.`channelOpeningFeePpm`, buf) - FfiConverterUInt.write(value.`channelOverProvisioningPpm`, buf) - FfiConverterULong.write(value.`minChannelOpeningFeeMsat`, buf) - FfiConverterUInt.write(value.`minChannelLifetime`, buf) - FfiConverterUInt.write(value.`maxClientToSelfDelay`, buf) - FfiConverterULong.write(value.`minPaymentSizeMsat`, buf) - FfiConverterULong.write(value.`maxPaymentSizeMsat`, buf) - FfiConverterBoolean.write(value.`clientTrustsLsp`, buf) - } -} - - - - -object FfiConverterTypeLogRecord: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): LogRecord { - return LogRecord( - FfiConverterTypeLogLevel.read(buf), - FfiConverterString.read(buf), - FfiConverterString.read(buf), - FfiConverterUInt.read(buf), - ) - } - - override fun allocationSize(value: LogRecord) = ( - FfiConverterTypeLogLevel.allocationSize(value.`level`) + - FfiConverterString.allocationSize(value.`args`) + - FfiConverterString.allocationSize(value.`modulePath`) + - FfiConverterUInt.allocationSize(value.`line`) - ) - - override fun write(value: LogRecord, buf: ByteBuffer) { - FfiConverterTypeLogLevel.write(value.`level`, buf) - FfiConverterString.write(value.`args`, buf) - FfiConverterString.write(value.`modulePath`, buf) - FfiConverterUInt.write(value.`line`, buf) - } -} - - - - -object FfiConverterTypeNodeAnnouncementInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): NodeAnnouncementInfo { - return NodeAnnouncementInfo( - FfiConverterUInt.read(buf), - FfiConverterString.read(buf), - FfiConverterSequenceTypeSocketAddress.read(buf), - ) - } - - override fun allocationSize(value: NodeAnnouncementInfo) = ( - FfiConverterUInt.allocationSize(value.`lastUpdate`) + - FfiConverterString.allocationSize(value.`alias`) + - FfiConverterSequenceTypeSocketAddress.allocationSize(value.`addresses`) - ) - - override fun write(value: NodeAnnouncementInfo, buf: ByteBuffer) { - FfiConverterUInt.write(value.`lastUpdate`, buf) - FfiConverterString.write(value.`alias`, buf) - FfiConverterSequenceTypeSocketAddress.write(value.`addresses`, buf) - } -} - - - - -object FfiConverterTypeNodeInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): NodeInfo { - return NodeInfo( - FfiConverterSequenceULong.read(buf), - FfiConverterOptionalTypeNodeAnnouncementInfo.read(buf), - ) - } - - override fun allocationSize(value: NodeInfo) = ( - FfiConverterSequenceULong.allocationSize(value.`channels`) + - FfiConverterOptionalTypeNodeAnnouncementInfo.allocationSize(value.`announcementInfo`) - ) - - override fun write(value: NodeInfo, buf: ByteBuffer) { - FfiConverterSequenceULong.write(value.`channels`, buf) - FfiConverterOptionalTypeNodeAnnouncementInfo.write(value.`announcementInfo`, buf) - } -} - - - - -object FfiConverterTypeNodeStatus: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): NodeStatus { - return NodeStatus( - FfiConverterBoolean.read(buf), - FfiConverterTypeBestBlock.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalUInt.read(buf), - ) - } - - override fun allocationSize(value: NodeStatus) = ( - FfiConverterBoolean.allocationSize(value.`isRunning`) + - FfiConverterTypeBestBlock.allocationSize(value.`currentBestBlock`) + - FfiConverterOptionalULong.allocationSize(value.`latestLightningWalletSyncTimestamp`) + - FfiConverterOptionalULong.allocationSize(value.`latestOnchainWalletSyncTimestamp`) + - FfiConverterOptionalULong.allocationSize(value.`latestFeeRateCacheUpdateTimestamp`) + - FfiConverterOptionalULong.allocationSize(value.`latestRgsSnapshotTimestamp`) + - FfiConverterOptionalULong.allocationSize(value.`latestPathfindingScoresSyncTimestamp`) + - FfiConverterOptionalULong.allocationSize(value.`latestNodeAnnouncementBroadcastTimestamp`) + - FfiConverterOptionalUInt.allocationSize(value.`latestChannelMonitorArchivalHeight`) - ) - - override fun write(value: NodeStatus, buf: ByteBuffer) { - FfiConverterBoolean.write(value.`isRunning`, buf) - FfiConverterTypeBestBlock.write(value.`currentBestBlock`, buf) - FfiConverterOptionalULong.write(value.`latestLightningWalletSyncTimestamp`, buf) - FfiConverterOptionalULong.write(value.`latestOnchainWalletSyncTimestamp`, buf) - FfiConverterOptionalULong.write(value.`latestFeeRateCacheUpdateTimestamp`, buf) - FfiConverterOptionalULong.write(value.`latestRgsSnapshotTimestamp`, buf) - FfiConverterOptionalULong.write(value.`latestPathfindingScoresSyncTimestamp`, buf) - FfiConverterOptionalULong.write(value.`latestNodeAnnouncementBroadcastTimestamp`, buf) - FfiConverterOptionalUInt.write(value.`latestChannelMonitorArchivalHeight`, buf) - } -} - - - - -object FfiConverterTypeOnchainWalletAccount: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): OnchainWalletAccount { - return OnchainWalletAccount( - FfiConverterTypeAddressType.read(buf), - FfiConverterUInt.read(buf), - ) - } - - override fun allocationSize(value: OnchainWalletAccount) = ( - FfiConverterTypeAddressType.allocationSize(value.`addressType`) + - FfiConverterUInt.allocationSize(value.`accountIndex`) - ) - - override fun write(value: OnchainWalletAccount, buf: ByteBuffer) { - FfiConverterTypeAddressType.write(value.`addressType`, buf) - FfiConverterUInt.write(value.`accountIndex`, buf) - } -} - - - - -object FfiConverterTypeOnchainWalletAccountConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): OnchainWalletAccountConfig { - return OnchainWalletAccountConfig( - FfiConverterTypeAddressType.read(buf), - FfiConverterUInt.read(buf), - FfiConverterString.read(buf), - ) - } - - override fun allocationSize(value: OnchainWalletAccountConfig) = ( - FfiConverterTypeAddressType.allocationSize(value.`addressType`) + - FfiConverterUInt.allocationSize(value.`accountIndex`) + - FfiConverterString.allocationSize(value.`xpub`) - ) - - override fun write(value: OnchainWalletAccountConfig, buf: ByteBuffer) { - FfiConverterTypeAddressType.write(value.`addressType`, buf) - FfiConverterUInt.write(value.`accountIndex`, buf) - FfiConverterString.write(value.`xpub`, buf) - } -} - - - - -object FfiConverterTypeOutPoint: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): OutPoint { - return OutPoint( - FfiConverterTypeTxid.read(buf), - FfiConverterUInt.read(buf), - ) - } - - override fun allocationSize(value: OutPoint) = ( - FfiConverterTypeTxid.allocationSize(value.`txid`) + - FfiConverterUInt.allocationSize(value.`vout`) - ) - - override fun write(value: OutPoint, buf: ByteBuffer) { - FfiConverterTypeTxid.write(value.`txid`, buf) - FfiConverterUInt.write(value.`vout`, buf) - } -} - - - - -object FfiConverterTypePaymentDetails: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): PaymentDetails { - return PaymentDetails( - FfiConverterTypePaymentId.read(buf), - FfiConverterTypePaymentKind.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterTypePaymentDirection.read(buf), - FfiConverterTypePaymentStatus.read(buf), - FfiConverterULong.read(buf), - ) - } - - override fun allocationSize(value: PaymentDetails) = ( - FfiConverterTypePaymentId.allocationSize(value.`id`) + - FfiConverterTypePaymentKind.allocationSize(value.`kind`) + - FfiConverterOptionalULong.allocationSize(value.`amountMsat`) + - FfiConverterOptionalULong.allocationSize(value.`feePaidMsat`) + - FfiConverterTypePaymentDirection.allocationSize(value.`direction`) + - FfiConverterTypePaymentStatus.allocationSize(value.`status`) + - FfiConverterULong.allocationSize(value.`latestUpdateTimestamp`) - ) - - override fun write(value: PaymentDetails, buf: ByteBuffer) { - FfiConverterTypePaymentId.write(value.`id`, buf) - FfiConverterTypePaymentKind.write(value.`kind`, buf) - FfiConverterOptionalULong.write(value.`amountMsat`, buf) - FfiConverterOptionalULong.write(value.`feePaidMsat`, buf) - FfiConverterTypePaymentDirection.write(value.`direction`, buf) - FfiConverterTypePaymentStatus.write(value.`status`, buf) - FfiConverterULong.write(value.`latestUpdateTimestamp`, buf) - } -} - - - - -object FfiConverterTypePeerDetails: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): PeerDetails { - return PeerDetails( - FfiConverterTypePublicKey.read(buf), - FfiConverterTypeSocketAddress.read(buf), - FfiConverterBoolean.read(buf), - FfiConverterBoolean.read(buf), - ) - } - - override fun allocationSize(value: PeerDetails) = ( - FfiConverterTypePublicKey.allocationSize(value.`nodeId`) + - FfiConverterTypeSocketAddress.allocationSize(value.`address`) + - FfiConverterBoolean.allocationSize(value.`isPersisted`) + - FfiConverterBoolean.allocationSize(value.`isConnected`) - ) - - override fun write(value: PeerDetails, buf: ByteBuffer) { - FfiConverterTypePublicKey.write(value.`nodeId`, buf) - FfiConverterTypeSocketAddress.write(value.`address`, buf) - FfiConverterBoolean.write(value.`isPersisted`, buf) - FfiConverterBoolean.write(value.`isConnected`, buf) - } -} - - - - -object FfiConverterTypeProbeHandle: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ProbeHandle { - return ProbeHandle( - FfiConverterTypePaymentHash.read(buf), - FfiConverterTypePaymentId.read(buf), - ) - } - - override fun allocationSize(value: ProbeHandle) = ( - FfiConverterTypePaymentHash.allocationSize(value.`paymentHash`) + - FfiConverterTypePaymentId.allocationSize(value.`paymentId`) - ) - - override fun write(value: ProbeHandle, buf: ByteBuffer) { - FfiConverterTypePaymentHash.write(value.`paymentHash`, buf) - FfiConverterTypePaymentId.write(value.`paymentId`, buf) - } -} - - - - -object FfiConverterTypeRouteHintHop: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): RouteHintHop { - return RouteHintHop( - FfiConverterTypePublicKey.read(buf), - FfiConverterULong.read(buf), - FfiConverterUShort.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterTypeRoutingFees.read(buf), - ) - } - - override fun allocationSize(value: RouteHintHop) = ( - FfiConverterTypePublicKey.allocationSize(value.`srcNodeId`) + - FfiConverterULong.allocationSize(value.`shortChannelId`) + - FfiConverterUShort.allocationSize(value.`cltvExpiryDelta`) + - FfiConverterOptionalULong.allocationSize(value.`htlcMinimumMsat`) + - FfiConverterOptionalULong.allocationSize(value.`htlcMaximumMsat`) + - FfiConverterTypeRoutingFees.allocationSize(value.`fees`) - ) - - override fun write(value: RouteHintHop, buf: ByteBuffer) { - FfiConverterTypePublicKey.write(value.`srcNodeId`, buf) - FfiConverterULong.write(value.`shortChannelId`, buf) - FfiConverterUShort.write(value.`cltvExpiryDelta`, buf) - FfiConverterOptionalULong.write(value.`htlcMinimumMsat`, buf) - FfiConverterOptionalULong.write(value.`htlcMaximumMsat`, buf) - FfiConverterTypeRoutingFees.write(value.`fees`, buf) - } -} - - - - -object FfiConverterTypeRouteParametersConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): RouteParametersConfig { - return RouteParametersConfig( - FfiConverterOptionalULong.read(buf), - FfiConverterUInt.read(buf), - FfiConverterUByte.read(buf), - FfiConverterUByte.read(buf), - ) - } - - override fun allocationSize(value: RouteParametersConfig) = ( - FfiConverterOptionalULong.allocationSize(value.`maxTotalRoutingFeeMsat`) + - FfiConverterUInt.allocationSize(value.`maxTotalCltvExpiryDelta`) + - FfiConverterUByte.allocationSize(value.`maxPathCount`) + - FfiConverterUByte.allocationSize(value.`maxChannelSaturationPowerOfHalf`) - ) - - override fun write(value: RouteParametersConfig, buf: ByteBuffer) { - FfiConverterOptionalULong.write(value.`maxTotalRoutingFeeMsat`, buf) - FfiConverterUInt.write(value.`maxTotalCltvExpiryDelta`, buf) - FfiConverterUByte.write(value.`maxPathCount`, buf) - FfiConverterUByte.write(value.`maxChannelSaturationPowerOfHalf`, buf) - } -} - - - - -object FfiConverterTypeRoutingFees: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): RoutingFees { - return RoutingFees( - FfiConverterUInt.read(buf), - FfiConverterUInt.read(buf), - ) - } - - override fun allocationSize(value: RoutingFees) = ( - FfiConverterUInt.allocationSize(value.`baseMsat`) + - FfiConverterUInt.allocationSize(value.`proportionalMillionths`) - ) - - override fun write(value: RoutingFees, buf: ByteBuffer) { - FfiConverterUInt.write(value.`baseMsat`, buf) - FfiConverterUInt.write(value.`proportionalMillionths`, buf) - } -} - - - - -object FfiConverterTypeRuntimeSyncIntervals: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): RuntimeSyncIntervals { - return RuntimeSyncIntervals( - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - ) - } - - override fun allocationSize(value: RuntimeSyncIntervals) = ( - FfiConverterULong.allocationSize(value.`onchainWalletSyncIntervalSecs`) + - FfiConverterULong.allocationSize(value.`lightningWalletSyncIntervalSecs`) + - FfiConverterULong.allocationSize(value.`feeRateCacheUpdateIntervalSecs`) - ) - - override fun write(value: RuntimeSyncIntervals, buf: ByteBuffer) { - FfiConverterULong.write(value.`onchainWalletSyncIntervalSecs`, buf) - FfiConverterULong.write(value.`lightningWalletSyncIntervalSecs`, buf) - FfiConverterULong.write(value.`feeRateCacheUpdateIntervalSecs`, buf) - } -} - - - - -object FfiConverterTypeScoringDecayParameters: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ScoringDecayParameters { - return ScoringDecayParameters( - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - ) - } - - override fun allocationSize(value: ScoringDecayParameters) = ( - FfiConverterULong.allocationSize(value.`historicalNoUpdatesHalfLifeSecs`) + - FfiConverterULong.allocationSize(value.`liquidityOffsetHalfLifeSecs`) - ) - - override fun write(value: ScoringDecayParameters, buf: ByteBuffer) { - FfiConverterULong.write(value.`historicalNoUpdatesHalfLifeSecs`, buf) - FfiConverterULong.write(value.`liquidityOffsetHalfLifeSecs`, buf) - } -} - - - - -object FfiConverterTypeScoringFeeParameters: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ScoringFeeParameters { - return ScoringFeeParameters( - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterBoolean.read(buf), - FfiConverterULong.read(buf), - ) - } - - override fun allocationSize(value: ScoringFeeParameters) = ( - FfiConverterULong.allocationSize(value.`basePenaltyMsat`) + - FfiConverterULong.allocationSize(value.`basePenaltyAmountMultiplierMsat`) + - FfiConverterULong.allocationSize(value.`liquidityPenaltyMultiplierMsat`) + - FfiConverterULong.allocationSize(value.`liquidityPenaltyAmountMultiplierMsat`) + - FfiConverterULong.allocationSize(value.`historicalLiquidityPenaltyMultiplierMsat`) + - FfiConverterULong.allocationSize(value.`historicalLiquidityPenaltyAmountMultiplierMsat`) + - FfiConverterULong.allocationSize(value.`antiProbingPenaltyMsat`) + - FfiConverterULong.allocationSize(value.`consideredImpossiblePenaltyMsat`) + - FfiConverterBoolean.allocationSize(value.`linearSuccessProbability`) + - FfiConverterULong.allocationSize(value.`probingDiversityPenaltyMsat`) - ) - - override fun write(value: ScoringFeeParameters, buf: ByteBuffer) { - FfiConverterULong.write(value.`basePenaltyMsat`, buf) - FfiConverterULong.write(value.`basePenaltyAmountMultiplierMsat`, buf) - FfiConverterULong.write(value.`liquidityPenaltyMultiplierMsat`, buf) - FfiConverterULong.write(value.`liquidityPenaltyAmountMultiplierMsat`, buf) - FfiConverterULong.write(value.`historicalLiquidityPenaltyMultiplierMsat`, buf) - FfiConverterULong.write(value.`historicalLiquidityPenaltyAmountMultiplierMsat`, buf) - FfiConverterULong.write(value.`antiProbingPenaltyMsat`, buf) - FfiConverterULong.write(value.`consideredImpossiblePenaltyMsat`, buf) - FfiConverterBoolean.write(value.`linearSuccessProbability`, buf) - FfiConverterULong.write(value.`probingDiversityPenaltyMsat`, buf) - } -} - - - - -object FfiConverterTypeSpendableUtxo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): SpendableUtxo { - return SpendableUtxo( - FfiConverterTypeOutPoint.read(buf), - FfiConverterULong.read(buf), - ) - } - - override fun allocationSize(value: SpendableUtxo) = ( - FfiConverterTypeOutPoint.allocationSize(value.`outpoint`) + - FfiConverterULong.allocationSize(value.`valueSats`) - ) - - override fun write(value: SpendableUtxo, buf: ByteBuffer) { - FfiConverterTypeOutPoint.write(value.`outpoint`, buf) - FfiConverterULong.write(value.`valueSats`, buf) - } -} - - - - -object FfiConverterTypeTransactionDetails: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): TransactionDetails { - return TransactionDetails( - FfiConverterLong.read(buf), - FfiConverterSequenceTypeTxInput.read(buf), - FfiConverterSequenceTypeTxOutput.read(buf), - ) - } - - override fun allocationSize(value: TransactionDetails) = ( - FfiConverterLong.allocationSize(value.`amountSats`) + - FfiConverterSequenceTypeTxInput.allocationSize(value.`inputs`) + - FfiConverterSequenceTypeTxOutput.allocationSize(value.`outputs`) - ) - - override fun write(value: TransactionDetails, buf: ByteBuffer) { - FfiConverterLong.write(value.`amountSats`, buf) - FfiConverterSequenceTypeTxInput.write(value.`inputs`, buf) - FfiConverterSequenceTypeTxOutput.write(value.`outputs`, buf) - } -} - - - - -object FfiConverterTypeTxInput: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): TxInput { - return TxInput( - FfiConverterTypeTxid.read(buf), - FfiConverterUInt.read(buf), - FfiConverterString.read(buf), - FfiConverterSequenceString.read(buf), - FfiConverterUInt.read(buf), - ) - } - - override fun allocationSize(value: TxInput) = ( - FfiConverterTypeTxid.allocationSize(value.`txid`) + - FfiConverterUInt.allocationSize(value.`vout`) + - FfiConverterString.allocationSize(value.`scriptsig`) + - FfiConverterSequenceString.allocationSize(value.`witness`) + - FfiConverterUInt.allocationSize(value.`sequence`) - ) - - override fun write(value: TxInput, buf: ByteBuffer) { - FfiConverterTypeTxid.write(value.`txid`, buf) - FfiConverterUInt.write(value.`vout`, buf) - FfiConverterString.write(value.`scriptsig`, buf) - FfiConverterSequenceString.write(value.`witness`, buf) - FfiConverterUInt.write(value.`sequence`, buf) - } -} - - - - -object FfiConverterTypeTxOutput: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): TxOutput { - return TxOutput( - FfiConverterString.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterLong.read(buf), - FfiConverterUInt.read(buf), - ) - } - - override fun allocationSize(value: TxOutput) = ( - FfiConverterString.allocationSize(value.`scriptpubkey`) + - FfiConverterOptionalString.allocationSize(value.`scriptpubkeyType`) + - FfiConverterOptionalString.allocationSize(value.`scriptpubkeyAddress`) + - FfiConverterLong.allocationSize(value.`value`) + - FfiConverterUInt.allocationSize(value.`n`) - ) - - override fun write(value: TxOutput, buf: ByteBuffer) { - FfiConverterString.write(value.`scriptpubkey`, buf) - FfiConverterOptionalString.write(value.`scriptpubkeyType`, buf) - FfiConverterOptionalString.write(value.`scriptpubkeyAddress`, buf) - FfiConverterLong.write(value.`value`, buf) - FfiConverterUInt.write(value.`n`, buf) - } -} - - - - - -object FfiConverterTypeAddressType: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - AddressType.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: AddressType) = 4UL - - override fun write(value: AddressType, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - - -object FfiConverterTypeAsyncPaymentsRole: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - AsyncPaymentsRole.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: AsyncPaymentsRole) = 4UL - - override fun write(value: AsyncPaymentsRole, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - - -object FfiConverterTypeBalanceSource: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - BalanceSource.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: BalanceSource) = 4UL - - override fun write(value: BalanceSource, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - - -object FfiConverterTypeBolt11InvoiceDescription : FfiConverterRustBuffer{ - override fun read(buf: ByteBuffer): Bolt11InvoiceDescription { - return when(buf.getInt()) { - 1 -> Bolt11InvoiceDescription.Hash( - FfiConverterString.read(buf), - ) - 2 -> Bolt11InvoiceDescription.Direct( - FfiConverterString.read(buf), - ) - else -> throw RuntimeException("invalid enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: Bolt11InvoiceDescription) = when(value) { - is Bolt11InvoiceDescription.Hash -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterString.allocationSize(value.`hash`) - ) - } - is Bolt11InvoiceDescription.Direct -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterString.allocationSize(value.`description`) - ) - } - } - - override fun write(value: Bolt11InvoiceDescription, buf: ByteBuffer) { - when(value) { - is Bolt11InvoiceDescription.Hash -> { - buf.putInt(1) - FfiConverterString.write(value.`hash`, buf) - Unit - } - is Bolt11InvoiceDescription.Direct -> { - buf.putInt(2) - FfiConverterString.write(value.`description`, buf) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - -object BuildExceptionErrorHandler : UniffiRustCallStatusErrorHandler { - override fun lift(errorBuf: RustBufferByValue): BuildException = FfiConverterTypeBuildError.lift(errorBuf) -} - -object FfiConverterTypeBuildError : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): BuildException { - return when (buf.getInt()) { - 1 -> BuildException.InvalidSeedBytes(FfiConverterString.read(buf)) - 2 -> BuildException.InvalidSeedFile(FfiConverterString.read(buf)) - 3 -> BuildException.InvalidSystemTime(FfiConverterString.read(buf)) - 4 -> BuildException.InvalidChannelMonitor(FfiConverterString.read(buf)) - 5 -> BuildException.InvalidListeningAddresses(FfiConverterString.read(buf)) - 6 -> BuildException.InvalidAnnouncementAddresses(FfiConverterString.read(buf)) - 7 -> BuildException.InvalidNodeAlias(FfiConverterString.read(buf)) - 8 -> BuildException.RuntimeSetupFailed(FfiConverterString.read(buf)) - 9 -> BuildException.ReadFailed(FfiConverterString.read(buf)) - 10 -> BuildException.DangerousValue(FfiConverterString.read(buf)) - 11 -> BuildException.WriteFailed(FfiConverterString.read(buf)) - 12 -> BuildException.StoragePathAccessFailed(FfiConverterString.read(buf)) - 13 -> BuildException.KvStoreSetupFailed(FfiConverterString.read(buf)) - 14 -> BuildException.WalletSetupFailed(FfiConverterString.read(buf)) - 15 -> BuildException.LoggerSetupFailed(FfiConverterString.read(buf)) - 16 -> BuildException.NetworkMismatch(FfiConverterString.read(buf)) - 17 -> BuildException.AsyncPaymentsConfigMismatch(FfiConverterString.read(buf)) - else -> throw RuntimeException("invalid error enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: BuildException): ULong { - return 4UL - } - - override fun write(value: BuildException, buf: ByteBuffer) { - when (value) { - is BuildException.InvalidSeedBytes -> { - buf.putInt(1) - Unit - } - is BuildException.InvalidSeedFile -> { - buf.putInt(2) - Unit - } - is BuildException.InvalidSystemTime -> { - buf.putInt(3) - Unit - } - is BuildException.InvalidChannelMonitor -> { - buf.putInt(4) - Unit - } - is BuildException.InvalidListeningAddresses -> { - buf.putInt(5) - Unit - } - is BuildException.InvalidAnnouncementAddresses -> { - buf.putInt(6) - Unit - } - is BuildException.InvalidNodeAlias -> { - buf.putInt(7) - Unit - } - is BuildException.RuntimeSetupFailed -> { - buf.putInt(8) - Unit - } - is BuildException.ReadFailed -> { - buf.putInt(9) - Unit - } - is BuildException.DangerousValue -> { - buf.putInt(10) - Unit - } - is BuildException.WriteFailed -> { - buf.putInt(11) - Unit - } - is BuildException.StoragePathAccessFailed -> { - buf.putInt(12) - Unit - } - is BuildException.KvStoreSetupFailed -> { - buf.putInt(13) - Unit - } - is BuildException.WalletSetupFailed -> { - buf.putInt(14) - Unit - } - is BuildException.LoggerSetupFailed -> { - buf.putInt(15) - Unit - } - is BuildException.NetworkMismatch -> { - buf.putInt(16) - Unit - } - is BuildException.AsyncPaymentsConfigMismatch -> { - buf.putInt(17) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - - -object FfiConverterTypeClosureReason : FfiConverterRustBuffer{ - override fun read(buf: ByteBuffer): ClosureReason { - return when(buf.getInt()) { - 1 -> ClosureReason.CounterpartyForceClosed( - FfiConverterTypeUntrustedString.read(buf), - ) - 2 -> ClosureReason.HolderForceClosed( - FfiConverterOptionalBoolean.read(buf), - FfiConverterString.read(buf), - ) - 3 -> ClosureReason.LegacyCooperativeClosure - 4 -> ClosureReason.CounterpartyInitiatedCooperativeClosure - 5 -> ClosureReason.LocallyInitiatedCooperativeClosure - 6 -> ClosureReason.CommitmentTxConfirmed - 7 -> ClosureReason.FundingTimedOut - 8 -> ClosureReason.ProcessingError( - FfiConverterString.read(buf), - ) - 9 -> ClosureReason.DisconnectedPeer - 10 -> ClosureReason.OutdatedChannelManager - 11 -> ClosureReason.CounterpartyCoopClosedUnfundedChannel - 12 -> ClosureReason.LocallyCoopClosedUnfundedChannel - 13 -> ClosureReason.FundingBatchClosure - 14 -> ClosureReason.HtlCsTimedOut( - FfiConverterOptionalTypePaymentHash.read(buf), - ) - 15 -> ClosureReason.PeerFeerateTooLow( - FfiConverterUInt.read(buf), - FfiConverterUInt.read(buf), - ) - else -> throw RuntimeException("invalid enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: ClosureReason) = when(value) { - is ClosureReason.CounterpartyForceClosed -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeUntrustedString.allocationSize(value.`peerMsg`) - ) - } - is ClosureReason.HolderForceClosed -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterOptionalBoolean.allocationSize(value.`broadcastedLatestTxn`) - + FfiConverterString.allocationSize(value.`message`) - ) - } - is ClosureReason.LegacyCooperativeClosure -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - ) - } - is ClosureReason.CounterpartyInitiatedCooperativeClosure -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - ) - } - is ClosureReason.LocallyInitiatedCooperativeClosure -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - ) - } - is ClosureReason.CommitmentTxConfirmed -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - ) - } - is ClosureReason.FundingTimedOut -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - ) - } - is ClosureReason.ProcessingError -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterString.allocationSize(value.`err`) - ) - } - is ClosureReason.DisconnectedPeer -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - ) - } - is ClosureReason.OutdatedChannelManager -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - ) - } - is ClosureReason.CounterpartyCoopClosedUnfundedChannel -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - ) - } - is ClosureReason.LocallyCoopClosedUnfundedChannel -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - ) - } - is ClosureReason.FundingBatchClosure -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - ) - } - is ClosureReason.HtlCsTimedOut -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterOptionalTypePaymentHash.allocationSize(value.`paymentHash`) - ) - } - is ClosureReason.PeerFeerateTooLow -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterUInt.allocationSize(value.`peerFeerateSatPerKw`) - + FfiConverterUInt.allocationSize(value.`requiredFeerateSatPerKw`) - ) - } - } - - override fun write(value: ClosureReason, buf: ByteBuffer) { - when(value) { - is ClosureReason.CounterpartyForceClosed -> { - buf.putInt(1) - FfiConverterTypeUntrustedString.write(value.`peerMsg`, buf) - Unit - } - is ClosureReason.HolderForceClosed -> { - buf.putInt(2) - FfiConverterOptionalBoolean.write(value.`broadcastedLatestTxn`, buf) - FfiConverterString.write(value.`message`, buf) - Unit - } - is ClosureReason.LegacyCooperativeClosure -> { - buf.putInt(3) - Unit - } - is ClosureReason.CounterpartyInitiatedCooperativeClosure -> { - buf.putInt(4) - Unit - } - is ClosureReason.LocallyInitiatedCooperativeClosure -> { - buf.putInt(5) - Unit - } - is ClosureReason.CommitmentTxConfirmed -> { - buf.putInt(6) - Unit - } - is ClosureReason.FundingTimedOut -> { - buf.putInt(7) - Unit - } - is ClosureReason.ProcessingError -> { - buf.putInt(8) - FfiConverterString.write(value.`err`, buf) - Unit - } - is ClosureReason.DisconnectedPeer -> { - buf.putInt(9) - Unit - } - is ClosureReason.OutdatedChannelManager -> { - buf.putInt(10) - Unit - } - is ClosureReason.CounterpartyCoopClosedUnfundedChannel -> { - buf.putInt(11) - Unit - } - is ClosureReason.LocallyCoopClosedUnfundedChannel -> { - buf.putInt(12) - Unit - } - is ClosureReason.FundingBatchClosure -> { - buf.putInt(13) - Unit - } - is ClosureReason.HtlCsTimedOut -> { - buf.putInt(14) - FfiConverterOptionalTypePaymentHash.write(value.`paymentHash`, buf) - Unit - } - is ClosureReason.PeerFeerateTooLow -> { - buf.putInt(15) - FfiConverterUInt.write(value.`peerFeerateSatPerKw`, buf) - FfiConverterUInt.write(value.`requiredFeerateSatPerKw`, buf) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - - -object FfiConverterTypeCoinSelectionAlgorithm: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - CoinSelectionAlgorithm.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: CoinSelectionAlgorithm) = 4UL - - override fun write(value: CoinSelectionAlgorithm, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - - -object FfiConverterTypeConfirmationStatus : FfiConverterRustBuffer{ - override fun read(buf: ByteBuffer): ConfirmationStatus { - return when(buf.getInt()) { - 1 -> ConfirmationStatus.Confirmed( - FfiConverterTypeBlockHash.read(buf), - FfiConverterUInt.read(buf), - FfiConverterULong.read(buf), - ) - 2 -> ConfirmationStatus.Unconfirmed - else -> throw RuntimeException("invalid enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: ConfirmationStatus) = when(value) { - is ConfirmationStatus.Confirmed -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeBlockHash.allocationSize(value.`blockHash`) - + FfiConverterUInt.allocationSize(value.`height`) - + FfiConverterULong.allocationSize(value.`timestamp`) - ) - } - is ConfirmationStatus.Unconfirmed -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - ) - } - } - - override fun write(value: ConfirmationStatus, buf: ByteBuffer) { - when(value) { - is ConfirmationStatus.Confirmed -> { - buf.putInt(1) - FfiConverterTypeBlockHash.write(value.`blockHash`, buf) - FfiConverterUInt.write(value.`height`, buf) - FfiConverterULong.write(value.`timestamp`, buf) - Unit - } - is ConfirmationStatus.Unconfirmed -> { - buf.putInt(2) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - - -object FfiConverterTypeCurrency: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - Currency.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: Currency) = 4UL - - override fun write(value: Currency, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - - -object FfiConverterTypeEvent : FfiConverterRustBuffer{ - override fun read(buf: ByteBuffer): Event { - return when(buf.getInt()) { - 1 -> Event.PaymentSuccessful( - FfiConverterOptionalTypePaymentId.read(buf), - FfiConverterTypePaymentHash.read(buf), - FfiConverterOptionalTypePaymentPreimage.read(buf), - FfiConverterOptionalULong.read(buf), - ) - 2 -> Event.PaymentFailed( - FfiConverterOptionalTypePaymentId.read(buf), - FfiConverterOptionalTypePaymentHash.read(buf), - FfiConverterOptionalTypePaymentFailureReason.read(buf), - ) - 3 -> Event.PaymentReceived( - FfiConverterOptionalTypePaymentId.read(buf), - FfiConverterTypePaymentHash.read(buf), - FfiConverterULong.read(buf), - FfiConverterSequenceTypeCustomTlvRecord.read(buf), - ) - 4 -> Event.PaymentClaimable( - FfiConverterTypePaymentId.read(buf), - FfiConverterTypePaymentHash.read(buf), - FfiConverterULong.read(buf), - FfiConverterOptionalUInt.read(buf), - FfiConverterSequenceTypeCustomTlvRecord.read(buf), - ) - 5 -> Event.PaymentForwarded( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypeChannelId.read(buf), - FfiConverterOptionalTypeUserChannelId.read(buf), - FfiConverterOptionalTypeUserChannelId.read(buf), - FfiConverterOptionalTypePublicKey.read(buf), - FfiConverterOptionalTypePublicKey.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterBoolean.read(buf), - FfiConverterOptionalULong.read(buf), - ) - 6 -> Event.ProbeSuccessful( - FfiConverterTypePaymentId.read(buf), - FfiConverterTypePaymentHash.read(buf), - FfiConverterOptionalULong.read(buf), - ) - 7 -> Event.ProbeFailed( - FfiConverterTypePaymentId.read(buf), - FfiConverterTypePaymentHash.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - ) - 8 -> Event.ChannelPending( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypeUserChannelId.read(buf), - FfiConverterTypeChannelId.read(buf), - FfiConverterTypePublicKey.read(buf), - FfiConverterTypeOutPoint.read(buf), - ) - 9 -> Event.ChannelReady( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypeUserChannelId.read(buf), - FfiConverterOptionalTypePublicKey.read(buf), - FfiConverterOptionalTypeOutPoint.read(buf), - ) - 10 -> Event.ChannelClosed( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypeUserChannelId.read(buf), - FfiConverterOptionalTypePublicKey.read(buf), - FfiConverterOptionalTypeClosureReason.read(buf), - ) - 11 -> Event.SplicePending( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypeUserChannelId.read(buf), - FfiConverterTypePublicKey.read(buf), - FfiConverterTypeOutPoint.read(buf), - ) - 12 -> Event.SpliceFailed( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypeUserChannelId.read(buf), - FfiConverterTypePublicKey.read(buf), - FfiConverterOptionalTypeOutPoint.read(buf), - ) - 13 -> Event.OnchainTransactionConfirmed( - FfiConverterTypeTxid.read(buf), - FfiConverterTypeBlockHash.read(buf), - FfiConverterUInt.read(buf), - FfiConverterULong.read(buf), - FfiConverterTypeTransactionDetails.read(buf), - ) - 14 -> Event.OnchainTransactionReceived( - FfiConverterTypeTxid.read(buf), - FfiConverterTypeTransactionDetails.read(buf), - ) - 15 -> Event.OnchainTransactionReplaced( - FfiConverterTypeTxid.read(buf), - FfiConverterSequenceTypeTxid.read(buf), - ) - 16 -> Event.OnchainTransactionReorged( - FfiConverterTypeTxid.read(buf), - ) - 17 -> Event.OnchainTransactionEvicted( - FfiConverterTypeTxid.read(buf), - ) - 18 -> Event.SyncProgress( - FfiConverterTypeSyncType.read(buf), - FfiConverterUByte.read(buf), - FfiConverterUInt.read(buf), - FfiConverterUInt.read(buf), - ) - 19 -> Event.SyncCompleted( - FfiConverterTypeSyncType.read(buf), - FfiConverterUInt.read(buf), - ) - 20 -> Event.BalanceChanged( - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - ) - else -> throw RuntimeException("invalid enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: Event) = when(value) { - is Event.PaymentSuccessful -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterOptionalTypePaymentId.allocationSize(value.`paymentId`) - + FfiConverterTypePaymentHash.allocationSize(value.`paymentHash`) - + FfiConverterOptionalTypePaymentPreimage.allocationSize(value.`paymentPreimage`) - + FfiConverterOptionalULong.allocationSize(value.`feePaidMsat`) - ) - } - is Event.PaymentFailed -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterOptionalTypePaymentId.allocationSize(value.`paymentId`) - + FfiConverterOptionalTypePaymentHash.allocationSize(value.`paymentHash`) - + FfiConverterOptionalTypePaymentFailureReason.allocationSize(value.`reason`) - ) - } - is Event.PaymentReceived -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterOptionalTypePaymentId.allocationSize(value.`paymentId`) - + FfiConverterTypePaymentHash.allocationSize(value.`paymentHash`) - + FfiConverterULong.allocationSize(value.`amountMsat`) - + FfiConverterSequenceTypeCustomTlvRecord.allocationSize(value.`customRecords`) - ) - } - is Event.PaymentClaimable -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypePaymentId.allocationSize(value.`paymentId`) - + FfiConverterTypePaymentHash.allocationSize(value.`paymentHash`) - + FfiConverterULong.allocationSize(value.`claimableAmountMsat`) - + FfiConverterOptionalUInt.allocationSize(value.`claimDeadline`) - + FfiConverterSequenceTypeCustomTlvRecord.allocationSize(value.`customRecords`) - ) - } - is Event.PaymentForwarded -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeChannelId.allocationSize(value.`prevChannelId`) - + FfiConverterTypeChannelId.allocationSize(value.`nextChannelId`) - + FfiConverterOptionalTypeUserChannelId.allocationSize(value.`prevUserChannelId`) - + FfiConverterOptionalTypeUserChannelId.allocationSize(value.`nextUserChannelId`) - + FfiConverterOptionalTypePublicKey.allocationSize(value.`prevNodeId`) - + FfiConverterOptionalTypePublicKey.allocationSize(value.`nextNodeId`) - + FfiConverterOptionalULong.allocationSize(value.`totalFeeEarnedMsat`) - + FfiConverterOptionalULong.allocationSize(value.`skimmedFeeMsat`) - + FfiConverterBoolean.allocationSize(value.`claimFromOnchainTx`) - + FfiConverterOptionalULong.allocationSize(value.`outboundAmountForwardedMsat`) - ) - } - is Event.ProbeSuccessful -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypePaymentId.allocationSize(value.`paymentId`) - + FfiConverterTypePaymentHash.allocationSize(value.`paymentHash`) - + FfiConverterOptionalULong.allocationSize(value.`routeFeeMsat`) - ) - } - is Event.ProbeFailed -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypePaymentId.allocationSize(value.`paymentId`) - + FfiConverterTypePaymentHash.allocationSize(value.`paymentHash`) - + FfiConverterOptionalULong.allocationSize(value.`shortChannelId`) - + FfiConverterOptionalULong.allocationSize(value.`routeFeeMsat`) - ) - } - is Event.ChannelPending -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterTypeUserChannelId.allocationSize(value.`userChannelId`) - + FfiConverterTypeChannelId.allocationSize(value.`formerTemporaryChannelId`) - + FfiConverterTypePublicKey.allocationSize(value.`counterpartyNodeId`) - + FfiConverterTypeOutPoint.allocationSize(value.`fundingTxo`) - ) - } - is Event.ChannelReady -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterTypeUserChannelId.allocationSize(value.`userChannelId`) - + FfiConverterOptionalTypePublicKey.allocationSize(value.`counterpartyNodeId`) - + FfiConverterOptionalTypeOutPoint.allocationSize(value.`fundingTxo`) - ) - } - is Event.ChannelClosed -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterTypeUserChannelId.allocationSize(value.`userChannelId`) - + FfiConverterOptionalTypePublicKey.allocationSize(value.`counterpartyNodeId`) - + FfiConverterOptionalTypeClosureReason.allocationSize(value.`reason`) - ) - } - is Event.SplicePending -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterTypeUserChannelId.allocationSize(value.`userChannelId`) - + FfiConverterTypePublicKey.allocationSize(value.`counterpartyNodeId`) - + FfiConverterTypeOutPoint.allocationSize(value.`newFundingTxo`) - ) - } - is Event.SpliceFailed -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterTypeUserChannelId.allocationSize(value.`userChannelId`) - + FfiConverterTypePublicKey.allocationSize(value.`counterpartyNodeId`) - + FfiConverterOptionalTypeOutPoint.allocationSize(value.`abandonedFundingTxo`) - ) - } - is Event.OnchainTransactionConfirmed -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeTxid.allocationSize(value.`txid`) - + FfiConverterTypeBlockHash.allocationSize(value.`blockHash`) - + FfiConverterUInt.allocationSize(value.`blockHeight`) - + FfiConverterULong.allocationSize(value.`confirmationTime`) - + FfiConverterTypeTransactionDetails.allocationSize(value.`details`) - ) - } - is Event.OnchainTransactionReceived -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeTxid.allocationSize(value.`txid`) - + FfiConverterTypeTransactionDetails.allocationSize(value.`details`) - ) - } - is Event.OnchainTransactionReplaced -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeTxid.allocationSize(value.`txid`) - + FfiConverterSequenceTypeTxid.allocationSize(value.`conflicts`) - ) - } - is Event.OnchainTransactionReorged -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeTxid.allocationSize(value.`txid`) - ) - } - is Event.OnchainTransactionEvicted -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeTxid.allocationSize(value.`txid`) - ) - } - is Event.SyncProgress -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeSyncType.allocationSize(value.`syncType`) - + FfiConverterUByte.allocationSize(value.`progressPercent`) - + FfiConverterUInt.allocationSize(value.`currentBlockHeight`) - + FfiConverterUInt.allocationSize(value.`targetBlockHeight`) - ) - } - is Event.SyncCompleted -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeSyncType.allocationSize(value.`syncType`) - + FfiConverterUInt.allocationSize(value.`syncedBlockHeight`) - ) - } - is Event.BalanceChanged -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterULong.allocationSize(value.`oldSpendableOnchainBalanceSats`) - + FfiConverterULong.allocationSize(value.`newSpendableOnchainBalanceSats`) - + FfiConverterULong.allocationSize(value.`oldTotalOnchainBalanceSats`) - + FfiConverterULong.allocationSize(value.`newTotalOnchainBalanceSats`) - + FfiConverterULong.allocationSize(value.`oldTotalLightningBalanceSats`) - + FfiConverterULong.allocationSize(value.`newTotalLightningBalanceSats`) - ) - } - } - - override fun write(value: Event, buf: ByteBuffer) { - when(value) { - is Event.PaymentSuccessful -> { - buf.putInt(1) - FfiConverterOptionalTypePaymentId.write(value.`paymentId`, buf) - FfiConverterTypePaymentHash.write(value.`paymentHash`, buf) - FfiConverterOptionalTypePaymentPreimage.write(value.`paymentPreimage`, buf) - FfiConverterOptionalULong.write(value.`feePaidMsat`, buf) - Unit - } - is Event.PaymentFailed -> { - buf.putInt(2) - FfiConverterOptionalTypePaymentId.write(value.`paymentId`, buf) - FfiConverterOptionalTypePaymentHash.write(value.`paymentHash`, buf) - FfiConverterOptionalTypePaymentFailureReason.write(value.`reason`, buf) - Unit - } - is Event.PaymentReceived -> { - buf.putInt(3) - FfiConverterOptionalTypePaymentId.write(value.`paymentId`, buf) - FfiConverterTypePaymentHash.write(value.`paymentHash`, buf) - FfiConverterULong.write(value.`amountMsat`, buf) - FfiConverterSequenceTypeCustomTlvRecord.write(value.`customRecords`, buf) - Unit - } - is Event.PaymentClaimable -> { - buf.putInt(4) - FfiConverterTypePaymentId.write(value.`paymentId`, buf) - FfiConverterTypePaymentHash.write(value.`paymentHash`, buf) - FfiConverterULong.write(value.`claimableAmountMsat`, buf) - FfiConverterOptionalUInt.write(value.`claimDeadline`, buf) - FfiConverterSequenceTypeCustomTlvRecord.write(value.`customRecords`, buf) - Unit - } - is Event.PaymentForwarded -> { - buf.putInt(5) - FfiConverterTypeChannelId.write(value.`prevChannelId`, buf) - FfiConverterTypeChannelId.write(value.`nextChannelId`, buf) - FfiConverterOptionalTypeUserChannelId.write(value.`prevUserChannelId`, buf) - FfiConverterOptionalTypeUserChannelId.write(value.`nextUserChannelId`, buf) - FfiConverterOptionalTypePublicKey.write(value.`prevNodeId`, buf) - FfiConverterOptionalTypePublicKey.write(value.`nextNodeId`, buf) - FfiConverterOptionalULong.write(value.`totalFeeEarnedMsat`, buf) - FfiConverterOptionalULong.write(value.`skimmedFeeMsat`, buf) - FfiConverterBoolean.write(value.`claimFromOnchainTx`, buf) - FfiConverterOptionalULong.write(value.`outboundAmountForwardedMsat`, buf) - Unit - } - is Event.ProbeSuccessful -> { - buf.putInt(6) - FfiConverterTypePaymentId.write(value.`paymentId`, buf) - FfiConverterTypePaymentHash.write(value.`paymentHash`, buf) - FfiConverterOptionalULong.write(value.`routeFeeMsat`, buf) - Unit - } - is Event.ProbeFailed -> { - buf.putInt(7) - FfiConverterTypePaymentId.write(value.`paymentId`, buf) - FfiConverterTypePaymentHash.write(value.`paymentHash`, buf) - FfiConverterOptionalULong.write(value.`shortChannelId`, buf) - FfiConverterOptionalULong.write(value.`routeFeeMsat`, buf) - Unit - } - is Event.ChannelPending -> { - buf.putInt(8) - FfiConverterTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypeUserChannelId.write(value.`userChannelId`, buf) - FfiConverterTypeChannelId.write(value.`formerTemporaryChannelId`, buf) - FfiConverterTypePublicKey.write(value.`counterpartyNodeId`, buf) - FfiConverterTypeOutPoint.write(value.`fundingTxo`, buf) - Unit - } - is Event.ChannelReady -> { - buf.putInt(9) - FfiConverterTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypeUserChannelId.write(value.`userChannelId`, buf) - FfiConverterOptionalTypePublicKey.write(value.`counterpartyNodeId`, buf) - FfiConverterOptionalTypeOutPoint.write(value.`fundingTxo`, buf) - Unit - } - is Event.ChannelClosed -> { - buf.putInt(10) - FfiConverterTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypeUserChannelId.write(value.`userChannelId`, buf) - FfiConverterOptionalTypePublicKey.write(value.`counterpartyNodeId`, buf) - FfiConverterOptionalTypeClosureReason.write(value.`reason`, buf) - Unit - } - is Event.SplicePending -> { - buf.putInt(11) - FfiConverterTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypeUserChannelId.write(value.`userChannelId`, buf) - FfiConverterTypePublicKey.write(value.`counterpartyNodeId`, buf) - FfiConverterTypeOutPoint.write(value.`newFundingTxo`, buf) - Unit - } - is Event.SpliceFailed -> { - buf.putInt(12) - FfiConverterTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypeUserChannelId.write(value.`userChannelId`, buf) - FfiConverterTypePublicKey.write(value.`counterpartyNodeId`, buf) - FfiConverterOptionalTypeOutPoint.write(value.`abandonedFundingTxo`, buf) - Unit - } - is Event.OnchainTransactionConfirmed -> { - buf.putInt(13) - FfiConverterTypeTxid.write(value.`txid`, buf) - FfiConverterTypeBlockHash.write(value.`blockHash`, buf) - FfiConverterUInt.write(value.`blockHeight`, buf) - FfiConverterULong.write(value.`confirmationTime`, buf) - FfiConverterTypeTransactionDetails.write(value.`details`, buf) - Unit - } - is Event.OnchainTransactionReceived -> { - buf.putInt(14) - FfiConverterTypeTxid.write(value.`txid`, buf) - FfiConverterTypeTransactionDetails.write(value.`details`, buf) - Unit - } - is Event.OnchainTransactionReplaced -> { - buf.putInt(15) - FfiConverterTypeTxid.write(value.`txid`, buf) - FfiConverterSequenceTypeTxid.write(value.`conflicts`, buf) - Unit - } - is Event.OnchainTransactionReorged -> { - buf.putInt(16) - FfiConverterTypeTxid.write(value.`txid`, buf) - Unit - } - is Event.OnchainTransactionEvicted -> { - buf.putInt(17) - FfiConverterTypeTxid.write(value.`txid`, buf) - Unit - } - is Event.SyncProgress -> { - buf.putInt(18) - FfiConverterTypeSyncType.write(value.`syncType`, buf) - FfiConverterUByte.write(value.`progressPercent`, buf) - FfiConverterUInt.write(value.`currentBlockHeight`, buf) - FfiConverterUInt.write(value.`targetBlockHeight`, buf) - Unit - } - is Event.SyncCompleted -> { - buf.putInt(19) - FfiConverterTypeSyncType.write(value.`syncType`, buf) - FfiConverterUInt.write(value.`syncedBlockHeight`, buf) - Unit - } - is Event.BalanceChanged -> { - buf.putInt(20) - FfiConverterULong.write(value.`oldSpendableOnchainBalanceSats`, buf) - FfiConverterULong.write(value.`newSpendableOnchainBalanceSats`, buf) - FfiConverterULong.write(value.`oldTotalOnchainBalanceSats`, buf) - FfiConverterULong.write(value.`newTotalOnchainBalanceSats`, buf) - FfiConverterULong.write(value.`oldTotalLightningBalanceSats`, buf) - FfiConverterULong.write(value.`newTotalLightningBalanceSats`, buf) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - - -object FfiConverterTypeKeychainKind: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - KeychainKind.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: KeychainKind) = 4UL - - override fun write(value: KeychainKind, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - - -object FfiConverterTypeLSPS1PaymentState: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - Lsps1PaymentState.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: Lsps1PaymentState) = 4UL - - override fun write(value: Lsps1PaymentState, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - - -object FfiConverterTypeLightningBalance : FfiConverterRustBuffer{ - override fun read(buf: ByteBuffer): LightningBalance { - return when(buf.getInt()) { - 1 -> LightningBalance.ClaimableOnChannelClose( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypePublicKey.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - ) - 2 -> LightningBalance.ClaimableAwaitingConfirmations( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypePublicKey.read(buf), - FfiConverterULong.read(buf), - FfiConverterUInt.read(buf), - FfiConverterTypeBalanceSource.read(buf), - ) - 3 -> LightningBalance.ContentiousClaimable( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypePublicKey.read(buf), - FfiConverterULong.read(buf), - FfiConverterUInt.read(buf), - FfiConverterTypePaymentHash.read(buf), - FfiConverterTypePaymentPreimage.read(buf), - ) - 4 -> LightningBalance.MaybeTimeoutClaimableHtlc( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypePublicKey.read(buf), - FfiConverterULong.read(buf), - FfiConverterUInt.read(buf), - FfiConverterTypePaymentHash.read(buf), - FfiConverterBoolean.read(buf), - ) - 5 -> LightningBalance.MaybePreimageClaimableHtlc( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypePublicKey.read(buf), - FfiConverterULong.read(buf), - FfiConverterUInt.read(buf), - FfiConverterTypePaymentHash.read(buf), - ) - 6 -> LightningBalance.CounterpartyRevokedOutputClaimable( - FfiConverterTypeChannelId.read(buf), - FfiConverterTypePublicKey.read(buf), - FfiConverterULong.read(buf), - ) - else -> throw RuntimeException("invalid enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: LightningBalance) = when(value) { - is LightningBalance.ClaimableOnChannelClose -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterTypePublicKey.allocationSize(value.`counterpartyNodeId`) - + FfiConverterULong.allocationSize(value.`amountSatoshis`) - + FfiConverterULong.allocationSize(value.`transactionFeeSatoshis`) - + FfiConverterULong.allocationSize(value.`outboundPaymentHtlcRoundedMsat`) - + FfiConverterULong.allocationSize(value.`outboundForwardedHtlcRoundedMsat`) - + FfiConverterULong.allocationSize(value.`inboundClaimingHtlcRoundedMsat`) - + FfiConverterULong.allocationSize(value.`inboundHtlcRoundedMsat`) - ) - } - is LightningBalance.ClaimableAwaitingConfirmations -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterTypePublicKey.allocationSize(value.`counterpartyNodeId`) - + FfiConverterULong.allocationSize(value.`amountSatoshis`) - + FfiConverterUInt.allocationSize(value.`confirmationHeight`) - + FfiConverterTypeBalanceSource.allocationSize(value.`source`) - ) - } - is LightningBalance.ContentiousClaimable -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterTypePublicKey.allocationSize(value.`counterpartyNodeId`) - + FfiConverterULong.allocationSize(value.`amountSatoshis`) - + FfiConverterUInt.allocationSize(value.`timeoutHeight`) - + FfiConverterTypePaymentHash.allocationSize(value.`paymentHash`) - + FfiConverterTypePaymentPreimage.allocationSize(value.`paymentPreimage`) - ) - } - is LightningBalance.MaybeTimeoutClaimableHtlc -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterTypePublicKey.allocationSize(value.`counterpartyNodeId`) - + FfiConverterULong.allocationSize(value.`amountSatoshis`) - + FfiConverterUInt.allocationSize(value.`claimableHeight`) - + FfiConverterTypePaymentHash.allocationSize(value.`paymentHash`) - + FfiConverterBoolean.allocationSize(value.`outboundPayment`) - ) - } - is LightningBalance.MaybePreimageClaimableHtlc -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterTypePublicKey.allocationSize(value.`counterpartyNodeId`) - + FfiConverterULong.allocationSize(value.`amountSatoshis`) - + FfiConverterUInt.allocationSize(value.`expiryHeight`) - + FfiConverterTypePaymentHash.allocationSize(value.`paymentHash`) - ) - } - is LightningBalance.CounterpartyRevokedOutputClaimable -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterTypePublicKey.allocationSize(value.`counterpartyNodeId`) - + FfiConverterULong.allocationSize(value.`amountSatoshis`) - ) - } - } - - override fun write(value: LightningBalance, buf: ByteBuffer) { - when(value) { - is LightningBalance.ClaimableOnChannelClose -> { - buf.putInt(1) - FfiConverterTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypePublicKey.write(value.`counterpartyNodeId`, buf) - FfiConverterULong.write(value.`amountSatoshis`, buf) - FfiConverterULong.write(value.`transactionFeeSatoshis`, buf) - FfiConverterULong.write(value.`outboundPaymentHtlcRoundedMsat`, buf) - FfiConverterULong.write(value.`outboundForwardedHtlcRoundedMsat`, buf) - FfiConverterULong.write(value.`inboundClaimingHtlcRoundedMsat`, buf) - FfiConverterULong.write(value.`inboundHtlcRoundedMsat`, buf) - Unit - } - is LightningBalance.ClaimableAwaitingConfirmations -> { - buf.putInt(2) - FfiConverterTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypePublicKey.write(value.`counterpartyNodeId`, buf) - FfiConverterULong.write(value.`amountSatoshis`, buf) - FfiConverterUInt.write(value.`confirmationHeight`, buf) - FfiConverterTypeBalanceSource.write(value.`source`, buf) - Unit - } - is LightningBalance.ContentiousClaimable -> { - buf.putInt(3) - FfiConverterTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypePublicKey.write(value.`counterpartyNodeId`, buf) - FfiConverterULong.write(value.`amountSatoshis`, buf) - FfiConverterUInt.write(value.`timeoutHeight`, buf) - FfiConverterTypePaymentHash.write(value.`paymentHash`, buf) - FfiConverterTypePaymentPreimage.write(value.`paymentPreimage`, buf) - Unit - } - is LightningBalance.MaybeTimeoutClaimableHtlc -> { - buf.putInt(4) - FfiConverterTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypePublicKey.write(value.`counterpartyNodeId`, buf) - FfiConverterULong.write(value.`amountSatoshis`, buf) - FfiConverterUInt.write(value.`claimableHeight`, buf) - FfiConverterTypePaymentHash.write(value.`paymentHash`, buf) - FfiConverterBoolean.write(value.`outboundPayment`, buf) - Unit - } - is LightningBalance.MaybePreimageClaimableHtlc -> { - buf.putInt(5) - FfiConverterTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypePublicKey.write(value.`counterpartyNodeId`, buf) - FfiConverterULong.write(value.`amountSatoshis`, buf) - FfiConverterUInt.write(value.`expiryHeight`, buf) - FfiConverterTypePaymentHash.write(value.`paymentHash`, buf) - Unit - } - is LightningBalance.CounterpartyRevokedOutputClaimable -> { - buf.putInt(6) - FfiConverterTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypePublicKey.write(value.`counterpartyNodeId`, buf) - FfiConverterULong.write(value.`amountSatoshis`, buf) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - - -object FfiConverterTypeLogLevel: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - LogLevel.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: LogLevel) = 4UL - - override fun write(value: LogLevel, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - - -object FfiConverterTypeMaxDustHTLCExposure : FfiConverterRustBuffer{ - override fun read(buf: ByteBuffer): MaxDustHtlcExposure { - return when(buf.getInt()) { - 1 -> MaxDustHtlcExposure.FixedLimit( - FfiConverterULong.read(buf), - ) - 2 -> MaxDustHtlcExposure.FeeRateMultiplier( - FfiConverterULong.read(buf), - ) - else -> throw RuntimeException("invalid enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: MaxDustHtlcExposure) = when(value) { - is MaxDustHtlcExposure.FixedLimit -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterULong.allocationSize(value.`limitMsat`) - ) - } - is MaxDustHtlcExposure.FeeRateMultiplier -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterULong.allocationSize(value.`multiplier`) - ) - } - } - - override fun write(value: MaxDustHtlcExposure, buf: ByteBuffer) { - when(value) { - is MaxDustHtlcExposure.FixedLimit -> { - buf.putInt(1) - FfiConverterULong.write(value.`limitMsat`, buf) - Unit - } - is MaxDustHtlcExposure.FeeRateMultiplier -> { - buf.putInt(2) - FfiConverterULong.write(value.`multiplier`, buf) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - - -object FfiConverterTypeNetwork: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - Network.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: Network) = 4UL - - override fun write(value: Network, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - -object NodeExceptionErrorHandler : UniffiRustCallStatusErrorHandler { - override fun lift(errorBuf: RustBufferByValue): NodeException = FfiConverterTypeNodeError.lift(errorBuf) -} - -object FfiConverterTypeNodeError : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): NodeException { - return when (buf.getInt()) { - 1 -> NodeException.AlreadyRunning(FfiConverterString.read(buf)) - 2 -> NodeException.NotRunning(FfiConverterString.read(buf)) - 3 -> NodeException.OnchainTxCreationFailed(FfiConverterString.read(buf)) - 4 -> NodeException.ConnectionFailed(FfiConverterString.read(buf)) - 5 -> NodeException.InvoiceCreationFailed(FfiConverterString.read(buf)) - 6 -> NodeException.InvoiceRequestCreationFailed(FfiConverterString.read(buf)) - 7 -> NodeException.OfferCreationFailed(FfiConverterString.read(buf)) - 8 -> NodeException.RefundCreationFailed(FfiConverterString.read(buf)) - 9 -> NodeException.PaymentSendingFailed(FfiConverterString.read(buf)) - 10 -> NodeException.InvalidCustomTlvs(FfiConverterString.read(buf)) - 11 -> NodeException.ProbeSendingFailed(FfiConverterString.read(buf)) - 12 -> NodeException.RouteNotFound(FfiConverterString.read(buf)) - 13 -> NodeException.ChannelCreationFailed(FfiConverterString.read(buf)) - 14 -> NodeException.ChannelClosingFailed(FfiConverterString.read(buf)) - 15 -> NodeException.ChannelSplicingFailed(FfiConverterString.read(buf)) - 16 -> NodeException.ChannelConfigUpdateFailed(FfiConverterString.read(buf)) - 17 -> NodeException.PersistenceFailed(FfiConverterString.read(buf)) - 18 -> NodeException.FeerateEstimationUpdateFailed(FfiConverterString.read(buf)) - 19 -> NodeException.FeerateEstimationUpdateTimeout(FfiConverterString.read(buf)) - 20 -> NodeException.WalletOperationFailed(FfiConverterString.read(buf)) - 21 -> NodeException.WalletOperationTimeout(FfiConverterString.read(buf)) - 22 -> NodeException.OnchainTxSigningFailed(FfiConverterString.read(buf)) - 23 -> NodeException.TxSyncFailed(FfiConverterString.read(buf)) - 24 -> NodeException.TxSyncTimeout(FfiConverterString.read(buf)) - 25 -> NodeException.GossipUpdateFailed(FfiConverterString.read(buf)) - 26 -> NodeException.GossipUpdateTimeout(FfiConverterString.read(buf)) - 27 -> NodeException.LiquidityRequestFailed(FfiConverterString.read(buf)) - 28 -> NodeException.UriParameterParsingFailed(FfiConverterString.read(buf)) - 29 -> NodeException.InvalidAddress(FfiConverterString.read(buf)) - 30 -> NodeException.InvalidSocketAddress(FfiConverterString.read(buf)) - 31 -> NodeException.InvalidPublicKey(FfiConverterString.read(buf)) - 32 -> NodeException.InvalidSecretKey(FfiConverterString.read(buf)) - 33 -> NodeException.InvalidOfferId(FfiConverterString.read(buf)) - 34 -> NodeException.InvalidNodeId(FfiConverterString.read(buf)) - 35 -> NodeException.InvalidPaymentId(FfiConverterString.read(buf)) - 36 -> NodeException.InvalidPaymentHash(FfiConverterString.read(buf)) - 37 -> NodeException.InvalidPaymentPreimage(FfiConverterString.read(buf)) - 38 -> NodeException.InvalidPaymentSecret(FfiConverterString.read(buf)) - 39 -> NodeException.InvalidAmount(FfiConverterString.read(buf)) - 40 -> NodeException.InvalidInvoice(FfiConverterString.read(buf)) - 41 -> NodeException.InvalidOffer(FfiConverterString.read(buf)) - 42 -> NodeException.InvalidRefund(FfiConverterString.read(buf)) - 43 -> NodeException.InvalidChannelId(FfiConverterString.read(buf)) - 44 -> NodeException.InvalidNetwork(FfiConverterString.read(buf)) - 45 -> NodeException.InvalidUri(FfiConverterString.read(buf)) - 46 -> NodeException.InvalidQuantity(FfiConverterString.read(buf)) - 47 -> NodeException.InvalidNodeAlias(FfiConverterString.read(buf)) - 48 -> NodeException.InvalidDateTime(FfiConverterString.read(buf)) - 49 -> NodeException.InvalidFeeRate(FfiConverterString.read(buf)) - 50 -> NodeException.DuplicatePayment(FfiConverterString.read(buf)) - 51 -> NodeException.UnsupportedCurrency(FfiConverterString.read(buf)) - 52 -> NodeException.InsufficientFunds(FfiConverterString.read(buf)) - 53 -> NodeException.LiquiditySourceUnavailable(FfiConverterString.read(buf)) - 54 -> NodeException.LiquidityFeeTooHigh(FfiConverterString.read(buf)) - 55 -> NodeException.InvalidBlindedPaths(FfiConverterString.read(buf)) - 56 -> NodeException.AsyncPaymentServicesDisabled(FfiConverterString.read(buf)) - 57 -> NodeException.CannotRbfFundingTransaction(FfiConverterString.read(buf)) - 58 -> NodeException.TransactionNotFound(FfiConverterString.read(buf)) - 59 -> NodeException.TransactionAlreadyConfirmed(FfiConverterString.read(buf)) - 60 -> NodeException.NoSpendableOutputs(FfiConverterString.read(buf)) - 61 -> NodeException.CoinSelectionFailed(FfiConverterString.read(buf)) - 62 -> NodeException.InvalidMnemonic(FfiConverterString.read(buf)) - 63 -> NodeException.BackgroundSyncNotEnabled(FfiConverterString.read(buf)) - 64 -> NodeException.AddressTypeAlreadyMonitored(FfiConverterString.read(buf)) - 65 -> NodeException.AddressTypeIsPrimary(FfiConverterString.read(buf)) - 66 -> NodeException.AddressTypeNotMonitored(FfiConverterString.read(buf)) - 67 -> NodeException.OnchainWalletAccountNotRegistered(FfiConverterString.read(buf)) - 68 -> NodeException.InvalidSeedBytes(FfiConverterString.read(buf)) - else -> throw RuntimeException("invalid error enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: NodeException): ULong { - return 4UL - } - - override fun write(value: NodeException, buf: ByteBuffer) { - when (value) { - is NodeException.AlreadyRunning -> { - buf.putInt(1) - Unit - } - is NodeException.NotRunning -> { - buf.putInt(2) - Unit - } - is NodeException.OnchainTxCreationFailed -> { - buf.putInt(3) - Unit - } - is NodeException.ConnectionFailed -> { - buf.putInt(4) - Unit - } - is NodeException.InvoiceCreationFailed -> { - buf.putInt(5) - Unit - } - is NodeException.InvoiceRequestCreationFailed -> { - buf.putInt(6) - Unit - } - is NodeException.OfferCreationFailed -> { - buf.putInt(7) - Unit - } - is NodeException.RefundCreationFailed -> { - buf.putInt(8) - Unit - } - is NodeException.PaymentSendingFailed -> { - buf.putInt(9) - Unit - } - is NodeException.InvalidCustomTlvs -> { - buf.putInt(10) - Unit - } - is NodeException.ProbeSendingFailed -> { - buf.putInt(11) - Unit - } - is NodeException.RouteNotFound -> { - buf.putInt(12) - Unit - } - is NodeException.ChannelCreationFailed -> { - buf.putInt(13) - Unit - } - is NodeException.ChannelClosingFailed -> { - buf.putInt(14) - Unit - } - is NodeException.ChannelSplicingFailed -> { - buf.putInt(15) - Unit - } - is NodeException.ChannelConfigUpdateFailed -> { - buf.putInt(16) - Unit - } - is NodeException.PersistenceFailed -> { - buf.putInt(17) - Unit - } - is NodeException.FeerateEstimationUpdateFailed -> { - buf.putInt(18) - Unit - } - is NodeException.FeerateEstimationUpdateTimeout -> { - buf.putInt(19) - Unit - } - is NodeException.WalletOperationFailed -> { - buf.putInt(20) - Unit - } - is NodeException.WalletOperationTimeout -> { - buf.putInt(21) - Unit - } - is NodeException.OnchainTxSigningFailed -> { - buf.putInt(22) - Unit - } - is NodeException.TxSyncFailed -> { - buf.putInt(23) - Unit - } - is NodeException.TxSyncTimeout -> { - buf.putInt(24) - Unit - } - is NodeException.GossipUpdateFailed -> { - buf.putInt(25) - Unit - } - is NodeException.GossipUpdateTimeout -> { - buf.putInt(26) - Unit - } - is NodeException.LiquidityRequestFailed -> { - buf.putInt(27) - Unit - } - is NodeException.UriParameterParsingFailed -> { - buf.putInt(28) - Unit - } - is NodeException.InvalidAddress -> { - buf.putInt(29) - Unit - } - is NodeException.InvalidSocketAddress -> { - buf.putInt(30) - Unit - } - is NodeException.InvalidPublicKey -> { - buf.putInt(31) - Unit - } - is NodeException.InvalidSecretKey -> { - buf.putInt(32) - Unit - } - is NodeException.InvalidOfferId -> { - buf.putInt(33) - Unit - } - is NodeException.InvalidNodeId -> { - buf.putInt(34) - Unit - } - is NodeException.InvalidPaymentId -> { - buf.putInt(35) - Unit - } - is NodeException.InvalidPaymentHash -> { - buf.putInt(36) - Unit - } - is NodeException.InvalidPaymentPreimage -> { - buf.putInt(37) - Unit - } - is NodeException.InvalidPaymentSecret -> { - buf.putInt(38) - Unit - } - is NodeException.InvalidAmount -> { - buf.putInt(39) - Unit - } - is NodeException.InvalidInvoice -> { - buf.putInt(40) - Unit - } - is NodeException.InvalidOffer -> { - buf.putInt(41) - Unit - } - is NodeException.InvalidRefund -> { - buf.putInt(42) - Unit - } - is NodeException.InvalidChannelId -> { - buf.putInt(43) - Unit - } - is NodeException.InvalidNetwork -> { - buf.putInt(44) - Unit - } - is NodeException.InvalidUri -> { - buf.putInt(45) - Unit - } - is NodeException.InvalidQuantity -> { - buf.putInt(46) - Unit - } - is NodeException.InvalidNodeAlias -> { - buf.putInt(47) - Unit - } - is NodeException.InvalidDateTime -> { - buf.putInt(48) - Unit - } - is NodeException.InvalidFeeRate -> { - buf.putInt(49) - Unit - } - is NodeException.DuplicatePayment -> { - buf.putInt(50) - Unit - } - is NodeException.UnsupportedCurrency -> { - buf.putInt(51) - Unit - } - is NodeException.InsufficientFunds -> { - buf.putInt(52) - Unit - } - is NodeException.LiquiditySourceUnavailable -> { - buf.putInt(53) - Unit - } - is NodeException.LiquidityFeeTooHigh -> { - buf.putInt(54) - Unit - } - is NodeException.InvalidBlindedPaths -> { - buf.putInt(55) - Unit - } - is NodeException.AsyncPaymentServicesDisabled -> { - buf.putInt(56) - Unit - } - is NodeException.CannotRbfFundingTransaction -> { - buf.putInt(57) - Unit - } - is NodeException.TransactionNotFound -> { - buf.putInt(58) - Unit - } - is NodeException.TransactionAlreadyConfirmed -> { - buf.putInt(59) - Unit - } - is NodeException.NoSpendableOutputs -> { - buf.putInt(60) - Unit - } - is NodeException.CoinSelectionFailed -> { - buf.putInt(61) - Unit - } - is NodeException.InvalidMnemonic -> { - buf.putInt(62) - Unit - } - is NodeException.BackgroundSyncNotEnabled -> { - buf.putInt(63) - Unit - } - is NodeException.AddressTypeAlreadyMonitored -> { - buf.putInt(64) - Unit - } - is NodeException.AddressTypeIsPrimary -> { - buf.putInt(65) - Unit - } - is NodeException.AddressTypeNotMonitored -> { - buf.putInt(66) - Unit - } - is NodeException.OnchainWalletAccountNotRegistered -> { - buf.putInt(67) - Unit - } - is NodeException.InvalidSeedBytes -> { - buf.putInt(68) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - - -object FfiConverterTypeOfferAmount : FfiConverterRustBuffer{ - override fun read(buf: ByteBuffer): OfferAmount { - return when(buf.getInt()) { - 1 -> OfferAmount.Bitcoin( - FfiConverterULong.read(buf), - ) - 2 -> OfferAmount.Currency( - FfiConverterString.read(buf), - FfiConverterULong.read(buf), - ) - else -> throw RuntimeException("invalid enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: OfferAmount) = when(value) { - is OfferAmount.Bitcoin -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterULong.allocationSize(value.`amountMsats`) - ) - } - is OfferAmount.Currency -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterString.allocationSize(value.`iso4217Code`) - + FfiConverterULong.allocationSize(value.`amount`) - ) - } - } - - override fun write(value: OfferAmount, buf: ByteBuffer) { - when(value) { - is OfferAmount.Bitcoin -> { - buf.putInt(1) - FfiConverterULong.write(value.`amountMsats`, buf) - Unit - } - is OfferAmount.Currency -> { - buf.putInt(2) - FfiConverterString.write(value.`iso4217Code`, buf) - FfiConverterULong.write(value.`amount`, buf) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - - -object FfiConverterTypePaymentDirection: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - PaymentDirection.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: PaymentDirection) = 4UL - - override fun write(value: PaymentDirection, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - - -object FfiConverterTypePaymentFailureReason: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - PaymentFailureReason.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: PaymentFailureReason) = 4UL - - override fun write(value: PaymentFailureReason, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - - -object FfiConverterTypePaymentKind : FfiConverterRustBuffer{ - override fun read(buf: ByteBuffer): PaymentKind { - return when(buf.getInt()) { - 1 -> PaymentKind.Onchain( - FfiConverterTypeTxid.read(buf), - FfiConverterTypeConfirmationStatus.read(buf), - ) - 2 -> PaymentKind.Bolt11( - FfiConverterTypePaymentHash.read(buf), - FfiConverterOptionalTypePaymentPreimage.read(buf), - FfiConverterOptionalTypePaymentSecret.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterOptionalString.read(buf), - ) - 3 -> PaymentKind.Bolt11Jit( - FfiConverterTypePaymentHash.read(buf), - FfiConverterOptionalTypePaymentPreimage.read(buf), - FfiConverterOptionalTypePaymentSecret.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterTypeLSPFeeLimits.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterOptionalString.read(buf), - ) - 4 -> PaymentKind.Bolt12Offer( - FfiConverterOptionalTypePaymentHash.read(buf), - FfiConverterOptionalTypePaymentPreimage.read(buf), - FfiConverterOptionalTypePaymentSecret.read(buf), - FfiConverterTypeOfferId.read(buf), - FfiConverterOptionalTypeUntrustedString.read(buf), - FfiConverterOptionalULong.read(buf), - ) - 5 -> PaymentKind.Bolt12Refund( - FfiConverterOptionalTypePaymentHash.read(buf), - FfiConverterOptionalTypePaymentPreimage.read(buf), - FfiConverterOptionalTypePaymentSecret.read(buf), - FfiConverterOptionalTypeUntrustedString.read(buf), - FfiConverterOptionalULong.read(buf), - ) - 6 -> PaymentKind.Spontaneous( - FfiConverterTypePaymentHash.read(buf), - FfiConverterOptionalTypePaymentPreimage.read(buf), - ) - else -> throw RuntimeException("invalid enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: PaymentKind) = when(value) { - is PaymentKind.Onchain -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeTxid.allocationSize(value.`txid`) - + FfiConverterTypeConfirmationStatus.allocationSize(value.`status`) - ) - } - is PaymentKind.Bolt11 -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypePaymentHash.allocationSize(value.`hash`) - + FfiConverterOptionalTypePaymentPreimage.allocationSize(value.`preimage`) - + FfiConverterOptionalTypePaymentSecret.allocationSize(value.`secret`) - + FfiConverterOptionalString.allocationSize(value.`description`) - + FfiConverterOptionalString.allocationSize(value.`bolt11`) - ) - } - is PaymentKind.Bolt11Jit -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypePaymentHash.allocationSize(value.`hash`) - + FfiConverterOptionalTypePaymentPreimage.allocationSize(value.`preimage`) - + FfiConverterOptionalTypePaymentSecret.allocationSize(value.`secret`) - + FfiConverterOptionalULong.allocationSize(value.`counterpartySkimmedFeeMsat`) - + FfiConverterTypeLSPFeeLimits.allocationSize(value.`lspFeeLimits`) - + FfiConverterOptionalString.allocationSize(value.`description`) - + FfiConverterOptionalString.allocationSize(value.`bolt11`) - ) - } - is PaymentKind.Bolt12Offer -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterOptionalTypePaymentHash.allocationSize(value.`hash`) - + FfiConverterOptionalTypePaymentPreimage.allocationSize(value.`preimage`) - + FfiConverterOptionalTypePaymentSecret.allocationSize(value.`secret`) - + FfiConverterTypeOfferId.allocationSize(value.`offerId`) - + FfiConverterOptionalTypeUntrustedString.allocationSize(value.`payerNote`) - + FfiConverterOptionalULong.allocationSize(value.`quantity`) - ) - } - is PaymentKind.Bolt12Refund -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterOptionalTypePaymentHash.allocationSize(value.`hash`) - + FfiConverterOptionalTypePaymentPreimage.allocationSize(value.`preimage`) - + FfiConverterOptionalTypePaymentSecret.allocationSize(value.`secret`) - + FfiConverterOptionalTypeUntrustedString.allocationSize(value.`payerNote`) - + FfiConverterOptionalULong.allocationSize(value.`quantity`) - ) - } - is PaymentKind.Spontaneous -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypePaymentHash.allocationSize(value.`hash`) - + FfiConverterOptionalTypePaymentPreimage.allocationSize(value.`preimage`) - ) - } - } - - override fun write(value: PaymentKind, buf: ByteBuffer) { - when(value) { - is PaymentKind.Onchain -> { - buf.putInt(1) - FfiConverterTypeTxid.write(value.`txid`, buf) - FfiConverterTypeConfirmationStatus.write(value.`status`, buf) - Unit - } - is PaymentKind.Bolt11 -> { - buf.putInt(2) - FfiConverterTypePaymentHash.write(value.`hash`, buf) - FfiConverterOptionalTypePaymentPreimage.write(value.`preimage`, buf) - FfiConverterOptionalTypePaymentSecret.write(value.`secret`, buf) - FfiConverterOptionalString.write(value.`description`, buf) - FfiConverterOptionalString.write(value.`bolt11`, buf) - Unit - } - is PaymentKind.Bolt11Jit -> { - buf.putInt(3) - FfiConverterTypePaymentHash.write(value.`hash`, buf) - FfiConverterOptionalTypePaymentPreimage.write(value.`preimage`, buf) - FfiConverterOptionalTypePaymentSecret.write(value.`secret`, buf) - FfiConverterOptionalULong.write(value.`counterpartySkimmedFeeMsat`, buf) - FfiConverterTypeLSPFeeLimits.write(value.`lspFeeLimits`, buf) - FfiConverterOptionalString.write(value.`description`, buf) - FfiConverterOptionalString.write(value.`bolt11`, buf) - Unit - } - is PaymentKind.Bolt12Offer -> { - buf.putInt(4) - FfiConverterOptionalTypePaymentHash.write(value.`hash`, buf) - FfiConverterOptionalTypePaymentPreimage.write(value.`preimage`, buf) - FfiConverterOptionalTypePaymentSecret.write(value.`secret`, buf) - FfiConverterTypeOfferId.write(value.`offerId`, buf) - FfiConverterOptionalTypeUntrustedString.write(value.`payerNote`, buf) - FfiConverterOptionalULong.write(value.`quantity`, buf) - Unit - } - is PaymentKind.Bolt12Refund -> { - buf.putInt(5) - FfiConverterOptionalTypePaymentHash.write(value.`hash`, buf) - FfiConverterOptionalTypePaymentPreimage.write(value.`preimage`, buf) - FfiConverterOptionalTypePaymentSecret.write(value.`secret`, buf) - FfiConverterOptionalTypeUntrustedString.write(value.`payerNote`, buf) - FfiConverterOptionalULong.write(value.`quantity`, buf) - Unit - } - is PaymentKind.Spontaneous -> { - buf.putInt(6) - FfiConverterTypePaymentHash.write(value.`hash`, buf) - FfiConverterOptionalTypePaymentPreimage.write(value.`preimage`, buf) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - - -object FfiConverterTypePaymentStatus: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - PaymentStatus.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: PaymentStatus) = 4UL - - override fun write(value: PaymentStatus, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - - -object FfiConverterTypePendingSweepBalance : FfiConverterRustBuffer{ - override fun read(buf: ByteBuffer): PendingSweepBalance { - return when(buf.getInt()) { - 1 -> PendingSweepBalance.PendingBroadcast( - FfiConverterOptionalTypeChannelId.read(buf), - FfiConverterULong.read(buf), - ) - 2 -> PendingSweepBalance.BroadcastAwaitingConfirmation( - FfiConverterOptionalTypeChannelId.read(buf), - FfiConverterUInt.read(buf), - FfiConverterTypeTxid.read(buf), - FfiConverterULong.read(buf), - ) - 3 -> PendingSweepBalance.AwaitingThresholdConfirmations( - FfiConverterOptionalTypeChannelId.read(buf), - FfiConverterTypeTxid.read(buf), - FfiConverterTypeBlockHash.read(buf), - FfiConverterUInt.read(buf), - FfiConverterULong.read(buf), - ) - else -> throw RuntimeException("invalid enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: PendingSweepBalance) = when(value) { - is PendingSweepBalance.PendingBroadcast -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterOptionalTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterULong.allocationSize(value.`amountSatoshis`) - ) - } - is PendingSweepBalance.BroadcastAwaitingConfirmation -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterOptionalTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterUInt.allocationSize(value.`latestBroadcastHeight`) - + FfiConverterTypeTxid.allocationSize(value.`latestSpendingTxid`) - + FfiConverterULong.allocationSize(value.`amountSatoshis`) - ) - } - is PendingSweepBalance.AwaitingThresholdConfirmations -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterOptionalTypeChannelId.allocationSize(value.`channelId`) - + FfiConverterTypeTxid.allocationSize(value.`latestSpendingTxid`) - + FfiConverterTypeBlockHash.allocationSize(value.`confirmationHash`) - + FfiConverterUInt.allocationSize(value.`confirmationHeight`) - + FfiConverterULong.allocationSize(value.`amountSatoshis`) - ) - } - } - - override fun write(value: PendingSweepBalance, buf: ByteBuffer) { - when(value) { - is PendingSweepBalance.PendingBroadcast -> { - buf.putInt(1) - FfiConverterOptionalTypeChannelId.write(value.`channelId`, buf) - FfiConverterULong.write(value.`amountSatoshis`, buf) - Unit - } - is PendingSweepBalance.BroadcastAwaitingConfirmation -> { - buf.putInt(2) - FfiConverterOptionalTypeChannelId.write(value.`channelId`, buf) - FfiConverterUInt.write(value.`latestBroadcastHeight`, buf) - FfiConverterTypeTxid.write(value.`latestSpendingTxid`, buf) - FfiConverterULong.write(value.`amountSatoshis`, buf) - Unit - } - is PendingSweepBalance.AwaitingThresholdConfirmations -> { - buf.putInt(3) - FfiConverterOptionalTypeChannelId.write(value.`channelId`, buf) - FfiConverterTypeTxid.write(value.`latestSpendingTxid`, buf) - FfiConverterTypeBlockHash.write(value.`confirmationHash`, buf) - FfiConverterUInt.write(value.`confirmationHeight`, buf) - FfiConverterULong.write(value.`amountSatoshis`, buf) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - - -object FfiConverterTypeQrPaymentResult : FfiConverterRustBuffer{ - override fun read(buf: ByteBuffer): QrPaymentResult { - return when(buf.getInt()) { - 1 -> QrPaymentResult.Onchain( - FfiConverterTypeTxid.read(buf), - ) - 2 -> QrPaymentResult.Bolt11( - FfiConverterTypePaymentId.read(buf), - ) - 3 -> QrPaymentResult.Bolt12( - FfiConverterTypePaymentId.read(buf), - ) - else -> throw RuntimeException("invalid enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: QrPaymentResult) = when(value) { - is QrPaymentResult.Onchain -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypeTxid.allocationSize(value.`txid`) - ) - } - is QrPaymentResult.Bolt11 -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypePaymentId.allocationSize(value.`paymentId`) - ) - } - is QrPaymentResult.Bolt12 -> { - // Add the size for the Int that specifies the variant plus the size needed for all fields - ( - 4UL - + FfiConverterTypePaymentId.allocationSize(value.`paymentId`) - ) - } - } - - override fun write(value: QrPaymentResult, buf: ByteBuffer) { - when(value) { - is QrPaymentResult.Onchain -> { - buf.putInt(1) - FfiConverterTypeTxid.write(value.`txid`, buf) - Unit - } - is QrPaymentResult.Bolt11 -> { - buf.putInt(2) - FfiConverterTypePaymentId.write(value.`paymentId`, buf) - Unit - } - is QrPaymentResult.Bolt12 -> { - buf.putInt(3) - FfiConverterTypePaymentId.write(value.`paymentId`, buf) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - - -object FfiConverterTypeSyncType: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - SyncType.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: SyncType) = 4UL - - override fun write(value: SyncType, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - -object VssHeaderProviderExceptionErrorHandler : UniffiRustCallStatusErrorHandler { - override fun lift(errorBuf: RustBufferByValue): VssHeaderProviderException = FfiConverterTypeVssHeaderProviderError.lift(errorBuf) -} - -object FfiConverterTypeVssHeaderProviderError : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): VssHeaderProviderException { - return when (buf.getInt()) { - 1 -> VssHeaderProviderException.InvalidData(FfiConverterString.read(buf)) - 2 -> VssHeaderProviderException.RequestException(FfiConverterString.read(buf)) - 3 -> VssHeaderProviderException.AuthorizationException(FfiConverterString.read(buf)) - 4 -> VssHeaderProviderException.InternalException(FfiConverterString.read(buf)) - else -> throw RuntimeException("invalid error enum value, something is very wrong!!") - } - } - - override fun allocationSize(value: VssHeaderProviderException): ULong { - return 4UL - } - - override fun write(value: VssHeaderProviderException, buf: ByteBuffer) { - when (value) { - is VssHeaderProviderException.InvalidData -> { - buf.putInt(1) - Unit - } - is VssHeaderProviderException.RequestException -> { - buf.putInt(2) - Unit - } - is VssHeaderProviderException.AuthorizationException -> { - buf.putInt(3) - Unit - } - is VssHeaderProviderException.InternalException -> { - buf.putInt(4) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } - } -} - - - - - -object FfiConverterTypeWordCount: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - WordCount.entries[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: WordCount) = 4UL - - override fun write(value: WordCount, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - - - -object FfiConverterOptionalUShort: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): kotlin.UShort? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterUShort.read(buf) - } - - override fun allocationSize(value: kotlin.UShort?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterUShort.allocationSize(value) - } - } - - override fun write(value: kotlin.UShort?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterUShort.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalUInt: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): kotlin.UInt? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterUInt.read(buf) - } - - override fun allocationSize(value: kotlin.UInt?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterUInt.allocationSize(value) - } - } - - override fun write(value: kotlin.UInt?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterUInt.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalULong: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): kotlin.ULong? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterULong.read(buf) - } - - override fun allocationSize(value: kotlin.ULong?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterULong.allocationSize(value) - } - } - - override fun write(value: kotlin.ULong?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterULong.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalBoolean: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): kotlin.Boolean? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterBoolean.read(buf) - } - - override fun allocationSize(value: kotlin.Boolean?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterBoolean.allocationSize(value) - } - } - - override fun write(value: kotlin.Boolean?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterBoolean.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalString: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): kotlin.String? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterString.read(buf) - } - - override fun allocationSize(value: kotlin.String?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterString.allocationSize(value) - } - } - - override fun write(value: kotlin.String?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterString.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeFeeRate: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FeeRate? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeFeeRate.read(buf) - } - - override fun allocationSize(value: FeeRate?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeFeeRate.allocationSize(value) - } - } - - override fun write(value: FeeRate?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeFeeRate.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeAnchorChannelsConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): AnchorChannelsConfig? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeAnchorChannelsConfig.read(buf) - } - - override fun allocationSize(value: AnchorChannelsConfig?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeAnchorChannelsConfig.allocationSize(value) - } - } - - override fun write(value: AnchorChannelsConfig?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeAnchorChannelsConfig.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeBackgroundSyncConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): BackgroundSyncConfig? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeBackgroundSyncConfig.read(buf) - } - - override fun allocationSize(value: BackgroundSyncConfig?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeBackgroundSyncConfig.allocationSize(value) - } - } - - override fun write(value: BackgroundSyncConfig?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeBackgroundSyncConfig.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeChannelConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ChannelConfig? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeChannelConfig.read(buf) - } - - override fun allocationSize(value: ChannelConfig?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeChannelConfig.allocationSize(value) - } - } - - override fun write(value: ChannelConfig?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeChannelConfig.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeChannelInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ChannelInfo? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeChannelInfo.read(buf) - } - - override fun allocationSize(value: ChannelInfo?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeChannelInfo.allocationSize(value) - } - } - - override fun write(value: ChannelInfo?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeChannelInfo.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeChannelUpdateInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ChannelUpdateInfo? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeChannelUpdateInfo.read(buf) - } - - override fun allocationSize(value: ChannelUpdateInfo?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeChannelUpdateInfo.allocationSize(value) - } - } - - override fun write(value: ChannelUpdateInfo?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeChannelUpdateInfo.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeElectrumSyncConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ElectrumSyncConfig? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeElectrumSyncConfig.read(buf) - } - - override fun allocationSize(value: ElectrumSyncConfig?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeElectrumSyncConfig.allocationSize(value) - } - } - - override fun write(value: ElectrumSyncConfig?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeElectrumSyncConfig.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeEsploraSyncConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): EsploraSyncConfig? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeEsploraSyncConfig.read(buf) - } - - override fun allocationSize(value: EsploraSyncConfig?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeEsploraSyncConfig.allocationSize(value) - } - } - - override fun write(value: EsploraSyncConfig?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeEsploraSyncConfig.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeLSPS1Bolt11PaymentInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Lsps1Bolt11PaymentInfo? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeLSPS1Bolt11PaymentInfo.read(buf) - } - - override fun allocationSize(value: Lsps1Bolt11PaymentInfo?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeLSPS1Bolt11PaymentInfo.allocationSize(value) - } - } - - override fun write(value: Lsps1Bolt11PaymentInfo?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeLSPS1Bolt11PaymentInfo.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeLSPS1ChannelInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Lsps1ChannelInfo? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeLSPS1ChannelInfo.read(buf) - } - - override fun allocationSize(value: Lsps1ChannelInfo?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeLSPS1ChannelInfo.allocationSize(value) - } - } - - override fun write(value: Lsps1ChannelInfo?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeLSPS1ChannelInfo.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeLSPS1OnchainPaymentInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Lsps1OnchainPaymentInfo? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeLSPS1OnchainPaymentInfo.read(buf) - } - - override fun allocationSize(value: Lsps1OnchainPaymentInfo?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeLSPS1OnchainPaymentInfo.allocationSize(value) - } - } - - override fun write(value: Lsps1OnchainPaymentInfo?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeLSPS1OnchainPaymentInfo.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeNodeAnnouncementInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): NodeAnnouncementInfo? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeNodeAnnouncementInfo.read(buf) - } - - override fun allocationSize(value: NodeAnnouncementInfo?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeNodeAnnouncementInfo.allocationSize(value) - } - } - - override fun write(value: NodeAnnouncementInfo?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeNodeAnnouncementInfo.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeNodeInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): NodeInfo? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeNodeInfo.read(buf) - } - - override fun allocationSize(value: NodeInfo?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeNodeInfo.allocationSize(value) - } - } - - override fun write(value: NodeInfo?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeNodeInfo.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeOutPoint: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): OutPoint? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeOutPoint.read(buf) - } - - override fun allocationSize(value: OutPoint?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeOutPoint.allocationSize(value) - } - } - - override fun write(value: OutPoint?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeOutPoint.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypePaymentDetails: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): PaymentDetails? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypePaymentDetails.read(buf) - } - - override fun allocationSize(value: PaymentDetails?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypePaymentDetails.allocationSize(value) - } - } - - override fun write(value: PaymentDetails?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypePaymentDetails.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeRouteParametersConfig: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): RouteParametersConfig? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeRouteParametersConfig.read(buf) - } - - override fun allocationSize(value: RouteParametersConfig?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeRouteParametersConfig.allocationSize(value) - } - } - - override fun write(value: RouteParametersConfig?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeRouteParametersConfig.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeScoringDecayParameters: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ScoringDecayParameters? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeScoringDecayParameters.read(buf) - } - - override fun allocationSize(value: ScoringDecayParameters?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeScoringDecayParameters.allocationSize(value) - } - } - - override fun write(value: ScoringDecayParameters?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeScoringDecayParameters.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeScoringFeeParameters: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ScoringFeeParameters? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeScoringFeeParameters.read(buf) - } - - override fun allocationSize(value: ScoringFeeParameters?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeScoringFeeParameters.allocationSize(value) - } - } - - override fun write(value: ScoringFeeParameters?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeScoringFeeParameters.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeTransactionDetails: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): TransactionDetails? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeTransactionDetails.read(buf) - } - - override fun allocationSize(value: TransactionDetails?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeTransactionDetails.allocationSize(value) - } - } - - override fun write(value: TransactionDetails?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeTransactionDetails.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeAsyncPaymentsRole: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): AsyncPaymentsRole? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeAsyncPaymentsRole.read(buf) - } - - override fun allocationSize(value: AsyncPaymentsRole?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeAsyncPaymentsRole.allocationSize(value) - } - } - - override fun write(value: AsyncPaymentsRole?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeAsyncPaymentsRole.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeClosureReason: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ClosureReason? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeClosureReason.read(buf) - } - - override fun allocationSize(value: ClosureReason?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeClosureReason.allocationSize(value) - } - } - - override fun write(value: ClosureReason?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeClosureReason.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeEvent: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Event? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeEvent.read(buf) - } - - override fun allocationSize(value: Event?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeEvent.allocationSize(value) - } - } - - override fun write(value: Event?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeEvent.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeLogLevel: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): LogLevel? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeLogLevel.read(buf) - } - - override fun allocationSize(value: LogLevel?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeLogLevel.allocationSize(value) - } - } - - override fun write(value: LogLevel?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeLogLevel.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeNetwork: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Network? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeNetwork.read(buf) - } - - override fun allocationSize(value: Network?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeNetwork.allocationSize(value) - } - } - - override fun write(value: Network?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeNetwork.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeOfferAmount: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): OfferAmount? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeOfferAmount.read(buf) - } - - override fun allocationSize(value: OfferAmount?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeOfferAmount.allocationSize(value) - } - } - - override fun write(value: OfferAmount?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeOfferAmount.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypePaymentFailureReason: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): PaymentFailureReason? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypePaymentFailureReason.read(buf) - } - - override fun allocationSize(value: PaymentFailureReason?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypePaymentFailureReason.allocationSize(value) - } - } - - override fun write(value: PaymentFailureReason?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypePaymentFailureReason.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeWordCount: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): WordCount? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeWordCount.read(buf) - } - - override fun allocationSize(value: WordCount?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeWordCount.allocationSize(value) - } - } - - override fun write(value: WordCount?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeWordCount.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalSequenceUByte: FfiConverterRustBuffer?> { - override fun read(buf: ByteBuffer): List? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterSequenceUByte.read(buf) - } - - override fun allocationSize(value: List?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterSequenceUByte.allocationSize(value) - } - } - - override fun write(value: List?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterSequenceUByte.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalSequenceTypeSpendableUtxo: FfiConverterRustBuffer?> { - override fun read(buf: ByteBuffer): List? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterSequenceTypeSpendableUtxo.read(buf) - } - - override fun allocationSize(value: List?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterSequenceTypeSpendableUtxo.allocationSize(value) - } - } - - override fun write(value: List?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterSequenceTypeSpendableUtxo.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalSequenceSequenceUByte: FfiConverterRustBuffer>?> { - override fun read(buf: ByteBuffer): List>? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterSequenceSequenceUByte.read(buf) - } - - override fun allocationSize(value: List>?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterSequenceSequenceUByte.allocationSize(value) - } - } - - override fun write(value: List>?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterSequenceSequenceUByte.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalSequenceTypeSocketAddress: FfiConverterRustBuffer?> { - override fun read(buf: ByteBuffer): List? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterSequenceTypeSocketAddress.read(buf) - } - - override fun allocationSize(value: List?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterSequenceTypeSocketAddress.allocationSize(value) - } - } - - override fun write(value: List?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterSequenceTypeSocketAddress.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeAddress: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Address? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeAddress.read(buf) - } - - override fun allocationSize(value: Address?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeAddress.allocationSize(value) - } - } - - override fun write(value: Address?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeAddress.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeChannelId: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ChannelId? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeChannelId.read(buf) - } - - override fun allocationSize(value: ChannelId?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeChannelId.allocationSize(value) - } - } - - override fun write(value: ChannelId?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeChannelId.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeNodeAlias: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): NodeAlias? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeNodeAlias.read(buf) - } - - override fun allocationSize(value: NodeAlias?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeNodeAlias.allocationSize(value) - } - } - - override fun write(value: NodeAlias?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeNodeAlias.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypePaymentHash: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): PaymentHash? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypePaymentHash.read(buf) - } - - override fun allocationSize(value: PaymentHash?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypePaymentHash.allocationSize(value) - } - } - - override fun write(value: PaymentHash?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypePaymentHash.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypePaymentId: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): PaymentId? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypePaymentId.read(buf) - } - - override fun allocationSize(value: PaymentId?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypePaymentId.allocationSize(value) - } - } - - override fun write(value: PaymentId?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypePaymentId.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypePaymentPreimage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): PaymentPreimage? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypePaymentPreimage.read(buf) - } - - override fun allocationSize(value: PaymentPreimage?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypePaymentPreimage.allocationSize(value) - } - } - - override fun write(value: PaymentPreimage?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypePaymentPreimage.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypePaymentSecret: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): PaymentSecret? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypePaymentSecret.read(buf) - } - - override fun allocationSize(value: PaymentSecret?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypePaymentSecret.allocationSize(value) - } - } - - override fun write(value: PaymentSecret?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypePaymentSecret.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypePublicKey: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): PublicKey? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypePublicKey.read(buf) - } - - override fun allocationSize(value: PublicKey?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypePublicKey.allocationSize(value) - } - } - - override fun write(value: PublicKey?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypePublicKey.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeUntrustedString: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): UntrustedString? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeUntrustedString.read(buf) - } - - override fun allocationSize(value: UntrustedString?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeUntrustedString.allocationSize(value) - } - } - - override fun write(value: UntrustedString?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeUntrustedString.write(value, buf) - } - } -} - - - - -object FfiConverterOptionalTypeUserChannelId: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): UserChannelId? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeUserChannelId.read(buf) - } - - override fun allocationSize(value: UserChannelId?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeUserChannelId.allocationSize(value) - } - } - - override fun write(value: UserChannelId?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeUserChannelId.write(value, buf) - } - } -} - - - - -object FfiConverterSequenceUByte: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterUByte.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterUByte.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterUByte.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceULong: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterULong.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterULong.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterULong.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceString: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterString.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterString.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterString.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeAddressInfo: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeAddressInfo.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeAddressInfo.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeAddressInfo.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeChannelDetails: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeChannelDetails.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeChannelDetails.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeChannelDetails.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeCustomTlvRecord: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeCustomTlvRecord.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeCustomTlvRecord.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeCustomTlvRecord.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeOnchainWalletAccount: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeOnchainWalletAccount.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeOnchainWalletAccount.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeOnchainWalletAccount.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeOnchainWalletAccountConfig: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeOnchainWalletAccountConfig.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeOnchainWalletAccountConfig.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeOnchainWalletAccountConfig.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypePaymentDetails: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypePaymentDetails.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypePaymentDetails.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypePaymentDetails.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypePeerDetails: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypePeerDetails.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypePeerDetails.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypePeerDetails.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeProbeHandle: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeProbeHandle.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeProbeHandle.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeProbeHandle.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeRouteHintHop: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeRouteHintHop.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeRouteHintHop.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeRouteHintHop.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeSpendableUtxo: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeSpendableUtxo.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeSpendableUtxo.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeSpendableUtxo.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeTxInput: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeTxInput.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeTxInput.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeTxInput.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeTxOutput: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeTxOutput.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeTxOutput.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeTxOutput.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeAddressType: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeAddressType.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeAddressType.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeAddressType.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeLightningBalance: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeLightningBalance.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeLightningBalance.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeLightningBalance.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeNetwork: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeNetwork.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeNetwork.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeNetwork.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypePendingSweepBalance: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypePendingSweepBalance.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypePendingSweepBalance.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypePendingSweepBalance.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceSequenceUByte: FfiConverterRustBuffer>> { - override fun read(buf: ByteBuffer): List> { - val len = buf.getInt() - return List>(len) { - FfiConverterSequenceUByte.read(buf) - } - } - - override fun allocationSize(value: List>): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterSequenceUByte.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List>, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterSequenceUByte.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceSequenceTypeRouteHintHop: FfiConverterRustBuffer>> { - override fun read(buf: ByteBuffer): List> { - val len = buf.getInt() - return List>(len) { - FfiConverterSequenceTypeRouteHintHop.read(buf) - } - } - - override fun allocationSize(value: List>): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterSequenceTypeRouteHintHop.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List>, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterSequenceTypeRouteHintHop.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeAddress: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List
{ - val len = buf.getInt() - return List
(len) { - FfiConverterTypeAddress.read(buf) - } - } - - override fun allocationSize(value: List
): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeAddress.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List
, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeAddress.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeNodeId: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeNodeId.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeNodeId.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeNodeId.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypePublicKey: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypePublicKey.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypePublicKey.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypePublicKey.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeSocketAddress: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeSocketAddress.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeSocketAddress.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeSocketAddress.write(it, buf) - } - } -} - - - - -object FfiConverterSequenceTypeTxid: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeTxid.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.sumOf { FfiConverterTypeTxid.allocationSize(it) } - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeTxid.write(it, buf) - } - } -} - - - -object FfiConverterMapStringString: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): Map { - val len = buf.getInt() - return buildMap(len) { - repeat(len) { - val k = FfiConverterString.read(buf) - val v = FfiConverterString.read(buf) - this[k] = v - } - } - } - - override fun allocationSize(value: Map): ULong { - val spaceForMapSize = 4UL - val spaceForChildren = value.entries.sumOf { (k, v) -> - FfiConverterString.allocationSize(k) + - FfiConverterString.allocationSize(v) - } - return spaceForMapSize + spaceForChildren - } - - override fun write(value: Map, buf: ByteBuffer) { - buf.putInt(value.size) - // The parens on `(k, v)` here ensure we're calling the right method, - // which is important for compatibility with older android devices. - // Ref https://blog.danlew.net/2017/03/16/kotlin-puzzler-whose-line-is-it-anyways/ - value.forEach { (k, v) -> - FfiConverterString.write(k, buf) - FfiConverterString.write(v, buf) - } - } -} - - - - -typealias FfiConverterTypeAddress = FfiConverterString - - - - -typealias FfiConverterTypeBlockHash = FfiConverterString - - - - -typealias FfiConverterTypeChannelId = FfiConverterString - - - - -typealias FfiConverterTypeLSPS1OrderId = FfiConverterString - - - - -typealias FfiConverterTypeLSPSDateTime = FfiConverterString - - - - -typealias FfiConverterTypeMnemonic = FfiConverterString - - - - -typealias FfiConverterTypeNodeAlias = FfiConverterString - - - - -typealias FfiConverterTypeNodeId = FfiConverterString - - - - -typealias FfiConverterTypeOfferId = FfiConverterString - - - - -typealias FfiConverterTypePaymentHash = FfiConverterString - - - - -typealias FfiConverterTypePaymentId = FfiConverterString - - - - -typealias FfiConverterTypePaymentPreimage = FfiConverterString - - - - -typealias FfiConverterTypePaymentSecret = FfiConverterString - - - - -typealias FfiConverterTypePublicKey = FfiConverterString - - - - -typealias FfiConverterTypeSocketAddress = FfiConverterString - - - - -typealias FfiConverterTypeTxid = FfiConverterString - - - - -typealias FfiConverterTypeUntrustedString = FfiConverterString - - - - -typealias FfiConverterTypeUserChannelId = FfiConverterString - - - - - - - - - - - - - -fun `batterySavingSyncIntervals`(): RuntimeSyncIntervals { - return FfiConverterTypeRuntimeSyncIntervals.lift(uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_func_battery_saving_sync_intervals( - uniffiRustCallStatus, - ) - }) -} - -fun `defaultConfig`(): Config { - return FfiConverterTypeConfig.lift(uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_func_default_config( - uniffiRustCallStatus, - ) - }) -} - -@Throws(NodeException::class) -fun `deriveNodeSecretFromMnemonic`(`mnemonic`: kotlin.String, `passphrase`: kotlin.String?): List { - return FfiConverterSequenceUByte.lift(uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_func_derive_node_secret_from_mnemonic( - FfiConverterString.lower(`mnemonic`), - FfiConverterOptionalString.lower(`passphrase`), - uniffiRustCallStatus, - ) - }) -} - -fun `generateEntropyMnemonic`(`wordCount`: WordCount?): Mnemonic { - return FfiConverterTypeMnemonic.lift(uniffiRustCall { uniffiRustCallStatus -> - UniffiLib.INSTANCE.uniffi_ldk_node_fn_func_generate_entropy_mnemonic( - FfiConverterOptionalTypeWordCount.lower(`wordCount`), - uniffiRustCallStatus, - ) - }) -} - - -// Async support - -internal const val UNIFFI_RUST_FUTURE_POLL_READY = 0.toByte() -internal const val UNIFFI_RUST_FUTURE_POLL_MAYBE_READY = 1.toByte() - -internal val uniffiContinuationHandleMap = UniffiHandleMap>() - -// FFI type for Rust future continuations -internal suspend fun uniffiRustCallAsync( - rustFuture: Long, - pollFunc: (Long, UniffiRustFutureContinuationCallback, Long) -> Unit, - completeFunc: (Long, UniffiRustCallStatus) -> F, - freeFunc: (Long) -> Unit, - cancelFunc: (Long) -> Unit, - liftFunc: (F) -> T, - errorHandler: UniffiRustCallStatusErrorHandler -): T { - return withContext(Dispatchers.IO) { - try { - do { - val pollResult = suspendCancellableCoroutine { continuation -> - val handle = uniffiContinuationHandleMap.insert(continuation) - continuation.invokeOnCancellation { - cancelFunc(rustFuture) - } - pollFunc( - rustFuture, - uniffiRustFutureContinuationCallbackCallback, - handle - ) - } - } while (pollResult != UNIFFI_RUST_FUTURE_POLL_READY); - - return@withContext liftFunc( - uniffiRustCallWithError(errorHandler) { status -> completeFunc(rustFuture, status) } - ) - } finally { - freeFunc(rustFuture) - } - } -} - -object uniffiRustFutureContinuationCallbackCallback: UniffiRustFutureContinuationCallback { - override fun callback(data: Long, pollResult: Byte) { - uniffiContinuationHandleMap.remove(data).resume(pollResult) - } -} diff --git a/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-aarch64/libldk_node.dylib b/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-aarch64/libldk_node.dylib deleted file mode 100644 index dfdaeae63d..0000000000 Binary files a/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-aarch64/libldk_node.dylib and /dev/null differ diff --git a/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-x86-64/libldk_node.dylib b/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-x86-64/libldk_node.dylib deleted file mode 100644 index d91a777c25..0000000000 Binary files a/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-x86-64/libldk_node.dylib and /dev/null differ diff --git a/scripts/install_gobley_bindgen.sh b/scripts/install_gobley_bindgen.sh index 30241b20d8..88c9cb3f9f 100755 --- a/scripts/install_gobley_bindgen.sh +++ b/scripts/install_gobley_bindgen.sh @@ -7,7 +7,7 @@ STAMP="${GOBLEY_ROOT}/rev" if [ ! -x "${GOBLEY_ROOT}/bin/gobley-uniffi-bindgen" ] || [ "$(cat "${STAMP}" 2>/dev/null || true)" != "${GOBLEY_REV}" ]; then echo "Installing gobley-uniffi-bindgen ${GOBLEY_REV} into ${GOBLEY_ROOT}..." - cargo install --git https://github.com/ovitrif/gobley.git --rev "${GOBLEY_REV}" --root "${GOBLEY_ROOT}" gobley-uniffi-bindgen --force + cargo install --git https://github.com/ovitrif/gobley.git --rev "${GOBLEY_REV}" --root "${GOBLEY_ROOT}" gobley-uniffi-bindgen --locked --force echo "${GOBLEY_REV}" > "${STAMP}" fi diff --git a/scripts/uniffi_bindgen_generate_kotlin.sh b/scripts/uniffi_bindgen_generate_kotlin.sh index 578be981cf..d0106c49f4 100755 --- a/scripts/uniffi_bindgen_generate_kotlin.sh +++ b/scripts/uniffi_bindgen_generate_kotlin.sh @@ -11,7 +11,7 @@ UNIFFI_BINDGEN_BIN="gobley-uniffi-bindgen" if [[ "$OSTYPE" == "linux-gnu"* ]]; then echo "Building for Linux x86_64..." rustup target add x86_64-unknown-linux-gnu || exit 1 - cargo build --profile release-smaller --target x86_64-unknown-linux-gnu --features uniffi || exit 1 + cargo build --locked --profile release-smaller --target x86_64-unknown-linux-gnu --features uniffi || exit 1 DYNAMIC_LIB_PATH="$TARGET_DIR/x86_64-unknown-linux-gnu/release-smaller/libldk_node.so" RES_DIR="$JVM_LIB_DIR/lib/src/main/resources/linux-x86-64/" mkdir -p $RES_DIR || exit 1 @@ -19,7 +19,7 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then else echo "Building for macOS x86_64..." rustup target add x86_64-apple-darwin || exit 1 - cargo build --profile release-smaller --target x86_64-apple-darwin --features uniffi || exit 1 + cargo build --locked --profile release-smaller --target x86_64-apple-darwin --features uniffi || exit 1 DYNAMIC_LIB_PATH="$TARGET_DIR/x86_64-apple-darwin/release-smaller/libldk_node.dylib" RES_DIR="$JVM_LIB_DIR/lib/src/main/resources/darwin-x86-64/" mkdir -p $RES_DIR || exit 1 @@ -27,7 +27,7 @@ else echo "Building for macOS aarch64..." rustup target add aarch64-apple-darwin || exit 1 - cargo build --profile release-smaller --target aarch64-apple-darwin --features uniffi || exit 1 + cargo build --locked --profile release-smaller --target aarch64-apple-darwin --features uniffi || exit 1 DYNAMIC_LIB_PATH_ARM="$TARGET_DIR/aarch64-apple-darwin/release-smaller/libldk_node.dylib" RES_DIR="$JVM_LIB_DIR/lib/src/main/resources/darwin-aarch64/" mkdir -p $RES_DIR || exit 1 @@ -66,8 +66,4 @@ echo "JVM version synced: $CARGO_VERSION" echo "Testing JVM library build..." $JVM_LIB_DIR/gradlew --project-dir "$JVM_LIB_DIR" clean build -x test || exit 1 -# Verify JVM library publish task graph -echo "Verifying JVM library publish task graph..." -$JVM_LIB_DIR/gradlew --project-dir "$JVM_LIB_DIR" clean publish --dry-run || exit 1 - echo "JVM build process completed successfully!" diff --git a/scripts/uniffi_bindgen_generate_kotlin_android.sh b/scripts/uniffi_bindgen_generate_kotlin_android.sh index 7f78d5a120..9710a4b380 100755 --- a/scripts/uniffi_bindgen_generate_kotlin_android.sh +++ b/scripts/uniffi_bindgen_generate_kotlin_android.sh @@ -266,7 +266,7 @@ cargo ndk \ -t armeabi-v7a \ -t arm64-v8a \ -t x86_64 \ - build --profile release-smaller --features uniffi || exit 1 + build --locked --profile release-smaller --features uniffi || exit 1 validate_android_symbols create_native_debug_symbols_archive