react-native-candle 19.0.12-beta → 40.0.6-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -25
- package/android/gradle.properties +5 -0
- package/android/src/main/java/com/margelo/nitro/rncandle/BridgeTypes.kt +189 -2
- package/android/src/main/java/com/margelo/nitro/rncandle/HybridRNCandle.kt +63 -10
- package/ios/Sources/CandleLinkSheetWrapperView.swift +3 -2
- package/ios/Sources/CandleLinkViewModel.swift +2 -1
- package/ios/Sources/RNCandle.swift +86 -9
- package/ios/Sources/Types.swift +199 -5
- package/lib/typescript/commonjs/src/context.d.ts +16 -6
- package/lib/typescript/commonjs/src/provider.d.ts +1 -2
- package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +76 -6
- package/lib/typescript/commonjs/src/types.d.ts +15 -3
- package/lib/typescript/module/src/context.d.ts +16 -6
- package/lib/typescript/module/src/provider.d.ts +1 -2
- package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +76 -6
- package/lib/typescript/module/src/types.d.ts +15 -3
- package/nitrogen/generated/android/c++/JAssetAccount.hpp +2 -0
- package/nitrogen/generated/android/c++/JAssetAccountsResponse.hpp +2 -0
- package/nitrogen/generated/android/c++/JCounterparty.hpp +2 -0
- package/nitrogen/generated/android/c++/JCryptoAccount.hpp +3 -0
- package/nitrogen/generated/android/c++/JCryptoAsset.hpp +3 -0
- package/nitrogen/generated/android/c++/JEventAsset.hpp +3 -0
- package/nitrogen/generated/android/c++/JFiatAccount.hpp +2 -0
- package/nitrogen/generated/android/c++/JFiatAsset.hpp +2 -0
- package/nitrogen/generated/android/c++/JFriendRequestAsset.hpp +86 -0
- package/nitrogen/generated/android/c++/JFriendRequestAssetDirection.hpp +58 -0
- package/nitrogen/generated/android/c++/JFriendRequestAssetQuoteRequest.hpp +63 -0
- package/nitrogen/generated/android/c++/JFriendRequestAssetQuoteRequestAction.hpp +64 -0
- package/nitrogen/generated/android/c++/JFriendRequestAssetRef.hpp +66 -0
- package/nitrogen/generated/android/c++/JFunc_void_LinkedAccount.hpp +13 -11
- package/nitrogen/generated/android/c++/JFunc_void_TradeExecutionResult.hpp +11 -0
- package/nitrogen/generated/android/c++/JHostedAuthorizationCallback.hpp +66 -0
- package/nitrogen/generated/android/c++/JHostedAuthorizationRequest.hpp +69 -0
- package/nitrogen/generated/android/c++/JHybridRNCandleSpec.cpp +78 -15
- package/nitrogen/generated/android/c++/JHybridRNCandleSpec.hpp +7 -4
- package/nitrogen/generated/android/c++/JLinkedAccount.hpp +2 -0
- package/nitrogen/generated/android/c++/JLinkedAccountStatusRef.hpp +3 -0
- package/nitrogen/generated/android/c++/JMessageThreadAsset.hpp +99 -0
- package/nitrogen/generated/android/c++/JMessageThreadAssetQuoteRequest.hpp +61 -0
- package/nitrogen/generated/android/c++/JMessageThreadAssetRef.hpp +65 -0
- package/nitrogen/generated/android/c++/JMessageThreadMessage.hpp +78 -0
- package/nitrogen/generated/android/c++/JService.hpp +36 -252
- package/nitrogen/generated/android/c++/JServiceCounterparty.hpp +3 -0
- package/nitrogen/generated/android/c++/JServiceID.hpp +316 -0
- package/nitrogen/generated/android/c++/JStockAccount.hpp +3 -0
- package/nitrogen/generated/android/c++/JStockAsset.hpp +3 -0
- package/nitrogen/generated/android/c++/JTrade.hpp +11 -0
- package/nitrogen/generated/android/c++/JTradeAsset.hpp +22 -1
- package/nitrogen/generated/android/c++/JTradeAssetKind.hpp +6 -0
- package/nitrogen/generated/android/c++/JTradeAssetQuoteRequest.hpp +15 -1
- package/nitrogen/generated/android/c++/JTradeAssetRef.hpp +13 -1
- package/nitrogen/generated/android/c++/JTradeExecutionResult.hpp +11 -0
- package/nitrogen/generated/android/c++/JTradeQuote.hpp +11 -0
- package/nitrogen/generated/android/c++/JTradeQuotesRequest.hpp +6 -0
- package/nitrogen/generated/android/c++/JTradeQuotesResponse.hpp +10 -0
- package/nitrogen/generated/android/c++/JTradeRef.hpp +4 -0
- package/nitrogen/generated/android/c++/JTradesResponse.hpp +10 -0
- package/nitrogen/generated/android/c++/JTransportAccount.hpp +3 -0
- package/nitrogen/generated/android/c++/JTransportAsset.hpp +3 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/FriendRequestAsset.kt +53 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/FriendRequestAssetDirection.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/FriendRequestAssetQuoteRequest.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/FriendRequestAssetQuoteRequestAction.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/FriendRequestAssetRef.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/Func_void_LinkedAccount.kt +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/HostedAuthorizationCallback.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/HostedAuthorizationRequest.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/HybridRNCandleSpec.kt +18 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/MessageThreadAsset.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/MessageThreadAssetQuoteRequest.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/MessageThreadAssetRef.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/MessageThreadMessage.kt +53 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/Service.kt +32 -83
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/ServiceID.kt +109 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/TradeAsset.kt +8 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/TradeAssetKind.kt +4 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/TradeAssetQuoteRequest.kt +8 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rncandle/TradeAssetRef.kt +8 -2
- package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.cpp +3 -3
- package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.hpp +184 -20
- package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Umbrella.hpp +37 -1
- package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +74 -14
- package/nitrogen/generated/ios/swift/FriendRequestAsset.swift +67 -0
- package/nitrogen/generated/ios/swift/FriendRequestAssetDirection.swift +40 -0
- package/nitrogen/generated/ios/swift/FriendRequestAssetQuoteRequest.swift +34 -0
- package/nitrogen/generated/ios/swift/FriendRequestAssetQuoteRequestAction.swift +48 -0
- package/nitrogen/generated/ios/swift/FriendRequestAssetRef.swift +52 -0
- package/nitrogen/generated/ios/swift/Func_void_LinkedAccount.swift +5 -5
- package/nitrogen/generated/ios/swift/HostedAuthorizationCallback.swift +52 -0
- package/nitrogen/generated/ios/swift/HostedAuthorizationRequest.swift +44 -0
- package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +7 -4
- package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +56 -13
- package/nitrogen/generated/ios/swift/MessageThreadAsset.swift +68 -0
- package/nitrogen/generated/ios/swift/MessageThreadAssetQuoteRequest.swift +34 -0
- package/nitrogen/generated/ios/swift/MessageThreadAssetRef.swift +39 -0
- package/nitrogen/generated/ios/swift/MessageThreadMessage.swift +119 -0
- package/nitrogen/generated/ios/swift/Service.swift +44 -334
- package/nitrogen/generated/ios/swift/ServiceID.swift +384 -0
- package/nitrogen/generated/ios/swift/TradeAsset.swift +23 -1
- package/nitrogen/generated/ios/swift/TradeAssetKind.swift +8 -0
- package/nitrogen/generated/ios/swift/TradeAssetQuoteRequest.swift +23 -1
- package/nitrogen/generated/ios/swift/TradeAssetRef.swift +23 -1
- package/nitrogen/generated/shared/c++/CryptoAccount.hpp +1 -1
- package/nitrogen/generated/shared/c++/CryptoAsset.hpp +1 -1
- package/nitrogen/generated/shared/c++/EventAsset.hpp +1 -1
- package/nitrogen/generated/shared/c++/FiatAccount.hpp +1 -1
- package/nitrogen/generated/shared/c++/FiatAsset.hpp +1 -1
- package/nitrogen/generated/shared/c++/FriendRequestAsset.hpp +112 -0
- package/nitrogen/generated/shared/c++/FriendRequestAssetDirection.hpp +76 -0
- package/nitrogen/generated/shared/c++/FriendRequestAssetQuoteRequest.hpp +89 -0
- package/nitrogen/generated/shared/c++/FriendRequestAssetQuoteRequestAction.hpp +84 -0
- package/nitrogen/generated/shared/c++/FriendRequestAssetRef.hpp +92 -0
- package/nitrogen/generated/shared/c++/HostedAuthorizationCallback.hpp +92 -0
- package/nitrogen/generated/shared/c++/HostedAuthorizationRequest.hpp +95 -0
- package/nitrogen/generated/shared/c++/HybridRNCandleSpec.cpp +5 -2
- package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +16 -7
- package/nitrogen/generated/shared/c++/LinkedAccount.hpp +1 -1
- package/nitrogen/generated/shared/c++/LinkedAccountStatusRef.hpp +1 -1
- package/nitrogen/generated/shared/c++/MessageThreadAsset.hpp +106 -0
- package/nitrogen/generated/shared/c++/MessageThreadAssetQuoteRequest.hpp +87 -0
- package/nitrogen/generated/shared/c++/MessageThreadAssetRef.hpp +91 -0
- package/nitrogen/generated/shared/c++/MessageThreadMessage.hpp +104 -0
- package/nitrogen/generated/shared/c++/Service.hpp +60 -346
- package/nitrogen/generated/shared/c++/ServiceCounterparty.hpp +1 -1
- package/nitrogen/generated/shared/c++/ServiceID.hpp +420 -0
- package/nitrogen/generated/shared/c++/StockAccount.hpp +1 -1
- package/nitrogen/generated/shared/c++/StockAsset.hpp +1 -1
- package/nitrogen/generated/shared/c++/TradeAsset.hpp +15 -1
- package/nitrogen/generated/shared/c++/TradeAssetKind.hpp +10 -2
- package/nitrogen/generated/shared/c++/TradeAssetQuoteRequest.hpp +15 -1
- package/nitrogen/generated/shared/c++/TradeAssetRef.hpp +15 -1
- package/nitrogen/generated/shared/c++/TransportAccount.hpp +1 -1
- package/nitrogen/generated/shared/c++/TransportAsset.hpp +1 -1
- package/package.json +1 -1
- package/src/context.ts +21 -5
- package/src/provider.tsx +62 -34
- package/src/specs/RNCandle.nitro.ts +109 -7
- package/src/types.ts +50 -1
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
#include <string>
|
|
18
18
|
#include "Service.hpp"
|
|
19
19
|
#include "JService.hpp"
|
|
20
|
+
#include "ServiceID.hpp"
|
|
21
|
+
#include "JServiceID.hpp"
|
|
22
|
+
#include <optional>
|
|
20
23
|
#include "LinkedAccountDetails.hpp"
|
|
21
24
|
#include "JLinkedAccountDetails.hpp"
|
|
22
25
|
#include "ActiveLinkedAccountDetails.hpp"
|
|
23
|
-
#include <optional>
|
|
24
26
|
#include "JActiveLinkedAccountDetails.hpp"
|
|
25
27
|
#include "InactiveLinkedAccountDetails.hpp"
|
|
26
28
|
#include "JInactiveLinkedAccountDetails.hpp"
|
|
@@ -32,7 +34,7 @@ namespace margelo::nitro::rncandle {
|
|
|
32
34
|
using namespace facebook;
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
|
-
* Represents the Java/Kotlin callback `(
|
|
37
|
+
* Represents the Java/Kotlin callback `(linkedAccount: LinkedAccount) -> Unit`.
|
|
36
38
|
* This can be passed around between C++ and Java/Kotlin.
|
|
37
39
|
*/
|
|
38
40
|
struct JFunc_void_LinkedAccount: public jni::JavaClass<JFunc_void_LinkedAccount> {
|
|
@@ -43,9 +45,9 @@ namespace margelo::nitro::rncandle {
|
|
|
43
45
|
/**
|
|
44
46
|
* Invokes the function this `JFunc_void_LinkedAccount` instance holds through JNI.
|
|
45
47
|
*/
|
|
46
|
-
void invoke(const LinkedAccount&
|
|
47
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JLinkedAccount> /*
|
|
48
|
-
method(self(), JLinkedAccount::fromCpp(
|
|
48
|
+
void invoke(const LinkedAccount& linkedAccount) const {
|
|
49
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JLinkedAccount> /* linkedAccount */)>("invoke");
|
|
50
|
+
method(self(), JLinkedAccount::fromCpp(linkedAccount));
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
53
|
|
|
@@ -54,7 +56,7 @@ namespace margelo::nitro::rncandle {
|
|
|
54
56
|
*/
|
|
55
57
|
class JFunc_void_LinkedAccount_cxx final: public jni::HybridClass<JFunc_void_LinkedAccount_cxx, JFunc_void_LinkedAccount> {
|
|
56
58
|
public:
|
|
57
|
-
static jni::local_ref<JFunc_void_LinkedAccount::javaobject> fromCpp(const std::function<void(const LinkedAccount& /*
|
|
59
|
+
static jni::local_ref<JFunc_void_LinkedAccount::javaobject> fromCpp(const std::function<void(const LinkedAccount& /* linkedAccount */)>& func) {
|
|
58
60
|
return JFunc_void_LinkedAccount_cxx::newObjectCxxArgs(func);
|
|
59
61
|
}
|
|
60
62
|
|
|
@@ -62,13 +64,13 @@ namespace margelo::nitro::rncandle {
|
|
|
62
64
|
/**
|
|
63
65
|
* Invokes the C++ `std::function<...>` this `JFunc_void_LinkedAccount_cxx` instance holds.
|
|
64
66
|
*/
|
|
65
|
-
void invoke_cxx(jni::alias_ref<JLinkedAccount>
|
|
66
|
-
_func(
|
|
67
|
+
void invoke_cxx(jni::alias_ref<JLinkedAccount> linkedAccount) {
|
|
68
|
+
_func(linkedAccount->toCpp());
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
public:
|
|
70
72
|
[[nodiscard]]
|
|
71
|
-
inline const std::function<void(const LinkedAccount& /*
|
|
73
|
+
inline const std::function<void(const LinkedAccount& /* linkedAccount */)>& getFunction() const {
|
|
72
74
|
return _func;
|
|
73
75
|
}
|
|
74
76
|
|
|
@@ -79,11 +81,11 @@ namespace margelo::nitro::rncandle {
|
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
private:
|
|
82
|
-
explicit JFunc_void_LinkedAccount_cxx(const std::function<void(const LinkedAccount& /*
|
|
84
|
+
explicit JFunc_void_LinkedAccount_cxx(const std::function<void(const LinkedAccount& /* linkedAccount */)>& func): _func(func) { }
|
|
83
85
|
|
|
84
86
|
private:
|
|
85
87
|
friend HybridBase;
|
|
86
|
-
std::function<void(const LinkedAccount& /*
|
|
88
|
+
std::function<void(const LinkedAccount& /* linkedAccount */)> _func;
|
|
87
89
|
};
|
|
88
90
|
|
|
89
91
|
} // namespace margelo::nitro::rncandle
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
#include "JServiceCounterparty.hpp"
|
|
33
33
|
#include "Service.hpp"
|
|
34
34
|
#include "JService.hpp"
|
|
35
|
+
#include "ServiceID.hpp"
|
|
36
|
+
#include "JServiceID.hpp"
|
|
35
37
|
#include "TradeAsset.hpp"
|
|
36
38
|
#include "JTradeAsset.hpp"
|
|
37
39
|
#include "FiatAsset.hpp"
|
|
@@ -48,6 +50,15 @@
|
|
|
48
50
|
#include "JAddress.hpp"
|
|
49
51
|
#include "EventAsset.hpp"
|
|
50
52
|
#include "JEventAsset.hpp"
|
|
53
|
+
#include "MessageThreadAsset.hpp"
|
|
54
|
+
#include "JMessageThreadAsset.hpp"
|
|
55
|
+
#include "MessageThreadMessage.hpp"
|
|
56
|
+
#include <vector>
|
|
57
|
+
#include "JMessageThreadMessage.hpp"
|
|
58
|
+
#include "FriendRequestAsset.hpp"
|
|
59
|
+
#include "JFriendRequestAsset.hpp"
|
|
60
|
+
#include "FriendRequestAssetDirection.hpp"
|
|
61
|
+
#include "JFriendRequestAssetDirection.hpp"
|
|
51
62
|
#include "OtherAsset.hpp"
|
|
52
63
|
#include "JOtherAsset.hpp"
|
|
53
64
|
#include "NothingAsset.hpp"
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHostedAuthorizationCallback.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "HostedAuthorizationCallback.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::rncandle {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "HostedAuthorizationCallback" and the the Kotlin data class "HostedAuthorizationCallback".
|
|
22
|
+
*/
|
|
23
|
+
struct JHostedAuthorizationCallback final: public jni::JavaClass<JHostedAuthorizationCallback> {
|
|
24
|
+
public:
|
|
25
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/rncandle/HostedAuthorizationCallback;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct HostedAuthorizationCallback by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
HostedAuthorizationCallback toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldAuthorizationCode = clazz->getField<jni::JString>("authorizationCode");
|
|
36
|
+
jni::local_ref<jni::JString> authorizationCode = this->getFieldValue(fieldAuthorizationCode);
|
|
37
|
+
static const auto fieldState = clazz->getField<jni::JString>("state");
|
|
38
|
+
jni::local_ref<jni::JString> state = this->getFieldValue(fieldState);
|
|
39
|
+
static const auto fieldEncryptedGrantPackage = clazz->getField<jni::JString>("encryptedGrantPackage");
|
|
40
|
+
jni::local_ref<jni::JString> encryptedGrantPackage = this->getFieldValue(fieldEncryptedGrantPackage);
|
|
41
|
+
return HostedAuthorizationCallback(
|
|
42
|
+
authorizationCode->toStdString(),
|
|
43
|
+
state != nullptr ? std::make_optional(state->toStdString()) : std::nullopt,
|
|
44
|
+
encryptedGrantPackage->toStdString()
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
/**
|
|
50
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
51
|
+
*/
|
|
52
|
+
[[maybe_unused]]
|
|
53
|
+
static jni::local_ref<JHostedAuthorizationCallback::javaobject> fromCpp(const HostedAuthorizationCallback& value) {
|
|
54
|
+
using JSignature = JHostedAuthorizationCallback(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
55
|
+
static const auto clazz = javaClassStatic();
|
|
56
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
57
|
+
return create(
|
|
58
|
+
clazz,
|
|
59
|
+
jni::make_jstring(value.authorizationCode),
|
|
60
|
+
value.state.has_value() ? jni::make_jstring(value.state.value()) : nullptr,
|
|
61
|
+
jni::make_jstring(value.encryptedGrantPackage)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
} // namespace margelo::nitro::rncandle
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHostedAuthorizationRequest.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "HostedAuthorizationRequest.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::rncandle {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "HostedAuthorizationRequest" and the the Kotlin data class "HostedAuthorizationRequest".
|
|
21
|
+
*/
|
|
22
|
+
struct JHostedAuthorizationRequest final: public jni::JavaClass<JHostedAuthorizationRequest> {
|
|
23
|
+
public:
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/rncandle/HostedAuthorizationRequest;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct HostedAuthorizationRequest by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
HostedAuthorizationRequest toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldUrl = clazz->getField<jni::JString>("url");
|
|
35
|
+
jni::local_ref<jni::JString> url = this->getFieldValue(fieldUrl);
|
|
36
|
+
static const auto fieldState = clazz->getField<jni::JString>("state");
|
|
37
|
+
jni::local_ref<jni::JString> state = this->getFieldValue(fieldState);
|
|
38
|
+
static const auto fieldCodeVerifier = clazz->getField<jni::JString>("codeVerifier");
|
|
39
|
+
jni::local_ref<jni::JString> codeVerifier = this->getFieldValue(fieldCodeVerifier);
|
|
40
|
+
static const auto fieldGrantPackagePublicKey = clazz->getField<jni::JString>("grantPackagePublicKey");
|
|
41
|
+
jni::local_ref<jni::JString> grantPackagePublicKey = this->getFieldValue(fieldGrantPackagePublicKey);
|
|
42
|
+
return HostedAuthorizationRequest(
|
|
43
|
+
url->toStdString(),
|
|
44
|
+
state->toStdString(),
|
|
45
|
+
codeVerifier->toStdString(),
|
|
46
|
+
grantPackagePublicKey->toStdString()
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
/**
|
|
52
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
53
|
+
*/
|
|
54
|
+
[[maybe_unused]]
|
|
55
|
+
static jni::local_ref<JHostedAuthorizationRequest::javaobject> fromCpp(const HostedAuthorizationRequest& value) {
|
|
56
|
+
using JSignature = JHostedAuthorizationRequest(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
57
|
+
static const auto clazz = javaClassStatic();
|
|
58
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
59
|
+
return create(
|
|
60
|
+
clazz,
|
|
61
|
+
jni::make_jstring(value.url),
|
|
62
|
+
jni::make_jstring(value.state),
|
|
63
|
+
jni::make_jstring(value.codeVerifier),
|
|
64
|
+
jni::make_jstring(value.grantPackagePublicKey)
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
} // namespace margelo::nitro::rncandle
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
// Forward declaration of `LinkedAccount` to properly resolve imports.
|
|
11
11
|
namespace margelo::nitro::rncandle { struct LinkedAccount; }
|
|
12
12
|
// Forward declaration of `Service` to properly resolve imports.
|
|
13
|
-
namespace margelo::nitro::rncandle {
|
|
13
|
+
namespace margelo::nitro::rncandle { struct Service; }
|
|
14
|
+
// Forward declaration of `ServiceID` to properly resolve imports.
|
|
15
|
+
namespace margelo::nitro::rncandle { enum class ServiceID; }
|
|
14
16
|
// Forward declaration of `LinkedAccountDetails` to properly resolve imports.
|
|
15
17
|
namespace margelo::nitro::rncandle { struct LinkedAccountDetails; }
|
|
16
18
|
// Forward declaration of `ActiveLinkedAccountDetails` to properly resolve imports.
|
|
@@ -77,6 +79,14 @@ namespace margelo::nitro::rncandle { struct Coordinates; }
|
|
|
77
79
|
namespace margelo::nitro::rncandle { struct Address; }
|
|
78
80
|
// Forward declaration of `EventAsset` to properly resolve imports.
|
|
79
81
|
namespace margelo::nitro::rncandle { struct EventAsset; }
|
|
82
|
+
// Forward declaration of `MessageThreadAsset` to properly resolve imports.
|
|
83
|
+
namespace margelo::nitro::rncandle { struct MessageThreadAsset; }
|
|
84
|
+
// Forward declaration of `MessageThreadMessage` to properly resolve imports.
|
|
85
|
+
namespace margelo::nitro::rncandle { struct MessageThreadMessage; }
|
|
86
|
+
// Forward declaration of `FriendRequestAsset` to properly resolve imports.
|
|
87
|
+
namespace margelo::nitro::rncandle { struct FriendRequestAsset; }
|
|
88
|
+
// Forward declaration of `FriendRequestAssetDirection` to properly resolve imports.
|
|
89
|
+
namespace margelo::nitro::rncandle { enum class FriendRequestAssetDirection; }
|
|
80
90
|
// Forward declaration of `OtherAsset` to properly resolve imports.
|
|
81
91
|
namespace margelo::nitro::rncandle { struct OtherAsset; }
|
|
82
92
|
// Forward declaration of `NothingAsset` to properly resolve imports.
|
|
@@ -85,6 +95,10 @@ namespace margelo::nitro::rncandle { struct NothingAsset; }
|
|
|
85
95
|
namespace margelo::nitro::rncandle { struct TradeQuotesResponse; }
|
|
86
96
|
// Forward declaration of `TradeQuote` to properly resolve imports.
|
|
87
97
|
namespace margelo::nitro::rncandle { struct TradeQuote; }
|
|
98
|
+
// Forward declaration of `HostedAuthorizationRequest` to properly resolve imports.
|
|
99
|
+
namespace margelo::nitro::rncandle { struct HostedAuthorizationRequest; }
|
|
100
|
+
// Forward declaration of `HostedAuthorizationCallback` to properly resolve imports.
|
|
101
|
+
namespace margelo::nitro::rncandle { struct HostedAuthorizationCallback; }
|
|
88
102
|
// Forward declaration of `PresentationBackground` to properly resolve imports.
|
|
89
103
|
namespace margelo::nitro::rncandle { enum class PresentationBackground; }
|
|
90
104
|
// Forward declaration of `PresentationStyle` to properly resolve imports.
|
|
@@ -119,6 +133,10 @@ namespace margelo::nitro::rncandle { struct StockAssetRef; }
|
|
|
119
133
|
namespace margelo::nitro::rncandle { struct TransportAssetRef; }
|
|
120
134
|
// Forward declaration of `EventAssetRef` to properly resolve imports.
|
|
121
135
|
namespace margelo::nitro::rncandle { struct EventAssetRef; }
|
|
136
|
+
// Forward declaration of `MessageThreadAssetRef` to properly resolve imports.
|
|
137
|
+
namespace margelo::nitro::rncandle { struct MessageThreadAssetRef; }
|
|
138
|
+
// Forward declaration of `FriendRequestAssetRef` to properly resolve imports.
|
|
139
|
+
namespace margelo::nitro::rncandle { struct FriendRequestAssetRef; }
|
|
122
140
|
// Forward declaration of `OtherAssetRef` to properly resolve imports.
|
|
123
141
|
namespace margelo::nitro::rncandle { struct OtherAssetRef; }
|
|
124
142
|
// Forward declaration of `NothingAssetRef` to properly resolve imports.
|
|
@@ -137,6 +155,12 @@ namespace margelo::nitro::rncandle { struct StockAssetQuoteRequest; }
|
|
|
137
155
|
namespace margelo::nitro::rncandle { struct TransportAssetQuoteRequest; }
|
|
138
156
|
// Forward declaration of `EventAssetQuoteRequest` to properly resolve imports.
|
|
139
157
|
namespace margelo::nitro::rncandle { struct EventAssetQuoteRequest; }
|
|
158
|
+
// Forward declaration of `MessageThreadAssetQuoteRequest` to properly resolve imports.
|
|
159
|
+
namespace margelo::nitro::rncandle { struct MessageThreadAssetQuoteRequest; }
|
|
160
|
+
// Forward declaration of `FriendRequestAssetQuoteRequest` to properly resolve imports.
|
|
161
|
+
namespace margelo::nitro::rncandle { struct FriendRequestAssetQuoteRequest; }
|
|
162
|
+
// Forward declaration of `FriendRequestAssetQuoteRequestAction` to properly resolve imports.
|
|
163
|
+
namespace margelo::nitro::rncandle { enum class FriendRequestAssetQuoteRequestAction; }
|
|
140
164
|
// Forward declaration of `NothingAssetQuoteRequest` to properly resolve imports.
|
|
141
165
|
namespace margelo::nitro::rncandle { struct NothingAssetQuoteRequest; }
|
|
142
166
|
// Forward declaration of `OtherAssetQuoteRequest` to properly resolve imports.
|
|
@@ -158,10 +182,12 @@ namespace margelo::nitro::rncandle { struct ServiceCounterpartyQuoteRequest; }
|
|
|
158
182
|
#include <string>
|
|
159
183
|
#include "Service.hpp"
|
|
160
184
|
#include "JService.hpp"
|
|
185
|
+
#include "ServiceID.hpp"
|
|
186
|
+
#include "JServiceID.hpp"
|
|
187
|
+
#include <optional>
|
|
161
188
|
#include "LinkedAccountDetails.hpp"
|
|
162
189
|
#include "JLinkedAccountDetails.hpp"
|
|
163
190
|
#include "ActiveLinkedAccountDetails.hpp"
|
|
164
|
-
#include <optional>
|
|
165
191
|
#include "JActiveLinkedAccountDetails.hpp"
|
|
166
192
|
#include "InactiveLinkedAccountDetails.hpp"
|
|
167
193
|
#include "JInactiveLinkedAccountDetails.hpp"
|
|
@@ -226,6 +252,14 @@ namespace margelo::nitro::rncandle { struct ServiceCounterpartyQuoteRequest; }
|
|
|
226
252
|
#include "JAddress.hpp"
|
|
227
253
|
#include "EventAsset.hpp"
|
|
228
254
|
#include "JEventAsset.hpp"
|
|
255
|
+
#include "MessageThreadAsset.hpp"
|
|
256
|
+
#include "JMessageThreadAsset.hpp"
|
|
257
|
+
#include "MessageThreadMessage.hpp"
|
|
258
|
+
#include "JMessageThreadMessage.hpp"
|
|
259
|
+
#include "FriendRequestAsset.hpp"
|
|
260
|
+
#include "JFriendRequestAsset.hpp"
|
|
261
|
+
#include "FriendRequestAssetDirection.hpp"
|
|
262
|
+
#include "JFriendRequestAssetDirection.hpp"
|
|
229
263
|
#include "OtherAsset.hpp"
|
|
230
264
|
#include "JOtherAsset.hpp"
|
|
231
265
|
#include "NothingAsset.hpp"
|
|
@@ -234,6 +268,10 @@ namespace margelo::nitro::rncandle { struct ServiceCounterpartyQuoteRequest; }
|
|
|
234
268
|
#include "JTradeQuotesResponse.hpp"
|
|
235
269
|
#include "TradeQuote.hpp"
|
|
236
270
|
#include "JTradeQuote.hpp"
|
|
271
|
+
#include "HostedAuthorizationRequest.hpp"
|
|
272
|
+
#include "JHostedAuthorizationRequest.hpp"
|
|
273
|
+
#include "HostedAuthorizationCallback.hpp"
|
|
274
|
+
#include "JHostedAuthorizationCallback.hpp"
|
|
237
275
|
#include "PresentationBackground.hpp"
|
|
238
276
|
#include "JPresentationBackground.hpp"
|
|
239
277
|
#include "PresentationStyle.hpp"
|
|
@@ -272,6 +310,10 @@ namespace margelo::nitro::rncandle { struct ServiceCounterpartyQuoteRequest; }
|
|
|
272
310
|
#include "JTransportAssetRef.hpp"
|
|
273
311
|
#include "EventAssetRef.hpp"
|
|
274
312
|
#include "JEventAssetRef.hpp"
|
|
313
|
+
#include "MessageThreadAssetRef.hpp"
|
|
314
|
+
#include "JMessageThreadAssetRef.hpp"
|
|
315
|
+
#include "FriendRequestAssetRef.hpp"
|
|
316
|
+
#include "JFriendRequestAssetRef.hpp"
|
|
275
317
|
#include "OtherAssetRef.hpp"
|
|
276
318
|
#include "JOtherAssetRef.hpp"
|
|
277
319
|
#include "NothingAssetRef.hpp"
|
|
@@ -290,6 +332,12 @@ namespace margelo::nitro::rncandle { struct ServiceCounterpartyQuoteRequest; }
|
|
|
290
332
|
#include "JTransportAssetQuoteRequest.hpp"
|
|
291
333
|
#include "EventAssetQuoteRequest.hpp"
|
|
292
334
|
#include "JEventAssetQuoteRequest.hpp"
|
|
335
|
+
#include "MessageThreadAssetQuoteRequest.hpp"
|
|
336
|
+
#include "JMessageThreadAssetQuoteRequest.hpp"
|
|
337
|
+
#include "FriendRequestAssetQuoteRequest.hpp"
|
|
338
|
+
#include "JFriendRequestAssetQuoteRequest.hpp"
|
|
339
|
+
#include "FriendRequestAssetQuoteRequestAction.hpp"
|
|
340
|
+
#include "JFriendRequestAssetQuoteRequestAction.hpp"
|
|
293
341
|
#include "NothingAssetQuoteRequest.hpp"
|
|
294
342
|
#include "JNothingAssetQuoteRequest.hpp"
|
|
295
343
|
#include "OtherAssetQuoteRequest.hpp"
|
|
@@ -336,26 +384,26 @@ namespace margelo::nitro::rncandle {
|
|
|
336
384
|
|
|
337
385
|
|
|
338
386
|
// Methods
|
|
339
|
-
void JHybridRNCandleSpec::candleLinkSheet(bool isPresented, const std::optional<std::vector<
|
|
340
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jboolean /* isPresented */, jni::alias_ref<jni::JArrayClass<
|
|
387
|
+
void JHybridRNCandleSpec::candleLinkSheet(bool isPresented, const std::optional<std::vector<ServiceID>>& services, bool showSandbox, double cornerRadius, const std::optional<std::string>& customerName, bool showDynamicLoading, PresentationBackground presentationBackground, PresentationStyle presentationStyle, const std::function<void(const LinkedAccount& /* linkedAccount */)>& onSuccess) {
|
|
388
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jboolean /* isPresented */, jni::alias_ref<jni::JArrayClass<JServiceID>> /* services */, jboolean /* showSandbox */, double /* cornerRadius */, jni::alias_ref<jni::JString> /* customerName */, jboolean /* showDynamicLoading */, jni::alias_ref<JPresentationBackground> /* presentationBackground */, jni::alias_ref<JPresentationStyle> /* presentationStyle */, jni::alias_ref<JFunc_void_LinkedAccount::javaobject> /* onSuccess */)>("candleLinkSheet_cxx");
|
|
341
389
|
method(_javaPart, isPresented, services.has_value() ? [&]() {
|
|
342
390
|
size_t __size = services.value().size();
|
|
343
|
-
jni::local_ref<jni::JArrayClass<
|
|
391
|
+
jni::local_ref<jni::JArrayClass<JServiceID>> __array = jni::JArrayClass<JServiceID>::newArray(__size);
|
|
344
392
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
345
393
|
const auto& __element = services.value()[__i];
|
|
346
|
-
auto __elementJni =
|
|
394
|
+
auto __elementJni = JServiceID::fromCpp(__element);
|
|
347
395
|
__array->setElement(__i, *__elementJni);
|
|
348
396
|
}
|
|
349
397
|
return __array;
|
|
350
|
-
}() : nullptr, cornerRadius, customerName.has_value() ? jni::make_jstring(customerName.value()) : nullptr, showDynamicLoading, JPresentationBackground::fromCpp(presentationBackground), JPresentationStyle::fromCpp(presentationStyle), JFunc_void_LinkedAccount_cxx::fromCpp(onSuccess));
|
|
398
|
+
}() : nullptr, showSandbox, cornerRadius, customerName.has_value() ? jni::make_jstring(customerName.value()) : nullptr, showDynamicLoading, JPresentationBackground::fromCpp(presentationBackground), JPresentationStyle::fromCpp(presentationStyle), JFunc_void_LinkedAccount_cxx::fromCpp(onSuccess));
|
|
351
399
|
}
|
|
352
400
|
void JHybridRNCandleSpec::candleTradeExecutionSheet(const TradeQuote& tradeQuote, PresentationBackground presentationBackground, const std::function<void(const TradeExecutionResult& /* result */)>& completion) {
|
|
353
401
|
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JTradeQuote> /* tradeQuote */, jni::alias_ref<JPresentationBackground> /* presentationBackground */, jni::alias_ref<JFunc_void_TradeExecutionResult::javaobject> /* completion */)>("candleTradeExecutionSheet_cxx");
|
|
354
402
|
method(_javaPart, JTradeQuote::fromCpp(tradeQuote), JPresentationBackground::fromCpp(presentationBackground), JFunc_void_TradeExecutionResult_cxx::fromCpp(completion));
|
|
355
403
|
}
|
|
356
|
-
void JHybridRNCandleSpec::initialize(const std::string&
|
|
357
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /*
|
|
358
|
-
method(_javaPart, jni::make_jstring(
|
|
404
|
+
void JHybridRNCandleSpec::initialize(const std::string& clientID, const std::optional<std::string>& accessGroup) {
|
|
405
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* clientID */, jni::alias_ref<jni::JString> /* accessGroup */)>("initialize");
|
|
406
|
+
method(_javaPart, jni::make_jstring(clientID), accessGroup.has_value() ? jni::make_jstring(accessGroup.value()) : nullptr);
|
|
359
407
|
}
|
|
360
408
|
std::shared_ptr<Promise<std::vector<LinkedAccount>>> JHybridRNCandleSpec::getLinkedAccounts() {
|
|
361
409
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("getLinkedAccounts");
|
|
@@ -525,9 +573,24 @@ namespace margelo::nitro::rncandle {
|
|
|
525
573
|
return __promise;
|
|
526
574
|
}();
|
|
527
575
|
}
|
|
528
|
-
std::
|
|
529
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<
|
|
530
|
-
auto __result = method(_javaPart, jni::make_jstring(
|
|
576
|
+
std::string JHybridRNCandleSpec::hostedAuthorizationUrl(const std::string& redirectUri, const std::string& state, const std::string& codeChallenge, const std::string& grantPackagePublicKey) {
|
|
577
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>(jni::alias_ref<jni::JString> /* redirectUri */, jni::alias_ref<jni::JString> /* state */, jni::alias_ref<jni::JString> /* codeChallenge */, jni::alias_ref<jni::JString> /* grantPackagePublicKey */)>("hostedAuthorizationUrl");
|
|
578
|
+
auto __result = method(_javaPart, jni::make_jstring(redirectUri), jni::make_jstring(state), jni::make_jstring(codeChallenge), jni::make_jstring(grantPackagePublicKey));
|
|
579
|
+
return __result->toStdString();
|
|
580
|
+
}
|
|
581
|
+
HostedAuthorizationRequest JHybridRNCandleSpec::makeHostedAuthorizationRequest(const std::string& redirectUri, const std::optional<std::string>& state) {
|
|
582
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JHostedAuthorizationRequest>(jni::alias_ref<jni::JString> /* redirectUri */, jni::alias_ref<jni::JString> /* state */)>("makeHostedAuthorizationRequest");
|
|
583
|
+
auto __result = method(_javaPart, jni::make_jstring(redirectUri), state.has_value() ? jni::make_jstring(state.value()) : nullptr);
|
|
584
|
+
return __result->toCpp();
|
|
585
|
+
}
|
|
586
|
+
HostedAuthorizationCallback JHybridRNCandleSpec::parseHostedAuthorizationCallback(const std::string& callbackUrl) {
|
|
587
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JHostedAuthorizationCallback>(jni::alias_ref<jni::JString> /* callbackUrl */)>("parseHostedAuthorizationCallback");
|
|
588
|
+
auto __result = method(_javaPart, jni::make_jstring(callbackUrl));
|
|
589
|
+
return __result->toCpp();
|
|
590
|
+
}
|
|
591
|
+
std::shared_ptr<Promise<void>> JHybridRNCandleSpec::completeHostedAuthorization(const std::string& callbackUrl) {
|
|
592
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* callbackUrl */)>("completeHostedAuthorization");
|
|
593
|
+
auto __result = method(_javaPart, jni::make_jstring(callbackUrl));
|
|
531
594
|
return [&]() {
|
|
532
595
|
auto __promise = Promise<void>::create();
|
|
533
596
|
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& /* unit */) {
|
|
@@ -540,8 +603,8 @@ namespace margelo::nitro::rncandle {
|
|
|
540
603
|
return __promise;
|
|
541
604
|
}();
|
|
542
605
|
}
|
|
543
|
-
std::shared_ptr<Promise<void>> JHybridRNCandleSpec::
|
|
544
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("
|
|
606
|
+
std::shared_ptr<Promise<void>> JHybridRNCandleSpec::signOut() {
|
|
607
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("signOut");
|
|
545
608
|
auto __result = method(_javaPart);
|
|
546
609
|
return [&]() {
|
|
547
610
|
auto __promise = Promise<void>::create();
|
|
@@ -54,9 +54,9 @@ namespace margelo::nitro::rncandle {
|
|
|
54
54
|
|
|
55
55
|
public:
|
|
56
56
|
// Methods
|
|
57
|
-
void candleLinkSheet(bool isPresented, const std::optional<std::vector<
|
|
57
|
+
void candleLinkSheet(bool isPresented, const std::optional<std::vector<ServiceID>>& services, bool showSandbox, double cornerRadius, const std::optional<std::string>& customerName, bool showDynamicLoading, PresentationBackground presentationBackground, PresentationStyle presentationStyle, const std::function<void(const LinkedAccount& /* linkedAccount */)>& onSuccess) override;
|
|
58
58
|
void candleTradeExecutionSheet(const TradeQuote& tradeQuote, PresentationBackground presentationBackground, const std::function<void(const TradeExecutionResult& /* result */)>& completion) override;
|
|
59
|
-
void initialize(const std::string&
|
|
59
|
+
void initialize(const std::string& clientID, const std::optional<std::string>& accessGroup) override;
|
|
60
60
|
std::shared_ptr<Promise<std::vector<LinkedAccount>>> getLinkedAccounts() override;
|
|
61
61
|
std::shared_ptr<Promise<LinkedAccount>> getLinkedAccount(const LinkedAccountRef& ref) override;
|
|
62
62
|
std::shared_ptr<Promise<void>> unlinkAccount(const LinkedAccountRef& ref) override;
|
|
@@ -67,8 +67,11 @@ namespace margelo::nitro::rncandle {
|
|
|
67
67
|
std::shared_ptr<Promise<Trade>> cancelTrade(const TradeRef& ref) override;
|
|
68
68
|
std::shared_ptr<Promise<TradeQuotesResponse>> getTradeQuotes(const TradeQuotesRequest& request) override;
|
|
69
69
|
std::shared_ptr<Promise<Trade>> executeTrade(const TradeQuote& quote) override;
|
|
70
|
-
std::
|
|
71
|
-
std::
|
|
70
|
+
std::string hostedAuthorizationUrl(const std::string& redirectUri, const std::string& state, const std::string& codeChallenge, const std::string& grantPackagePublicKey) override;
|
|
71
|
+
HostedAuthorizationRequest makeHostedAuthorizationRequest(const std::string& redirectUri, const std::optional<std::string>& state) override;
|
|
72
|
+
HostedAuthorizationCallback parseHostedAuthorizationCallback(const std::string& callbackUrl) override;
|
|
73
|
+
std::shared_ptr<Promise<void>> completeHostedAuthorization(const std::string& callbackUrl) override;
|
|
74
|
+
std::shared_ptr<Promise<void>> signOut() override;
|
|
72
75
|
|
|
73
76
|
private:
|
|
74
77
|
jni::global_ref<JHybridRNCandleSpec::JavaPart> _javaPart;
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
#include "JInactiveLinkedAccountDetails.hpp"
|
|
17
17
|
#include "JLinkedAccountDetails.hpp"
|
|
18
18
|
#include "JService.hpp"
|
|
19
|
+
#include "JServiceID.hpp"
|
|
19
20
|
#include "JUnavailableLinkedAccountDetails.hpp"
|
|
20
21
|
#include "LinkedAccountDetails.hpp"
|
|
21
22
|
#include "Service.hpp"
|
|
23
|
+
#include "ServiceID.hpp"
|
|
22
24
|
#include "UnavailableLinkedAccountDetails.hpp"
|
|
23
25
|
#include <optional>
|
|
24
26
|
#include <string>
|
|
@@ -12,8 +12,11 @@
|
|
|
12
12
|
|
|
13
13
|
#include "JLinkedAccountState.hpp"
|
|
14
14
|
#include "JService.hpp"
|
|
15
|
+
#include "JServiceID.hpp"
|
|
15
16
|
#include "LinkedAccountState.hpp"
|
|
16
17
|
#include "Service.hpp"
|
|
18
|
+
#include "ServiceID.hpp"
|
|
19
|
+
#include <optional>
|
|
17
20
|
#include <string>
|
|
18
21
|
|
|
19
22
|
namespace margelo::nitro::rncandle {
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMessageThreadAsset.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MessageThreadAsset.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JMessageThreadMessage.hpp"
|
|
14
|
+
#include "JService.hpp"
|
|
15
|
+
#include "JServiceID.hpp"
|
|
16
|
+
#include "MessageThreadMessage.hpp"
|
|
17
|
+
#include "Service.hpp"
|
|
18
|
+
#include "ServiceID.hpp"
|
|
19
|
+
#include <optional>
|
|
20
|
+
#include <string>
|
|
21
|
+
#include <vector>
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::rncandle {
|
|
24
|
+
|
|
25
|
+
using namespace facebook;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The C++ JNI bridge between the C++ struct "MessageThreadAsset" and the the Kotlin data class "MessageThreadAsset".
|
|
29
|
+
*/
|
|
30
|
+
struct JMessageThreadAsset final: public jni::JavaClass<JMessageThreadAsset> {
|
|
31
|
+
public:
|
|
32
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/rncandle/MessageThreadAsset;";
|
|
33
|
+
|
|
34
|
+
public:
|
|
35
|
+
/**
|
|
36
|
+
* Convert this Java/Kotlin-based struct to the C++ struct MessageThreadAsset by copying all values to C++.
|
|
37
|
+
*/
|
|
38
|
+
[[maybe_unused]]
|
|
39
|
+
[[nodiscard]]
|
|
40
|
+
MessageThreadAsset toCpp() const {
|
|
41
|
+
static const auto clazz = javaClassStatic();
|
|
42
|
+
static const auto fieldAssetKind = clazz->getField<jni::JString>("assetKind");
|
|
43
|
+
jni::local_ref<jni::JString> assetKind = this->getFieldValue(fieldAssetKind);
|
|
44
|
+
static const auto fieldServiceTradeID = clazz->getField<jni::JString>("serviceTradeID");
|
|
45
|
+
jni::local_ref<jni::JString> serviceTradeID = this->getFieldValue(fieldServiceTradeID);
|
|
46
|
+
static const auto fieldMessages = clazz->getField<jni::JArrayClass<JMessageThreadMessage>>("messages");
|
|
47
|
+
jni::local_ref<jni::JArrayClass<JMessageThreadMessage>> messages = this->getFieldValue(fieldMessages);
|
|
48
|
+
static const auto fieldLinkedAccountID = clazz->getField<jni::JString>("linkedAccountID");
|
|
49
|
+
jni::local_ref<jni::JString> linkedAccountID = this->getFieldValue(fieldLinkedAccountID);
|
|
50
|
+
static const auto fieldService = clazz->getField<JService>("service");
|
|
51
|
+
jni::local_ref<JService> service = this->getFieldValue(fieldService);
|
|
52
|
+
return MessageThreadAsset(
|
|
53
|
+
assetKind->toStdString(),
|
|
54
|
+
serviceTradeID != nullptr ? std::make_optional(serviceTradeID->toStdString()) : std::nullopt,
|
|
55
|
+
[&]() {
|
|
56
|
+
size_t __size = messages->size();
|
|
57
|
+
std::vector<MessageThreadMessage> __vector;
|
|
58
|
+
__vector.reserve(__size);
|
|
59
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
60
|
+
auto __element = messages->getElement(__i);
|
|
61
|
+
__vector.push_back(__element->toCpp());
|
|
62
|
+
}
|
|
63
|
+
return __vector;
|
|
64
|
+
}(),
|
|
65
|
+
linkedAccountID->toStdString(),
|
|
66
|
+
service->toCpp()
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public:
|
|
71
|
+
/**
|
|
72
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
73
|
+
*/
|
|
74
|
+
[[maybe_unused]]
|
|
75
|
+
static jni::local_ref<JMessageThreadAsset::javaobject> fromCpp(const MessageThreadAsset& value) {
|
|
76
|
+
using JSignature = JMessageThreadAsset(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<JMessageThreadMessage>>, jni::alias_ref<jni::JString>, jni::alias_ref<JService>);
|
|
77
|
+
static const auto clazz = javaClassStatic();
|
|
78
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
79
|
+
return create(
|
|
80
|
+
clazz,
|
|
81
|
+
jni::make_jstring(value.assetKind),
|
|
82
|
+
value.serviceTradeID.has_value() ? jni::make_jstring(value.serviceTradeID.value()) : nullptr,
|
|
83
|
+
[&]() {
|
|
84
|
+
size_t __size = value.messages.size();
|
|
85
|
+
jni::local_ref<jni::JArrayClass<JMessageThreadMessage>> __array = jni::JArrayClass<JMessageThreadMessage>::newArray(__size);
|
|
86
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
87
|
+
const auto& __element = value.messages[__i];
|
|
88
|
+
auto __elementJni = JMessageThreadMessage::fromCpp(__element);
|
|
89
|
+
__array->setElement(__i, *__elementJni);
|
|
90
|
+
}
|
|
91
|
+
return __array;
|
|
92
|
+
}(),
|
|
93
|
+
jni::make_jstring(value.linkedAccountID),
|
|
94
|
+
JService::fromCpp(value.service)
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
} // namespace margelo::nitro::rncandle
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMessageThreadAssetQuoteRequest.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MessageThreadAssetQuoteRequest.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::rncandle {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "MessageThreadAssetQuoteRequest" and the the Kotlin data class "MessageThreadAssetQuoteRequest".
|
|
21
|
+
*/
|
|
22
|
+
struct JMessageThreadAssetQuoteRequest final: public jni::JavaClass<JMessageThreadAssetQuoteRequest> {
|
|
23
|
+
public:
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/rncandle/MessageThreadAssetQuoteRequest;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct MessageThreadAssetQuoteRequest by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
MessageThreadAssetQuoteRequest toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldAssetKind = clazz->getField<jni::JString>("assetKind");
|
|
35
|
+
jni::local_ref<jni::JString> assetKind = this->getFieldValue(fieldAssetKind);
|
|
36
|
+
static const auto fieldText = clazz->getField<jni::JString>("text");
|
|
37
|
+
jni::local_ref<jni::JString> text = this->getFieldValue(fieldText);
|
|
38
|
+
return MessageThreadAssetQuoteRequest(
|
|
39
|
+
assetKind->toStdString(),
|
|
40
|
+
text->toStdString()
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
/**
|
|
46
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
47
|
+
*/
|
|
48
|
+
[[maybe_unused]]
|
|
49
|
+
static jni::local_ref<JMessageThreadAssetQuoteRequest::javaobject> fromCpp(const MessageThreadAssetQuoteRequest& value) {
|
|
50
|
+
using JSignature = JMessageThreadAssetQuoteRequest(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
51
|
+
static const auto clazz = javaClassStatic();
|
|
52
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
53
|
+
return create(
|
|
54
|
+
clazz,
|
|
55
|
+
jni::make_jstring(value.assetKind),
|
|
56
|
+
jni::make_jstring(value.text)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::rncandle
|