@circle-fin/w3s-pw-react-native-sdk 1.1.7 → 2.0.0

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 (114) hide show
  1. package/BARE_REACT_NATIVE_GUIDE.md +397 -0
  2. package/LICENSE +1 -1
  3. package/README.md +196 -90
  4. package/android/build.gradle +43 -126
  5. package/android/src/main/AndroidManifest.xml +12 -16
  6. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/ProgrammablewalletRnSdkModule.kt +414 -244
  7. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseCallback.kt +76 -74
  8. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/RecordsHelper.kt +602 -0
  9. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/models/Records.kt +43 -0
  10. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/pwcustom/RnImageSetter.kt +55 -33
  11. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/pwcustom/RnLayoutProvider.kt +81 -79
  12. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/pwcustom/RnViewSetterProvider.kt +93 -63
  13. package/app.json +8 -0
  14. package/build/ProgrammablewalletRnSdkModule.d.ts +44 -0
  15. package/build/ProgrammablewalletRnSdkModule.d.ts.map +1 -0
  16. package/build/ProgrammablewalletRnSdkModule.js +21 -0
  17. package/build/ProgrammablewalletRnSdkModule.js.map +1 -0
  18. package/build/WalletSdk.d.ts +20 -0
  19. package/build/WalletSdk.d.ts.map +1 -0
  20. package/build/WalletSdk.js +303 -0
  21. package/build/WalletSdk.js.map +1 -0
  22. package/build/bridgeSafe.d.ts +50 -0
  23. package/build/bridgeSafe.d.ts.map +1 -0
  24. package/build/bridgeSafe.js +136 -0
  25. package/build/bridgeSafe.js.map +1 -0
  26. package/build/index.d.ts +21 -0
  27. package/build/index.d.ts.map +1 -0
  28. package/build/index.js +21 -0
  29. package/build/index.js.map +1 -0
  30. package/{lib/typescript/src → build}/types.d.ts +72 -43
  31. package/build/types.d.ts.map +1 -0
  32. package/build/types.js +331 -0
  33. package/build/types.js.map +1 -0
  34. package/build/utils/securityQuestionUtils.d.ts +43 -0
  35. package/build/utils/securityQuestionUtils.d.ts.map +1 -0
  36. package/build/utils/securityQuestionUtils.js +109 -0
  37. package/build/utils/securityQuestionUtils.js.map +1 -0
  38. package/expo-module.config.json +11 -0
  39. package/ios/Array+Extension.swift +17 -15
  40. package/ios/BridgeHelper.swift +71 -92
  41. package/ios/{RnWalletSdk+CustomizeAdapter.swift → CustomizeAdapter.swift} +19 -29
  42. package/ios/ProgrammablewalletRnSdk.podspec +30 -0
  43. package/ios/ProgrammablewalletRnSdkModule.swift +384 -0
  44. package/ios/TextConfig.swift +17 -15
  45. package/ios/TextKey.swift +17 -15
  46. package/ios/UIApplication+Extension.swift +26 -17
  47. package/ios/UIColor+Extension.swift +34 -28
  48. package/ios/UITextField+Extension.swift +31 -0
  49. package/ios/UIView+Extension.swift +24 -17
  50. package/package.json +70 -116
  51. package/plugins/apple-signin-entitlements.js +16 -0
  52. package/plugins/infoplist-config.js +77 -0
  53. package/plugins/infoplist-config.md +72 -0
  54. package/plugins/podfile-modifier.js +84 -0
  55. package/plugins/podfile-modifier.md +33 -0
  56. package/plugins/withCopyFiles.js +132 -0
  57. package/plugins/withCopyFiles.md +81 -0
  58. package/src/ProgrammablewalletRnSdkModule.ts +68 -38
  59. package/src/WalletSdk.ts +297 -159
  60. package/src/bridgeSafe.ts +156 -0
  61. package/src/index.ts +21 -0
  62. package/src/types.ts +133 -110
  63. package/src/utils/securityQuestionUtils.ts +121 -0
  64. package/COPYRIGHT +0 -10
  65. package/android/gradle.properties +0 -21
  66. package/android/src/main/AndroidManifestNew.xml +0 -22
  67. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/BridgeHelper.kt +0 -399
  68. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/ProgrammablewalletRnSdkPackage.kt +0 -49
  69. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseCallback2.kt +0 -65
  70. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseLogoutCallback.kt +0 -47
  71. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseSocialCallback.kt +0 -53
  72. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/TestHelper.kt +0 -37
  73. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/annotation/ExcludeFromGeneratedCCReport.kt +0 -33
  74. package/android/src/newarch/ProgrammablewalletRnSdkSpec.kt +0 -29
  75. package/android/src/oldarch/ProgrammablewalletRnSdkSpec.kt +0 -76
  76. package/circlefin-w3s-pw-react-native-sdk.podspec +0 -41
  77. package/ios/EventEmitter.swift +0 -49
  78. package/ios/ProgrammablewalletRnSdk.h +0 -29
  79. package/ios/ProgrammablewalletRnSdk.mm +0 -162
  80. package/ios/ReactNativeEventEmitter.m +0 -27
  81. package/ios/ReactNativeEventEmitter.swift +0 -37
  82. package/ios/RnWalletSdk.swift +0 -390
  83. package/ios/programmablewallet-rn-sdk-Bridging-Header.h +0 -22
  84. package/lib/commonjs/NativeProgrammablewalletRnSdk.js +0 -24
  85. package/lib/commonjs/NativeProgrammablewalletRnSdk.js.map +0 -1
  86. package/lib/commonjs/ProgrammablewalletRnSdkModule.js +0 -38
  87. package/lib/commonjs/ProgrammablewalletRnSdkModule.js.map +0 -1
  88. package/lib/commonjs/WalletSdk.js +0 -211
  89. package/lib/commonjs/WalletSdk.js.map +0 -1
  90. package/lib/commonjs/index.js +0 -74
  91. package/lib/commonjs/index.js.map +0 -1
  92. package/lib/commonjs/types.js +0 -342
  93. package/lib/commonjs/types.js.map +0 -1
  94. package/lib/module/NativeProgrammablewalletRnSdk.js +0 -19
  95. package/lib/module/NativeProgrammablewalletRnSdk.js.map +0 -1
  96. package/lib/module/ProgrammablewalletRnSdkModule.js +0 -31
  97. package/lib/module/ProgrammablewalletRnSdkModule.js.map +0 -1
  98. package/lib/module/WalletSdk.js +0 -203
  99. package/lib/module/WalletSdk.js.map +0 -1
  100. package/lib/module/index.js +0 -18
  101. package/lib/module/index.js.map +0 -1
  102. package/lib/module/types.js +0 -334
  103. package/lib/module/types.js.map +0 -1
  104. package/lib/typescript/src/NativeProgrammablewalletRnSdk.d.ts +0 -28
  105. package/lib/typescript/src/NativeProgrammablewalletRnSdk.d.ts.map +0 -1
  106. package/lib/typescript/src/ProgrammablewalletRnSdkModule.d.ts +0 -3
  107. package/lib/typescript/src/ProgrammablewalletRnSdkModule.d.ts.map +0 -1
  108. package/lib/typescript/src/WalletSdk.d.ts +0 -3
  109. package/lib/typescript/src/WalletSdk.d.ts.map +0 -1
  110. package/lib/typescript/src/index.d.ts +0 -4
  111. package/lib/typescript/src/index.d.ts.map +0 -1
  112. package/lib/typescript/src/types.d.ts.map +0 -1
  113. package/src/NativeProgrammablewalletRnSdk.ts +0 -77
  114. package/src/index.tsx +0 -29
@@ -1,29 +0,0 @@
1
- // Copyright (c) 2024, Circle Internet Financial, LTD. All rights reserved.
2
- //
3
- // SPDX-License-Identifier: Apache-2.0
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License");
6
- // you may not use this file except in compliance with the License.
7
- // You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing, software
12
- // distributed under the License is distributed on an "AS IS" BASIS,
13
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- // See the License for the specific language governing permissions and
15
- // limitations under the License.
16
- package com.circlefin.programmablewalletrnsdk
17
-
18
- import circle.programmablewallet.sdk.WalletSdk
19
- import com.facebook.react.bridge.ReactApplicationContext
20
-
21
- abstract class ProgrammablewalletRnSdkSpec internal constructor(context: ReactApplicationContext) :
22
- NativeProgrammablewalletRnSdkSpec(context) {
23
-
24
- override fun getTypedExportedConstants(): MutableMap<String, Any> {
25
- val constants: MutableMap<String, Any> = HashMap()
26
- constants["sdkVersion"] = WalletSdk.sdkVersion()
27
- return constants
28
- }
29
- }
@@ -1,76 +0,0 @@
1
- // Copyright (c) 2024, Circle Internet Financial, LTD. All rights reserved.
2
- //
3
- // SPDX-License-Identifier: Apache-2.0
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License");
6
- // you may not use this file except in compliance with the License.
7
- // You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing, software
12
- // distributed under the License is distributed on an "AS IS" BASIS,
13
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- // See the License for the specific language governing permissions and
15
- // limitations under the License.
16
- package com.circlefin.programmablewalletrnsdk
17
-
18
- import com.facebook.react.bridge.ReactApplicationContext
19
- import com.facebook.react.bridge.ReactContextBaseJavaModule
20
- import com.facebook.react.bridge.Promise
21
- import com.facebook.react.bridge.ReadableArray
22
- import com.facebook.react.bridge.ReadableMap
23
- import circle.programmablewallet.sdk.WalletSdk
24
-
25
- abstract class ProgrammablewalletRnSdkSpec internal constructor(val context: ReactApplicationContext) :
26
- ReactContextBaseJavaModule(context) {
27
-
28
- abstract fun initSdk(configuration: ReadableMap, promise: Promise)
29
- abstract fun setSecurityQuestions(questionArr: ReadableArray)
30
- abstract fun getDeviceId(): String
31
- abstract fun execute(
32
- userToken: String?,
33
- secretKey: String?,
34
- challengeIdArr: ReadableArray,
35
- promise: Promise?
36
- )
37
- abstract fun setBiometricsPin(
38
- userToken: String?,
39
- secretKey: String?,
40
- promise: Promise?
41
- )
42
- abstract fun performLogin(
43
- provider: String,
44
- deviceToken: String,
45
- deviceEncryptionKey: String,
46
- promise: Promise
47
- )
48
- abstract fun verifyOTP(
49
- otpToken: String,
50
- deviceToken: String,
51
- deviceEncryptionKey: String,
52
- promise: Promise
53
- )
54
- abstract fun performLogout(
55
- provider: String,
56
- promise: Promise
57
- )
58
-
59
- abstract fun setDismissOnCallbackMap(readableMap: ReadableMap)
60
- abstract fun moveTaskToFront()
61
- abstract fun moveRnTaskToFront()
62
- abstract fun setTextConfigsMap(readableMap: ReadableMap)
63
- abstract fun setIconTextConfigsMap(readableMap: ReadableMap)
64
- abstract fun setTextConfigMap(readableMap: ReadableMap)
65
- abstract fun setImageMap(readableMap: ReadableMap)
66
- abstract fun setDateFormat(value: String)
67
- abstract fun setDebugging(value: Boolean)
68
- abstract fun setCustomUserAgent(value: String)
69
- abstract fun setErrorStringMap(readableMap: ReadableMap)
70
- override fun getConstants(): MutableMap<String, Any> {
71
- val constants: MutableMap<String, Any> = HashMap()
72
- constants["sdkVersion"] = WalletSdk.sdkVersion()
73
- constants["deviceId"] = WalletSdk.getDeviceId(context) ?: ""
74
- return constants
75
- }
76
- }
@@ -1,41 +0,0 @@
1
- require "json"
2
-
3
- package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
- folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
-
6
- Pod::Spec.new do |s|
7
- s.name = "circlefin-w3s-pw-react-native-sdk"
8
- s.version = package["version"]
9
- s.summary = package["description"]
10
- s.homepage = package["homepage"]
11
- s.license = package["license"]
12
- s.authors = package["author"]
13
-
14
- s.platforms = { :ios => "11.0" }
15
- s.source = { :git => package["repository"], :tag => "#{s.version}" }
16
-
17
- s.source_files = "ios/**/*.{h,m,mm,swift}"
18
- s.dependency 'CircleProgrammableWalletSDK_static', '1.1.9'
19
-
20
- # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
21
- # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
22
- if respond_to?(:install_modules_dependencies, true)
23
- install_modules_dependencies(s)
24
- else
25
- s.dependency "React-Core"
26
- # Don't install the dependencies when we run `pod install` in the old architecture.
27
- if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
28
- s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
29
- s.pod_target_xcconfig = {
30
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
31
- "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
32
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
33
- }
34
- s.dependency "React-Codegen"
35
- s.dependency "RCT-Folly"
36
- s.dependency "RCTRequired"
37
- s.dependency "RCTTypeSafety"
38
- s.dependency "ReactCommon/turbomodule/core"
39
- end
40
- end
41
- end
@@ -1,49 +0,0 @@
1
- // Copyright (c) 2024, Circle Internet Financial, LTD. All rights reserved.
2
- //
3
- // SPDX-License-Identifier: Apache-2.0
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License");
6
- // you may not use this file except in compliance with the License.
7
- // You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing, software
12
- // distributed under the License is distributed on an "AS IS" BASIS,
13
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- // See the License for the specific language governing permissions and
15
- // limitations under the License.
16
-
17
- import Foundation
18
-
19
- class EventEmitter {
20
-
21
- /// Shared Instance.
22
- public static var sharedInstance = EventEmitter()
23
-
24
- // ReactNativeEventEmitter is instantiated by React Native with the bridge.
25
- private var eventEmitter: ReactNativeEventEmitter!
26
-
27
- private init() {}
28
-
29
- // When React Native instantiates the emitter it is registered here.
30
- func registerEventEmitter(eventEmitter: ReactNativeEventEmitter) {
31
- self.eventEmitter = eventEmitter
32
- }
33
-
34
- func dispatch(name: String, body: Any?) {
35
- eventEmitter.sendEvent(withName: name, body: body)
36
- }
37
-
38
- /// All Events which must be support by React Native.
39
- lazy var allEvents: [String] = {
40
- var allEventNames: [String] = [
41
- "CirclePwOnEvent",
42
- "CirclePwOnSuccess",
43
- "CirclePwOnError",
44
- ]
45
-
46
- return allEventNames
47
- }()
48
-
49
- }
@@ -1,29 +0,0 @@
1
- // Copyright (c) 2024, Circle Internet Financial, LTD. All rights reserved.
2
- //
3
- // SPDX-License-Identifier: Apache-2.0
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License");
6
- // you may not use this file except in compliance with the License.
7
- // You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing, software
12
- // distributed under the License is distributed on an "AS IS" BASIS,
13
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- // See the License for the specific language governing permissions and
15
- // limitations under the License.
16
-
17
- #ifdef RCT_NEW_ARCH_ENABLED
18
-
19
- #import "RNProgrammablewalletRnSdkSpec.h"
20
- #import <React/RCTEventEmitter.h>
21
- @interface ProgrammablewalletRnSdk : RCTEventEmitter <NativeProgrammablewalletRnSdkSpec>
22
-
23
- #else
24
-
25
- #import <React/RCTBridgeModule.h>
26
- @interface ProgrammablewalletRnSdk : NSObject <RCTBridgeModule>
27
- #endif
28
-
29
- @end
@@ -1,162 +0,0 @@
1
- // Copyright (c) 2024, Circle Internet Financial, LTD. All rights reserved.
2
- //
3
- // SPDX-License-Identifier: Apache-2.0
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License");
6
- // you may not use this file except in compliance with the License.
7
- // You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing, software
12
- // distributed under the License is distributed on an "AS IS" BASIS,
13
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- // See the License for the specific language governing permissions and
15
- // limitations under the License.
16
-
17
- #import "ProgrammablewalletRnSdk.h"
18
- #import "circlefin_w3s_pw_react_native_sdk/circlefin_w3s_pw_react_native_sdk-Swift.h"
19
-
20
- @implementation ProgrammablewalletRnSdk
21
- RCT_EXPORT_MODULE()
22
- RNWalletSdk *sdk = [[RNWalletSdk alloc]init];
23
- RCT_EXPORT_METHOD(initSdk:(NSDictionary *)configuration
24
- resolve:(RCTPromiseResolveBlock)resolve
25
- reject:(RCTPromiseRejectBlock)reject)
26
- {
27
- [sdk initSdk:configuration resolve:resolve reject:reject];
28
- }
29
-
30
- RCT_EXPORT_METHOD(setSecurityQuestions:(NSArray *)questions)
31
- {
32
- [sdk setSecurityQuestions:questions];
33
- }
34
-
35
- RCT_EXPORT_METHOD(execute:(NSString *)userToken
36
- encryptionKey:(NSString *)encryptionKey
37
- challengeIds:(NSArray *)challengeIds
38
- resolve:(RCTPromiseResolveBlock)resolve
39
- reject:(RCTPromiseRejectBlock)reject)
40
- {
41
- [sdk execute:userToken encryptionKey:encryptionKey challengeIds:challengeIds resolve:resolve reject:reject];
42
- }
43
-
44
- RCT_EXPORT_METHOD(setBiometricsPin:(NSString *)userToken
45
- encryptionKey:(NSString *)encryptionKey
46
- resolve:(RCTPromiseResolveBlock)resolve
47
- reject:(RCTPromiseRejectBlock)reject)
48
- {
49
- [sdk setBiometricsPin:userToken encryptionKey:encryptionKey resolve:resolve reject:reject];
50
- }
51
-
52
- RCT_EXPORT_METHOD(performLogin:(NSString *)provider
53
- deviceToken:(NSString *)deviceToken
54
- deviceEncryptionKey:(NSString *)deviceEncryptionKey
55
- resolve:(RCTPromiseResolveBlock)resolve
56
- reject:(RCTPromiseRejectBlock)reject)
57
- {
58
- [sdk performLoginWithProvider:provider deviceToken:deviceToken encryptionKey:deviceEncryptionKey resolve:resolve reject:reject];
59
- }
60
-
61
- RCT_EXPORT_METHOD(verifyOTP:(NSString *)otpToken
62
- deviceToken:(NSString *)deviceToken
63
- deviceEncryptionKey:(NSString *)deviceEncryptionKey
64
- resolve:(RCTPromiseResolveBlock)resolve
65
- reject:(RCTPromiseRejectBlock)reject)
66
- {
67
- [sdk verifyOTPWithDeviceToken:deviceToken encryptionKey:deviceEncryptionKey otpToken:otpToken resolve:resolve reject:reject];
68
- }
69
-
70
- RCT_EXPORT_METHOD(performLogout:(NSString *)provider
71
- resolve:(RCTPromiseResolveBlock)resolve
72
- reject:(RCTPromiseRejectBlock)reject)
73
- {
74
- [sdk performLogoutWithProvider:provider resolve:resolve reject:reject];
75
- }
76
-
77
- RCT_EXPORT_METHOD(setDismissOnCallbackMap:(NSDictionary *)map)
78
- {
79
- [sdk setDismissOnCallbackMap:map];
80
- }
81
-
82
- RCT_EXPORT_METHOD(moveTaskToFront)
83
- {
84
- [sdk moveTaskToFront];
85
- }
86
-
87
- RCT_EXPORT_METHOD(moveRnTaskToFront)
88
- {
89
- [sdk moveRnTaskToFront];
90
- }
91
-
92
- RCT_EXPORT_METHOD(setTextConfigsMap:(NSDictionary *)map)
93
- {
94
- [sdk setTextConfigsMap:map];
95
- }
96
-
97
- RCT_EXPORT_METHOD(setIconTextConfigsMap:(NSDictionary *)map)
98
- {
99
- [sdk setIconTextConfigsMap:map];
100
- }
101
-
102
- RCT_EXPORT_METHOD(setTextConfigMap:(NSDictionary *)map)
103
- {
104
- [sdk setTextConfigMap:map];
105
- }
106
-
107
- RCT_EXPORT_METHOD(setImageMap:(NSDictionary *)map)
108
- {
109
- [sdk setImageMap:map];
110
- }
111
-
112
- RCT_EXPORT_METHOD(setDateFormat:(NSString *)format)
113
- {
114
- [sdk setDateFormatWithFormat:format];
115
- }
116
-
117
- RCT_EXPORT_METHOD(setDebugging:(BOOL)debugging)
118
- {
119
- [sdk setDebuggingWithDebugging: debugging];
120
- }
121
-
122
- RCT_EXPORT_METHOD(setCustomUserAgent:(NSString *)userAgent)
123
- {
124
- [sdk setCustomUserAgentWithUserAgent:userAgent];
125
- }
126
-
127
- RCT_EXPORT_METHOD(setErrorStringMap:(NSDictionary *)map)
128
- {
129
- [sdk setErrorStringMap:map];
130
- }
131
- RCT_EXPORT_METHOD(getDeviceId)
132
- {
133
- // Export an empty getDeviceId() function since on Android new architechure it's needed to return value through a function.
134
- }
135
-
136
- - (NSDictionary *)getConstants
137
- {
138
- return @{ @"sdkVersion": [sdk sdkVersion],
139
- @"deviceId": [sdk getDeviceId]};
140
- }
141
- - (NSDictionary *)constantsToExport
142
- {
143
- return @{ @"sdkVersion": [sdk sdkVersion],
144
- @"deviceId": [sdk getDeviceId]};
145
- }
146
- + (BOOL)requiresMainQueueSetup
147
- {
148
- return YES; // only do this if your module initialization relies on calling UIKit!
149
- }
150
- - (dispatch_queue_t)methodQueue{
151
- return dispatch_get_main_queue();
152
- }
153
- #ifdef RCT_NEW_ARCH_ENABLED
154
- -(std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
155
- (const facebook::react::ObjCTurboModule::InitParams &)params
156
- {
157
- return std::make_shared<facebook::react::NativeProgrammablewalletRnSdkSpecJSI>(params);
158
- }
159
- #endif
160
-
161
- @end
162
-
@@ -1,27 +0,0 @@
1
- // Copyright (c) 2024, Circle Internet Financial, LTD. All rights reserved.
2
- //
3
- // SPDX-License-Identifier: Apache-2.0
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License");
6
- // you may not use this file except in compliance with the License.
7
- // You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing, software
12
- // distributed under the License is distributed on an "AS IS" BASIS,
13
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- // See the License for the specific language governing permissions and
15
- // limitations under the License.
16
-
17
- #import <Foundation/Foundation.h>
18
-
19
- #import <Foundation/Foundation.h>
20
- #import <React/RCTBridgeModule.h>
21
- #import <React/RCTEventEmitter.h>
22
-
23
- @interface RCT_EXTERN_MODULE(ReactNativeEventEmitter, RCTEventEmitter)
24
-
25
- RCT_EXTERN_METHOD(supportedEvents)
26
-
27
- @end
@@ -1,37 +0,0 @@
1
- // Copyright (c) 2024, Circle Internet Financial, LTD. All rights reserved.
2
- //
3
- // SPDX-License-Identifier: Apache-2.0
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License");
6
- // you may not use this file except in compliance with the License.
7
- // You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing, software
12
- // distributed under the License is distributed on an "AS IS" BASIS,
13
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- // See the License for the specific language governing permissions and
15
- // limitations under the License.
16
-
17
- import Foundation
18
-
19
- @objc(ReactNativeEventEmitter)
20
- class ReactNativeEventEmitter: RCTEventEmitter {
21
-
22
- override init() {
23
- super.init()
24
- EventEmitter.sharedInstance.registerEventEmitter(eventEmitter: self)
25
- }
26
-
27
- /// Base overide for RCTEventEmitter.
28
- ///
29
- /// - Returns: all supported events
30
- @objc override func supportedEvents() -> [String] {
31
- return EventEmitter.sharedInstance.allEvents
32
- }
33
-
34
- @objc override static func requiresMainQueueSetup() -> Bool {
35
- return true
36
- }
37
- }