react-native-candle 0.1.27 → 0.1.29

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 (42) hide show
  1. package/ReactNativeCandle.podspec +1 -1
  2. package/ios/Sources/CandleLinkSheetWrapperView.swift +4 -4
  3. package/ios/Sources/RNCandle.swift +76 -36
  4. package/lib/commonjs/index.js +47 -27
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/module/index.js +47 -27
  7. package/lib/module/index.js.map +1 -1
  8. package/lib/typescript/commonjs/src/index.d.ts +16 -6
  9. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  10. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +28 -6
  11. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts.map +1 -1
  12. package/lib/typescript/module/src/index.d.ts +16 -6
  13. package/lib/typescript/module/src/index.d.ts.map +1 -1
  14. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +28 -6
  15. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts.map +1 -1
  16. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.cpp +12 -12
  17. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.hpp +98 -72
  18. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Umbrella.hpp +15 -0
  19. package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +20 -5
  20. package/nitrogen/generated/ios/swift/AssetAccountsResponse.swift +70 -0
  21. package/nitrogen/generated/ios/swift/{Func_void_std__vector_TradeQuote_.swift → Func_void_AssetAccountsResponse.swift} +11 -11
  22. package/nitrogen/generated/ios/swift/{Func_void_std__vector_AssetAccount_.swift → Func_void_TradeQuotesResponse.swift} +11 -12
  23. package/nitrogen/generated/ios/swift/{Func_void_std__vector_Trade_.swift → Func_void_TradesResponse.swift} +11 -12
  24. package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +4 -4
  25. package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +33 -53
  26. package/nitrogen/generated/ios/swift/LinkedAccountStatusRef.swift +67 -0
  27. package/nitrogen/generated/ios/swift/StatePayload.swift +42 -0
  28. package/nitrogen/generated/ios/swift/TradeQuote.swift +13 -2
  29. package/nitrogen/generated/ios/swift/TradeQuotesResponse.swift +70 -0
  30. package/nitrogen/generated/ios/swift/TradesResponse.swift +70 -0
  31. package/nitrogen/generated/ios/swift/TransportAsset.swift +25 -2
  32. package/nitrogen/generated/shared/c++/AssetAccountsResponse.hpp +78 -0
  33. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +19 -10
  34. package/nitrogen/generated/shared/c++/LinkedAccountStatusRef.hpp +86 -0
  35. package/nitrogen/generated/shared/c++/StatePayload.hpp +82 -0
  36. package/nitrogen/generated/shared/c++/TradeQuote.hpp +6 -2
  37. package/nitrogen/generated/shared/c++/TradeQuotesResponse.hpp +78 -0
  38. package/nitrogen/generated/shared/c++/TradesResponse.hpp +78 -0
  39. package/nitrogen/generated/shared/c++/TransportAsset.hpp +9 -1
  40. package/package.json +1 -1
  41. package/src/index.ts +52 -25
  42. package/src/specs/RNCandle.nitro.ts +33 -6
@@ -1,5 +1,5 @@
1
1
  ///
2
- /// Func_void_std__vector_AssetAccount_.swift
2
+ /// Func_void_TradeQuotesResponse.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
5
  /// Copyright © 2025 Marc Rousavy @ Margelo
@@ -7,20 +7,20 @@
7
7
 
8
8
  import NitroModules
9
9
 
10
- /// Wraps a Swift `(_ value: [AssetAccount]) -> Void` as a class.
10
+ /// Wraps a Swift `(_ value: TradeQuotesResponse) -> 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
- public final class Func_void_std__vector_AssetAccount_ {
12
+ public final class Func_void_TradeQuotesResponse {
13
13
  public typealias bridge = margelo.nitro.rncandle.bridge.swift
14
14
 
15
- private let closure: (_ value: [AssetAccount]) -> Void
15
+ private let closure: (_ value: TradeQuotesResponse) -> Void
16
16
 
17
- public init(_ closure: @escaping (_ value: [AssetAccount]) -> Void) {
17
+ public init(_ closure: @escaping (_ value: TradeQuotesResponse) -> Void) {
18
18
  self.closure = closure
19
19
  }
20
20
 
21
21
  @inline(__always)
22
- public func call(value: bridge.std__vector_AssetAccount_) {
23
- self.closure(value.map({ __item in __item }))
22
+ public func call(value: TradeQuotesResponse) {
23
+ self.closure(value)
24
24
  }
25
25
 
26
26
  /**
@@ -33,14 +33,13 @@ public final class Func_void_std__vector_AssetAccount_ {
33
33
  }
34
34
 
35
35
  /**
36
- * Casts an unsafe pointer to a `Func_void_std__vector_AssetAccount_`.
37
- * The pointer has to be a retained opaque `Unmanaged<Func_void_std__vector_AssetAccount_>`.
36
+ * Casts an unsafe pointer to a `Func_void_TradeQuotesResponse`.
37
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_TradeQuotesResponse>`.
38
38
  * This removes one strong reference from the object!
39
39
  */
40
40
  @inline(__always)
41
- public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer)
42
- -> Func_void_std__vector_AssetAccount_
41
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_TradeQuotesResponse
43
42
  {
44
- return Unmanaged<Func_void_std__vector_AssetAccount_>.fromOpaque(pointer).takeRetainedValue()
43
+ return Unmanaged<Func_void_TradeQuotesResponse>.fromOpaque(pointer).takeRetainedValue()
45
44
  }
46
45
  }
@@ -1,5 +1,5 @@
1
1
  ///
2
- /// Func_void_std__vector_Trade_.swift
2
+ /// Func_void_TradesResponse.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
5
  /// Copyright © 2025 Marc Rousavy @ Margelo
@@ -7,20 +7,20 @@
7
7
 
8
8
  import NitroModules
9
9
 
10
- /// Wraps a Swift `(_ value: [Trade]) -> Void` as a class.
10
+ /// Wraps a Swift `(_ value: TradesResponse) -> 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
- public final class Func_void_std__vector_Trade_ {
12
+ public final class Func_void_TradesResponse {
13
13
  public typealias bridge = margelo.nitro.rncandle.bridge.swift
14
14
 
15
- private let closure: (_ value: [Trade]) -> Void
15
+ private let closure: (_ value: TradesResponse) -> Void
16
16
 
17
- public init(_ closure: @escaping (_ value: [Trade]) -> Void) {
17
+ public init(_ closure: @escaping (_ value: TradesResponse) -> Void) {
18
18
  self.closure = closure
19
19
  }
20
20
 
21
21
  @inline(__always)
22
- public func call(value: bridge.std__vector_Trade_) {
23
- self.closure(value.map({ __item in __item }))
22
+ public func call(value: TradesResponse) {
23
+ self.closure(value)
24
24
  }
25
25
 
26
26
  /**
@@ -33,13 +33,12 @@ public final class Func_void_std__vector_Trade_ {
33
33
  }
34
34
 
35
35
  /**
36
- * Casts an unsafe pointer to a `Func_void_std__vector_Trade_`.
37
- * The pointer has to be a retained opaque `Unmanaged<Func_void_std__vector_Trade_>`.
36
+ * Casts an unsafe pointer to a `Func_void_TradesResponse`.
37
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_TradesResponse>`.
38
38
  * This removes one strong reference from the object!
39
39
  */
40
40
  @inline(__always)
41
- public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_Trade_
42
- {
43
- return Unmanaged<Func_void_std__vector_Trade_>.fromOpaque(pointer).takeRetainedValue()
41
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_TradesResponse {
42
+ return Unmanaged<Func_void_TradesResponse>.fromOpaque(pointer).takeRetainedValue()
44
43
  }
45
44
  }
@@ -21,15 +21,15 @@ public protocol HybridRNCandleSpec_protocol: HybridObject {
21
21
  func candleTradeExecutionSheet(
22
22
  tradeQuote: TradeQuote, presentationBackground: PresentationBackground,
23
23
  completion: @escaping (_ result: TradeExecutionResult) -> Void) throws
24
- func initialize(appUser: AppUser) throws
24
+ func initialize(appUser: AppUser, accessGroup: String?) throws
25
25
  func getLinkedAccounts() throws -> Promise<[LinkedAccount]>
26
26
  func getLinkedAccount(ref: LinkedAccountRef) throws -> Promise<LinkedAccount>
27
27
  func unlinkAccount(ref: LinkedAccountRef) throws -> Promise<Void>
28
- func getAssetAccounts(query: AssetAccountQuery) throws -> Promise<[AssetAccount]>
28
+ func getAssetAccounts(query: AssetAccountQuery) throws -> Promise<AssetAccountsResponse>
29
29
  func getAssetAccount(ref: AssetAccountRef) throws -> Promise<AssetAccount>
30
- func getTrades(query: TradeQuery) throws -> Promise<[Trade]>
30
+ func getTrades(query: TradeQuery) throws -> Promise<TradesResponse>
31
31
  func getTrade(ref: TradeRef) throws -> Promise<Trade>
32
- func getTradeQuotes(request: TradeQuoteRequest) throws -> Promise<[TradeQuote]>
32
+ func getTradeQuotes(request: TradeQuoteRequest) throws -> Promise<TradeQuotesResponse>
33
33
  func deleteUser() throws -> Promise<Void>
34
34
  func getAvailableTools() throws -> Promise<[AnyMapHolder]>
35
35
  func executeTool(tool: ToolCall) throws -> Promise<String>
@@ -161,9 +161,19 @@ public class HybridRNCandleSpec_cxx {
161
161
  }
162
162
 
163
163
  @inline(__always)
164
- public final func initialize(appUser: AppUser) -> bridge.Result_void_ {
164
+ public final func initialize(appUser: AppUser, accessGroup: bridge.std__optional_std__string_)
165
+ -> bridge.Result_void_
166
+ {
165
167
  do {
166
- try self.__implementation.initialize(appUser: appUser)
168
+ try self.__implementation.initialize(
169
+ appUser: appUser,
170
+ accessGroup: { () -> String? in
171
+ if let __unwrapped = accessGroup.value {
172
+ return String(__unwrapped)
173
+ } else {
174
+ return nil
175
+ }
176
+ }())
167
177
  return bridge.create_Result_void_()
168
178
  } catch (let __error) {
169
179
  let __exceptionPtr = __error.toCpp()
@@ -247,33 +257,22 @@ public class HybridRNCandleSpec_cxx {
247
257
 
248
258
  @inline(__always)
249
259
  public final func getAssetAccounts(query: AssetAccountQuery)
250
- -> bridge.Result_std__shared_ptr_Promise_std__vector_AssetAccount____
260
+ -> bridge.Result_std__shared_ptr_Promise_AssetAccountsResponse___
251
261
  {
252
262
  do {
253
263
  let __result = try self.__implementation.getAssetAccounts(query: query)
254
- let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_AssetAccount___ in
255
- let __promise = bridge.create_std__shared_ptr_Promise_std__vector_AssetAccount___()
256
- let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_AssetAccount___(
257
- __promise)
264
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_AssetAccountsResponse__ in
265
+ let __promise = bridge.create_std__shared_ptr_Promise_AssetAccountsResponse__()
266
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_AssetAccountsResponse__(__promise)
258
267
  __result
259
- .then({ __result in
260
- __promiseHolder.resolve(
261
- { () -> bridge.std__vector_AssetAccount_ in
262
- var __vector = bridge.create_std__vector_AssetAccount_(__result.count)
263
- for __item in __result {
264
- __vector.push_back(__item)
265
- }
266
- return __vector
267
- }())
268
- })
268
+ .then({ __result in __promiseHolder.resolve(__result) })
269
269
  .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
270
270
  return __promise
271
271
  }()
272
- return bridge.create_Result_std__shared_ptr_Promise_std__vector_AssetAccount____(__resultCpp)
272
+ return bridge.create_Result_std__shared_ptr_Promise_AssetAccountsResponse___(__resultCpp)
273
273
  } catch (let __error) {
274
274
  let __exceptionPtr = __error.toCpp()
275
- return bridge.create_Result_std__shared_ptr_Promise_std__vector_AssetAccount____(
276
- __exceptionPtr)
275
+ return bridge.create_Result_std__shared_ptr_Promise_AssetAccountsResponse___(__exceptionPtr)
277
276
  }
278
277
  }
279
278
 
@@ -300,31 +299,22 @@ public class HybridRNCandleSpec_cxx {
300
299
 
301
300
  @inline(__always)
302
301
  public final func getTrades(query: TradeQuery)
303
- -> bridge.Result_std__shared_ptr_Promise_std__vector_Trade____
302
+ -> bridge.Result_std__shared_ptr_Promise_TradesResponse___
304
303
  {
305
304
  do {
306
305
  let __result = try self.__implementation.getTrades(query: query)
307
- let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_Trade___ in
308
- let __promise = bridge.create_std__shared_ptr_Promise_std__vector_Trade___()
309
- let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_Trade___(__promise)
306
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_TradesResponse__ in
307
+ let __promise = bridge.create_std__shared_ptr_Promise_TradesResponse__()
308
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_TradesResponse__(__promise)
310
309
  __result
311
- .then({ __result in
312
- __promiseHolder.resolve(
313
- { () -> bridge.std__vector_Trade_ in
314
- var __vector = bridge.create_std__vector_Trade_(__result.count)
315
- for __item in __result {
316
- __vector.push_back(__item)
317
- }
318
- return __vector
319
- }())
320
- })
310
+ .then({ __result in __promiseHolder.resolve(__result) })
321
311
  .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
322
312
  return __promise
323
313
  }()
324
- return bridge.create_Result_std__shared_ptr_Promise_std__vector_Trade____(__resultCpp)
314
+ return bridge.create_Result_std__shared_ptr_Promise_TradesResponse___(__resultCpp)
325
315
  } catch (let __error) {
326
316
  let __exceptionPtr = __error.toCpp()
327
- return bridge.create_Result_std__shared_ptr_Promise_std__vector_Trade____(__exceptionPtr)
317
+ return bridge.create_Result_std__shared_ptr_Promise_TradesResponse___(__exceptionPtr)
328
318
  }
329
319
  }
330
320
 
@@ -349,32 +339,22 @@ public class HybridRNCandleSpec_cxx {
349
339
 
350
340
  @inline(__always)
351
341
  public final func getTradeQuotes(request: TradeQuoteRequest)
352
- -> bridge.Result_std__shared_ptr_Promise_std__vector_TradeQuote____
342
+ -> bridge.Result_std__shared_ptr_Promise_TradeQuotesResponse___
353
343
  {
354
344
  do {
355
345
  let __result = try self.__implementation.getTradeQuotes(request: request)
356
- let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_TradeQuote___ in
357
- let __promise = bridge.create_std__shared_ptr_Promise_std__vector_TradeQuote___()
358
- let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_TradeQuote___(
359
- __promise)
346
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_TradeQuotesResponse__ in
347
+ let __promise = bridge.create_std__shared_ptr_Promise_TradeQuotesResponse__()
348
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_TradeQuotesResponse__(__promise)
360
349
  __result
361
- .then({ __result in
362
- __promiseHolder.resolve(
363
- { () -> bridge.std__vector_TradeQuote_ in
364
- var __vector = bridge.create_std__vector_TradeQuote_(__result.count)
365
- for __item in __result {
366
- __vector.push_back(__item)
367
- }
368
- return __vector
369
- }())
370
- })
350
+ .then({ __result in __promiseHolder.resolve(__result) })
371
351
  .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
372
352
  return __promise
373
353
  }()
374
- return bridge.create_Result_std__shared_ptr_Promise_std__vector_TradeQuote____(__resultCpp)
354
+ return bridge.create_Result_std__shared_ptr_Promise_TradeQuotesResponse___(__resultCpp)
375
355
  } catch (let __error) {
376
356
  let __exceptionPtr = __error.toCpp()
377
- return bridge.create_Result_std__shared_ptr_Promise_std__vector_TradeQuote____(__exceptionPtr)
357
+ return bridge.create_Result_std__shared_ptr_Promise_TradeQuotesResponse___(__exceptionPtr)
378
358
  }
379
359
  }
380
360
 
@@ -0,0 +1,67 @@
1
+ ///
2
+ /// LinkedAccountStatusRef.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 `LinkedAccountStatusRef`, backed by a C++ struct.
11
+ public typealias LinkedAccountStatusRef = margelo.nitro.rncandle.LinkedAccountStatusRef
12
+
13
+ extension LinkedAccountStatusRef {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `LinkedAccountStatusRef`.
18
+ */
19
+ public init(linkedAccountID: String, service: Service, serviceUserID: String, state: StatePayload)
20
+ {
21
+ self.init(std.string(linkedAccountID), service, std.string(serviceUserID), state)
22
+ }
23
+
24
+ public var linkedAccountID: String {
25
+ @inline(__always)
26
+ get {
27
+ return String(self.__linkedAccountID)
28
+ }
29
+ @inline(__always)
30
+ set {
31
+ self.__linkedAccountID = std.string(newValue)
32
+ }
33
+ }
34
+
35
+ public var service: Service {
36
+ @inline(__always)
37
+ get {
38
+ return self.__service
39
+ }
40
+ @inline(__always)
41
+ set {
42
+ self.__service = newValue
43
+ }
44
+ }
45
+
46
+ public var serviceUserID: String {
47
+ @inline(__always)
48
+ get {
49
+ return String(self.__serviceUserID)
50
+ }
51
+ @inline(__always)
52
+ set {
53
+ self.__serviceUserID = std.string(newValue)
54
+ }
55
+ }
56
+
57
+ public var state: StatePayload {
58
+ @inline(__always)
59
+ get {
60
+ return self.__state
61
+ }
62
+ @inline(__always)
63
+ set {
64
+ self.__state = newValue
65
+ }
66
+ }
67
+ }
@@ -0,0 +1,42 @@
1
+ ///
2
+ /// StatePayload.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
+ /// Represents the JS union `StatePayload`, backed by a C++ enum.
9
+ public typealias StatePayload = margelo.nitro.rncandle.StatePayload
10
+
11
+ extension StatePayload {
12
+ /**
13
+ * Get a StatePayload for the given String value, or
14
+ * return `nil` if the given value was invalid/unknown.
15
+ */
16
+ public init?(fromString string: String) {
17
+ switch string {
18
+ case "active":
19
+ self = .active
20
+ case "inactive":
21
+ self = .inactive
22
+ case "unavailable":
23
+ self = .unavailable
24
+ default:
25
+ return nil
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Get the String value this StatePayload represents.
31
+ */
32
+ public var stringValue: String {
33
+ switch self {
34
+ case .active:
35
+ return "active"
36
+ case .inactive:
37
+ return "inactive"
38
+ case .unavailable:
39
+ return "unavailable"
40
+ }
41
+ }
42
+ }
@@ -16,8 +16,8 @@ extension TradeQuote {
16
16
  /**
17
17
  * Create a new instance of `TradeQuote`.
18
18
  */
19
- public init(lost: TradeAsset, gained: TradeAsset, context: String) {
20
- self.init(lost, gained, std.string(context))
19
+ public init(lost: TradeAsset, gained: TradeAsset, context: String, expirationDateTime: String) {
20
+ self.init(lost, gained, std.string(context), std.string(expirationDateTime))
21
21
  }
22
22
 
23
23
  public var lost: TradeAsset {
@@ -52,4 +52,15 @@ extension TradeQuote {
52
52
  self.__context = std.string(newValue)
53
53
  }
54
54
  }
55
+
56
+ public var expirationDateTime: String {
57
+ @inline(__always)
58
+ get {
59
+ return String(self.__expirationDateTime)
60
+ }
61
+ @inline(__always)
62
+ set {
63
+ self.__expirationDateTime = std.string(newValue)
64
+ }
65
+ }
55
66
  }
@@ -0,0 +1,70 @@
1
+ ///
2
+ /// TradeQuotesResponse.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 `TradeQuotesResponse`, backed by a C++ struct.
11
+ public typealias TradeQuotesResponse = margelo.nitro.rncandle.TradeQuotesResponse
12
+
13
+ extension TradeQuotesResponse {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `TradeQuotesResponse`.
18
+ */
19
+ public init(linkedAccounts: [LinkedAccountStatusRef], tradeQuotes: [TradeQuote]) {
20
+ self.init(
21
+ { () -> bridge.std__vector_LinkedAccountStatusRef_ in
22
+ var __vector = bridge.create_std__vector_LinkedAccountStatusRef_(linkedAccounts.count)
23
+ for __item in linkedAccounts {
24
+ __vector.push_back(__item)
25
+ }
26
+ return __vector
27
+ }(),
28
+ { () -> bridge.std__vector_TradeQuote_ in
29
+ var __vector = bridge.create_std__vector_TradeQuote_(tradeQuotes.count)
30
+ for __item in tradeQuotes {
31
+ __vector.push_back(__item)
32
+ }
33
+ return __vector
34
+ }())
35
+ }
36
+
37
+ public var linkedAccounts: [LinkedAccountStatusRef] {
38
+ @inline(__always)
39
+ get {
40
+ return self.__linkedAccounts.map({ __item in __item })
41
+ }
42
+ @inline(__always)
43
+ set {
44
+ self.__linkedAccounts = { () -> bridge.std__vector_LinkedAccountStatusRef_ in
45
+ var __vector = bridge.create_std__vector_LinkedAccountStatusRef_(newValue.count)
46
+ for __item in newValue {
47
+ __vector.push_back(__item)
48
+ }
49
+ return __vector
50
+ }()
51
+ }
52
+ }
53
+
54
+ public var tradeQuotes: [TradeQuote] {
55
+ @inline(__always)
56
+ get {
57
+ return self.__tradeQuotes.map({ __item in __item })
58
+ }
59
+ @inline(__always)
60
+ set {
61
+ self.__tradeQuotes = { () -> bridge.std__vector_TradeQuote_ in
62
+ var __vector = bridge.create_std__vector_TradeQuote_(newValue.count)
63
+ for __item in newValue {
64
+ __vector.push_back(__item)
65
+ }
66
+ return __vector
67
+ }()
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,70 @@
1
+ ///
2
+ /// TradesResponse.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 `TradesResponse`, backed by a C++ struct.
11
+ public typealias TradesResponse = margelo.nitro.rncandle.TradesResponse
12
+
13
+ extension TradesResponse {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `TradesResponse`.
18
+ */
19
+ public init(linkedAccounts: [LinkedAccountStatusRef], trades: [Trade]) {
20
+ self.init(
21
+ { () -> bridge.std__vector_LinkedAccountStatusRef_ in
22
+ var __vector = bridge.create_std__vector_LinkedAccountStatusRef_(linkedAccounts.count)
23
+ for __item in linkedAccounts {
24
+ __vector.push_back(__item)
25
+ }
26
+ return __vector
27
+ }(),
28
+ { () -> bridge.std__vector_Trade_ in
29
+ var __vector = bridge.create_std__vector_Trade_(trades.count)
30
+ for __item in trades {
31
+ __vector.push_back(__item)
32
+ }
33
+ return __vector
34
+ }())
35
+ }
36
+
37
+ public var linkedAccounts: [LinkedAccountStatusRef] {
38
+ @inline(__always)
39
+ get {
40
+ return self.__linkedAccounts.map({ __item in __item })
41
+ }
42
+ @inline(__always)
43
+ set {
44
+ self.__linkedAccounts = { () -> bridge.std__vector_LinkedAccountStatusRef_ in
45
+ var __vector = bridge.create_std__vector_LinkedAccountStatusRef_(newValue.count)
46
+ for __item in newValue {
47
+ __vector.push_back(__item)
48
+ }
49
+ return __vector
50
+ }()
51
+ }
52
+ }
53
+
54
+ public var trades: [Trade] {
55
+ @inline(__always)
56
+ get {
57
+ return self.__trades.map({ __item in __item })
58
+ }
59
+ @inline(__always)
60
+ set {
61
+ self.__trades = { () -> bridge.std__vector_Trade_ in
62
+ var __vector = bridge.create_std__vector_Trade_(newValue.count)
63
+ for __item in newValue {
64
+ __vector.push_back(__item)
65
+ }
66
+ return __vector
67
+ }()
68
+ }
69
+ }
70
+ }
@@ -20,12 +20,13 @@ extension TransportAsset {
20
20
  assetKind: String, serviceTradeID: String, serviceAssetID: String, name: String,
21
21
  description: String, imageURL: String, originCoordinates: Coordinates, originAddress: Address,
22
22
  destinationCoordinates: Coordinates, destinationAddress: Address, seats: Double,
23
- linkedAccountID: String, service: Service
23
+ departureDateTime: String, arrivalDateTime: String, linkedAccountID: String, service: Service
24
24
  ) {
25
25
  self.init(
26
26
  std.string(assetKind), std.string(serviceTradeID), std.string(serviceAssetID),
27
27
  std.string(name), std.string(description), std.string(imageURL), originCoordinates,
28
- originAddress, destinationCoordinates, destinationAddress, seats, std.string(linkedAccountID),
28
+ originAddress, destinationCoordinates, destinationAddress, seats,
29
+ std.string(departureDateTime), std.string(arrivalDateTime), std.string(linkedAccountID),
29
30
  service)
30
31
  }
31
32
 
@@ -150,6 +151,28 @@ extension TransportAsset {
150
151
  }
151
152
  }
152
153
 
154
+ public var departureDateTime: String {
155
+ @inline(__always)
156
+ get {
157
+ return String(self.__departureDateTime)
158
+ }
159
+ @inline(__always)
160
+ set {
161
+ self.__departureDateTime = std.string(newValue)
162
+ }
163
+ }
164
+
165
+ public var arrivalDateTime: String {
166
+ @inline(__always)
167
+ get {
168
+ return String(self.__arrivalDateTime)
169
+ }
170
+ @inline(__always)
171
+ set {
172
+ self.__arrivalDateTime = std.string(newValue)
173
+ }
174
+ }
175
+
153
176
  public var linkedAccountID: String {
154
177
  @inline(__always)
155
178
  get {
@@ -0,0 +1,78 @@
1
+ ///
2
+ /// AssetAccountsResponse.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 `LinkedAccountStatusRef` to properly resolve imports.
22
+ namespace margelo::nitro::rncandle { struct LinkedAccountStatusRef; }
23
+ // Forward declaration of `AssetAccount` to properly resolve imports.
24
+ namespace margelo::nitro::rncandle { struct AssetAccount; }
25
+
26
+ #include <vector>
27
+ #include "LinkedAccountStatusRef.hpp"
28
+ #include "AssetAccount.hpp"
29
+
30
+ namespace margelo::nitro::rncandle {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (AssetAccountsResponse).
34
+ */
35
+ struct AssetAccountsResponse {
36
+ public:
37
+ std::vector<LinkedAccountStatusRef> linkedAccounts SWIFT_PRIVATE;
38
+ std::vector<AssetAccount> assetAccounts SWIFT_PRIVATE;
39
+
40
+ public:
41
+ AssetAccountsResponse() = default;
42
+ explicit AssetAccountsResponse(std::vector<LinkedAccountStatusRef> linkedAccounts, std::vector<AssetAccount> assetAccounts): linkedAccounts(linkedAccounts), assetAccounts(assetAccounts) {}
43
+ };
44
+
45
+ } // namespace margelo::nitro::rncandle
46
+
47
+ namespace margelo::nitro {
48
+
49
+ using namespace margelo::nitro::rncandle;
50
+
51
+ // C++ AssetAccountsResponse <> JS AssetAccountsResponse (object)
52
+ template <>
53
+ struct JSIConverter<AssetAccountsResponse> final {
54
+ static inline AssetAccountsResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
55
+ jsi::Object obj = arg.asObject(runtime);
56
+ return AssetAccountsResponse(
57
+ JSIConverter<std::vector<LinkedAccountStatusRef>>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccounts")),
58
+ JSIConverter<std::vector<AssetAccount>>::fromJSI(runtime, obj.getProperty(runtime, "assetAccounts"))
59
+ );
60
+ }
61
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const AssetAccountsResponse& arg) {
62
+ jsi::Object obj(runtime);
63
+ obj.setProperty(runtime, "linkedAccounts", JSIConverter<std::vector<LinkedAccountStatusRef>>::toJSI(runtime, arg.linkedAccounts));
64
+ obj.setProperty(runtime, "assetAccounts", JSIConverter<std::vector<AssetAccount>>::toJSI(runtime, arg.assetAccounts));
65
+ return obj;
66
+ }
67
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
68
+ if (!value.isObject()) {
69
+ return false;
70
+ }
71
+ jsi::Object obj = value.getObject(runtime);
72
+ if (!JSIConverter<std::vector<LinkedAccountStatusRef>>::canConvert(runtime, obj.getProperty(runtime, "linkedAccounts"))) return false;
73
+ if (!JSIConverter<std::vector<AssetAccount>>::canConvert(runtime, obj.getProperty(runtime, "assetAccounts"))) return false;
74
+ return true;
75
+ }
76
+ };
77
+
78
+ } // namespace margelo::nitro