react-native-candle 19.0.12-beta → 40.0.8-beta

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 (138) hide show
  1. package/README.md +17 -25
  2. package/android/gradle.properties +5 -0
  3. package/android/src/main/java/com/margelo/nitro/rncandle/BridgeTypes.kt +189 -2
  4. package/android/src/main/java/com/margelo/nitro/rncandle/HybridRNCandle.kt +63 -10
  5. package/ios/Sources/CandleLinkSheetWrapperView.swift +3 -2
  6. package/ios/Sources/CandleLinkViewModel.swift +2 -1
  7. package/ios/Sources/RNCandle.swift +86 -9
  8. package/ios/Sources/Types.swift +199 -5
  9. package/lib/typescript/commonjs/src/context.d.ts +16 -6
  10. package/lib/typescript/commonjs/src/provider.d.ts +1 -2
  11. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +76 -6
  12. package/lib/typescript/commonjs/src/types.d.ts +15 -3
  13. package/lib/typescript/module/src/context.d.ts +16 -6
  14. package/lib/typescript/module/src/provider.d.ts +1 -2
  15. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +76 -6
  16. package/lib/typescript/module/src/types.d.ts +15 -3
  17. package/nitrogen/generated/android/c++/JAssetAccount.hpp +2 -0
  18. package/nitrogen/generated/android/c++/JAssetAccountsResponse.hpp +2 -0
  19. package/nitrogen/generated/android/c++/JCounterparty.hpp +2 -0
  20. package/nitrogen/generated/android/c++/JCryptoAccount.hpp +3 -0
  21. package/nitrogen/generated/android/c++/JCryptoAsset.hpp +3 -0
  22. package/nitrogen/generated/android/c++/JEventAsset.hpp +3 -0
  23. package/nitrogen/generated/android/c++/JFiatAccount.hpp +2 -0
  24. package/nitrogen/generated/android/c++/JFiatAsset.hpp +2 -0
  25. package/nitrogen/generated/android/c++/JFriendRequestAsset.hpp +86 -0
  26. package/nitrogen/generated/android/c++/JFriendRequestAssetDirection.hpp +58 -0
  27. package/nitrogen/generated/android/c++/JFriendRequestAssetQuoteRequest.hpp +63 -0
  28. package/nitrogen/generated/android/c++/JFriendRequestAssetQuoteRequestAction.hpp +64 -0
  29. package/nitrogen/generated/android/c++/JFriendRequestAssetRef.hpp +66 -0
  30. package/nitrogen/generated/android/c++/JFunc_void_LinkedAccount.hpp +13 -11
  31. package/nitrogen/generated/android/c++/JFunc_void_TradeExecutionResult.hpp +11 -0
  32. package/nitrogen/generated/android/c++/JHostedAuthorizationCallback.hpp +66 -0
  33. package/nitrogen/generated/android/c++/JHostedAuthorizationRequest.hpp +69 -0
  34. package/nitrogen/generated/android/c++/JHybridRNCandleSpec.cpp +78 -15
  35. package/nitrogen/generated/android/c++/JHybridRNCandleSpec.hpp +7 -4
  36. package/nitrogen/generated/android/c++/JLinkedAccount.hpp +2 -0
  37. package/nitrogen/generated/android/c++/JLinkedAccountStatusRef.hpp +3 -0
  38. package/nitrogen/generated/android/c++/JMessageThreadAsset.hpp +99 -0
  39. package/nitrogen/generated/android/c++/JMessageThreadAssetQuoteRequest.hpp +61 -0
  40. package/nitrogen/generated/android/c++/JMessageThreadAssetRef.hpp +65 -0
  41. package/nitrogen/generated/android/c++/JMessageThreadMessage.hpp +78 -0
  42. package/nitrogen/generated/android/c++/JService.hpp +36 -252
  43. package/nitrogen/generated/android/c++/JServiceCounterparty.hpp +3 -0
  44. package/nitrogen/generated/android/c++/JServiceID.hpp +316 -0
  45. package/nitrogen/generated/android/c++/JStockAccount.hpp +3 -0
  46. package/nitrogen/generated/android/c++/JStockAsset.hpp +3 -0
  47. package/nitrogen/generated/android/c++/JTrade.hpp +11 -0
  48. package/nitrogen/generated/android/c++/JTradeAsset.hpp +22 -1
  49. package/nitrogen/generated/android/c++/JTradeAssetKind.hpp +6 -0
  50. package/nitrogen/generated/android/c++/JTradeAssetQuoteRequest.hpp +15 -1
  51. package/nitrogen/generated/android/c++/JTradeAssetRef.hpp +13 -1
  52. package/nitrogen/generated/android/c++/JTradeExecutionResult.hpp +11 -0
  53. package/nitrogen/generated/android/c++/JTradeQuote.hpp +11 -0
  54. package/nitrogen/generated/android/c++/JTradeQuotesRequest.hpp +6 -0
  55. package/nitrogen/generated/android/c++/JTradeQuotesResponse.hpp +10 -0
  56. package/nitrogen/generated/android/c++/JTradeRef.hpp +4 -0
  57. package/nitrogen/generated/android/c++/JTradesResponse.hpp +10 -0
  58. package/nitrogen/generated/android/c++/JTransportAccount.hpp +3 -0
  59. package/nitrogen/generated/android/c++/JTransportAsset.hpp +3 -0
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/FriendRequestAsset.kt +53 -0
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/FriendRequestAssetDirection.kt +23 -0
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/FriendRequestAssetQuoteRequest.kt +41 -0
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/FriendRequestAssetQuoteRequestAction.kt +25 -0
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/FriendRequestAssetRef.kt +44 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/Func_void_LinkedAccount.kt +9 -9
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/HostedAuthorizationCallback.kt +44 -0
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/HostedAuthorizationRequest.kt +47 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/HybridRNCandleSpec.kt +18 -6
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/MessageThreadAsset.kt +50 -0
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/MessageThreadAssetQuoteRequest.kt +41 -0
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/MessageThreadAssetRef.kt +44 -0
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/MessageThreadMessage.kt +53 -0
  73. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/Service.kt +32 -83
  74. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/ServiceID.kt +109 -0
  75. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/TradeAsset.kt +8 -2
  76. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/TradeAssetKind.kt +4 -2
  77. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/TradeAssetQuoteRequest.kt +8 -2
  78. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/TradeAssetRef.kt +8 -2
  79. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.cpp +3 -3
  80. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.hpp +184 -20
  81. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Umbrella.hpp +37 -1
  82. package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +74 -14
  83. package/nitrogen/generated/ios/swift/FriendRequestAsset.swift +67 -0
  84. package/nitrogen/generated/ios/swift/FriendRequestAssetDirection.swift +40 -0
  85. package/nitrogen/generated/ios/swift/FriendRequestAssetQuoteRequest.swift +34 -0
  86. package/nitrogen/generated/ios/swift/FriendRequestAssetQuoteRequestAction.swift +48 -0
  87. package/nitrogen/generated/ios/swift/FriendRequestAssetRef.swift +52 -0
  88. package/nitrogen/generated/ios/swift/Func_void_LinkedAccount.swift +5 -5
  89. package/nitrogen/generated/ios/swift/HostedAuthorizationCallback.swift +52 -0
  90. package/nitrogen/generated/ios/swift/HostedAuthorizationRequest.swift +44 -0
  91. package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +7 -4
  92. package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +56 -13
  93. package/nitrogen/generated/ios/swift/MessageThreadAsset.swift +68 -0
  94. package/nitrogen/generated/ios/swift/MessageThreadAssetQuoteRequest.swift +34 -0
  95. package/nitrogen/generated/ios/swift/MessageThreadAssetRef.swift +39 -0
  96. package/nitrogen/generated/ios/swift/MessageThreadMessage.swift +119 -0
  97. package/nitrogen/generated/ios/swift/Service.swift +44 -334
  98. package/nitrogen/generated/ios/swift/ServiceID.swift +384 -0
  99. package/nitrogen/generated/ios/swift/TradeAsset.swift +23 -1
  100. package/nitrogen/generated/ios/swift/TradeAssetKind.swift +8 -0
  101. package/nitrogen/generated/ios/swift/TradeAssetQuoteRequest.swift +23 -1
  102. package/nitrogen/generated/ios/swift/TradeAssetRef.swift +23 -1
  103. package/nitrogen/generated/shared/c++/CryptoAccount.hpp +1 -1
  104. package/nitrogen/generated/shared/c++/CryptoAsset.hpp +1 -1
  105. package/nitrogen/generated/shared/c++/EventAsset.hpp +1 -1
  106. package/nitrogen/generated/shared/c++/FiatAccount.hpp +1 -1
  107. package/nitrogen/generated/shared/c++/FiatAsset.hpp +1 -1
  108. package/nitrogen/generated/shared/c++/FriendRequestAsset.hpp +112 -0
  109. package/nitrogen/generated/shared/c++/FriendRequestAssetDirection.hpp +76 -0
  110. package/nitrogen/generated/shared/c++/FriendRequestAssetQuoteRequest.hpp +89 -0
  111. package/nitrogen/generated/shared/c++/FriendRequestAssetQuoteRequestAction.hpp +84 -0
  112. package/nitrogen/generated/shared/c++/FriendRequestAssetRef.hpp +92 -0
  113. package/nitrogen/generated/shared/c++/HostedAuthorizationCallback.hpp +92 -0
  114. package/nitrogen/generated/shared/c++/HostedAuthorizationRequest.hpp +95 -0
  115. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.cpp +5 -2
  116. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +16 -7
  117. package/nitrogen/generated/shared/c++/LinkedAccount.hpp +1 -1
  118. package/nitrogen/generated/shared/c++/LinkedAccountStatusRef.hpp +1 -1
  119. package/nitrogen/generated/shared/c++/MessageThreadAsset.hpp +106 -0
  120. package/nitrogen/generated/shared/c++/MessageThreadAssetQuoteRequest.hpp +87 -0
  121. package/nitrogen/generated/shared/c++/MessageThreadAssetRef.hpp +91 -0
  122. package/nitrogen/generated/shared/c++/MessageThreadMessage.hpp +104 -0
  123. package/nitrogen/generated/shared/c++/Service.hpp +60 -346
  124. package/nitrogen/generated/shared/c++/ServiceCounterparty.hpp +1 -1
  125. package/nitrogen/generated/shared/c++/ServiceID.hpp +420 -0
  126. package/nitrogen/generated/shared/c++/StockAccount.hpp +1 -1
  127. package/nitrogen/generated/shared/c++/StockAsset.hpp +1 -1
  128. package/nitrogen/generated/shared/c++/TradeAsset.hpp +15 -1
  129. package/nitrogen/generated/shared/c++/TradeAssetKind.hpp +10 -2
  130. package/nitrogen/generated/shared/c++/TradeAssetQuoteRequest.hpp +15 -1
  131. package/nitrogen/generated/shared/c++/TradeAssetRef.hpp +15 -1
  132. package/nitrogen/generated/shared/c++/TransportAccount.hpp +1 -1
  133. package/nitrogen/generated/shared/c++/TransportAsset.hpp +1 -1
  134. package/package.json +1 -1
  135. package/src/context.ts +21 -5
  136. package/src/provider.tsx +62 -34
  137. package/src/specs/RNCandle.nitro.ts +109 -7
  138. package/src/types.ts +50 -1
@@ -0,0 +1,112 @@
1
+ ///
2
+ /// FriendRequestAsset.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `FriendRequestAssetDirection` to properly resolve imports.
32
+ namespace margelo::nitro::rncandle { enum class FriendRequestAssetDirection; }
33
+ // Forward declaration of `UserCounterparty` to properly resolve imports.
34
+ namespace margelo::nitro::rncandle { struct UserCounterparty; }
35
+ // Forward declaration of `Service` to properly resolve imports.
36
+ namespace margelo::nitro::rncandle { struct Service; }
37
+
38
+ #include <string>
39
+ #include <optional>
40
+ #include "FriendRequestAssetDirection.hpp"
41
+ #include "UserCounterparty.hpp"
42
+ #include "Service.hpp"
43
+
44
+ namespace margelo::nitro::rncandle {
45
+
46
+ /**
47
+ * A struct which can be represented as a JavaScript object (FriendRequestAsset).
48
+ */
49
+ struct FriendRequestAsset final {
50
+ public:
51
+ std::string assetKind SWIFT_PRIVATE;
52
+ std::optional<std::string> serviceTradeID SWIFT_PRIVATE;
53
+ FriendRequestAssetDirection direction SWIFT_PRIVATE;
54
+ UserCounterparty user SWIFT_PRIVATE;
55
+ std::string linkedAccountID SWIFT_PRIVATE;
56
+ Service service SWIFT_PRIVATE;
57
+
58
+ public:
59
+ FriendRequestAsset() = default;
60
+ explicit FriendRequestAsset(std::string assetKind, std::optional<std::string> serviceTradeID, FriendRequestAssetDirection direction, UserCounterparty user, std::string linkedAccountID, Service service): assetKind(assetKind), serviceTradeID(serviceTradeID), direction(direction), user(user), linkedAccountID(linkedAccountID), service(service) {}
61
+
62
+ public:
63
+ friend bool operator==(const FriendRequestAsset& lhs, const FriendRequestAsset& rhs) = default;
64
+ };
65
+
66
+ } // namespace margelo::nitro::rncandle
67
+
68
+ namespace margelo::nitro {
69
+
70
+ // C++ FriendRequestAsset <> JS FriendRequestAsset (object)
71
+ template <>
72
+ struct JSIConverter<margelo::nitro::rncandle::FriendRequestAsset> final {
73
+ static inline margelo::nitro::rncandle::FriendRequestAsset fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
74
+ jsi::Object obj = arg.asObject(runtime);
75
+ return margelo::nitro::rncandle::FriendRequestAsset(
76
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "assetKind"))),
77
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serviceTradeID"))),
78
+ JSIConverter<margelo::nitro::rncandle::FriendRequestAssetDirection>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "direction"))),
79
+ JSIConverter<margelo::nitro::rncandle::UserCounterparty>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "user"))),
80
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "linkedAccountID"))),
81
+ JSIConverter<margelo::nitro::rncandle::Service>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "service")))
82
+ );
83
+ }
84
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::FriendRequestAsset& arg) {
85
+ jsi::Object obj(runtime);
86
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "assetKind"), JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
87
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "serviceTradeID"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.serviceTradeID));
88
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "direction"), JSIConverter<margelo::nitro::rncandle::FriendRequestAssetDirection>::toJSI(runtime, arg.direction));
89
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "user"), JSIConverter<margelo::nitro::rncandle::UserCounterparty>::toJSI(runtime, arg.user));
90
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "linkedAccountID"), JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
91
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "service"), JSIConverter<margelo::nitro::rncandle::Service>::toJSI(runtime, arg.service));
92
+ return obj;
93
+ }
94
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
95
+ if (!value.isObject()) {
96
+ return false;
97
+ }
98
+ jsi::Object obj = value.getObject(runtime);
99
+ if (!nitro::isPlainObject(runtime, obj)) {
100
+ return false;
101
+ }
102
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "assetKind")))) return false;
103
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serviceTradeID")))) return false;
104
+ if (!JSIConverter<margelo::nitro::rncandle::FriendRequestAssetDirection>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "direction")))) return false;
105
+ if (!JSIConverter<margelo::nitro::rncandle::UserCounterparty>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "user")))) return false;
106
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "linkedAccountID")))) return false;
107
+ if (!JSIConverter<margelo::nitro::rncandle::Service>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "service")))) return false;
108
+ return true;
109
+ }
110
+ };
111
+
112
+ } // namespace margelo::nitro
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// FriendRequestAssetDirection.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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 (FriendRequestAssetDirection).
30
+ */
31
+ enum class FriendRequestAssetDirection {
32
+ RECEIVED SWIFT_NAME(received) = 0,
33
+ SENT SWIFT_NAME(sent) = 1,
34
+ } CLOSED_ENUM;
35
+
36
+ } // namespace margelo::nitro::rncandle
37
+
38
+ namespace margelo::nitro {
39
+
40
+ // C++ FriendRequestAssetDirection <> JS FriendRequestAssetDirection (union)
41
+ template <>
42
+ struct JSIConverter<margelo::nitro::rncandle::FriendRequestAssetDirection> final {
43
+ static inline margelo::nitro::rncandle::FriendRequestAssetDirection fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
44
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
45
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
46
+ case hashString("received"): return margelo::nitro::rncandle::FriendRequestAssetDirection::RECEIVED;
47
+ case hashString("sent"): return margelo::nitro::rncandle::FriendRequestAssetDirection::SENT;
48
+ default: [[unlikely]]
49
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum FriendRequestAssetDirection - invalid value!");
50
+ }
51
+ }
52
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rncandle::FriendRequestAssetDirection arg) {
53
+ switch (arg) {
54
+ case margelo::nitro::rncandle::FriendRequestAssetDirection::RECEIVED: return JSIConverter<std::string>::toJSI(runtime, "received");
55
+ case margelo::nitro::rncandle::FriendRequestAssetDirection::SENT: return JSIConverter<std::string>::toJSI(runtime, "sent");
56
+ default: [[unlikely]]
57
+ throw std::invalid_argument("Cannot convert FriendRequestAssetDirection to JS - invalid value: "
58
+ + std::to_string(static_cast<int>(arg)) + "!");
59
+ }
60
+ }
61
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
62
+ if (!value.isString()) {
63
+ return false;
64
+ }
65
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
66
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
67
+ case hashString("received"):
68
+ case hashString("sent"):
69
+ return true;
70
+ default:
71
+ return false;
72
+ }
73
+ }
74
+ };
75
+
76
+ } // namespace margelo::nitro
@@ -0,0 +1,89 @@
1
+ ///
2
+ /// FriendRequestAssetQuoteRequest.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+ // Forward declaration of `FriendRequestAssetQuoteRequestAction` to properly resolve imports.
32
+ namespace margelo::nitro::rncandle { enum class FriendRequestAssetQuoteRequestAction; }
33
+
34
+ #include <string>
35
+ #include "FriendRequestAssetQuoteRequestAction.hpp"
36
+
37
+ namespace margelo::nitro::rncandle {
38
+
39
+ /**
40
+ * A struct which can be represented as a JavaScript object (FriendRequestAssetQuoteRequest).
41
+ */
42
+ struct FriendRequestAssetQuoteRequest final {
43
+ public:
44
+ std::string assetKind SWIFT_PRIVATE;
45
+ FriendRequestAssetQuoteRequestAction action SWIFT_PRIVATE;
46
+
47
+ public:
48
+ FriendRequestAssetQuoteRequest() = default;
49
+ explicit FriendRequestAssetQuoteRequest(std::string assetKind, FriendRequestAssetQuoteRequestAction action): assetKind(assetKind), action(action) {}
50
+
51
+ public:
52
+ friend bool operator==(const FriendRequestAssetQuoteRequest& lhs, const FriendRequestAssetQuoteRequest& rhs) = default;
53
+ };
54
+
55
+ } // namespace margelo::nitro::rncandle
56
+
57
+ namespace margelo::nitro {
58
+
59
+ // C++ FriendRequestAssetQuoteRequest <> JS FriendRequestAssetQuoteRequest (object)
60
+ template <>
61
+ struct JSIConverter<margelo::nitro::rncandle::FriendRequestAssetQuoteRequest> final {
62
+ static inline margelo::nitro::rncandle::FriendRequestAssetQuoteRequest fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
63
+ jsi::Object obj = arg.asObject(runtime);
64
+ return margelo::nitro::rncandle::FriendRequestAssetQuoteRequest(
65
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "assetKind"))),
66
+ JSIConverter<margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "action")))
67
+ );
68
+ }
69
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::FriendRequestAssetQuoteRequest& arg) {
70
+ jsi::Object obj(runtime);
71
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "assetKind"), JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
72
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "action"), JSIConverter<margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction>::toJSI(runtime, arg.action));
73
+ return obj;
74
+ }
75
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
76
+ if (!value.isObject()) {
77
+ return false;
78
+ }
79
+ jsi::Object obj = value.getObject(runtime);
80
+ if (!nitro::isPlainObject(runtime, obj)) {
81
+ return false;
82
+ }
83
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "assetKind")))) return false;
84
+ if (!JSIConverter<margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "action")))) return false;
85
+ return true;
86
+ }
87
+ };
88
+
89
+ } // namespace margelo::nitro
@@ -0,0 +1,84 @@
1
+ ///
2
+ /// FriendRequestAssetQuoteRequestAction.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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 (FriendRequestAssetQuoteRequestAction).
30
+ */
31
+ enum class FriendRequestAssetQuoteRequestAction {
32
+ ACCEPT SWIFT_NAME(accept) = 0,
33
+ REJECT SWIFT_NAME(reject) = 1,
34
+ SEND SWIFT_NAME(send) = 2,
35
+ WITHDRAW SWIFT_NAME(withdraw) = 3,
36
+ } CLOSED_ENUM;
37
+
38
+ } // namespace margelo::nitro::rncandle
39
+
40
+ namespace margelo::nitro {
41
+
42
+ // C++ FriendRequestAssetQuoteRequestAction <> JS FriendRequestAssetQuoteRequestAction (union)
43
+ template <>
44
+ struct JSIConverter<margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction> final {
45
+ static inline margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
46
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
47
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
48
+ case hashString("accept"): return margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction::ACCEPT;
49
+ case hashString("reject"): return margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction::REJECT;
50
+ case hashString("send"): return margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction::SEND;
51
+ case hashString("withdraw"): return margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction::WITHDRAW;
52
+ default: [[unlikely]]
53
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum FriendRequestAssetQuoteRequestAction - invalid value!");
54
+ }
55
+ }
56
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction arg) {
57
+ switch (arg) {
58
+ case margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction::ACCEPT: return JSIConverter<std::string>::toJSI(runtime, "accept");
59
+ case margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction::REJECT: return JSIConverter<std::string>::toJSI(runtime, "reject");
60
+ case margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction::SEND: return JSIConverter<std::string>::toJSI(runtime, "send");
61
+ case margelo::nitro::rncandle::FriendRequestAssetQuoteRequestAction::WITHDRAW: return JSIConverter<std::string>::toJSI(runtime, "withdraw");
62
+ default: [[unlikely]]
63
+ throw std::invalid_argument("Cannot convert FriendRequestAssetQuoteRequestAction to JS - invalid value: "
64
+ + std::to_string(static_cast<int>(arg)) + "!");
65
+ }
66
+ }
67
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
68
+ if (!value.isString()) {
69
+ return false;
70
+ }
71
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
72
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
73
+ case hashString("accept"):
74
+ case hashString("reject"):
75
+ case hashString("send"):
76
+ case hashString("withdraw"):
77
+ return true;
78
+ default:
79
+ return false;
80
+ }
81
+ }
82
+ };
83
+
84
+ } // namespace margelo::nitro
@@ -0,0 +1,92 @@
1
+ ///
2
+ /// FriendRequestAssetRef.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+
32
+
33
+ #include <string>
34
+ #include <optional>
35
+
36
+ namespace margelo::nitro::rncandle {
37
+
38
+ /**
39
+ * A struct which can be represented as a JavaScript object (FriendRequestAssetRef).
40
+ */
41
+ struct FriendRequestAssetRef final {
42
+ public:
43
+ std::string assetKind SWIFT_PRIVATE;
44
+ std::optional<std::string> serviceTradeID SWIFT_PRIVATE;
45
+ std::string linkedAccountID SWIFT_PRIVATE;
46
+
47
+ public:
48
+ FriendRequestAssetRef() = default;
49
+ explicit FriendRequestAssetRef(std::string assetKind, std::optional<std::string> serviceTradeID, std::string linkedAccountID): assetKind(assetKind), serviceTradeID(serviceTradeID), linkedAccountID(linkedAccountID) {}
50
+
51
+ public:
52
+ friend bool operator==(const FriendRequestAssetRef& lhs, const FriendRequestAssetRef& rhs) = default;
53
+ };
54
+
55
+ } // namespace margelo::nitro::rncandle
56
+
57
+ namespace margelo::nitro {
58
+
59
+ // C++ FriendRequestAssetRef <> JS FriendRequestAssetRef (object)
60
+ template <>
61
+ struct JSIConverter<margelo::nitro::rncandle::FriendRequestAssetRef> final {
62
+ static inline margelo::nitro::rncandle::FriendRequestAssetRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
63
+ jsi::Object obj = arg.asObject(runtime);
64
+ return margelo::nitro::rncandle::FriendRequestAssetRef(
65
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "assetKind"))),
66
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serviceTradeID"))),
67
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "linkedAccountID")))
68
+ );
69
+ }
70
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::FriendRequestAssetRef& arg) {
71
+ jsi::Object obj(runtime);
72
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "assetKind"), JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
73
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "serviceTradeID"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.serviceTradeID));
74
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "linkedAccountID"), JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
75
+ return obj;
76
+ }
77
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
78
+ if (!value.isObject()) {
79
+ return false;
80
+ }
81
+ jsi::Object obj = value.getObject(runtime);
82
+ if (!nitro::isPlainObject(runtime, obj)) {
83
+ return false;
84
+ }
85
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "assetKind")))) return false;
86
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serviceTradeID")))) return false;
87
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "linkedAccountID")))) return false;
88
+ return true;
89
+ }
90
+ };
91
+
92
+ } // namespace margelo::nitro
@@ -0,0 +1,92 @@
1
+ ///
2
+ /// HostedAuthorizationCallback.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+
32
+
33
+ #include <string>
34
+ #include <optional>
35
+
36
+ namespace margelo::nitro::rncandle {
37
+
38
+ /**
39
+ * A struct which can be represented as a JavaScript object (HostedAuthorizationCallback).
40
+ */
41
+ struct HostedAuthorizationCallback final {
42
+ public:
43
+ std::string authorizationCode SWIFT_PRIVATE;
44
+ std::optional<std::string> state SWIFT_PRIVATE;
45
+ std::string encryptedGrantPackage SWIFT_PRIVATE;
46
+
47
+ public:
48
+ HostedAuthorizationCallback() = default;
49
+ explicit HostedAuthorizationCallback(std::string authorizationCode, std::optional<std::string> state, std::string encryptedGrantPackage): authorizationCode(authorizationCode), state(state), encryptedGrantPackage(encryptedGrantPackage) {}
50
+
51
+ public:
52
+ friend bool operator==(const HostedAuthorizationCallback& lhs, const HostedAuthorizationCallback& rhs) = default;
53
+ };
54
+
55
+ } // namespace margelo::nitro::rncandle
56
+
57
+ namespace margelo::nitro {
58
+
59
+ // C++ HostedAuthorizationCallback <> JS HostedAuthorizationCallback (object)
60
+ template <>
61
+ struct JSIConverter<margelo::nitro::rncandle::HostedAuthorizationCallback> final {
62
+ static inline margelo::nitro::rncandle::HostedAuthorizationCallback fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
63
+ jsi::Object obj = arg.asObject(runtime);
64
+ return margelo::nitro::rncandle::HostedAuthorizationCallback(
65
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "authorizationCode"))),
66
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "state"))),
67
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "encryptedGrantPackage")))
68
+ );
69
+ }
70
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::HostedAuthorizationCallback& arg) {
71
+ jsi::Object obj(runtime);
72
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "authorizationCode"), JSIConverter<std::string>::toJSI(runtime, arg.authorizationCode));
73
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "state"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.state));
74
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "encryptedGrantPackage"), JSIConverter<std::string>::toJSI(runtime, arg.encryptedGrantPackage));
75
+ return obj;
76
+ }
77
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
78
+ if (!value.isObject()) {
79
+ return false;
80
+ }
81
+ jsi::Object obj = value.getObject(runtime);
82
+ if (!nitro::isPlainObject(runtime, obj)) {
83
+ return false;
84
+ }
85
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "authorizationCode")))) return false;
86
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "state")))) return false;
87
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "encryptedGrantPackage")))) return false;
88
+ return true;
89
+ }
90
+ };
91
+
92
+ } // namespace margelo::nitro
@@ -0,0 +1,95 @@
1
+ ///
2
+ /// HostedAuthorizationRequest.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 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
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+ #if __has_include(<NitroModules/PropNameIDCache.hpp>)
26
+ #include <NitroModules/PropNameIDCache.hpp>
27
+ #else
28
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
29
+ #endif
30
+
31
+
32
+
33
+ #include <string>
34
+
35
+ namespace margelo::nitro::rncandle {
36
+
37
+ /**
38
+ * A struct which can be represented as a JavaScript object (HostedAuthorizationRequest).
39
+ */
40
+ struct HostedAuthorizationRequest final {
41
+ public:
42
+ std::string url SWIFT_PRIVATE;
43
+ std::string state SWIFT_PRIVATE;
44
+ std::string codeVerifier SWIFT_PRIVATE;
45
+ std::string grantPackagePublicKey SWIFT_PRIVATE;
46
+
47
+ public:
48
+ HostedAuthorizationRequest() = default;
49
+ explicit HostedAuthorizationRequest(std::string url, std::string state, std::string codeVerifier, std::string grantPackagePublicKey): url(url), state(state), codeVerifier(codeVerifier), grantPackagePublicKey(grantPackagePublicKey) {}
50
+
51
+ public:
52
+ friend bool operator==(const HostedAuthorizationRequest& lhs, const HostedAuthorizationRequest& rhs) = default;
53
+ };
54
+
55
+ } // namespace margelo::nitro::rncandle
56
+
57
+ namespace margelo::nitro {
58
+
59
+ // C++ HostedAuthorizationRequest <> JS HostedAuthorizationRequest (object)
60
+ template <>
61
+ struct JSIConverter<margelo::nitro::rncandle::HostedAuthorizationRequest> final {
62
+ static inline margelo::nitro::rncandle::HostedAuthorizationRequest fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
63
+ jsi::Object obj = arg.asObject(runtime);
64
+ return margelo::nitro::rncandle::HostedAuthorizationRequest(
65
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "url"))),
66
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "state"))),
67
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "codeVerifier"))),
68
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "grantPackagePublicKey")))
69
+ );
70
+ }
71
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rncandle::HostedAuthorizationRequest& arg) {
72
+ jsi::Object obj(runtime);
73
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "url"), JSIConverter<std::string>::toJSI(runtime, arg.url));
74
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "state"), JSIConverter<std::string>::toJSI(runtime, arg.state));
75
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "codeVerifier"), JSIConverter<std::string>::toJSI(runtime, arg.codeVerifier));
76
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "grantPackagePublicKey"), JSIConverter<std::string>::toJSI(runtime, arg.grantPackagePublicKey));
77
+ return obj;
78
+ }
79
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
80
+ if (!value.isObject()) {
81
+ return false;
82
+ }
83
+ jsi::Object obj = value.getObject(runtime);
84
+ if (!nitro::isPlainObject(runtime, obj)) {
85
+ return false;
86
+ }
87
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "url")))) return false;
88
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "state")))) return false;
89
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "codeVerifier")))) return false;
90
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "grantPackagePublicKey")))) return false;
91
+ return true;
92
+ }
93
+ };
94
+
95
+ } // namespace margelo::nitro
@@ -27,8 +27,11 @@ namespace margelo::nitro::rncandle {
27
27
  prototype.registerHybridMethod("cancelTrade", &HybridRNCandleSpec::cancelTrade);
28
28
  prototype.registerHybridMethod("getTradeQuotes", &HybridRNCandleSpec::getTradeQuotes);
29
29
  prototype.registerHybridMethod("executeTrade", &HybridRNCandleSpec::executeTrade);
30
- prototype.registerHybridMethod("createUser", &HybridRNCandleSpec::createUser);
31
- prototype.registerHybridMethod("deleteUser", &HybridRNCandleSpec::deleteUser);
30
+ prototype.registerHybridMethod("hostedAuthorizationUrl", &HybridRNCandleSpec::hostedAuthorizationUrl);
31
+ prototype.registerHybridMethod("makeHostedAuthorizationRequest", &HybridRNCandleSpec::makeHostedAuthorizationRequest);
32
+ prototype.registerHybridMethod("parseHostedAuthorizationCallback", &HybridRNCandleSpec::parseHostedAuthorizationCallback);
33
+ prototype.registerHybridMethod("completeHostedAuthorization", &HybridRNCandleSpec::completeHostedAuthorization);
34
+ prototype.registerHybridMethod("signOut", &HybridRNCandleSpec::signOut);
32
35
  });
33
36
  }
34
37