react-native-candle 0.1.16 → 0.1.18

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 (105) hide show
  1. package/ReactNativeCandle.podspec +1 -1
  2. package/ios/Sources/CandleLinkSheetWrapperView.swift +2 -167
  3. package/ios/Sources/RNCandle.swift +558 -47
  4. package/lib/commonjs/index.js +157 -1
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/module/index.js +157 -1
  7. package/lib/module/index.js.map +1 -1
  8. package/lib/typescript/commonjs/src/index.d.ts +79 -3
  9. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  10. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +197 -9
  11. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts.map +1 -1
  12. package/lib/typescript/module/src/index.d.ts +79 -3
  13. package/lib/typescript/module/src/index.d.ts.map +1 -1
  14. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +197 -9
  15. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts.map +1 -1
  16. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.cpp +36 -4
  17. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.hpp +528 -35
  18. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Umbrella.hpp +108 -6
  19. package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +122 -12
  20. package/nitrogen/generated/ios/swift/ACHAccountKind.swift +38 -0
  21. package/nitrogen/generated/ios/swift/ACHDetails.swift +55 -0
  22. package/nitrogen/generated/ios/swift/{Details.swift → ActiveLinkedAccountDetails.swift} +55 -22
  23. package/nitrogen/generated/ios/swift/Address.swift +33 -0
  24. package/nitrogen/generated/ios/swift/AssetAccount.swift +55 -0
  25. package/nitrogen/generated/ios/swift/AssetAccountDetails.swift +83 -0
  26. package/nitrogen/generated/ios/swift/AssetAccountKind.swift +42 -0
  27. package/nitrogen/generated/ios/swift/AssetAccountQuery.swift +76 -0
  28. package/nitrogen/generated/ios/swift/Coordinates.swift +44 -0
  29. package/nitrogen/generated/ios/swift/Counterparty.swift +115 -0
  30. package/nitrogen/generated/ios/swift/FiatAccountDetails.swift +165 -0
  31. package/nitrogen/generated/ios/swift/FiatAsset.swift +123 -0
  32. package/nitrogen/generated/ios/swift/FiatAssetQuoteRequest.swift +119 -0
  33. package/nitrogen/generated/ios/swift/Func_void_Trade.swift +44 -0
  34. package/nitrogen/generated/ios/swift/Func_void_std__vector_AssetAccount_.swift +46 -0
  35. package/nitrogen/generated/ios/swift/Func_void_std__vector_TradeQuote_.swift +46 -0
  36. package/nitrogen/generated/ios/swift/Func_void_std__vector_Trade_.swift +45 -0
  37. package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +4 -3
  38. package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +79 -40
  39. package/nitrogen/generated/ios/swift/InactiveLinkedAccountDetails.swift +33 -0
  40. package/nitrogen/generated/ios/swift/LegalAccountKind.swift +46 -0
  41. package/nitrogen/generated/ios/swift/LinkedAccount.swift +16 -34
  42. package/nitrogen/generated/ios/swift/LinkedAccountDetails.swift +87 -0
  43. package/nitrogen/generated/ios/swift/MarketAccountDetails.swift +69 -0
  44. package/nitrogen/generated/ios/swift/MarketAssetQuoteRequest.swift +151 -0
  45. package/nitrogen/generated/ios/swift/MarketTradeAsset.swift +150 -0
  46. package/nitrogen/generated/ios/swift/MerchantCounterparty.swift +86 -0
  47. package/nitrogen/generated/ios/swift/MerchantLocation.swift +55 -0
  48. package/nitrogen/generated/ios/swift/NothingAsset.swift +33 -0
  49. package/nitrogen/generated/ios/swift/NothingAssetQuoteRequest.swift +33 -0
  50. package/nitrogen/generated/ios/swift/OtherAsset.swift +33 -0
  51. package/nitrogen/generated/ios/swift/ServiceCounterparty.swift +44 -0
  52. package/nitrogen/generated/ios/swift/Trade.swift +80 -0
  53. package/nitrogen/generated/ios/swift/TradeAsset.swift +175 -0
  54. package/nitrogen/generated/ios/swift/TradeAssetQuoteRequest.swift +148 -0
  55. package/nitrogen/generated/ios/swift/TradeQuery.swift +175 -0
  56. package/nitrogen/generated/ios/swift/TradeQuote.swift +44 -0
  57. package/nitrogen/generated/ios/swift/TradeQuoteRequest.swift +63 -0
  58. package/nitrogen/generated/ios/swift/TradeState.swift +42 -0
  59. package/nitrogen/generated/ios/swift/TransportAsset.swift +174 -0
  60. package/nitrogen/generated/ios/swift/TransportAssetQuoteRequest.swift +212 -0
  61. package/nitrogen/generated/ios/swift/UserCounterparty.swift +66 -0
  62. package/nitrogen/generated/ios/swift/WireDetails.swift +44 -0
  63. package/nitrogen/generated/shared/c++/{State.hpp → ACHAccountKind.hpp} +17 -17
  64. package/nitrogen/generated/shared/c++/ACHDetails.hpp +79 -0
  65. package/nitrogen/generated/shared/c++/{Details.hpp → ActiveLinkedAccountDetails.hpp} +25 -23
  66. package/nitrogen/generated/shared/c++/Address.hpp +69 -0
  67. package/nitrogen/generated/shared/c++/AssetAccount.hpp +82 -0
  68. package/nitrogen/generated/shared/c++/AssetAccountDetails.hpp +78 -0
  69. package/nitrogen/generated/shared/c++/AssetAccountKind.hpp +82 -0
  70. package/nitrogen/generated/shared/c++/AssetAccountQuery.hpp +76 -0
  71. package/nitrogen/generated/shared/c++/Coordinates.hpp +73 -0
  72. package/nitrogen/generated/shared/c++/Counterparty.hpp +85 -0
  73. package/nitrogen/generated/shared/c++/FiatAccountDetails.hpp +106 -0
  74. package/nitrogen/generated/shared/c++/FiatAsset.hpp +96 -0
  75. package/nitrogen/generated/shared/c++/FiatAssetQuoteRequest.hpp +82 -0
  76. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.cpp +1 -0
  77. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +22 -3
  78. package/nitrogen/generated/shared/c++/InactiveLinkedAccountDetails.hpp +69 -0
  79. package/nitrogen/generated/shared/c++/LegalAccountKind.hpp +86 -0
  80. package/nitrogen/generated/shared/c++/LinkedAccount.hpp +13 -14
  81. package/nitrogen/generated/shared/c++/LinkedAccountDetails.hpp +78 -0
  82. package/nitrogen/generated/shared/c++/MarketAccountDetails.hpp +83 -0
  83. package/nitrogen/generated/shared/c++/MarketAssetQuoteRequest.hpp +86 -0
  84. package/nitrogen/generated/shared/c++/MarketTradeAsset.hpp +111 -0
  85. package/nitrogen/generated/shared/c++/MerchantCounterparty.hpp +84 -0
  86. package/nitrogen/generated/shared/c++/MerchantLocation.hpp +77 -0
  87. package/nitrogen/generated/shared/c++/NothingAsset.hpp +69 -0
  88. package/nitrogen/generated/shared/c++/NothingAssetQuoteRequest.hpp +69 -0
  89. package/nitrogen/generated/shared/c++/OtherAsset.hpp +69 -0
  90. package/nitrogen/generated/shared/c++/ServiceCounterparty.hpp +75 -0
  91. package/nitrogen/generated/shared/c++/Trade.hpp +93 -0
  92. package/nitrogen/generated/shared/c++/TradeAsset.hpp +99 -0
  93. package/nitrogen/generated/shared/c++/TradeAssetQuoteRequest.hpp +92 -0
  94. package/nitrogen/generated/shared/c++/TradeQuery.hpp +86 -0
  95. package/nitrogen/generated/shared/c++/TradeQuote.hpp +74 -0
  96. package/nitrogen/generated/shared/c++/TradeQuoteRequest.hpp +76 -0
  97. package/nitrogen/generated/shared/c++/TradeState.hpp +82 -0
  98. package/nitrogen/generated/shared/c++/TransportAsset.hpp +125 -0
  99. package/nitrogen/generated/shared/c++/TransportAssetQuoteRequest.hpp +99 -0
  100. package/nitrogen/generated/shared/c++/UserCounterparty.hpp +81 -0
  101. package/nitrogen/generated/shared/c++/WireDetails.hpp +73 -0
  102. package/package.json +1 -1
  103. package/src/index.ts +259 -3
  104. package/src/specs/RNCandle.nitro.ts +237 -10
  105. package/nitrogen/generated/ios/swift/State.swift +0 -38
@@ -0,0 +1,85 @@
1
+ ///
2
+ /// Counterparty.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 `MerchantCounterparty` to properly resolve imports.
22
+ namespace margelo::nitro::rncandle { struct MerchantCounterparty; }
23
+ // Forward declaration of `UserCounterparty` to properly resolve imports.
24
+ namespace margelo::nitro::rncandle { struct UserCounterparty; }
25
+ // Forward declaration of `ServiceCounterparty` to properly resolve imports.
26
+ namespace margelo::nitro::rncandle { struct ServiceCounterparty; }
27
+
28
+ #include <optional>
29
+ #include "MerchantCounterparty.hpp"
30
+ #include "UserCounterparty.hpp"
31
+ #include "ServiceCounterparty.hpp"
32
+
33
+ namespace margelo::nitro::rncandle {
34
+
35
+ /**
36
+ * A struct which can be represented as a JavaScript object (Counterparty).
37
+ */
38
+ struct Counterparty {
39
+ public:
40
+ std::optional<MerchantCounterparty> merchantCounterparty SWIFT_PRIVATE;
41
+ std::optional<UserCounterparty> userCounterparty SWIFT_PRIVATE;
42
+ std::optional<ServiceCounterparty> serviceCounterparty SWIFT_PRIVATE;
43
+
44
+ public:
45
+ Counterparty() = default;
46
+ explicit Counterparty(std::optional<MerchantCounterparty> merchantCounterparty, std::optional<UserCounterparty> userCounterparty, std::optional<ServiceCounterparty> serviceCounterparty): merchantCounterparty(merchantCounterparty), userCounterparty(userCounterparty), serviceCounterparty(serviceCounterparty) {}
47
+ };
48
+
49
+ } // namespace margelo::nitro::rncandle
50
+
51
+ namespace margelo::nitro {
52
+
53
+ using namespace margelo::nitro::rncandle;
54
+
55
+ // C++ Counterparty <> JS Counterparty (object)
56
+ template <>
57
+ struct JSIConverter<Counterparty> final {
58
+ static inline Counterparty fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
59
+ 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"))
64
+ );
65
+ }
66
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const Counterparty& arg) {
67
+ 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));
71
+ return obj;
72
+ }
73
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
74
+ if (!value.isObject()) {
75
+ return false;
76
+ }
77
+ 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;
81
+ return true;
82
+ }
83
+ };
84
+
85
+ } // namespace margelo::nitro
@@ -0,0 +1,106 @@
1
+ ///
2
+ /// FiatAccountDetails.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 `ACHDetails` to properly resolve imports.
22
+ namespace margelo::nitro::rncandle { struct ACHDetails; }
23
+ // Forward declaration of `WireDetails` to properly resolve imports.
24
+ namespace margelo::nitro::rncandle { struct WireDetails; }
25
+ // Forward declaration of `Service` to properly resolve imports.
26
+ namespace margelo::nitro::rncandle { enum class Service; }
27
+
28
+ #include <string>
29
+ #include <optional>
30
+ #include "ACHDetails.hpp"
31
+ #include "WireDetails.hpp"
32
+ #include "Service.hpp"
33
+
34
+ namespace margelo::nitro::rncandle {
35
+
36
+ /**
37
+ * A struct which can be represented as a JavaScript object (FiatAccountDetails).
38
+ */
39
+ struct FiatAccountDetails {
40
+ public:
41
+ std::string assetKind SWIFT_PRIVATE;
42
+ std::string serviceAccountID SWIFT_PRIVATE;
43
+ std::string currencyCode SWIFT_PRIVATE;
44
+ std::optional<double> balance SWIFT_PRIVATE;
45
+ std::optional<ACHDetails> ach SWIFT_PRIVATE;
46
+ std::optional<WireDetails> wire SWIFT_PRIVATE;
47
+ std::string linkedAccountID SWIFT_PRIVATE;
48
+ Service service SWIFT_PRIVATE;
49
+
50
+ public:
51
+ FiatAccountDetails() = default;
52
+ explicit FiatAccountDetails(std::string assetKind, std::string serviceAccountID, std::string currencyCode, std::optional<double> balance, std::optional<ACHDetails> ach, std::optional<WireDetails> wire, std::string linkedAccountID, Service service): assetKind(assetKind), serviceAccountID(serviceAccountID), currencyCode(currencyCode), balance(balance), ach(ach), wire(wire), linkedAccountID(linkedAccountID), service(service) {}
53
+ };
54
+
55
+ } // namespace margelo::nitro::rncandle
56
+
57
+ namespace margelo::nitro {
58
+
59
+ using namespace margelo::nitro::rncandle;
60
+
61
+ // C++ FiatAccountDetails <> JS FiatAccountDetails (object)
62
+ template <>
63
+ struct JSIConverter<FiatAccountDetails> final {
64
+ static inline FiatAccountDetails fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
65
+ jsi::Object obj = arg.asObject(runtime);
66
+ return FiatAccountDetails(
67
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
68
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "serviceAccountID")),
69
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "currencyCode")),
70
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "balance")),
71
+ JSIConverter<std::optional<ACHDetails>>::fromJSI(runtime, obj.getProperty(runtime, "ach")),
72
+ JSIConverter<std::optional<WireDetails>>::fromJSI(runtime, obj.getProperty(runtime, "wire")),
73
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID")),
74
+ JSIConverter<Service>::fromJSI(runtime, obj.getProperty(runtime, "service"))
75
+ );
76
+ }
77
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const FiatAccountDetails& arg) {
78
+ jsi::Object obj(runtime);
79
+ obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
80
+ obj.setProperty(runtime, "serviceAccountID", JSIConverter<std::string>::toJSI(runtime, arg.serviceAccountID));
81
+ obj.setProperty(runtime, "currencyCode", JSIConverter<std::string>::toJSI(runtime, arg.currencyCode));
82
+ obj.setProperty(runtime, "balance", JSIConverter<std::optional<double>>::toJSI(runtime, arg.balance));
83
+ obj.setProperty(runtime, "ach", JSIConverter<std::optional<ACHDetails>>::toJSI(runtime, arg.ach));
84
+ obj.setProperty(runtime, "wire", JSIConverter<std::optional<WireDetails>>::toJSI(runtime, arg.wire));
85
+ obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
86
+ obj.setProperty(runtime, "service", JSIConverter<Service>::toJSI(runtime, arg.service));
87
+ return obj;
88
+ }
89
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
90
+ if (!value.isObject()) {
91
+ return false;
92
+ }
93
+ jsi::Object obj = value.getObject(runtime);
94
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
95
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "serviceAccountID"))) return false;
96
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "currencyCode"))) return false;
97
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "balance"))) return false;
98
+ if (!JSIConverter<std::optional<ACHDetails>>::canConvert(runtime, obj.getProperty(runtime, "ach"))) return false;
99
+ if (!JSIConverter<std::optional<WireDetails>>::canConvert(runtime, obj.getProperty(runtime, "wire"))) return false;
100
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
101
+ if (!JSIConverter<Service>::canConvert(runtime, obj.getProperty(runtime, "service"))) return false;
102
+ return true;
103
+ }
104
+ };
105
+
106
+ } // namespace margelo::nitro
@@ -0,0 +1,96 @@
1
+ ///
2
+ /// FiatAsset.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 `Service` to properly resolve imports.
22
+ namespace margelo::nitro::rncandle { enum class Service; }
23
+
24
+ #include <string>
25
+ #include <optional>
26
+ #include "Service.hpp"
27
+
28
+ namespace margelo::nitro::rncandle {
29
+
30
+ /**
31
+ * A struct which can be represented as a JavaScript object (FiatAsset).
32
+ */
33
+ struct FiatAsset {
34
+ public:
35
+ std::string assetKind SWIFT_PRIVATE;
36
+ std::optional<std::string> serviceTradeID SWIFT_PRIVATE;
37
+ std::string serviceAccountID SWIFT_PRIVATE;
38
+ std::string currencyCode SWIFT_PRIVATE;
39
+ double amount SWIFT_PRIVATE;
40
+ std::string linkedAccountID SWIFT_PRIVATE;
41
+ Service service SWIFT_PRIVATE;
42
+
43
+ public:
44
+ FiatAsset() = default;
45
+ explicit FiatAsset(std::string assetKind, std::optional<std::string> serviceTradeID, std::string serviceAccountID, std::string currencyCode, double amount, std::string linkedAccountID, Service service): assetKind(assetKind), serviceTradeID(serviceTradeID), serviceAccountID(serviceAccountID), currencyCode(currencyCode), amount(amount), linkedAccountID(linkedAccountID), service(service) {}
46
+ };
47
+
48
+ } // namespace margelo::nitro::rncandle
49
+
50
+ namespace margelo::nitro {
51
+
52
+ using namespace margelo::nitro::rncandle;
53
+
54
+ // C++ FiatAsset <> JS FiatAsset (object)
55
+ template <>
56
+ struct JSIConverter<FiatAsset> final {
57
+ static inline FiatAsset fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
58
+ jsi::Object obj = arg.asObject(runtime);
59
+ return FiatAsset(
60
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
61
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "serviceTradeID")),
62
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "serviceAccountID")),
63
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "currencyCode")),
64
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "amount")),
65
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID")),
66
+ JSIConverter<Service>::fromJSI(runtime, obj.getProperty(runtime, "service"))
67
+ );
68
+ }
69
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const FiatAsset& arg) {
70
+ jsi::Object obj(runtime);
71
+ obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
72
+ obj.setProperty(runtime, "serviceTradeID", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.serviceTradeID));
73
+ obj.setProperty(runtime, "serviceAccountID", JSIConverter<std::string>::toJSI(runtime, arg.serviceAccountID));
74
+ obj.setProperty(runtime, "currencyCode", JSIConverter<std::string>::toJSI(runtime, arg.currencyCode));
75
+ obj.setProperty(runtime, "amount", JSIConverter<double>::toJSI(runtime, arg.amount));
76
+ obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
77
+ obj.setProperty(runtime, "service", JSIConverter<Service>::toJSI(runtime, arg.service));
78
+ return obj;
79
+ }
80
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
81
+ if (!value.isObject()) {
82
+ return false;
83
+ }
84
+ jsi::Object obj = value.getObject(runtime);
85
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
86
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "serviceTradeID"))) return false;
87
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "serviceAccountID"))) return false;
88
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "currencyCode"))) return false;
89
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "amount"))) return false;
90
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
91
+ if (!JSIConverter<Service>::canConvert(runtime, obj.getProperty(runtime, "service"))) return false;
92
+ return true;
93
+ }
94
+ };
95
+
96
+ } // namespace margelo::nitro
@@ -0,0 +1,82 @@
1
+ ///
2
+ /// FiatAssetQuoteRequest.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 (FiatAssetQuoteRequest).
30
+ */
31
+ struct FiatAssetQuoteRequest {
32
+ public:
33
+ std::string assetKind SWIFT_PRIVATE;
34
+ std::optional<std::string> serviceAccountID SWIFT_PRIVATE;
35
+ std::optional<std::string> currencyCode SWIFT_PRIVATE;
36
+ std::optional<double> amount SWIFT_PRIVATE;
37
+
38
+ public:
39
+ FiatAssetQuoteRequest() = default;
40
+ explicit FiatAssetQuoteRequest(std::string assetKind, std::optional<std::string> serviceAccountID, std::optional<std::string> currencyCode, std::optional<double> amount): assetKind(assetKind), serviceAccountID(serviceAccountID), currencyCode(currencyCode), amount(amount) {}
41
+ };
42
+
43
+ } // namespace margelo::nitro::rncandle
44
+
45
+ namespace margelo::nitro {
46
+
47
+ using namespace margelo::nitro::rncandle;
48
+
49
+ // C++ FiatAssetQuoteRequest <> JS FiatAssetQuoteRequest (object)
50
+ template <>
51
+ struct JSIConverter<FiatAssetQuoteRequest> final {
52
+ static inline FiatAssetQuoteRequest fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
+ jsi::Object obj = arg.asObject(runtime);
54
+ return FiatAssetQuoteRequest(
55
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
56
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "serviceAccountID")),
57
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "currencyCode")),
58
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "amount"))
59
+ );
60
+ }
61
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const FiatAssetQuoteRequest& arg) {
62
+ jsi::Object obj(runtime);
63
+ obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
64
+ obj.setProperty(runtime, "serviceAccountID", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.serviceAccountID));
65
+ obj.setProperty(runtime, "currencyCode", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.currencyCode));
66
+ obj.setProperty(runtime, "amount", JSIConverter<std::optional<double>>::toJSI(runtime, arg.amount));
67
+ return obj;
68
+ }
69
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
70
+ if (!value.isObject()) {
71
+ return false;
72
+ }
73
+ jsi::Object obj = value.getObject(runtime);
74
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
75
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "serviceAccountID"))) return false;
76
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "currencyCode"))) return false;
77
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "amount"))) return false;
78
+ return true;
79
+ }
80
+ };
81
+
82
+ } // namespace margelo::nitro
@@ -21,6 +21,7 @@ namespace margelo::nitro::rncandle {
21
21
  prototype.registerHybridMethod("getAssetAccounts", &HybridRNCandleSpec::getAssetAccounts);
22
22
  prototype.registerHybridMethod("getTrades", &HybridRNCandleSpec::getTrades);
23
23
  prototype.registerHybridMethod("getTradeQuotes", &HybridRNCandleSpec::getTradeQuotes);
24
+ prototype.registerHybridMethod("submitTrade", &HybridRNCandleSpec::submitTrade);
24
25
  prototype.registerHybridMethod("deleteUser", &HybridRNCandleSpec::deleteUser);
25
26
  prototype.registerHybridMethod("getAvailableTools", &HybridRNCandleSpec::getAvailableTools);
26
27
  prototype.registerHybridMethod("executeTool", &HybridRNCandleSpec::executeTool);
@@ -23,6 +23,18 @@ 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 `AssetAccount` to properly resolve imports.
27
+ namespace margelo::nitro::rncandle { struct AssetAccount; }
28
+ // Forward declaration of `AssetAccountQuery` to properly resolve imports.
29
+ namespace margelo::nitro::rncandle { struct AssetAccountQuery; }
30
+ // Forward declaration of `Trade` to properly resolve imports.
31
+ namespace margelo::nitro::rncandle { struct Trade; }
32
+ // Forward declaration of `TradeQuery` to properly resolve imports.
33
+ namespace margelo::nitro::rncandle { struct TradeQuery; }
34
+ // Forward declaration of `TradeQuote` to properly resolve imports.
35
+ namespace margelo::nitro::rncandle { struct TradeQuote; }
36
+ // Forward declaration of `TradeQuoteRequest` to properly resolve imports.
37
+ namespace margelo::nitro::rncandle { struct TradeQuoteRequest; }
26
38
  // Forward declaration of `AnyMap` to properly resolve imports.
27
39
  namespace NitroModules { class AnyMap; }
28
40
  // Forward declaration of `ToolCall` to properly resolve imports.
@@ -38,6 +50,12 @@ namespace margelo::nitro::rncandle { struct ToolCall; }
38
50
  #include "LinkedAccount.hpp"
39
51
  #include "AppUser.hpp"
40
52
  #include <NitroModules/Promise.hpp>
53
+ #include "AssetAccount.hpp"
54
+ #include "AssetAccountQuery.hpp"
55
+ #include "Trade.hpp"
56
+ #include "TradeQuery.hpp"
57
+ #include "TradeQuote.hpp"
58
+ #include "TradeQuoteRequest.hpp"
41
59
  #include <NitroModules/AnyMap.hpp>
42
60
  #include "ToolCall.hpp"
43
61
 
@@ -76,9 +94,10 @@ namespace margelo::nitro::rncandle {
76
94
  virtual void initialize(const AppUser& appUser) = 0;
77
95
  virtual std::shared_ptr<Promise<std::vector<LinkedAccount>>> getLinkedAccounts() = 0;
78
96
  virtual std::shared_ptr<Promise<void>> unlinkAccount(const std::string& linkedAccountID) = 0;
79
- virtual std::shared_ptr<Promise<std::string>> getAssetAccounts() = 0;
80
- virtual std::shared_ptr<Promise<std::string>> getTrades(const std::optional<std::string>& span) = 0;
81
- virtual std::shared_ptr<Promise<std::string>> getTradeQuotes(const std::optional<std::string>& span) = 0;
97
+ virtual std::shared_ptr<Promise<std::vector<AssetAccount>>> getAssetAccounts(const AssetAccountQuery& query) = 0;
98
+ virtual std::shared_ptr<Promise<std::vector<Trade>>> getTrades(const TradeQuery& query) = 0;
99
+ 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;
82
101
  virtual std::shared_ptr<Promise<void>> deleteUser() = 0;
83
102
  virtual std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>> getAvailableTools() = 0;
84
103
  virtual std::shared_ptr<Promise<std::string>> executeTool(const ToolCall& tool) = 0;
@@ -0,0 +1,69 @@
1
+ ///
2
+ /// InactiveLinkedAccountDetails.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 (InactiveLinkedAccountDetails).
29
+ */
30
+ struct InactiveLinkedAccountDetails {
31
+ public:
32
+ std::string state SWIFT_PRIVATE;
33
+
34
+ public:
35
+ InactiveLinkedAccountDetails() = default;
36
+ explicit InactiveLinkedAccountDetails(std::string state): state(state) {}
37
+ };
38
+
39
+ } // namespace margelo::nitro::rncandle
40
+
41
+ namespace margelo::nitro {
42
+
43
+ using namespace margelo::nitro::rncandle;
44
+
45
+ // C++ InactiveLinkedAccountDetails <> JS InactiveLinkedAccountDetails (object)
46
+ template <>
47
+ struct JSIConverter<InactiveLinkedAccountDetails> final {
48
+ static inline InactiveLinkedAccountDetails fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ jsi::Object obj = arg.asObject(runtime);
50
+ return InactiveLinkedAccountDetails(
51
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "state"))
52
+ );
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const InactiveLinkedAccountDetails& arg) {
55
+ jsi::Object obj(runtime);
56
+ obj.setProperty(runtime, "state", JSIConverter<std::string>::toJSI(runtime, arg.state));
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, "state"))) return false;
65
+ return true;
66
+ }
67
+ };
68
+
69
+ } // namespace margelo::nitro
@@ -0,0 +1,86 @@
1
+ ///
2
+ /// LegalAccountKind.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 (LegalAccountKind).
30
+ */
31
+ enum class LegalAccountKind {
32
+ INDIVIDUAL SWIFT_NAME(individual) = 0,
33
+ JOINT SWIFT_NAME(joint) = 1,
34
+ TRADITIONALIRA SWIFT_NAME(traditionalira) = 2,
35
+ ROTHIRA SWIFT_NAME(rothira) = 3,
36
+ } CLOSED_ENUM;
37
+
38
+ } // namespace margelo::nitro::rncandle
39
+
40
+ namespace margelo::nitro {
41
+
42
+ using namespace margelo::nitro::rncandle;
43
+
44
+ // C++ LegalAccountKind <> JS LegalAccountKind (union)
45
+ template <>
46
+ struct JSIConverter<LegalAccountKind> final {
47
+ static inline LegalAccountKind fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
48
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
49
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
50
+ case hashString("individual"): return LegalAccountKind::INDIVIDUAL;
51
+ case hashString("joint"): return LegalAccountKind::JOINT;
52
+ case hashString("traditionalIra"): return LegalAccountKind::TRADITIONALIRA;
53
+ case hashString("rothIra"): return LegalAccountKind::ROTHIRA;
54
+ default: [[unlikely]]
55
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum LegalAccountKind - invalid value!");
56
+ }
57
+ }
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, LegalAccountKind arg) {
59
+ switch (arg) {
60
+ case LegalAccountKind::INDIVIDUAL: return JSIConverter<std::string>::toJSI(runtime, "individual");
61
+ case LegalAccountKind::JOINT: return JSIConverter<std::string>::toJSI(runtime, "joint");
62
+ case LegalAccountKind::TRADITIONALIRA: return JSIConverter<std::string>::toJSI(runtime, "traditionalIra");
63
+ case LegalAccountKind::ROTHIRA: return JSIConverter<std::string>::toJSI(runtime, "rothIra");
64
+ default: [[unlikely]]
65
+ throw std::invalid_argument("Cannot convert LegalAccountKind to JS - invalid value: "
66
+ + std::to_string(static_cast<int>(arg)) + "!");
67
+ }
68
+ }
69
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
70
+ if (!value.isString()) {
71
+ return false;
72
+ }
73
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
74
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
75
+ case hashString("individual"):
76
+ case hashString("joint"):
77
+ case hashString("traditionalIra"):
78
+ case hashString("rothIra"):
79
+ return true;
80
+ default:
81
+ return false;
82
+ }
83
+ }
84
+ };
85
+
86
+ } // namespace margelo::nitro
@@ -18,15 +18,14 @@
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
20
 
21
- // Forward declaration of `Details` to properly resolve imports.
22
- namespace margelo::nitro::rncandle { struct Details; }
23
21
  // Forward declaration of `Service` to properly resolve imports.
24
22
  namespace margelo::nitro::rncandle { enum class Service; }
23
+ // Forward declaration of `LinkedAccountDetails` to properly resolve imports.
24
+ namespace margelo::nitro::rncandle { struct LinkedAccountDetails; }
25
25
 
26
26
  #include <string>
27
- #include <optional>
28
- #include "Details.hpp"
29
27
  #include "Service.hpp"
28
+ #include "LinkedAccountDetails.hpp"
30
29
 
31
30
  namespace margelo::nitro::rncandle {
32
31
 
@@ -35,14 +34,14 @@ namespace margelo::nitro::rncandle {
35
34
  */
36
35
  struct LinkedAccount {
37
36
  public:
38
- std::string serviceUserID SWIFT_PRIVATE;
39
- std::optional<Details> details SWIFT_PRIVATE;
40
37
  std::string linkedAccountID SWIFT_PRIVATE;
41
38
  Service service SWIFT_PRIVATE;
39
+ std::string serviceUserID SWIFT_PRIVATE;
40
+ LinkedAccountDetails details SWIFT_PRIVATE;
42
41
 
43
42
  public:
44
43
  LinkedAccount() = default;
45
- explicit LinkedAccount(std::string serviceUserID, std::optional<Details> details, std::string linkedAccountID, Service service): serviceUserID(serviceUserID), details(details), linkedAccountID(linkedAccountID), service(service) {}
44
+ explicit LinkedAccount(std::string linkedAccountID, Service service, std::string serviceUserID, LinkedAccountDetails details): linkedAccountID(linkedAccountID), service(service), serviceUserID(serviceUserID), details(details) {}
46
45
  };
47
46
 
48
47
  } // namespace margelo::nitro::rncandle
@@ -57,18 +56,18 @@ namespace margelo::nitro {
57
56
  static inline LinkedAccount fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
58
57
  jsi::Object obj = arg.asObject(runtime);
59
58
  return LinkedAccount(
60
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "serviceUserID")),
61
- JSIConverter<std::optional<Details>>::fromJSI(runtime, obj.getProperty(runtime, "details")),
62
59
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID")),
63
- JSIConverter<Service>::fromJSI(runtime, obj.getProperty(runtime, "service"))
60
+ JSIConverter<Service>::fromJSI(runtime, obj.getProperty(runtime, "service")),
61
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "serviceUserID")),
62
+ JSIConverter<LinkedAccountDetails>::fromJSI(runtime, obj.getProperty(runtime, "details"))
64
63
  );
65
64
  }
66
65
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const LinkedAccount& arg) {
67
66
  jsi::Object obj(runtime);
68
- obj.setProperty(runtime, "serviceUserID", JSIConverter<std::string>::toJSI(runtime, arg.serviceUserID));
69
- obj.setProperty(runtime, "details", JSIConverter<std::optional<Details>>::toJSI(runtime, arg.details));
70
67
  obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
71
68
  obj.setProperty(runtime, "service", JSIConverter<Service>::toJSI(runtime, arg.service));
69
+ obj.setProperty(runtime, "serviceUserID", JSIConverter<std::string>::toJSI(runtime, arg.serviceUserID));
70
+ obj.setProperty(runtime, "details", JSIConverter<LinkedAccountDetails>::toJSI(runtime, arg.details));
72
71
  return obj;
73
72
  }
74
73
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -76,10 +75,10 @@ namespace margelo::nitro {
76
75
  return false;
77
76
  }
78
77
  jsi::Object obj = value.getObject(runtime);
79
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "serviceUserID"))) return false;
80
- if (!JSIConverter<std::optional<Details>>::canConvert(runtime, obj.getProperty(runtime, "details"))) return false;
81
78
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
82
79
  if (!JSIConverter<Service>::canConvert(runtime, obj.getProperty(runtime, "service"))) return false;
80
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "serviceUserID"))) return false;
81
+ if (!JSIConverter<LinkedAccountDetails>::canConvert(runtime, obj.getProperty(runtime, "details"))) return false;
83
82
  return true;
84
83
  }
85
84
  };