react-native-candle 0.1.18 → 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 (47) hide show
  1. package/ReactNativeCandle.podspec +1 -1
  2. package/ios/Sources/RNCandle.swift +271 -89
  3. package/lib/commonjs/index.js +73 -2
  4. package/lib/commonjs/index.js.map +1 -1
  5. package/lib/module/index.js +73 -2
  6. package/lib/module/index.js.map +1 -1
  7. package/lib/typescript/commonjs/src/index.d.ts +35 -14
  8. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  9. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +49 -2
  10. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts.map +1 -1
  11. package/lib/typescript/module/src/index.d.ts +35 -14
  12. package/lib/typescript/module/src/index.d.ts.map +1 -1
  13. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +49 -2
  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 +30 -0
  18. package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +58 -4
  19. package/nitrogen/generated/ios/swift/AssetAccountRef.swift +55 -0
  20. package/nitrogen/generated/ios/swift/ExecuteTradeRequest.swift +44 -0
  21. package/nitrogen/generated/ios/swift/FiatAssetRef.swift +75 -0
  22. package/nitrogen/generated/ios/swift/Func_void_AssetAccount.swift +44 -0
  23. package/nitrogen/generated/ios/swift/Func_void_LinkedAccount.swift +5 -5
  24. package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +5 -2
  25. package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +65 -5
  26. package/nitrogen/generated/ios/swift/LinkedAccountRef.swift +33 -0
  27. package/nitrogen/generated/ios/swift/MarketTradeAssetRef.swift +55 -0
  28. package/nitrogen/generated/ios/swift/NothingAssetRef.swift +33 -0
  29. package/nitrogen/generated/ios/swift/OtherAssetRef.swift +33 -0
  30. package/nitrogen/generated/ios/swift/TradeAssetRef.swift +176 -0
  31. package/nitrogen/generated/ios/swift/TradeRef.swift +44 -0
  32. package/nitrogen/generated/ios/swift/TransportAssetRef.swift +55 -0
  33. package/nitrogen/generated/shared/c++/AssetAccountRef.hpp +77 -0
  34. package/nitrogen/generated/shared/c++/ExecuteTradeRequest.hpp +73 -0
  35. package/nitrogen/generated/shared/c++/FiatAssetRef.hpp +78 -0
  36. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.cpp +4 -1
  37. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +17 -2
  38. package/nitrogen/generated/shared/c++/LinkedAccountRef.hpp +69 -0
  39. package/nitrogen/generated/shared/c++/MarketTradeAssetRef.hpp +77 -0
  40. package/nitrogen/generated/shared/c++/NothingAssetRef.hpp +69 -0
  41. package/nitrogen/generated/shared/c++/OtherAssetRef.hpp +69 -0
  42. package/nitrogen/generated/shared/c++/TradeAssetRef.hpp +99 -0
  43. package/nitrogen/generated/shared/c++/TradeRef.hpp +74 -0
  44. package/nitrogen/generated/shared/c++/TransportAssetRef.hpp +77 -0
  45. package/package.json +1 -1
  46. package/src/index.ts +131 -21
  47. package/src/specs/RNCandle.nitro.ts +59 -2
@@ -0,0 +1,55 @@
1
+ ///
2
+ /// TransportAssetRef.swift
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
+ import NitroModules
9
+
10
+ /// Represents an instance of `TransportAssetRef`, backed by a C++ struct.
11
+ public typealias TransportAssetRef = margelo.nitro.rncandle.TransportAssetRef
12
+
13
+ extension TransportAssetRef {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `TransportAssetRef`.
18
+ */
19
+ public init(assetKind: String, serviceTradeID: String, linkedAccountID: String) {
20
+ self.init(std.string(assetKind), std.string(serviceTradeID), std.string(linkedAccountID))
21
+ }
22
+
23
+ public var assetKind: String {
24
+ @inline(__always)
25
+ get {
26
+ return String(self.__assetKind)
27
+ }
28
+ @inline(__always)
29
+ set {
30
+ self.__assetKind = std.string(newValue)
31
+ }
32
+ }
33
+
34
+ public var serviceTradeID: String {
35
+ @inline(__always)
36
+ get {
37
+ return String(self.__serviceTradeID)
38
+ }
39
+ @inline(__always)
40
+ set {
41
+ self.__serviceTradeID = std.string(newValue)
42
+ }
43
+ }
44
+
45
+ public var linkedAccountID: String {
46
+ @inline(__always)
47
+ get {
48
+ return String(self.__linkedAccountID)
49
+ }
50
+ @inline(__always)
51
+ set {
52
+ self.__linkedAccountID = std.string(newValue)
53
+ }
54
+ }
55
+ }
@@ -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,73 @@
1
+ ///
2
+ /// ExecuteTradeRequest.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 (ExecuteTradeRequest).
29
+ */
30
+ struct ExecuteTradeRequest {
31
+ public:
32
+ std::string linkedAccountID SWIFT_PRIVATE;
33
+ std::string context SWIFT_PRIVATE;
34
+
35
+ public:
36
+ ExecuteTradeRequest() = default;
37
+ explicit ExecuteTradeRequest(std::string linkedAccountID, std::string context): linkedAccountID(linkedAccountID), context(context) {}
38
+ };
39
+
40
+ } // namespace margelo::nitro::rncandle
41
+
42
+ namespace margelo::nitro {
43
+
44
+ using namespace margelo::nitro::rncandle;
45
+
46
+ // C++ ExecuteTradeRequest <> JS ExecuteTradeRequest (object)
47
+ template <>
48
+ struct JSIConverter<ExecuteTradeRequest> final {
49
+ static inline ExecuteTradeRequest fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
+ jsi::Object obj = arg.asObject(runtime);
51
+ return ExecuteTradeRequest(
52
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID")),
53
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "context"))
54
+ );
55
+ }
56
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const ExecuteTradeRequest& arg) {
57
+ jsi::Object obj(runtime);
58
+ obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
59
+ obj.setProperty(runtime, "context", JSIConverter<std::string>::toJSI(runtime, arg.context));
60
+ return obj;
61
+ }
62
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
63
+ if (!value.isObject()) {
64
+ return false;
65
+ }
66
+ jsi::Object obj = value.getObject(runtime);
67
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
68
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "context"))) return false;
69
+ return true;
70
+ }
71
+ };
72
+
73
+ } // 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,11 +17,14 @@ 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
- prototype.registerHybridMethod("submitTrade", &HybridRNCandleSpec::submitTrade);
27
+ prototype.registerHybridMethod("executeTrade", &HybridRNCandleSpec::executeTrade);
25
28
  prototype.registerHybridMethod("deleteUser", &HybridRNCandleSpec::deleteUser);
26
29
  prototype.registerHybridMethod("getAvailableTools", &HybridRNCandleSpec::getAvailableTools);
27
30
  prototype.registerHybridMethod("executeTool", &HybridRNCandleSpec::executeTool);
@@ -23,18 +23,26 @@ 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.
37
43
  namespace margelo::nitro::rncandle { struct TradeQuoteRequest; }
44
+ // Forward declaration of `ExecuteTradeRequest` to properly resolve imports.
45
+ namespace margelo::nitro::rncandle { struct ExecuteTradeRequest; }
38
46
  // Forward declaration of `AnyMap` to properly resolve imports.
39
47
  namespace NitroModules { class AnyMap; }
40
48
  // Forward declaration of `ToolCall` to properly resolve imports.
@@ -50,12 +58,16 @@ namespace margelo::nitro::rncandle { struct ToolCall; }
50
58
  #include "LinkedAccount.hpp"
51
59
  #include "AppUser.hpp"
52
60
  #include <NitroModules/Promise.hpp>
61
+ #include "LinkedAccountRef.hpp"
53
62
  #include "AssetAccount.hpp"
54
63
  #include "AssetAccountQuery.hpp"
64
+ #include "AssetAccountRef.hpp"
55
65
  #include "Trade.hpp"
56
66
  #include "TradeQuery.hpp"
67
+ #include "TradeRef.hpp"
57
68
  #include "TradeQuote.hpp"
58
69
  #include "TradeQuoteRequest.hpp"
70
+ #include "ExecuteTradeRequest.hpp"
59
71
  #include <NitroModules/AnyMap.hpp>
60
72
  #include "ToolCall.hpp"
61
73
 
@@ -93,11 +105,14 @@ namespace margelo::nitro::rncandle {
93
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;
94
106
  virtual void initialize(const AppUser& appUser) = 0;
95
107
  virtual std::shared_ptr<Promise<std::vector<LinkedAccount>>> getLinkedAccounts() = 0;
96
- 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;
97
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;
98
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;
99
114
  virtual std::shared_ptr<Promise<std::vector<TradeQuote>>> getTradeQuotes(const TradeQuoteRequest& request) = 0;
100
- virtual std::shared_ptr<Promise<Trade>> submitTrade(const std::string& serviceTradeID) = 0;
115
+ virtual std::shared_ptr<Promise<Trade>> executeTrade(const ExecuteTradeRequest& request) = 0;
101
116
  virtual std::shared_ptr<Promise<void>> deleteUser() = 0;
102
117
  virtual std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>> getAvailableTools() = 0;
103
118
  virtual std::shared_ptr<Promise<std::string>> executeTool(const ToolCall& tool) = 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