react-native-candle 0.1.19 → 0.1.20

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 (45) hide show
  1. package/ReactNativeCandle.podspec +1 -1
  2. package/ios/Sources/RNCandle.swift +143 -54
  3. package/lib/commonjs/index.js +63 -2
  4. package/lib/commonjs/index.js.map +1 -1
  5. package/lib/module/index.js +63 -2
  6. package/lib/module/index.js.map +1 -1
  7. package/lib/typescript/commonjs/src/index.d.ts +27 -8
  8. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  9. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +44 -1
  10. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts.map +1 -1
  11. package/lib/typescript/module/src/index.d.ts +27 -8
  12. package/lib/typescript/module/src/index.d.ts.map +1 -1
  13. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +44 -1
  14. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts.map +1 -1
  15. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.cpp +16 -8
  16. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.hpp +167 -43
  17. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Umbrella.hpp +27 -0
  18. package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +53 -2
  19. package/nitrogen/generated/ios/swift/AssetAccountRef.swift +55 -0
  20. package/nitrogen/generated/ios/swift/FiatAssetRef.swift +75 -0
  21. package/nitrogen/generated/ios/swift/Func_void_AssetAccount.swift +44 -0
  22. package/nitrogen/generated/ios/swift/Func_void_LinkedAccount.swift +5 -5
  23. package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +4 -1
  24. package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +63 -3
  25. package/nitrogen/generated/ios/swift/LinkedAccountRef.swift +33 -0
  26. package/nitrogen/generated/ios/swift/MarketTradeAssetRef.swift +55 -0
  27. package/nitrogen/generated/ios/swift/NothingAssetRef.swift +33 -0
  28. package/nitrogen/generated/ios/swift/OtherAssetRef.swift +33 -0
  29. package/nitrogen/generated/ios/swift/TradeAssetRef.swift +176 -0
  30. package/nitrogen/generated/ios/swift/TradeRef.swift +44 -0
  31. package/nitrogen/generated/ios/swift/TransportAssetRef.swift +55 -0
  32. package/nitrogen/generated/shared/c++/AssetAccountRef.hpp +77 -0
  33. package/nitrogen/generated/shared/c++/FiatAssetRef.hpp +78 -0
  34. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.cpp +3 -0
  35. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +13 -1
  36. package/nitrogen/generated/shared/c++/LinkedAccountRef.hpp +69 -0
  37. package/nitrogen/generated/shared/c++/MarketTradeAssetRef.hpp +77 -0
  38. package/nitrogen/generated/shared/c++/NothingAssetRef.hpp +69 -0
  39. package/nitrogen/generated/shared/c++/OtherAssetRef.hpp +69 -0
  40. package/nitrogen/generated/shared/c++/TradeAssetRef.hpp +99 -0
  41. package/nitrogen/generated/shared/c++/TradeRef.hpp +74 -0
  42. package/nitrogen/generated/shared/c++/TransportAssetRef.hpp +77 -0
  43. package/package.json +1 -1
  44. package/src/index.ts +111 -13
  45. package/src/specs/RNCandle.nitro.ts +53 -1
@@ -0,0 +1,77 @@
1
+ ///
2
+ /// AssetAccountRef.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/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::rncandle {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (AssetAccountRef).
29
+ */
30
+ struct AssetAccountRef {
31
+ public:
32
+ std::string linkedAccountID SWIFT_PRIVATE;
33
+ std::string assetKind SWIFT_PRIVATE;
34
+ std::string serviceAccountID SWIFT_PRIVATE;
35
+
36
+ public:
37
+ AssetAccountRef() = default;
38
+ explicit AssetAccountRef(std::string linkedAccountID, std::string assetKind, std::string serviceAccountID): linkedAccountID(linkedAccountID), assetKind(assetKind), serviceAccountID(serviceAccountID) {}
39
+ };
40
+
41
+ } // namespace margelo::nitro::rncandle
42
+
43
+ namespace margelo::nitro {
44
+
45
+ using namespace margelo::nitro::rncandle;
46
+
47
+ // C++ AssetAccountRef <> JS AssetAccountRef (object)
48
+ template <>
49
+ struct JSIConverter<AssetAccountRef> final {
50
+ static inline AssetAccountRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
51
+ jsi::Object obj = arg.asObject(runtime);
52
+ return AssetAccountRef(
53
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID")),
54
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
55
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "serviceAccountID"))
56
+ );
57
+ }
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const AssetAccountRef& arg) {
59
+ jsi::Object obj(runtime);
60
+ obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
61
+ obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
62
+ obj.setProperty(runtime, "serviceAccountID", JSIConverter<std::string>::toJSI(runtime, arg.serviceAccountID));
63
+ return obj;
64
+ }
65
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
66
+ if (!value.isObject()) {
67
+ return false;
68
+ }
69
+ jsi::Object obj = value.getObject(runtime);
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;
72
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "serviceAccountID"))) return false;
73
+ return true;
74
+ }
75
+ };
76
+
77
+ } // namespace margelo::nitro
@@ -0,0 +1,78 @@
1
+ ///
2
+ /// FiatAssetRef.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/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+ #include <optional>
25
+
26
+ namespace margelo::nitro::rncandle {
27
+
28
+ /**
29
+ * A struct which can be represented as a JavaScript object (FiatAssetRef).
30
+ */
31
+ struct FiatAssetRef {
32
+ public:
33
+ std::string assetKind SWIFT_PRIVATE;
34
+ std::optional<std::string> serviceTradeID SWIFT_PRIVATE;
35
+ std::string linkedAccountID SWIFT_PRIVATE;
36
+
37
+ public:
38
+ FiatAssetRef() = default;
39
+ explicit FiatAssetRef(std::string assetKind, std::optional<std::string> serviceTradeID, std::string linkedAccountID): assetKind(assetKind), serviceTradeID(serviceTradeID), linkedAccountID(linkedAccountID) {}
40
+ };
41
+
42
+ } // namespace margelo::nitro::rncandle
43
+
44
+ namespace margelo::nitro {
45
+
46
+ using namespace margelo::nitro::rncandle;
47
+
48
+ // C++ FiatAssetRef <> JS FiatAssetRef (object)
49
+ template <>
50
+ struct JSIConverter<FiatAssetRef> final {
51
+ static inline FiatAssetRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
52
+ jsi::Object obj = arg.asObject(runtime);
53
+ return FiatAssetRef(
54
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
55
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "serviceTradeID")),
56
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID"))
57
+ );
58
+ }
59
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const FiatAssetRef& arg) {
60
+ jsi::Object obj(runtime);
61
+ obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
62
+ obj.setProperty(runtime, "serviceTradeID", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.serviceTradeID));
63
+ obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
64
+ return obj;
65
+ }
66
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
67
+ if (!value.isObject()) {
68
+ return false;
69
+ }
70
+ jsi::Object obj = value.getObject(runtime);
71
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
72
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "serviceTradeID"))) return false;
73
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
74
+ return true;
75
+ }
76
+ };
77
+
78
+ } // namespace margelo::nitro
@@ -17,9 +17,12 @@ namespace margelo::nitro::rncandle {
17
17
  prototype.registerHybridMethod("candleLinkSheet", &HybridRNCandleSpec::candleLinkSheet);
18
18
  prototype.registerHybridMethod("initialize", &HybridRNCandleSpec::initialize);
19
19
  prototype.registerHybridMethod("getLinkedAccounts", &HybridRNCandleSpec::getLinkedAccounts);
20
+ prototype.registerHybridMethod("getLinkedAccount", &HybridRNCandleSpec::getLinkedAccount);
20
21
  prototype.registerHybridMethod("unlinkAccount", &HybridRNCandleSpec::unlinkAccount);
21
22
  prototype.registerHybridMethod("getAssetAccounts", &HybridRNCandleSpec::getAssetAccounts);
23
+ prototype.registerHybridMethod("getAssetAccount", &HybridRNCandleSpec::getAssetAccount);
22
24
  prototype.registerHybridMethod("getTrades", &HybridRNCandleSpec::getTrades);
25
+ prototype.registerHybridMethod("getTrade", &HybridRNCandleSpec::getTrade);
23
26
  prototype.registerHybridMethod("getTradeQuotes", &HybridRNCandleSpec::getTradeQuotes);
24
27
  prototype.registerHybridMethod("executeTrade", &HybridRNCandleSpec::executeTrade);
25
28
  prototype.registerHybridMethod("deleteUser", &HybridRNCandleSpec::deleteUser);
@@ -23,14 +23,20 @@ namespace margelo::nitro::rncandle { enum class PresentationStyle; }
23
23
  namespace margelo::nitro::rncandle { struct LinkedAccount; }
24
24
  // Forward declaration of `AppUser` to properly resolve imports.
25
25
  namespace margelo::nitro::rncandle { struct AppUser; }
26
+ // Forward declaration of `LinkedAccountRef` to properly resolve imports.
27
+ namespace margelo::nitro::rncandle { struct LinkedAccountRef; }
26
28
  // Forward declaration of `AssetAccount` to properly resolve imports.
27
29
  namespace margelo::nitro::rncandle { struct AssetAccount; }
28
30
  // Forward declaration of `AssetAccountQuery` to properly resolve imports.
29
31
  namespace margelo::nitro::rncandle { struct AssetAccountQuery; }
32
+ // Forward declaration of `AssetAccountRef` to properly resolve imports.
33
+ namespace margelo::nitro::rncandle { struct AssetAccountRef; }
30
34
  // Forward declaration of `Trade` to properly resolve imports.
31
35
  namespace margelo::nitro::rncandle { struct Trade; }
32
36
  // Forward declaration of `TradeQuery` to properly resolve imports.
33
37
  namespace margelo::nitro::rncandle { struct TradeQuery; }
38
+ // Forward declaration of `TradeRef` to properly resolve imports.
39
+ namespace margelo::nitro::rncandle { struct TradeRef; }
34
40
  // Forward declaration of `TradeQuote` to properly resolve imports.
35
41
  namespace margelo::nitro::rncandle { struct TradeQuote; }
36
42
  // Forward declaration of `TradeQuoteRequest` to properly resolve imports.
@@ -52,10 +58,13 @@ namespace margelo::nitro::rncandle { struct ToolCall; }
52
58
  #include "LinkedAccount.hpp"
53
59
  #include "AppUser.hpp"
54
60
  #include <NitroModules/Promise.hpp>
61
+ #include "LinkedAccountRef.hpp"
55
62
  #include "AssetAccount.hpp"
56
63
  #include "AssetAccountQuery.hpp"
64
+ #include "AssetAccountRef.hpp"
57
65
  #include "Trade.hpp"
58
66
  #include "TradeQuery.hpp"
67
+ #include "TradeRef.hpp"
59
68
  #include "TradeQuote.hpp"
60
69
  #include "TradeQuoteRequest.hpp"
61
70
  #include "ExecuteTradeRequest.hpp"
@@ -96,9 +105,12 @@ namespace margelo::nitro::rncandle {
96
105
  virtual void candleLinkSheet(bool isPresented, const std::optional<std::vector<Service>>& services, double cornerRadius, const std::optional<std::string>& customerName, bool showDynamicLoading, PresentationBackground presentationBackground, PresentationStyle presentationStyle, const std::function<void(const LinkedAccount& /* account */)>& onSuccess) = 0;
97
106
  virtual void initialize(const AppUser& appUser) = 0;
98
107
  virtual std::shared_ptr<Promise<std::vector<LinkedAccount>>> getLinkedAccounts() = 0;
99
- virtual std::shared_ptr<Promise<void>> unlinkAccount(const std::string& linkedAccountID) = 0;
108
+ virtual std::shared_ptr<Promise<LinkedAccount>> getLinkedAccount(const LinkedAccountRef& ref) = 0;
109
+ virtual std::shared_ptr<Promise<void>> unlinkAccount(const LinkedAccountRef& ref) = 0;
100
110
  virtual std::shared_ptr<Promise<std::vector<AssetAccount>>> getAssetAccounts(const AssetAccountQuery& query) = 0;
111
+ virtual std::shared_ptr<Promise<AssetAccount>> getAssetAccount(const AssetAccountRef& ref) = 0;
101
112
  virtual std::shared_ptr<Promise<std::vector<Trade>>> getTrades(const TradeQuery& query) = 0;
113
+ virtual std::shared_ptr<Promise<Trade>> getTrade(const TradeRef& ref) = 0;
102
114
  virtual std::shared_ptr<Promise<std::vector<TradeQuote>>> getTradeQuotes(const TradeQuoteRequest& request) = 0;
103
115
  virtual std::shared_ptr<Promise<Trade>> executeTrade(const ExecuteTradeRequest& request) = 0;
104
116
  virtual std::shared_ptr<Promise<void>> deleteUser() = 0;
@@ -0,0 +1,69 @@
1
+ ///
2
+ /// LinkedAccountRef.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/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::rncandle {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (LinkedAccountRef).
29
+ */
30
+ struct LinkedAccountRef {
31
+ public:
32
+ std::string linkedAccountID SWIFT_PRIVATE;
33
+
34
+ public:
35
+ LinkedAccountRef() = default;
36
+ explicit LinkedAccountRef(std::string linkedAccountID): linkedAccountID(linkedAccountID) {}
37
+ };
38
+
39
+ } // namespace margelo::nitro::rncandle
40
+
41
+ namespace margelo::nitro {
42
+
43
+ using namespace margelo::nitro::rncandle;
44
+
45
+ // C++ LinkedAccountRef <> JS LinkedAccountRef (object)
46
+ template <>
47
+ struct JSIConverter<LinkedAccountRef> final {
48
+ static inline LinkedAccountRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ jsi::Object obj = arg.asObject(runtime);
50
+ return LinkedAccountRef(
51
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID"))
52
+ );
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const LinkedAccountRef& arg) {
55
+ jsi::Object obj(runtime);
56
+ obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
57
+ return obj;
58
+ }
59
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
60
+ if (!value.isObject()) {
61
+ return false;
62
+ }
63
+ jsi::Object obj = value.getObject(runtime);
64
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
65
+ return true;
66
+ }
67
+ };
68
+
69
+ } // namespace margelo::nitro
@@ -0,0 +1,77 @@
1
+ ///
2
+ /// MarketTradeAssetRef.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/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::rncandle {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (MarketTradeAssetRef).
29
+ */
30
+ struct MarketTradeAssetRef {
31
+ public:
32
+ std::string assetKind SWIFT_PRIVATE;
33
+ std::string serviceTradeID SWIFT_PRIVATE;
34
+ std::string linkedAccountID SWIFT_PRIVATE;
35
+
36
+ public:
37
+ MarketTradeAssetRef() = default;
38
+ explicit MarketTradeAssetRef(std::string assetKind, std::string serviceTradeID, std::string linkedAccountID): assetKind(assetKind), serviceTradeID(serviceTradeID), linkedAccountID(linkedAccountID) {}
39
+ };
40
+
41
+ } // namespace margelo::nitro::rncandle
42
+
43
+ namespace margelo::nitro {
44
+
45
+ using namespace margelo::nitro::rncandle;
46
+
47
+ // C++ MarketTradeAssetRef <> JS MarketTradeAssetRef (object)
48
+ template <>
49
+ struct JSIConverter<MarketTradeAssetRef> final {
50
+ static inline MarketTradeAssetRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
51
+ jsi::Object obj = arg.asObject(runtime);
52
+ return MarketTradeAssetRef(
53
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
54
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "serviceTradeID")),
55
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID"))
56
+ );
57
+ }
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const MarketTradeAssetRef& arg) {
59
+ jsi::Object obj(runtime);
60
+ obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
61
+ obj.setProperty(runtime, "serviceTradeID", JSIConverter<std::string>::toJSI(runtime, arg.serviceTradeID));
62
+ obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
63
+ return obj;
64
+ }
65
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
66
+ if (!value.isObject()) {
67
+ return false;
68
+ }
69
+ jsi::Object obj = value.getObject(runtime);
70
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
71
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "serviceTradeID"))) return false;
72
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
73
+ return true;
74
+ }
75
+ };
76
+
77
+ } // namespace margelo::nitro
@@ -0,0 +1,69 @@
1
+ ///
2
+ /// NothingAssetRef.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/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::rncandle {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (NothingAssetRef).
29
+ */
30
+ struct NothingAssetRef {
31
+ public:
32
+ std::string assetKind SWIFT_PRIVATE;
33
+
34
+ public:
35
+ NothingAssetRef() = default;
36
+ explicit NothingAssetRef(std::string assetKind): assetKind(assetKind) {}
37
+ };
38
+
39
+ } // namespace margelo::nitro::rncandle
40
+
41
+ namespace margelo::nitro {
42
+
43
+ using namespace margelo::nitro::rncandle;
44
+
45
+ // C++ NothingAssetRef <> JS NothingAssetRef (object)
46
+ template <>
47
+ struct JSIConverter<NothingAssetRef> final {
48
+ static inline NothingAssetRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ jsi::Object obj = arg.asObject(runtime);
50
+ return NothingAssetRef(
51
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind"))
52
+ );
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const NothingAssetRef& arg) {
55
+ jsi::Object obj(runtime);
56
+ obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
57
+ return obj;
58
+ }
59
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
60
+ if (!value.isObject()) {
61
+ return false;
62
+ }
63
+ jsi::Object obj = value.getObject(runtime);
64
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
65
+ return true;
66
+ }
67
+ };
68
+
69
+ } // namespace margelo::nitro
@@ -0,0 +1,69 @@
1
+ ///
2
+ /// OtherAssetRef.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/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::rncandle {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (OtherAssetRef).
29
+ */
30
+ struct OtherAssetRef {
31
+ public:
32
+ std::string assetKind SWIFT_PRIVATE;
33
+
34
+ public:
35
+ OtherAssetRef() = default;
36
+ explicit OtherAssetRef(std::string assetKind): assetKind(assetKind) {}
37
+ };
38
+
39
+ } // namespace margelo::nitro::rncandle
40
+
41
+ namespace margelo::nitro {
42
+
43
+ using namespace margelo::nitro::rncandle;
44
+
45
+ // C++ OtherAssetRef <> JS OtherAssetRef (object)
46
+ template <>
47
+ struct JSIConverter<OtherAssetRef> final {
48
+ static inline OtherAssetRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ jsi::Object obj = arg.asObject(runtime);
50
+ return OtherAssetRef(
51
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind"))
52
+ );
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const OtherAssetRef& arg) {
55
+ jsi::Object obj(runtime);
56
+ obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
57
+ return obj;
58
+ }
59
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
60
+ if (!value.isObject()) {
61
+ return false;
62
+ }
63
+ jsi::Object obj = value.getObject(runtime);
64
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
65
+ return true;
66
+ }
67
+ };
68
+
69
+ } // namespace margelo::nitro
@@ -0,0 +1,99 @@
1
+ ///
2
+ /// TradeAssetRef.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/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+ // Forward declaration of `FiatAssetRef` to properly resolve imports.
22
+ namespace margelo::nitro::rncandle { struct FiatAssetRef; }
23
+ // Forward declaration of `MarketTradeAssetRef` to properly resolve imports.
24
+ namespace margelo::nitro::rncandle { struct MarketTradeAssetRef; }
25
+ // Forward declaration of `TransportAssetRef` to properly resolve imports.
26
+ namespace margelo::nitro::rncandle { struct TransportAssetRef; }
27
+ // Forward declaration of `OtherAssetRef` to properly resolve imports.
28
+ namespace margelo::nitro::rncandle { struct OtherAssetRef; }
29
+ // Forward declaration of `NothingAssetRef` to properly resolve imports.
30
+ namespace margelo::nitro::rncandle { struct NothingAssetRef; }
31
+
32
+ #include <optional>
33
+ #include "FiatAssetRef.hpp"
34
+ #include "MarketTradeAssetRef.hpp"
35
+ #include "TransportAssetRef.hpp"
36
+ #include "OtherAssetRef.hpp"
37
+ #include "NothingAssetRef.hpp"
38
+
39
+ namespace margelo::nitro::rncandle {
40
+
41
+ /**
42
+ * A struct which can be represented as a JavaScript object (TradeAssetRef).
43
+ */
44
+ struct TradeAssetRef {
45
+ public:
46
+ std::optional<FiatAssetRef> fiatAssetRef SWIFT_PRIVATE;
47
+ std::optional<MarketTradeAssetRef> marketTradeAssetRef SWIFT_PRIVATE;
48
+ std::optional<TransportAssetRef> transportAssetRef SWIFT_PRIVATE;
49
+ std::optional<OtherAssetRef> otherAssetRef SWIFT_PRIVATE;
50
+ std::optional<NothingAssetRef> nothingAssetRef SWIFT_PRIVATE;
51
+
52
+ public:
53
+ TradeAssetRef() = default;
54
+ explicit TradeAssetRef(std::optional<FiatAssetRef> fiatAssetRef, std::optional<MarketTradeAssetRef> marketTradeAssetRef, std::optional<TransportAssetRef> transportAssetRef, std::optional<OtherAssetRef> otherAssetRef, std::optional<NothingAssetRef> nothingAssetRef): fiatAssetRef(fiatAssetRef), marketTradeAssetRef(marketTradeAssetRef), transportAssetRef(transportAssetRef), otherAssetRef(otherAssetRef), nothingAssetRef(nothingAssetRef) {}
55
+ };
56
+
57
+ } // namespace margelo::nitro::rncandle
58
+
59
+ namespace margelo::nitro {
60
+
61
+ using namespace margelo::nitro::rncandle;
62
+
63
+ // C++ TradeAssetRef <> JS TradeAssetRef (object)
64
+ template <>
65
+ struct JSIConverter<TradeAssetRef> final {
66
+ static inline TradeAssetRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
67
+ jsi::Object obj = arg.asObject(runtime);
68
+ return TradeAssetRef(
69
+ JSIConverter<std::optional<FiatAssetRef>>::fromJSI(runtime, obj.getProperty(runtime, "fiatAssetRef")),
70
+ JSIConverter<std::optional<MarketTradeAssetRef>>::fromJSI(runtime, obj.getProperty(runtime, "marketTradeAssetRef")),
71
+ JSIConverter<std::optional<TransportAssetRef>>::fromJSI(runtime, obj.getProperty(runtime, "transportAssetRef")),
72
+ JSIConverter<std::optional<OtherAssetRef>>::fromJSI(runtime, obj.getProperty(runtime, "otherAssetRef")),
73
+ JSIConverter<std::optional<NothingAssetRef>>::fromJSI(runtime, obj.getProperty(runtime, "nothingAssetRef"))
74
+ );
75
+ }
76
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const TradeAssetRef& arg) {
77
+ jsi::Object obj(runtime);
78
+ obj.setProperty(runtime, "fiatAssetRef", JSIConverter<std::optional<FiatAssetRef>>::toJSI(runtime, arg.fiatAssetRef));
79
+ obj.setProperty(runtime, "marketTradeAssetRef", JSIConverter<std::optional<MarketTradeAssetRef>>::toJSI(runtime, arg.marketTradeAssetRef));
80
+ obj.setProperty(runtime, "transportAssetRef", JSIConverter<std::optional<TransportAssetRef>>::toJSI(runtime, arg.transportAssetRef));
81
+ obj.setProperty(runtime, "otherAssetRef", JSIConverter<std::optional<OtherAssetRef>>::toJSI(runtime, arg.otherAssetRef));
82
+ obj.setProperty(runtime, "nothingAssetRef", JSIConverter<std::optional<NothingAssetRef>>::toJSI(runtime, arg.nothingAssetRef));
83
+ return obj;
84
+ }
85
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
86
+ if (!value.isObject()) {
87
+ return false;
88
+ }
89
+ jsi::Object obj = value.getObject(runtime);
90
+ if (!JSIConverter<std::optional<FiatAssetRef>>::canConvert(runtime, obj.getProperty(runtime, "fiatAssetRef"))) return false;
91
+ if (!JSIConverter<std::optional<MarketTradeAssetRef>>::canConvert(runtime, obj.getProperty(runtime, "marketTradeAssetRef"))) return false;
92
+ if (!JSIConverter<std::optional<TransportAssetRef>>::canConvert(runtime, obj.getProperty(runtime, "transportAssetRef"))) return false;
93
+ if (!JSIConverter<std::optional<OtherAssetRef>>::canConvert(runtime, obj.getProperty(runtime, "otherAssetRef"))) return false;
94
+ if (!JSIConverter<std::optional<NothingAssetRef>>::canConvert(runtime, obj.getProperty(runtime, "nothingAssetRef"))) return false;
95
+ return true;
96
+ }
97
+ };
98
+
99
+ } // namespace margelo::nitro