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
@@ -0,0 +1,33 @@
1
+ ///
2
+ /// LinkedAccountRef.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 `LinkedAccountRef`, backed by a C++ struct.
11
+ public typealias LinkedAccountRef = margelo.nitro.rncandle.LinkedAccountRef
12
+
13
+ extension LinkedAccountRef {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `LinkedAccountRef`.
18
+ */
19
+ public init(linkedAccountID: String) {
20
+ self.init(std.string(linkedAccountID))
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
+ }
@@ -0,0 +1,55 @@
1
+ ///
2
+ /// MarketTradeAssetRef.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 `MarketTradeAssetRef`, backed by a C++ struct.
11
+ public typealias MarketTradeAssetRef = margelo.nitro.rncandle.MarketTradeAssetRef
12
+
13
+ extension MarketTradeAssetRef {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `MarketTradeAssetRef`.
18
+ */
19
+ public init(assetKind: String, serviceTradeID: String, linkedAccountID: String) {
20
+ self.init(std.string(assetKind), std.string(serviceTradeID), std.string(linkedAccountID))
21
+ }
22
+
23
+ public var assetKind: String {
24
+ @inline(__always)
25
+ get {
26
+ return String(self.__assetKind)
27
+ }
28
+ @inline(__always)
29
+ set {
30
+ self.__assetKind = std.string(newValue)
31
+ }
32
+ }
33
+
34
+ public var serviceTradeID: String {
35
+ @inline(__always)
36
+ get {
37
+ return String(self.__serviceTradeID)
38
+ }
39
+ @inline(__always)
40
+ set {
41
+ self.__serviceTradeID = std.string(newValue)
42
+ }
43
+ }
44
+
45
+ public var linkedAccountID: String {
46
+ @inline(__always)
47
+ get {
48
+ return String(self.__linkedAccountID)
49
+ }
50
+ @inline(__always)
51
+ set {
52
+ self.__linkedAccountID = std.string(newValue)
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,33 @@
1
+ ///
2
+ /// NothingAssetRef.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 `NothingAssetRef`, backed by a C++ struct.
11
+ public typealias NothingAssetRef = margelo.nitro.rncandle.NothingAssetRef
12
+
13
+ extension NothingAssetRef {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `NothingAssetRef`.
18
+ */
19
+ public init(assetKind: String) {
20
+ self.init(std.string(assetKind))
21
+ }
22
+
23
+ public var assetKind: String {
24
+ @inline(__always)
25
+ get {
26
+ return String(self.__assetKind)
27
+ }
28
+ @inline(__always)
29
+ set {
30
+ self.__assetKind = std.string(newValue)
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,33 @@
1
+ ///
2
+ /// OtherAssetRef.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 `OtherAssetRef`, backed by a C++ struct.
11
+ public typealias OtherAssetRef = margelo.nitro.rncandle.OtherAssetRef
12
+
13
+ extension OtherAssetRef {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `OtherAssetRef`.
18
+ */
19
+ public init(assetKind: String) {
20
+ self.init(std.string(assetKind))
21
+ }
22
+
23
+ public var assetKind: String {
24
+ @inline(__always)
25
+ get {
26
+ return String(self.__assetKind)
27
+ }
28
+ @inline(__always)
29
+ set {
30
+ self.__assetKind = std.string(newValue)
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,176 @@
1
+ ///
2
+ /// TradeAssetRef.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 `TradeAssetRef`, backed by a C++ struct.
11
+ public typealias TradeAssetRef = margelo.nitro.rncandle.TradeAssetRef
12
+
13
+ extension TradeAssetRef {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `TradeAssetRef`.
18
+ */
19
+ public init(
20
+ fiatAssetRef: FiatAssetRef?, marketTradeAssetRef: MarketTradeAssetRef?,
21
+ transportAssetRef: TransportAssetRef?, otherAssetRef: OtherAssetRef?,
22
+ nothingAssetRef: NothingAssetRef?
23
+ ) {
24
+ self.init(
25
+ { () -> bridge.std__optional_FiatAssetRef_ in
26
+ if let __unwrappedValue = fiatAssetRef {
27
+ return bridge.create_std__optional_FiatAssetRef_(__unwrappedValue)
28
+ } else {
29
+ return .init()
30
+ }
31
+ }(),
32
+ { () -> bridge.std__optional_MarketTradeAssetRef_ in
33
+ if let __unwrappedValue = marketTradeAssetRef {
34
+ return bridge.create_std__optional_MarketTradeAssetRef_(__unwrappedValue)
35
+ } else {
36
+ return .init()
37
+ }
38
+ }(),
39
+ { () -> bridge.std__optional_TransportAssetRef_ in
40
+ if let __unwrappedValue = transportAssetRef {
41
+ return bridge.create_std__optional_TransportAssetRef_(__unwrappedValue)
42
+ } else {
43
+ return .init()
44
+ }
45
+ }(),
46
+ { () -> bridge.std__optional_OtherAssetRef_ in
47
+ if let __unwrappedValue = otherAssetRef {
48
+ return bridge.create_std__optional_OtherAssetRef_(__unwrappedValue)
49
+ } else {
50
+ return .init()
51
+ }
52
+ }(),
53
+ { () -> bridge.std__optional_NothingAssetRef_ in
54
+ if let __unwrappedValue = nothingAssetRef {
55
+ return bridge.create_std__optional_NothingAssetRef_(__unwrappedValue)
56
+ } else {
57
+ return .init()
58
+ }
59
+ }())
60
+ }
61
+
62
+ public var fiatAssetRef: FiatAssetRef? {
63
+ @inline(__always)
64
+ get {
65
+ return { () -> FiatAssetRef? in
66
+ if let __unwrapped = self.__fiatAssetRef.value {
67
+ return __unwrapped
68
+ } else {
69
+ return nil
70
+ }
71
+ }()
72
+ }
73
+ @inline(__always)
74
+ set {
75
+ self.__fiatAssetRef = { () -> bridge.std__optional_FiatAssetRef_ in
76
+ if let __unwrappedValue = newValue {
77
+ return bridge.create_std__optional_FiatAssetRef_(__unwrappedValue)
78
+ } else {
79
+ return .init()
80
+ }
81
+ }()
82
+ }
83
+ }
84
+
85
+ public var marketTradeAssetRef: MarketTradeAssetRef? {
86
+ @inline(__always)
87
+ get {
88
+ return { () -> MarketTradeAssetRef? in
89
+ if let __unwrapped = self.__marketTradeAssetRef.value {
90
+ return __unwrapped
91
+ } else {
92
+ return nil
93
+ }
94
+ }()
95
+ }
96
+ @inline(__always)
97
+ set {
98
+ self.__marketTradeAssetRef = { () -> bridge.std__optional_MarketTradeAssetRef_ in
99
+ if let __unwrappedValue = newValue {
100
+ return bridge.create_std__optional_MarketTradeAssetRef_(__unwrappedValue)
101
+ } else {
102
+ return .init()
103
+ }
104
+ }()
105
+ }
106
+ }
107
+
108
+ public var transportAssetRef: TransportAssetRef? {
109
+ @inline(__always)
110
+ get {
111
+ return { () -> TransportAssetRef? in
112
+ if let __unwrapped = self.__transportAssetRef.value {
113
+ return __unwrapped
114
+ } else {
115
+ return nil
116
+ }
117
+ }()
118
+ }
119
+ @inline(__always)
120
+ set {
121
+ self.__transportAssetRef = { () -> bridge.std__optional_TransportAssetRef_ in
122
+ if let __unwrappedValue = newValue {
123
+ return bridge.create_std__optional_TransportAssetRef_(__unwrappedValue)
124
+ } else {
125
+ return .init()
126
+ }
127
+ }()
128
+ }
129
+ }
130
+
131
+ public var otherAssetRef: OtherAssetRef? {
132
+ @inline(__always)
133
+ get {
134
+ return { () -> OtherAssetRef? in
135
+ if let __unwrapped = self.__otherAssetRef.value {
136
+ return __unwrapped
137
+ } else {
138
+ return nil
139
+ }
140
+ }()
141
+ }
142
+ @inline(__always)
143
+ set {
144
+ self.__otherAssetRef = { () -> bridge.std__optional_OtherAssetRef_ in
145
+ if let __unwrappedValue = newValue {
146
+ return bridge.create_std__optional_OtherAssetRef_(__unwrappedValue)
147
+ } else {
148
+ return .init()
149
+ }
150
+ }()
151
+ }
152
+ }
153
+
154
+ public var nothingAssetRef: NothingAssetRef? {
155
+ @inline(__always)
156
+ get {
157
+ return { () -> NothingAssetRef? in
158
+ if let __unwrapped = self.__nothingAssetRef.value {
159
+ return __unwrapped
160
+ } else {
161
+ return nil
162
+ }
163
+ }()
164
+ }
165
+ @inline(__always)
166
+ set {
167
+ self.__nothingAssetRef = { () -> bridge.std__optional_NothingAssetRef_ in
168
+ if let __unwrappedValue = newValue {
169
+ return bridge.create_std__optional_NothingAssetRef_(__unwrappedValue)
170
+ } else {
171
+ return .init()
172
+ }
173
+ }()
174
+ }
175
+ }
176
+ }
@@ -0,0 +1,82 @@
1
+ ///
2
+ /// 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
+ /// Represents an instance of `TradeExecutionResult`, backed by a C++ struct.
11
+ public typealias TradeExecutionResult = margelo.nitro.rncandle.TradeExecutionResult
12
+
13
+ extension TradeExecutionResult {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `TradeExecutionResult`.
18
+ */
19
+ public init(trade: Trade?, error: String?) {
20
+ self.init(
21
+ { () -> bridge.std__optional_Trade_ in
22
+ if let __unwrappedValue = trade {
23
+ return bridge.create_std__optional_Trade_(__unwrappedValue)
24
+ } else {
25
+ return .init()
26
+ }
27
+ }(),
28
+ { () -> bridge.std__optional_std__string_ in
29
+ if let __unwrappedValue = error {
30
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
31
+ } else {
32
+ return .init()
33
+ }
34
+ }())
35
+ }
36
+
37
+ public var trade: Trade? {
38
+ @inline(__always)
39
+ get {
40
+ return { () -> Trade? in
41
+ if let __unwrapped = self.__trade.value {
42
+ return __unwrapped
43
+ } else {
44
+ return nil
45
+ }
46
+ }()
47
+ }
48
+ @inline(__always)
49
+ set {
50
+ self.__trade = { () -> bridge.std__optional_Trade_ in
51
+ if let __unwrappedValue = newValue {
52
+ return bridge.create_std__optional_Trade_(__unwrappedValue)
53
+ } else {
54
+ return .init()
55
+ }
56
+ }()
57
+ }
58
+ }
59
+
60
+ public var error: String? {
61
+ @inline(__always)
62
+ get {
63
+ return { () -> String? in
64
+ if let __unwrapped = self.__error.value {
65
+ return String(__unwrapped)
66
+ } else {
67
+ return nil
68
+ }
69
+ }()
70
+ }
71
+ @inline(__always)
72
+ set {
73
+ self.__error = { () -> bridge.std__optional_std__string_ in
74
+ if let __unwrappedValue = newValue {
75
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
76
+ } else {
77
+ return .init()
78
+ }
79
+ }()
80
+ }
81
+ }
82
+ }
@@ -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) {
20
- self.init(lost, gained)
19
+ public init(lost: TradeAsset, gained: TradeAsset, context: String) {
20
+ self.init(lost, gained, std.string(context))
21
21
  }
22
22
 
23
23
  public var lost: TradeAsset {
@@ -41,4 +41,15 @@ extension TradeQuote {
41
41
  self.__gained = newValue
42
42
  }
43
43
  }
44
+
45
+ public var context: String {
46
+ @inline(__always)
47
+ get {
48
+ return String(self.__context)
49
+ }
50
+ @inline(__always)
51
+ set {
52
+ self.__context = std.string(newValue)
53
+ }
54
+ }
44
55
  }
@@ -0,0 +1,44 @@
1
+ ///
2
+ /// TradeRef.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 `TradeRef`, backed by a C++ struct.
11
+ public typealias TradeRef = margelo.nitro.rncandle.TradeRef
12
+
13
+ extension TradeRef {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `TradeRef`.
18
+ */
19
+ public init(lost: TradeAssetRef, gained: TradeAssetRef) {
20
+ self.init(lost, gained)
21
+ }
22
+
23
+ public var lost: TradeAssetRef {
24
+ @inline(__always)
25
+ get {
26
+ return self.__lost
27
+ }
28
+ @inline(__always)
29
+ set {
30
+ self.__lost = newValue
31
+ }
32
+ }
33
+
34
+ public var gained: TradeAssetRef {
35
+ @inline(__always)
36
+ get {
37
+ return self.__gained
38
+ }
39
+ @inline(__always)
40
+ set {
41
+ self.__gained = newValue
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,55 @@
1
+ ///
2
+ /// TransportAssetRef.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+ /// Represents an instance of `TransportAssetRef`, backed by a C++ struct.
11
+ public typealias TransportAssetRef = margelo.nitro.rncandle.TransportAssetRef
12
+
13
+ extension TransportAssetRef {
14
+ private typealias bridge = margelo.nitro.rncandle.bridge.swift
15
+
16
+ /**
17
+ * Create a new instance of `TransportAssetRef`.
18
+ */
19
+ public init(assetKind: String, serviceTradeID: String, linkedAccountID: String) {
20
+ self.init(std.string(assetKind), std.string(serviceTradeID), std.string(linkedAccountID))
21
+ }
22
+
23
+ public var assetKind: String {
24
+ @inline(__always)
25
+ get {
26
+ return String(self.__assetKind)
27
+ }
28
+ @inline(__always)
29
+ set {
30
+ self.__assetKind = std.string(newValue)
31
+ }
32
+ }
33
+
34
+ public var serviceTradeID: String {
35
+ @inline(__always)
36
+ get {
37
+ return String(self.__serviceTradeID)
38
+ }
39
+ @inline(__always)
40
+ set {
41
+ self.__serviceTradeID = std.string(newValue)
42
+ }
43
+ }
44
+
45
+ public var linkedAccountID: String {
46
+ @inline(__always)
47
+ get {
48
+ return String(self.__linkedAccountID)
49
+ }
50
+ @inline(__always)
51
+ set {
52
+ self.__linkedAccountID = std.string(newValue)
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,77 @@
1
+ ///
2
+ /// AssetAccountRef.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::rncandle {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (AssetAccountRef).
29
+ */
30
+ struct AssetAccountRef {
31
+ public:
32
+ std::string linkedAccountID SWIFT_PRIVATE;
33
+ std::string assetKind SWIFT_PRIVATE;
34
+ std::string serviceAccountID SWIFT_PRIVATE;
35
+
36
+ public:
37
+ AssetAccountRef() = default;
38
+ explicit AssetAccountRef(std::string linkedAccountID, std::string assetKind, std::string serviceAccountID): linkedAccountID(linkedAccountID), assetKind(assetKind), serviceAccountID(serviceAccountID) {}
39
+ };
40
+
41
+ } // namespace margelo::nitro::rncandle
42
+
43
+ namespace margelo::nitro {
44
+
45
+ using namespace margelo::nitro::rncandle;
46
+
47
+ // C++ AssetAccountRef <> JS AssetAccountRef (object)
48
+ template <>
49
+ struct JSIConverter<AssetAccountRef> final {
50
+ static inline AssetAccountRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
51
+ jsi::Object obj = arg.asObject(runtime);
52
+ return AssetAccountRef(
53
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID")),
54
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
55
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "serviceAccountID"))
56
+ );
57
+ }
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const AssetAccountRef& arg) {
59
+ jsi::Object obj(runtime);
60
+ obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
61
+ obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
62
+ obj.setProperty(runtime, "serviceAccountID", JSIConverter<std::string>::toJSI(runtime, arg.serviceAccountID));
63
+ return obj;
64
+ }
65
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
66
+ if (!value.isObject()) {
67
+ return false;
68
+ }
69
+ jsi::Object obj = value.getObject(runtime);
70
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
71
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
72
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "serviceAccountID"))) return false;
73
+ return true;
74
+ }
75
+ };
76
+
77
+ } // namespace margelo::nitro
@@ -0,0 +1,78 @@
1
+ ///
2
+ /// FiatAssetRef.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+ #include <optional>
25
+
26
+ namespace margelo::nitro::rncandle {
27
+
28
+ /**
29
+ * A struct which can be represented as a JavaScript object (FiatAssetRef).
30
+ */
31
+ struct FiatAssetRef {
32
+ public:
33
+ std::string assetKind SWIFT_PRIVATE;
34
+ std::optional<std::string> serviceTradeID SWIFT_PRIVATE;
35
+ std::string linkedAccountID SWIFT_PRIVATE;
36
+
37
+ public:
38
+ FiatAssetRef() = default;
39
+ explicit FiatAssetRef(std::string assetKind, std::optional<std::string> serviceTradeID, std::string linkedAccountID): assetKind(assetKind), serviceTradeID(serviceTradeID), linkedAccountID(linkedAccountID) {}
40
+ };
41
+
42
+ } // namespace margelo::nitro::rncandle
43
+
44
+ namespace margelo::nitro {
45
+
46
+ using namespace margelo::nitro::rncandle;
47
+
48
+ // C++ FiatAssetRef <> JS FiatAssetRef (object)
49
+ template <>
50
+ struct JSIConverter<FiatAssetRef> final {
51
+ static inline FiatAssetRef fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
52
+ jsi::Object obj = arg.asObject(runtime);
53
+ return FiatAssetRef(
54
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind")),
55
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "serviceTradeID")),
56
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID"))
57
+ );
58
+ }
59
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const FiatAssetRef& arg) {
60
+ jsi::Object obj(runtime);
61
+ obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
62
+ obj.setProperty(runtime, "serviceTradeID", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.serviceTradeID));
63
+ obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
64
+ return obj;
65
+ }
66
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
67
+ if (!value.isObject()) {
68
+ return false;
69
+ }
70
+ jsi::Object obj = value.getObject(runtime);
71
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
72
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "serviceTradeID"))) return false;
73
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
74
+ return true;
75
+ }
76
+ };
77
+
78
+ } // namespace margelo::nitro