react-native-candle 0.1.4 → 0.1.6

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 (36) hide show
  1. package/ReactNativeCandle.podspec +37 -4
  2. package/ios/Sources/CandleLinkSheetWrapperView.swift +22 -3
  3. package/ios/Sources/CandleLinkViewModel.swift +1 -23
  4. package/ios/Sources/RNCandle.swift +44 -6
  5. package/lib/commonjs/index.js +13 -13
  6. package/lib/commonjs/index.js.map +1 -1
  7. package/lib/module/index.js +13 -11
  8. package/lib/module/index.js.map +1 -1
  9. package/lib/typescript/commonjs/src/index.d.ts +4 -6
  10. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  11. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +16 -3
  12. package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts.map +1 -1
  13. package/lib/typescript/module/src/index.d.ts +4 -6
  14. package/lib/typescript/module/src/index.d.ts.map +1 -1
  15. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +16 -3
  16. package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts.map +1 -1
  17. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.cpp +8 -0
  18. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.hpp +109 -13
  19. package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Umbrella.hpp +10 -0
  20. package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +14 -4
  21. package/nitrogen/generated/ios/swift/Details.swift +105 -0
  22. package/nitrogen/generated/ios/swift/Func_void_std__vector_LinkedAccount_.swift +46 -0
  23. package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +3 -3
  24. package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +31 -12
  25. package/nitrogen/generated/ios/swift/LinkedAccount.swift +86 -0
  26. package/nitrogen/generated/ios/swift/Service.swift +4 -8
  27. package/nitrogen/generated/ios/swift/State.swift +38 -0
  28. package/nitrogen/generated/shared/c++/Details.hpp +84 -0
  29. package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +7 -3
  30. package/nitrogen/generated/shared/c++/LinkedAccount.hpp +87 -0
  31. package/nitrogen/generated/shared/c++/Service.hpp +4 -8
  32. package/nitrogen/generated/shared/c++/State.hpp +78 -0
  33. package/package.json +1 -1
  34. package/plugin/withIosDeploymentTarget.js +101 -101
  35. package/src/index.ts +14 -15
  36. package/src/specs/RNCandle.nitro.ts +20 -6
@@ -0,0 +1,84 @@
1
+ ///
2
+ /// Details.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 `State` to properly resolve imports.
22
+ namespace margelo::nitro::rncandle { enum class State; }
23
+
24
+ #include "State.hpp"
25
+ #include <optional>
26
+ #include <string>
27
+
28
+ namespace margelo::nitro::rncandle {
29
+
30
+ /**
31
+ * A struct which can be represented as a JavaScript object (Details).
32
+ */
33
+ struct Details {
34
+ public:
35
+ State state SWIFT_PRIVATE;
36
+ std::optional<std::string> username SWIFT_PRIVATE;
37
+ std::string legalName SWIFT_PRIVATE;
38
+ std::optional<std::string> accountOpened SWIFT_PRIVATE;
39
+
40
+ public:
41
+ Details() = default;
42
+ explicit Details(State state, std::optional<std::string> username, std::string legalName, std::optional<std::string> accountOpened): state(state), username(username), legalName(legalName), accountOpened(accountOpened) {}
43
+ };
44
+
45
+ } // namespace margelo::nitro::rncandle
46
+
47
+ namespace margelo::nitro {
48
+
49
+ using namespace margelo::nitro::rncandle;
50
+
51
+ // C++ Details <> JS Details (object)
52
+ template <>
53
+ struct JSIConverter<Details> final {
54
+ static inline Details fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
55
+ jsi::Object obj = arg.asObject(runtime);
56
+ return Details(
57
+ JSIConverter<State>::fromJSI(runtime, obj.getProperty(runtime, "state")),
58
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "username")),
59
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "legalName")),
60
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "accountOpened"))
61
+ );
62
+ }
63
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const Details& arg) {
64
+ jsi::Object obj(runtime);
65
+ obj.setProperty(runtime, "state", JSIConverter<State>::toJSI(runtime, arg.state));
66
+ obj.setProperty(runtime, "username", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.username));
67
+ obj.setProperty(runtime, "legalName", JSIConverter<std::string>::toJSI(runtime, arg.legalName));
68
+ obj.setProperty(runtime, "accountOpened", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.accountOpened));
69
+ return obj;
70
+ }
71
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
72
+ if (!value.isObject()) {
73
+ return false;
74
+ }
75
+ jsi::Object obj = value.getObject(runtime);
76
+ if (!JSIConverter<State>::canConvert(runtime, obj.getProperty(runtime, "state"))) return false;
77
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "username"))) return false;
78
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "legalName"))) return false;
79
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "accountOpened"))) return false;
80
+ return true;
81
+ }
82
+ };
83
+
84
+ } // namespace margelo::nitro
@@ -19,16 +19,20 @@ namespace margelo::nitro::rncandle { enum class Service; }
19
19
  namespace margelo::nitro::rncandle { enum class PresentationBackground; }
20
20
  // Forward declaration of `PresentationStyle` to properly resolve imports.
21
21
  namespace margelo::nitro::rncandle { enum class PresentationStyle; }
22
+ // Forward declaration of `LinkedAccount` to properly resolve imports.
23
+ namespace margelo::nitro::rncandle { struct LinkedAccount; }
22
24
  // Forward declaration of `ToolCall` to properly resolve imports.
23
25
  namespace margelo::nitro::rncandle { struct ToolCall; }
24
26
 
25
- #include "Service.hpp"
26
27
  #include <optional>
28
+ #include <vector>
29
+ #include "Service.hpp"
27
30
  #include <string>
28
31
  #include "PresentationBackground.hpp"
29
32
  #include "PresentationStyle.hpp"
30
33
  #include <functional>
31
34
  #include <NitroModules/Promise.hpp>
35
+ #include "LinkedAccount.hpp"
32
36
  #include "ToolCall.hpp"
33
37
 
34
38
  namespace margelo::nitro::rncandle {
@@ -62,8 +66,8 @@ namespace margelo::nitro::rncandle {
62
66
 
63
67
  public:
64
68
  // Methods
65
- virtual void candleLinkSheet(bool isPresented, Service service, double cornerRadius, const std::optional<std::string>& customerName, bool showSandbox, bool showDynamicLoading, PresentationBackground presentationBackground, PresentationStyle presentationStyle, const std::function<void(const std::string& /* account */)>& onSuccess) = 0;
66
- virtual std::shared_ptr<Promise<std::string>> getLinkedAccounts() = 0;
69
+ virtual void candleLinkSheet(bool isPresented, const std::optional<std::vector<Service>>& services, double cornerRadius, const std::optional<std::string>& customerName, bool showDynamicLoading, PresentationBackground presentationBackground, PresentationStyle presentationStyle, const std::function<void(const std::string& /* account */)>& onSuccess) = 0;
70
+ virtual std::shared_ptr<Promise<std::vector<LinkedAccount>>> getLinkedAccounts() = 0;
67
71
  virtual std::shared_ptr<Promise<void>> unlinkAccount(const std::string& linkedAccountID) = 0;
68
72
  virtual std::shared_ptr<Promise<std::string>> getFiatAccounts() = 0;
69
73
  virtual std::shared_ptr<Promise<std::string>> getActivity(const std::optional<std::string>& span) = 0;
@@ -0,0 +1,87 @@
1
+ ///
2
+ /// LinkedAccount.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 `Details` to properly resolve imports.
22
+ namespace margelo::nitro::rncandle { struct Details; }
23
+ // Forward declaration of `Service` to properly resolve imports.
24
+ namespace margelo::nitro::rncandle { enum class Service; }
25
+
26
+ #include <string>
27
+ #include <optional>
28
+ #include "Details.hpp"
29
+ #include "Service.hpp"
30
+
31
+ namespace margelo::nitro::rncandle {
32
+
33
+ /**
34
+ * A struct which can be represented as a JavaScript object (LinkedAccount).
35
+ */
36
+ struct LinkedAccount {
37
+ public:
38
+ std::string serviceUserID SWIFT_PRIVATE;
39
+ std::optional<Details> details SWIFT_PRIVATE;
40
+ std::string linkedAccountID SWIFT_PRIVATE;
41
+ Service service SWIFT_PRIVATE;
42
+
43
+ public:
44
+ LinkedAccount() = default;
45
+ explicit LinkedAccount(std::string serviceUserID, std::optional<Details> details, std::string linkedAccountID, Service service): serviceUserID(serviceUserID), details(details), linkedAccountID(linkedAccountID), service(service) {}
46
+ };
47
+
48
+ } // namespace margelo::nitro::rncandle
49
+
50
+ namespace margelo::nitro {
51
+
52
+ using namespace margelo::nitro::rncandle;
53
+
54
+ // C++ LinkedAccount <> JS LinkedAccount (object)
55
+ template <>
56
+ struct JSIConverter<LinkedAccount> final {
57
+ static inline LinkedAccount fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
58
+ jsi::Object obj = arg.asObject(runtime);
59
+ return LinkedAccount(
60
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "serviceUserID")),
61
+ JSIConverter<std::optional<Details>>::fromJSI(runtime, obj.getProperty(runtime, "details")),
62
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID")),
63
+ JSIConverter<Service>::fromJSI(runtime, obj.getProperty(runtime, "service"))
64
+ );
65
+ }
66
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const LinkedAccount& arg) {
67
+ jsi::Object obj(runtime);
68
+ obj.setProperty(runtime, "serviceUserID", JSIConverter<std::string>::toJSI(runtime, arg.serviceUserID));
69
+ obj.setProperty(runtime, "details", JSIConverter<std::optional<Details>>::toJSI(runtime, arg.details));
70
+ obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
71
+ obj.setProperty(runtime, "service", JSIConverter<Service>::toJSI(runtime, arg.service));
72
+ return obj;
73
+ }
74
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
75
+ if (!value.isObject()) {
76
+ return false;
77
+ }
78
+ jsi::Object obj = value.getObject(runtime);
79
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "serviceUserID"))) return false;
80
+ if (!JSIConverter<std::optional<Details>>::canConvert(runtime, obj.getProperty(runtime, "details"))) return false;
81
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
82
+ if (!JSIConverter<Service>::canConvert(runtime, obj.getProperty(runtime, "service"))) return false;
83
+ return true;
84
+ }
85
+ };
86
+
87
+ } // namespace margelo::nitro
@@ -33,10 +33,9 @@ namespace margelo::nitro::rncandle {
33
33
  CASH_APP SWIFT_NAME(cashApp) = 1,
34
34
  VENMO SWIFT_NAME(venmo) = 2,
35
35
  APPLE SWIFT_NAME(apple) = 3,
36
- DEMO SWIFT_NAME(demo) = 4,
36
+ SANDBOX SWIFT_NAME(sandbox) = 4,
37
37
  UBER SWIFT_NAME(uber) = 5,
38
38
  LYFT SWIFT_NAME(lyft) = 6,
39
- DEFAULT SWIFT_NAME(default) = 7,
40
39
  } CLOSED_ENUM;
41
40
 
42
41
  } // namespace margelo::nitro::rncandle
@@ -55,10 +54,9 @@ namespace margelo::nitro {
55
54
  case hashString("cash_app"): return Service::CASH_APP;
56
55
  case hashString("venmo"): return Service::VENMO;
57
56
  case hashString("apple"): return Service::APPLE;
58
- case hashString("demo"): return Service::DEMO;
57
+ case hashString("sandbox"): return Service::SANDBOX;
59
58
  case hashString("uber"): return Service::UBER;
60
59
  case hashString("lyft"): return Service::LYFT;
61
- case hashString("default"): return Service::DEFAULT;
62
60
  default: [[unlikely]]
63
61
  throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum Service - invalid value!");
64
62
  }
@@ -69,10 +67,9 @@ namespace margelo::nitro {
69
67
  case Service::CASH_APP: return JSIConverter<std::string>::toJSI(runtime, "cash_app");
70
68
  case Service::VENMO: return JSIConverter<std::string>::toJSI(runtime, "venmo");
71
69
  case Service::APPLE: return JSIConverter<std::string>::toJSI(runtime, "apple");
72
- case Service::DEMO: return JSIConverter<std::string>::toJSI(runtime, "demo");
70
+ case Service::SANDBOX: return JSIConverter<std::string>::toJSI(runtime, "sandbox");
73
71
  case Service::UBER: return JSIConverter<std::string>::toJSI(runtime, "uber");
74
72
  case Service::LYFT: return JSIConverter<std::string>::toJSI(runtime, "lyft");
75
- case Service::DEFAULT: return JSIConverter<std::string>::toJSI(runtime, "default");
76
73
  default: [[unlikely]]
77
74
  throw std::invalid_argument("Cannot convert Service to JS - invalid value: "
78
75
  + std::to_string(static_cast<int>(arg)) + "!");
@@ -88,10 +85,9 @@ namespace margelo::nitro {
88
85
  case hashString("cash_app"):
89
86
  case hashString("venmo"):
90
87
  case hashString("apple"):
91
- case hashString("demo"):
88
+ case hashString("sandbox"):
92
89
  case hashString("uber"):
93
90
  case hashString("lyft"):
94
- case hashString("default"):
95
91
  return true;
96
92
  default:
97
93
  return false;
@@ -0,0 +1,78 @@
1
+ ///
2
+ /// State.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/NitroHash.hpp>)
11
+ #include <NitroModules/NitroHash.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
16
+ #include <NitroModules/JSIConverter.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
21
+ #include <NitroModules/NitroDefines.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ namespace margelo::nitro::rncandle {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (State).
30
+ */
31
+ enum class State {
32
+ ACTIVE SWIFT_NAME(active) = 0,
33
+ INACTIVE SWIFT_NAME(inactive) = 1,
34
+ } CLOSED_ENUM;
35
+
36
+ } // namespace margelo::nitro::rncandle
37
+
38
+ namespace margelo::nitro {
39
+
40
+ using namespace margelo::nitro::rncandle;
41
+
42
+ // C++ State <> JS State (union)
43
+ template <>
44
+ struct JSIConverter<State> final {
45
+ static inline State fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
46
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
47
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
48
+ case hashString("active"): return State::ACTIVE;
49
+ case hashString("inactive"): return State::INACTIVE;
50
+ default: [[unlikely]]
51
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum State - invalid value!");
52
+ }
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, State arg) {
55
+ switch (arg) {
56
+ case State::ACTIVE: return JSIConverter<std::string>::toJSI(runtime, "active");
57
+ case State::INACTIVE: return JSIConverter<std::string>::toJSI(runtime, "inactive");
58
+ default: [[unlikely]]
59
+ throw std::invalid_argument("Cannot convert State to JS - invalid value: "
60
+ + std::to_string(static_cast<int>(arg)) + "!");
61
+ }
62
+ }
63
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
64
+ if (!value.isString()) {
65
+ return false;
66
+ }
67
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
68
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
69
+ case hashString("active"):
70
+ case hashString("inactive"):
71
+ return true;
72
+ default:
73
+ return false;
74
+ }
75
+ }
76
+ };
77
+
78
+ } // namespace margelo::nitro
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-candle",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Candle SDK for React Native",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/module/index.js",
@@ -109,111 +109,111 @@ fi`;
109
109
  );
110
110
 
111
111
  // reference the "props"
112
- const { version, repositoryUrl, repoName, productName } = {
113
- repositoryUrl: "https://github.com/candlefinance/candle-swift",
114
- repoName: "candle-swift",
115
- productName: "Candle",
116
- version: "fa0db96e9a73740bbd4977160894a45c6db96f51",
117
- };
118
- // get XCRemoteSwiftPackageReference section
119
- const spmReferences =
120
- xcodeProject.hash.project.objects["XCRemoteSwiftPackageReference"];
121
- // if doesn't exist (this is our first SPM package) create empty object
122
- if (!spmReferences) {
123
- xcodeProject.hash.project.objects["XCRemoteSwiftPackageReference"] = {};
124
- }
125
- // generate new ID
126
- const packageReferenceUUID = xcodeProject.generateUuid();
127
- // add XCRemoteSwiftPackageReference section
128
- xcodeProject.hash.project.objects["XCRemoteSwiftPackageReference"][
129
- `${packageReferenceUUID} /* XCRemoteSwiftPackageReference "${repoName}" */`
130
- ] = {
131
- isa: "XCRemoteSwiftPackageReference",
132
- repositoryURL: repositoryUrl,
133
- requirement: {
134
- kind: "revision",
135
- revision: version,
136
- },
137
- };
112
+ // const { version, repositoryUrl, repoName, productName } = {
113
+ // repositoryUrl: "https://github.com/candlefinance/candle-swift",
114
+ // repoName: "candle-swift",
115
+ // productName: "Candle",
116
+ // version: "fa0db96e9a73740bbd4977160894a45c6db96f51",
117
+ // };
118
+ // // get XCRemoteSwiftPackageReference section
119
+ // const spmReferences =
120
+ // xcodeProject.hash.project.objects["XCRemoteSwiftPackageReference"];
121
+ // // if doesn't exist (this is our first SPM package) create empty object
122
+ // if (!spmReferences) {
123
+ // xcodeProject.hash.project.objects["XCRemoteSwiftPackageReference"] = {};
124
+ // }
125
+ // // generate new ID
126
+ // const packageReferenceUUID = xcodeProject.generateUuid();
127
+ // // add XCRemoteSwiftPackageReference section
128
+ // xcodeProject.hash.project.objects["XCRemoteSwiftPackageReference"][
129
+ // `${packageReferenceUUID} /* XCRemoteSwiftPackageReference "${repoName}" */`
130
+ // ] = {
131
+ // isa: "XCRemoteSwiftPackageReference",
132
+ // repositoryURL: repositoryUrl,
133
+ // requirement: {
134
+ // kind: "revision",
135
+ // revision: version,
136
+ // },
137
+ // };
138
138
 
139
139
  // get XCSwiftPackageProductDependency section
140
- const spmProducts =
141
- xcodeProject.hash.project.objects["XCSwiftPackageProductDependency"];
142
- // if doesn't exist (this is our first SPM package) create empty object
143
- if (!spmProducts) {
144
- xcodeProject.hash.project.objects["XCSwiftPackageProductDependency"] = {};
145
- }
146
- // generate new ID
147
- const packageUUID = xcodeProject.generateUuid();
148
- // add XCSwiftPackageProductDependency section
149
- xcodeProject.hash.project.objects["XCSwiftPackageProductDependency"][
150
- `${packageUUID} /* ${productName} */`
151
- ] = {
152
- isa: "XCSwiftPackageProductDependency",
153
- // from step before
154
- package: `${packageReferenceUUID} /* XCRemoteSwiftPackageReference "${repoName}" */`,
155
- productName: productName,
156
- };
140
+ // const spmProducts =
141
+ // xcodeProject.hash.project.objects["XCSwiftPackageProductDependency"];
142
+ // // if doesn't exist (this is our first SPM package) create empty object
143
+ // if (!spmProducts) {
144
+ // xcodeProject.hash.project.objects["XCSwiftPackageProductDependency"] = {};
145
+ // }
146
+ // // generate new ID
147
+ // const packageUUID = xcodeProject.generateUuid();
148
+ // // add XCSwiftPackageProductDependency section
149
+ // xcodeProject.hash.project.objects["XCSwiftPackageProductDependency"][
150
+ // `${packageUUID} /* ${productName} */`
151
+ // ] = {
152
+ // isa: "XCSwiftPackageProductDependency",
153
+ // // from step before
154
+ // package: `${packageReferenceUUID} /* XCRemoteSwiftPackageReference "${repoName}" */`,
155
+ // productName: productName,
156
+ // };
157
157
 
158
158
  // get main project ID
159
- const projectId = Object.keys(
160
- xcodeProject.hash.project.objects["PBXProject"]
161
- ).at(0);
162
- // create empty array for package references if it doesn't exist
163
- if (
164
- !xcodeProject.hash.project.objects["PBXProject"][projectId][
165
- "packageReferences"
166
- ]
167
- ) {
168
- xcodeProject.hash.project.objects["PBXProject"][projectId][
169
- "packageReferences"
170
- ] = [];
171
- }
172
- // add our package reference (use ID from first step)
173
- xcodeProject.hash.project.objects["PBXProject"][projectId][
174
- "packageReferences"
175
- ] = [
176
- ...xcodeProject.hash.project.objects["PBXProject"][projectId][
177
- "packageReferences"
178
- ],
179
- `${packageReferenceUUID} /* XCRemoteSwiftPackageReference "${repoName}" */`,
180
- ];
181
-
182
- // generate new ID
183
- const frameworkUUID = xcodeProject.generateUuid();
184
- // add comment and reference to our framework in PBXBuildFile section
185
- xcodeProject.hash.project.objects["PBXBuildFile"][
186
- `${frameworkUUID}_comment`
187
- ] = `${productName} in Frameworks`;
188
- xcodeProject.hash.project.objects["PBXBuildFile"][frameworkUUID] = {
189
- isa: "PBXBuildFile",
190
- productRef: packageUUID,
191
- productRef_comment: productName,
192
- };
193
-
194
- // get first build phase
195
- const buildPhaseId = Object.keys(
196
- xcodeProject.hash.project.objects["PBXFrameworksBuildPhase"]
197
- ).at(0);
198
- // create empty array for files if it doesn't exist
199
- if (
200
- !xcodeProject.hash.project.objects["PBXFrameworksBuildPhase"][buildPhaseId][
201
- "files"
202
- ]
203
- ) {
204
- xcodeProject.hash.project.objects["PBXFrameworksBuildPhase"][buildPhaseId][
205
- "files"
206
- ] = [];
207
- }
208
- // add our framework reference (use ID from step 4)
209
- xcodeProject.hash.project.objects["PBXFrameworksBuildPhase"][buildPhaseId][
210
- "files"
211
- ] = [
212
- ...xcodeProject.hash.project.objects["PBXFrameworksBuildPhase"][
213
- buildPhaseId
214
- ]["files"],
215
- `${frameworkUUID} /* ${productName} in Frameworks */`,
216
- ];
159
+ // const projectId = Object.keys(
160
+ // xcodeProject.hash.project.objects["PBXProject"]
161
+ // ).at(0);
162
+ // // create empty array for package references if it doesn't exist
163
+ // if (
164
+ // !xcodeProject.hash.project.objects["PBXProject"][projectId][
165
+ // "packageReferences"
166
+ // ]
167
+ // ) {
168
+ // xcodeProject.hash.project.objects["PBXProject"][projectId][
169
+ // "packageReferences"
170
+ // ] = [];
171
+ // }
172
+ // // add our package reference (use ID from first step)
173
+ // xcodeProject.hash.project.objects["PBXProject"][projectId][
174
+ // "packageReferences"
175
+ // ] = [
176
+ // ...xcodeProject.hash.project.objects["PBXProject"][projectId][
177
+ // "packageReferences"
178
+ // ],
179
+ // `${packageReferenceUUID} /* XCRemoteSwiftPackageReference "${repoName}" */`,
180
+ // ];
181
+
182
+ // // generate new ID
183
+ // const frameworkUUID = xcodeProject.generateUuid();
184
+ // // add comment and reference to our framework in PBXBuildFile section
185
+ // xcodeProject.hash.project.objects["PBXBuildFile"][
186
+ // `${frameworkUUID}_comment`
187
+ // ] = `${productName} in Frameworks`;
188
+ // xcodeProject.hash.project.objects["PBXBuildFile"][frameworkUUID] = {
189
+ // isa: "PBXBuildFile",
190
+ // productRef: packageUUID,
191
+ // productRef_comment: productName,
192
+ // };
193
+
194
+ // // get first build phase
195
+ // const buildPhaseId = Object.keys(
196
+ // xcodeProject.hash.project.objects["PBXFrameworksBuildPhase"]
197
+ // ).at(0);
198
+ // // create empty array for files if it doesn't exist
199
+ // if (
200
+ // !xcodeProject.hash.project.objects["PBXFrameworksBuildPhase"][buildPhaseId][
201
+ // "files"
202
+ // ]
203
+ // ) {
204
+ // xcodeProject.hash.project.objects["PBXFrameworksBuildPhase"][buildPhaseId][
205
+ // "files"
206
+ // ] = [];
207
+ // }
208
+ // // add our framework reference (use ID from step 4)
209
+ // xcodeProject.hash.project.objects["PBXFrameworksBuildPhase"][buildPhaseId][
210
+ // "files"
211
+ // ] = [
212
+ // ...xcodeProject.hash.project.objects["PBXFrameworksBuildPhase"][
213
+ // buildPhaseId
214
+ // ]["files"],
215
+ // `${frameworkUUID} /* ${productName} in Frameworks */`,
216
+ // ];
217
217
 
218
218
  return config;
219
219
  };
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { NitroModules } from "react-native-nitro-modules";
2
2
  import type {
3
+ LinkedAccount,
3
4
  PresentationBackground,
4
5
  PresentationStyle,
5
6
  RNCandle,
@@ -10,16 +11,15 @@ const CandleHybridObject =
10
11
  NitroModules.createHybridObject<RNCandle>("RNCandle");
11
12
 
12
13
  export function presentCandleLinkSheet({
13
- service = "default",
14
+ services = undefined,
14
15
  cornerRadius = 24,
15
16
  customerName,
16
- showSandbox = false,
17
17
  showDynamicLoading = true,
18
18
  presentationBackground = "default",
19
19
  presentationStyle = "sheet",
20
20
  onSuccess,
21
21
  }: {
22
- service?: Service;
22
+ services?: Service[];
23
23
  cornerRadius?: number;
24
24
  customerName?: string;
25
25
  showSandbox?: boolean;
@@ -30,10 +30,9 @@ export function presentCandleLinkSheet({
30
30
  }): void {
31
31
  CandleHybridObject.candleLinkSheet(
32
32
  true,
33
- service,
33
+ services,
34
34
  cornerRadius,
35
35
  customerName,
36
- showSandbox,
37
36
  showDynamicLoading,
38
37
  presentationBackground,
39
38
  presentationStyle,
@@ -41,21 +40,21 @@ export function presentCandleLinkSheet({
41
40
  );
42
41
  }
43
42
 
44
- export async function unlinkAccount(linkedAccountID: string): Promise<void> {
45
- await CandleHybridObject.unlinkAccount(linkedAccountID);
46
- }
47
-
48
- export async function getLinkedAccounts(): Promise<string> {
43
+ export async function getLinkedAccounts(): Promise<LinkedAccount[]> {
49
44
  return await CandleHybridObject.getLinkedAccounts();
50
45
  }
51
46
 
52
- export async function getFiatAccounts(): Promise<string> {
53
- return await CandleHybridObject.getFiatAccounts();
47
+ export async function unlinkAccount(linkedAccountID: string): Promise<void> {
48
+ await CandleHybridObject.unlinkAccount(linkedAccountID);
54
49
  }
55
50
 
56
- export async function getActivity(span?: string): Promise<string> {
57
- return await CandleHybridObject.getActivity(span);
58
- }
51
+ // export async function getFiatAccounts(): Promise<string> {
52
+ // return await CandleHybridObject.getFiatAccounts();
53
+ // }
54
+
55
+ // export async function getActivity(span?: string): Promise<string> {
56
+ // return await CandleHybridObject.getActivity(span);
57
+ // }
59
58
 
60
59
  export async function deleteUser(): Promise<void> {
61
60
  await CandleHybridObject.deleteUser();