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

import Foundation
import NitroModules

/// See ``HybridRNCandleSpec``
public protocol HybridRNCandleSpec_protocol: HybridObject {
  // Properties

  // Methods
  func candleLinkSheet(
    isPresented: Bool, services: [Service]?, cornerRadius: Double, customerName: String?,
    showDynamicLoading: Bool, presentationBackground: PresentationBackground,
    presentationStyle: PresentationStyle, onSuccess: @escaping (_ account: LinkedAccount) -> Void)
    throws
  func candleTradeExecutionSheet(
    tradeQuote: TradeQuote, presentationBackground: PresentationBackground,
    completion: @escaping (_ result: TradeExecutionResult) -> Void) throws
  func initialize(appKey: String, appSecret: String, accessGroup: String?) throws
  func getLinkedAccounts() throws -> Promise<[LinkedAccount]>
  func getLinkedAccount(ref: LinkedAccountRef) throws -> Promise<LinkedAccount>
  func unlinkAccount(ref: LinkedAccountRef) throws -> Promise<Void>
  func getAssetAccounts(query: AssetAccountsQuery) throws -> Promise<AssetAccountsResponse>
  func getAssetAccount(ref: AssetAccountRef) throws -> Promise<AssetAccount>
  func getTrades(query: TradesQuery) throws -> Promise<TradesResponse>
  func getTrade(ref: TradeRef) throws -> Promise<Trade>
  func getTradeQuotes(request: TradeQuotesRequest) throws -> Promise<TradeQuotesResponse>
  func executeTrade(quote: TradeQuote) throws -> Promise<Trade>
  func createUser(appUserID: String) throws -> Promise<Void>
  func deleteUser() throws -> Promise<Void>
}

/// See ``HybridRNCandleSpec``
open class HybridRNCandleSpec_base {
  private weak var cxxWrapper: HybridRNCandleSpec_cxx? = nil
  public init() {}
  public func getCxxWrapper() -> HybridRNCandleSpec_cxx {
    #if DEBUG
      guard self is HybridRNCandleSpec else {
        fatalError(
          "`self` is not a `HybridRNCandleSpec`! Did you accidentally inherit from `HybridRNCandleSpec_base` instead of `HybridRNCandleSpec`?"
        )
      }
    #endif
    if let cxxWrapper = self.cxxWrapper {
      return cxxWrapper
    } else {
      let cxxWrapper = HybridRNCandleSpec_cxx(self as! HybridRNCandleSpec)
      self.cxxWrapper = cxxWrapper
      return cxxWrapper
    }
  }
}

/// A Swift base-protocol representing the RNCandle HybridObject.
/// Implement this protocol to create Swift-based instances of RNCandle.
/// ```swift
/// class HybridRNCandle : HybridRNCandleSpec {
///   // ...
/// }
/// ```
public typealias HybridRNCandleSpec = HybridRNCandleSpec_protocol & HybridRNCandleSpec_base
