react-native-candle 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ReactNativeCandle.podspec +1 -1
- package/ios/Sources/CandleLinkSheetWrapperView.swift +2 -167
- package/ios/Sources/RNCandle.swift +542 -46
- package/lib/commonjs/index.js +157 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +157 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +79 -3
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +197 -9
- package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +79 -3
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +197 -9
- package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts.map +1 -1
- package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.cpp +36 -4
- package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.hpp +528 -35
- package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Umbrella.hpp +108 -6
- package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +122 -12
- package/nitrogen/generated/ios/swift/ACHAccountKind.swift +38 -0
- package/nitrogen/generated/ios/swift/ACHDetails.swift +55 -0
- package/nitrogen/generated/ios/swift/{Details.swift → ActiveLinkedAccountDetails.swift} +55 -22
- package/nitrogen/generated/ios/swift/Address.swift +33 -0
- package/nitrogen/generated/ios/swift/AssetAccount.swift +55 -0
- package/nitrogen/generated/ios/swift/AssetAccountDetails.swift +83 -0
- package/nitrogen/generated/ios/swift/AssetAccountKind.swift +42 -0
- package/nitrogen/generated/ios/swift/AssetAccountQuery.swift +76 -0
- package/nitrogen/generated/ios/swift/Coordinates.swift +44 -0
- package/nitrogen/generated/ios/swift/Counterparty.swift +115 -0
- package/nitrogen/generated/ios/swift/FiatAccountDetails.swift +165 -0
- package/nitrogen/generated/ios/swift/FiatAsset.swift +123 -0
- package/nitrogen/generated/ios/swift/FiatAssetQuoteRequest.swift +119 -0
- package/nitrogen/generated/ios/swift/Func_void_Trade.swift +44 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_AssetAccount_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_TradeQuote_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_Trade_.swift +45 -0
- package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +4 -3
- package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +79 -40
- package/nitrogen/generated/ios/swift/InactiveLinkedAccountDetails.swift +33 -0
- package/nitrogen/generated/ios/swift/LegalAccountKind.swift +46 -0
- package/nitrogen/generated/ios/swift/LinkedAccount.swift +16 -34
- package/nitrogen/generated/ios/swift/LinkedAccountDetails.swift +87 -0
- package/nitrogen/generated/ios/swift/MarketAccountDetails.swift +69 -0
- package/nitrogen/generated/ios/swift/MarketAssetQuoteRequest.swift +151 -0
- package/nitrogen/generated/ios/swift/MarketTradeAsset.swift +150 -0
- package/nitrogen/generated/ios/swift/MerchantCounterparty.swift +86 -0
- package/nitrogen/generated/ios/swift/MerchantLocation.swift +55 -0
- package/nitrogen/generated/ios/swift/NothingAsset.swift +33 -0
- package/nitrogen/generated/ios/swift/NothingAssetQuoteRequest.swift +33 -0
- package/nitrogen/generated/ios/swift/OtherAsset.swift +33 -0
- package/nitrogen/generated/ios/swift/ServiceCounterparty.swift +44 -0
- package/nitrogen/generated/ios/swift/Trade.swift +80 -0
- package/nitrogen/generated/ios/swift/TradeAsset.swift +175 -0
- package/nitrogen/generated/ios/swift/TradeAssetQuoteRequest.swift +148 -0
- package/nitrogen/generated/ios/swift/TradeQuery.swift +175 -0
- package/nitrogen/generated/ios/swift/TradeQuote.swift +44 -0
- package/nitrogen/generated/ios/swift/TradeQuoteRequest.swift +63 -0
- package/nitrogen/generated/ios/swift/TradeState.swift +42 -0
- package/nitrogen/generated/ios/swift/TransportAsset.swift +174 -0
- package/nitrogen/generated/ios/swift/TransportAssetQuoteRequest.swift +212 -0
- package/nitrogen/generated/ios/swift/UserCounterparty.swift +66 -0
- package/nitrogen/generated/ios/swift/WireDetails.swift +44 -0
- package/nitrogen/generated/shared/c++/{State.hpp → ACHAccountKind.hpp} +17 -17
- package/nitrogen/generated/shared/c++/ACHDetails.hpp +79 -0
- package/nitrogen/generated/shared/c++/{Details.hpp → ActiveLinkedAccountDetails.hpp} +25 -23
- package/nitrogen/generated/shared/c++/Address.hpp +69 -0
- package/nitrogen/generated/shared/c++/AssetAccount.hpp +82 -0
- package/nitrogen/generated/shared/c++/AssetAccountDetails.hpp +78 -0
- package/nitrogen/generated/shared/c++/AssetAccountKind.hpp +82 -0
- package/nitrogen/generated/shared/c++/AssetAccountQuery.hpp +76 -0
- package/nitrogen/generated/shared/c++/Coordinates.hpp +73 -0
- package/nitrogen/generated/shared/c++/Counterparty.hpp +85 -0
- package/nitrogen/generated/shared/c++/FiatAccountDetails.hpp +106 -0
- package/nitrogen/generated/shared/c++/FiatAsset.hpp +96 -0
- package/nitrogen/generated/shared/c++/FiatAssetQuoteRequest.hpp +82 -0
- package/nitrogen/generated/shared/c++/HybridRNCandleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +22 -3
- package/nitrogen/generated/shared/c++/InactiveLinkedAccountDetails.hpp +69 -0
- package/nitrogen/generated/shared/c++/LegalAccountKind.hpp +86 -0
- package/nitrogen/generated/shared/c++/LinkedAccount.hpp +13 -14
- package/nitrogen/generated/shared/c++/LinkedAccountDetails.hpp +78 -0
- package/nitrogen/generated/shared/c++/MarketAccountDetails.hpp +83 -0
- package/nitrogen/generated/shared/c++/MarketAssetQuoteRequest.hpp +86 -0
- package/nitrogen/generated/shared/c++/MarketTradeAsset.hpp +111 -0
- package/nitrogen/generated/shared/c++/MerchantCounterparty.hpp +84 -0
- package/nitrogen/generated/shared/c++/MerchantLocation.hpp +77 -0
- package/nitrogen/generated/shared/c++/NothingAsset.hpp +69 -0
- package/nitrogen/generated/shared/c++/NothingAssetQuoteRequest.hpp +69 -0
- package/nitrogen/generated/shared/c++/OtherAsset.hpp +69 -0
- package/nitrogen/generated/shared/c++/ServiceCounterparty.hpp +75 -0
- package/nitrogen/generated/shared/c++/Trade.hpp +93 -0
- package/nitrogen/generated/shared/c++/TradeAsset.hpp +99 -0
- package/nitrogen/generated/shared/c++/TradeAssetQuoteRequest.hpp +92 -0
- package/nitrogen/generated/shared/c++/TradeQuery.hpp +86 -0
- package/nitrogen/generated/shared/c++/TradeQuote.hpp +74 -0
- package/nitrogen/generated/shared/c++/TradeQuoteRequest.hpp +76 -0
- package/nitrogen/generated/shared/c++/TradeState.hpp +82 -0
- package/nitrogen/generated/shared/c++/TransportAsset.hpp +125 -0
- package/nitrogen/generated/shared/c++/TransportAssetQuoteRequest.hpp +99 -0
- package/nitrogen/generated/shared/c++/UserCounterparty.hpp +81 -0
- package/nitrogen/generated/shared/c++/WireDetails.hpp +73 -0
- package/package.json +1 -1
- package/src/index.ts +259 -3
- package/src/specs/RNCandle.nitro.ts +237 -10
- package/nitrogen/generated/ios/swift/State.swift +0 -38
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// OtherAsset.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 (OtherAsset).
|
|
29
|
+
*/
|
|
30
|
+
struct OtherAsset {
|
|
31
|
+
public:
|
|
32
|
+
std::string assetKind SWIFT_PRIVATE;
|
|
33
|
+
|
|
34
|
+
public:
|
|
35
|
+
OtherAsset() = default;
|
|
36
|
+
explicit OtherAsset(std::string assetKind): assetKind(assetKind) {}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
} // namespace margelo::nitro::rncandle
|
|
40
|
+
|
|
41
|
+
namespace margelo::nitro {
|
|
42
|
+
|
|
43
|
+
using namespace margelo::nitro::rncandle;
|
|
44
|
+
|
|
45
|
+
// C++ OtherAsset <> JS OtherAsset (object)
|
|
46
|
+
template <>
|
|
47
|
+
struct JSIConverter<OtherAsset> final {
|
|
48
|
+
static inline OtherAsset fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
49
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
50
|
+
return OtherAsset(
|
|
51
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "assetKind"))
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const OtherAsset& arg) {
|
|
55
|
+
jsi::Object obj(runtime);
|
|
56
|
+
obj.setProperty(runtime, "assetKind", JSIConverter<std::string>::toJSI(runtime, arg.assetKind));
|
|
57
|
+
return obj;
|
|
58
|
+
}
|
|
59
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
60
|
+
if (!value.isObject()) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
jsi::Object obj = value.getObject(runtime);
|
|
64
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "assetKind"))) return false;
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ServiceCounterparty.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
// Forward declaration of `Service` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rncandle { enum class Service; }
|
|
23
|
+
|
|
24
|
+
#include <string>
|
|
25
|
+
#include "Service.hpp"
|
|
26
|
+
|
|
27
|
+
namespace margelo::nitro::rncandle {
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A struct which can be represented as a JavaScript object (ServiceCounterparty).
|
|
31
|
+
*/
|
|
32
|
+
struct ServiceCounterparty {
|
|
33
|
+
public:
|
|
34
|
+
std::string kind SWIFT_PRIVATE;
|
|
35
|
+
Service service SWIFT_PRIVATE;
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
ServiceCounterparty() = default;
|
|
39
|
+
explicit ServiceCounterparty(std::string kind, Service service): kind(kind), service(service) {}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
} // namespace margelo::nitro::rncandle
|
|
43
|
+
|
|
44
|
+
namespace margelo::nitro {
|
|
45
|
+
|
|
46
|
+
using namespace margelo::nitro::rncandle;
|
|
47
|
+
|
|
48
|
+
// C++ ServiceCounterparty <> JS ServiceCounterparty (object)
|
|
49
|
+
template <>
|
|
50
|
+
struct JSIConverter<ServiceCounterparty> final {
|
|
51
|
+
static inline ServiceCounterparty fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
52
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
53
|
+
return ServiceCounterparty(
|
|
54
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "kind")),
|
|
55
|
+
JSIConverter<Service>::fromJSI(runtime, obj.getProperty(runtime, "service"))
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const ServiceCounterparty& arg) {
|
|
59
|
+
jsi::Object obj(runtime);
|
|
60
|
+
obj.setProperty(runtime, "kind", JSIConverter<std::string>::toJSI(runtime, arg.kind));
|
|
61
|
+
obj.setProperty(runtime, "service", JSIConverter<Service>::toJSI(runtime, arg.service));
|
|
62
|
+
return obj;
|
|
63
|
+
}
|
|
64
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
65
|
+
if (!value.isObject()) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
jsi::Object obj = value.getObject(runtime);
|
|
69
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "kind"))) return false;
|
|
70
|
+
if (!JSIConverter<Service>::canConvert(runtime, obj.getProperty(runtime, "service"))) return false;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Trade.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 `TradeState` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rncandle { enum class TradeState; }
|
|
23
|
+
// Forward declaration of `Counterparty` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::rncandle { struct Counterparty; }
|
|
25
|
+
// Forward declaration of `TradeAsset` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::rncandle { struct TradeAsset; }
|
|
27
|
+
|
|
28
|
+
#include <string>
|
|
29
|
+
#include "TradeState.hpp"
|
|
30
|
+
#include "Counterparty.hpp"
|
|
31
|
+
#include "TradeAsset.hpp"
|
|
32
|
+
|
|
33
|
+
namespace margelo::nitro::rncandle {
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A struct which can be represented as a JavaScript object (Trade).
|
|
37
|
+
*/
|
|
38
|
+
struct Trade {
|
|
39
|
+
public:
|
|
40
|
+
std::string dateTime SWIFT_PRIVATE;
|
|
41
|
+
TradeState state SWIFT_PRIVATE;
|
|
42
|
+
Counterparty counterparty SWIFT_PRIVATE;
|
|
43
|
+
TradeAsset lost SWIFT_PRIVATE;
|
|
44
|
+
TradeAsset gained SWIFT_PRIVATE;
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
Trade() = default;
|
|
48
|
+
explicit Trade(std::string dateTime, TradeState state, Counterparty counterparty, TradeAsset lost, TradeAsset gained): dateTime(dateTime), state(state), counterparty(counterparty), lost(lost), gained(gained) {}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
} // namespace margelo::nitro::rncandle
|
|
52
|
+
|
|
53
|
+
namespace margelo::nitro {
|
|
54
|
+
|
|
55
|
+
using namespace margelo::nitro::rncandle;
|
|
56
|
+
|
|
57
|
+
// C++ Trade <> JS Trade (object)
|
|
58
|
+
template <>
|
|
59
|
+
struct JSIConverter<Trade> final {
|
|
60
|
+
static inline Trade fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
61
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
62
|
+
return Trade(
|
|
63
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "dateTime")),
|
|
64
|
+
JSIConverter<TradeState>::fromJSI(runtime, obj.getProperty(runtime, "state")),
|
|
65
|
+
JSIConverter<Counterparty>::fromJSI(runtime, obj.getProperty(runtime, "counterparty")),
|
|
66
|
+
JSIConverter<TradeAsset>::fromJSI(runtime, obj.getProperty(runtime, "lost")),
|
|
67
|
+
JSIConverter<TradeAsset>::fromJSI(runtime, obj.getProperty(runtime, "gained"))
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const Trade& arg) {
|
|
71
|
+
jsi::Object obj(runtime);
|
|
72
|
+
obj.setProperty(runtime, "dateTime", JSIConverter<std::string>::toJSI(runtime, arg.dateTime));
|
|
73
|
+
obj.setProperty(runtime, "state", JSIConverter<TradeState>::toJSI(runtime, arg.state));
|
|
74
|
+
obj.setProperty(runtime, "counterparty", JSIConverter<Counterparty>::toJSI(runtime, arg.counterparty));
|
|
75
|
+
obj.setProperty(runtime, "lost", JSIConverter<TradeAsset>::toJSI(runtime, arg.lost));
|
|
76
|
+
obj.setProperty(runtime, "gained", JSIConverter<TradeAsset>::toJSI(runtime, arg.gained));
|
|
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 (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "dateTime"))) return false;
|
|
85
|
+
if (!JSIConverter<TradeState>::canConvert(runtime, obj.getProperty(runtime, "state"))) return false;
|
|
86
|
+
if (!JSIConverter<Counterparty>::canConvert(runtime, obj.getProperty(runtime, "counterparty"))) return false;
|
|
87
|
+
if (!JSIConverter<TradeAsset>::canConvert(runtime, obj.getProperty(runtime, "lost"))) return false;
|
|
88
|
+
if (!JSIConverter<TradeAsset>::canConvert(runtime, obj.getProperty(runtime, "gained"))) return false;
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// TradeAsset.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 `FiatAsset` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rncandle { struct FiatAsset; }
|
|
23
|
+
// Forward declaration of `MarketTradeAsset` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::rncandle { struct MarketTradeAsset; }
|
|
25
|
+
// Forward declaration of `TransportAsset` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::rncandle { struct TransportAsset; }
|
|
27
|
+
// Forward declaration of `OtherAsset` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::rncandle { struct OtherAsset; }
|
|
29
|
+
// Forward declaration of `NothingAsset` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::rncandle { struct NothingAsset; }
|
|
31
|
+
|
|
32
|
+
#include <optional>
|
|
33
|
+
#include "FiatAsset.hpp"
|
|
34
|
+
#include "MarketTradeAsset.hpp"
|
|
35
|
+
#include "TransportAsset.hpp"
|
|
36
|
+
#include "OtherAsset.hpp"
|
|
37
|
+
#include "NothingAsset.hpp"
|
|
38
|
+
|
|
39
|
+
namespace margelo::nitro::rncandle {
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A struct which can be represented as a JavaScript object (TradeAsset).
|
|
43
|
+
*/
|
|
44
|
+
struct TradeAsset {
|
|
45
|
+
public:
|
|
46
|
+
std::optional<FiatAsset> fiatAsset SWIFT_PRIVATE;
|
|
47
|
+
std::optional<MarketTradeAsset> marketTradeAsset SWIFT_PRIVATE;
|
|
48
|
+
std::optional<TransportAsset> transportAsset SWIFT_PRIVATE;
|
|
49
|
+
std::optional<OtherAsset> otherAsset SWIFT_PRIVATE;
|
|
50
|
+
std::optional<NothingAsset> nothingAsset SWIFT_PRIVATE;
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
TradeAsset() = default;
|
|
54
|
+
explicit TradeAsset(std::optional<FiatAsset> fiatAsset, std::optional<MarketTradeAsset> marketTradeAsset, std::optional<TransportAsset> transportAsset, std::optional<OtherAsset> otherAsset, std::optional<NothingAsset> nothingAsset): fiatAsset(fiatAsset), marketTradeAsset(marketTradeAsset), transportAsset(transportAsset), otherAsset(otherAsset), nothingAsset(nothingAsset) {}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
} // namespace margelo::nitro::rncandle
|
|
58
|
+
|
|
59
|
+
namespace margelo::nitro {
|
|
60
|
+
|
|
61
|
+
using namespace margelo::nitro::rncandle;
|
|
62
|
+
|
|
63
|
+
// C++ TradeAsset <> JS TradeAsset (object)
|
|
64
|
+
template <>
|
|
65
|
+
struct JSIConverter<TradeAsset> final {
|
|
66
|
+
static inline TradeAsset fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
67
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
68
|
+
return TradeAsset(
|
|
69
|
+
JSIConverter<std::optional<FiatAsset>>::fromJSI(runtime, obj.getProperty(runtime, "fiatAsset")),
|
|
70
|
+
JSIConverter<std::optional<MarketTradeAsset>>::fromJSI(runtime, obj.getProperty(runtime, "marketTradeAsset")),
|
|
71
|
+
JSIConverter<std::optional<TransportAsset>>::fromJSI(runtime, obj.getProperty(runtime, "transportAsset")),
|
|
72
|
+
JSIConverter<std::optional<OtherAsset>>::fromJSI(runtime, obj.getProperty(runtime, "otherAsset")),
|
|
73
|
+
JSIConverter<std::optional<NothingAsset>>::fromJSI(runtime, obj.getProperty(runtime, "nothingAsset"))
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const TradeAsset& arg) {
|
|
77
|
+
jsi::Object obj(runtime);
|
|
78
|
+
obj.setProperty(runtime, "fiatAsset", JSIConverter<std::optional<FiatAsset>>::toJSI(runtime, arg.fiatAsset));
|
|
79
|
+
obj.setProperty(runtime, "marketTradeAsset", JSIConverter<std::optional<MarketTradeAsset>>::toJSI(runtime, arg.marketTradeAsset));
|
|
80
|
+
obj.setProperty(runtime, "transportAsset", JSIConverter<std::optional<TransportAsset>>::toJSI(runtime, arg.transportAsset));
|
|
81
|
+
obj.setProperty(runtime, "otherAsset", JSIConverter<std::optional<OtherAsset>>::toJSI(runtime, arg.otherAsset));
|
|
82
|
+
obj.setProperty(runtime, "nothingAsset", JSIConverter<std::optional<NothingAsset>>::toJSI(runtime, arg.nothingAsset));
|
|
83
|
+
return obj;
|
|
84
|
+
}
|
|
85
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
86
|
+
if (!value.isObject()) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
jsi::Object obj = value.getObject(runtime);
|
|
90
|
+
if (!JSIConverter<std::optional<FiatAsset>>::canConvert(runtime, obj.getProperty(runtime, "fiatAsset"))) return false;
|
|
91
|
+
if (!JSIConverter<std::optional<MarketTradeAsset>>::canConvert(runtime, obj.getProperty(runtime, "marketTradeAsset"))) return false;
|
|
92
|
+
if (!JSIConverter<std::optional<TransportAsset>>::canConvert(runtime, obj.getProperty(runtime, "transportAsset"))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<OtherAsset>>::canConvert(runtime, obj.getProperty(runtime, "otherAsset"))) return false;
|
|
94
|
+
if (!JSIConverter<std::optional<NothingAsset>>::canConvert(runtime, obj.getProperty(runtime, "nothingAsset"))) return false;
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// TradeAssetQuoteRequest.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 `FiatAssetQuoteRequest` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rncandle { struct FiatAssetQuoteRequest; }
|
|
23
|
+
// Forward declaration of `MarketAssetQuoteRequest` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::rncandle { struct MarketAssetQuoteRequest; }
|
|
25
|
+
// Forward declaration of `TransportAssetQuoteRequest` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::rncandle { struct TransportAssetQuoteRequest; }
|
|
27
|
+
// Forward declaration of `NothingAssetQuoteRequest` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::rncandle { struct NothingAssetQuoteRequest; }
|
|
29
|
+
|
|
30
|
+
#include <optional>
|
|
31
|
+
#include "FiatAssetQuoteRequest.hpp"
|
|
32
|
+
#include "MarketAssetQuoteRequest.hpp"
|
|
33
|
+
#include "TransportAssetQuoteRequest.hpp"
|
|
34
|
+
#include "NothingAssetQuoteRequest.hpp"
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::rncandle {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (TradeAssetQuoteRequest).
|
|
40
|
+
*/
|
|
41
|
+
struct TradeAssetQuoteRequest {
|
|
42
|
+
public:
|
|
43
|
+
std::optional<FiatAssetQuoteRequest> fiatAssetQuoteRequest SWIFT_PRIVATE;
|
|
44
|
+
std::optional<MarketAssetQuoteRequest> marketAssetQuoteRequest SWIFT_PRIVATE;
|
|
45
|
+
std::optional<TransportAssetQuoteRequest> transportAssetQuoteRequest SWIFT_PRIVATE;
|
|
46
|
+
std::optional<NothingAssetQuoteRequest> nothingAssetQuoteRequest SWIFT_PRIVATE;
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
TradeAssetQuoteRequest() = default;
|
|
50
|
+
explicit TradeAssetQuoteRequest(std::optional<FiatAssetQuoteRequest> fiatAssetQuoteRequest, std::optional<MarketAssetQuoteRequest> marketAssetQuoteRequest, std::optional<TransportAssetQuoteRequest> transportAssetQuoteRequest, std::optional<NothingAssetQuoteRequest> nothingAssetQuoteRequest): fiatAssetQuoteRequest(fiatAssetQuoteRequest), marketAssetQuoteRequest(marketAssetQuoteRequest), transportAssetQuoteRequest(transportAssetQuoteRequest), nothingAssetQuoteRequest(nothingAssetQuoteRequest) {}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
} // namespace margelo::nitro::rncandle
|
|
54
|
+
|
|
55
|
+
namespace margelo::nitro {
|
|
56
|
+
|
|
57
|
+
using namespace margelo::nitro::rncandle;
|
|
58
|
+
|
|
59
|
+
// C++ TradeAssetQuoteRequest <> JS TradeAssetQuoteRequest (object)
|
|
60
|
+
template <>
|
|
61
|
+
struct JSIConverter<TradeAssetQuoteRequest> final {
|
|
62
|
+
static inline TradeAssetQuoteRequest fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
63
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
64
|
+
return TradeAssetQuoteRequest(
|
|
65
|
+
JSIConverter<std::optional<FiatAssetQuoteRequest>>::fromJSI(runtime, obj.getProperty(runtime, "fiatAssetQuoteRequest")),
|
|
66
|
+
JSIConverter<std::optional<MarketAssetQuoteRequest>>::fromJSI(runtime, obj.getProperty(runtime, "marketAssetQuoteRequest")),
|
|
67
|
+
JSIConverter<std::optional<TransportAssetQuoteRequest>>::fromJSI(runtime, obj.getProperty(runtime, "transportAssetQuoteRequest")),
|
|
68
|
+
JSIConverter<std::optional<NothingAssetQuoteRequest>>::fromJSI(runtime, obj.getProperty(runtime, "nothingAssetQuoteRequest"))
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const TradeAssetQuoteRequest& arg) {
|
|
72
|
+
jsi::Object obj(runtime);
|
|
73
|
+
obj.setProperty(runtime, "fiatAssetQuoteRequest", JSIConverter<std::optional<FiatAssetQuoteRequest>>::toJSI(runtime, arg.fiatAssetQuoteRequest));
|
|
74
|
+
obj.setProperty(runtime, "marketAssetQuoteRequest", JSIConverter<std::optional<MarketAssetQuoteRequest>>::toJSI(runtime, arg.marketAssetQuoteRequest));
|
|
75
|
+
obj.setProperty(runtime, "transportAssetQuoteRequest", JSIConverter<std::optional<TransportAssetQuoteRequest>>::toJSI(runtime, arg.transportAssetQuoteRequest));
|
|
76
|
+
obj.setProperty(runtime, "nothingAssetQuoteRequest", JSIConverter<std::optional<NothingAssetQuoteRequest>>::toJSI(runtime, arg.nothingAssetQuoteRequest));
|
|
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 (!JSIConverter<std::optional<FiatAssetQuoteRequest>>::canConvert(runtime, obj.getProperty(runtime, "fiatAssetQuoteRequest"))) return false;
|
|
85
|
+
if (!JSIConverter<std::optional<MarketAssetQuoteRequest>>::canConvert(runtime, obj.getProperty(runtime, "marketAssetQuoteRequest"))) return false;
|
|
86
|
+
if (!JSIConverter<std::optional<TransportAssetQuoteRequest>>::canConvert(runtime, obj.getProperty(runtime, "transportAssetQuoteRequest"))) return false;
|
|
87
|
+
if (!JSIConverter<std::optional<NothingAssetQuoteRequest>>::canConvert(runtime, obj.getProperty(runtime, "nothingAssetQuoteRequest"))) return false;
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// TradeQuery.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 <optional>
|
|
24
|
+
#include <string>
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::rncandle {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A struct which can be represented as a JavaScript object (TradeQuery).
|
|
30
|
+
*/
|
|
31
|
+
struct TradeQuery {
|
|
32
|
+
public:
|
|
33
|
+
std::optional<std::string> linkedAccountIDs SWIFT_PRIVATE;
|
|
34
|
+
std::optional<std::string> dateTimeSpan SWIFT_PRIVATE;
|
|
35
|
+
std::optional<std::string> gainedAssetKind SWIFT_PRIVATE;
|
|
36
|
+
std::optional<std::string> lostAssetKind SWIFT_PRIVATE;
|
|
37
|
+
std::optional<std::string> counterpartyKind SWIFT_PRIVATE;
|
|
38
|
+
|
|
39
|
+
public:
|
|
40
|
+
TradeQuery() = default;
|
|
41
|
+
explicit TradeQuery(std::optional<std::string> linkedAccountIDs, std::optional<std::string> dateTimeSpan, std::optional<std::string> gainedAssetKind, std::optional<std::string> lostAssetKind, std::optional<std::string> counterpartyKind): linkedAccountIDs(linkedAccountIDs), dateTimeSpan(dateTimeSpan), gainedAssetKind(gainedAssetKind), lostAssetKind(lostAssetKind), counterpartyKind(counterpartyKind) {}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
} // namespace margelo::nitro::rncandle
|
|
45
|
+
|
|
46
|
+
namespace margelo::nitro {
|
|
47
|
+
|
|
48
|
+
using namespace margelo::nitro::rncandle;
|
|
49
|
+
|
|
50
|
+
// C++ TradeQuery <> JS TradeQuery (object)
|
|
51
|
+
template <>
|
|
52
|
+
struct JSIConverter<TradeQuery> final {
|
|
53
|
+
static inline TradeQuery fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
54
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
55
|
+
return TradeQuery(
|
|
56
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountIDs")),
|
|
57
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "dateTimeSpan")),
|
|
58
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "gainedAssetKind")),
|
|
59
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "lostAssetKind")),
|
|
60
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "counterpartyKind"))
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const TradeQuery& arg) {
|
|
64
|
+
jsi::Object obj(runtime);
|
|
65
|
+
obj.setProperty(runtime, "linkedAccountIDs", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.linkedAccountIDs));
|
|
66
|
+
obj.setProperty(runtime, "dateTimeSpan", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.dateTimeSpan));
|
|
67
|
+
obj.setProperty(runtime, "gainedAssetKind", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.gainedAssetKind));
|
|
68
|
+
obj.setProperty(runtime, "lostAssetKind", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.lostAssetKind));
|
|
69
|
+
obj.setProperty(runtime, "counterpartyKind", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.counterpartyKind));
|
|
70
|
+
return obj;
|
|
71
|
+
}
|
|
72
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
73
|
+
if (!value.isObject()) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
jsi::Object obj = value.getObject(runtime);
|
|
77
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountIDs"))) return false;
|
|
78
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "dateTimeSpan"))) return false;
|
|
79
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "gainedAssetKind"))) return false;
|
|
80
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "lostAssetKind"))) return false;
|
|
81
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "counterpartyKind"))) return false;
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// TradeQuote.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 `TradeAsset` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rncandle { struct TradeAsset; }
|
|
23
|
+
|
|
24
|
+
#include "TradeAsset.hpp"
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::rncandle {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A struct which can be represented as a JavaScript object (TradeQuote).
|
|
30
|
+
*/
|
|
31
|
+
struct TradeQuote {
|
|
32
|
+
public:
|
|
33
|
+
TradeAsset lost SWIFT_PRIVATE;
|
|
34
|
+
TradeAsset gained SWIFT_PRIVATE;
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
TradeQuote() = default;
|
|
38
|
+
explicit TradeQuote(TradeAsset lost, TradeAsset gained): lost(lost), gained(gained) {}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::rncandle
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
using namespace margelo::nitro::rncandle;
|
|
46
|
+
|
|
47
|
+
// C++ TradeQuote <> JS TradeQuote (object)
|
|
48
|
+
template <>
|
|
49
|
+
struct JSIConverter<TradeQuote> final {
|
|
50
|
+
static inline TradeQuote fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
51
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
52
|
+
return TradeQuote(
|
|
53
|
+
JSIConverter<TradeAsset>::fromJSI(runtime, obj.getProperty(runtime, "lost")),
|
|
54
|
+
JSIConverter<TradeAsset>::fromJSI(runtime, obj.getProperty(runtime, "gained"))
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const TradeQuote& arg) {
|
|
58
|
+
jsi::Object obj(runtime);
|
|
59
|
+
obj.setProperty(runtime, "lost", JSIConverter<TradeAsset>::toJSI(runtime, arg.lost));
|
|
60
|
+
obj.setProperty(runtime, "gained", JSIConverter<TradeAsset>::toJSI(runtime, arg.gained));
|
|
61
|
+
return obj;
|
|
62
|
+
}
|
|
63
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
64
|
+
if (!value.isObject()) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
jsi::Object obj = value.getObject(runtime);
|
|
68
|
+
if (!JSIConverter<TradeAsset>::canConvert(runtime, obj.getProperty(runtime, "lost"))) return false;
|
|
69
|
+
if (!JSIConverter<TradeAsset>::canConvert(runtime, obj.getProperty(runtime, "gained"))) return false;
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// TradeQuoteRequest.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 `TradeAssetQuoteRequest` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rncandle { struct TradeAssetQuoteRequest; }
|
|
23
|
+
|
|
24
|
+
#include <optional>
|
|
25
|
+
#include <string>
|
|
26
|
+
#include "TradeAssetQuoteRequest.hpp"
|
|
27
|
+
|
|
28
|
+
namespace margelo::nitro::rncandle {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A struct which can be represented as a JavaScript object (TradeQuoteRequest).
|
|
32
|
+
*/
|
|
33
|
+
struct TradeQuoteRequest {
|
|
34
|
+
public:
|
|
35
|
+
std::optional<std::string> linkedAccountIDs SWIFT_PRIVATE;
|
|
36
|
+
TradeAssetQuoteRequest gained SWIFT_PRIVATE;
|
|
37
|
+
|
|
38
|
+
public:
|
|
39
|
+
TradeQuoteRequest() = default;
|
|
40
|
+
explicit TradeQuoteRequest(std::optional<std::string> linkedAccountIDs, TradeAssetQuoteRequest gained): linkedAccountIDs(linkedAccountIDs), gained(gained) {}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
} // namespace margelo::nitro::rncandle
|
|
44
|
+
|
|
45
|
+
namespace margelo::nitro {
|
|
46
|
+
|
|
47
|
+
using namespace margelo::nitro::rncandle;
|
|
48
|
+
|
|
49
|
+
// C++ TradeQuoteRequest <> JS TradeQuoteRequest (object)
|
|
50
|
+
template <>
|
|
51
|
+
struct JSIConverter<TradeQuoteRequest> final {
|
|
52
|
+
static inline TradeQuoteRequest fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
53
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
54
|
+
return TradeQuoteRequest(
|
|
55
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountIDs")),
|
|
56
|
+
JSIConverter<TradeAssetQuoteRequest>::fromJSI(runtime, obj.getProperty(runtime, "gained"))
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const TradeQuoteRequest& arg) {
|
|
60
|
+
jsi::Object obj(runtime);
|
|
61
|
+
obj.setProperty(runtime, "linkedAccountIDs", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.linkedAccountIDs));
|
|
62
|
+
obj.setProperty(runtime, "gained", JSIConverter<TradeAssetQuoteRequest>::toJSI(runtime, arg.gained));
|
|
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::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountIDs"))) return false;
|
|
71
|
+
if (!JSIConverter<TradeAssetQuoteRequest>::canConvert(runtime, obj.getProperty(runtime, "gained"))) return false;
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro
|