react-native-candle 0.1.43 → 0.1.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/ReactNativeCandle.podspec +1 -1
  2. package/ios/Sources/CandleActionViewModel.swift +4 -7
  3. package/ios/Sources/CandleLinkSheetWrapperView.swift +40 -59
  4. package/ios/Sources/CandleLinkViewModel.swift +21 -31
  5. package/ios/Sources/CandleTradeExecutionSheetWrapper.swift +14 -23
  6. package/ios/Sources/HostingViewController.swift +26 -26
  7. package/ios/Sources/RNCandle.swift +159 -1307
  8. package/ios/Sources/Types.swift +847 -0
  9. package/ios/Sources/UIApplication++.swift +5 -9
  10. package/lib/commonjs/context.js +17 -0
  11. package/lib/commonjs/context.js.map +1 -0
  12. package/lib/commonjs/index.js +17 -407
  13. package/lib/commonjs/index.js.map +1 -1
  14. package/lib/commonjs/package.json +1 -0
  15. package/lib/commonjs/provider.js +117 -0
  16. package/lib/commonjs/provider.js.map +1 -0
  17. package/lib/commonjs/types.js +271 -0
  18. package/lib/commonjs/types.js.map +1 -0
  19. package/lib/module/context.js +12 -0
  20. package/lib/module/context.js.map +1 -0
  21. package/lib/module/index.js +2 -408
  22. package/lib/module/index.js.map +1 -1
  23. package/lib/module/package.json +1 -0
  24. package/lib/module/provider.js +111 -0
  25. package/lib/module/provider.js.map +1 -0
  26. package/lib/module/types.js +256 -0
  27. package/lib/module/types.js.map +1 -0
  28. package/lib/typescript/commonjs/src/context.d.ts +47 -0
  29. package/lib/typescript/commonjs/src/context.d.ts.map +1 -0
  30. package/lib/typescript/commonjs/src/index.d.ts +4 -166
  31. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  32. package/lib/typescript/commonjs/src/provider.d.ts +8 -0
  33. package/lib/typescript/commonjs/src/provider.d.ts.map +1 -0
  34. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +22 -24
  35. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts.map +1 -1
  36. package/lib/typescript/commonjs/src/types.d.ts +125 -0
  37. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  38. package/lib/typescript/module/src/context.d.ts +47 -0
  39. package/lib/typescript/module/src/context.d.ts.map +1 -0
  40. package/lib/typescript/module/src/index.d.ts +4 -166
  41. package/lib/typescript/module/src/index.d.ts.map +1 -1
  42. package/lib/typescript/module/src/provider.d.ts +8 -0
  43. package/lib/typescript/module/src/provider.d.ts.map +1 -0
  44. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +22 -24
  45. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts.map +1 -1
  46. package/lib/typescript/module/src/types.d.ts +125 -0
  47. package/lib/typescript/module/src/types.d.ts.map +1 -0
  48. package/nitrogen/generated/.gitattributes +1 -1
  49. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.cpp +15 -31
  50. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.hpp +379 -242
  51. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Umbrella.hpp +23 -22
  52. package/nitrogen/generated/ios/ReactNativeCandleAutolinking.mm +1 -1
  53. package/nitrogen/generated/ios/ReactNativeCandleAutolinking.swift +2 -4
  54. package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +36 -42
  55. package/nitrogen/generated/ios/swift/ActiveLinkedAccountDetails.swift +6 -3
  56. package/nitrogen/generated/ios/swift/AssetAccount.swift +6 -3
  57. package/nitrogen/generated/ios/swift/AssetAccountKind.swift +4 -4
  58. package/nitrogen/generated/ios/swift/AssetAccountRef.swift +5 -5
  59. package/nitrogen/generated/ios/swift/{AssetAccountQuery.swift → AssetAccountsQuery.swift} +7 -6
  60. package/nitrogen/generated/ios/swift/Counterparty.swift +8 -3
  61. package/nitrogen/generated/ios/swift/CounterpartyKind.swift +42 -0
  62. package/nitrogen/generated/ios/swift/FiatAccount.swift +4 -2
  63. package/nitrogen/generated/ios/swift/FiatAsset.swift +2 -1
  64. package/nitrogen/generated/ios/swift/FiatAssetQuoteRequest.swift +4 -2
  65. package/nitrogen/generated/ios/swift/FiatAssetRef.swift +2 -1
  66. package/nitrogen/generated/ios/swift/Func_void_LinkedAccount.swift +5 -5
  67. package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +7 -7
  68. package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +40 -65
  69. package/nitrogen/generated/ios/swift/LinkedAccountDetails.swift +15 -3
  70. package/nitrogen/generated/ios/swift/{StatePayload.swift → LinkedAccountState.swift} +6 -6
  71. package/nitrogen/generated/ios/swift/LinkedAccountStatusRef.swift +4 -3
  72. package/nitrogen/generated/ios/swift/MarketAccount.swift +5 -5
  73. package/nitrogen/generated/ios/swift/MarketAssetKind.swift +38 -0
  74. package/nitrogen/generated/ios/swift/MarketAssetQuoteRequest.swift +11 -8
  75. package/nitrogen/generated/ios/swift/MarketTradeAsset.swift +7 -7
  76. package/nitrogen/generated/ios/swift/MarketTradeAssetRef.swift +5 -5
  77. package/nitrogen/generated/ios/swift/MerchantCounterparty.swift +2 -1
  78. package/nitrogen/generated/ios/swift/TradeAsset.swift +10 -5
  79. package/nitrogen/generated/ios/swift/TradeAssetKind.swift +54 -0
  80. package/nitrogen/generated/ios/swift/TradeAssetQuoteRequest.swift +15 -4
  81. package/nitrogen/generated/ios/swift/TradeAssetRef.swift +11 -5
  82. package/nitrogen/generated/ios/swift/TradeExecutionResult.swift +4 -2
  83. package/nitrogen/generated/ios/swift/{TradeQuoteRequest.swift → TradeQuotesRequest.swift} +7 -6
  84. package/nitrogen/generated/ios/swift/{TradeQuery.swift → TradesQuery.swift} +29 -45
  85. package/nitrogen/generated/ios/swift/TransportAssetQuoteRequest.swift +12 -6
  86. package/nitrogen/generated/shared/c++/ACHAccountKind.hpp +7 -9
  87. package/nitrogen/generated/shared/c++/ACHDetails.hpp +7 -9
  88. package/nitrogen/generated/shared/c++/ActiveLinkedAccountDetails.hpp +4 -6
  89. package/nitrogen/generated/shared/c++/Address.hpp +4 -6
  90. package/nitrogen/generated/shared/c++/AssetAccount.hpp +14 -16
  91. package/nitrogen/generated/shared/c++/AssetAccountKind.hpp +15 -17
  92. package/nitrogen/generated/shared/c++/AssetAccountRef.hpp +12 -12
  93. package/nitrogen/generated/shared/c++/{AssetAccountQuery.hpp → AssetAccountsQuery.hpp} +14 -16
  94. package/nitrogen/generated/shared/c++/AssetAccountsResponse.hpp +11 -13
  95. package/nitrogen/generated/shared/c++/Coordinates.hpp +4 -6
  96. package/nitrogen/generated/shared/c++/Counterparty.hpp +14 -16
  97. package/nitrogen/generated/shared/c++/CounterpartyKind.hpp +80 -0
  98. package/nitrogen/generated/shared/c++/FiatAccount.hpp +16 -18
  99. package/nitrogen/generated/shared/c++/FiatAsset.hpp +7 -9
  100. package/nitrogen/generated/shared/c++/FiatAssetQuoteRequest.hpp +4 -6
  101. package/nitrogen/generated/shared/c++/FiatAssetRef.hpp +4 -6
  102. package/nitrogen/generated/shared/c++/FiatMarketAccountKind.hpp +13 -15
  103. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.cpp +1 -2
  104. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +17 -27
  105. package/nitrogen/generated/shared/c++/InactiveLinkedAccountDetails.hpp +4 -6
  106. package/nitrogen/generated/shared/c++/LinkedAccount.hpp +10 -12
  107. package/nitrogen/generated/shared/c++/LinkedAccountDetails.hpp +14 -16
  108. package/nitrogen/generated/shared/c++/LinkedAccountRef.hpp +4 -6
  109. package/nitrogen/generated/shared/c++/{StatePayload.hpp → LinkedAccountState.hpp} +15 -17
  110. package/nitrogen/generated/shared/c++/LinkedAccountStatusRef.hpp +15 -17
  111. package/nitrogen/generated/shared/c++/MarketAccount.hpp +18 -17
  112. package/nitrogen/generated/shared/c++/MarketAssetKind.hpp +76 -0
  113. package/nitrogen/generated/shared/c++/MarketAssetQuoteRequest.hpp +12 -12
  114. package/nitrogen/generated/shared/c++/MarketTradeAsset.hpp +15 -14
  115. package/nitrogen/generated/shared/c++/MarketTradeAssetRef.hpp +12 -12
  116. package/nitrogen/generated/shared/c++/MerchantCounterparty.hpp +8 -10
  117. package/nitrogen/generated/shared/c++/MerchantLocation.hpp +4 -6
  118. package/nitrogen/generated/shared/c++/NothingAsset.hpp +4 -6
  119. package/nitrogen/generated/shared/c++/NothingAssetQuoteRequest.hpp +4 -6
  120. package/nitrogen/generated/shared/c++/NothingAssetRef.hpp +4 -6
  121. package/nitrogen/generated/shared/c++/OtherAsset.hpp +4 -6
  122. package/nitrogen/generated/shared/c++/OtherAssetRef.hpp +4 -6
  123. package/nitrogen/generated/shared/c++/PresentationBackground.hpp +7 -9
  124. package/nitrogen/generated/shared/c++/PresentationStyle.hpp +7 -9
  125. package/nitrogen/generated/shared/c++/Service.hpp +163 -165
  126. package/nitrogen/generated/shared/c++/ServiceCounterparty.hpp +7 -9
  127. package/nitrogen/generated/shared/c++/Trade.hpp +16 -18
  128. package/nitrogen/generated/shared/c++/TradeAsset.hpp +20 -22
  129. package/nitrogen/generated/shared/c++/TradeAssetKind.hpp +92 -0
  130. package/nitrogen/generated/shared/c++/TradeAssetQuoteRequest.hpp +17 -19
  131. package/nitrogen/generated/shared/c++/TradeAssetRef.hpp +20 -22
  132. package/nitrogen/generated/shared/c++/TradeExecutionResult.hpp +8 -10
  133. package/nitrogen/generated/shared/c++/TradeQuote.hpp +10 -12
  134. package/nitrogen/generated/shared/c++/{TradeQuoteRequest.hpp → TradeQuotesRequest.hpp} +17 -19
  135. package/nitrogen/generated/shared/c++/TradeQuotesResponse.hpp +11 -13
  136. package/nitrogen/generated/shared/c++/TradeRef.hpp +10 -12
  137. package/nitrogen/generated/shared/c++/TradeState.hpp +9 -11
  138. package/nitrogen/generated/shared/c++/TradesQuery.hpp +89 -0
  139. package/nitrogen/generated/shared/c++/TradesResponse.hpp +11 -13
  140. package/nitrogen/generated/shared/c++/TransportAccount.hpp +10 -12
  141. package/nitrogen/generated/shared/c++/TransportAccountKind.hpp +9 -11
  142. package/nitrogen/generated/shared/c++/TransportAsset.hpp +19 -21
  143. package/nitrogen/generated/shared/c++/TransportAssetQuoteRequest.hpp +16 -18
  144. package/nitrogen/generated/shared/c++/TransportAssetRef.hpp +4 -6
  145. package/nitrogen/generated/shared/c++/UnavailableLinkedAccountDetails.hpp +4 -6
  146. package/nitrogen/generated/shared/c++/UserCounterparty.hpp +4 -6
  147. package/nitrogen/generated/shared/c++/WireDetails.hpp +4 -6
  148. package/package.json +10 -14
  149. package/src/context.ts +86 -0
  150. package/src/index.ts +4 -634
  151. package/src/provider.tsx +152 -0
  152. package/src/specs/RNCandle.nitro.ts +38 -29
  153. package/src/types.ts +462 -0
  154. package/nitrogen/generated/ios/swift/AppUser.swift +0 -75
  155. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +0 -44
  156. package/nitrogen/generated/ios/swift/Func_void_std__vector_std__shared_ptr_AnyMap__.swift +0 -47
  157. package/nitrogen/generated/ios/swift/ToolCall.swift +0 -44
  158. package/nitrogen/generated/shared/c++/AppUser.hpp +0 -78
  159. package/nitrogen/generated/shared/c++/ToolCall.hpp +0 -73
  160. package/nitrogen/generated/shared/c++/TradeQuery.hpp +0 -86
@@ -29,9 +29,9 @@ namespace margelo::nitro::rncandle {
29
29
  * An enum which can be represented as a JavaScript union (AssetAccountKind).
30
30
  */
31
31
  enum class AssetAccountKind {
32
- FIAT SWIFT_NAME(fiat) = 0,
33
- STOCK SWIFT_NAME(stock) = 1,
34
- CRYPTO SWIFT_NAME(crypto) = 2,
32
+ STOCK SWIFT_NAME(stock) = 0,
33
+ CRYPTO SWIFT_NAME(crypto) = 1,
34
+ FIAT SWIFT_NAME(fiat) = 2,
35
35
  TRANSPORT SWIFT_NAME(transport) = 3,
36
36
  } CLOSED_ENUM;
37
37
 
@@ -39,28 +39,26 @@ namespace margelo::nitro::rncandle {
39
39
 
40
40
  namespace margelo::nitro {
41
41
 
42
- using namespace margelo::nitro::rncandle;
43
-
44
42
  // C++ AssetAccountKind <> JS AssetAccountKind (union)
45
43
  template <>
46
- struct JSIConverter<AssetAccountKind> final {
47
- static inline AssetAccountKind fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
44
+ struct JSIConverter<margelo::nitro::rncandle::AssetAccountKind> final {
45
+ static inline margelo::nitro::rncandle::AssetAccountKind fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
48
46
  std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
49
47
  switch (hashString(unionValue.c_str(), unionValue.size())) {
50
- case hashString("fiat"): return AssetAccountKind::FIAT;
51
- case hashString("stock"): return AssetAccountKind::STOCK;
52
- case hashString("crypto"): return AssetAccountKind::CRYPTO;
53
- case hashString("transport"): return AssetAccountKind::TRANSPORT;
48
+ case hashString("stock"): return margelo::nitro::rncandle::AssetAccountKind::STOCK;
49
+ case hashString("crypto"): return margelo::nitro::rncandle::AssetAccountKind::CRYPTO;
50
+ case hashString("fiat"): return margelo::nitro::rncandle::AssetAccountKind::FIAT;
51
+ case hashString("transport"): return margelo::nitro::rncandle::AssetAccountKind::TRANSPORT;
54
52
  default: [[unlikely]]
55
53
  throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum AssetAccountKind - invalid value!");
56
54
  }
57
55
  }
58
- static inline jsi::Value toJSI(jsi::Runtime& runtime, AssetAccountKind arg) {
56
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rncandle::AssetAccountKind arg) {
59
57
  switch (arg) {
60
- case AssetAccountKind::FIAT: return JSIConverter<std::string>::toJSI(runtime, "fiat");
61
- case AssetAccountKind::STOCK: return JSIConverter<std::string>::toJSI(runtime, "stock");
62
- case AssetAccountKind::CRYPTO: return JSIConverter<std::string>::toJSI(runtime, "crypto");
63
- case AssetAccountKind::TRANSPORT: return JSIConverter<std::string>::toJSI(runtime, "transport");
58
+ case margelo::nitro::rncandle::AssetAccountKind::STOCK: return JSIConverter<std::string>::toJSI(runtime, "stock");
59
+ case margelo::nitro::rncandle::AssetAccountKind::CRYPTO: return JSIConverter<std::string>::toJSI(runtime, "crypto");
60
+ case margelo::nitro::rncandle::AssetAccountKind::FIAT: return JSIConverter<std::string>::toJSI(runtime, "fiat");
61
+ case margelo::nitro::rncandle::AssetAccountKind::TRANSPORT: return JSIConverter<std::string>::toJSI(runtime, "transport");
64
62
  default: [[unlikely]]
65
63
  throw std::invalid_argument("Cannot convert AssetAccountKind to JS - invalid value: "
66
64
  + std::to_string(static_cast<int>(arg)) + "!");
@@ -72,9 +70,9 @@ namespace margelo::nitro {
72
70
  }
73
71
  std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
74
72
  switch (hashString(unionValue.c_str(), unionValue.size())) {
75
- case hashString("fiat"):
76
73
  case hashString("stock"):
77
74
  case hashString("crypto"):
75
+ case hashString("fiat"):
78
76
  case hashString("transport"):
79
77
  return true;
80
78
  default:
@@ -18,9 +18,11 @@
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
20
 
21
-
21
+ // Forward declaration of `AssetAccountKind` to properly resolve imports.
22
+ namespace margelo::nitro::rncandle { enum class AssetAccountKind; }
22
23
 
23
24
  #include <string>
25
+ #include "AssetAccountKind.hpp"
24
26
 
25
27
  namespace margelo::nitro::rncandle {
26
28
 
@@ -30,35 +32,33 @@ namespace margelo::nitro::rncandle {
30
32
  struct AssetAccountRef {
31
33
  public:
32
34
  std::string linkedAccountID SWIFT_PRIVATE;
33
- std::string assetKind SWIFT_PRIVATE;
35
+ AssetAccountKind assetKind SWIFT_PRIVATE;
34
36
  std::string serviceAccountID SWIFT_PRIVATE;
35
37
 
36
38
  public:
37
39
  AssetAccountRef() = default;
38
- explicit AssetAccountRef(std::string linkedAccountID, std::string assetKind, std::string serviceAccountID): linkedAccountID(linkedAccountID), assetKind(assetKind), serviceAccountID(serviceAccountID) {}
40
+ explicit AssetAccountRef(std::string linkedAccountID, AssetAccountKind assetKind, std::string serviceAccountID): linkedAccountID(linkedAccountID), assetKind(assetKind), serviceAccountID(serviceAccountID) {}
39
41
  };
40
42
 
41
43
  } // namespace margelo::nitro::rncandle
42
44
 
43
45
  namespace margelo::nitro {
44
46
 
45
- using namespace margelo::nitro::rncandle;
46
-
47
47
  // C++ AssetAccountRef <> JS AssetAccountRef (object)
48
48
  template <>
49
- struct JSIConverter<AssetAccountRef> final {
50
- static inline AssetAccountRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ struct JSIConverter<margelo::nitro::rncandle::AssetAccountRef> final {
50
+ static inline margelo::nitro::rncandle::AssetAccountRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
51
51
  jsi::Object obj = arg.asObject(runtime);
52
- return AssetAccountRef(
52
+ return margelo::nitro::rncandle::AssetAccountRef(
53
53
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID")),
54
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
54
+ JSIConverter<margelo::nitro::rncandle::AssetAccountKind>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
55
55
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "serviceAccountID"))
56
56
  );
57
57
  }
58
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const AssetAccountRef& arg) {
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::AssetAccountRef& arg) {
59
59
  jsi::Object obj(runtime);
60
60
  obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
61
- obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
61
+ obj.setProperty(runtime, "assetKind", JSIConverter<margelo::nitro::rncandle::AssetAccountKind>::toJSI(runtime, arg.assetKind));
62
62
  obj.setProperty(runtime, "serviceAccountID", JSIConverter<std::string>::toJSI(runtime, arg.serviceAccountID));
63
63
  return obj;
64
64
  }
@@ -68,7 +68,7 @@ namespace margelo::nitro {
68
68
  }
69
69
  jsi::Object obj = value.getObject(runtime);
70
70
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
71
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
71
+ if (!JSIConverter<margelo::nitro::rncandle::AssetAccountKind>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
72
72
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "serviceAccountID"))) return false;
73
73
  return true;
74
74
  }
@@ -1,5 +1,5 @@
1
1
  ///
2
- /// AssetAccountQuery.hpp
2
+ /// AssetAccountsQuery.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
5
  /// Copyright © 2025 Marc Rousavy @ Margelo
@@ -21,45 +21,43 @@
21
21
  // Forward declaration of `AssetAccountKind` to properly resolve imports.
22
22
  namespace margelo::nitro::rncandle { enum class AssetAccountKind; }
23
23
 
24
- #include <optional>
25
24
  #include <string>
25
+ #include <optional>
26
26
  #include "AssetAccountKind.hpp"
27
27
 
28
28
  namespace margelo::nitro::rncandle {
29
29
 
30
30
  /**
31
- * A struct which can be represented as a JavaScript object (AssetAccountQuery).
31
+ * A struct which can be represented as a JavaScript object (AssetAccountsQuery).
32
32
  */
33
- struct AssetAccountQuery {
33
+ struct AssetAccountsQuery {
34
34
  public:
35
35
  std::optional<std::string> linkedAccountIDs SWIFT_PRIVATE;
36
36
  std::optional<AssetAccountKind> assetKind SWIFT_PRIVATE;
37
37
 
38
38
  public:
39
- AssetAccountQuery() = default;
40
- explicit AssetAccountQuery(std::optional<std::string> linkedAccountIDs, std::optional<AssetAccountKind> assetKind): linkedAccountIDs(linkedAccountIDs), assetKind(assetKind) {}
39
+ AssetAccountsQuery() = default;
40
+ explicit AssetAccountsQuery(std::optional<std::string> linkedAccountIDs, std::optional<AssetAccountKind> assetKind): linkedAccountIDs(linkedAccountIDs), assetKind(assetKind) {}
41
41
  };
42
42
 
43
43
  } // namespace margelo::nitro::rncandle
44
44
 
45
45
  namespace margelo::nitro {
46
46
 
47
- using namespace margelo::nitro::rncandle;
48
-
49
- // C++ AssetAccountQuery <> JS AssetAccountQuery (object)
47
+ // C++ AssetAccountsQuery <> JS AssetAccountsQuery (object)
50
48
  template <>
51
- struct JSIConverter<AssetAccountQuery> final {
52
- static inline AssetAccountQuery fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ struct JSIConverter<margelo::nitro::rncandle::AssetAccountsQuery> final {
50
+ static inline margelo::nitro::rncandle::AssetAccountsQuery fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
51
  jsi::Object obj = arg.asObject(runtime);
54
- return AssetAccountQuery(
52
+ return margelo::nitro::rncandle::AssetAccountsQuery(
55
53
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountIDs")),
56
- JSIConverter<std::optional<AssetAccountKind>>::fromJSI(runtime, obj.getProperty(runtime, "assetKind"))
54
+ JSIConverter<std::optional<margelo::nitro::rncandle::AssetAccountKind>>::fromJSI(runtime, obj.getProperty(runtime, "assetKind"))
57
55
  );
58
56
  }
59
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const AssetAccountQuery& arg) {
57
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::AssetAccountsQuery& arg) {
60
58
  jsi::Object obj(runtime);
61
59
  obj.setProperty(runtime, "linkedAccountIDs", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.linkedAccountIDs));
62
- obj.setProperty(runtime, "assetKind", JSIConverter<std::optional<AssetAccountKind>>::toJSI(runtime, arg.assetKind));
60
+ obj.setProperty(runtime, "assetKind", JSIConverter<std::optional<margelo::nitro::rncandle::AssetAccountKind>>::toJSI(runtime, arg.assetKind));
63
61
  return obj;
64
62
  }
65
63
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -68,7 +66,7 @@ namespace margelo::nitro {
68
66
  }
69
67
  jsi::Object obj = value.getObject(runtime);
70
68
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountIDs"))) return false;
71
- if (!JSIConverter<std::optional<AssetAccountKind>>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
69
+ if (!JSIConverter<std::optional<margelo::nitro::rncandle::AssetAccountKind>>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
72
70
  return true;
73
71
  }
74
72
  };
@@ -23,8 +23,8 @@ namespace margelo::nitro::rncandle { struct LinkedAccountStatusRef; }
23
23
  // Forward declaration of `AssetAccount` to properly resolve imports.
24
24
  namespace margelo::nitro::rncandle { struct AssetAccount; }
25
25
 
26
- #include <vector>
27
26
  #include "LinkedAccountStatusRef.hpp"
27
+ #include <vector>
28
28
  #include "AssetAccount.hpp"
29
29
 
30
30
  namespace margelo::nitro::rncandle {
@@ -46,22 +46,20 @@ namespace margelo::nitro::rncandle {
46
46
 
47
47
  namespace margelo::nitro {
48
48
 
49
- using namespace margelo::nitro::rncandle;
50
-
51
49
  // C++ AssetAccountsResponse <> JS AssetAccountsResponse (object)
52
50
  template <>
53
- struct JSIConverter<AssetAccountsResponse> final {
54
- static inline AssetAccountsResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
51
+ struct JSIConverter<margelo::nitro::rncandle::AssetAccountsResponse> final {
52
+ static inline margelo::nitro::rncandle::AssetAccountsResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
55
53
  jsi::Object obj = arg.asObject(runtime);
56
- return AssetAccountsResponse(
57
- JSIConverter<std::vector<LinkedAccountStatusRef>>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccounts")),
58
- JSIConverter<std::vector<AssetAccount>>::fromJSI(runtime, obj.getProperty(runtime, "assetAccounts"))
54
+ return margelo::nitro::rncandle::AssetAccountsResponse(
55
+ JSIConverter<std::vector<margelo::nitro::rncandle::LinkedAccountStatusRef>>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccounts")),
56
+ JSIConverter<std::vector<margelo::nitro::rncandle::AssetAccount>>::fromJSI(runtime, obj.getProperty(runtime, "assetAccounts"))
59
57
  );
60
58
  }
61
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const AssetAccountsResponse& arg) {
59
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::AssetAccountsResponse& arg) {
62
60
  jsi::Object obj(runtime);
63
- obj.setProperty(runtime, "linkedAccounts", JSIConverter<std::vector<LinkedAccountStatusRef>>::toJSI(runtime, arg.linkedAccounts));
64
- obj.setProperty(runtime, "assetAccounts", JSIConverter<std::vector<AssetAccount>>::toJSI(runtime, arg.assetAccounts));
61
+ obj.setProperty(runtime, "linkedAccounts", JSIConverter<std::vector<margelo::nitro::rncandle::LinkedAccountStatusRef>>::toJSI(runtime, arg.linkedAccounts));
62
+ obj.setProperty(runtime, "assetAccounts", JSIConverter<std::vector<margelo::nitro::rncandle::AssetAccount>>::toJSI(runtime, arg.assetAccounts));
65
63
  return obj;
66
64
  }
67
65
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -69,8 +67,8 @@ namespace margelo::nitro {
69
67
  return false;
70
68
  }
71
69
  jsi::Object obj = value.getObject(runtime);
72
- if (!JSIConverter<std::vector<LinkedAccountStatusRef>>::canConvert(runtime, obj.getProperty(runtime, "linkedAccounts"))) return false;
73
- if (!JSIConverter<std::vector<AssetAccount>>::canConvert(runtime, obj.getProperty(runtime, "assetAccounts"))) return false;
70
+ if (!JSIConverter<std::vector<margelo::nitro::rncandle::LinkedAccountStatusRef>>::canConvert(runtime, obj.getProperty(runtime, "linkedAccounts"))) return false;
71
+ if (!JSIConverter<std::vector<margelo::nitro::rncandle::AssetAccount>>::canConvert(runtime, obj.getProperty(runtime, "assetAccounts"))) return false;
74
72
  return true;
75
73
  }
76
74
  };
@@ -41,19 +41,17 @@ namespace margelo::nitro::rncandle {
41
41
 
42
42
  namespace margelo::nitro {
43
43
 
44
- using namespace margelo::nitro::rncandle;
45
-
46
44
  // C++ Coordinates <> JS Coordinates (object)
47
45
  template <>
48
- struct JSIConverter<Coordinates> final {
49
- static inline Coordinates fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
46
+ struct JSIConverter<margelo::nitro::rncandle::Coordinates> final {
47
+ static inline margelo::nitro::rncandle::Coordinates fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
48
  jsi::Object obj = arg.asObject(runtime);
51
- return Coordinates(
49
+ return margelo::nitro::rncandle::Coordinates(
52
50
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "latitude")),
53
51
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "longitude"))
54
52
  );
55
53
  }
56
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const Coordinates& arg) {
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::Coordinates& arg) {
57
55
  jsi::Object obj(runtime);
58
56
  obj.setProperty(runtime, "latitude", JSIConverter<double>::toJSI(runtime, arg.latitude));
59
57
  obj.setProperty(runtime, "longitude", JSIConverter<double>::toJSI(runtime, arg.longitude));
@@ -25,8 +25,8 @@ namespace margelo::nitro::rncandle { struct UserCounterparty; }
25
25
  // Forward declaration of `ServiceCounterparty` to properly resolve imports.
26
26
  namespace margelo::nitro::rncandle { struct ServiceCounterparty; }
27
27
 
28
- #include <optional>
29
28
  #include "MerchantCounterparty.hpp"
29
+ #include <optional>
30
30
  #include "UserCounterparty.hpp"
31
31
  #include "ServiceCounterparty.hpp"
32
32
 
@@ -50,24 +50,22 @@ namespace margelo::nitro::rncandle {
50
50
 
51
51
  namespace margelo::nitro {
52
52
 
53
- using namespace margelo::nitro::rncandle;
54
-
55
53
  // C++ Counterparty <> JS Counterparty (object)
56
54
  template <>
57
- struct JSIConverter<Counterparty> final {
58
- static inline Counterparty fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
55
+ struct JSIConverter<margelo::nitro::rncandle::Counterparty> final {
56
+ static inline margelo::nitro::rncandle::Counterparty fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
59
57
  jsi::Object obj = arg.asObject(runtime);
60
- return Counterparty(
61
- JSIConverter<std::optional<MerchantCounterparty>>::fromJSI(runtime, obj.getProperty(runtime, "merchantCounterparty")),
62
- JSIConverter<std::optional<UserCounterparty>>::fromJSI(runtime, obj.getProperty(runtime, "userCounterparty")),
63
- JSIConverter<std::optional<ServiceCounterparty>>::fromJSI(runtime, obj.getProperty(runtime, "serviceCounterparty"))
58
+ return margelo::nitro::rncandle::Counterparty(
59
+ JSIConverter<std::optional<margelo::nitro::rncandle::MerchantCounterparty>>::fromJSI(runtime, obj.getProperty(runtime, "merchantCounterparty")),
60
+ JSIConverter<std::optional<margelo::nitro::rncandle::UserCounterparty>>::fromJSI(runtime, obj.getProperty(runtime, "userCounterparty")),
61
+ JSIConverter<std::optional<margelo::nitro::rncandle::ServiceCounterparty>>::fromJSI(runtime, obj.getProperty(runtime, "serviceCounterparty"))
64
62
  );
65
63
  }
66
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const Counterparty& arg) {
64
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::Counterparty& arg) {
67
65
  jsi::Object obj(runtime);
68
- obj.setProperty(runtime, "merchantCounterparty", JSIConverter<std::optional<MerchantCounterparty>>::toJSI(runtime, arg.merchantCounterparty));
69
- obj.setProperty(runtime, "userCounterparty", JSIConverter<std::optional<UserCounterparty>>::toJSI(runtime, arg.userCounterparty));
70
- obj.setProperty(runtime, "serviceCounterparty", JSIConverter<std::optional<ServiceCounterparty>>::toJSI(runtime, arg.serviceCounterparty));
66
+ obj.setProperty(runtime, "merchantCounterparty", JSIConverter<std::optional<margelo::nitro::rncandle::MerchantCounterparty>>::toJSI(runtime, arg.merchantCounterparty));
67
+ obj.setProperty(runtime, "userCounterparty", JSIConverter<std::optional<margelo::nitro::rncandle::UserCounterparty>>::toJSI(runtime, arg.userCounterparty));
68
+ obj.setProperty(runtime, "serviceCounterparty", JSIConverter<std::optional<margelo::nitro::rncandle::ServiceCounterparty>>::toJSI(runtime, arg.serviceCounterparty));
71
69
  return obj;
72
70
  }
73
71
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -75,9 +73,9 @@ namespace margelo::nitro {
75
73
  return false;
76
74
  }
77
75
  jsi::Object obj = value.getObject(runtime);
78
- if (!JSIConverter<std::optional<MerchantCounterparty>>::canConvert(runtime, obj.getProperty(runtime, "merchantCounterparty"))) return false;
79
- if (!JSIConverter<std::optional<UserCounterparty>>::canConvert(runtime, obj.getProperty(runtime, "userCounterparty"))) return false;
80
- if (!JSIConverter<std::optional<ServiceCounterparty>>::canConvert(runtime, obj.getProperty(runtime, "serviceCounterparty"))) return false;
76
+ if (!JSIConverter<std::optional<margelo::nitro::rncandle::MerchantCounterparty>>::canConvert(runtime, obj.getProperty(runtime, "merchantCounterparty"))) return false;
77
+ if (!JSIConverter<std::optional<margelo::nitro::rncandle::UserCounterparty>>::canConvert(runtime, obj.getProperty(runtime, "userCounterparty"))) return false;
78
+ if (!JSIConverter<std::optional<margelo::nitro::rncandle::ServiceCounterparty>>::canConvert(runtime, obj.getProperty(runtime, "serviceCounterparty"))) return false;
81
79
  return true;
82
80
  }
83
81
  };
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// CounterpartyKind.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/NitroHash.hpp>)
11
+ #include <NitroModules/NitroHash.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
16
+ #include <NitroModules/JSIConverter.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
21
+ #include <NitroModules/NitroDefines.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ namespace margelo::nitro::rncandle {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (CounterpartyKind).
30
+ */
31
+ enum class CounterpartyKind {
32
+ MERCHANT SWIFT_NAME(merchant) = 0,
33
+ USER SWIFT_NAME(user) = 1,
34
+ SERVICE SWIFT_NAME(service) = 2,
35
+ } CLOSED_ENUM;
36
+
37
+ } // namespace margelo::nitro::rncandle
38
+
39
+ namespace margelo::nitro {
40
+
41
+ // C++ CounterpartyKind <> JS CounterpartyKind (union)
42
+ template <>
43
+ struct JSIConverter<margelo::nitro::rncandle::CounterpartyKind> final {
44
+ static inline margelo::nitro::rncandle::CounterpartyKind fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
45
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
46
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
47
+ case hashString("merchant"): return margelo::nitro::rncandle::CounterpartyKind::MERCHANT;
48
+ case hashString("user"): return margelo::nitro::rncandle::CounterpartyKind::USER;
49
+ case hashString("service"): return margelo::nitro::rncandle::CounterpartyKind::SERVICE;
50
+ default: [[unlikely]]
51
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum CounterpartyKind - invalid value!");
52
+ }
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rncandle::CounterpartyKind arg) {
55
+ switch (arg) {
56
+ case margelo::nitro::rncandle::CounterpartyKind::MERCHANT: return JSIConverter<std::string>::toJSI(runtime, "merchant");
57
+ case margelo::nitro::rncandle::CounterpartyKind::USER: return JSIConverter<std::string>::toJSI(runtime, "user");
58
+ case margelo::nitro::rncandle::CounterpartyKind::SERVICE: return JSIConverter<std::string>::toJSI(runtime, "service");
59
+ default: [[unlikely]]
60
+ throw std::invalid_argument("Cannot convert CounterpartyKind to JS - invalid value: "
61
+ + std::to_string(static_cast<int>(arg)) + "!");
62
+ }
63
+ }
64
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
65
+ if (!value.isString()) {
66
+ return false;
67
+ }
68
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
69
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
70
+ case hashString("merchant"):
71
+ case hashString("user"):
72
+ case hashString("service"):
73
+ return true;
74
+ default:
75
+ return false;
76
+ }
77
+ }
78
+ };
79
+
80
+ } // namespace margelo::nitro
@@ -61,38 +61,36 @@ namespace margelo::nitro::rncandle {
61
61
 
62
62
  namespace margelo::nitro {
63
63
 
64
- using namespace margelo::nitro::rncandle;
65
-
66
64
  // C++ FiatAccount <> JS FiatAccount (object)
67
65
  template <>
68
- struct JSIConverter<FiatAccount> final {
69
- static inline FiatAccount fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
66
+ struct JSIConverter<margelo::nitro::rncandle::FiatAccount> final {
67
+ static inline margelo::nitro::rncandle::FiatAccount fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
70
68
  jsi::Object obj = arg.asObject(runtime);
71
- return FiatAccount(
69
+ return margelo::nitro::rncandle::FiatAccount(
72
70
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
73
71
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "serviceAccountID")),
74
- JSIConverter<FiatMarketAccountKind>::fromJSI(runtime, obj.getProperty(runtime, "accountKind")),
72
+ JSIConverter<margelo::nitro::rncandle::FiatMarketAccountKind>::fromJSI(runtime, obj.getProperty(runtime, "accountKind")),
75
73
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "nickname")),
76
74
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "currencyCode")),
77
75
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "balance")),
78
- JSIConverter<std::optional<ACHDetails>>::fromJSI(runtime, obj.getProperty(runtime, "ach")),
79
- JSIConverter<std::optional<WireDetails>>::fromJSI(runtime, obj.getProperty(runtime, "wire")),
76
+ JSIConverter<std::optional<margelo::nitro::rncandle::ACHDetails>>::fromJSI(runtime, obj.getProperty(runtime, "ach")),
77
+ JSIConverter<std::optional<margelo::nitro::rncandle::WireDetails>>::fromJSI(runtime, obj.getProperty(runtime, "wire")),
80
78
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID")),
81
- JSIConverter<Service>::fromJSI(runtime, obj.getProperty(runtime, "service"))
79
+ JSIConverter<margelo::nitro::rncandle::Service>::fromJSI(runtime, obj.getProperty(runtime, "service"))
82
80
  );
83
81
  }
84
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const FiatAccount& arg) {
82
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::FiatAccount& arg) {
85
83
  jsi::Object obj(runtime);
86
84
  obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
87
85
  obj.setProperty(runtime, "serviceAccountID", JSIConverter<std::string>::toJSI(runtime, arg.serviceAccountID));
88
- obj.setProperty(runtime, "accountKind", JSIConverter<FiatMarketAccountKind>::toJSI(runtime, arg.accountKind));
86
+ obj.setProperty(runtime, "accountKind", JSIConverter<margelo::nitro::rncandle::FiatMarketAccountKind>::toJSI(runtime, arg.accountKind));
89
87
  obj.setProperty(runtime, "nickname", JSIConverter<std::string>::toJSI(runtime, arg.nickname));
90
88
  obj.setProperty(runtime, "currencyCode", JSIConverter<std::string>::toJSI(runtime, arg.currencyCode));
91
89
  obj.setProperty(runtime, "balance", JSIConverter<std::optional<double>>::toJSI(runtime, arg.balance));
92
- obj.setProperty(runtime, "ach", JSIConverter<std::optional<ACHDetails>>::toJSI(runtime, arg.ach));
93
- obj.setProperty(runtime, "wire", JSIConverter<std::optional<WireDetails>>::toJSI(runtime, arg.wire));
90
+ obj.setProperty(runtime, "ach", JSIConverter<std::optional<margelo::nitro::rncandle::ACHDetails>>::toJSI(runtime, arg.ach));
91
+ obj.setProperty(runtime, "wire", JSIConverter<std::optional<margelo::nitro::rncandle::WireDetails>>::toJSI(runtime, arg.wire));
94
92
  obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
95
- obj.setProperty(runtime, "service", JSIConverter<Service>::toJSI(runtime, arg.service));
93
+ obj.setProperty(runtime, "service", JSIConverter<margelo::nitro::rncandle::Service>::toJSI(runtime, arg.service));
96
94
  return obj;
97
95
  }
98
96
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -102,14 +100,14 @@ namespace margelo::nitro {
102
100
  jsi::Object obj = value.getObject(runtime);
103
101
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
104
102
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "serviceAccountID"))) return false;
105
- if (!JSIConverter<FiatMarketAccountKind>::canConvert(runtime, obj.getProperty(runtime, "accountKind"))) return false;
103
+ if (!JSIConverter<margelo::nitro::rncandle::FiatMarketAccountKind>::canConvert(runtime, obj.getProperty(runtime, "accountKind"))) return false;
106
104
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "nickname"))) return false;
107
105
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "currencyCode"))) return false;
108
106
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "balance"))) return false;
109
- if (!JSIConverter<std::optional<ACHDetails>>::canConvert(runtime, obj.getProperty(runtime, "ach"))) return false;
110
- if (!JSIConverter<std::optional<WireDetails>>::canConvert(runtime, obj.getProperty(runtime, "wire"))) return false;
107
+ if (!JSIConverter<std::optional<margelo::nitro::rncandle::ACHDetails>>::canConvert(runtime, obj.getProperty(runtime, "ach"))) return false;
108
+ if (!JSIConverter<std::optional<margelo::nitro::rncandle::WireDetails>>::canConvert(runtime, obj.getProperty(runtime, "wire"))) return false;
111
109
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
112
- if (!JSIConverter<Service>::canConvert(runtime, obj.getProperty(runtime, "service"))) return false;
110
+ if (!JSIConverter<margelo::nitro::rncandle::Service>::canConvert(runtime, obj.getProperty(runtime, "service"))) return false;
113
111
  return true;
114
112
  }
115
113
  };
@@ -49,24 +49,22 @@ namespace margelo::nitro::rncandle {
49
49
 
50
50
  namespace margelo::nitro {
51
51
 
52
- using namespace margelo::nitro::rncandle;
53
-
54
52
  // C++ FiatAsset <> JS FiatAsset (object)
55
53
  template <>
56
- struct JSIConverter<FiatAsset> final {
57
- static inline FiatAsset fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
+ struct JSIConverter<margelo::nitro::rncandle::FiatAsset> final {
55
+ static inline margelo::nitro::rncandle::FiatAsset fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
58
56
  jsi::Object obj = arg.asObject(runtime);
59
- return FiatAsset(
57
+ return margelo::nitro::rncandle::FiatAsset(
60
58
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
61
59
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "serviceTradeID")),
62
60
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "serviceAccountID")),
63
61
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "currencyCode")),
64
62
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "amount")),
65
63
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID")),
66
- JSIConverter<Service>::fromJSI(runtime, obj.getProperty(runtime, "service"))
64
+ JSIConverter<margelo::nitro::rncandle::Service>::fromJSI(runtime, obj.getProperty(runtime, "service"))
67
65
  );
68
66
  }
69
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const FiatAsset& arg) {
67
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::FiatAsset& arg) {
70
68
  jsi::Object obj(runtime);
71
69
  obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
72
70
  obj.setProperty(runtime, "serviceTradeID", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.serviceTradeID));
@@ -74,7 +72,7 @@ namespace margelo::nitro {
74
72
  obj.setProperty(runtime, "currencyCode", JSIConverter<std::string>::toJSI(runtime, arg.currencyCode));
75
73
  obj.setProperty(runtime, "amount", JSIConverter<double>::toJSI(runtime, arg.amount));
76
74
  obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
77
- obj.setProperty(runtime, "service", JSIConverter<Service>::toJSI(runtime, arg.service));
75
+ obj.setProperty(runtime, "service", JSIConverter<margelo::nitro::rncandle::Service>::toJSI(runtime, arg.service));
78
76
  return obj;
79
77
  }
80
78
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -88,7 +86,7 @@ namespace margelo::nitro {
88
86
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "currencyCode"))) return false;
89
87
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "amount"))) return false;
90
88
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
91
- if (!JSIConverter<Service>::canConvert(runtime, obj.getProperty(runtime, "service"))) return false;
89
+ if (!JSIConverter<margelo::nitro::rncandle::Service>::canConvert(runtime, obj.getProperty(runtime, "service"))) return false;
92
90
  return true;
93
91
  }
94
92
  };
@@ -44,21 +44,19 @@ namespace margelo::nitro::rncandle {
44
44
 
45
45
  namespace margelo::nitro {
46
46
 
47
- using namespace margelo::nitro::rncandle;
48
-
49
47
  // C++ FiatAssetQuoteRequest <> JS FiatAssetQuoteRequest (object)
50
48
  template <>
51
- struct JSIConverter<FiatAssetQuoteRequest> final {
52
- static inline FiatAssetQuoteRequest fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ struct JSIConverter<margelo::nitro::rncandle::FiatAssetQuoteRequest> final {
50
+ static inline margelo::nitro::rncandle::FiatAssetQuoteRequest fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
51
  jsi::Object obj = arg.asObject(runtime);
54
- return FiatAssetQuoteRequest(
52
+ return margelo::nitro::rncandle::FiatAssetQuoteRequest(
55
53
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
56
54
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "serviceAccountID")),
57
55
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "currencyCode")),
58
56
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "amount"))
59
57
  );
60
58
  }
61
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const FiatAssetQuoteRequest& arg) {
59
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::FiatAssetQuoteRequest& arg) {
62
60
  jsi::Object obj(runtime);
63
61
  obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
64
62
  obj.setProperty(runtime, "serviceAccountID", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.serviceAccountID));
@@ -43,20 +43,18 @@ namespace margelo::nitro::rncandle {
43
43
 
44
44
  namespace margelo::nitro {
45
45
 
46
- using namespace margelo::nitro::rncandle;
47
-
48
46
  // C++ FiatAssetRef <> JS FiatAssetRef (object)
49
47
  template <>
50
- struct JSIConverter<FiatAssetRef> final {
51
- static inline FiatAssetRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
48
+ struct JSIConverter<margelo::nitro::rncandle::FiatAssetRef> final {
49
+ static inline margelo::nitro::rncandle::FiatAssetRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
52
50
  jsi::Object obj = arg.asObject(runtime);
53
- return FiatAssetRef(
51
+ return margelo::nitro::rncandle::FiatAssetRef(
54
52
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
55
53
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "serviceTradeID")),
56
54
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID"))
57
55
  );
58
56
  }
59
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const FiatAssetRef& arg) {
57
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::FiatAssetRef& arg) {
60
58
  jsi::Object obj(runtime);
61
59
  obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
62
60
  obj.setProperty(runtime, "serviceTradeID", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.serviceTradeID));