///
/// HybridNitroArkSpec.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#if __has_include(<NitroModules/HybridObject.hpp>)
#include <NitroModules/HybridObject.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

// Forward declaration of `BarkCreateOpts` to properly resolve imports.
namespace margelo::nitro::nitroark { struct BarkCreateOpts; }
// Forward declaration of `RestoreWalletResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct RestoreWalletResult; }
// Forward declaration of `WalletSnapshotInfo` to properly resolve imports.
namespace margelo::nitro::nitroark { struct WalletSnapshotInfo; }
// Forward declaration of `WalletSnapshotExpectation` to properly resolve imports.
namespace margelo::nitro::nitroark { struct WalletSnapshotExpectation; }
// Forward declaration of `HybridWalletStateChangeSubscriptionSpec` to properly resolve imports.
namespace margelo::nitro::nitroark { class HybridWalletStateChangeSubscriptionSpec; }
// Forward declaration of `WalletStateChangeEvent` to properly resolve imports.
namespace margelo::nitro::nitroark { struct WalletStateChangeEvent; }
// Forward declaration of `ExitProgressStatusResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct ExitProgressStatusResult; }
// Forward declaration of `ExitFeeEstimate` to properly resolve imports.
namespace margelo::nitro::nitroark { struct ExitFeeEstimate; }
// Forward declaration of `ExitVtxoResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct ExitVtxoResult; }
// Forward declaration of `ExitStatusResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct ExitStatusResult; }
// Forward declaration of `PendingRoundStatus` to properly resolve imports.
namespace margelo::nitro::nitroark { struct PendingRoundStatus; }
// Forward declaration of `BarkArkInfo` to properly resolve imports.
namespace margelo::nitro::nitroark { struct BarkArkInfo; }
// Forward declaration of `WalletDebugInfo` to properly resolve imports.
namespace margelo::nitro::nitroark { struct WalletDebugInfo; }
// Forward declaration of `OffchainBalanceResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct OffchainBalanceResult; }
// Forward declaration of `KeyPairResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct KeyPairResult; }
// Forward declaration of `NewAddressResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct NewAddressResult; }
// Forward declaration of `MailboxAuthorizationResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct MailboxAuthorizationResult; }
// Forward declaration of `HybridBarkNotificationSubscriptionSpec` to properly resolve imports.
namespace margelo::nitro::nitroark { class HybridBarkNotificationSubscriptionSpec; }
// Forward declaration of `BarkNotificationEvent` to properly resolve imports.
namespace margelo::nitro::nitroark { struct BarkNotificationEvent; }
// Forward declaration of `BarkMovement` to properly resolve imports.
namespace margelo::nitro::nitroark { struct BarkMovement; }
// Forward declaration of `BarkVtxo` to properly resolve imports.
namespace margelo::nitro::nitroark { struct BarkVtxo; }
// Forward declaration of `DelegatedRoundState` to properly resolve imports.
namespace margelo::nitro::nitroark { struct DelegatedRoundState; }
// Forward declaration of `OnchainBalanceResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct OnchainBalanceResult; }
// Forward declaration of `BarkFeeRates` to properly resolve imports.
namespace margelo::nitro::nitroark { struct BarkFeeRates; }
// Forward declaration of `OnchainTransactionInfo` to properly resolve imports.
namespace margelo::nitro::nitroark { struct OnchainTransactionInfo; }
// Forward declaration of `OnchainPaymentResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct OnchainPaymentResult; }
// Forward declaration of `BarkSendManyOutput` to properly resolve imports.
namespace margelo::nitro::nitroark { struct BarkSendManyOutput; }
// Forward declaration of `BoardResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct BoardResult; }
// Forward declaration of `ArkoorPaymentResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct ArkoorPaymentResult; }
// Forward declaration of `ParsedPaymentRequest` to properly resolve imports.
namespace margelo::nitro::nitroark { struct ParsedPaymentRequest; }
// Forward declaration of `BarkFeeEstimate` to properly resolve imports.
namespace margelo::nitro::nitroark { struct BarkFeeEstimate; }
// Forward declaration of `LightningPaymentResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct LightningPaymentResult; }
// Forward declaration of `LightningPaymentOrigin` to properly resolve imports.
namespace margelo::nitro::nitroark { struct LightningPaymentOrigin; }
// Forward declaration of `OffboardResult` to properly resolve imports.
namespace margelo::nitro::nitroark { struct OffboardResult; }
// Forward declaration of `Bolt11Invoice` to properly resolve imports.
namespace margelo::nitro::nitroark { struct Bolt11Invoice; }
// Forward declaration of `LightningReceive` to properly resolve imports.
namespace margelo::nitro::nitroark { struct LightningReceive; }

#include <string>
#include <NitroModules/Promise.hpp>
#include "BarkCreateOpts.hpp"
#include "RestoreWalletResult.hpp"
#include "WalletSnapshotInfo.hpp"
#include "WalletSnapshotExpectation.hpp"
#include <optional>
#include <memory>
#include "HybridWalletStateChangeSubscriptionSpec.hpp"
#include "WalletStateChangeEvent.hpp"
#include <functional>
#include <vector>
#include "ExitProgressStatusResult.hpp"
#include "ExitFeeEstimate.hpp"
#include "ExitVtxoResult.hpp"
#include "ExitStatusResult.hpp"
#include "PendingRoundStatus.hpp"
#include "BarkArkInfo.hpp"
#include "WalletDebugInfo.hpp"
#include "OffchainBalanceResult.hpp"
#include "KeyPairResult.hpp"
#include "NewAddressResult.hpp"
#include "MailboxAuthorizationResult.hpp"
#include "HybridBarkNotificationSubscriptionSpec.hpp"
#include "BarkNotificationEvent.hpp"
#include "BarkMovement.hpp"
#include "BarkVtxo.hpp"
#include "DelegatedRoundState.hpp"
#include "OnchainBalanceResult.hpp"
#include "BarkFeeRates.hpp"
#include "OnchainTransactionInfo.hpp"
#include "OnchainPaymentResult.hpp"
#include "BarkSendManyOutput.hpp"
#include "BoardResult.hpp"
#include "ArkoorPaymentResult.hpp"
#include "ParsedPaymentRequest.hpp"
#include "BarkFeeEstimate.hpp"
#include "LightningPaymentResult.hpp"
#include "LightningPaymentOrigin.hpp"
#include "OffboardResult.hpp"
#include "Bolt11Invoice.hpp"
#include "LightningReceive.hpp"

namespace margelo::nitro::nitroark {

  using namespace margelo::nitro;

  /**
   * An abstract base class for `NitroArk`
   * Inherit this class to create instances of `HybridNitroArkSpec` in C++.
   * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
   * @example
   * ```cpp
   * class HybridNitroArk: public HybridNitroArkSpec {
   * public:
   *   HybridNitroArk(...): HybridObject(TAG) { ... }
   *   // ...
   * };
   * ```
   */
  class HybridNitroArkSpec: public virtual HybridObject {
    public:
      // Constructor
      explicit HybridNitroArkSpec(): HybridObject(TAG) { }

      // Destructor
      ~HybridNitroArkSpec() override = default;

    public:
      // Properties
      

    public:
      // Methods
      virtual std::string getBarkVersion() = 0;
      virtual std::shared_ptr<Promise<std::string>> createMnemonic() = 0;
      virtual std::shared_ptr<Promise<void>> createWallet(const std::string& datadir, const BarkCreateOpts& opts) = 0;
      virtual std::shared_ptr<Promise<void>> loadWallet(const std::string& datadir, const BarkCreateOpts& config) = 0;
      virtual std::shared_ptr<Promise<RestoreWalletResult>> restoreWalletFromArkServer(const std::string& datadir, const BarkCreateOpts& opts) = 0;
      virtual std::shared_ptr<Promise<bool>> isWalletLoaded() = 0;
      virtual std::shared_ptr<Promise<void>> closeWallet() = 0;
      virtual std::shared_ptr<Promise<WalletSnapshotInfo>> createWalletSnapshot(const std::string& destinationPath) = 0;
      virtual std::shared_ptr<Promise<WalletSnapshotInfo>> validateWalletSnapshot(const std::string& path, const std::optional<WalletSnapshotExpectation>& expected) = 0;
      virtual std::shared_ptr<HybridWalletStateChangeSubscriptionSpec> subscribeWalletStateChanges(const std::function<void(const WalletStateChangeEvent& /* event */)>& onEvent) = 0;
      virtual std::shared_ptr<Promise<void>> refreshServer() = 0;
      virtual std::shared_ptr<Promise<void>> syncPendingBoards() = 0;
      virtual std::shared_ptr<Promise<void>> maintenance() = 0;
      virtual std::shared_ptr<Promise<void>> maintenanceDelegated() = 0;
      virtual std::shared_ptr<Promise<void>> maintenanceRefresh() = 0;
      virtual std::shared_ptr<Promise<void>> sync() = 0;
      virtual std::shared_ptr<Promise<void>> startExitForEntireWallet() = 0;
      virtual std::shared_ptr<Promise<void>> startExitForVtxos(const std::vector<std::string>& vtxoIds) = 0;
      virtual std::shared_ptr<Promise<void>> cancelExit(const std::string& vtxoId) = 0;
      virtual std::shared_ptr<Promise<void>> syncExit() = 0;
      virtual std::shared_ptr<Promise<std::vector<ExitProgressStatusResult>>> progressExits(std::optional<double> feeRateSatPerKvb) = 0;
      virtual std::shared_ptr<Promise<ExitFeeEstimate>> estimateEmergencyExitFee(const std::vector<std::string>& vtxoIds, std::optional<double> feeRateSatPerKvb, const std::optional<std::string>& destinationAddress, std::optional<double> feeMargin) = 0;
      virtual std::shared_ptr<Promise<std::vector<ExitVtxoResult>>> getExitVtxos() = 0;
      virtual std::shared_ptr<Promise<std::vector<ExitVtxoResult>>> listClaimable() = 0;
      virtual std::shared_ptr<Promise<std::optional<ExitStatusResult>>> getExitStatus(const std::string& vtxoId, std::optional<bool> includeHistory, std::optional<bool> includeTransactions) = 0;
      virtual std::shared_ptr<Promise<bool>> hasPendingExits() = 0;
      virtual std::shared_ptr<Promise<double>> pendingExitTotal() = 0;
      virtual std::shared_ptr<Promise<std::optional<double>>> allClaimableAtHeight() = 0;
      virtual std::shared_ptr<Promise<std::string>> drainExits(const std::vector<std::string>& vtxoIds, const std::string& destinationAddress, std::optional<double> feeRateSatPerKvb) = 0;
      virtual std::shared_ptr<Promise<std::string>> extractTransaction(const std::string& psbt) = 0;
      virtual std::shared_ptr<Promise<std::string>> broadcastTransaction(const std::string& txHex) = 0;
      virtual std::shared_ptr<Promise<std::vector<PendingRoundStatus>>> syncPendingRounds() = 0;
      virtual std::shared_ptr<Promise<BarkArkInfo>> getArkInfo() = 0;
      virtual std::shared_ptr<Promise<WalletDebugInfo>> debugInfo() = 0;
      virtual std::shared_ptr<Promise<OffchainBalanceResult>> offchainBalance() = 0;
      virtual std::shared_ptr<Promise<KeyPairResult>> deriveStoreNextKeypair() = 0;
      virtual std::shared_ptr<Promise<KeyPairResult>> peekKeyPair(double index) = 0;
      virtual std::shared_ptr<Promise<NewAddressResult>> peekAddress(double index) = 0;
      virtual std::shared_ptr<Promise<NewAddressResult>> newAddress() = 0;
      virtual std::shared_ptr<Promise<std::string>> signMessage(const std::string& message, double index) = 0;
      virtual std::shared_ptr<Promise<std::string>> signMesssageWithMnemonic(const std::string& message, const std::string& mnemonic, const std::string& network, double index) = 0;
      virtual std::shared_ptr<Promise<KeyPairResult>> deriveKeypairFromMnemonic(const std::string& mnemonic, const std::string& network, double index) = 0;
      virtual std::shared_ptr<Promise<bool>> verifyMessage(const std::string& message, const std::string& signature, const std::string& publicKey) = 0;
      virtual std::shared_ptr<Promise<KeyPairResult>> mailboxKeypair() = 0;
      virtual std::shared_ptr<Promise<MailboxAuthorizationResult>> mailboxAuthorization(double authorizationExpiry) = 0;
      virtual std::shared_ptr<HybridBarkNotificationSubscriptionSpec> subscribeNotifications(const std::function<void(const BarkNotificationEvent& /* event */)>& onEvent) = 0;
      virtual std::shared_ptr<HybridBarkNotificationSubscriptionSpec> subscribeArkoorAddressMovements(const std::string& address, const std::function<void(const BarkNotificationEvent& /* event */)>& onEvent) = 0;
      virtual std::shared_ptr<HybridBarkNotificationSubscriptionSpec> subscribeLightningPaymentMovements(const std::string& paymentHash, const std::function<void(const BarkNotificationEvent& /* event */)>& onEvent) = 0;
      virtual std::shared_ptr<Promise<std::vector<BarkMovement>>> history() = 0;
      virtual std::shared_ptr<Promise<std::vector<BarkVtxo>>> vtxos() = 0;
      virtual std::shared_ptr<Promise<void>> updateHistoryMetadata(double movementId, const std::string& patchJson) = 0;
      virtual std::shared_ptr<Promise<BarkVtxo>> decodeVtxoHex(const std::string& vtxoHex) = 0;
      virtual std::shared_ptr<Promise<BarkVtxo>> importVtxo(const std::string& vtxoHex) = 0;
      virtual std::shared_ptr<Promise<void>> dangerousDropVtxo(const std::string& vtxoId) = 0;
      virtual std::shared_ptr<Promise<void>> unlockVtxos(const std::vector<std::string>& vtxoIds) = 0;
      virtual std::shared_ptr<Promise<std::optional<DelegatedRoundState>>> refreshVtxosDelegated(const std::vector<std::string>& vtxoIds) = 0;
      virtual std::shared_ptr<Promise<std::optional<double>>> getFirstExpiringVtxoBlockheight() = 0;
      virtual std::shared_ptr<Promise<std::optional<double>>> getNextRequiredRefreshBlockheight() = 0;
      virtual std::shared_ptr<Promise<std::vector<BarkVtxo>>> getExpiringVtxos(double threshold) = 0;
      virtual std::shared_ptr<Promise<OnchainBalanceResult>> onchainBalance() = 0;
      virtual std::shared_ptr<Promise<void>> onchainSync() = 0;
      virtual std::shared_ptr<Promise<bool>> onchainIsMine(const std::string& address) = 0;
      virtual std::shared_ptr<Promise<std::string>> onchainListUnspent() = 0;
      virtual std::shared_ptr<Promise<std::string>> onchainUtxos() = 0;
      virtual std::shared_ptr<Promise<BarkFeeRates>> onchainFeeRates() = 0;
      virtual std::shared_ptr<Promise<std::vector<OnchainTransactionInfo>>> onchainTransactions() = 0;
      virtual std::shared_ptr<Promise<std::string>> onchainAddress() = 0;
      virtual std::shared_ptr<Promise<OnchainPaymentResult>> onchainSend(const std::string& destination, double amountSat, std::optional<double> feeRate) = 0;
      virtual std::shared_ptr<Promise<std::string>> onchainDrain(const std::string& destination, std::optional<double> feeRate) = 0;
      virtual std::shared_ptr<Promise<std::string>> onchainSendMany(const std::vector<BarkSendManyOutput>& outputs, std::optional<double> feeRate) = 0;
      virtual std::shared_ptr<Promise<BoardResult>> boardAmount(double amountSat) = 0;
      virtual std::shared_ptr<Promise<BoardResult>> boardAll() = 0;
      virtual std::shared_ptr<Promise<void>> validateArkoorAddress(const std::string& address) = 0;
      virtual std::shared_ptr<Promise<ArkoorPaymentResult>> sendArkoorPayment(const std::string& destination, double amountSat) = 0;
      virtual std::shared_ptr<Promise<ParsedPaymentRequest>> parsePaymentRequest(const std::string& payment) = 0;
      virtual std::shared_ptr<Promise<BarkFeeEstimate>> estimateArkoorPaymentFee(double amountSat) = 0;
      virtual std::shared_ptr<Promise<BarkFeeEstimate>> estimateBoardOffchainFee(double amountSat) = 0;
      virtual std::shared_ptr<Promise<BarkFeeEstimate>> estimateRefreshFee(const std::vector<std::string>& vtxoIds) = 0;
      virtual std::shared_ptr<Promise<LightningPaymentResult>> payLightningInvoice(const std::string& destination, bool wait, std::optional<double> amountSat, std::optional<double> retryForSeconds) = 0;
      virtual std::shared_ptr<Promise<LightningPaymentResult>> payLightningInvoiceWithOrigin(const std::string& invoice, const LightningPaymentOrigin& origin, bool wait, std::optional<double> retryForSeconds) = 0;
      virtual std::shared_ptr<Promise<LightningPaymentResult>> payLightningOffer(const std::string& offer, bool wait, std::optional<double> amountSat, std::optional<double> retryForSeconds) = 0;
      virtual std::shared_ptr<Promise<LightningPaymentResult>> payLightningAddress(const std::string& addr, double amountSat, const std::string& comment, bool wait, std::optional<double> retryForSeconds) = 0;
      virtual std::shared_ptr<Promise<BarkFeeEstimate>> estimateLightningSendFee(double amountSat) = 0;
      virtual std::shared_ptr<Promise<OffboardResult>> sendOnchain(const std::string& destination, double amountSat) = 0;
      virtual std::shared_ptr<Promise<BarkFeeEstimate>> estimateSendOnchain(const std::string& destination, double amountSat) = 0;
      virtual std::shared_ptr<Promise<Bolt11Invoice>> bolt11Invoice(double amountSat, const std::optional<std::string>& description, const std::optional<std::string>& token) = 0;
      virtual std::shared_ptr<Promise<LightningReceive>> lightningReceiveStatus(const std::string& paymentHash) = 0;
      virtual std::shared_ptr<Promise<LightningPaymentResult>> checkLightningPayment(const std::string& paymentHash, bool wait) = 0;
      virtual std::shared_ptr<Promise<LightningReceive>> tryClaimLightningReceive(const std::string& paymentHash, bool wait) = 0;
      virtual std::shared_ptr<Promise<void>> tryClaimAllLightningReceives(bool wait) = 0;
      virtual std::shared_ptr<Promise<OffboardResult>> offboardSpecific(const std::vector<std::string>& vtxoIds, const std::string& destinationAddress) = 0;
      virtual std::shared_ptr<Promise<OffboardResult>> offboardAll(const std::string& destinationAddress) = 0;
      virtual std::shared_ptr<Promise<BarkFeeEstimate>> estimateOffboardAll(const std::string& destinationAddress) = 0;

    protected:
      // Hybrid Setup
      void loadHybridMethods() override;

    protected:
      // Tag for logging
      static constexpr auto TAG = "NitroArk";
  };

} // namespace margelo::nitro::nitroark
