react-native-candle 0.1.19 → 0.1.21

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 (54) hide show
  1. package/ReactNativeCandle.podspec +1 -1
  2. package/ios/Sources/CandleActionViewModel.swift +13 -0
  3. package/ios/Sources/CandleTradeExecutionSheetWrapper.swift +31 -0
  4. package/ios/Sources/HostingViewController.swift +7 -0
  5. package/ios/Sources/RNCandle.swift +300 -84
  6. package/lib/commonjs/index.js +140 -15
  7. package/lib/commonjs/index.js.map +1 -1
  8. package/lib/module/index.js +140 -15
  9. package/lib/module/index.js.map +1 -1
  10. package/lib/typescript/commonjs/src/index.d.ts +46 -13
  11. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  12. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +50 -2
  13. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts.map +1 -1
  14. package/lib/typescript/module/src/index.d.ts +46 -13
  15. package/lib/typescript/module/src/index.d.ts.map +1 -1
  16. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +50 -2
  17. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts.map +1 -1
  18. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.cpp +24 -8
  19. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.hpp +271 -113
  20. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Umbrella.hpp +30 -3
  21. package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +106 -57
  22. package/nitrogen/generated/ios/swift/AssetAccountRef.swift +55 -0
  23. package/nitrogen/generated/ios/swift/FiatAssetRef.swift +75 -0
  24. package/nitrogen/generated/ios/swift/Func_void_AssetAccount.swift +44 -0
  25. package/nitrogen/generated/ios/swift/Func_void_LinkedAccount.swift +5 -5
  26. package/nitrogen/generated/ios/swift/Func_void_TradeExecutionResult.swift +46 -0
  27. package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +7 -2
  28. package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +86 -24
  29. package/nitrogen/generated/ios/swift/LinkedAccountRef.swift +33 -0
  30. package/nitrogen/generated/ios/swift/MarketTradeAssetRef.swift +55 -0
  31. package/nitrogen/generated/ios/swift/NothingAssetRef.swift +33 -0
  32. package/nitrogen/generated/ios/swift/OtherAssetRef.swift +33 -0
  33. package/nitrogen/generated/ios/swift/TradeAssetRef.swift +176 -0
  34. package/nitrogen/generated/ios/swift/TradeExecutionResult.swift +82 -0
  35. package/nitrogen/generated/ios/swift/TradeQuote.swift +13 -2
  36. package/nitrogen/generated/ios/swift/TradeRef.swift +44 -0
  37. package/nitrogen/generated/ios/swift/TransportAssetRef.swift +55 -0
  38. package/nitrogen/generated/shared/c++/AssetAccountRef.hpp +77 -0
  39. package/nitrogen/generated/shared/c++/FiatAssetRef.hpp +78 -0
  40. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.cpp +4 -1
  41. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +20 -8
  42. package/nitrogen/generated/shared/c++/{ExecuteTradeRequest.hpp → LinkedAccountRef.hpp} +11 -15
  43. package/nitrogen/generated/shared/c++/MarketTradeAssetRef.hpp +77 -0
  44. package/nitrogen/generated/shared/c++/NothingAssetRef.hpp +69 -0
  45. package/nitrogen/generated/shared/c++/OtherAssetRef.hpp +69 -0
  46. package/nitrogen/generated/shared/c++/TradeAssetRef.hpp +99 -0
  47. package/nitrogen/generated/shared/c++/TradeExecutionResult.hpp +76 -0
  48. package/nitrogen/generated/shared/c++/TradeQuote.hpp +7 -2
  49. package/nitrogen/generated/shared/c++/TradeRef.hpp +74 -0
  50. package/nitrogen/generated/shared/c++/TransportAssetRef.hpp +77 -0
  51. package/package.json +1 -1
  52. package/src/index.ts +199 -33
  53. package/src/specs/RNCandle.nitro.ts +64 -2
  54. package/nitrogen/generated/ios/swift/ExecuteTradeRequest.swift +0 -44
@@ -26,8 +26,44 @@ namespace margelo::nitro::rncandle { struct LinkedAccountDetails; }
26
26
  namespace margelo::nitro::rncandle { struct ActiveLinkedAccountDetails; }
27
27
  // Forward declaration of `InactiveLinkedAccountDetails` to properly resolve imports.
28
28
  namespace margelo::nitro::rncandle { struct InactiveLinkedAccountDetails; }
29
+ // Forward declaration of `TradeQuote` to properly resolve imports.
30
+ namespace margelo::nitro::rncandle { struct TradeQuote; }
31
+ // Forward declaration of `TradeAsset` to properly resolve imports.
32
+ namespace margelo::nitro::rncandle { struct TradeAsset; }
33
+ // Forward declaration of `FiatAsset` to properly resolve imports.
34
+ namespace margelo::nitro::rncandle { struct FiatAsset; }
35
+ // Forward declaration of `MarketTradeAsset` to properly resolve imports.
36
+ namespace margelo::nitro::rncandle { struct MarketTradeAsset; }
37
+ // Forward declaration of `TransportAsset` to properly resolve imports.
38
+ namespace margelo::nitro::rncandle { struct TransportAsset; }
39
+ // Forward declaration of `Coordinates` to properly resolve imports.
40
+ namespace margelo::nitro::rncandle { struct Coordinates; }
41
+ // Forward declaration of `Address` to properly resolve imports.
42
+ namespace margelo::nitro::rncandle { struct Address; }
43
+ // Forward declaration of `OtherAsset` to properly resolve imports.
44
+ namespace margelo::nitro::rncandle { struct OtherAsset; }
45
+ // Forward declaration of `NothingAsset` to properly resolve imports.
46
+ namespace margelo::nitro::rncandle { struct NothingAsset; }
47
+ // Forward declaration of `TradeExecutionResult` to properly resolve imports.
48
+ namespace margelo::nitro::rncandle { struct TradeExecutionResult; }
49
+ // Forward declaration of `Trade` to properly resolve imports.
50
+ namespace margelo::nitro::rncandle { struct Trade; }
51
+ // Forward declaration of `TradeState` to properly resolve imports.
52
+ namespace margelo::nitro::rncandle { enum class TradeState; }
53
+ // Forward declaration of `Counterparty` to properly resolve imports.
54
+ namespace margelo::nitro::rncandle { struct Counterparty; }
55
+ // Forward declaration of `MerchantCounterparty` to properly resolve imports.
56
+ namespace margelo::nitro::rncandle { struct MerchantCounterparty; }
57
+ // Forward declaration of `MerchantLocation` to properly resolve imports.
58
+ namespace margelo::nitro::rncandle { struct MerchantLocation; }
59
+ // Forward declaration of `UserCounterparty` to properly resolve imports.
60
+ namespace margelo::nitro::rncandle { struct UserCounterparty; }
61
+ // Forward declaration of `ServiceCounterparty` to properly resolve imports.
62
+ namespace margelo::nitro::rncandle { struct ServiceCounterparty; }
29
63
  // Forward declaration of `AppUser` to properly resolve imports.
30
64
  namespace margelo::nitro::rncandle { struct AppUser; }
65
+ // Forward declaration of `LinkedAccountRef` to properly resolve imports.
66
+ namespace margelo::nitro::rncandle { struct LinkedAccountRef; }
31
67
  // Forward declaration of `AssetAccount` to properly resolve imports.
32
68
  namespace margelo::nitro::rncandle { struct AssetAccount; }
33
69
  // Forward declaration of `LegalAccountKind` to properly resolve imports.
@@ -48,40 +84,24 @@ namespace margelo::nitro::rncandle { struct MarketAccountDetails; }
48
84
  namespace margelo::nitro::rncandle { struct AssetAccountQuery; }
49
85
  // Forward declaration of `AssetAccountKind` to properly resolve imports.
50
86
  namespace margelo::nitro::rncandle { enum class AssetAccountKind; }
51
- // Forward declaration of `Trade` to properly resolve imports.
52
- namespace margelo::nitro::rncandle { struct Trade; }
53
- // Forward declaration of `TradeState` to properly resolve imports.
54
- namespace margelo::nitro::rncandle { enum class TradeState; }
55
- // Forward declaration of `Counterparty` to properly resolve imports.
56
- namespace margelo::nitro::rncandle { struct Counterparty; }
57
- // Forward declaration of `MerchantCounterparty` to properly resolve imports.
58
- namespace margelo::nitro::rncandle { struct MerchantCounterparty; }
59
- // Forward declaration of `MerchantLocation` to properly resolve imports.
60
- namespace margelo::nitro::rncandle { struct MerchantLocation; }
61
- // Forward declaration of `UserCounterparty` to properly resolve imports.
62
- namespace margelo::nitro::rncandle { struct UserCounterparty; }
63
- // Forward declaration of `ServiceCounterparty` to properly resolve imports.
64
- namespace margelo::nitro::rncandle { struct ServiceCounterparty; }
65
- // Forward declaration of `TradeAsset` to properly resolve imports.
66
- namespace margelo::nitro::rncandle { struct TradeAsset; }
67
- // Forward declaration of `FiatAsset` to properly resolve imports.
68
- namespace margelo::nitro::rncandle { struct FiatAsset; }
69
- // Forward declaration of `MarketTradeAsset` to properly resolve imports.
70
- namespace margelo::nitro::rncandle { struct MarketTradeAsset; }
71
- // Forward declaration of `TransportAsset` to properly resolve imports.
72
- namespace margelo::nitro::rncandle { struct TransportAsset; }
73
- // Forward declaration of `Coordinates` to properly resolve imports.
74
- namespace margelo::nitro::rncandle { struct Coordinates; }
75
- // Forward declaration of `Address` to properly resolve imports.
76
- namespace margelo::nitro::rncandle { struct Address; }
77
- // Forward declaration of `OtherAsset` to properly resolve imports.
78
- namespace margelo::nitro::rncandle { struct OtherAsset; }
79
- // Forward declaration of `NothingAsset` to properly resolve imports.
80
- namespace margelo::nitro::rncandle { struct NothingAsset; }
87
+ // Forward declaration of `AssetAccountRef` to properly resolve imports.
88
+ namespace margelo::nitro::rncandle { struct AssetAccountRef; }
81
89
  // Forward declaration of `TradeQuery` to properly resolve imports.
82
90
  namespace margelo::nitro::rncandle { struct TradeQuery; }
83
- // Forward declaration of `TradeQuote` to properly resolve imports.
84
- namespace margelo::nitro::rncandle { struct TradeQuote; }
91
+ // Forward declaration of `TradeRef` to properly resolve imports.
92
+ namespace margelo::nitro::rncandle { struct TradeRef; }
93
+ // Forward declaration of `TradeAssetRef` to properly resolve imports.
94
+ namespace margelo::nitro::rncandle { struct TradeAssetRef; }
95
+ // Forward declaration of `FiatAssetRef` to properly resolve imports.
96
+ namespace margelo::nitro::rncandle { struct FiatAssetRef; }
97
+ // Forward declaration of `MarketTradeAssetRef` to properly resolve imports.
98
+ namespace margelo::nitro::rncandle { struct MarketTradeAssetRef; }
99
+ // Forward declaration of `TransportAssetRef` to properly resolve imports.
100
+ namespace margelo::nitro::rncandle { struct TransportAssetRef; }
101
+ // Forward declaration of `OtherAssetRef` to properly resolve imports.
102
+ namespace margelo::nitro::rncandle { struct OtherAssetRef; }
103
+ // Forward declaration of `NothingAssetRef` to properly resolve imports.
104
+ namespace margelo::nitro::rncandle { struct NothingAssetRef; }
85
105
  // Forward declaration of `TradeQuoteRequest` to properly resolve imports.
86
106
  namespace margelo::nitro::rncandle { struct TradeQuoteRequest; }
87
107
  // Forward declaration of `TradeAssetQuoteRequest` to properly resolve imports.
@@ -94,8 +114,6 @@ namespace margelo::nitro::rncandle { struct MarketAssetQuoteRequest; }
94
114
  namespace margelo::nitro::rncandle { struct TransportAssetQuoteRequest; }
95
115
  // Forward declaration of `NothingAssetQuoteRequest` to properly resolve imports.
96
116
  namespace margelo::nitro::rncandle { struct NothingAssetQuoteRequest; }
97
- // Forward declaration of `ExecuteTradeRequest` to properly resolve imports.
98
- namespace margelo::nitro::rncandle { struct ExecuteTradeRequest; }
99
117
  // Forward declaration of `AnyMap` to properly resolve imports.
100
118
  namespace NitroModules { class AnyMap; }
101
119
  // Forward declaration of `ToolCall` to properly resolve imports.
@@ -112,8 +130,26 @@ namespace margelo::nitro::rncandle { struct ToolCall; }
112
130
  #include "LinkedAccountDetails.hpp"
113
131
  #include "ActiveLinkedAccountDetails.hpp"
114
132
  #include "InactiveLinkedAccountDetails.hpp"
133
+ #include "TradeQuote.hpp"
134
+ #include "TradeAsset.hpp"
135
+ #include "FiatAsset.hpp"
136
+ #include "MarketTradeAsset.hpp"
137
+ #include "TransportAsset.hpp"
138
+ #include "Coordinates.hpp"
139
+ #include "Address.hpp"
140
+ #include "OtherAsset.hpp"
141
+ #include "NothingAsset.hpp"
142
+ #include "TradeExecutionResult.hpp"
143
+ #include "Trade.hpp"
144
+ #include "TradeState.hpp"
145
+ #include "Counterparty.hpp"
146
+ #include "MerchantCounterparty.hpp"
147
+ #include "MerchantLocation.hpp"
148
+ #include "UserCounterparty.hpp"
149
+ #include "ServiceCounterparty.hpp"
115
150
  #include "AppUser.hpp"
116
151
  #include <NitroModules/Promise.hpp>
152
+ #include "LinkedAccountRef.hpp"
117
153
  #include "AssetAccount.hpp"
118
154
  #include "LegalAccountKind.hpp"
119
155
  #include "AssetAccountDetails.hpp"
@@ -124,30 +160,21 @@ namespace margelo::nitro::rncandle { struct ToolCall; }
124
160
  #include "MarketAccountDetails.hpp"
125
161
  #include "AssetAccountQuery.hpp"
126
162
  #include "AssetAccountKind.hpp"
127
- #include "Trade.hpp"
128
- #include "TradeState.hpp"
129
- #include "Counterparty.hpp"
130
- #include "MerchantCounterparty.hpp"
131
- #include "MerchantLocation.hpp"
132
- #include "UserCounterparty.hpp"
133
- #include "ServiceCounterparty.hpp"
134
- #include "TradeAsset.hpp"
135
- #include "FiatAsset.hpp"
136
- #include "MarketTradeAsset.hpp"
137
- #include "TransportAsset.hpp"
138
- #include "Coordinates.hpp"
139
- #include "Address.hpp"
140
- #include "OtherAsset.hpp"
141
- #include "NothingAsset.hpp"
163
+ #include "AssetAccountRef.hpp"
142
164
  #include "TradeQuery.hpp"
143
- #include "TradeQuote.hpp"
165
+ #include "TradeRef.hpp"
166
+ #include "TradeAssetRef.hpp"
167
+ #include "FiatAssetRef.hpp"
168
+ #include "MarketTradeAssetRef.hpp"
169
+ #include "TransportAssetRef.hpp"
170
+ #include "OtherAssetRef.hpp"
171
+ #include "NothingAssetRef.hpp"
144
172
  #include "TradeQuoteRequest.hpp"
145
173
  #include "TradeAssetQuoteRequest.hpp"
146
174
  #include "FiatAssetQuoteRequest.hpp"
147
175
  #include "MarketAssetQuoteRequest.hpp"
148
176
  #include "TransportAssetQuoteRequest.hpp"
149
177
  #include "NothingAssetQuoteRequest.hpp"
150
- #include "ExecuteTradeRequest.hpp"
151
178
  #include <NitroModules/AnyMap.hpp>
152
179
  #include "ToolCall.hpp"
153
180
 
@@ -196,6 +223,12 @@ namespace margelo::nitro::rncandle {
196
223
  std::rethrow_exception(__result.error());
197
224
  }
198
225
  }
226
+ inline void candleTradeExecutionSheet(const TradeQuote& tradeQuote, PresentationBackground presentationBackground, const std::function<void(const TradeExecutionResult& /* result */)>& completion) override {
227
+ auto __result = _swiftPart.candleTradeExecutionSheet(tradeQuote, static_cast<int>(presentationBackground), completion);
228
+ if (__result.hasError()) [[unlikely]] {
229
+ std::rethrow_exception(__result.error());
230
+ }
231
+ }
199
232
  inline void initialize(const AppUser& appUser) override {
200
233
  auto __result = _swiftPart.initialize(appUser);
201
234
  if (__result.hasError()) [[unlikely]] {
@@ -210,8 +243,16 @@ namespace margelo::nitro::rncandle {
210
243
  auto __value = std::move(__result.value());
211
244
  return __value;
212
245
  }
213
- inline std::shared_ptr<Promise<void>> unlinkAccount(const std::string& linkedAccountID) override {
214
- auto __result = _swiftPart.unlinkAccount(linkedAccountID);
246
+ inline std::shared_ptr<Promise<LinkedAccount>> getLinkedAccount(const LinkedAccountRef& ref) override {
247
+ auto __result = _swiftPart.getLinkedAccount(ref);
248
+ if (__result.hasError()) [[unlikely]] {
249
+ std::rethrow_exception(__result.error());
250
+ }
251
+ auto __value = std::move(__result.value());
252
+ return __value;
253
+ }
254
+ inline std::shared_ptr<Promise<void>> unlinkAccount(const LinkedAccountRef& ref) override {
255
+ auto __result = _swiftPart.unlinkAccount(ref);
215
256
  if (__result.hasError()) [[unlikely]] {
216
257
  std::rethrow_exception(__result.error());
217
258
  }
@@ -226,6 +267,14 @@ namespace margelo::nitro::rncandle {
226
267
  auto __value = std::move(__result.value());
227
268
  return __value;
228
269
  }
270
+ inline std::shared_ptr<Promise<AssetAccount>> getAssetAccount(const AssetAccountRef& ref) override {
271
+ auto __result = _swiftPart.getAssetAccount(ref);
272
+ if (__result.hasError()) [[unlikely]] {
273
+ std::rethrow_exception(__result.error());
274
+ }
275
+ auto __value = std::move(__result.value());
276
+ return __value;
277
+ }
229
278
  inline std::shared_ptr<Promise<std::vector<Trade>>> getTrades(const TradeQuery& query) override {
230
279
  auto __result = _swiftPart.getTrades(query);
231
280
  if (__result.hasError()) [[unlikely]] {
@@ -234,16 +283,16 @@ namespace margelo::nitro::rncandle {
234
283
  auto __value = std::move(__result.value());
235
284
  return __value;
236
285
  }
237
- inline std::shared_ptr<Promise<std::vector<TradeQuote>>> getTradeQuotes(const TradeQuoteRequest& request) override {
238
- auto __result = _swiftPart.getTradeQuotes(request);
286
+ inline std::shared_ptr<Promise<Trade>> getTrade(const TradeRef& ref) override {
287
+ auto __result = _swiftPart.getTrade(ref);
239
288
  if (__result.hasError()) [[unlikely]] {
240
289
  std::rethrow_exception(__result.error());
241
290
  }
242
291
  auto __value = std::move(__result.value());
243
292
  return __value;
244
293
  }
245
- inline std::shared_ptr<Promise<Trade>> executeTrade(const ExecuteTradeRequest& request) override {
246
- auto __result = _swiftPart.executeTrade(request);
294
+ inline std::shared_ptr<Promise<std::vector<TradeQuote>>> getTradeQuotes(const TradeQuoteRequest& request) override {
295
+ auto __result = _swiftPart.getTradeQuotes(request);
247
296
  if (__result.hasError()) [[unlikely]] {
248
297
  std::rethrow_exception(__result.error());
249
298
  }
@@ -0,0 +1,55 @@
1
+ ///
2
+ /// AssetAccountRef.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 `AssetAccountRef`, backed by a C++ struct.
11
+ public typealias AssetAccountRef = margelo.nitro.rncandle.AssetAccountRef
12
+
13
+ extension AssetAccountRef {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `AssetAccountRef`.
18
+ */
19
+ public init(linkedAccountID: String, assetKind: String, serviceAccountID: String) {
20
+ self.init(std.string(linkedAccountID), std.string(assetKind), std.string(serviceAccountID))
21
+ }
22
+
23
+ public var linkedAccountID: String {
24
+ @inline(__always)
25
+ get {
26
+ return String(self.__linkedAccountID)
27
+ }
28
+ @inline(__always)
29
+ set {
30
+ self.__linkedAccountID = std.string(newValue)
31
+ }
32
+ }
33
+
34
+ public var assetKind: String {
35
+ @inline(__always)
36
+ get {
37
+ return String(self.__assetKind)
38
+ }
39
+ @inline(__always)
40
+ set {
41
+ self.__assetKind = std.string(newValue)
42
+ }
43
+ }
44
+
45
+ public var serviceAccountID: String {
46
+ @inline(__always)
47
+ get {
48
+ return String(self.__serviceAccountID)
49
+ }
50
+ @inline(__always)
51
+ set {
52
+ self.__serviceAccountID = std.string(newValue)
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,75 @@
1
+ ///
2
+ /// FiatAssetRef.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 `FiatAssetRef`, backed by a C++ struct.
11
+ public typealias FiatAssetRef = margelo.nitro.rncandle.FiatAssetRef
12
+
13
+ extension FiatAssetRef {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `FiatAssetRef`.
18
+ */
19
+ public init(assetKind: String, serviceTradeID: String?, linkedAccountID: String) {
20
+ self.init(
21
+ std.string(assetKind),
22
+ { () -> bridge.std__optional_std__string_ in
23
+ if let __unwrappedValue = serviceTradeID {
24
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
25
+ } else {
26
+ return .init()
27
+ }
28
+ }(), std.string(linkedAccountID))
29
+ }
30
+
31
+ public var assetKind: String {
32
+ @inline(__always)
33
+ get {
34
+ return String(self.__assetKind)
35
+ }
36
+ @inline(__always)
37
+ set {
38
+ self.__assetKind = std.string(newValue)
39
+ }
40
+ }
41
+
42
+ public var serviceTradeID: String? {
43
+ @inline(__always)
44
+ get {
45
+ return { () -> String? in
46
+ if let __unwrapped = self.__serviceTradeID.value {
47
+ return String(__unwrapped)
48
+ } else {
49
+ return nil
50
+ }
51
+ }()
52
+ }
53
+ @inline(__always)
54
+ set {
55
+ self.__serviceTradeID = { () -> bridge.std__optional_std__string_ in
56
+ if let __unwrappedValue = newValue {
57
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
58
+ } else {
59
+ return .init()
60
+ }
61
+ }()
62
+ }
63
+ }
64
+
65
+ public var linkedAccountID: String {
66
+ @inline(__always)
67
+ get {
68
+ return String(self.__linkedAccountID)
69
+ }
70
+ @inline(__always)
71
+ set {
72
+ self.__linkedAccountID = std.string(newValue)
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,44 @@
1
+ ///
2
+ /// Func_void_AssetAccount.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
+ /// Wraps a Swift `(_ value: AssetAccount) -> Void` as a class.
11
+ /// This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
12
+ public final class Func_void_AssetAccount {
13
+ public typealias bridge = margelo.nitro.rncandle.bridge.swift
14
+
15
+ private let closure: (_ value: AssetAccount) -> Void
16
+
17
+ public init(_ closure: @escaping (_ value: AssetAccount) -> Void) {
18
+ self.closure = closure
19
+ }
20
+
21
+ @inline(__always)
22
+ public func call(value: AssetAccount) {
23
+ self.closure(value)
24
+ }
25
+
26
+ /**
27
+ * Casts this instance to a retained unsafe raw pointer.
28
+ * This acquires one additional strong reference on the object!
29
+ */
30
+ @inline(__always)
31
+ public func toUnsafe() -> UnsafeMutableRawPointer {
32
+ return Unmanaged.passRetained(self).toOpaque()
33
+ }
34
+
35
+ /**
36
+ * Casts an unsafe pointer to a `Func_void_AssetAccount`.
37
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_AssetAccount>`.
38
+ * This removes one strong reference from the object!
39
+ */
40
+ @inline(__always)
41
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_AssetAccount {
42
+ return Unmanaged<Func_void_AssetAccount>.fromOpaque(pointer).takeRetainedValue()
43
+ }
44
+ }
@@ -7,20 +7,20 @@
7
7
 
8
8
  import NitroModules
9
9
 
10
- /// Wraps a Swift `(_ account: LinkedAccount) -> Void` as a class.
10
+ /// Wraps a Swift `(_ value: LinkedAccount) -> Void` as a class.
11
11
  /// This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
12
12
  public final class Func_void_LinkedAccount {
13
13
  public typealias bridge = margelo.nitro.rncandle.bridge.swift
14
14
 
15
- private let closure: (_ account: LinkedAccount) -> Void
15
+ private let closure: (_ value: LinkedAccount) -> Void
16
16
 
17
- public init(_ closure: @escaping (_ account: LinkedAccount) -> Void) {
17
+ public init(_ closure: @escaping (_ value: LinkedAccount) -> Void) {
18
18
  self.closure = closure
19
19
  }
20
20
 
21
21
  @inline(__always)
22
- public func call(account: LinkedAccount) {
23
- self.closure(account)
22
+ public func call(value: LinkedAccount) {
23
+ self.closure(value)
24
24
  }
25
25
 
26
26
  /**
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// Func_void_TradeExecutionResult.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
+ /// Wraps a Swift `(_ result: TradeExecutionResult) -> Void` as a class.
11
+ /// This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
12
+ public final class Func_void_TradeExecutionResult {
13
+ public typealias bridge = margelo.nitro.rncandle.bridge.swift
14
+
15
+ private let closure: (_ result: TradeExecutionResult) -> Void
16
+
17
+ public init(_ closure: @escaping (_ result: TradeExecutionResult) -> Void) {
18
+ self.closure = closure
19
+ }
20
+
21
+ @inline(__always)
22
+ public func call(result: TradeExecutionResult) {
23
+ self.closure(result)
24
+ }
25
+
26
+ /**
27
+ * Casts this instance to a retained unsafe raw pointer.
28
+ * This acquires one additional strong reference on the object!
29
+ */
30
+ @inline(__always)
31
+ public func toUnsafe() -> UnsafeMutableRawPointer {
32
+ return Unmanaged.passRetained(self).toOpaque()
33
+ }
34
+
35
+ /**
36
+ * Casts an unsafe pointer to a `Func_void_TradeExecutionResult`.
37
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_TradeExecutionResult>`.
38
+ * This removes one strong reference from the object!
39
+ */
40
+ @inline(__always)
41
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer)
42
+ -> Func_void_TradeExecutionResult
43
+ {
44
+ return Unmanaged<Func_void_TradeExecutionResult>.fromOpaque(pointer).takeRetainedValue()
45
+ }
46
+ }
@@ -18,13 +18,18 @@ public protocol HybridRNCandleSpec_protocol: HybridObject {
18
18
  showDynamicLoading: Bool, presentationBackground: PresentationBackground,
19
19
  presentationStyle: PresentationStyle, onSuccess: @escaping (_ account: LinkedAccount) -> Void)
20
20
  throws
21
+ func candleTradeExecutionSheet(
22
+ tradeQuote: TradeQuote, presentationBackground: PresentationBackground,
23
+ completion: @escaping (_ result: TradeExecutionResult) -> Void) throws
21
24
  func initialize(appUser: AppUser) throws
22
25
  func getLinkedAccounts() throws -> Promise<[LinkedAccount]>
23
- func unlinkAccount(linkedAccountID: String) throws -> Promise<Void>
26
+ func getLinkedAccount(ref: LinkedAccountRef) throws -> Promise<LinkedAccount>
27
+ func unlinkAccount(ref: LinkedAccountRef) throws -> Promise<Void>
24
28
  func getAssetAccounts(query: AssetAccountQuery) throws -> Promise<[AssetAccount]>
29
+ func getAssetAccount(ref: AssetAccountRef) throws -> Promise<AssetAccount>
25
30
  func getTrades(query: TradeQuery) throws -> Promise<[Trade]>
31
+ func getTrade(ref: TradeRef) throws -> Promise<Trade>
26
32
  func getTradeQuotes(request: TradeQuoteRequest) throws -> Promise<[TradeQuote]>
27
- func executeTrade(request: ExecuteTradeRequest) throws -> Promise<Trade>
28
33
  func deleteUser() throws -> Promise<Void>
29
34
  func getAvailableTools() throws -> Promise<[AnyMapHolder]>
30
35
  func executeTool(tool: ToolCall) throws -> Promise<String>
@@ -137,6 +137,29 @@ public class HybridRNCandleSpec_cxx {
137
137
  }
138
138
  }
139
139
 
140
+ @inline(__always)
141
+ public final func candleTradeExecutionSheet(
142
+ tradeQuote: TradeQuote, presentationBackground: Int32,
143
+ completion: bridge.Func_void_TradeExecutionResult
144
+ ) -> bridge.Result_void_ {
145
+ do {
146
+ try self.__implementation.candleTradeExecutionSheet(
147
+ tradeQuote: tradeQuote,
148
+ presentationBackground: margelo.nitro.rncandle.PresentationBackground(
149
+ rawValue: presentationBackground)!,
150
+ completion: { () -> (TradeExecutionResult) -> Void in
151
+ let __wrappedFunction = bridge.wrap_Func_void_TradeExecutionResult(completion)
152
+ return { (__result: TradeExecutionResult) -> Void in
153
+ __wrappedFunction.call(__result)
154
+ }
155
+ }())
156
+ return bridge.create_Result_void_()
157
+ } catch (let __error) {
158
+ let __exceptionPtr = __error.toCpp()
159
+ return bridge.create_Result_void_(__exceptionPtr)
160
+ }
161
+ }
162
+
140
163
  @inline(__always)
141
164
  public final func initialize(appUser: AppUser) -> bridge.Result_void_ {
142
165
  do {
@@ -181,12 +204,32 @@ public class HybridRNCandleSpec_cxx {
181
204
  }
182
205
 
183
206
  @inline(__always)
184
- public final func unlinkAccount(linkedAccountID: std.string)
207
+ public final func getLinkedAccount(ref: LinkedAccountRef)
208
+ -> bridge.Result_std__shared_ptr_Promise_LinkedAccount___
209
+ {
210
+ do {
211
+ let __result = try self.__implementation.getLinkedAccount(ref: ref)
212
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_LinkedAccount__ in
213
+ let __promise = bridge.create_std__shared_ptr_Promise_LinkedAccount__()
214
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_LinkedAccount__(__promise)
215
+ __result
216
+ .then({ __result in __promiseHolder.resolve(__result) })
217
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
218
+ return __promise
219
+ }()
220
+ return bridge.create_Result_std__shared_ptr_Promise_LinkedAccount___(__resultCpp)
221
+ } catch (let __error) {
222
+ let __exceptionPtr = __error.toCpp()
223
+ return bridge.create_Result_std__shared_ptr_Promise_LinkedAccount___(__exceptionPtr)
224
+ }
225
+ }
226
+
227
+ @inline(__always)
228
+ public final func unlinkAccount(ref: LinkedAccountRef)
185
229
  -> bridge.Result_std__shared_ptr_Promise_void___
186
230
  {
187
231
  do {
188
- let __result = try self.__implementation.unlinkAccount(
189
- linkedAccountID: String(linkedAccountID))
232
+ let __result = try self.__implementation.unlinkAccount(ref: ref)
190
233
  let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in
191
234
  let __promise = bridge.create_std__shared_ptr_Promise_void__()
192
235
  let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise)
@@ -234,6 +277,27 @@ public class HybridRNCandleSpec_cxx {
234
277
  }
235
278
  }
236
279
 
280
+ @inline(__always)
281
+ public final func getAssetAccount(ref: AssetAccountRef)
282
+ -> bridge.Result_std__shared_ptr_Promise_AssetAccount___
283
+ {
284
+ do {
285
+ let __result = try self.__implementation.getAssetAccount(ref: ref)
286
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_AssetAccount__ in
287
+ let __promise = bridge.create_std__shared_ptr_Promise_AssetAccount__()
288
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_AssetAccount__(__promise)
289
+ __result
290
+ .then({ __result in __promiseHolder.resolve(__result) })
291
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
292
+ return __promise
293
+ }()
294
+ return bridge.create_Result_std__shared_ptr_Promise_AssetAccount___(__resultCpp)
295
+ } catch (let __error) {
296
+ let __exceptionPtr = __error.toCpp()
297
+ return bridge.create_Result_std__shared_ptr_Promise_AssetAccount___(__exceptionPtr)
298
+ }
299
+ }
300
+
237
301
  @inline(__always)
238
302
  public final func getTrades(query: TradeQuery)
239
303
  -> bridge.Result_std__shared_ptr_Promise_std__vector_Trade____
@@ -264,6 +328,25 @@ public class HybridRNCandleSpec_cxx {
264
328
  }
265
329
  }
266
330
 
331
+ @inline(__always)
332
+ public final func getTrade(ref: TradeRef) -> bridge.Result_std__shared_ptr_Promise_Trade___ {
333
+ do {
334
+ let __result = try self.__implementation.getTrade(ref: ref)
335
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_Trade__ in
336
+ let __promise = bridge.create_std__shared_ptr_Promise_Trade__()
337
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_Trade__(__promise)
338
+ __result
339
+ .then({ __result in __promiseHolder.resolve(__result) })
340
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
341
+ return __promise
342
+ }()
343
+ return bridge.create_Result_std__shared_ptr_Promise_Trade___(__resultCpp)
344
+ } catch (let __error) {
345
+ let __exceptionPtr = __error.toCpp()
346
+ return bridge.create_Result_std__shared_ptr_Promise_Trade___(__exceptionPtr)
347
+ }
348
+ }
349
+
267
350
  @inline(__always)
268
351
  public final func getTradeQuotes(request: TradeQuoteRequest)
269
352
  -> bridge.Result_std__shared_ptr_Promise_std__vector_TradeQuote____
@@ -295,27 +378,6 @@ public class HybridRNCandleSpec_cxx {
295
378
  }
296
379
  }
297
380
 
298
- @inline(__always)
299
- public final func executeTrade(request: ExecuteTradeRequest)
300
- -> bridge.Result_std__shared_ptr_Promise_Trade___
301
- {
302
- do {
303
- let __result = try self.__implementation.executeTrade(request: request)
304
- let __resultCpp = { () -> bridge.std__shared_ptr_Promise_Trade__ in
305
- let __promise = bridge.create_std__shared_ptr_Promise_Trade__()
306
- let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_Trade__(__promise)
307
- __result
308
- .then({ __result in __promiseHolder.resolve(__result) })
309
- .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
310
- return __promise
311
- }()
312
- return bridge.create_Result_std__shared_ptr_Promise_Trade___(__resultCpp)
313
- } catch (let __error) {
314
- let __exceptionPtr = __error.toCpp()
315
- return bridge.create_Result_std__shared_ptr_Promise_Trade___(__exceptionPtr)
316
- }
317
- }
318
-
319
381
  @inline(__always)
320
382
  public final func deleteUser() -> bridge.Result_std__shared_ptr_Promise_void___ {
321
383
  do {