content: // This file is automatically generated, so please do not edit it.
  // @generated by `flutter_rust_bridge`@ 2.9.0.
  
  // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
  
  import '../frb_generated.dart';
  import 'descriptor.dart';
  import 'error.dart';
  import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
  import 'types.dart';
  
  // These functions are ignored because they are not marked as `pub`: `get_txout`, `get_wallet`
  
  // Rust type: RustOpaqueNom<Mutex < lwk_wollet :: Wollet >>
  abstract class MutexWollet implements RustOpaqueInterface {}
  
  /// Main wallet object
  class Wallet {
    final MutexWollet inner;
  
    const Wallet({
      required this.inner,
    });
  
    /// Get an address from a specific index
    Future<Address> address({required int index}) => LwkCore.instance.api
        .crateApiWalletWalletAddress(that: this, index: index);
  
    /// Get the last unused address from the wallet
    Future<Address> addressLastUnused() =>
        LwkCore.instance.api.crateApiWalletWalletAddressLastUnused(
          that: this,
        );
  
    /// Get balances for a wallet.
    Future<List<Balance>> balances() =>
        LwkCore.instance.api.crateApiWalletWalletBalances(
          that: this,
        );
  
    /// Get the blinding key string for the wallet
    Future<String> blindingKey() =>
        LwkCore.instance.api.crateApiWalletWalletBlindingKey(
          that: this,
        );
  
    /// Build a transaction for a specific asset
    Future<String> buildAssetTx(
            {required BigInt sats,
            required String outAddress,
            required double feeRate,
            required String asset}) =>
        LwkCore.instance.api.crateApiWalletWalletBuildAssetTx(
            that: this,
            sats: sats,
            outAddress: outAddress,
            feeRate: feeRate,
            asset: asset);
  
    /// Build a LBTC transaction
    Future<String> buildLbtcTx(
            {required BigInt sats,
            required String outAddress,
            required double feeRate,
            required bool drain}) =>
        LwkCore.instance.api.crateApiWalletWalletBuildLbtcTx(
            that: this,
            sats: sats,
            outAddress: outAddress,
            feeRate: feeRate,
            drain: drain);
  
    /// Build a PayJoin transaction for a specific asset, even if the wallet does not contain L-BTC UTXOs.
    /// The asset must be one of the assets supported by SideSwap, such as USDt or DePix.
    /// This creates a coin-join PSET. The PSET includes the asset wallet inputs and change,
    /// and the asset output to `out_address`, the L-BTC server's input and change and the asset fee output to the server.
    /// The server fee is included in the return value for the user to review.
    ///
    /// To make a PayJoin transaction:
    /// - call build_payjoin_tx
    /// - review server fee
    /// - call signed_pset_with_extra_details, extract_tx and broadcast_tx.
    /// See the `test_payjoin` test for an example of how to use it:
    Future<PayjoinTx> buildPayjoinTx(
            {required BigInt sats,
            required String outAddress,
            required String asset,
            required Network network}) =>
        LwkCore.instance.api.crateApiWalletWalletBuildPayjoinTx(
            that: this,
            sats: sats,
            outAddress: outAddress,
            asset: asset,
            network: network);
  
    /// Decode a transaction given a PSET
    Future<PsetAmounts> decodeTx({required String pset}) =>
        LwkCore.instance.api.crateApiWalletWalletDecodeTx(that: this, pset: pset);
  
    /// Get the descriptor string for the wallet
    Future<String> descriptor() =>
        LwkCore.instance.api.crateApiWalletWalletDescriptor(
          that: this,
        );
  
    /// Initializes a wallet from a specific db path and descriptor
    static Future<Wallet> init(
            {required Network network,
            required String dbpath,
            required Descriptor descriptor}) =>
        LwkCore.instance.api.crateApiWalletWalletInit(
            network: network, dbpath: dbpath, descriptor: descriptor);
  
    /// Sign a wallet transaction, returns (pset, signed_bytes)
    Future<String> signTx(
            {required Network network,
            required String pset,
            required String mnemonic}) =>
        LwkCore.instance.api.crateApiWalletWalletSignTx(
            that: this, network: network, pset: pset, mnemonic: mnemonic);
  
    /// Sign a pset with extra details (used for asset transactions)
    Future<String> signedPsetWithExtraDetails(
            {required Network network,
            required String pset,
            required String mnemonic}) =>
        LwkCore.instance.api.crateApiWalletWalletSignedPsetWithExtraDetails(
            that: this, network: network, pset: pset, mnemonic: mnemonic);
  
    /// Syncs the wallet db with its latest state fetched from the electrum server
    Future<void> sync_(
            {required String electrumUrl, required bool validateDomain}) =>
        LwkCore.instance.api.crateApiWalletWalletSync(
            that: this, electrumUrl: electrumUrl, validateDomain: validateDomain);
  
    /// Get the transaction history of the wallet
    Future<List<Tx>> txs() => LwkCore.instance.api.crateApiWalletWalletTxs(
          that: this,
        );
  
    /// Get utxos of the wallet
    Future<List<TxOut>> utxos() => LwkCore.instance.api.crateApiWalletWalletUtxos(
          that: this,
        );
  
    @override
    int get hashCode => inner.hashCode;
  
    @override
    bool operator ==(Object other) =>
        identical(this, other) ||
        other is Wallet &&
            runtimeType == other.runtimeType &&
            inner == other.inner;
  }
  