From 68a961d0e14fec69a9be3afbd7b9e69ba673f4ea Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 22 May 2026 13:49:09 -0500 Subject: [PATCH] feat: add native reproducibility hygiene checks --- .github/workflows/ci.yml | 42 +- .gitignore | 1 + PUBDEV_RELEASE_CHECKLIST.md | 6 +- README.md | 14 +- hook/build.dart | 1 + lib/bdk.dart | 4446 +++++++++++++++--------------- native/Cargo.lock | 2176 +++++++++++++++ native/Cargo.toml | 8 +- scripts/check_reproducibility.sh | 82 + scripts/generate_bindings.sh | 6 +- 10 files changed, 4548 insertions(+), 2234 deletions(-) create mode 100644 native/Cargo.lock create mode 100644 scripts/check_reproducibility.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5fa864..c49e31a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [main] +env: + # Keep in sync with native/rust-toolchain.toml. + RUST_TOOLCHAIN: "1.85.1" + jobs: build-and-test: strategy: @@ -17,7 +21,9 @@ jobs: uses: actions/checkout@v4 - name: Setup Rust - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} - name: Setup Flutter uses: subosito/flutter-action@v2 @@ -71,7 +77,9 @@ jobs: uses: actions/checkout@v4 - name: Setup Rust - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} - name: Setup Dart uses: dart-lang/setup-dart@v1 @@ -95,7 +103,9 @@ jobs: uses: actions/checkout@v4 - name: Setup Rust - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} - name: Setup Java uses: actions/setup-java@v4 @@ -128,7 +138,9 @@ jobs: uses: actions/checkout@v4 - name: Setup Rust - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} - name: Setup Flutter uses: subosito/flutter-action@v2 @@ -150,3 +162,25 @@ jobs: - name: Build iOS simulator app (bdk_demo) working-directory: bdk_demo run: flutter build ios --simulator --no-codesign + + reproducibility: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + + - name: Setup Dart + uses: dart-lang/setup-dart@v1 + with: + sdk: "3.10.0" + + - name: Check deterministic bindings and native library hash + run: | + chmod +x scripts/generate_bindings.sh scripts/check_reproducibility.sh + ./scripts/check_reproducibility.sh diff --git a/.gitignore b/.gitignore index 3adc1b6..cff34e4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ native/target/ **/*.rs.bk Cargo.lock +!native/Cargo.lock # Flutter/Dart **/build/ diff --git a/PUBDEV_RELEASE_CHECKLIST.md b/PUBDEV_RELEASE_CHECKLIST.md index a3f4c1d..02bf224 100644 --- a/PUBDEV_RELEASE_CHECKLIST.md +++ b/PUBDEV_RELEASE_CHECKLIST.md @@ -14,8 +14,12 @@ Use this checklist before publishing `bdk_dart` to pub.dev. ## 2. Source and generated bindings - [ ] Native and bindings changes are finalized. -- [ ] `lib/bdk.dart` is regenerated if needed. +- [ ] `native/Cargo.lock` changes are intentional and reviewed when native dependencies change. +- [ ] Release native builds use the pinned Rust toolchain from `native/rust-toolchain.toml`. +- [ ] `lib/bdk.dart` is regenerated if needed and the working tree remains clean for generated bindings. - [ ] `scripts/generate_bindings.sh` succeeds on a clean checkout. +- [ ] `scripts/check_reproducibility.sh` passes for deterministic binding generation and native build input hygiene. +- [ ] Native binary hash enforcement is enabled only after the UniFFI trait-ordering fix is available in the native dependency stack. ## 3. Local quality gates diff --git a/README.md b/README.md index 411982d..cf57f90 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,13 @@ If you have the Rust toolchain installed, the native library will be automatical As a user of the package, you don't need to worry about building the native library or bindings yourself. Only if you want to contribute to the bindings or modify the native code yourself, you can follow the instructions in [development](#development) below. The first build can take several minutes depending on your machine and network (subsequent builds are faster). -We pin git dependencies to immutable refs for reproducibility. `bdk-ffi` and `uniffi-dart` both track upstream release tags. +We pin git dependencies to immutable refs for reproducibility. `bdk-ffi` tracks an upstream release +tag; `uniffi-dart` is temporarily pinned to an immutable merge commit until a release tag includes +the deterministic Dart helper ordering fix. +The native Rust crate also commits `native/Cargo.lock` and uses the pinned Rust toolchain in +`native/rust-toolchain.toml` for deterministic binding generation and native build input hygiene. +The native hash comparison is reported as hygiene until the upstream UniFFI trait-ordering fix is +available through the native dependency stack. ## Development @@ -79,6 +85,12 @@ For release operations, see [PUBDEV_RELEASE_CHECKLIST.md](PUBDEV_RELEASE_CHECKLI bash ./scripts/generate_bindings.sh ``` +3. Before release-oriented changes, verify generated bindings and native build input hygiene: + + ```bash + bash ./scripts/check_reproducibility.sh + ``` + ### Testing Once you have generated `lib/bdk.dart` and the native library locally you can execute the diff --git a/hook/build.dart b/hook/build.dart index 7e7790e..096a04b 100644 --- a/hook/build.dart +++ b/hook/build.dart @@ -5,6 +5,7 @@ void main(List args) async { await build(args, (input, output) async { await const RustBuilder( assetName: 'uniffi:bdk_dart_ffi', + extraCargoBuildArgs: ['--locked'], ).run(input: input, output: output); }); } diff --git a/lib/bdk.dart b/lib/bdk.dart index 1b715f5..b4a9be5 100644 --- a/lib/bdk.dart +++ b/lib/bdk.dart @@ -24959,60 +24959,82 @@ Uint8List createUint8ListFromInt(int value) { return uint8List; } -class FfiConverterSequenceWalletEvent { - static List lift(RustBuffer buf) { - return FfiConverterSequenceWalletEvent.read(buf.asUint8List()).value; +class FfiConverterBool { + static bool lift(int value) { + return value == 1; } - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterWalletEvent.read( - Uint8List.view(buf.buffer, offset), - ); - offset += ret.bytesRead; - res.add(ret.value); - } - return LiftRetVal(res, offset - buf.offsetInBytes); + static int lower(bool value) { + return value ? 1 : 0; } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterWalletEvent.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); - } - return offset - buf.offsetInBytes; + static LiftRetVal read(Uint8List buf) { + return LiftRetVal(FfiConverterBool.lift(buf.first), 1); } - static int allocationSize(List value) { - return value - .map((l) => FfiConverterWalletEvent.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + static RustBuffer lowerIntoRustBuffer(bool value) { + return toRustBuffer(Uint8List.fromList([FfiConverterBool.lower(value)])); } - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + static int allocationSize([bool value = false]) { + return 1; + } + + static int write(bool value, Uint8List buf) { + buf.setAll(0, [value ? 1 : 0]); + return allocationSize(); } } -class FfiConverterUInt32 { +class FfiConverterDouble32 { + static double lift(double value) => value; + static LiftRetVal read(Uint8List buf) { + return LiftRetVal( + buf.buffer.asByteData(buf.offsetInBytes).getFloat32(0), + 4, + ); + } + + static double lower(double value) => value; + static int allocationSize([double value = 0]) { + return 4; + } + + static int write(double value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setFloat32(0, value); + return FfiConverterDouble32.allocationSize(); + } +} + +class FfiConverterDouble64 { + static double lift(double value) => value; + static LiftRetVal read(Uint8List buf) { + return LiftRetVal( + buf.buffer.asByteData(buf.offsetInBytes).getFloat64(0), + 8, + ); + } + + static double lower(double value) => value; + static int allocationSize([double value = 0]) { + return 8; + } + + static int write(double value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setFloat64(0, value); + return FfiConverterDouble64.allocationSize(); + } +} + +class FfiConverterInt32 { static int lift(int value) => value; static LiftRetVal read(Uint8List buf) { - return LiftRetVal(buf.buffer.asByteData(buf.offsetInBytes).getUint32(0), 4); + return LiftRetVal(buf.buffer.asByteData(buf.offsetInBytes).getInt32(0), 4); } static int lower(int value) { - if (value < 0 || value > 4294967295) { - throw ArgumentError("Value out of range for u32: " + value.toString()); + if (value < -2147483648 || value > 2147483647) { + throw ArgumentError("Value out of range for i32: " + value.toString()); } return value; } @@ -25022,82 +25044,120 @@ class FfiConverterUInt32 { } static int write(int value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setUint32(0, lower(value)); + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, lower(value)); return 4; } } -class FfiConverterSequenceUInt32 { - static List lift(RustBuffer buf) { - return FfiConverterSequenceUInt32.read(buf.asUint8List()).value; +class FfiConverterInt64 { + static int lift(int value) => value; + static LiftRetVal read(Uint8List buf) { + return LiftRetVal(buf.buffer.asByteData(buf.offsetInBytes).getInt64(0), 8); } - static LiftRetVal> read(Uint8List buf) { - List res = []; + static int lower(int value) { + if (value < -9223372036854775808 || value > 9223372036854775807) { + throw ArgumentError("Value out of range for i64: " + value.toString()); + } + return value; + } + + static int allocationSize([int value = 0]) { + return 8; + } + + static int write(int value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt64(0, lower(value)); + return 8; + } +} + +class FfiConverterMapControlBlockToTapScriptEntry { + static Map lift(RustBuffer buf) { + return FfiConverterMapControlBlockToTapScriptEntry.read( + buf.asUint8List(), + ).value; + } + + static LiftRetVal> read(Uint8List buf) { + final map = {}; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final ret = FfiConverterUInt32.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); + final k = FfiConverterControlBlock.read( + Uint8List.view(buf.buffer, offset), + ); + offset += k.bytesRead; + final v = FfiConverterTapScriptEntry.read( + Uint8List.view(buf.buffer, offset), + ); + offset += v.bytesRead; + map[k.value] = v.value; } - return LiftRetVal(res, offset - buf.offsetInBytes); + return LiftRetVal(map, offset - buf.offsetInBytes); } - static int write(List value, Uint8List buf) { + static int write(Map value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterUInt32.write( - value[i], + for (final entry in value.entries) { + offset += FfiConverterControlBlock.write( + entry.key, + Uint8List.view(buf.buffer, offset), + ); + offset += FfiConverterTapScriptEntry.write( + entry.value, Uint8List.view(buf.buffer, offset), ); } return offset - buf.offsetInBytes; } - static int allocationSize(List value) { - return value - .map((l) => FfiConverterUInt32.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + static int allocationSize(Map value) { + return value.entries + .map( + (e) => + FfiConverterControlBlock.allocationSize(e.key) + + FfiConverterTapScriptEntry.allocationSize(e.value), + ) + .fold(4, (a, b) => a + b); } - static RustBuffer lower(List value) { + static RustBuffer lower(Map value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterMapStringToUint8List { - static Map lift(RustBuffer buf) { - return FfiConverterMapStringToUint8List.read(buf.asUint8List()).value; +class FfiConverterMapDescriptorIdToUInt32 { + static Map lift(RustBuffer buf) { + return FfiConverterMapDescriptorIdToUInt32.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - final map = {}; + static LiftRetVal> read(Uint8List buf) { + final map = {}; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final k = FfiConverterString.read(Uint8List.view(buf.buffer, offset)); + final k = DescriptorId.read(Uint8List.view(buf.buffer, offset)); offset += k.bytesRead; - final v = FfiConverterUint8List.read(Uint8List.view(buf.buffer, offset)); + final v = FfiConverterUInt32.read(Uint8List.view(buf.buffer, offset)); offset += v.bytesRead; map[k.value] = v.value; } return LiftRetVal(map, offset - buf.offsetInBytes); } - static int write(Map value, Uint8List buf) { + static int write(Map value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; for (final entry in value.entries) { - offset += FfiConverterString.write( + offset += DescriptorId.write( entry.key, Uint8List.view(buf.buffer, offset), ); - offset += FfiConverterUint8List.write( + offset += FfiConverterUInt32.write( entry.value, Uint8List.view(buf.buffer, offset), ); @@ -25105,120 +25165,238 @@ class FfiConverterMapStringToUint8List { return offset - buf.offsetInBytes; } - static int allocationSize(Map value) { + static int allocationSize(Map value) { return value.entries .map( (e) => - FfiConverterString.allocationSize(e.key) + - FfiConverterUint8List.allocationSize(e.value), + DescriptorId.allocationSize(e.key) + + FfiConverterUInt32.allocationSize(e.value), ) .fold(4, (a, b) => a + b); } - static RustBuffer lower(Map value) { + static RustBuffer lower(Map value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterOptionalBool { - static bool? lift(RustBuffer buf) { - return FfiConverterOptionalBool.read(buf.asUint8List()).value; +class FfiConverterMapHashableOutPointToTxOut { + static Map lift(RustBuffer buf) { + return FfiConverterMapHashableOutPointToTxOut.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { - if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { - return LiftRetVal(null, 1); + static LiftRetVal> read(Uint8List buf) { + final map = {}; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final k = HashableOutPoint.read(Uint8List.view(buf.buffer, offset)); + offset += k.bytesRead; + final v = FfiConverterTxOut.read(Uint8List.view(buf.buffer, offset)); + offset += v.bytesRead; + map[k.value] = v.value; } - final result = FfiConverterBool.read( - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(map, offset - buf.offsetInBytes); } - static int allocationSize([bool? value]) { - if (value == null) { - return 1; + static int write(Map value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (final entry in value.entries) { + offset += HashableOutPoint.write( + entry.key, + Uint8List.view(buf.buffer, offset), + ); + offset += FfiConverterTxOut.write( + entry.value, + Uint8List.view(buf.buffer, offset), + ); } - return FfiConverterBool.allocationSize(value) + 1; + return offset - buf.offsetInBytes; } - static RustBuffer lower(bool? value) { - if (value == null) { - return toRustBuffer(Uint8List.fromList([0])); - } - final length = FfiConverterOptionalBool.allocationSize(value); - final Pointer frameData = calloc(length); - final buf = frameData.asTypedList(length); - FfiConverterOptionalBool.write(value, buf); - final bytes = calloc(); - bytes.ref.len = length; - bytes.ref.data = frameData; - return RustBuffer.fromBytes(bytes.ref); + static int allocationSize(Map value) { + return value.entries + .map( + (e) => + HashableOutPoint.allocationSize(e.key) + + FfiConverterTxOut.allocationSize(e.value), + ) + .fold(4, (a, b) => a + b); } - static int write(bool? value, Uint8List buf) { - if (value == null) { - buf[0] = 0; - return 1; + static RustBuffer lower(Map value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); + } +} + +class FfiConverterMapKeyToUint8List { + static Map lift(RustBuffer buf) { + return FfiConverterMapKeyToUint8List.read(buf.asUint8List()).value; + } + + static LiftRetVal> read(Uint8List buf) { + final map = {}; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final k = FfiConverterKey.read(Uint8List.view(buf.buffer, offset)); + offset += k.bytesRead; + final v = FfiConverterUint8List.read(Uint8List.view(buf.buffer, offset)); + offset += v.bytesRead; + map[k.value] = v.value; } - buf[0] = 1; - return FfiConverterBool.write( - value, - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ) + - 1; + return LiftRetVal(map, offset - buf.offsetInBytes); + } + + static int write(Map value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (final entry in value.entries) { + offset += FfiConverterKey.write( + entry.key, + Uint8List.view(buf.buffer, offset), + ); + offset += FfiConverterUint8List.write( + entry.value, + Uint8List.view(buf.buffer, offset), + ); + } + return offset - buf.offsetInBytes; + } + + static int allocationSize(Map value) { + return value.entries + .map( + (e) => + FfiConverterKey.allocationSize(e.key) + + FfiConverterUint8List.allocationSize(e.value), + ) + .fold(4, (a, b) => a + b); + } + + static RustBuffer lower(Map value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); } } -class FfiConverterOptionalUInt32 { - static int? lift(RustBuffer buf) { - return FfiConverterOptionalUInt32.read(buf.asUint8List()).value; +class FfiConverterMapProprietaryKeyToUint8List { + static Map lift(RustBuffer buf) { + return FfiConverterMapProprietaryKeyToUint8List.read( + buf.asUint8List(), + ).value; } - static LiftRetVal read(Uint8List buf) { - if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { - return LiftRetVal(null, 1); + static LiftRetVal> read(Uint8List buf) { + final map = {}; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final k = FfiConverterProprietaryKey.read( + Uint8List.view(buf.buffer, offset), + ); + offset += k.bytesRead; + final v = FfiConverterUint8List.read(Uint8List.view(buf.buffer, offset)); + offset += v.bytesRead; + map[k.value] = v.value; } - final result = FfiConverterUInt32.read( - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(map, offset - buf.offsetInBytes); } - static int allocationSize([int? value]) { - if (value == null) { - return 1; + static int write(Map value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (final entry in value.entries) { + offset += FfiConverterProprietaryKey.write( + entry.key, + Uint8List.view(buf.buffer, offset), + ); + offset += FfiConverterUint8List.write( + entry.value, + Uint8List.view(buf.buffer, offset), + ); } - return FfiConverterUInt32.allocationSize(value) + 1; + return offset - buf.offsetInBytes; } - static RustBuffer lower(int? value) { - if (value == null) { - return toRustBuffer(Uint8List.fromList([0])); + static int allocationSize(Map value) { + return value.entries + .map( + (e) => + FfiConverterProprietaryKey.allocationSize(e.key) + + FfiConverterUint8List.allocationSize(e.value), + ) + .fold(4, (a, b) => a + b); + } + + static RustBuffer lower(Map value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); + } +} + +class FfiConverterMapSequenceUInt32ToSequenceCondition { + static Map, List> lift(RustBuffer buf) { + return FfiConverterMapSequenceUInt32ToSequenceCondition.read( + buf.asUint8List(), + ).value; + } + + static LiftRetVal, List>> read(Uint8List buf) { + final map = , List>{}; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final k = FfiConverterSequenceUInt32.read( + Uint8List.view(buf.buffer, offset), + ); + offset += k.bytesRead; + final v = FfiConverterSequenceCondition.read( + Uint8List.view(buf.buffer, offset), + ); + offset += v.bytesRead; + map[k.value] = v.value; } - final length = FfiConverterOptionalUInt32.allocationSize(value); - final Pointer frameData = calloc(length); - final buf = frameData.asTypedList(length); - FfiConverterOptionalUInt32.write(value, buf); - final bytes = calloc(); - bytes.ref.len = length; - bytes.ref.data = frameData; - return RustBuffer.fromBytes(bytes.ref); + return LiftRetVal(map, offset - buf.offsetInBytes); } - static int write(int? value, Uint8List buf) { - if (value == null) { - buf[0] = 0; - return 1; + static int write(Map, List> value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (final entry in value.entries) { + offset += FfiConverterSequenceUInt32.write( + entry.key, + Uint8List.view(buf.buffer, offset), + ); + offset += FfiConverterSequenceCondition.write( + entry.value, + Uint8List.view(buf.buffer, offset), + ); } - buf[0] = 1; - return FfiConverterUInt32.write( - value, - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ) + - 1; + return offset - buf.offsetInBytes; + } + + static int allocationSize(Map, List> value) { + return value.entries + .map( + (e) => + FfiConverterSequenceUInt32.allocationSize(e.key) + + FfiConverterSequenceCondition.allocationSize(e.value), + ) + .fold(4, (a, b) => a + b); + } + + static RustBuffer lower(Map, List> value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); } } @@ -25274,38 +25452,36 @@ class FfiConverterMapStringToKeySource { } } -class FfiConverterMapTapScriptSigKeyToUint8List { - static Map lift(RustBuffer buf) { - return FfiConverterMapTapScriptSigKeyToUint8List.read( - buf.asUint8List(), - ).value; +class FfiConverterMapStringToSequenceUInt64 { + static Map> lift(RustBuffer buf) { + return FfiConverterMapStringToSequenceUInt64.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - final map = {}; + static LiftRetVal>> read(Uint8List buf) { + final map = >{}; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final k = FfiConverterTapScriptSigKey.read( + final k = FfiConverterString.read(Uint8List.view(buf.buffer, offset)); + offset += k.bytesRead; + final v = FfiConverterSequenceUInt64.read( Uint8List.view(buf.buffer, offset), ); - offset += k.bytesRead; - final v = FfiConverterUint8List.read(Uint8List.view(buf.buffer, offset)); offset += v.bytesRead; map[k.value] = v.value; } return LiftRetVal(map, offset - buf.offsetInBytes); } - static int write(Map value, Uint8List buf) { + static int write(Map> value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; for (final entry in value.entries) { - offset += FfiConverterTapScriptSigKey.write( + offset += FfiConverterString.write( entry.key, Uint8List.view(buf.buffer, offset), ); - offset += FfiConverterUint8List.write( + offset += FfiConverterSequenceUInt64.write( entry.value, Uint8List.view(buf.buffer, offset), ); @@ -25313,338 +25489,385 @@ class FfiConverterMapTapScriptSigKeyToUint8List { return offset - buf.offsetInBytes; } - static int allocationSize(Map value) { + static int allocationSize(Map> value) { return value.entries .map( (e) => - FfiConverterTapScriptSigKey.allocationSize(e.key) + - FfiConverterUint8List.allocationSize(e.value), + FfiConverterString.allocationSize(e.key) + + FfiConverterSequenceUInt64.allocationSize(e.value), ) .fold(4, (a, b) => a + b); } - static RustBuffer lower(Map value) { + static RustBuffer lower(Map> value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterOptionalUInt64 { - static int? lift(RustBuffer buf) { - return FfiConverterOptionalUInt64.read(buf.asUint8List()).value; - } - - static LiftRetVal read(Uint8List buf) { - if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { - return LiftRetVal(null, 1); - } - final result = FfiConverterUInt64.read( - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ); - return LiftRetVal(result.value, result.bytesRead + 1); +class FfiConverterMapStringToTapKeyOrigin { + static Map lift(RustBuffer buf) { + return FfiConverterMapStringToTapKeyOrigin.read(buf.asUint8List()).value; } - static int allocationSize([int? value]) { - if (value == null) { - return 1; - } - return FfiConverterUInt64.allocationSize(value) + 1; - } - - static RustBuffer lower(int? value) { - if (value == null) { - return toRustBuffer(Uint8List.fromList([0])); - } - final length = FfiConverterOptionalUInt64.allocationSize(value); - final Pointer frameData = calloc(length); - final buf = frameData.asTypedList(length); - FfiConverterOptionalUInt64.write(value, buf); - final bytes = calloc(); - bytes.ref.len = length; - bytes.ref.data = frameData; - return RustBuffer.fromBytes(bytes.ref); - } - - static int write(int? value, Uint8List buf) { - if (value == null) { - buf[0] = 0; - return 1; - } - buf[0] = 1; - return FfiConverterUInt64.write( - value, - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ) + - 1; - } -} - -class FfiConverterOptionalInt64 { - static int? lift(RustBuffer buf) { - return FfiConverterOptionalInt64.read(buf.asUint8List()).value; - } - - static LiftRetVal read(Uint8List buf) { - if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { - return LiftRetVal(null, 1); + static LiftRetVal> read(Uint8List buf) { + final map = {}; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final k = FfiConverterString.read(Uint8List.view(buf.buffer, offset)); + offset += k.bytesRead; + final v = FfiConverterTapKeyOrigin.read( + Uint8List.view(buf.buffer, offset), + ); + offset += v.bytesRead; + map[k.value] = v.value; } - final result = FfiConverterInt64.read( - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(map, offset - buf.offsetInBytes); } - static int allocationSize([int? value]) { - if (value == null) { - return 1; + static int write(Map value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (final entry in value.entries) { + offset += FfiConverterString.write( + entry.key, + Uint8List.view(buf.buffer, offset), + ); + offset += FfiConverterTapKeyOrigin.write( + entry.value, + Uint8List.view(buf.buffer, offset), + ); } - return FfiConverterInt64.allocationSize(value) + 1; + return offset - buf.offsetInBytes; } - static RustBuffer lower(int? value) { - if (value == null) { - return toRustBuffer(Uint8List.fromList([0])); - } - final length = FfiConverterOptionalInt64.allocationSize(value); - final Pointer frameData = calloc(length); - final buf = frameData.asTypedList(length); - FfiConverterOptionalInt64.write(value, buf); - final bytes = calloc(); - bytes.ref.len = length; - bytes.ref.data = frameData; - return RustBuffer.fromBytes(bytes.ref); + static int allocationSize(Map value) { + return value.entries + .map( + (e) => + FfiConverterString.allocationSize(e.key) + + FfiConverterTapKeyOrigin.allocationSize(e.value), + ) + .fold(4, (a, b) => a + b); } - static int write(int? value, Uint8List buf) { - if (value == null) { - buf[0] = 0; - return 1; - } - buf[0] = 1; - return FfiConverterInt64.write( - value, - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ) + - 1; + static RustBuffer lower(Map value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); } } -class FfiConverterSequenceUInt64 { - static List lift(RustBuffer buf) { - return FfiConverterSequenceUInt64.read(buf.asUint8List()).value; +class FfiConverterMapStringToUint8List { + static Map lift(RustBuffer buf) { + return FfiConverterMapStringToUint8List.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; + static LiftRetVal> read(Uint8List buf) { + final map = {}; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final ret = FfiConverterUInt64.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); + final k = FfiConverterString.read(Uint8List.view(buf.buffer, offset)); + offset += k.bytesRead; + final v = FfiConverterUint8List.read(Uint8List.view(buf.buffer, offset)); + offset += v.bytesRead; + map[k.value] = v.value; } - return LiftRetVal(res, offset - buf.offsetInBytes); + return LiftRetVal(map, offset - buf.offsetInBytes); } - static int write(List value, Uint8List buf) { + static int write(Map value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterUInt64.write( - value[i], + for (final entry in value.entries) { + offset += FfiConverterString.write( + entry.key, + Uint8List.view(buf.buffer, offset), + ); + offset += FfiConverterUint8List.write( + entry.value, Uint8List.view(buf.buffer, offset), ); } return offset - buf.offsetInBytes; } - static int allocationSize(List value) { - return value - .map((l) => FfiConverterUInt64.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + static int allocationSize(Map value) { + return value.entries + .map( + (e) => + FfiConverterString.allocationSize(e.key) + + FfiConverterUint8List.allocationSize(e.value), + ) + .fold(4, (a, b) => a + b); } - static RustBuffer lower(List value) { + static RustBuffer lower(Map value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterSequencePkOrF { - static List lift(RustBuffer buf) { - return FfiConverterSequencePkOrF.read(buf.asUint8List()).value; +class FfiConverterMapTapScriptSigKeyToUint8List { + static Map lift(RustBuffer buf) { + return FfiConverterMapTapScriptSigKeyToUint8List.read( + buf.asUint8List(), + ).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; + static LiftRetVal> read(Uint8List buf) { + final map = {}; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final ret = FfiConverterPkOrF.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); + final k = FfiConverterTapScriptSigKey.read( + Uint8List.view(buf.buffer, offset), + ); + offset += k.bytesRead; + final v = FfiConverterUint8List.read(Uint8List.view(buf.buffer, offset)); + offset += v.bytesRead; + map[k.value] = v.value; } - return LiftRetVal(res, offset - buf.offsetInBytes); + return LiftRetVal(map, offset - buf.offsetInBytes); } - static int write(List value, Uint8List buf) { + static int write(Map value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterPkOrF.write( - value[i], + for (final entry in value.entries) { + offset += FfiConverterTapScriptSigKey.write( + entry.key, + Uint8List.view(buf.buffer, offset), + ); + offset += FfiConverterUint8List.write( + entry.value, Uint8List.view(buf.buffer, offset), ); } return offset - buf.offsetInBytes; } - static int allocationSize(List value) { - return value - .map((l) => FfiConverterPkOrF.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + static int allocationSize(Map value) { + return value.entries + .map( + (e) => + FfiConverterTapScriptSigKey.allocationSize(e.key) + + FfiConverterUint8List.allocationSize(e.value), + ) + .fold(4, (a, b) => a + b); } - static RustBuffer lower(List value) { + static RustBuffer lower(Map value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterSequenceConflict { - static List lift(RustBuffer buf) { - return FfiConverterSequenceConflict.read(buf.asUint8List()).value; +class FfiConverterMapTxidToUInt64 { + static Map lift(RustBuffer buf) { + return FfiConverterMapTxidToUInt64.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; + static LiftRetVal> read(Uint8List buf) { + final map = {}; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final ret = FfiConverterConflict.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); + final k = Txid.read(Uint8List.view(buf.buffer, offset)); + offset += k.bytesRead; + final v = FfiConverterUInt64.read(Uint8List.view(buf.buffer, offset)); + offset += v.bytesRead; + map[k.value] = v.value; } - return LiftRetVal(res, offset - buf.offsetInBytes); + return LiftRetVal(map, offset - buf.offsetInBytes); } - static int write(List value, Uint8List buf) { + static int write(Map value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterConflict.write( - value[i], + for (final entry in value.entries) { + offset += Txid.write(entry.key, Uint8List.view(buf.buffer, offset)); + offset += FfiConverterUInt64.write( + entry.value, Uint8List.view(buf.buffer, offset), ); } return offset - buf.offsetInBytes; } - static int allocationSize(List value) { - return value - .map((l) => FfiConverterConflict.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + static int allocationSize(Map value) { + return value.entries + .map( + (e) => + Txid.allocationSize(e.key) + + FfiConverterUInt64.allocationSize(e.value), + ) + .fold(4, (a, b) => a + b); } - static RustBuffer lower(List value) { + static RustBuffer lower(Map value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterSequenceCanonicalTx { - static List lift(RustBuffer buf) { - return FfiConverterSequenceCanonicalTx.read(buf.asUint8List()).value; +class FfiConverterMapUInt16ToDouble64 { + static Map lift(RustBuffer buf) { + return FfiConverterMapUInt16ToDouble64.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; + static LiftRetVal> read(Uint8List buf) { + final map = {}; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final ret = FfiConverterCanonicalTx.read( + final k = FfiConverterUInt16.read(Uint8List.view(buf.buffer, offset)); + offset += k.bytesRead; + final v = FfiConverterDouble64.read(Uint8List.view(buf.buffer, offset)); + offset += v.bytesRead; + map[k.value] = v.value; + } + return LiftRetVal(map, offset - buf.offsetInBytes); + } + + static int write(Map value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (final entry in value.entries) { + offset += FfiConverterUInt16.write( + entry.key, + Uint8List.view(buf.buffer, offset), + ); + offset += FfiConverterDouble64.write( + entry.value, Uint8List.view(buf.buffer, offset), ); - offset += ret.bytesRead; - res.add(ret.value); } - return LiftRetVal(res, offset - buf.offsetInBytes); + return offset - buf.offsetInBytes; } - static int write(List value, Uint8List buf) { + static int allocationSize(Map value) { + return value.entries + .map( + (e) => + FfiConverterUInt16.allocationSize(e.key) + + FfiConverterDouble64.allocationSize(e.value), + ) + .fold(4, (a, b) => a + b); + } + + static RustBuffer lower(Map value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); + } +} + +class FfiConverterMapUInt32ToSequenceCondition { + static Map> lift(RustBuffer buf) { + return FfiConverterMapUInt32ToSequenceCondition.read( + buf.asUint8List(), + ).value; + } + + static LiftRetVal>> read(Uint8List buf) { + final map = >{}; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final k = FfiConverterUInt32.read(Uint8List.view(buf.buffer, offset)); + offset += k.bytesRead; + final v = FfiConverterSequenceCondition.read( + Uint8List.view(buf.buffer, offset), + ); + offset += v.bytesRead; + map[k.value] = v.value; + } + return LiftRetVal(map, offset - buf.offsetInBytes); + } + + static int write(Map> value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterCanonicalTx.write( - value[i], + for (final entry in value.entries) { + offset += FfiConverterUInt32.write( + entry.key, + Uint8List.view(buf.buffer, offset), + ); + offset += FfiConverterSequenceCondition.write( + entry.value, Uint8List.view(buf.buffer, offset), ); } return offset - buf.offsetInBytes; } - static int allocationSize(List value) { - return value - .map((l) => FfiConverterCanonicalTx.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + static int allocationSize(Map> value) { + return value.entries + .map( + (e) => + FfiConverterUInt32.allocationSize(e.key) + + FfiConverterSequenceCondition.allocationSize(e.value), + ) + .fold(4, (a, b) => a + b); } - static RustBuffer lower(List value) { + static RustBuffer lower(Map> value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterOptionalTxid { - static Txid? lift(RustBuffer buf) { - return FfiConverterOptionalTxid.read(buf.asUint8List()).value; +class FfiConverterOptionalAmount { + static Amount? lift(RustBuffer buf) { + return FfiConverterOptionalAmount.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = Txid.read(Uint8List.view(buf.buffer, buf.offsetInBytes + 1)); - return LiftRetVal(result.value, result.bytesRead + 1); + final result = Amount.read( + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([Txid? value]) { + static int allocationSize([Amount? value]) { if (value == null) { return 1; } - return Txid.allocationSize(value) + 1; + return Amount.allocationSize(value) + 1; } - static RustBuffer lower(Txid? value) { + static RustBuffer lower(Amount? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalTxid.allocationSize(value); + final length = FfiConverterOptionalAmount.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalTxid.write(value, buf); + FfiConverterOptionalAmount.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(Txid? value, Uint8List buf) { + static int write(Amount? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return Txid.write( + return Amount.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -25652,56 +25875,49 @@ class FfiConverterOptionalTxid { } } -class FfiConverterOptionalConfirmationBlockTime { - static ConfirmationBlockTime? lift(RustBuffer buf) { - return FfiConverterOptionalConfirmationBlockTime.read( - buf.asUint8List(), - ).value; +class FfiConverterOptionalBlock { + static Block? lift(RustBuffer buf) { + return FfiConverterOptionalBlock.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterConfirmationBlockTime.read( + final result = FfiConverterBlock.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal( - result.value, - result.bytesRead + 1, - ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([ConfirmationBlockTime? value]) { + static int allocationSize([Block? value]) { if (value == null) { return 1; } - return FfiConverterConfirmationBlockTime.allocationSize(value) + 1; + return FfiConverterBlock.allocationSize(value) + 1; } - static RustBuffer lower(ConfirmationBlockTime? value) { + static RustBuffer lower(Block? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalConfirmationBlockTime.allocationSize( - value, - ); + final length = FfiConverterOptionalBlock.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalConfirmationBlockTime.write(value, buf); + FfiConverterOptionalBlock.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(ConfirmationBlockTime? value, Uint8List buf) { + static int write(Block? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterConfirmationBlockTime.write( + return FfiConverterBlock.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -25709,89 +25925,99 @@ class FfiConverterOptionalConfirmationBlockTime { } } -class FfiConverterSequenceIpAddress { - static List lift(RustBuffer buf) { - return FfiConverterSequenceIpAddress.read(buf.asUint8List()).value; +class FfiConverterOptionalBlockHash { + static BlockHash? lift(RustBuffer buf) { + return FfiConverterOptionalBlockHash.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = IpAddress.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); + static LiftRetVal read(Uint8List buf) { + if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { + return LiftRetVal(null, 1); } - return LiftRetVal(res, offset - buf.offsetInBytes); + final result = BlockHash.read( + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += IpAddress.write(value[i], Uint8List.view(buf.buffer, offset)); + static int allocationSize([BlockHash? value]) { + if (value == null) { + return 1; } - return offset - buf.offsetInBytes; + return BlockHash.allocationSize(value) + 1; } - static int allocationSize(List value) { - return value - .map((l) => IpAddress.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + static RustBuffer lower(BlockHash? value) { + if (value == null) { + return toRustBuffer(Uint8List.fromList([0])); + } + final length = FfiConverterOptionalBlockHash.allocationSize(value); + final Pointer frameData = calloc(length); + final buf = frameData.asTypedList(length); + FfiConverterOptionalBlockHash.write(value, buf); + final bytes = calloc(); + bytes.ref.len = length; + bytes.ref.data = frameData; + return RustBuffer.fromBytes(bytes.ref); } - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + static int write(BlockHash? value, Uint8List buf) { + if (value == null) { + buf[0] = 0; + return 1; + } + buf[0] = 1; + return BlockHash.write( + value, + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ) + + 1; } } -class FfiConverterOptionalUInt16 { - static int? lift(RustBuffer buf) { - return FfiConverterOptionalUInt16.read(buf.asUint8List()).value; +class FfiConverterOptionalBool { + static bool? lift(RustBuffer buf) { + return FfiConverterOptionalBool.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterUInt16.read( + final result = FfiConverterBool.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([int? value]) { + static int allocationSize([bool? value]) { if (value == null) { return 1; } - return FfiConverterUInt16.allocationSize(value) + 1; + return FfiConverterBool.allocationSize(value) + 1; } - static RustBuffer lower(int? value) { + static RustBuffer lower(bool? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalUInt16.allocationSize(value); + final length = FfiConverterOptionalBool.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalUInt16.write(value, buf); + FfiConverterOptionalBool.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(int? value, Uint8List buf) { + static int write(bool? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterUInt16.write( + return FfiConverterBool.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -25799,192 +26025,49 @@ class FfiConverterOptionalUInt16 { } } -class FfiConverterUInt64 { - static int lift(int value) => value; - static LiftRetVal read(Uint8List buf) { - return LiftRetVal(buf.buffer.asByteData(buf.offsetInBytes).getUint64(0), 8); - } - - static int lower(int value) { - if (value < 0) { - throw ArgumentError("Value out of range for u64: " + value.toString()); - } - return value; - } - - static int allocationSize([int value = 0]) { - return 8; - } - - static int write(int value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setUint64(0, lower(value)); - return 8; - } -} - -class FfiConverterMapProprietaryKeyToUint8List { - static Map lift(RustBuffer buf) { - return FfiConverterMapProprietaryKeyToUint8List.read( - buf.asUint8List(), - ).value; - } - - static LiftRetVal> read(Uint8List buf) { - final map = {}; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final k = FfiConverterProprietaryKey.read( - Uint8List.view(buf.buffer, offset), - ); - offset += k.bytesRead; - final v = FfiConverterUint8List.read(Uint8List.view(buf.buffer, offset)); - offset += v.bytesRead; - map[k.value] = v.value; - } - return LiftRetVal(map, offset - buf.offsetInBytes); - } - - static int write(Map value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (final entry in value.entries) { - offset += FfiConverterProprietaryKey.write( - entry.key, - Uint8List.view(buf.buffer, offset), - ); - offset += FfiConverterUint8List.write( - entry.value, - Uint8List.view(buf.buffer, offset), - ); - } - return offset - buf.offsetInBytes; - } - - static int allocationSize(Map value) { - return value.entries - .map( - (e) => - FfiConverterProprietaryKey.allocationSize(e.key) + - FfiConverterUint8List.allocationSize(e.value), - ) - .fold(4, (a, b) => a + b); - } - - static RustBuffer lower(Map value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); - } -} - -class FfiConverterString { - static String lift(RustBuffer buf) { - return utf8.decoder.convert(buf.asUint8List()); - } - - static RustBuffer lower(String value) { - return toRustBuffer(Utf8Encoder().convert(value)); - } - - static LiftRetVal read(Uint8List buf) { - final end = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0) + 4; - return LiftRetVal(utf8.decoder.convert(buf, 4, end), end); - } - - static int allocationSize([String value = ""]) { - return utf8.encoder.convert(value).length + 4; - } - - static int write(String value, Uint8List buf) { - final list = utf8.encoder.convert(value); - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, list.length); - buf.setAll(4, list); - return list.length + 4; - } -} - -class FfiConverterSequencePolicy { - static List lift(RustBuffer buf) { - return FfiConverterSequencePolicy.read(buf.asUint8List()).value; - } - - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = Policy.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); - } - return LiftRetVal(res, offset - buf.offsetInBytes); - } - - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += Policy.write(value[i], Uint8List.view(buf.buffer, offset)); - } - return offset - buf.offsetInBytes; - } - - static int allocationSize(List value) { - return value.map((l) => Policy.allocationSize(l)).fold(0, (a, b) => a + b) + - 4; - } - - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); - } -} - -class FfiConverterOptionalKeychainAndIndex { - static KeychainAndIndex? lift(RustBuffer buf) { - return FfiConverterOptionalKeychainAndIndex.read(buf.asUint8List()).value; +class FfiConverterOptionalCanonicalTx { + static CanonicalTx? lift(RustBuffer buf) { + return FfiConverterOptionalCanonicalTx.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterKeychainAndIndex.read( + final result = FfiConverterCanonicalTx.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([KeychainAndIndex? value]) { + static int allocationSize([CanonicalTx? value]) { if (value == null) { return 1; } - return FfiConverterKeychainAndIndex.allocationSize(value) + 1; + return FfiConverterCanonicalTx.allocationSize(value) + 1; } - static RustBuffer lower(KeychainAndIndex? value) { + static RustBuffer lower(CanonicalTx? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalKeychainAndIndex.allocationSize(value); + final length = FfiConverterOptionalCanonicalTx.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalKeychainAndIndex.write(value, buf); + FfiConverterOptionalCanonicalTx.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(KeychainAndIndex? value, Uint8List buf) { + static int write(CanonicalTx? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterKeychainAndIndex.write( + return FfiConverterCanonicalTx.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -25992,105 +26075,49 @@ class FfiConverterOptionalKeychainAndIndex { } } -class FfiConverterMapUInt32ToSequenceCondition { - static Map> lift(RustBuffer buf) { - return FfiConverterMapUInt32ToSequenceCondition.read( - buf.asUint8List(), - ).value; - } - - static LiftRetVal>> read(Uint8List buf) { - final map = >{}; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final k = FfiConverterUInt32.read(Uint8List.view(buf.buffer, offset)); - offset += k.bytesRead; - final v = FfiConverterSequenceCondition.read( - Uint8List.view(buf.buffer, offset), - ); - offset += v.bytesRead; - map[k.value] = v.value; - } - return LiftRetVal(map, offset - buf.offsetInBytes); - } - - static int write(Map> value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (final entry in value.entries) { - offset += FfiConverterUInt32.write( - entry.key, - Uint8List.view(buf.buffer, offset), - ); - offset += FfiConverterSequenceCondition.write( - entry.value, - Uint8List.view(buf.buffer, offset), - ); - } - return offset - buf.offsetInBytes; - } - - static int allocationSize(Map> value) { - return value.entries - .map( - (e) => - FfiConverterUInt32.allocationSize(e.key) + - FfiConverterSequenceCondition.allocationSize(e.value), - ) - .fold(4, (a, b) => a + b); - } - - static RustBuffer lower(Map> value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); - } -} - -class FfiConverterOptionalTapTree { - static TapTree? lift(RustBuffer buf) { - return FfiConverterOptionalTapTree.read(buf.asUint8List()).value; +class FfiConverterOptionalChangeSet { + static ChangeSet? lift(RustBuffer buf) { + return FfiConverterOptionalChangeSet.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = TapTree.read( + final result = ChangeSet.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([TapTree? value]) { + static int allocationSize([ChangeSet? value]) { if (value == null) { return 1; } - return TapTree.allocationSize(value) + 1; + return ChangeSet.allocationSize(value) + 1; } - static RustBuffer lower(TapTree? value) { + static RustBuffer lower(ChangeSet? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalTapTree.allocationSize(value); + final length = FfiConverterOptionalChangeSet.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalTapTree.write(value, buf); + FfiConverterOptionalChangeSet.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(TapTree? value, Uint8List buf) { + static int write(ChangeSet? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return TapTree.write( + return ChangeSet.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -26098,103 +26125,106 @@ class FfiConverterOptionalTapTree { } } -class FfiConverterMapStringToTapKeyOrigin { - static Map lift(RustBuffer buf) { - return FfiConverterMapStringToTapKeyOrigin.read(buf.asUint8List()).value; +class FfiConverterOptionalConfirmationBlockTime { + static ConfirmationBlockTime? lift(RustBuffer buf) { + return FfiConverterOptionalConfirmationBlockTime.read( + buf.asUint8List(), + ).value; } - static LiftRetVal> read(Uint8List buf) { - final map = {}; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final k = FfiConverterString.read(Uint8List.view(buf.buffer, offset)); - offset += k.bytesRead; - final v = FfiConverterTapKeyOrigin.read( - Uint8List.view(buf.buffer, offset), - ); - offset += v.bytesRead; - map[k.value] = v.value; + static LiftRetVal read(Uint8List buf) { + if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { + return LiftRetVal(null, 1); } - return LiftRetVal(map, offset - buf.offsetInBytes); + final result = FfiConverterConfirmationBlockTime.read( + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ); + return LiftRetVal( + result.value, + result.bytesRead + 1, + ); } - static int write(Map value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (final entry in value.entries) { - offset += FfiConverterString.write( - entry.key, - Uint8List.view(buf.buffer, offset), - ); - offset += FfiConverterTapKeyOrigin.write( - entry.value, - Uint8List.view(buf.buffer, offset), - ); + static int allocationSize([ConfirmationBlockTime? value]) { + if (value == null) { + return 1; } - return offset - buf.offsetInBytes; + return FfiConverterConfirmationBlockTime.allocationSize(value) + 1; } - static int allocationSize(Map value) { - return value.entries - .map( - (e) => - FfiConverterString.allocationSize(e.key) + - FfiConverterTapKeyOrigin.allocationSize(e.value), - ) - .fold(4, (a, b) => a + b); + static RustBuffer lower(ConfirmationBlockTime? value) { + if (value == null) { + return toRustBuffer(Uint8List.fromList([0])); + } + final length = FfiConverterOptionalConfirmationBlockTime.allocationSize( + value, + ); + final Pointer frameData = calloc(length); + final buf = frameData.asTypedList(length); + FfiConverterOptionalConfirmationBlockTime.write(value, buf); + final bytes = calloc(); + bytes.ref.len = length; + bytes.ref.data = frameData; + return RustBuffer.fromBytes(bytes.ref); } - static RustBuffer lower(Map value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + static int write(ConfirmationBlockTime? value, Uint8List buf) { + if (value == null) { + buf[0] = 0; + return 1; + } + buf[0] = 1; + return FfiConverterConfirmationBlockTime.write( + value, + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ) + + 1; } } -class FfiConverterOptionalTxStatus { - static TxStatus? lift(RustBuffer buf) { - return FfiConverterOptionalTxStatus.read(buf.asUint8List()).value; +class FfiConverterOptionalDescriptor { + static Descriptor? lift(RustBuffer buf) { + return FfiConverterOptionalDescriptor.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterTxStatus.read( + final result = Descriptor.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([TxStatus? value]) { + static int allocationSize([Descriptor? value]) { if (value == null) { return 1; } - return FfiConverterTxStatus.allocationSize(value) + 1; + return Descriptor.allocationSize(value) + 1; } - static RustBuffer lower(TxStatus? value) { + static RustBuffer lower(Descriptor? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalTxStatus.allocationSize(value); + final length = FfiConverterOptionalDescriptor.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalTxStatus.write(value, buf); + FfiConverterOptionalDescriptor.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(TxStatus? value, Uint8List buf) { + static int write(Descriptor? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterTxStatus.write( + return Descriptor.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -26202,155 +26232,99 @@ class FfiConverterOptionalTxStatus { } } -class FfiConverterSequencePeer { - static List lift(RustBuffer buf) { - return FfiConverterSequencePeer.read(buf.asUint8List()).value; - } - - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterPeer.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); - } - return LiftRetVal(res, offset - buf.offsetInBytes); +class FfiConverterOptionalDouble32 { + static double? lift(RustBuffer buf) { + return FfiConverterOptionalDouble32.read(buf.asUint8List()).value; } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterPeer.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); + static LiftRetVal read(Uint8List buf) { + if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { + return LiftRetVal(null, 1); } - return offset - buf.offsetInBytes; - } - - static int allocationSize(List value) { - return value - .map((l) => FfiConverterPeer.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; - } - - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); - } -} - -class FfiConverterDouble32 { - static double lift(double value) => value; - static LiftRetVal read(Uint8List buf) { - return LiftRetVal( - buf.buffer.asByteData(buf.offsetInBytes).getFloat32(0), - 4, + final result = FfiConverterDouble32.read( + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static double lower(double value) => value; - static int allocationSize([double value = 0]) { - return 4; - } - - static int write(double value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setFloat32(0, value); - return FfiConverterDouble32.allocationSize(); - } -} - -class FfiConverterSequenceInput { - static List lift(RustBuffer buf) { - return FfiConverterSequenceInput.read(buf.asUint8List()).value; - } - - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterInput.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); + static int allocationSize([double? value]) { + if (value == null) { + return 1; } - return LiftRetVal(res, offset - buf.offsetInBytes); + return FfiConverterDouble32.allocationSize(value) + 1; } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterInput.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); + static RustBuffer lower(double? value) { + if (value == null) { + return toRustBuffer(Uint8List.fromList([0])); } - return offset - buf.offsetInBytes; - } - - static int allocationSize(List value) { - return value - .map((l) => FfiConverterInput.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + final length = FfiConverterOptionalDouble32.allocationSize(value); + final Pointer frameData = calloc(length); + final buf = frameData.asTypedList(length); + FfiConverterOptionalDouble32.write(value, buf); + final bytes = calloc(); + bytes.ref.len = length; + bytes.ref.data = frameData; + return RustBuffer.fromBytes(bytes.ref); } - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + static int write(double? value, Uint8List buf) { + if (value == null) { + buf[0] = 0; + return 1; + } + buf[0] = 1; + return FfiConverterDouble32.write( + value, + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ) + + 1; } } -class FfiConverterOptionalUInt8 { - static int? lift(RustBuffer buf) { - return FfiConverterOptionalUInt8.read(buf.asUint8List()).value; +class FfiConverterOptionalHeaderNotification { + static HeaderNotification? lift(RustBuffer buf) { + return FfiConverterOptionalHeaderNotification.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterUInt8.read( + final result = FfiConverterHeaderNotification.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([int? value]) { + static int allocationSize([HeaderNotification? value]) { if (value == null) { return 1; } - return FfiConverterUInt8.allocationSize(value) + 1; + return FfiConverterHeaderNotification.allocationSize(value) + 1; } - static RustBuffer lower(int? value) { + static RustBuffer lower(HeaderNotification? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalUInt8.allocationSize(value); + final length = FfiConverterOptionalHeaderNotification.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalUInt8.write(value, buf); + FfiConverterOptionalHeaderNotification.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(int? value, Uint8List buf) { + static int write(HeaderNotification? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterUInt8.write( + return FfiConverterHeaderNotification.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -26358,206 +26332,99 @@ class FfiConverterOptionalUInt8 { } } -class FfiConverterSequenceLeafNode { - static List lift(RustBuffer buf) { - return FfiConverterSequenceLeafNode.read(buf.asUint8List()).value; - } - - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = LeafNode.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); - } - return LiftRetVal(res, offset - buf.offsetInBytes); - } - - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += LeafNode.write(value[i], Uint8List.view(buf.buffer, offset)); - } - return offset - buf.offsetInBytes; - } - - static int allocationSize(List value) { - return value - .map((l) => LeafNode.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; - } - - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); - } -} - -class FfiConverterBool { - static bool lift(int value) { - return value == 1; - } - - static int lower(bool value) { - return value ? 1 : 0; - } - - static LiftRetVal read(Uint8List buf) { - return LiftRetVal(FfiConverterBool.lift(buf.first), 1); - } - - static RustBuffer lowerIntoRustBuffer(bool value) { - return toRustBuffer(Uint8List.fromList([FfiConverterBool.lower(value)])); - } - - static int allocationSize([bool value = false]) { - return 1; - } - - static int write(bool value, Uint8List buf) { - buf.setAll(0, [value ? 1 : 0]); - return allocationSize(); - } -} - -class FfiConverterSequenceUnconfirmedTx { - static List lift(RustBuffer buf) { - return FfiConverterSequenceUnconfirmedTx.read(buf.asUint8List()).value; +class FfiConverterOptionalInt64 { + static int? lift(RustBuffer buf) { + return FfiConverterOptionalInt64.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterUnconfirmedTx.read( - Uint8List.view(buf.buffer, offset), - ); - offset += ret.bytesRead; - res.add(ret.value); + static LiftRetVal read(Uint8List buf) { + if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { + return LiftRetVal(null, 1); } - return LiftRetVal(res, offset - buf.offsetInBytes); + final result = FfiConverterInt64.read( + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterUnconfirmedTx.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); + static int allocationSize([int? value]) { + if (value == null) { + return 1; } - return offset - buf.offsetInBytes; - } - - static int allocationSize(List value) { - return value - .map((l) => FfiConverterUnconfirmedTx.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; - } - - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); - } -} - -class FfiConverterSequenceEvictedTx { - static List lift(RustBuffer buf) { - return FfiConverterSequenceEvictedTx.read(buf.asUint8List()).value; + return FfiConverterInt64.allocationSize(value) + 1; } - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterEvictedTx.read( - Uint8List.view(buf.buffer, offset), - ); - offset += ret.bytesRead; - res.add(ret.value); + static RustBuffer lower(int? value) { + if (value == null) { + return toRustBuffer(Uint8List.fromList([0])); } - return LiftRetVal(res, offset - buf.offsetInBytes); + final length = FfiConverterOptionalInt64.allocationSize(value); + final Pointer frameData = calloc(length); + final buf = frameData.asTypedList(length); + FfiConverterOptionalInt64.write(value, buf); + final bytes = calloc(); + bytes.ref.len = length; + bytes.ref.data = frameData; + return RustBuffer.fromBytes(bytes.ref); } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterEvictedTx.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); + static int write(int? value, Uint8List buf) { + if (value == null) { + buf[0] = 0; + return 1; } - return offset - buf.offsetInBytes; - } - - static int allocationSize(List value) { - return value - .map((l) => FfiConverterEvictedTx.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; - } - - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + buf[0] = 1; + return FfiConverterInt64.write( + value, + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ) + + 1; } } -class FfiConverterOptionalScript { - static Script? lift(RustBuffer buf) { - return FfiConverterOptionalScript.read(buf.asUint8List()).value; +class FfiConverterOptionalKeychainAndIndex { + static KeychainAndIndex? lift(RustBuffer buf) { + return FfiConverterOptionalKeychainAndIndex.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = Script.read( + final result = FfiConverterKeychainAndIndex.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([Script? value]) { + static int allocationSize([KeychainAndIndex? value]) { if (value == null) { return 1; } - return Script.allocationSize(value) + 1; + return FfiConverterKeychainAndIndex.allocationSize(value) + 1; } - static RustBuffer lower(Script? value) { + static RustBuffer lower(KeychainAndIndex? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalScript.allocationSize(value); + final length = FfiConverterOptionalKeychainAndIndex.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalScript.write(value, buf); + FfiConverterOptionalKeychainAndIndex.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(Script? value, Uint8List buf) { + static int write(KeychainAndIndex? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return Script.write( + return FfiConverterKeychainAndIndex.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -26615,94 +26482,99 @@ class FfiConverterOptionalLocalOutput { } } -class FfiConverterSequenceCondition { - static List lift(RustBuffer buf) { - return FfiConverterSequenceCondition.read(buf.asUint8List()).value; +class FfiConverterOptionalLockTime { + static LockTime? lift(RustBuffer buf) { + return FfiConverterOptionalLockTime.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterCondition.read( - Uint8List.view(buf.buffer, offset), - ); - offset += ret.bytesRead; - res.add(ret.value); + static LiftRetVal read(Uint8List buf) { + if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { + return LiftRetVal(null, 1); } - return LiftRetVal(res, offset - buf.offsetInBytes); + final result = FfiConverterLockTime.read( + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterCondition.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); + static int allocationSize([LockTime? value]) { + if (value == null) { + return 1; } - return offset - buf.offsetInBytes; + return FfiConverterLockTime.allocationSize(value) + 1; } - static int allocationSize(List value) { - return value - .map((l) => FfiConverterCondition.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + static RustBuffer lower(LockTime? value) { + if (value == null) { + return toRustBuffer(Uint8List.fromList([0])); + } + final length = FfiConverterOptionalLockTime.allocationSize(value); + final Pointer frameData = calloc(length); + final buf = frameData.asTypedList(length); + FfiConverterOptionalLockTime.write(value, buf); + final bytes = calloc(); + bytes.ref.len = length; + bytes.ref.data = frameData; + return RustBuffer.fromBytes(bytes.ref); } - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + static int write(LockTime? value, Uint8List buf) { + if (value == null) { + buf[0] = 0; + return 1; + } + buf[0] = 1; + return FfiConverterLockTime.write( + value, + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ) + + 1; } } -class FfiConverterOptionalDescriptor { - static Descriptor? lift(RustBuffer buf) { - return FfiConverterOptionalDescriptor.read(buf.asUint8List()).value; +class FfiConverterOptionalMerkleProof { + static MerkleProof? lift(RustBuffer buf) { + return FfiConverterOptionalMerkleProof.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = Descriptor.read( + final result = FfiConverterMerkleProof.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([Descriptor? value]) { + static int allocationSize([MerkleProof? value]) { if (value == null) { return 1; } - return Descriptor.allocationSize(value) + 1; + return FfiConverterMerkleProof.allocationSize(value) + 1; } - static RustBuffer lower(Descriptor? value) { + static RustBuffer lower(MerkleProof? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalDescriptor.allocationSize(value); + final length = FfiConverterOptionalMerkleProof.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalDescriptor.write(value, buf); + FfiConverterOptionalMerkleProof.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(Descriptor? value, Uint8List buf) { + static int write(MerkleProof? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return Descriptor.write( + return FfiConverterMerkleProof.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -26710,87 +26582,49 @@ class FfiConverterOptionalDescriptor { } } -class FfiConverterSequenceTxid { - static List lift(RustBuffer buf) { - return FfiConverterSequenceTxid.read(buf.asUint8List()).value; - } - - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = Txid.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); - } - return LiftRetVal(res, offset - buf.offsetInBytes); - } - - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += Txid.write(value[i], Uint8List.view(buf.buffer, offset)); - } - return offset - buf.offsetInBytes; - } - - static int allocationSize(List value) { - return value.map((l) => Txid.allocationSize(l)).fold(0, (a, b) => a + b) + - 4; - } - - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); - } -} - -class FfiConverterOptionalTx { - static Tx? lift(RustBuffer buf) { - return FfiConverterOptionalTx.read(buf.asUint8List()).value; +class FfiConverterOptionalNetwork { + static Network? lift(RustBuffer buf) { + return FfiConverterOptionalNetwork.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterTx.read( + final result = FfiConverterNetwork.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([Tx? value]) { + static int allocationSize([Network? value]) { if (value == null) { return 1; } - return FfiConverterTx.allocationSize(value) + 1; + return FfiConverterNetwork.allocationSize(value) + 1; } - static RustBuffer lower(Tx? value) { + static RustBuffer lower(Network? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalTx.allocationSize(value); + final length = FfiConverterOptionalNetwork.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalTx.write(value, buf); + FfiConverterOptionalNetwork.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(Tx? value, Uint8List buf) { + static int write(Network? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterTx.write( + return FfiConverterNetwork.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -26798,101 +26632,49 @@ class FfiConverterOptionalTx { } } -class FfiConverterMapDescriptorIdToUInt32 { - static Map lift(RustBuffer buf) { - return FfiConverterMapDescriptorIdToUInt32.read(buf.asUint8List()).value; - } - - static LiftRetVal> read(Uint8List buf) { - final map = {}; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final k = DescriptorId.read(Uint8List.view(buf.buffer, offset)); - offset += k.bytesRead; - final v = FfiConverterUInt32.read(Uint8List.view(buf.buffer, offset)); - offset += v.bytesRead; - map[k.value] = v.value; - } - return LiftRetVal(map, offset - buf.offsetInBytes); - } - - static int write(Map value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (final entry in value.entries) { - offset += DescriptorId.write( - entry.key, - Uint8List.view(buf.buffer, offset), - ); - offset += FfiConverterUInt32.write( - entry.value, - Uint8List.view(buf.buffer, offset), - ); - } - return offset - buf.offsetInBytes; - } - - static int allocationSize(Map value) { - return value.entries - .map( - (e) => - DescriptorId.allocationSize(e.key) + - FfiConverterUInt32.allocationSize(e.value), - ) - .fold(4, (a, b) => a + b); - } - - static RustBuffer lower(Map value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); - } -} - -class FfiConverterOptionalSignOptions { - static SignOptions? lift(RustBuffer buf) { - return FfiConverterOptionalSignOptions.read(buf.asUint8List()).value; +class FfiConverterOptionalOutputStatus { + static OutputStatus? lift(RustBuffer buf) { + return FfiConverterOptionalOutputStatus.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterSignOptions.read( + final result = FfiConverterOutputStatus.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([SignOptions? value]) { + static int allocationSize([OutputStatus? value]) { if (value == null) { return 1; } - return FfiConverterSignOptions.allocationSize(value) + 1; + return FfiConverterOutputStatus.allocationSize(value) + 1; } - static RustBuffer lower(SignOptions? value) { + static RustBuffer lower(OutputStatus? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalSignOptions.allocationSize(value); + final length = FfiConverterOptionalOutputStatus.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalSignOptions.write(value, buf); + FfiConverterOptionalOutputStatus.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(SignOptions? value, Uint8List buf) { + static int write(OutputStatus? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterSignOptions.write( + return FfiConverterOutputStatus.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -26900,94 +26682,49 @@ class FfiConverterOptionalSignOptions { } } -class FfiConverterSequenceLocalOutput { - static List lift(RustBuffer buf) { - return FfiConverterSequenceLocalOutput.read(buf.asUint8List()).value; - } - - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterLocalOutput.read( - Uint8List.view(buf.buffer, offset), - ); - offset += ret.bytesRead; - res.add(ret.value); - } - return LiftRetVal(res, offset - buf.offsetInBytes); - } - - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterLocalOutput.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); - } - return offset - buf.offsetInBytes; - } - - static int allocationSize(List value) { - return value - .map((l) => FfiConverterLocalOutput.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; - } - - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); - } -} - -class FfiConverterOptionalTxDetails { - static TxDetails? lift(RustBuffer buf) { - return FfiConverterOptionalTxDetails.read(buf.asUint8List()).value; +class FfiConverterOptionalPolicy { + static Policy? lift(RustBuffer buf) { + return FfiConverterOptionalPolicy.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterTxDetails.read( + final result = Policy.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([TxDetails? value]) { + static int allocationSize([Policy? value]) { if (value == null) { return 1; } - return FfiConverterTxDetails.allocationSize(value) + 1; + return Policy.allocationSize(value) + 1; } - static RustBuffer lower(TxDetails? value) { + static RustBuffer lower(Policy? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalTxDetails.allocationSize(value); + final length = FfiConverterOptionalPolicy.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalTxDetails.write(value, buf); + FfiConverterOptionalPolicy.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(TxDetails? value, Uint8List buf) { + static int write(Policy? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterTxDetails.write( + return Policy.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -26995,72 +26732,49 @@ class FfiConverterOptionalTxDetails { } } -class FfiConverterInt32 { - static int lift(int value) => value; - static LiftRetVal read(Uint8List buf) { - return LiftRetVal(buf.buffer.asByteData(buf.offsetInBytes).getInt32(0), 4); - } - - static int lower(int value) { - if (value < -2147483648 || value > 2147483647) { - throw ArgumentError("Value out of range for i32: " + value.toString()); - } - return value; - } - - static int allocationSize([int value = 0]) { - return 4; - } - - static int write(int value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, lower(value)); - return 4; - } -} - -class FfiConverterOptionalOutputStatus { - static OutputStatus? lift(RustBuffer buf) { - return FfiConverterOptionalOutputStatus.read(buf.asUint8List()).value; +class FfiConverterOptionalScript { + static Script? lift(RustBuffer buf) { + return FfiConverterOptionalScript.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterOutputStatus.read( + final result = Script.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([OutputStatus? value]) { + static int allocationSize([Script? value]) { if (value == null) { return 1; } - return FfiConverterOutputStatus.allocationSize(value) + 1; + return Script.allocationSize(value) + 1; } - static RustBuffer lower(OutputStatus? value) { + static RustBuffer lower(Script? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalOutputStatus.allocationSize(value); + final length = FfiConverterOptionalScript.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalOutputStatus.write(value, buf); + FfiConverterOptionalScript.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(OutputStatus? value, Uint8List buf) { + static int write(Script? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterOutputStatus.write( + return Script.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -27068,49 +26782,55 @@ class FfiConverterOptionalOutputStatus { } } -class FfiConverterOptionalTransaction { - static Transaction? lift(RustBuffer buf) { - return FfiConverterOptionalTransaction.read(buf.asUint8List()).value; +class FfiConverterOptionalSequencePsbtFinalizeException { + static List? lift(RustBuffer buf) { + return FfiConverterOptionalSequencePsbtFinalizeException.read( + buf.asUint8List(), + ).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal?> read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = Transaction.read( + final result = FfiConverterSequencePsbtFinalizeException.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal?>( + result.value, + result.bytesRead + 1, + ); } - static int allocationSize([Transaction? value]) { + static int allocationSize([List? value]) { if (value == null) { return 1; } - return Transaction.allocationSize(value) + 1; + return FfiConverterSequencePsbtFinalizeException.allocationSize(value) + 1; } - static RustBuffer lower(Transaction? value) { + static RustBuffer lower(List? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalTransaction.allocationSize(value); + final length = + FfiConverterOptionalSequencePsbtFinalizeException.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalTransaction.write(value, buf); + FfiConverterOptionalSequencePsbtFinalizeException.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(Transaction? value, Uint8List buf) { + static int write(List? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return Transaction.write( + return FfiConverterSequencePsbtFinalizeException.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -27118,124 +26838,96 @@ class FfiConverterOptionalTransaction { } } -class FfiConverterUInt8 { - static int lift(int value) => value; - static LiftRetVal read(Uint8List buf) { - return LiftRetVal(buf.buffer.asByteData(buf.offsetInBytes).getUint8(0), 1); - } - - static int lower(int value) { - if (value < 0 || value > 255) { - throw ArgumentError("Value out of range for u8: " + value.toString()); - } - return value; - } - - static int allocationSize([int value = 0]) { - return 1; - } - - static int write(int value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setUint8(0, lower(value)); - return 1; - } -} - -class FfiConverterMapHashableOutPointToTxOut { - static Map lift(RustBuffer buf) { - return FfiConverterMapHashableOutPointToTxOut.read(buf.asUint8List()).value; +class FfiConverterSequencePsbtFinalizeException { + static List lift(RustBuffer buf) { + return FfiConverterSequencePsbtFinalizeException.read( + buf.asUint8List(), + ).value; } - static LiftRetVal> read(Uint8List buf) { - final map = {}; + static LiftRetVal> read(Uint8List buf) { + List res = []; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final k = HashableOutPoint.read(Uint8List.view(buf.buffer, offset)); - offset += k.bytesRead; - final v = FfiConverterTxOut.read(Uint8List.view(buf.buffer, offset)); - offset += v.bytesRead; - map[k.value] = v.value; + final ret = FfiConverterPsbtFinalizeException.read( + Uint8List.view(buf.buffer, offset), + ); + offset += ret.bytesRead; + res.add(ret.value); } - return LiftRetVal(map, offset - buf.offsetInBytes); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int write(Map value, Uint8List buf) { + static int write(List value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; - for (final entry in value.entries) { - offset += HashableOutPoint.write( - entry.key, - Uint8List.view(buf.buffer, offset), - ); - offset += FfiConverterTxOut.write( - entry.value, + for (var i = 0; i < value.length; i++) { + offset += FfiConverterPsbtFinalizeException.write( + value[i], Uint8List.view(buf.buffer, offset), ); } return offset - buf.offsetInBytes; } - static int allocationSize(Map value) { - return value.entries - .map( - (e) => - HashableOutPoint.allocationSize(e.key) + - FfiConverterTxOut.allocationSize(e.value), - ) - .fold(4, (a, b) => a + b); + static int allocationSize(List value) { + return value + .map((l) => FfiConverterPsbtFinalizeException.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; } - static RustBuffer lower(Map value) { + static RustBuffer lower(List value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterOptionalHeaderNotification { - static HeaderNotification? lift(RustBuffer buf) { - return FfiConverterOptionalHeaderNotification.read(buf.asUint8List()).value; +class FfiConverterOptionalSequenceUint8List { + static List? lift(RustBuffer buf) { + return FfiConverterOptionalSequenceUint8List.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal?> read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterHeaderNotification.read( + final result = FfiConverterSequenceUint8List.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal?>(result.value, result.bytesRead + 1); } - static int allocationSize([HeaderNotification? value]) { + static int allocationSize([List? value]) { if (value == null) { return 1; } - return FfiConverterHeaderNotification.allocationSize(value) + 1; + return FfiConverterSequenceUint8List.allocationSize(value) + 1; } - static RustBuffer lower(HeaderNotification? value) { + static RustBuffer lower(List? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalHeaderNotification.allocationSize(value); + final length = FfiConverterOptionalSequenceUint8List.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalHeaderNotification.write(value, buf); + FfiConverterOptionalSequenceUint8List.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(HeaderNotification? value, Uint8List buf) { + static int write(List? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterHeaderNotification.write( + return FfiConverterSequenceUint8List.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -27243,49 +26935,49 @@ class FfiConverterOptionalHeaderNotification { } } -class FfiConverterOptionalPolicy { - static Policy? lift(RustBuffer buf) { - return FfiConverterOptionalPolicy.read(buf.asUint8List()).value; +class FfiConverterOptionalSignOptions { + static SignOptions? lift(RustBuffer buf) { + return FfiConverterOptionalSignOptions.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = Policy.read( + final result = FfiConverterSignOptions.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([Policy? value]) { + static int allocationSize([SignOptions? value]) { if (value == null) { return 1; } - return Policy.allocationSize(value) + 1; + return FfiConverterSignOptions.allocationSize(value) + 1; } - static RustBuffer lower(Policy? value) { + static RustBuffer lower(SignOptions? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalPolicy.allocationSize(value); + final length = FfiConverterOptionalSignOptions.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalPolicy.write(value, buf); + FfiConverterOptionalSignOptions.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(Policy? value, Uint8List buf) { + static int write(SignOptions? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return Policy.write( + return FfiConverterSignOptions.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -27293,141 +26985,99 @@ class FfiConverterOptionalPolicy { } } -class FfiConverterMapTxidToUInt64 { - static Map lift(RustBuffer buf) { - return FfiConverterMapTxidToUInt64.read(buf.asUint8List()).value; +class FfiConverterOptionalString { + static String? lift(RustBuffer buf) { + return FfiConverterOptionalString.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - final map = {}; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final k = Txid.read(Uint8List.view(buf.buffer, offset)); - offset += k.bytesRead; - final v = FfiConverterUInt64.read(Uint8List.view(buf.buffer, offset)); - offset += v.bytesRead; - map[k.value] = v.value; + static LiftRetVal read(Uint8List buf) { + if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { + return LiftRetVal(null, 1); } - return LiftRetVal(map, offset - buf.offsetInBytes); + final result = FfiConverterString.read( + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int write(Map value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (final entry in value.entries) { - offset += Txid.write(entry.key, Uint8List.view(buf.buffer, offset)); - offset += FfiConverterUInt64.write( - entry.value, - Uint8List.view(buf.buffer, offset), - ); + static int allocationSize([String? value]) { + if (value == null) { + return 1; } - return offset - buf.offsetInBytes; - } - - static int allocationSize(Map value) { - return value.entries - .map( - (e) => - Txid.allocationSize(e.key) + - FfiConverterUInt64.allocationSize(e.value), - ) - .fold(4, (a, b) => a + b); + return FfiConverterString.allocationSize(value) + 1; } - static RustBuffer lower(Map value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); - } -} - -class FfiConverterSequenceTxOut { - static List lift(RustBuffer buf) { - return FfiConverterSequenceTxOut.read(buf.asUint8List()).value; - } - - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterTxOut.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); + static RustBuffer lower(String? value) { + if (value == null) { + return toRustBuffer(Uint8List.fromList([0])); } - return LiftRetVal(res, offset - buf.offsetInBytes); + final length = FfiConverterOptionalString.allocationSize(value); + final Pointer frameData = calloc(length); + final buf = frameData.asTypedList(length); + FfiConverterOptionalString.write(value, buf); + final bytes = calloc(); + bytes.ref.len = length; + bytes.ref.data = frameData; + return RustBuffer.fromBytes(bytes.ref); } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterTxOut.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); + static int write(String? value, Uint8List buf) { + if (value == null) { + buf[0] = 0; + return 1; } - return offset - buf.offsetInBytes; - } - - static int allocationSize(List value) { - return value - .map((l) => FfiConverterTxOut.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; - } - - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + buf[0] = 1; + return FfiConverterString.write( + value, + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ) + + 1; } } -class FfiConverterOptionalBlockHash { - static BlockHash? lift(RustBuffer buf) { - return FfiConverterOptionalBlockHash.read(buf.asUint8List()).value; +class FfiConverterOptionalTapTree { + static TapTree? lift(RustBuffer buf) { + return FfiConverterOptionalTapTree.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = BlockHash.read( + final result = TapTree.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([BlockHash? value]) { + static int allocationSize([TapTree? value]) { if (value == null) { return 1; } - return BlockHash.allocationSize(value) + 1; + return TapTree.allocationSize(value) + 1; } - static RustBuffer lower(BlockHash? value) { + static RustBuffer lower(TapTree? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalBlockHash.allocationSize(value); + final length = FfiConverterOptionalTapTree.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalBlockHash.write(value, buf); + FfiConverterOptionalTapTree.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(BlockHash? value, Uint8List buf) { + static int write(TapTree? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return BlockHash.write( + return TapTree.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -27435,55 +27085,49 @@ class FfiConverterOptionalBlockHash { } } -class FfiConverterOptionalSequencePsbtFinalizeException { - static List? lift(RustBuffer buf) { - return FfiConverterOptionalSequencePsbtFinalizeException.read( - buf.asUint8List(), - ).value; +class FfiConverterOptionalTransaction { + static Transaction? lift(RustBuffer buf) { + return FfiConverterOptionalTransaction.read(buf.asUint8List()).value; } - static LiftRetVal?> read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterSequencePsbtFinalizeException.read( + final result = Transaction.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal?>( - result.value, - result.bytesRead + 1, - ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([List? value]) { + static int allocationSize([Transaction? value]) { if (value == null) { return 1; } - return FfiConverterSequencePsbtFinalizeException.allocationSize(value) + 1; + return Transaction.allocationSize(value) + 1; } - static RustBuffer lower(List? value) { + static RustBuffer lower(Transaction? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = - FfiConverterOptionalSequencePsbtFinalizeException.allocationSize(value); + final length = FfiConverterOptionalTransaction.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalSequencePsbtFinalizeException.write(value, buf); + FfiConverterOptionalTransaction.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(List? value, Uint8List buf) { + static int write(Transaction? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterSequencePsbtFinalizeException.write( + return Transaction.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -27491,170 +27135,199 @@ class FfiConverterOptionalSequencePsbtFinalizeException { } } -class FfiConverterSequencePsbtFinalizeException { - static List lift(RustBuffer buf) { - return FfiConverterSequencePsbtFinalizeException.read( - buf.asUint8List(), - ).value; +class FfiConverterOptionalTx { + static Tx? lift(RustBuffer buf) { + return FfiConverterOptionalTx.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterPsbtFinalizeException.read( - Uint8List.view(buf.buffer, offset), - ); - offset += ret.bytesRead; - res.add(ret.value); + static LiftRetVal read(Uint8List buf) { + if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { + return LiftRetVal(null, 1); } - return LiftRetVal(res, offset - buf.offsetInBytes); + final result = FfiConverterTx.read( + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterPsbtFinalizeException.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); + static int allocationSize([Tx? value]) { + if (value == null) { + return 1; } - return offset - buf.offsetInBytes; + return FfiConverterTx.allocationSize(value) + 1; } - static int allocationSize(List value) { - return value - .map((l) => FfiConverterPsbtFinalizeException.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + static RustBuffer lower(Tx? value) { + if (value == null) { + return toRustBuffer(Uint8List.fromList([0])); + } + final length = FfiConverterOptionalTx.allocationSize(value); + final Pointer frameData = calloc(length); + final buf = frameData.asTypedList(length); + FfiConverterOptionalTx.write(value, buf); + final bytes = calloc(); + bytes.ref.len = length; + bytes.ref.data = frameData; + return RustBuffer.fromBytes(bytes.ref); } - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + static int write(Tx? value, Uint8List buf) { + if (value == null) { + buf[0] = 0; + return 1; + } + buf[0] = 1; + return FfiConverterTx.write( + value, + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ) + + 1; } } -class FfiConverterSequenceAnchor { - static List lift(RustBuffer buf) { - return FfiConverterSequenceAnchor.read(buf.asUint8List()).value; +class FfiConverterOptionalTxDetails { + static TxDetails? lift(RustBuffer buf) { + return FfiConverterOptionalTxDetails.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterAnchor.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); + static LiftRetVal read(Uint8List buf) { + if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { + return LiftRetVal(null, 1); } - return LiftRetVal(res, offset - buf.offsetInBytes); + final result = FfiConverterTxDetails.read( + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterAnchor.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); + static int allocationSize([TxDetails? value]) { + if (value == null) { + return 1; } - return offset - buf.offsetInBytes; + return FfiConverterTxDetails.allocationSize(value) + 1; } - static int allocationSize(List value) { - return value - .map((l) => FfiConverterAnchor.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + static RustBuffer lower(TxDetails? value) { + if (value == null) { + return toRustBuffer(Uint8List.fromList([0])); + } + final length = FfiConverterOptionalTxDetails.allocationSize(value); + final Pointer frameData = calloc(length); + final buf = frameData.asTypedList(length); + FfiConverterOptionalTxDetails.write(value, buf); + final bytes = calloc(); + bytes.ref.len = length; + bytes.ref.data = frameData; + return RustBuffer.fromBytes(bytes.ref); } - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + static int write(TxDetails? value, Uint8List buf) { + if (value == null) { + buf[0] = 0; + return 1; + } + buf[0] = 1; + return FfiConverterTxDetails.write( + value, + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ) + + 1; } } -class FfiConverterUint8List { - static Uint8List lift(RustBuffer value) { - return FfiConverterUint8List.read(value.asUint8List()).value; +class FfiConverterOptionalTxOut { + static TxOut? lift(RustBuffer buf) { + return FfiConverterOptionalTxOut.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - final bytes = Uint8List.view(buf.buffer, buf.offsetInBytes + 4, length); - return LiftRetVal(bytes, length + 4); + static LiftRetVal read(Uint8List buf) { + if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { + return LiftRetVal(null, 1); + } + final result = FfiConverterTxOut.read( + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static RustBuffer lower(Uint8List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + static int allocationSize([TxOut? value]) { + if (value == null) { + return 1; + } + return FfiConverterTxOut.allocationSize(value) + 1; } - static int allocationSize([Uint8List? value]) { + static RustBuffer lower(TxOut? value) { if (value == null) { - return 4; + return toRustBuffer(Uint8List.fromList([0])); } - return 4 + value.length; + final length = FfiConverterOptionalTxOut.allocationSize(value); + final Pointer frameData = calloc(length); + final buf = frameData.asTypedList(length); + FfiConverterOptionalTxOut.write(value, buf); + final bytes = calloc(); + bytes.ref.len = length; + bytes.ref.data = frameData; + return RustBuffer.fromBytes(bytes.ref); } - static int write(Uint8List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - buf.setRange(4, 4 + value.length, value); - return 4 + value.length; + static int write(TxOut? value, Uint8List buf) { + if (value == null) { + buf[0] = 0; + return 1; + } + buf[0] = 1; + return FfiConverterTxOut.write( + value, + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ) + + 1; } } -class FfiConverterOptionalSequenceUint8List { - static List? lift(RustBuffer buf) { - return FfiConverterOptionalSequenceUint8List.read(buf.asUint8List()).value; +class FfiConverterOptionalTxStatus { + static TxStatus? lift(RustBuffer buf) { + return FfiConverterOptionalTxStatus.read(buf.asUint8List()).value; } - static LiftRetVal?> read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterSequenceUint8List.read( + final result = FfiConverterTxStatus.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal?>(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([List? value]) { + static int allocationSize([TxStatus? value]) { if (value == null) { return 1; } - return FfiConverterSequenceUint8List.allocationSize(value) + 1; + return FfiConverterTxStatus.allocationSize(value) + 1; } - static RustBuffer lower(List? value) { + static RustBuffer lower(TxStatus? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalSequenceUint8List.allocationSize(value); + final length = FfiConverterOptionalTxStatus.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalSequenceUint8List.write(value, buf); + FfiConverterOptionalTxStatus.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(List? value, Uint8List buf) { + static int write(TxStatus? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterSequenceUint8List.write( + return FfiConverterTxStatus.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -27662,92 +27335,97 @@ class FfiConverterOptionalSequenceUint8List { } } -class FfiConverterSequenceString { - static List lift(RustBuffer buf) { - return FfiConverterSequenceString.read(buf.asUint8List()).value; +class FfiConverterOptionalTxid { + static Txid? lift(RustBuffer buf) { + return FfiConverterOptionalTxid.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterString.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); + static LiftRetVal read(Uint8List buf) { + if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { + return LiftRetVal(null, 1); } - return LiftRetVal(res, offset - buf.offsetInBytes); + final result = Txid.read(Uint8List.view(buf.buffer, buf.offsetInBytes + 1)); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterString.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); + static int allocationSize([Txid? value]) { + if (value == null) { + return 1; } - return offset - buf.offsetInBytes; + return Txid.allocationSize(value) + 1; } - static int allocationSize(List value) { - return value - .map((l) => FfiConverterString.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + static RustBuffer lower(Txid? value) { + if (value == null) { + return toRustBuffer(Uint8List.fromList([0])); + } + final length = FfiConverterOptionalTxid.allocationSize(value); + final Pointer frameData = calloc(length); + final buf = frameData.asTypedList(length); + FfiConverterOptionalTxid.write(value, buf); + final bytes = calloc(); + bytes.ref.len = length; + bytes.ref.data = frameData; + return RustBuffer.fromBytes(bytes.ref); } - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + static int write(Txid? value, Uint8List buf) { + if (value == null) { + buf[0] = 0; + return 1; + } + buf[0] = 1; + return Txid.write( + value, + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ) + + 1; } } -class FfiConverterOptionalNetwork { - static Network? lift(RustBuffer buf) { - return FfiConverterOptionalNetwork.read(buf.asUint8List()).value; +class FfiConverterOptionalUInt16 { + static int? lift(RustBuffer buf) { + return FfiConverterOptionalUInt16.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterNetwork.read( + final result = FfiConverterUInt16.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([Network? value]) { + static int allocationSize([int? value]) { if (value == null) { return 1; } - return FfiConverterNetwork.allocationSize(value) + 1; + return FfiConverterUInt16.allocationSize(value) + 1; } - static RustBuffer lower(Network? value) { + static RustBuffer lower(int? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalNetwork.allocationSize(value); + final length = FfiConverterOptionalUInt16.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalNetwork.write(value, buf); + FfiConverterOptionalUInt16.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(Network? value, Uint8List buf) { + static int write(int? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterNetwork.write( + return FfiConverterUInt16.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -27755,92 +27433,49 @@ class FfiConverterOptionalNetwork { } } -class FfiConverterSequenceOutput { - static List lift(RustBuffer buf) { - return FfiConverterSequenceOutput.read(buf.asUint8List()).value; - } - - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterOutput.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); - } - return LiftRetVal(res, offset - buf.offsetInBytes); - } - - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterOutput.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); - } - return offset - buf.offsetInBytes; - } - - static int allocationSize(List value) { - return value - .map((l) => FfiConverterOutput.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; - } - - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); - } -} - -class FfiConverterOptionalUint8List { - static Uint8List? lift(RustBuffer buf) { - return FfiConverterOptionalUint8List.read(buf.asUint8List()).value; +class FfiConverterOptionalUInt32 { + static int? lift(RustBuffer buf) { + return FfiConverterOptionalUInt32.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterUint8List.read( + final result = FfiConverterUInt32.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([Uint8List? value]) { + static int allocationSize([int? value]) { if (value == null) { return 1; } - return FfiConverterUint8List.allocationSize(value) + 1; + return FfiConverterUInt32.allocationSize(value) + 1; } - static RustBuffer lower(Uint8List? value) { + static RustBuffer lower(int? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalUint8List.allocationSize(value); + final length = FfiConverterOptionalUInt32.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalUint8List.write(value, buf); + FfiConverterOptionalUInt32.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(Uint8List? value, Uint8List buf) { + static int write(int? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterUint8List.write( + return FfiConverterUInt32.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -27848,155 +27483,149 @@ class FfiConverterOptionalUint8List { } } -class FfiConverterUInt16 { - static int lift(int value) => value; - static LiftRetVal read(Uint8List buf) { - return LiftRetVal(buf.buffer.asByteData(buf.offsetInBytes).getUint16(0), 2); +class FfiConverterOptionalUInt64 { + static int? lift(RustBuffer buf) { + return FfiConverterOptionalUInt64.read(buf.asUint8List()).value; } - static int lower(int value) { - if (value < 0 || value > 65535) { - throw ArgumentError("Value out of range for u16: " + value.toString()); + static LiftRetVal read(Uint8List buf) { + if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { + return LiftRetVal(null, 1); } - return value; - } - - static int allocationSize([int value = 0]) { - return 2; - } - - static int write(int value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setUint16(0, lower(value)); - return 2; - } -} - -class FfiConverterSequenceOutPoint { - static List lift(RustBuffer buf) { - return FfiConverterSequenceOutPoint.read(buf.asUint8List()).value; + final result = FfiConverterUInt64.read( + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = FfiConverterOutPoint.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); + static int allocationSize([int? value]) { + if (value == null) { + return 1; } - return LiftRetVal(res, offset - buf.offsetInBytes); + return FfiConverterUInt64.allocationSize(value) + 1; } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += FfiConverterOutPoint.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); + static RustBuffer lower(int? value) { + if (value == null) { + return toRustBuffer(Uint8List.fromList([0])); } - return offset - buf.offsetInBytes; - } - - static int allocationSize(List value) { - return value - .map((l) => FfiConverterOutPoint.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + final length = FfiConverterOptionalUInt64.allocationSize(value); + final Pointer frameData = calloc(length); + final buf = frameData.asTypedList(length); + FfiConverterOptionalUInt64.write(value, buf); + final bytes = calloc(); + bytes.ref.len = length; + bytes.ref.data = frameData; + return RustBuffer.fromBytes(bytes.ref); } - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + static int write(int? value, Uint8List buf) { + if (value == null) { + buf[0] = 0; + return 1; + } + buf[0] = 1; + return FfiConverterUInt64.write( + value, + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ) + + 1; } } -class FfiConverterSequenceDescriptor { - static List lift(RustBuffer buf) { - return FfiConverterSequenceDescriptor.read(buf.asUint8List()).value; +class FfiConverterOptionalUInt8 { + static int? lift(RustBuffer buf) { + return FfiConverterOptionalUInt8.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; - final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < length; i++) { - final ret = Descriptor.read(Uint8List.view(buf.buffer, offset)); - offset += ret.bytesRead; - res.add(ret.value); + static LiftRetVal read(Uint8List buf) { + if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { + return LiftRetVal(null, 1); } - return LiftRetVal(res, offset - buf.offsetInBytes); + final result = FfiConverterUInt8.read( + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int write(List value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); - int offset = buf.offsetInBytes + 4; - for (var i = 0; i < value.length; i++) { - offset += Descriptor.write(value[i], Uint8List.view(buf.buffer, offset)); + static int allocationSize([int? value]) { + if (value == null) { + return 1; } - return offset - buf.offsetInBytes; + return FfiConverterUInt8.allocationSize(value) + 1; } - static int allocationSize(List value) { - return value - .map((l) => Descriptor.allocationSize(l)) - .fold(0, (a, b) => a + b) + - 4; + static RustBuffer lower(int? value) { + if (value == null) { + return toRustBuffer(Uint8List.fromList([0])); + } + final length = FfiConverterOptionalUInt8.allocationSize(value); + final Pointer frameData = calloc(length); + final buf = frameData.asTypedList(length); + FfiConverterOptionalUInt8.write(value, buf); + final bytes = calloc(); + bytes.ref.len = length; + bytes.ref.data = frameData; + return RustBuffer.fromBytes(bytes.ref); } - static RustBuffer lower(List value) { - final buf = Uint8List(allocationSize(value)); - write(value, buf); - return toRustBuffer(buf); + static int write(int? value, Uint8List buf) { + if (value == null) { + buf[0] = 0; + return 1; + } + buf[0] = 1; + return FfiConverterUInt8.write( + value, + Uint8List.view(buf.buffer, buf.offsetInBytes + 1), + ) + + 1; } } -class FfiConverterOptionalDouble32 { - static double? lift(RustBuffer buf) { - return FfiConverterOptionalDouble32.read(buf.asUint8List()).value; +class FfiConverterOptionalUint8List { + static Uint8List? lift(RustBuffer buf) { + return FfiConverterOptionalUint8List.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { + static LiftRetVal read(Uint8List buf) { if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { return LiftRetVal(null, 1); } - final result = FfiConverterDouble32.read( + final result = FfiConverterUint8List.read( Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(result.value, result.bytesRead + 1); } - static int allocationSize([double? value]) { + static int allocationSize([Uint8List? value]) { if (value == null) { return 1; } - return FfiConverterDouble32.allocationSize(value) + 1; + return FfiConverterUint8List.allocationSize(value) + 1; } - static RustBuffer lower(double? value) { + static RustBuffer lower(Uint8List? value) { if (value == null) { return toRustBuffer(Uint8List.fromList([0])); } - final length = FfiConverterOptionalDouble32.allocationSize(value); + final length = FfiConverterOptionalUint8List.allocationSize(value); final Pointer frameData = calloc(length); final buf = frameData.asTypedList(length); - FfiConverterOptionalDouble32.write(value, buf); + FfiConverterOptionalUint8List.write(value, buf); final bytes = calloc(); bytes.ref.len = length; bytes.ref.data = frameData; return RustBuffer.fromBytes(bytes.ref); } - static int write(double? value, Uint8List buf) { + static int write(Uint8List? value, Uint8List buf) { if (value == null) { buf[0] = 0; return 1; } buf[0] = 1; - return FfiConverterDouble32.write( + return FfiConverterUint8List.write( value, Uint8List.view(buf.buffer, buf.offsetInBytes + 1), ) + @@ -28004,28 +27633,30 @@ class FfiConverterOptionalDouble32 { } } -class FfiConverterSequenceTxIn { - static List lift(RustBuffer buf) { - return FfiConverterSequenceTxIn.read(buf.asUint8List()).value; +class FfiConverterSequenceAddressInfo { + static List lift(RustBuffer buf) { + return FfiConverterSequenceAddressInfo.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; + static LiftRetVal> read(Uint8List buf) { + List res = []; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final ret = FfiConverterTxIn.read(Uint8List.view(buf.buffer, offset)); + final ret = FfiConverterAddressInfo.read( + Uint8List.view(buf.buffer, offset), + ); offset += ret.bytesRead; res.add(ret.value); } return LiftRetVal(res, offset - buf.offsetInBytes); } - static int write(List value, Uint8List buf) { + static int write(List value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; for (var i = 0; i < value.length; i++) { - offset += FfiConverterTxIn.write( + offset += FfiConverterAddressInfo.write( value[i], Uint8List.view(buf.buffer, offset), ); @@ -28033,158 +27664,164 @@ class FfiConverterSequenceTxIn { return offset - buf.offsetInBytes; } - static int allocationSize(List value) { + static int allocationSize(List value) { return value - .map((l) => FfiConverterTxIn.allocationSize(l)) + .map((l) => FfiConverterAddressInfo.allocationSize(l)) .fold(0, (a, b) => a + b) + 4; } - static RustBuffer lower(List value) { + static RustBuffer lower(List value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterMapStringToSequenceUInt64 { - static Map> lift(RustBuffer buf) { - return FfiConverterMapStringToSequenceUInt64.read(buf.asUint8List()).value; +class FfiConverterSequenceAnchor { + static List lift(RustBuffer buf) { + return FfiConverterSequenceAnchor.read(buf.asUint8List()).value; } - static LiftRetVal>> read(Uint8List buf) { - final map = >{}; + static LiftRetVal> read(Uint8List buf) { + List res = []; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final k = FfiConverterString.read(Uint8List.view(buf.buffer, offset)); - offset += k.bytesRead; - final v = FfiConverterSequenceUInt64.read( - Uint8List.view(buf.buffer, offset), - ); - offset += v.bytesRead; - map[k.value] = v.value; + final ret = FfiConverterAnchor.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); } - return LiftRetVal(map, offset - buf.offsetInBytes); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int write(Map> value, Uint8List buf) { + static int write(List value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; - for (final entry in value.entries) { - offset += FfiConverterString.write( - entry.key, - Uint8List.view(buf.buffer, offset), - ); - offset += FfiConverterSequenceUInt64.write( - entry.value, + for (var i = 0; i < value.length; i++) { + offset += FfiConverterAnchor.write( + value[i], Uint8List.view(buf.buffer, offset), ); } return offset - buf.offsetInBytes; } - static int allocationSize(Map> value) { - return value.entries - .map( - (e) => - FfiConverterString.allocationSize(e.key) + - FfiConverterSequenceUInt64.allocationSize(e.value), - ) - .fold(4, (a, b) => a + b); + static int allocationSize(List value) { + return value + .map((l) => FfiConverterAnchor.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; } - static RustBuffer lower(Map> value) { + static RustBuffer lower(List value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterInt64 { - static int lift(int value) => value; - static LiftRetVal read(Uint8List buf) { - return LiftRetVal(buf.buffer.asByteData(buf.offsetInBytes).getInt64(0), 8); +class FfiConverterSequenceCanonicalTx { + static List lift(RustBuffer buf) { + return FfiConverterSequenceCanonicalTx.read(buf.asUint8List()).value; } - static int lower(int value) { - if (value < -9223372036854775808 || value > 9223372036854775807) { - throw ArgumentError("Value out of range for i64: " + value.toString()); + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterCanonicalTx.read( + Uint8List.view(buf.buffer, offset), + ); + offset += ret.bytesRead; + res.add(ret.value); } - return value; + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int allocationSize([int value = 0]) { - return 8; + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterCanonicalTx.write( + value[i], + Uint8List.view(buf.buffer, offset), + ); + } + return offset - buf.offsetInBytes; } - static int write(int value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setInt64(0, lower(value)); - return 8; + static int allocationSize(List value) { + return value + .map((l) => FfiConverterCanonicalTx.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; + } + + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); } } -class FfiConverterOptionalCanonicalTx { - static CanonicalTx? lift(RustBuffer buf) { - return FfiConverterOptionalCanonicalTx.read(buf.asUint8List()).value; +class FfiConverterSequenceChainChange { + static List lift(RustBuffer buf) { + return FfiConverterSequenceChainChange.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { - if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { - return LiftRetVal(null, 1); + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterChainChange.read( + Uint8List.view(buf.buffer, offset), + ); + offset += ret.bytesRead; + res.add(ret.value); } - final result = FfiConverterCanonicalTx.read( - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int allocationSize([CanonicalTx? value]) { - if (value == null) { - return 1; + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterChainChange.write( + value[i], + Uint8List.view(buf.buffer, offset), + ); } - return FfiConverterCanonicalTx.allocationSize(value) + 1; + return offset - buf.offsetInBytes; } - static RustBuffer lower(CanonicalTx? value) { - if (value == null) { - return toRustBuffer(Uint8List.fromList([0])); - } - final length = FfiConverterOptionalCanonicalTx.allocationSize(value); - final Pointer frameData = calloc(length); - final buf = frameData.asTypedList(length); - FfiConverterOptionalCanonicalTx.write(value, buf); - final bytes = calloc(); - bytes.ref.len = length; - bytes.ref.data = frameData; - return RustBuffer.fromBytes(bytes.ref); + static int allocationSize(List value) { + return value + .map((l) => FfiConverterChainChange.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; } - static int write(CanonicalTx? value, Uint8List buf) { - if (value == null) { - buf[0] = 0; - return 1; - } - buf[0] = 1; - return FfiConverterCanonicalTx.write( - value, - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ) + - 1; + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); } } -class FfiConverterSequenceAddressInfo { - static List lift(RustBuffer buf) { - return FfiConverterSequenceAddressInfo.read(buf.asUint8List()).value; +class FfiConverterSequenceCondition { + static List lift(RustBuffer buf) { + return FfiConverterSequenceCondition.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; + static LiftRetVal> read(Uint8List buf) { + List res = []; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final ret = FfiConverterAddressInfo.read( + final ret = FfiConverterCondition.read( Uint8List.view(buf.buffer, offset), ); offset += ret.bytesRead; @@ -28193,11 +27830,11 @@ class FfiConverterSequenceAddressInfo { return LiftRetVal(res, offset - buf.offsetInBytes); } - static int write(List value, Uint8List buf) { + static int write(List value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; for (var i = 0; i < value.length; i++) { - offset += FfiConverterAddressInfo.write( + offset += FfiConverterCondition.write( value[i], Uint8List.view(buf.buffer, offset), ); @@ -28205,196 +27842,170 @@ class FfiConverterSequenceAddressInfo { return offset - buf.offsetInBytes; } - static int allocationSize(List value) { + static int allocationSize(List value) { return value - .map((l) => FfiConverterAddressInfo.allocationSize(l)) + .map((l) => FfiConverterCondition.allocationSize(l)) .fold(0, (a, b) => a + b) + 4; } - static RustBuffer lower(List value) { + static RustBuffer lower(List value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterMapKeyToUint8List { - static Map lift(RustBuffer buf) { - return FfiConverterMapKeyToUint8List.read(buf.asUint8List()).value; +class FfiConverterSequenceConflict { + static List lift(RustBuffer buf) { + return FfiConverterSequenceConflict.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - final map = {}; + static LiftRetVal> read(Uint8List buf) { + List res = []; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final k = FfiConverterKey.read(Uint8List.view(buf.buffer, offset)); - offset += k.bytesRead; - final v = FfiConverterUint8List.read(Uint8List.view(buf.buffer, offset)); - offset += v.bytesRead; - map[k.value] = v.value; + final ret = FfiConverterConflict.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); } - return LiftRetVal(map, offset - buf.offsetInBytes); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int write(Map value, Uint8List buf) { + static int write(List value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; - for (final entry in value.entries) { - offset += FfiConverterKey.write( - entry.key, - Uint8List.view(buf.buffer, offset), - ); - offset += FfiConverterUint8List.write( - entry.value, + for (var i = 0; i < value.length; i++) { + offset += FfiConverterConflict.write( + value[i], Uint8List.view(buf.buffer, offset), ); } return offset - buf.offsetInBytes; } - static int allocationSize(Map value) { - return value.entries - .map( - (e) => - FfiConverterKey.allocationSize(e.key) + - FfiConverterUint8List.allocationSize(e.value), - ) - .fold(4, (a, b) => a + b); + static int allocationSize(List value) { + return value + .map((l) => FfiConverterConflict.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; } - static RustBuffer lower(Map value) { + static RustBuffer lower(List value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterOptionalBlock { - static Block? lift(RustBuffer buf) { - return FfiConverterOptionalBlock.read(buf.asUint8List()).value; +class FfiConverterSequenceDescriptor { + static List lift(RustBuffer buf) { + return FfiConverterSequenceDescriptor.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { - if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { - return LiftRetVal(null, 1); + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = Descriptor.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); } - final result = FfiConverterBlock.read( - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int allocationSize([Block? value]) { - if (value == null) { - return 1; + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += Descriptor.write(value[i], Uint8List.view(buf.buffer, offset)); } - return FfiConverterBlock.allocationSize(value) + 1; + return offset - buf.offsetInBytes; } - static RustBuffer lower(Block? value) { - if (value == null) { - return toRustBuffer(Uint8List.fromList([0])); - } - final length = FfiConverterOptionalBlock.allocationSize(value); - final Pointer frameData = calloc(length); - final buf = frameData.asTypedList(length); - FfiConverterOptionalBlock.write(value, buf); - final bytes = calloc(); - bytes.ref.len = length; - bytes.ref.data = frameData; - return RustBuffer.fromBytes(bytes.ref); + static int allocationSize(List value) { + return value + .map((l) => Descriptor.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; } - static int write(Block? value, Uint8List buf) { - if (value == null) { - buf[0] = 0; - return 1; - } - buf[0] = 1; - return FfiConverterBlock.write( - value, - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ) + - 1; + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); } } -class FfiConverterOptionalMerkleProof { - static MerkleProof? lift(RustBuffer buf) { - return FfiConverterOptionalMerkleProof.read(buf.asUint8List()).value; +class FfiConverterSequenceEvictedTx { + static List lift(RustBuffer buf) { + return FfiConverterSequenceEvictedTx.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { - if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { - return LiftRetVal(null, 1); + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterEvictedTx.read( + Uint8List.view(buf.buffer, offset), + ); + offset += ret.bytesRead; + res.add(ret.value); } - final result = FfiConverterMerkleProof.read( - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int allocationSize([MerkleProof? value]) { - if (value == null) { - return 1; - } - return FfiConverterMerkleProof.allocationSize(value) + 1; + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterEvictedTx.write( + value[i], + Uint8List.view(buf.buffer, offset), + ); + } + return offset - buf.offsetInBytes; } - static RustBuffer lower(MerkleProof? value) { - if (value == null) { - return toRustBuffer(Uint8List.fromList([0])); - } - final length = FfiConverterOptionalMerkleProof.allocationSize(value); - final Pointer frameData = calloc(length); - final buf = frameData.asTypedList(length); - FfiConverterOptionalMerkleProof.write(value, buf); - final bytes = calloc(); - bytes.ref.len = length; - bytes.ref.data = frameData; - return RustBuffer.fromBytes(bytes.ref); + static int allocationSize(List value) { + return value + .map((l) => FfiConverterEvictedTx.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; } - static int write(MerkleProof? value, Uint8List buf) { - if (value == null) { - buf[0] = 0; - return 1; - } - buf[0] = 1; - return FfiConverterMerkleProof.write( - value, - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ) + - 1; + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); } } -class FfiConverterSequenceUint8List { - static List lift(RustBuffer buf) { - return FfiConverterSequenceUint8List.read(buf.asUint8List()).value; +class FfiConverterSequenceInput { + static List lift(RustBuffer buf) { + return FfiConverterSequenceInput.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; + static LiftRetVal> read(Uint8List buf) { + List res = []; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final ret = FfiConverterUint8List.read( - Uint8List.view(buf.buffer, offset), - ); + final ret = FfiConverterInput.read(Uint8List.view(buf.buffer, offset)); offset += ret.bytesRead; res.add(ret.value); } return LiftRetVal(res, offset - buf.offsetInBytes); } - static int write(List value, Uint8List buf) { + static int write(List value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; for (var i = 0; i < value.length; i++) { - offset += FfiConverterUint8List.write( + offset += FfiConverterInput.write( value[i], Uint8List.view(buf.buffer, offset), ); @@ -28402,222 +28013,210 @@ class FfiConverterSequenceUint8List { return offset - buf.offsetInBytes; } - static int allocationSize(List value) { + static int allocationSize(List value) { return value - .map((l) => FfiConverterUint8List.allocationSize(l)) + .map((l) => FfiConverterInput.allocationSize(l)) .fold(0, (a, b) => a + b) + 4; } - static RustBuffer lower(List value) { + static RustBuffer lower(List value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterOptionalAmount { - static Amount? lift(RustBuffer buf) { - return FfiConverterOptionalAmount.read(buf.asUint8List()).value; +class FfiConverterSequenceIpAddress { + static List lift(RustBuffer buf) { + return FfiConverterSequenceIpAddress.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { - if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { - return LiftRetVal(null, 1); + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = IpAddress.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); } - final result = Amount.read( - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int allocationSize([Amount? value]) { - if (value == null) { - return 1; + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += IpAddress.write(value[i], Uint8List.view(buf.buffer, offset)); } - return Amount.allocationSize(value) + 1; + return offset - buf.offsetInBytes; } - static RustBuffer lower(Amount? value) { - if (value == null) { - return toRustBuffer(Uint8List.fromList([0])); - } - final length = FfiConverterOptionalAmount.allocationSize(value); - final Pointer frameData = calloc(length); - final buf = frameData.asTypedList(length); - FfiConverterOptionalAmount.write(value, buf); - final bytes = calloc(); - bytes.ref.len = length; - bytes.ref.data = frameData; - return RustBuffer.fromBytes(bytes.ref); + static int allocationSize(List value) { + return value + .map((l) => IpAddress.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; } - static int write(Amount? value, Uint8List buf) { - if (value == null) { - buf[0] = 0; - return 1; - } - buf[0] = 1; - return Amount.write( - value, - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ) + - 1; + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); } } -class FfiConverterDouble64 { - static double lift(double value) => value; - static LiftRetVal read(Uint8List buf) { - return LiftRetVal( - buf.buffer.asByteData(buf.offsetInBytes).getFloat64(0), - 8, - ); +class FfiConverterSequenceLeafNode { + static List lift(RustBuffer buf) { + return FfiConverterSequenceLeafNode.read(buf.asUint8List()).value; } - static double lower(double value) => value; - static int allocationSize([double value = 0]) { - return 8; + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = LeafNode.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); + } + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int write(double value, Uint8List buf) { - buf.buffer.asByteData(buf.offsetInBytes).setFloat64(0, value); - return FfiConverterDouble64.allocationSize(); + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += LeafNode.write(value[i], Uint8List.view(buf.buffer, offset)); + } + return offset - buf.offsetInBytes; + } + + static int allocationSize(List value) { + return value + .map((l) => LeafNode.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; + } + + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); } } -class FfiConverterMapControlBlockToTapScriptEntry { - static Map lift(RustBuffer buf) { - return FfiConverterMapControlBlockToTapScriptEntry.read( - buf.asUint8List(), - ).value; +class FfiConverterSequenceLocalOutput { + static List lift(RustBuffer buf) { + return FfiConverterSequenceLocalOutput.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - final map = {}; + static LiftRetVal> read(Uint8List buf) { + List res = []; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final k = FfiConverterControlBlock.read( - Uint8List.view(buf.buffer, offset), - ); - offset += k.bytesRead; - final v = FfiConverterTapScriptEntry.read( + final ret = FfiConverterLocalOutput.read( Uint8List.view(buf.buffer, offset), ); - offset += v.bytesRead; - map[k.value] = v.value; + offset += ret.bytesRead; + res.add(ret.value); } - return LiftRetVal(map, offset - buf.offsetInBytes); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int write(Map value, Uint8List buf) { + static int write(List value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; - for (final entry in value.entries) { - offset += FfiConverterControlBlock.write( - entry.key, - Uint8List.view(buf.buffer, offset), - ); - offset += FfiConverterTapScriptEntry.write( - entry.value, + for (var i = 0; i < value.length; i++) { + offset += FfiConverterLocalOutput.write( + value[i], Uint8List.view(buf.buffer, offset), ); } return offset - buf.offsetInBytes; } - static int allocationSize(Map value) { - return value.entries - .map( - (e) => - FfiConverterControlBlock.allocationSize(e.key) + - FfiConverterTapScriptEntry.allocationSize(e.value), - ) - .fold(4, (a, b) => a + b); + static int allocationSize(List value) { + return value + .map((l) => FfiConverterLocalOutput.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; } - static RustBuffer lower(Map value) { + static RustBuffer lower(List value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterOptionalTxOut { - static TxOut? lift(RustBuffer buf) { - return FfiConverterOptionalTxOut.read(buf.asUint8List()).value; +class FfiConverterSequenceOutPoint { + static List lift(RustBuffer buf) { + return FfiConverterSequenceOutPoint.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { - if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { - return LiftRetVal(null, 1); + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterOutPoint.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); } - final result = FfiConverterTxOut.read( - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int allocationSize([TxOut? value]) { - if (value == null) { - return 1; - } - return FfiConverterTxOut.allocationSize(value) + 1; - } - - static RustBuffer lower(TxOut? value) { - if (value == null) { - return toRustBuffer(Uint8List.fromList([0])); + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterOutPoint.write( + value[i], + Uint8List.view(buf.buffer, offset), + ); } - final length = FfiConverterOptionalTxOut.allocationSize(value); - final Pointer frameData = calloc(length); - final buf = frameData.asTypedList(length); - FfiConverterOptionalTxOut.write(value, buf); - final bytes = calloc(); - bytes.ref.len = length; - bytes.ref.data = frameData; - return RustBuffer.fromBytes(bytes.ref); + return offset - buf.offsetInBytes; } - static int write(TxOut? value, Uint8List buf) { - if (value == null) { - buf[0] = 0; - return 1; - } - buf[0] = 1; - return FfiConverterTxOut.write( - value, - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ) + - 1; + static int allocationSize(List value) { + return value + .map((l) => FfiConverterOutPoint.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; + } + + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); } } -class FfiConverterSequenceChainChange { - static List lift(RustBuffer buf) { - return FfiConverterSequenceChainChange.read(buf.asUint8List()).value; +class FfiConverterSequenceOutput { + static List lift(RustBuffer buf) { + return FfiConverterSequenceOutput.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; + static LiftRetVal> read(Uint8List buf) { + List res = []; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final ret = FfiConverterChainChange.read( - Uint8List.view(buf.buffer, offset), - ); + final ret = FfiConverterOutput.read(Uint8List.view(buf.buffer, offset)); offset += ret.bytesRead; res.add(ret.value); } return LiftRetVal(res, offset - buf.offsetInBytes); } - static int write(List value, Uint8List buf) { + static int write(List value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; for (var i = 0; i < value.length; i++) { - offset += FfiConverterChainChange.write( + offset += FfiConverterOutput.write( value[i], Uint8List.view(buf.buffer, offset), ); @@ -28625,147 +28224,138 @@ class FfiConverterSequenceChainChange { return offset - buf.offsetInBytes; } - static int allocationSize(List value) { + static int allocationSize(List value) { return value - .map((l) => FfiConverterChainChange.allocationSize(l)) + .map((l) => FfiConverterOutput.allocationSize(l)) .fold(0, (a, b) => a + b) + 4; } - static RustBuffer lower(List value) { + static RustBuffer lower(List value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterSequenceTransaction { - static List lift(RustBuffer buf) { - return FfiConverterSequenceTransaction.read(buf.asUint8List()).value; +class FfiConverterSequencePeer { + static List lift(RustBuffer buf) { + return FfiConverterSequencePeer.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; + static LiftRetVal> read(Uint8List buf) { + List res = []; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final ret = Transaction.read(Uint8List.view(buf.buffer, offset)); + final ret = FfiConverterPeer.read(Uint8List.view(buf.buffer, offset)); offset += ret.bytesRead; res.add(ret.value); } return LiftRetVal(res, offset - buf.offsetInBytes); } - static int write(List value, Uint8List buf) { + static int write(List value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; for (var i = 0; i < value.length; i++) { - offset += Transaction.write(value[i], Uint8List.view(buf.buffer, offset)); + offset += FfiConverterPeer.write( + value[i], + Uint8List.view(buf.buffer, offset), + ); } return offset - buf.offsetInBytes; } - static int allocationSize(List value) { + static int allocationSize(List value) { return value - .map((l) => Transaction.allocationSize(l)) + .map((l) => FfiConverterPeer.allocationSize(l)) .fold(0, (a, b) => a + b) + 4; } - static RustBuffer lower(List value) { + static RustBuffer lower(List value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterOptionalChangeSet { - static ChangeSet? lift(RustBuffer buf) { - return FfiConverterOptionalChangeSet.read(buf.asUint8List()).value; +class FfiConverterSequencePkOrF { + static List lift(RustBuffer buf) { + return FfiConverterSequencePkOrF.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { - if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { - return LiftRetVal(null, 1); + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterPkOrF.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); } - final result = ChangeSet.read( - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int allocationSize([ChangeSet? value]) { - if (value == null) { - return 1; + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterPkOrF.write( + value[i], + Uint8List.view(buf.buffer, offset), + ); } - return ChangeSet.allocationSize(value) + 1; + return offset - buf.offsetInBytes; } - static RustBuffer lower(ChangeSet? value) { - if (value == null) { - return toRustBuffer(Uint8List.fromList([0])); - } - final length = FfiConverterOptionalChangeSet.allocationSize(value); - final Pointer frameData = calloc(length); - final buf = frameData.asTypedList(length); - FfiConverterOptionalChangeSet.write(value, buf); - final bytes = calloc(); - bytes.ref.len = length; - bytes.ref.data = frameData; - return RustBuffer.fromBytes(bytes.ref); + static int allocationSize(List value) { + return value + .map((l) => FfiConverterPkOrF.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; } - static int write(ChangeSet? value, Uint8List buf) { - if (value == null) { - buf[0] = 0; - return 1; - } - buf[0] = 1; - return ChangeSet.write( - value, - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ) + - 1; + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); } } -class FfiConverterSequenceTx { - static List lift(RustBuffer buf) { - return FfiConverterSequenceTx.read(buf.asUint8List()).value; +class FfiConverterSequencePolicy { + static List lift(RustBuffer buf) { + return FfiConverterSequencePolicy.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - List res = []; + static LiftRetVal> read(Uint8List buf) { + List res = []; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final ret = FfiConverterTx.read(Uint8List.view(buf.buffer, offset)); + final ret = Policy.read(Uint8List.view(buf.buffer, offset)); offset += ret.bytesRead; res.add(ret.value); } return LiftRetVal(res, offset - buf.offsetInBytes); } - static int write(List value, Uint8List buf) { + static int write(List value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; for (var i = 0; i < value.length; i++) { - offset += FfiConverterTx.write( - value[i], - Uint8List.view(buf.buffer, offset), - ); + offset += Policy.write(value[i], Uint8List.view(buf.buffer, offset)); } return offset - buf.offsetInBytes; } - static int allocationSize(List value) { - return value - .map((l) => FfiConverterTx.allocationSize(l)) - .fold(0, (a, b) => a + b) + + static int allocationSize(List value) { + return value.map((l) => Policy.allocationSize(l)).fold(0, (a, b) => a + b) + 4; } - static RustBuffer lower(List value) { + static RustBuffer lower(List value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); @@ -28817,213 +28407,623 @@ class FfiConverterSequenceScriptAmount { } } -class FfiConverterOptionalLockTime { - static LockTime? lift(RustBuffer buf) { - return FfiConverterOptionalLockTime.read(buf.asUint8List()).value; +class FfiConverterSequenceString { + static List lift(RustBuffer buf) { + return FfiConverterSequenceString.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { - if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { - return LiftRetVal(null, 1); + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterString.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); } - final result = FfiConverterLockTime.read( - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int allocationSize([LockTime? value]) { - if (value == null) { - return 1; + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterString.write( + value[i], + Uint8List.view(buf.buffer, offset), + ); } - return FfiConverterLockTime.allocationSize(value) + 1; + return offset - buf.offsetInBytes; } - static RustBuffer lower(LockTime? value) { - if (value == null) { - return toRustBuffer(Uint8List.fromList([0])); - } - final length = FfiConverterOptionalLockTime.allocationSize(value); - final Pointer frameData = calloc(length); - final buf = frameData.asTypedList(length); - FfiConverterOptionalLockTime.write(value, buf); - final bytes = calloc(); - bytes.ref.len = length; - bytes.ref.data = frameData; - return RustBuffer.fromBytes(bytes.ref); + static int allocationSize(List value) { + return value + .map((l) => FfiConverterString.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; } - static int write(LockTime? value, Uint8List buf) { - if (value == null) { - buf[0] = 0; - return 1; - } - buf[0] = 1; - return FfiConverterLockTime.write( - value, - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ) + - 1; + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); } } -class FfiConverterMapUInt16ToDouble64 { - static Map lift(RustBuffer buf) { - return FfiConverterMapUInt16ToDouble64.read(buf.asUint8List()).value; +class FfiConverterSequenceTransaction { + static List lift(RustBuffer buf) { + return FfiConverterSequenceTransaction.read(buf.asUint8List()).value; } - static LiftRetVal> read(Uint8List buf) { - final map = {}; + static LiftRetVal> read(Uint8List buf) { + List res = []; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final k = FfiConverterUInt16.read(Uint8List.view(buf.buffer, offset)); - offset += k.bytesRead; - final v = FfiConverterDouble64.read(Uint8List.view(buf.buffer, offset)); - offset += v.bytesRead; - map[k.value] = v.value; + final ret = Transaction.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); } - return LiftRetVal(map, offset - buf.offsetInBytes); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int write(Map value, Uint8List buf) { + static int write(List value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; - for (final entry in value.entries) { - offset += FfiConverterUInt16.write( - entry.key, - Uint8List.view(buf.buffer, offset), - ); - offset += FfiConverterDouble64.write( - entry.value, - Uint8List.view(buf.buffer, offset), - ); + for (var i = 0; i < value.length; i++) { + offset += Transaction.write(value[i], Uint8List.view(buf.buffer, offset)); } return offset - buf.offsetInBytes; } - static int allocationSize(Map value) { - return value.entries - .map( - (e) => - FfiConverterUInt16.allocationSize(e.key) + - FfiConverterDouble64.allocationSize(e.value), - ) - .fold(4, (a, b) => a + b); + static int allocationSize(List value) { + return value + .map((l) => Transaction.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; } - static RustBuffer lower(Map value) { + static RustBuffer lower(List value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterMapSequenceUInt32ToSequenceCondition { - static Map, List> lift(RustBuffer buf) { - return FfiConverterMapSequenceUInt32ToSequenceCondition.read( - buf.asUint8List(), - ).value; +class FfiConverterSequenceTx { + static List lift(RustBuffer buf) { + return FfiConverterSequenceTx.read(buf.asUint8List()).value; } - static LiftRetVal, List>> read(Uint8List buf) { - final map = , List>{}; + static LiftRetVal> read(Uint8List buf) { + List res = []; final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); int offset = buf.offsetInBytes + 4; for (var i = 0; i < length; i++) { - final k = FfiConverterSequenceUInt32.read( - Uint8List.view(buf.buffer, offset), - ); - offset += k.bytesRead; - final v = FfiConverterSequenceCondition.read( + final ret = FfiConverterTx.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); + } + return LiftRetVal(res, offset - buf.offsetInBytes); + } + + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterTx.write( + value[i], Uint8List.view(buf.buffer, offset), ); - offset += v.bytesRead; - map[k.value] = v.value; } - return LiftRetVal(map, offset - buf.offsetInBytes); + return offset - buf.offsetInBytes; } - static int write(Map, List> value, Uint8List buf) { + static int allocationSize(List value) { + return value + .map((l) => FfiConverterTx.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; + } + + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); + } +} + +class FfiConverterSequenceTxIn { + static List lift(RustBuffer buf) { + return FfiConverterSequenceTxIn.read(buf.asUint8List()).value; + } + + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterTxIn.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); + } + return LiftRetVal(res, offset - buf.offsetInBytes); + } + + static int write(List value, Uint8List buf) { buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); int offset = buf.offsetInBytes + 4; - for (final entry in value.entries) { - offset += FfiConverterSequenceUInt32.write( - entry.key, + for (var i = 0; i < value.length; i++) { + offset += FfiConverterTxIn.write( + value[i], Uint8List.view(buf.buffer, offset), ); - offset += FfiConverterSequenceCondition.write( - entry.value, + } + return offset - buf.offsetInBytes; + } + + static int allocationSize(List value) { + return value + .map((l) => FfiConverterTxIn.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; + } + + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); + } +} + +class FfiConverterSequenceTxOut { + static List lift(RustBuffer buf) { + return FfiConverterSequenceTxOut.read(buf.asUint8List()).value; + } + + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterTxOut.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); + } + return LiftRetVal(res, offset - buf.offsetInBytes); + } + + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterTxOut.write( + value[i], Uint8List.view(buf.buffer, offset), ); } return offset - buf.offsetInBytes; } - static int allocationSize(Map, List> value) { - return value.entries - .map( - (e) => - FfiConverterSequenceUInt32.allocationSize(e.key) + - FfiConverterSequenceCondition.allocationSize(e.value), - ) - .fold(4, (a, b) => a + b); + static int allocationSize(List value) { + return value + .map((l) => FfiConverterTxOut.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; } - static RustBuffer lower(Map, List> value) { + static RustBuffer lower(List value) { final buf = Uint8List(allocationSize(value)); write(value, buf); return toRustBuffer(buf); } } -class FfiConverterOptionalString { - static String? lift(RustBuffer buf) { - return FfiConverterOptionalString.read(buf.asUint8List()).value; +class FfiConverterSequenceTxid { + static List lift(RustBuffer buf) { + return FfiConverterSequenceTxid.read(buf.asUint8List()).value; } - static LiftRetVal read(Uint8List buf) { - if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) { - return LiftRetVal(null, 1); + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = Txid.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); } - final result = FfiConverterString.read( - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ); - return LiftRetVal(result.value, result.bytesRead + 1); + return LiftRetVal(res, offset - buf.offsetInBytes); } - static int allocationSize([String? value]) { - if (value == null) { - return 1; + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += Txid.write(value[i], Uint8List.view(buf.buffer, offset)); } - return FfiConverterString.allocationSize(value) + 1; + return offset - buf.offsetInBytes; } - static RustBuffer lower(String? value) { - if (value == null) { - return toRustBuffer(Uint8List.fromList([0])); - } - final length = FfiConverterOptionalString.allocationSize(value); - final Pointer frameData = calloc(length); - final buf = frameData.asTypedList(length); - FfiConverterOptionalString.write(value, buf); - final bytes = calloc(); - bytes.ref.len = length; - bytes.ref.data = frameData; - return RustBuffer.fromBytes(bytes.ref); + static int allocationSize(List value) { + return value.map((l) => Txid.allocationSize(l)).fold(0, (a, b) => a + b) + + 4; } - static int write(String? value, Uint8List buf) { - if (value == null) { - buf[0] = 0; - return 1; + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); + } +} + +class FfiConverterSequenceUInt32 { + static List lift(RustBuffer buf) { + return FfiConverterSequenceUInt32.read(buf.asUint8List()).value; + } + + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterUInt32.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); } - buf[0] = 1; - return FfiConverterString.write( - value, - Uint8List.view(buf.buffer, buf.offsetInBytes + 1), - ) + - 1; + return LiftRetVal(res, offset - buf.offsetInBytes); + } + + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterUInt32.write( + value[i], + Uint8List.view(buf.buffer, offset), + ); + } + return offset - buf.offsetInBytes; + } + + static int allocationSize(List value) { + return value + .map((l) => FfiConverterUInt32.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; + } + + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); + } +} + +class FfiConverterSequenceUInt64 { + static List lift(RustBuffer buf) { + return FfiConverterSequenceUInt64.read(buf.asUint8List()).value; + } + + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterUInt64.read(Uint8List.view(buf.buffer, offset)); + offset += ret.bytesRead; + res.add(ret.value); + } + return LiftRetVal(res, offset - buf.offsetInBytes); + } + + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterUInt64.write( + value[i], + Uint8List.view(buf.buffer, offset), + ); + } + return offset - buf.offsetInBytes; + } + + static int allocationSize(List value) { + return value + .map((l) => FfiConverterUInt64.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; + } + + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); + } +} + +class FfiConverterSequenceUint8List { + static List lift(RustBuffer buf) { + return FfiConverterSequenceUint8List.read(buf.asUint8List()).value; + } + + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterUint8List.read( + Uint8List.view(buf.buffer, offset), + ); + offset += ret.bytesRead; + res.add(ret.value); + } + return LiftRetVal(res, offset - buf.offsetInBytes); + } + + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterUint8List.write( + value[i], + Uint8List.view(buf.buffer, offset), + ); + } + return offset - buf.offsetInBytes; + } + + static int allocationSize(List value) { + return value + .map((l) => FfiConverterUint8List.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; + } + + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); + } +} + +class FfiConverterSequenceUnconfirmedTx { + static List lift(RustBuffer buf) { + return FfiConverterSequenceUnconfirmedTx.read(buf.asUint8List()).value; + } + + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterUnconfirmedTx.read( + Uint8List.view(buf.buffer, offset), + ); + offset += ret.bytesRead; + res.add(ret.value); + } + return LiftRetVal(res, offset - buf.offsetInBytes); + } + + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterUnconfirmedTx.write( + value[i], + Uint8List.view(buf.buffer, offset), + ); + } + return offset - buf.offsetInBytes; + } + + static int allocationSize(List value) { + return value + .map((l) => FfiConverterUnconfirmedTx.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; + } + + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); + } +} + +class FfiConverterSequenceWalletEvent { + static List lift(RustBuffer buf) { + return FfiConverterSequenceWalletEvent.read(buf.asUint8List()).value; + } + + static LiftRetVal> read(Uint8List buf) { + List res = []; + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < length; i++) { + final ret = FfiConverterWalletEvent.read( + Uint8List.view(buf.buffer, offset), + ); + offset += ret.bytesRead; + res.add(ret.value); + } + return LiftRetVal(res, offset - buf.offsetInBytes); + } + + static int write(List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + int offset = buf.offsetInBytes + 4; + for (var i = 0; i < value.length; i++) { + offset += FfiConverterWalletEvent.write( + value[i], + Uint8List.view(buf.buffer, offset), + ); + } + return offset - buf.offsetInBytes; + } + + static int allocationSize(List value) { + return value + .map((l) => FfiConverterWalletEvent.allocationSize(l)) + .fold(0, (a, b) => a + b) + + 4; + } + + static RustBuffer lower(List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); + } +} + +class FfiConverterString { + static String lift(RustBuffer buf) { + return utf8.decoder.convert(buf.asUint8List()); + } + + static RustBuffer lower(String value) { + return toRustBuffer(Utf8Encoder().convert(value)); + } + + static LiftRetVal read(Uint8List buf) { + final end = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0) + 4; + return LiftRetVal(utf8.decoder.convert(buf, 4, end), end); + } + + static int allocationSize([String value = ""]) { + return utf8.encoder.convert(value).length + 4; + } + + static int write(String value, Uint8List buf) { + final list = utf8.encoder.convert(value); + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, list.length); + buf.setAll(4, list); + return list.length + 4; + } +} + +class FfiConverterUInt16 { + static int lift(int value) => value; + static LiftRetVal read(Uint8List buf) { + return LiftRetVal(buf.buffer.asByteData(buf.offsetInBytes).getUint16(0), 2); + } + + static int lower(int value) { + if (value < 0 || value > 65535) { + throw ArgumentError("Value out of range for u16: " + value.toString()); + } + return value; + } + + static int allocationSize([int value = 0]) { + return 2; + } + + static int write(int value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setUint16(0, lower(value)); + return 2; + } +} + +class FfiConverterUInt32 { + static int lift(int value) => value; + static LiftRetVal read(Uint8List buf) { + return LiftRetVal(buf.buffer.asByteData(buf.offsetInBytes).getUint32(0), 4); + } + + static int lower(int value) { + if (value < 0 || value > 4294967295) { + throw ArgumentError("Value out of range for u32: " + value.toString()); + } + return value; + } + + static int allocationSize([int value = 0]) { + return 4; + } + + static int write(int value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setUint32(0, lower(value)); + return 4; + } +} + +class FfiConverterUInt64 { + static int lift(int value) => value; + static LiftRetVal read(Uint8List buf) { + return LiftRetVal(buf.buffer.asByteData(buf.offsetInBytes).getUint64(0), 8); + } + + static int lower(int value) { + if (value < 0) { + throw ArgumentError("Value out of range for u64: " + value.toString()); + } + return value; + } + + static int allocationSize([int value = 0]) { + return 8; + } + + static int write(int value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setUint64(0, lower(value)); + return 8; + } +} + +class FfiConverterUInt8 { + static int lift(int value) => value; + static LiftRetVal read(Uint8List buf) { + return LiftRetVal(buf.buffer.asByteData(buf.offsetInBytes).getUint8(0), 1); + } + + static int lower(int value) { + if (value < 0 || value > 255) { + throw ArgumentError("Value out of range for u8: " + value.toString()); + } + return value; + } + + static int allocationSize([int value = 0]) { + return 1; + } + + static int write(int value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setUint8(0, lower(value)); + return 1; + } +} + +class FfiConverterUint8List { + static Uint8List lift(RustBuffer value) { + return FfiConverterUint8List.read(value.asUint8List()).value; + } + + static LiftRetVal read(Uint8List buf) { + final length = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0); + final bytes = Uint8List.view(buf.buffer, buf.offsetInBytes + 4, length); + return LiftRetVal(bytes, length + 4); + } + + static RustBuffer lower(Uint8List value) { + final buf = Uint8List(allocationSize(value)); + write(value, buf); + return toRustBuffer(buf); + } + + static int allocationSize([Uint8List? value]) { + if (value == null) { + return 4; + } + return 4 + value.length; + } + + static int write(Uint8List value, Uint8List buf) { + buf.buffer.asByteData(buf.offsetInBytes).setInt32(0, value.length); + buf.setRange(4, 4 + value.length, value); + return 4 + value.length; } } diff --git a/native/Cargo.lock b/native/Cargo.lock new file mode 100644 index 0000000..77ab34b --- /dev/null +++ b/native/Cargo.lock @@ -0,0 +1,2176 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[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 = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "askama" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4744ed2eef2645831b441d8f5459689ade2ab27c854488fbab1fbe94fce1a7" +dependencies = [ + "askama_derive 0.13.1", + "itoa", + "percent-encoding", + "serde", + "serde_json", +] + +[[package]] +name = "askama" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4" +dependencies = [ + "askama_derive 0.14.0", + "itoa", + "percent-encoding", + "serde", + "serde_json", +] + +[[package]] +name = "askama_derive" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d661e0f57be36a5c14c48f78d09011e67e0cb618f269cca9f2fd8d15b68c46ac" +dependencies = [ + "askama_parser 0.13.0", + "basic-toml", + "memchr", + "proc-macro2", + "quote", + "rustc-hash", + "serde", + "serde_derive", + "syn 2.0.117", +] + +[[package]] +name = "askama_derive" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f" +dependencies = [ + "askama_parser 0.14.0", + "basic-toml", + "memchr", + "proc-macro2", + "quote", + "rustc-hash", + "serde", + "serde_derive", + "syn 2.0.117", +] + +[[package]] +name = "askama_parser" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf315ce6524c857bb129ff794935cf6d42c82a6cff60526fe2a63593de4d0d4f" +dependencies = [ + "memchr", + "serde", + "serde_derive", + "winnow 0.7.15", +] + +[[package]] +name = "askama_parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358" +dependencies = [ + "memchr", + "serde", + "serde_derive", + "winnow 0.7.15", +] + +[[package]] +name = "async-compat" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ba85bc55464dcbf728b56d97e119d673f4cf9062be330a9a26f3acf504a590" +dependencies = [ + "futures-core", + "futures-io", + "once_cell", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "base58ck" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c8d66485a3a2ea485c1913c4572ce0256067a5377ac8c75c4960e1cda98605f" +dependencies = [ + "bitcoin-internals 0.3.0", + "bitcoin_hashes 0.14.1", +] + +[[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-ffi" +version = "2.3.0-alpha.0" +source = "git+https://github.com/bitcoindevkit/bdk-ffi.git?tag=v2.3.1#ecfc0b9ca68d01d503db78488381a066696a9be6" +dependencies = [ + "bdk_electrum", + "bdk_esplora", + "bdk_kyoto", + "bdk_wallet", + "thiserror 2.0.18", + "uniffi 0.30.0", +] + +[[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", + "rusqlite", + "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_dart_ffi" +version = "2.3.0-alpha.0" +dependencies = [ + "bdk-ffi", + "camino", + "uniffi 0.31.1", + "uniffi-dart", +] + +[[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", +] + +[[package]] +name = "bdk_esplora" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83986307ea92997c3d051e8c306af8115a05add601e22acb7c1903008e6b614e" +dependencies = [ + "bdk_core", + "esplora-client", +] + +[[package]] +name = "bdk_kyoto" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f35b9f8b3aa8c4647bec7a92b050c496742d955e0ac1edcb4e7c2deabf63c54" +dependencies = [ + "bdk_wallet", + "bip157", +] + +[[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", + "serde", + "serde_json", +] + +[[package]] +name = "bech32" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32637268377fc7b10a8c6d51de3e7fba1ce5dd371a96e342b34e6078db558e7f" + +[[package]] +name = "bip157" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88df5c18baaea9be4219679afbd4fc26491606f89f6ecdaffcdcabd67635b07b" +dependencies = [ + "bip324", + "bitcoin", + "bitcoin-address-book", + "tokio", +] + +[[package]] +name = "bip324" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53157fcb2d6ec2851c7602d0690536d0b79209e393972cb2b36bd5d72dbd1879" +dependencies = [ + "bitcoin", + "bitcoin_hashes 0.15.0", + "chacha20-poly1305", + "rand", + "tokio", +] + +[[package]] +name = "bip39" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90dbd31c98227229239363921e60fcf5e558e43ec69094d46fc4996f08d1d5bc" +dependencies = [ + "bitcoin_hashes 0.14.1", + "serde", + "unicode-normalization", +] + +[[package]] +name = "bitcoin" +version = "0.32.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf93e61f2dbc3e3c41234ca26a65e2c0b0975c52e0f069ab9893ebbede584d3" +dependencies = [ + "base58ck", + "base64 0.21.7", + "bech32", + "bitcoin-internals 0.3.0", + "bitcoin-io 0.1.4", + "bitcoin-units", + "bitcoin_hashes 0.14.1", + "hex-conservative 0.2.2", + "hex_lit", + "secp256k1", + "serde", +] + +[[package]] +name = "bitcoin-address-book" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "060c05780195789a7b89bbfe7f57a1a8cd6ae0bb3daa9b96eeca4fbe0ba8014f" +dependencies = [ + "bitcoin", +] + +[[package]] +name = "bitcoin-internals" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bdbe14aa07b06e6cfeffc529a1f099e5fbe249524f8125358604df99a4bed2" +dependencies = [ + "serde", +] + +[[package]] +name = "bitcoin-internals" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a90bbbfa552b49101a230fb2668f3f9ef968c81e6f83cf577e1d4b80f689e1aa" + +[[package]] +name = "bitcoin-io" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dee39a0ee5b4095224a0cfc6bf4cc1baf0f9624b96b367e53b66d974e51d953" + +[[package]] +name = "bitcoin-io" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26792cd2bf245069a1c5acb06aa7ad7abe1de69b507c90b490bca81e0665d0ee" +dependencies = [ + "bitcoin-internals 0.4.2", +] + +[[package]] +name = "bitcoin-units" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346568ebaab2918487cea76dd55dae13c27bb618cdb737c952e69eb2017c4118" +dependencies = [ + "bitcoin-internals 0.3.0", + "serde", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26ec84b80c482df901772e931a9a681e26a1b9ee2302edeff23cb30328745c8b" +dependencies = [ + "bitcoin-io 0.1.4", + "hex-conservative 0.2.2", + "serde", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0982261c82a50d89d1a411602afee0498b3e0debe3d36693f0c661352809639" +dependencies = [ + "bitcoin-io 0.2.0", + "hex-conservative 0.3.2", +] + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "camino" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" +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.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.18", +] + +[[package]] +name = "cc" +version = "1.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chacha20-poly1305" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b4b0fc281743d80256607bd65e8beedc42cb0787ea119c85b81b4c0eab85e5f" + +[[package]] +name = "clap" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[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.40", + "serde", + "serde_json", + "webpki-roots", + "winapi", +] + +[[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.52.0", +] + +[[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.2", + "log", + "minreq", + "serde", + "serde_json", +] + +[[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.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "genco" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a35958104272e516c2a5f66a9d82fba4784d2b585fc1e2358b8f96e15d342995" +dependencies = [ + "genco-macros", + "relative-path", + "smallvec", +] + +[[package]] +name = "genco-macros" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43eaff6bbc0b3a878361aced5ec6a2818ee7c541c5b33b5880dfa9a86c23e9e7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", + "wasip3", +] + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[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 = "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.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex-conservative" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda06d18ac606267c40c04e41b9947729bf8b9efe74bd4e82b61a5f26a510b9f" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "hex-conservative" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830e599c2904b08f0834ee6337d8fe8f0ed4a63b5d9e7a7f49c0ffa06d08d360" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "hex_lit" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", + "serde", + "serde_core", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[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 = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c14116d8342edd3626b0f8e84df16f4e6a76dc04799ba747493403236a1b8ac5" +dependencies = [ + "bech32", + "bitcoin", + "serde", +] + +[[package]] +name = "minreq" +version = "2.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05015102dad0f7d61691ca347e9d9d9006685a64aefb3d79eecf62665de2153d" +dependencies = [ + "base64 0.22.1", + "rustls 0.21.12", + "rustls-webpki 0.101.7", + "serde", + "serde_json", + "webpki-roots", +] + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[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 = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[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 = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[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.117", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[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", +] + +[[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 = "relative-path" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" + +[[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", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", +] + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[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.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki 0.103.13", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" +dependencies = [ + "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.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[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.117", +] + +[[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 0.14.1", + "rand", + "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.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_json" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "siphasher" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "stringcase" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04028eeb851ed08af6aba5caa29f2d59a13ed168cee4d6bd753aeefcf1d636b0" + +[[package]] +name = "stringcase" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72abeda133c49d7bddece6c154728f83eec8172380c80ab7096da9487e20d27c" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[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.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.2", + "once_cell", + "rustix", + "windows-sys 0.52.0", +] + +[[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.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[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.117", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +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.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "toml" +version = "0.9.12+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow 0.7.15", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow 1.0.3", +] + +[[package]] +name = "toml_writer" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" + +[[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 = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "uniffi" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c866f627c3f04c3df068b68bb2d725492caaa539dd313e2a9d26bb85b1a32f4e" +dependencies = [ + "anyhow", + "camino", + "cargo_metadata 0.19.2", + "clap", + "uniffi_bindgen 0.30.0", + "uniffi_build 0.30.0", + "uniffi_core 0.30.0", + "uniffi_macros 0.30.0", + "uniffi_pipeline 0.30.0", +] + +[[package]] +name = "uniffi" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc5f2297ee5b893405bed1a6929faec4713a061df158ecf5198089f23910d470" +dependencies = [ + "anyhow", + "camino", + "cargo_metadata 0.19.2", + "clap", + "uniffi_bindgen 0.31.1", + "uniffi_build 0.31.1", + "uniffi_core 0.31.1", + "uniffi_macros 0.31.1", + "uniffi_pipeline 0.31.1", +] + +[[package]] +name = "uniffi-dart" +version = "0.1.0+v0.30.0" +source = "git+https://github.com/Uniffi-Dart/uniffi-dart?rev=379a0e35dfa50ea79172a478d1e4a75a15e8168a#379a0e35dfa50ea79172a478d1e4a75a15e8168a" +dependencies = [ + "anyhow", + "camino", + "cargo_metadata 0.18.1", + "genco", + "heck", + "lazy_static", + "paste", + "proc-macro2", + "serde", + "stringcase 0.4.0", + "toml", + "uniffi 0.31.1", + "uniffi_bindgen 0.31.1", + "uniffi_build 0.31.1", + "uniffi_dart_macro", +] + +[[package]] +name = "uniffi_bindgen" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c8ca600167641ebe7c8ba9254af40492dda3397c528cc3b2f511bd23e8541a5" +dependencies = [ + "anyhow", + "askama 0.13.1", + "camino", + "cargo_metadata 0.19.2", + "fs-err", + "glob", + "goblin", + "heck", + "indexmap", + "once_cell", + "serde", + "tempfile", + "textwrap", + "toml", + "uniffi_internal_macros 0.30.0", + "uniffi_meta 0.30.0", + "uniffi_pipeline 0.30.0", + "uniffi_udl 0.30.0", +] + +[[package]] +name = "uniffi_bindgen" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bc0c60a9607e7ab77a2ad47ec5530178015014839db25af7512447d2238016c" +dependencies = [ + "anyhow", + "askama 0.14.0", + "camino", + "cargo_metadata 0.19.2", + "fs-err", + "glob", + "goblin", + "heck", + "indexmap", + "once_cell", + "serde", + "tempfile", + "textwrap", + "toml", + "uniffi_internal_macros 0.31.1", + "uniffi_meta 0.31.1", + "uniffi_pipeline 0.31.1", + "uniffi_udl 0.31.1", +] + +[[package]] +name = "uniffi_build" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e55c05228f4858bb258f651d21d743fcc1fe5a2ec20d3c0f9daefddb105ee4d" +dependencies = [ + "anyhow", + "camino", + "uniffi_bindgen 0.30.0", +] + +[[package]] +name = "uniffi_build" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c39413c43b955e4aa8a4e2b34bbd1b6b5ff6bd85532b52f9eb92fbe88c14458" +dependencies = [ + "anyhow", + "camino", + "uniffi_bindgen 0.31.1", +] + +[[package]] +name = "uniffi_core" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e7a5a038ebffe8f4cf91416b154ef3c2468b18e828b7009e01b1b99938089f9" +dependencies = [ + "anyhow", + "bytes", + "once_cell", + "static_assertions", +] + +[[package]] +name = "uniffi_core" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77baf5d539fe2e1ad6805e942dbc5dbdeb2b83eb5f2b3a6535d422ca4b02a12f" +dependencies = [ + "anyhow", + "async-compat", + "bytes", + "once_cell", + "static_assertions", +] + +[[package]] +name = "uniffi_dart_macro" +version = "0.1.0+v0.30.0" +source = "git+https://github.com/Uniffi-Dart/uniffi-dart?rev=379a0e35dfa50ea79172a478d1e4a75a15e8168a#379a0e35dfa50ea79172a478d1e4a75a15e8168a" +dependencies = [ + "futures", + "proc-macro2", + "quote", + "stringcase 0.3.0", + "syn 1.0.109", + "uniffi 0.31.1", +] + +[[package]] +name = "uniffi_internal_macros" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c2a6f93e7b73726e2015696ece25ca0ac5a5f1cf8d6a7ab5214dd0a01d2edf" +dependencies = [ + "anyhow", + "indexmap", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "uniffi_internal_macros" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4b42137524f4be6400fcaca9d02c1d4ecb6ad917e4013c0b93235526d8396e5" +dependencies = [ + "anyhow", + "indexmap", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "uniffi_macros" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c6309fc36c7992afc03bc0c5b059c656bccbef3f2a4bc362980017f8936141" +dependencies = [ + "camino", + "fs-err", + "once_cell", + "proc-macro2", + "quote", + "serde", + "syn 2.0.117", + "toml", + "uniffi_meta 0.30.0", +] + +[[package]] +name = "uniffi_macros" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9273ec45330d8fe9a3701b7b983cea7a4e218503359831967cb95d26b873561" +dependencies = [ + "camino", + "fs-err", + "once_cell", + "proc-macro2", + "quote", + "serde", + "syn 2.0.117", + "toml", + "uniffi_meta 0.31.1", +] + +[[package]] +name = "uniffi_meta" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a138823392dba19b0aa494872689f97d0ee157de5852e2bec157ce6de9cdc22" +dependencies = [ + "anyhow", + "siphasher 0.3.11", + "uniffi_internal_macros 0.30.0", + "uniffi_pipeline 0.30.0", +] + +[[package]] +name = "uniffi_meta" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "431d2f443e7828a6c29d188de98b6771a6491ee98bba2d4372643bf93f988a18" +dependencies = [ + "anyhow", + "siphasher 1.0.3", + "uniffi_internal_macros 0.31.1", + "uniffi_pipeline 0.31.1", +] + +[[package]] +name = "uniffi_pipeline" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c27c4b515d25f8e53cc918e238c39a79c3144a40eaf2e51c4a7958973422c29" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "tempfile", + "uniffi_internal_macros 0.30.0", +] + +[[package]] +name = "uniffi_pipeline" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "761ef74f6175e15603d0424cc5f98854c5baccfe7bf4ccb08e5816f9ab8af689" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "tempfile", + "uniffi_internal_macros 0.31.1", +] + +[[package]] +name = "uniffi_udl" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0adacdd848aeed7af4f5af7d2f621d5e82531325d405e29463482becfdeafca" +dependencies = [ + "anyhow", + "textwrap", + "uniffi_meta 0.30.0", + "weedle2", +] + +[[package]] +name = "uniffi_udl" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68773ec0e1c067b6505a73bbf6a5782f31a7f9209333a0df97b87565c46bf370" +dependencies = [ + "anyhow", + "textwrap", + "uniffi_meta 0.31.1", + "weedle2", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[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 = "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.3+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +dependencies = [ + "wit-bindgen 0.57.1", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen 0.51.0", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "weedle2" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e" +dependencies = [ + "nom", +] + +[[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-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn 2.0.117", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.117", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/native/Cargo.toml b/native/Cargo.toml index d266682..6205365 100644 --- a/native/Cargo.toml +++ b/native/Cargo.toml @@ -18,12 +18,16 @@ path = "uniffi-bindgen.rs" [dependencies] bdk-ffi = { package = "bdk-ffi", git = "https://github.com/bitcoindevkit/bdk-ffi.git", tag = "v2.3.1" } +# TODO: Bump UniFFI after a release includes mozilla/uniffi-rs#2873. +# UniFFI 0.31.1 predates the deterministic uniffi_traits ordering fix merged on 2026-04-16. uniffi = { version = "=0.31.1", features = ["cli"] } -uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart", tag = "v0.2.0+v0.31.1" } +# TODO: Switch this rev pin back to a release tag after a tag includes Uniffi-Dart/uniffi-dart#134. +# The latest release tag, v0.2.0+v0.31.1, predates deterministic Dart helper ordering merged on 2026-05-04. +uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart", rev = "379a0e35dfa50ea79172a478d1e4a75a15e8168a" } camino = "1.2" [build-dependencies] uniffi = { version = "=0.31.1", features = ["build"] } -uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart", tag = "v0.2.0+v0.31.1", features = [ +uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart", rev = "379a0e35dfa50ea79172a478d1e4a75a15e8168a", features = [ "build", ] } diff --git a/scripts/check_reproducibility.sh b/scripts/check_reproducibility.sh new file mode 100644 index 0000000..20bd5f1 --- /dev/null +++ b/scripts/check_reproducibility.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +BDK_DART_DIR="$SCRIPT_DIR/.." +NATIVE_DIR="$BDK_DART_DIR/native" +ENFORCE_NATIVE_HASH="${BDK_DART_ENFORCE_NATIVE_HASH:-0}" + +case "$(uname -s)" in + Darwin) + LIBNAME=libbdk_dart_ffi.dylib + ;; + Linux) + LIBNAME=libbdk_dart_ffi.so + ;; + *) + echo "Unsupported os: $(uname -s)" >&2 + exit 1 + ;; +esac + +hash_file() { + local file="$1" + if command -v sha256sum >/dev/null 2>&1; then + sha256sum "$file" | awk '{print $1}' + else + shasum -a 256 "$file" | awk '{print $1}' + fi +} + +cd "$BDK_DART_DIR" + +echo "Regenerating Dart bindings..." +bash "$BDK_DART_DIR/scripts/generate_bindings.sh" + +echo "Checking generated binding drift..." +if ! git diff --exit-code -- lib/bdk.dart; then + echo "Generated bindings differ from committed lib/bdk.dart." >&2 + exit 1 +fi + +TMP_DIR="$(mktemp -d)" +cleanup() { + rm -rf "$TMP_DIR" +} +trap cleanup EXIT + +declare -a HASHES=() + +for build_index in 1 2; do + TARGET_DIR="$TMP_DIR/target-$build_index" + ARTIFACT="$TARGET_DIR/release/$LIBNAME" + + echo "Building native library pass $build_index..." + CARGO_INCREMENTAL=0 cargo build \ + --locked \ + --release \ + --manifest-path "$NATIVE_DIR/Cargo.toml" \ + --target-dir "$TARGET_DIR" + + if [[ ! -f "$ARTIFACT" ]]; then + echo "Expected native artifact not found: $ARTIFACT" >&2 + exit 1 + fi + + HASH="$(hash_file "$ARTIFACT")" + HASHES+=("$HASH") + echo "pass $build_index: $HASH $ARTIFACT" +done + +if [[ "${HASHES[0]}" != "${HASHES[1]}" ]]; then + echo "Native library hashes differ between clean builds." >&2 + echo "This is currently reported as native build input hygiene rather than enforced binary reproducibility." >&2 + echo "Set BDK_DART_ENFORCE_NATIVE_HASH=1 once the UniFFI trait-ordering fix is available in the native dependency stack." >&2 + if [[ "$ENFORCE_NATIVE_HASH" == "1" ]]; then + exit 1 + fi +else + echo "Native library hashes match." +fi + +echo "Reproducibility hygiene check completed." diff --git a/scripts/generate_bindings.sh b/scripts/generate_bindings.sh index 9bc4d39..c0028ef 100644 --- a/scripts/generate_bindings.sh +++ b/scripts/generate_bindings.sh @@ -30,9 +30,9 @@ fi # Navigate to the native directory to build the rust code using Cargo.toml cd "$NATIVE_DIR" echo "Building bdk-dart-ffi..." -cargo build --profile dev +cargo build --locked --profile dev # Generate Dart bindings using local uniffi-bindgen wrapper -cargo run --profile dev --bin uniffi-bindgen -- generate --library --language dart --out-dir "$BDK_DART_DIR/lib/" "$NATIVE_DIR/target/debug/$LIBNAME" +cargo run --locked --profile dev --bin uniffi-bindgen -- generate --library --language dart --out-dir "$BDK_DART_DIR/lib/" "$NATIVE_DIR/target/debug/$LIBNAME" -echo "Bindings generated successfully!" \ No newline at end of file +echo "Bindings generated successfully!"