content: // This file is automatically generated, so please do not edit it.
  // @generated by `flutter_rust_bridge`@ 2.9.0.
  
  // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
  
  import 'api/blockchain.dart';
  import 'api/descriptor.dart';
  import 'api/error.dart';
  import 'api/transaction.dart';
  import 'api/types.dart';
  import 'api/wallet.dart';
  import 'dart:async';
  import 'dart:convert';
  import 'frb_generated.dart';
  import 'frb_generated.io.dart'
      if (dart.library.js_interop) 'frb_generated.web.dart';
  import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
  
  /// Main entrypoint of the Rust API
  class LwkCore extends BaseEntrypoint<LwkCoreApi, LwkCoreApiImpl, LwkCoreWire> {
    @internal
    static final instance = LwkCore._();
  
    LwkCore._();
  
    /// Initialize flutter_rust_bridge
    static Future<void> init({
      LwkCoreApi? api,
      BaseHandler? handler,
      ExternalLibrary? externalLibrary,
    }) async {
      await instance.initImpl(
        api: api,
        handler: handler,
        externalLibrary: externalLibrary,
      );
    }
  
    /// Initialize flutter_rust_bridge in mock mode.
    /// No libraries for FFI are loaded.
    static void initMock({
      required LwkCoreApi api,
    }) {
      instance.initMockImpl(
        api: api,
      );
    }
  
    /// Dispose flutter_rust_bridge
    ///
    /// The call to this function is optional, since flutter_rust_bridge (and everything else)
    /// is automatically disposed when the app stops.
    static void dispose() => instance.disposeImpl();
  
    @override
    ApiImplConstructor<LwkCoreApiImpl, LwkCoreWire> get apiImplConstructor =>
        LwkCoreApiImpl.new;
  
    @override
    WireConstructor<LwkCoreWire> get wireConstructor =>
        LwkCoreWire.fromExternalLibrary;
  
    @override
    Future<void> executeRustInitializers() async {}
  
    @override
    ExternalLibraryLoaderConfig get defaultExternalLibraryLoaderConfig =>
        kDefaultExternalLibraryLoaderConfig;
  
    @override
    String get codegenVersion => '2.9.0';
  
    @override
    int get rustContentHash => 119919397;
  
    static const kDefaultExternalLibraryLoaderConfig =
        ExternalLibraryLoaderConfig(
      stem: 'lwk',
      ioDirectory: 'rust/target/release/',
      webPrefix: 'pkg/',
    );
  }
  
  abstract class LwkCoreApi extends BaseApi {
    Future<Address> crateApiTypesAddressAddressFromScript(
        {required Network network, required String script, String? blindingKey});
  
    Future<Network> crateApiTypesAddressValidate({required String addressString});
  
    Future<String> crateApiBlockchainBlockchainBroadcastSignedPset(
        {required String electrumUrl, required String signedPset});
  
    Future<String> crateApiBlockchainBlockchainBroadcastTxBytes(
        {required String electrumUrl, required List<int> txBytes});
  
    Future<void> crateApiBlockchainBlockchainTest(
        {required Blockchain that, required String electrumUrl});
  
    Future<Descriptor> crateApiDescriptorDescriptorNewConfidential(
        {required Network network, required String mnemonic});
  
    Future<Uint8List> crateApiTransactionExtractTxBytes({required String pset});
  
    Future<SizeAndFees> crateApiTransactionGetSizeAndAbsoluteFees(
        {required String pset});
  
    Future<Address> crateApiWalletWalletAddress(
        {required Wallet that, required int index});
  
    Future<Address> crateApiWalletWalletAddressLastUnused({required Wallet that});
  
    Future<List<Balance>> crateApiWalletWalletBalances({required Wallet that});
  
    Future<String> crateApiWalletWalletBlindingKey({required Wallet that});
  
    Future<String> crateApiWalletWalletBuildAssetTx(
        {required Wallet that,
        required BigInt sats,
        required String outAddress,
        required double feeRate,
        required String asset});
  
    Future<String> crateApiWalletWalletBuildLbtcTx(
        {required Wallet that,
        required BigInt sats,
        required String outAddress,
        required double feeRate,
        required bool drain});
  
    Future<PayjoinTx> crateApiWalletWalletBuildPayjoinTx(
        {required Wallet that,
        required BigInt sats,
        required String outAddress,
        required String asset,
        required Network network});
  
    Future<PsetAmounts> crateApiWalletWalletDecodeTx(
        {required Wallet that, required String pset});
  
    Future<String> crateApiWalletWalletDescriptor({required Wallet that});
  
    Future<Wallet> crateApiWalletWalletInit(
        {required Network network,
        required String dbpath,
        required Descriptor descriptor});
  
    Future<String> crateApiWalletWalletSignTx(
        {required Wallet that,
        required Network network,
        required String pset,
        required String mnemonic});
  
    Future<String> crateApiWalletWalletSignedPsetWithExtraDetails(
        {required Wallet that,
        required Network network,
        required String pset,
        required String mnemonic});
  
    Future<void> crateApiWalletWalletSync(
        {required Wallet that,
        required String electrumUrl,
        required bool validateDomain});
  
    Future<List<Tx>> crateApiWalletWalletTxs({required Wallet that});
  
    Future<List<TxOut>> crateApiWalletWalletUtxos({required Wallet that});
  
    RustArcIncrementStrongCountFnType
        get rust_arc_increment_strong_count_MutexWollet;
  
    RustArcDecrementStrongCountFnType
        get rust_arc_decrement_strong_count_MutexWollet;
  
    CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_MutexWolletPtr;
  }
  
  class LwkCoreApiImpl extends LwkCoreApiImplPlatform implements LwkCoreApi {
    LwkCoreApiImpl({
      required super.handler,
      required super.wire,
      required super.generalizedFrbRustBinding,
      required super.portManager,
    });
  
    @override
    Future<Address> crateApiTypesAddressAddressFromScript(
        {required Network network, required String script, String? blindingKey}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_network(network);
          var arg1 = cst_encode_String(script);
          var arg2 = cst_encode_opt_String(blindingKey);
          return wire.wire__crate__api__types__address_address_from_script(
              port_, arg0, arg1, arg2);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_address,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiTypesAddressAddressFromScriptConstMeta,
        argValues: [network, script, blindingKey],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiTypesAddressAddressFromScriptConstMeta =>
        const TaskConstMeta(
          debugName: "address_address_from_script",
          argNames: ["network", "script", "blindingKey"],
        );
  
    @override
    Future<Network> crateApiTypesAddressValidate(
        {required String addressString}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_String(addressString);
          return wire.wire__crate__api__types__address_validate(port_, arg0);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_network,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiTypesAddressValidateConstMeta,
        argValues: [addressString],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiTypesAddressValidateConstMeta =>
        const TaskConstMeta(
          debugName: "address_validate",
          argNames: ["addressString"],
        );
  
    @override
    Future<String> crateApiBlockchainBlockchainBroadcastSignedPset(
        {required String electrumUrl, required String signedPset}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_String(electrumUrl);
          var arg1 = cst_encode_String(signedPset);
          return wire
              .wire__crate__api__blockchain__blockchain_broadcast_signed_pset(
                  port_, arg0, arg1);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_String,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiBlockchainBlockchainBroadcastSignedPsetConstMeta,
        argValues: [electrumUrl, signedPset],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiBlockchainBlockchainBroadcastSignedPsetConstMeta =>
        const TaskConstMeta(
          debugName: "blockchain_broadcast_signed_pset",
          argNames: ["electrumUrl", "signedPset"],
        );
  
    @override
    Future<String> crateApiBlockchainBlockchainBroadcastTxBytes(
        {required String electrumUrl, required List<int> txBytes}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_String(electrumUrl);
          var arg1 = cst_encode_list_prim_u_8_loose(txBytes);
          return wire.wire__crate__api__blockchain__blockchain_broadcast_tx_bytes(
              port_, arg0, arg1);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_String,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiBlockchainBlockchainBroadcastTxBytesConstMeta,
        argValues: [electrumUrl, txBytes],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiBlockchainBlockchainBroadcastTxBytesConstMeta =>
        const TaskConstMeta(
          debugName: "blockchain_broadcast_tx_bytes",
          argNames: ["electrumUrl", "txBytes"],
        );
  
    @override
    Future<void> crateApiBlockchainBlockchainTest(
        {required Blockchain that, required String electrumUrl}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_blockchain(that);
          var arg1 = cst_encode_String(electrumUrl);
          return wire.wire__crate__api__blockchain__blockchain_test(
              port_, arg0, arg1);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_unit,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiBlockchainBlockchainTestConstMeta,
        argValues: [that, electrumUrl],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiBlockchainBlockchainTestConstMeta =>
        const TaskConstMeta(
          debugName: "blockchain_test",
          argNames: ["that", "electrumUrl"],
        );
  
    @override
    Future<Descriptor> crateApiDescriptorDescriptorNewConfidential(
        {required Network network, required String mnemonic}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_network(network);
          var arg1 = cst_encode_String(mnemonic);
          return wire.wire__crate__api__descriptor__descriptor_new_confidential(
              port_, arg0, arg1);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_descriptor,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiDescriptorDescriptorNewConfidentialConstMeta,
        argValues: [network, mnemonic],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiDescriptorDescriptorNewConfidentialConstMeta =>
        const TaskConstMeta(
          debugName: "descriptor_new_confidential",
          argNames: ["network", "mnemonic"],
        );
  
    @override
    Future<Uint8List> crateApiTransactionExtractTxBytes({required String pset}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_String(pset);
          return wire.wire__crate__api__transaction__extract_tx_bytes(
              port_, arg0);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_list_prim_u_8_strict,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiTransactionExtractTxBytesConstMeta,
        argValues: [pset],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiTransactionExtractTxBytesConstMeta =>
        const TaskConstMeta(
          debugName: "extract_tx_bytes",
          argNames: ["pset"],
        );
  
    @override
    Future<SizeAndFees> crateApiTransactionGetSizeAndAbsoluteFees(
        {required String pset}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_String(pset);
          return wire.wire__crate__api__transaction__get_size_and_absolute_fees(
              port_, arg0);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_size_and_fees,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiTransactionGetSizeAndAbsoluteFeesConstMeta,
        argValues: [pset],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiTransactionGetSizeAndAbsoluteFeesConstMeta =>
        const TaskConstMeta(
          debugName: "get_size_and_absolute_fees",
          argNames: ["pset"],
        );
  
    @override
    Future<Address> crateApiWalletWalletAddress(
        {required Wallet that, required int index}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          var arg1 = cst_encode_u_32(index);
          return wire.wire__crate__api__wallet__wallet_address(port_, arg0, arg1);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_address,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletAddressConstMeta,
        argValues: [that, index],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletAddressConstMeta =>
        const TaskConstMeta(
          debugName: "wallet_address",
          argNames: ["that", "index"],
        );
  
    @override
    Future<Address> crateApiWalletWalletAddressLastUnused(
        {required Wallet that}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          return wire.wire__crate__api__wallet__wallet_address_last_unused(
              port_, arg0);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_address,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletAddressLastUnusedConstMeta,
        argValues: [that],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletAddressLastUnusedConstMeta =>
        const TaskConstMeta(
          debugName: "wallet_address_last_unused",
          argNames: ["that"],
        );
  
    @override
    Future<List<Balance>> crateApiWalletWalletBalances({required Wallet that}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          return wire.wire__crate__api__wallet__wallet_balances(port_, arg0);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_list_balance,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletBalancesConstMeta,
        argValues: [that],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletBalancesConstMeta =>
        const TaskConstMeta(
          debugName: "wallet_balances",
          argNames: ["that"],
        );
  
    @override
    Future<String> crateApiWalletWalletBlindingKey({required Wallet that}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          return wire.wire__crate__api__wallet__wallet_blinding_key(port_, arg0);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_String,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletBlindingKeyConstMeta,
        argValues: [that],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletBlindingKeyConstMeta =>
        const TaskConstMeta(
          debugName: "wallet_blinding_key",
          argNames: ["that"],
        );
  
    @override
    Future<String> crateApiWalletWalletBuildAssetTx(
        {required Wallet that,
        required BigInt sats,
        required String outAddress,
        required double feeRate,
        required String asset}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          var arg1 = cst_encode_u_64(sats);
          var arg2 = cst_encode_String(outAddress);
          var arg3 = cst_encode_f_32(feeRate);
          var arg4 = cst_encode_String(asset);
          return wire.wire__crate__api__wallet__wallet_build_asset_tx(
              port_, arg0, arg1, arg2, arg3, arg4);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_String,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletBuildAssetTxConstMeta,
        argValues: [that, sats, outAddress, feeRate, asset],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletBuildAssetTxConstMeta =>
        const TaskConstMeta(
          debugName: "wallet_build_asset_tx",
          argNames: ["that", "sats", "outAddress", "feeRate", "asset"],
        );
  
    @override
    Future<String> crateApiWalletWalletBuildLbtcTx(
        {required Wallet that,
        required BigInt sats,
        required String outAddress,
        required double feeRate,
        required bool drain}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          var arg1 = cst_encode_u_64(sats);
          var arg2 = cst_encode_String(outAddress);
          var arg3 = cst_encode_f_32(feeRate);
          var arg4 = cst_encode_bool(drain);
          return wire.wire__crate__api__wallet__wallet_build_lbtc_tx(
              port_, arg0, arg1, arg2, arg3, arg4);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_String,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletBuildLbtcTxConstMeta,
        argValues: [that, sats, outAddress, feeRate, drain],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletBuildLbtcTxConstMeta =>
        const TaskConstMeta(
          debugName: "wallet_build_lbtc_tx",
          argNames: ["that", "sats", "outAddress", "feeRate", "drain"],
        );
  
    @override
    Future<PayjoinTx> crateApiWalletWalletBuildPayjoinTx(
        {required Wallet that,
        required BigInt sats,
        required String outAddress,
        required String asset,
        required Network network}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          var arg1 = cst_encode_u_64(sats);
          var arg2 = cst_encode_String(outAddress);
          var arg3 = cst_encode_String(asset);
          var arg4 = cst_encode_network(network);
          return wire.wire__crate__api__wallet__wallet_build_payjoin_tx(
              port_, arg0, arg1, arg2, arg3, arg4);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_payjoin_tx,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletBuildPayjoinTxConstMeta,
        argValues: [that, sats, outAddress, asset, network],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletBuildPayjoinTxConstMeta =>
        const TaskConstMeta(
          debugName: "wallet_build_payjoin_tx",
          argNames: ["that", "sats", "outAddress", "asset", "network"],
        );
  
    @override
    Future<PsetAmounts> crateApiWalletWalletDecodeTx(
        {required Wallet that, required String pset}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          var arg1 = cst_encode_String(pset);
          return wire.wire__crate__api__wallet__wallet_decode_tx(
              port_, arg0, arg1);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_pset_amounts,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletDecodeTxConstMeta,
        argValues: [that, pset],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletDecodeTxConstMeta =>
        const TaskConstMeta(
          debugName: "wallet_decode_tx",
          argNames: ["that", "pset"],
        );
  
    @override
    Future<String> crateApiWalletWalletDescriptor({required Wallet that}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          return wire.wire__crate__api__wallet__wallet_descriptor(port_, arg0);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_String,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletDescriptorConstMeta,
        argValues: [that],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletDescriptorConstMeta =>
        const TaskConstMeta(
          debugName: "wallet_descriptor",
          argNames: ["that"],
        );
  
    @override
    Future<Wallet> crateApiWalletWalletInit(
        {required Network network,
        required String dbpath,
        required Descriptor descriptor}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_network(network);
          var arg1 = cst_encode_String(dbpath);
          var arg2 = cst_encode_box_autoadd_descriptor(descriptor);
          return wire.wire__crate__api__wallet__wallet_init(
              port_, arg0, arg1, arg2);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_wallet,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletInitConstMeta,
        argValues: [network, dbpath, descriptor],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletInitConstMeta => const TaskConstMeta(
          debugName: "wallet_init",
          argNames: ["network", "dbpath", "descriptor"],
        );
  
    @override
    Future<String> crateApiWalletWalletSignTx(
        {required Wallet that,
        required Network network,
        required String pset,
        required String mnemonic}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          var arg1 = cst_encode_network(network);
          var arg2 = cst_encode_String(pset);
          var arg3 = cst_encode_String(mnemonic);
          return wire.wire__crate__api__wallet__wallet_sign_tx(
              port_, arg0, arg1, arg2, arg3);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_String,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletSignTxConstMeta,
        argValues: [that, network, pset, mnemonic],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletSignTxConstMeta => const TaskConstMeta(
          debugName: "wallet_sign_tx",
          argNames: ["that", "network", "pset", "mnemonic"],
        );
  
    @override
    Future<String> crateApiWalletWalletSignedPsetWithExtraDetails(
        {required Wallet that,
        required Network network,
        required String pset,
        required String mnemonic}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          var arg1 = cst_encode_network(network);
          var arg2 = cst_encode_String(pset);
          var arg3 = cst_encode_String(mnemonic);
          return wire
              .wire__crate__api__wallet__wallet_signed_pset_with_extra_details(
                  port_, arg0, arg1, arg2, arg3);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_String,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletSignedPsetWithExtraDetailsConstMeta,
        argValues: [that, network, pset, mnemonic],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletSignedPsetWithExtraDetailsConstMeta =>
        const TaskConstMeta(
          debugName: "wallet_signed_pset_with_extra_details",
          argNames: ["that", "network", "pset", "mnemonic"],
        );
  
    @override
    Future<void> crateApiWalletWalletSync(
        {required Wallet that,
        required String electrumUrl,
        required bool validateDomain}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          var arg1 = cst_encode_String(electrumUrl);
          var arg2 = cst_encode_bool(validateDomain);
          return wire.wire__crate__api__wallet__wallet_sync(
              port_, arg0, arg1, arg2);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_unit,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletSyncConstMeta,
        argValues: [that, electrumUrl, validateDomain],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletSyncConstMeta => const TaskConstMeta(
          debugName: "wallet_sync",
          argNames: ["that", "electrumUrl", "validateDomain"],
        );
  
    @override
    Future<List<Tx>> crateApiWalletWalletTxs({required Wallet that}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          return wire.wire__crate__api__wallet__wallet_txs(port_, arg0);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_list_tx,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletTxsConstMeta,
        argValues: [that],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletTxsConstMeta => const TaskConstMeta(
          debugName: "wallet_txs",
          argNames: ["that"],
        );
  
    @override
    Future<List<TxOut>> crateApiWalletWalletUtxos({required Wallet that}) {
      return handler.executeNormal(NormalTask(
        callFfi: (port_) {
          var arg0 = cst_encode_box_autoadd_wallet(that);
          return wire.wire__crate__api__wallet__wallet_utxos(port_, arg0);
        },
        codec: DcoCodec(
          decodeSuccessData: dco_decode_list_tx_out,
          decodeErrorData: dco_decode_lwk_error,
        ),
        constMeta: kCrateApiWalletWalletUtxosConstMeta,
        argValues: [that],
        apiImpl: this,
      ));
    }
  
    TaskConstMeta get kCrateApiWalletWalletUtxosConstMeta => const TaskConstMeta(
          debugName: "wallet_utxos",
          argNames: ["that"],
        );
  
    RustArcIncrementStrongCountFnType
        get rust_arc_increment_strong_count_MutexWollet =>
            wire.rust_arc_increment_strong_count_RustOpaque_Mutexlwk_wolletWollet;
  
    RustArcDecrementStrongCountFnType
        get rust_arc_decrement_strong_count_MutexWollet =>
            wire.rust_arc_decrement_strong_count_RustOpaque_Mutexlwk_wolletWollet;
  
    @protected
    MutexWollet dco_decode_RustOpaque_Mutexlwk_wolletWollet(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return MutexWolletImpl.frbInternalDcoDecode(raw as List<dynamic>);
    }
  
    @protected
    String dco_decode_String(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return raw as String;
    }
  
    @protected
    Address dco_decode_address(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.length != 4)
        throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
      return Address(
        standard: dco_decode_String(arr[0]),
        confidential: dco_decode_String(arr[1]),
        index: dco_decode_opt_box_autoadd_u_32(arr[2]),
        blindingKey: dco_decode_opt_String(arr[3]),
      );
    }
  
    @protected
    Balance dco_decode_balance(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.length != 2)
        throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
      return Balance(
        assetId: dco_decode_String(arr[0]),
        value: dco_decode_i_64(arr[1]),
      );
    }
  
    @protected
    Blockchain dco_decode_blockchain(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.isNotEmpty)
        throw Exception('unexpected arr length: expect 0 but see ${arr.length}');
      return Blockchain();
    }
  
    @protected
    bool dco_decode_bool(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return raw as bool;
    }
  
    @protected
    Blockchain dco_decode_box_autoadd_blockchain(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return dco_decode_blockchain(raw);
    }
  
    @protected
    Descriptor dco_decode_box_autoadd_descriptor(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return dco_decode_descriptor(raw);
    }
  
    @protected
    int dco_decode_box_autoadd_u_32(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return raw as int;
    }
  
    @protected
    Wallet dco_decode_box_autoadd_wallet(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return dco_decode_wallet(raw);
    }
  
    @protected
    Descriptor dco_decode_descriptor(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.length != 1)
        throw Exception('unexpected arr length: expect 1 but see ${arr.length}');
      return Descriptor(
        ctDescriptor: dco_decode_String(arr[0]),
      );
    }
  
    @protected
    double dco_decode_f_32(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return raw as double;
    }
  
    @protected
    int dco_decode_i_32(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return raw as int;
    }
  
    @protected
    PlatformInt64 dco_decode_i_64(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return dcoDecodeI64(raw);
    }
  
    @protected
    List<Balance> dco_decode_list_balance(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return (raw as List<dynamic>).map(dco_decode_balance).toList();
    }
  
    @protected
    List<int> dco_decode_list_prim_u_8_loose(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return raw as List<int>;
    }
  
    @protected
    Uint8List dco_decode_list_prim_u_8_strict(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return raw as Uint8List;
    }
  
    @protected
    List<Tx> dco_decode_list_tx(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return (raw as List<dynamic>).map(dco_decode_tx).toList();
    }
  
    @protected
    List<TxOut> dco_decode_list_tx_out(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return (raw as List<dynamic>).map(dco_decode_tx_out).toList();
    }
  
    @protected
    LwkError dco_decode_lwk_error(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.length != 1)
        throw Exception('unexpected arr length: expect 1 but see ${arr.length}');
      return LwkError(
        msg: dco_decode_String(arr[0]),
      );
    }
  
    @protected
    Network dco_decode_network(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return Network.values[raw as int];
    }
  
    @protected
    String? dco_decode_opt_String(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return raw == null ? null : dco_decode_String(raw);
    }
  
    @protected
    int? dco_decode_opt_box_autoadd_u_32(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return raw == null ? null : dco_decode_box_autoadd_u_32(raw);
    }
  
    @protected
    OutPoint dco_decode_out_point(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.length != 2)
        throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
      return OutPoint(
        txid: dco_decode_String(arr[0]),
        vout: dco_decode_u_32(arr[1]),
      );
    }
  
    @protected
    PayjoinTx dco_decode_payjoin_tx(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.length != 3)
        throw Exception('unexpected arr length: expect 3 but see ${arr.length}');
      return PayjoinTx(
        pset: dco_decode_String(arr[0]),
        networkFee: dco_decode_u_64(arr[1]),
        assetFee: dco_decode_u_64(arr[2]),
      );
    }
  
    @protected
    PsetAmounts dco_decode_pset_amounts(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.length != 2)
        throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
      return PsetAmounts(
        absoluteFees: dco_decode_u_64(arr[0]),
        balances: dco_decode_list_balance(arr[1]),
      );
    }
  
    @protected
    SizeAndFees dco_decode_size_and_fees(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.length != 3)
        throw Exception('unexpected arr length: expect 3 but see ${arr.length}');
      return SizeAndFees(
        discountedVsize: dco_decode_usize(arr[0]),
        discountedWeight: dco_decode_usize(arr[1]),
        absoluteFees: dco_decode_list_balance(arr[2]),
      );
    }
  
    @protected
    Tx dco_decode_tx(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.length != 10)
        throw Exception('unexpected arr length: expect 10 but see ${arr.length}');
      return Tx(
        timestamp: dco_decode_opt_box_autoadd_u_32(arr[0]),
        kind: dco_decode_String(arr[1]),
        balances: dco_decode_list_balance(arr[2]),
        txid: dco_decode_String(arr[3]),
        outputs: dco_decode_list_tx_out(arr[4]),
        inputs: dco_decode_list_tx_out(arr[5]),
        fee: dco_decode_u_64(arr[6]),
        height: dco_decode_opt_box_autoadd_u_32(arr[7]),
        unblindedUrl: dco_decode_String(arr[8]),
        vsize: dco_decode_usize(arr[9]),
      );
    }
  
    @protected
    TxOut dco_decode_tx_out(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.length != 6)
        throw Exception('unexpected arr length: expect 6 but see ${arr.length}');
      return TxOut(
        scriptPubkey: dco_decode_String(arr[0]),
        outpoint: dco_decode_out_point(arr[1]),
        height: dco_decode_opt_box_autoadd_u_32(arr[2]),
        unblinded: dco_decode_tx_out_secrets(arr[3]),
        isSpent: dco_decode_bool(arr[4]),
        address: dco_decode_address(arr[5]),
      );
    }
  
    @protected
    TxOutSecrets dco_decode_tx_out_secrets(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.length != 4)
        throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
      return TxOutSecrets(
        value: dco_decode_u_64(arr[0]),
        valueBf: dco_decode_String(arr[1]),
        asset: dco_decode_String(arr[2]),
        assetBf: dco_decode_String(arr[3]),
      );
    }
  
    @protected
    int dco_decode_u_32(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return raw as int;
    }
  
    @protected
    BigInt dco_decode_u_64(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return dcoDecodeU64(raw);
    }
  
    @protected
    int dco_decode_u_8(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return raw as int;
    }
  
    @protected
    void dco_decode_unit(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return;
    }
  
    @protected
    BigInt dco_decode_usize(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      return dcoDecodeU64(raw);
    }
  
    @protected
    Wallet dco_decode_wallet(dynamic raw) {
      // Codec=Dco (DartCObject based), see doc to use other codecs
      final arr = raw as List<dynamic>;
      if (arr.length != 1)
        throw Exception('unexpected arr length: expect 1 but see ${arr.length}');
      return Wallet(
        inner: dco_decode_RustOpaque_Mutexlwk_wolletWollet(arr[0]),
      );
    }
  
    @protected
    MutexWollet sse_decode_RustOpaque_Mutexlwk_wolletWollet(
        SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return MutexWolletImpl.frbInternalSseDecode(
          sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
    }
  
    @protected
    String sse_decode_String(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var inner = sse_decode_list_prim_u_8_strict(deserializer);
      return utf8.decoder.convert(inner);
    }
  
    @protected
    Address sse_decode_address(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var var_standard = sse_decode_String(deserializer);
      var var_confidential = sse_decode_String(deserializer);
      var var_index = sse_decode_opt_box_autoadd_u_32(deserializer);
      var var_blindingKey = sse_decode_opt_String(deserializer);
      return Address(
          standard: var_standard,
          confidential: var_confidential,
          index: var_index,
          blindingKey: var_blindingKey);
    }
  
    @protected
    Balance sse_decode_balance(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var var_assetId = sse_decode_String(deserializer);
      var var_value = sse_decode_i_64(deserializer);
      return Balance(assetId: var_assetId, value: var_value);
    }
  
    @protected
    Blockchain sse_decode_blockchain(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return Blockchain();
    }
  
    @protected
    bool sse_decode_bool(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return deserializer.buffer.getUint8() != 0;
    }
  
    @protected
    Blockchain sse_decode_box_autoadd_blockchain(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return (sse_decode_blockchain(deserializer));
    }
  
    @protected
    Descriptor sse_decode_box_autoadd_descriptor(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return (sse_decode_descriptor(deserializer));
    }
  
    @protected
    int sse_decode_box_autoadd_u_32(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return (sse_decode_u_32(deserializer));
    }
  
    @protected
    Wallet sse_decode_box_autoadd_wallet(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return (sse_decode_wallet(deserializer));
    }
  
    @protected
    Descriptor sse_decode_descriptor(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var var_ctDescriptor = sse_decode_String(deserializer);
      return Descriptor(ctDescriptor: var_ctDescriptor);
    }
  
    @protected
    double sse_decode_f_32(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return deserializer.buffer.getFloat32();
    }
  
    @protected
    int sse_decode_i_32(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return deserializer.buffer.getInt32();
    }
  
    @protected
    PlatformInt64 sse_decode_i_64(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return deserializer.buffer.getPlatformInt64();
    }
  
    @protected
    List<Balance> sse_decode_list_balance(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
  
      var len_ = sse_decode_i_32(deserializer);
      var ans_ = <Balance>[];
      for (var idx_ = 0; idx_ < len_; ++idx_) {
        ans_.add(sse_decode_balance(deserializer));
      }
      return ans_;
    }
  
    @protected
    List<int> sse_decode_list_prim_u_8_loose(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var len_ = sse_decode_i_32(deserializer);
      return deserializer.buffer.getUint8List(len_);
    }
  
    @protected
    Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var len_ = sse_decode_i_32(deserializer);
      return deserializer.buffer.getUint8List(len_);
    }
  
    @protected
    List<Tx> sse_decode_list_tx(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
  
      var len_ = sse_decode_i_32(deserializer);
      var ans_ = <Tx>[];
      for (var idx_ = 0; idx_ < len_; ++idx_) {
        ans_.add(sse_decode_tx(deserializer));
      }
      return ans_;
    }
  
    @protected
    List<TxOut> sse_decode_list_tx_out(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
  
      var len_ = sse_decode_i_32(deserializer);
      var ans_ = <TxOut>[];
      for (var idx_ = 0; idx_ < len_; ++idx_) {
        ans_.add(sse_decode_tx_out(deserializer));
      }
      return ans_;
    }
  
    @protected
    LwkError sse_decode_lwk_error(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var var_msg = sse_decode_String(deserializer);
      return LwkError(msg: var_msg);
    }
  
    @protected
    Network sse_decode_network(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var inner = sse_decode_i_32(deserializer);
      return Network.values[inner];
    }
  
    @protected
    String? sse_decode_opt_String(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
  
      if (sse_decode_bool(deserializer)) {
        return (sse_decode_String(deserializer));
      } else {
        return null;
      }
    }
  
    @protected
    int? sse_decode_opt_box_autoadd_u_32(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
  
      if (sse_decode_bool(deserializer)) {
        return (sse_decode_box_autoadd_u_32(deserializer));
      } else {
        return null;
      }
    }
  
    @protected
    OutPoint sse_decode_out_point(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var var_txid = sse_decode_String(deserializer);
      var var_vout = sse_decode_u_32(deserializer);
      return OutPoint(txid: var_txid, vout: var_vout);
    }
  
    @protected
    PayjoinTx sse_decode_payjoin_tx(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var var_pset = sse_decode_String(deserializer);
      var var_networkFee = sse_decode_u_64(deserializer);
      var var_assetFee = sse_decode_u_64(deserializer);
      return PayjoinTx(
          pset: var_pset, networkFee: var_networkFee, assetFee: var_assetFee);
    }
  
    @protected
    PsetAmounts sse_decode_pset_amounts(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var var_absoluteFees = sse_decode_u_64(deserializer);
      var var_balances = sse_decode_list_balance(deserializer);
      return PsetAmounts(absoluteFees: var_absoluteFees, balances: var_balances);
    }
  
    @protected
    SizeAndFees sse_decode_size_and_fees(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var var_discountedVsize = sse_decode_usize(deserializer);
      var var_discountedWeight = sse_decode_usize(deserializer);
      var var_absoluteFees = sse_decode_list_balance(deserializer);
      return SizeAndFees(
          discountedVsize: var_discountedVsize,
          discountedWeight: var_discountedWeight,
          absoluteFees: var_absoluteFees);
    }
  
    @protected
    Tx sse_decode_tx(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var var_timestamp = sse_decode_opt_box_autoadd_u_32(deserializer);
      var var_kind = sse_decode_String(deserializer);
      var var_balances = sse_decode_list_balance(deserializer);
      var var_txid = sse_decode_String(deserializer);
      var var_outputs = sse_decode_list_tx_out(deserializer);
      var var_inputs = sse_decode_list_tx_out(deserializer);
      var var_fee = sse_decode_u_64(deserializer);
      var var_height = sse_decode_opt_box_autoadd_u_32(deserializer);
      var var_unblindedUrl = sse_decode_String(deserializer);
      var var_vsize = sse_decode_usize(deserializer);
      return Tx(
          timestamp: var_timestamp,
          kind: var_kind,
          balances: var_balances,
          txid: var_txid,
          outputs: var_outputs,
          inputs: var_inputs,
          fee: var_fee,
          height: var_height,
          unblindedUrl: var_unblindedUrl,
          vsize: var_vsize);
    }
  
    @protected
    TxOut sse_decode_tx_out(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var var_scriptPubkey = sse_decode_String(deserializer);
      var var_outpoint = sse_decode_out_point(deserializer);
      var var_height = sse_decode_opt_box_autoadd_u_32(deserializer);
      var var_unblinded = sse_decode_tx_out_secrets(deserializer);
      var var_isSpent = sse_decode_bool(deserializer);
      var var_address = sse_decode_address(deserializer);
      return TxOut(
          scriptPubkey: var_scriptPubkey,
          outpoint: var_outpoint,
          height: var_height,
          unblinded: var_unblinded,
          isSpent: var_isSpent,
          address: var_address);
    }
  
    @protected
    TxOutSecrets sse_decode_tx_out_secrets(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var var_value = sse_decode_u_64(deserializer);
      var var_valueBf = sse_decode_String(deserializer);
      var var_asset = sse_decode_String(deserializer);
      var var_assetBf = sse_decode_String(deserializer);
      return TxOutSecrets(
          value: var_value,
          valueBf: var_valueBf,
          asset: var_asset,
          assetBf: var_assetBf);
    }
  
    @protected
    int sse_decode_u_32(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return deserializer.buffer.getUint32();
    }
  
    @protected
    BigInt sse_decode_u_64(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return deserializer.buffer.getBigUint64();
    }
  
    @protected
    int sse_decode_u_8(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return deserializer.buffer.getUint8();
    }
  
    @protected
    void sse_decode_unit(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
    }
  
    @protected
    BigInt sse_decode_usize(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      return deserializer.buffer.getBigUint64();
    }
  
    @protected
    Wallet sse_decode_wallet(SseDeserializer deserializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      var var_inner = sse_decode_RustOpaque_Mutexlwk_wolletWollet(deserializer);
      return Wallet(inner: var_inner);
    }
  
    @protected
    int cst_encode_RustOpaque_Mutexlwk_wolletWollet(MutexWollet raw) {
      // Codec=Cst (C-struct based), see doc to use other codecs
  // ignore: invalid_use_of_internal_member
      return (raw as MutexWolletImpl).frbInternalCstEncode();
    }
  
    @protected
    bool cst_encode_bool(bool raw) {
      // Codec=Cst (C-struct based), see doc to use other codecs
      return raw;
    }
  
    @protected
    double cst_encode_f_32(double raw) {
      // Codec=Cst (C-struct based), see doc to use other codecs
      return raw;
    }
  
    @protected
    int cst_encode_i_32(int raw) {
      // Codec=Cst (C-struct based), see doc to use other codecs
      return raw;
    }
  
    @protected
    int cst_encode_network(Network raw) {
      // Codec=Cst (C-struct based), see doc to use other codecs
      return cst_encode_i_32(raw.index);
    }
  
    @protected
    int cst_encode_u_32(int raw) {
      // Codec=Cst (C-struct based), see doc to use other codecs
      return raw;
    }
  
    @protected
    int cst_encode_u_8(int raw) {
      // Codec=Cst (C-struct based), see doc to use other codecs
      return raw;
    }
  
    @protected
    void cst_encode_unit(void raw) {
      // Codec=Cst (C-struct based), see doc to use other codecs
      return raw;
    }
  
    @protected
    void sse_encode_RustOpaque_Mutexlwk_wolletWollet(
        MutexWollet self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_usize(
          (self as MutexWolletImpl).frbInternalSseEncode(move: null), serializer);
    }
  
    @protected
    void sse_encode_String(String self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_list_prim_u_8_strict(utf8.encoder.convert(self), serializer);
    }
  
    @protected
    void sse_encode_address(Address self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_String(self.standard, serializer);
      sse_encode_String(self.confidential, serializer);
      sse_encode_opt_box_autoadd_u_32(self.index, serializer);
      sse_encode_opt_String(self.blindingKey, serializer);
    }
  
    @protected
    void sse_encode_balance(Balance self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_String(self.assetId, serializer);
      sse_encode_i_64(self.value, serializer);
    }
  
    @protected
    void sse_encode_blockchain(Blockchain self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
    }
  
    @protected
    void sse_encode_bool(bool self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      serializer.buffer.putUint8(self ? 1 : 0);
    }
  
    @protected
    void sse_encode_box_autoadd_blockchain(
        Blockchain self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_blockchain(self, serializer);
    }
  
    @protected
    void sse_encode_box_autoadd_descriptor(
        Descriptor self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_descriptor(self, serializer);
    }
  
    @protected
    void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_u_32(self, serializer);
    }
  
    @protected
    void sse_encode_box_autoadd_wallet(Wallet self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_wallet(self, serializer);
    }
  
    @protected
    void sse_encode_descriptor(Descriptor self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_String(self.ctDescriptor, serializer);
    }
  
    @protected
    void sse_encode_f_32(double self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      serializer.buffer.putFloat32(self);
    }
  
    @protected
    void sse_encode_i_32(int self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      serializer.buffer.putInt32(self);
    }
  
    @protected
    void sse_encode_i_64(PlatformInt64 self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      serializer.buffer.putPlatformInt64(self);
    }
  
    @protected
    void sse_encode_list_balance(List<Balance> self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_i_32(self.length, serializer);
      for (final item in self) {
        sse_encode_balance(item, serializer);
      }
    }
  
    @protected
    void sse_encode_list_prim_u_8_loose(
        List<int> self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_i_32(self.length, serializer);
      serializer.buffer
          .putUint8List(self is Uint8List ? self : Uint8List.fromList(self));
    }
  
    @protected
    void sse_encode_list_prim_u_8_strict(
        Uint8List self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_i_32(self.length, serializer);
      serializer.buffer.putUint8List(self);
    }
  
    @protected
    void sse_encode_list_tx(List<Tx> self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_i_32(self.length, serializer);
      for (final item in self) {
        sse_encode_tx(item, serializer);
      }
    }
  
    @protected
    void sse_encode_list_tx_out(List<TxOut> self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_i_32(self.length, serializer);
      for (final item in self) {
        sse_encode_tx_out(item, serializer);
      }
    }
  
    @protected
    void sse_encode_lwk_error(LwkError self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_String(self.msg, serializer);
    }
  
    @protected
    void sse_encode_network(Network self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_i_32(self.index, serializer);
    }
  
    @protected
    void sse_encode_opt_String(String? self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
  
      sse_encode_bool(self != null, serializer);
      if (self != null) {
        sse_encode_String(self, serializer);
      }
    }
  
    @protected
    void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
  
      sse_encode_bool(self != null, serializer);
      if (self != null) {
        sse_encode_box_autoadd_u_32(self, serializer);
      }
    }
  
    @protected
    void sse_encode_out_point(OutPoint self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_String(self.txid, serializer);
      sse_encode_u_32(self.vout, serializer);
    }
  
    @protected
    void sse_encode_payjoin_tx(PayjoinTx self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_String(self.pset, serializer);
      sse_encode_u_64(self.networkFee, serializer);
      sse_encode_u_64(self.assetFee, serializer);
    }
  
    @protected
    void sse_encode_pset_amounts(PsetAmounts self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_u_64(self.absoluteFees, serializer);
      sse_encode_list_balance(self.balances, serializer);
    }
  
    @protected
    void sse_encode_size_and_fees(SizeAndFees self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_usize(self.discountedVsize, serializer);
      sse_encode_usize(self.discountedWeight, serializer);
      sse_encode_list_balance(self.absoluteFees, serializer);
    }
  
    @protected
    void sse_encode_tx(Tx self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_opt_box_autoadd_u_32(self.timestamp, serializer);
      sse_encode_String(self.kind, serializer);
      sse_encode_list_balance(self.balances, serializer);
      sse_encode_String(self.txid, serializer);
      sse_encode_list_tx_out(self.outputs, serializer);
      sse_encode_list_tx_out(self.inputs, serializer);
      sse_encode_u_64(self.fee, serializer);
      sse_encode_opt_box_autoadd_u_32(self.height, serializer);
      sse_encode_String(self.unblindedUrl, serializer);
      sse_encode_usize(self.vsize, serializer);
    }
  
    @protected
    void sse_encode_tx_out(TxOut self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_String(self.scriptPubkey, serializer);
      sse_encode_out_point(self.outpoint, serializer);
      sse_encode_opt_box_autoadd_u_32(self.height, serializer);
      sse_encode_tx_out_secrets(self.unblinded, serializer);
      sse_encode_bool(self.isSpent, serializer);
      sse_encode_address(self.address, serializer);
    }
  
    @protected
    void sse_encode_tx_out_secrets(TxOutSecrets self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_u_64(self.value, serializer);
      sse_encode_String(self.valueBf, serializer);
      sse_encode_String(self.asset, serializer);
      sse_encode_String(self.assetBf, serializer);
    }
  
    @protected
    void sse_encode_u_32(int self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      serializer.buffer.putUint32(self);
    }
  
    @protected
    void sse_encode_u_64(BigInt self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      serializer.buffer.putBigUint64(self);
    }
  
    @protected
    void sse_encode_u_8(int self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      serializer.buffer.putUint8(self);
    }
  
    @protected
    void sse_encode_unit(void self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
    }
  
    @protected
    void sse_encode_usize(BigInt self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      serializer.buffer.putBigUint64(self);
    }
  
    @protected
    void sse_encode_wallet(Wallet self, SseSerializer serializer) {
      // Codec=Sse (Serialization based), see doc to use other codecs
      sse_encode_RustOpaque_Mutexlwk_wolletWollet(self.inner, serializer);
    }
  }
  
  @sealed
  class MutexWolletImpl extends RustOpaque implements MutexWollet {
    // Not to be used by end users
    MutexWolletImpl.frbInternalDcoDecode(List<dynamic> wire)
        : super.frbInternalDcoDecode(wire, _kStaticData);
  
    // Not to be used by end users
    MutexWolletImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
        : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);
  
    static final _kStaticData = RustArcStaticData(
      rustArcIncrementStrongCount:
          LwkCore.instance.api.rust_arc_increment_strong_count_MutexWollet,
      rustArcDecrementStrongCount:
          LwkCore.instance.api.rust_arc_decrement_strong_count_MutexWollet,
      rustArcDecrementStrongCountPtr:
          LwkCore.instance.api.rust_arc_decrement_strong_count_MutexWolletPtr,
    );
  }
  