@circle-fin/w3s-pw-react-native-sdk 1.1.7 → 2.0.1
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/BARE_REACT_NATIVE_GUIDE.md +397 -0
- package/LICENSE +1 -1
- package/README.md +203 -90
- package/android/build.gradle +43 -126
- package/android/src/main/AndroidManifest.xml +12 -16
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/ProgrammablewalletRnSdkModule.kt +414 -244
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseCallback.kt +76 -74
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/RecordsHelper.kt +602 -0
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/models/Records.kt +43 -0
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/pwcustom/RnImageSetter.kt +55 -33
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/pwcustom/RnLayoutProvider.kt +81 -79
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/pwcustom/RnViewSetterProvider.kt +93 -63
- package/app.json +8 -0
- package/build/ProgrammablewalletRnSdkModule.d.ts +44 -0
- package/build/ProgrammablewalletRnSdkModule.d.ts.map +1 -0
- package/build/ProgrammablewalletRnSdkModule.js +21 -0
- package/build/ProgrammablewalletRnSdkModule.js.map +1 -0
- package/build/WalletSdk.d.ts +20 -0
- package/build/WalletSdk.d.ts.map +1 -0
- package/build/WalletSdk.js +303 -0
- package/build/WalletSdk.js.map +1 -0
- package/build/bridgeSafe.d.ts +50 -0
- package/build/bridgeSafe.d.ts.map +1 -0
- package/build/bridgeSafe.js +136 -0
- package/build/bridgeSafe.js.map +1 -0
- package/build/index.d.ts +21 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +21 -0
- package/build/index.js.map +1 -0
- package/{lib/typescript/src → build}/types.d.ts +72 -43
- package/build/types.d.ts.map +1 -0
- package/build/types.js +331 -0
- package/build/types.js.map +1 -0
- package/build/utils/securityQuestionUtils.d.ts +43 -0
- package/build/utils/securityQuestionUtils.d.ts.map +1 -0
- package/build/utils/securityQuestionUtils.js +109 -0
- package/build/utils/securityQuestionUtils.js.map +1 -0
- package/expo-module.config.json +11 -0
- package/ios/Array+Extension.swift +17 -15
- package/ios/BridgeHelper.swift +71 -92
- package/ios/{RnWalletSdk+CustomizeAdapter.swift → CustomizeAdapter.swift} +19 -29
- package/ios/ProgrammablewalletRnSdk.podspec +30 -0
- package/ios/ProgrammablewalletRnSdkModule.swift +384 -0
- package/ios/TextConfig.swift +17 -15
- package/ios/TextKey.swift +17 -15
- package/ios/UIApplication+Extension.swift +26 -17
- package/ios/UIColor+Extension.swift +34 -28
- package/ios/UITextField+Extension.swift +31 -0
- package/ios/UIView+Extension.swift +24 -17
- package/package.json +71 -116
- package/plugins/apple-signin-entitlements.js +16 -0
- package/plugins/infoplist-config.js +77 -0
- package/plugins/infoplist-config.md +72 -0
- package/plugins/podfile-modifier.js +84 -0
- package/plugins/podfile-modifier.md +33 -0
- package/plugins/withCopyFiles.js +148 -0
- package/plugins/withCopyFiles.md +81 -0
- package/src/ProgrammablewalletRnSdkModule.ts +68 -38
- package/src/WalletSdk.ts +297 -159
- package/src/bridgeSafe.ts +156 -0
- package/src/index.ts +21 -0
- package/src/types.ts +133 -110
- package/src/utils/securityQuestionUtils.ts +121 -0
- package/COPYRIGHT +0 -10
- package/android/gradle.properties +0 -21
- package/android/src/main/AndroidManifestNew.xml +0 -22
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/BridgeHelper.kt +0 -399
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/ProgrammablewalletRnSdkPackage.kt +0 -49
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseCallback2.kt +0 -65
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseLogoutCallback.kt +0 -47
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseSocialCallback.kt +0 -53
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/TestHelper.kt +0 -37
- package/android/src/main/java/com/circlefin/programmablewalletrnsdk/annotation/ExcludeFromGeneratedCCReport.kt +0 -33
- package/android/src/newarch/ProgrammablewalletRnSdkSpec.kt +0 -29
- package/android/src/oldarch/ProgrammablewalletRnSdkSpec.kt +0 -76
- package/circlefin-w3s-pw-react-native-sdk.podspec +0 -41
- package/ios/EventEmitter.swift +0 -49
- package/ios/ProgrammablewalletRnSdk.h +0 -29
- package/ios/ProgrammablewalletRnSdk.mm +0 -162
- package/ios/ReactNativeEventEmitter.m +0 -27
- package/ios/ReactNativeEventEmitter.swift +0 -37
- package/ios/RnWalletSdk.swift +0 -390
- package/ios/programmablewallet-rn-sdk-Bridging-Header.h +0 -22
- package/lib/commonjs/NativeProgrammablewalletRnSdk.js +0 -24
- package/lib/commonjs/NativeProgrammablewalletRnSdk.js.map +0 -1
- package/lib/commonjs/ProgrammablewalletRnSdkModule.js +0 -38
- package/lib/commonjs/ProgrammablewalletRnSdkModule.js.map +0 -1
- package/lib/commonjs/WalletSdk.js +0 -211
- package/lib/commonjs/WalletSdk.js.map +0 -1
- package/lib/commonjs/index.js +0 -74
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/types.js +0 -342
- package/lib/commonjs/types.js.map +0 -1
- package/lib/module/NativeProgrammablewalletRnSdk.js +0 -19
- package/lib/module/NativeProgrammablewalletRnSdk.js.map +0 -1
- package/lib/module/ProgrammablewalletRnSdkModule.js +0 -31
- package/lib/module/ProgrammablewalletRnSdkModule.js.map +0 -1
- package/lib/module/WalletSdk.js +0 -203
- package/lib/module/WalletSdk.js.map +0 -1
- package/lib/module/index.js +0 -18
- package/lib/module/index.js.map +0 -1
- package/lib/module/types.js +0 -334
- package/lib/module/types.js.map +0 -1
- package/lib/typescript/src/NativeProgrammablewalletRnSdk.d.ts +0 -28
- package/lib/typescript/src/NativeProgrammablewalletRnSdk.d.ts.map +0 -1
- package/lib/typescript/src/ProgrammablewalletRnSdkModule.d.ts +0 -3
- package/lib/typescript/src/ProgrammablewalletRnSdkModule.d.ts.map +0 -1
- package/lib/typescript/src/WalletSdk.d.ts +0 -3
- package/lib/typescript/src/WalletSdk.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -4
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/types.d.ts.map +0 -1
- package/src/NativeProgrammablewalletRnSdk.ts +0 -77
- package/src/index.tsx +0 -29
package/README.md
CHANGED
|
@@ -1,112 +1,225 @@
|
|
|
1
|
-
#
|
|
2
|
-
React Native SDK for Circle Programmable Wallet
|
|
3
|
-
## Install NVM
|
|
1
|
+
# Circle User-Controlled Wallets React Native SDK
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
> SDK for integrating Circle's user-controlled wallet into React Native applications
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
> [!IMPORTANT]
|
|
6
|
+
> This SDK supports both Expo and bare React Native projects. Select the appropriate guide based on your project type.
|
|
7
|
+
>
|
|
8
|
+
> - **Bare React Native** (manages native code manually) → Go to [Bare React Native Integration Guide](./BARE_REACT_NATIVE_GUIDE.md)
|
|
9
|
+
> - **Expo project** (uses `expo prebuild` and has `app.json`/`app.config.js`) ↓ Continue below
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
---
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Migrating from SDK v1 (Bare React Native)
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
If you have an existing bare React Native project using SDK v1 and want to upgrade to SDK v2, see the [SDK v1 Migration Guide](https://github.com/circlefin/w3s-react-native-sample-app-wallets/blob/master/MIGRATION_GUIDE.md).
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
You can also find the SDK v1 sample app in the sample app repository's [sdk-v1 branch](https://github.com/circlefin/w3s-react-native-sample-app-wallets/tree/sdk-v1).
|
|
18
|
+
|
|
19
|
+
## System Requirements
|
|
20
|
+
|
|
21
|
+
| Platform | Minimum Version | Recommended Version |
|
|
22
|
+
| ------------ | --------------- | ------------------- |
|
|
23
|
+
| React Native | 0.60+ | 0.76-0.81 |
|
|
24
|
+
| iOS | 15.1+ | iOS 17+ |
|
|
25
|
+
| Android | API 21+ | API 33+ |
|
|
26
|
+
| Expo SDK | 49+ | 53+ |
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
> [!IMPORTANT]
|
|
31
|
+
> **Prerequisites**: This SDK uses native modules and requires a [development build](https://docs.expo.dev/develop/development-builds/introduction). Expo Go is not supported.
|
|
32
|
+
|
|
33
|
+
Follow these steps in order. The SDK will be fully configured after running `expo prebuild`.
|
|
34
|
+
|
|
35
|
+
#### Step 1: Generate Native Projects (Skip if `android`/`ios` Already Exist)
|
|
36
|
+
|
|
37
|
+
If you don't have `android/` and `ios/` directories yet, generate them:
|
|
38
|
+
|
|
39
|
+
```shell
|
|
40
|
+
npx expo prebuild
|
|
19
41
|
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```properties
|
|
26
|
-
npm notice Log in on https://registry.npmjs.org/
|
|
27
|
-
Username: <insert your GitHub username here>
|
|
28
|
-
Password: <insert your GitHub personal access token here>
|
|
42
|
+
|
|
43
|
+
#### Step 2: Install the SDK Package
|
|
44
|
+
|
|
45
|
+
```shell
|
|
46
|
+
npx expo install @circle-fin/w3s-pw-react-native-sdk
|
|
29
47
|
```
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
|
|
48
|
+
|
|
49
|
+
#### Step 3: Configure app.json
|
|
50
|
+
|
|
51
|
+
Add both required plugins to `app.json`:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"expo": {
|
|
56
|
+
"plugins": [
|
|
57
|
+
[
|
|
58
|
+
"@circle-fin/w3s-pw-react-native-sdk/plugins/withCopyFiles",
|
|
59
|
+
{
|
|
60
|
+
"sourceDir": "prebuild-sync-src",
|
|
61
|
+
"targetDir": ".",
|
|
62
|
+
"overwrite": true
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"@circle-fin/w3s-pw-react-native-sdk/plugins/podfile-modifier"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
37
69
|
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
70
|
+
|
|
71
|
+
**What these plugins do:**
|
|
72
|
+
|
|
73
|
+
- `withCopyFiles`: Preserves your Android/iOS configurations across rebuilds
|
|
74
|
+
- `podfile-modifier`: Automatically configures iOS Podfile for Circle SDK
|
|
75
|
+
|
|
76
|
+
> [!TIP]
|
|
77
|
+
> Prefer manual setup? Skip `podfile-modifier` and follow the [iOS configuration](./BARE_REACT_NATIVE_GUIDE.md#step-3-configure-ios) in the **Bare React Native Integration Guide** after prebuild.
|
|
78
|
+
|
|
79
|
+
<details>
|
|
80
|
+
<summary><strong>Learn more about withCopyFiles plugin</strong></summary>
|
|
81
|
+
|
|
82
|
+
The `withCopyFiles` plugin copies files from a source directory to your native project during prebuild, ensuring custom configurations are preserved.
|
|
83
|
+
|
|
84
|
+
**Directory structure example:**
|
|
85
|
+
|
|
42
86
|
```
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
87
|
+
prebuild-sync-src/
|
|
88
|
+
├── android/
|
|
89
|
+
│ └── build.gradle
|
|
90
|
+
└── ios/
|
|
91
|
+
└── YourApp/Resources/
|
|
92
|
+
├── CirclePWLocalizable.strings
|
|
93
|
+
└── CirclePWTheme.json
|
|
47
94
|
```
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
95
|
+
|
|
96
|
+
During `expo prebuild`, files from `prebuild-sync-src/android` → `android/` and `prebuild-sync-src/ios` → `ios/`.
|
|
97
|
+
|
|
98
|
+
**Options:**
|
|
99
|
+
|
|
100
|
+
| Option | Default | Description |
|
|
101
|
+
| ----------- | ------------------- | --------------------------------------------- |
|
|
102
|
+
| `sourceDir` | `prebuild-sync-src` | Root directory with android/ and ios/ folders |
|
|
103
|
+
| `overwrite` | `true` | Whether to overwrite existing files |
|
|
104
|
+
|
|
105
|
+
**Note:** This solves the problem of `expo prebuild --clean` erasing manual changes.
|
|
106
|
+
|
|
107
|
+
</details>
|
|
108
|
+
|
|
109
|
+
#### Step 4: Configure Android Repository
|
|
110
|
+
|
|
111
|
+
> [!NOTE]
|
|
112
|
+
> The SDK depends on `w3s-android-sdk` hosted on GitHub Gradle registry, which requires authentication.
|
|
113
|
+
|
|
114
|
+
**4.1** Create `.env` in project root with your GitHub credentials:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
PWSDK_MAVEN_URL=https://maven.pkg.github.com/circlefin/w3s-android-sdk
|
|
118
|
+
PWSDK_MAVEN_USERNAME=<YOUR_GITHUB_USERNAME>
|
|
119
|
+
PWSDK_MAVEN_PASSWORD=<YOUR_GITHUB_PAT>
|
|
51
120
|
```
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
121
|
+
|
|
122
|
+
Get a [Personal Access Token](https://github.com/settings/tokens) with `read:packages` permission.
|
|
123
|
+
|
|
124
|
+
**4.2** Add to `android/build.gradle` (project-level) in the `repositories` block:
|
|
125
|
+
|
|
126
|
+
```gradle
|
|
56
127
|
repositories {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
128
|
+
// Keep your other repositories here
|
|
129
|
+
// google()
|
|
130
|
+
// mavenCentral()
|
|
131
|
+
|
|
132
|
+
maven {
|
|
133
|
+
url System.getenv('PWSDK_MAVEN_URL')
|
|
134
|
+
credentials {
|
|
135
|
+
username System.getenv('PWSDK_MAVEN_USERNAME')
|
|
136
|
+
password System.getenv('PWSDK_MAVEN_PASSWORD')
|
|
137
|
+
}
|
|
138
|
+
}
|
|
69
139
|
}
|
|
70
140
|
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
141
|
+
|
|
142
|
+
#### Step 5: Create Sync Directory Structure
|
|
143
|
+
|
|
144
|
+
Create `prebuild-sync-src/` folder and copy your modified Android files:
|
|
145
|
+
|
|
146
|
+
```shell
|
|
147
|
+
mkdir -p prebuild-sync-src/android
|
|
148
|
+
cp android/build.gradle prebuild-sync-src/android/
|
|
77
149
|
```
|
|
78
|
-
### iOS
|
|
79
|
-
Add below links at tne top of `ios/Podfile`:
|
|
80
|
-
```ruby
|
|
81
|
-
source 'https://github.com/circlefin/w3s-ios-sdk.git'
|
|
82
|
-
source 'https://github.com/CocoaPods/Specs.git'
|
|
83
150
|
|
|
84
|
-
|
|
151
|
+
> [!IMPORTANT]
|
|
152
|
+
> Place all manual Android/iOS changes in `prebuild-sync-src/` to preserve them across rebuilds.
|
|
153
|
+
|
|
154
|
+
#### Step 6: Generate Native Code
|
|
155
|
+
|
|
156
|
+
```shell
|
|
157
|
+
npx expo prebuild --clean
|
|
85
158
|
```
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
159
|
+
|
|
160
|
+
This command generates native directories and applies all configurations automatically.
|
|
161
|
+
|
|
162
|
+
> [!TIP]
|
|
163
|
+
> **Verify iOS Configuration:** Check if the Circle SDK repository was added correctly:
|
|
164
|
+
>
|
|
165
|
+
> ```shell
|
|
166
|
+
> cat ios/Podfile | grep "circlefin"
|
|
167
|
+
> ```
|
|
168
|
+
>
|
|
169
|
+
> Expected output: `source 'https://github.com/circlefin/w3s-ios-sdk.git'`
|
|
170
|
+
|
|
171
|
+
#### Step 7: Install iOS Dependencies
|
|
172
|
+
|
|
173
|
+
```shell
|
|
174
|
+
cd ios && pod install && cd ..
|
|
91
175
|
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
end
|
|
102
|
-
end
|
|
176
|
+
|
|
177
|
+
#### Step 8: Build and Run
|
|
178
|
+
|
|
179
|
+
**Local development:**
|
|
180
|
+
|
|
181
|
+
For iOS:
|
|
182
|
+
|
|
183
|
+
```shell
|
|
184
|
+
npx expo run:ios
|
|
103
185
|
```
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
186
|
+
|
|
187
|
+
For Android:
|
|
188
|
+
|
|
189
|
+
```shell
|
|
190
|
+
npx expo run:android
|
|
108
191
|
```
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
192
|
+
|
|
193
|
+
**EAS Build:**
|
|
194
|
+
|
|
195
|
+
First, install EAS CLI globally (one-time setup):
|
|
196
|
+
|
|
197
|
+
```shell
|
|
198
|
+
npm install -g eas-cli
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Then build your app:
|
|
202
|
+
|
|
203
|
+
```shell
|
|
204
|
+
eas build --profile development --platform all
|
|
112
205
|
```
|
|
206
|
+
|
|
207
|
+
> [!TIP]
|
|
208
|
+
> **EAS Setup**: Add secrets `PWSDK_MAVEN_USERNAME` and `PWSDK_MAVEN_PASSWORD` to your EAS project. [Learn more](https://docs.expo.dev/build-reference/variables/)
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Additional Resources
|
|
213
|
+
|
|
214
|
+
**Circle Resources:**
|
|
215
|
+
|
|
216
|
+
- [User-Controlled Wallets Documentation](https://developers.circle.com/wallets/user-controlled) - Product overview and architecture
|
|
217
|
+
- [React Native SDK Documentation](https://developers.circle.com/wallets/user-controlled/react-native-sdk) - Complete API reference
|
|
218
|
+
- [UI Customization API](https://developers.circle.com/wallets/user-controlled/react-native-sdk-ui-customization-api) - Theming and localization options
|
|
219
|
+
- [React Native Sample App](https://github.com/circlefin/w3s-react-native-sample-app-wallets) - Working Expo sample app with integration guide
|
|
220
|
+
- [SDK v1 Migration Guide](https://github.com/circlefin/w3s-react-native-sample-app-wallets/blob/master/MIGRATION_GUIDE.md) - Complete guide for upgrading from bare React Native + SDK v1 to Expo Modules + SDK v2
|
|
221
|
+
|
|
222
|
+
**Expo Resources:**
|
|
223
|
+
|
|
224
|
+
- [Expo Development Build](https://docs.expo.dev/development/build/)
|
|
225
|
+
- [EAS Build](https://docs.expo.dev/build/introduction/)
|
package/android/build.gradle
CHANGED
|
@@ -1,139 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
apply plugin: 'com.android.library'
|
|
2
|
+
|
|
3
|
+
import groovy.json.JsonSlurper
|
|
4
|
+
|
|
5
|
+
def getPackageJsonVersion() {
|
|
6
|
+
def packageJsonFile = file("${projectDir}/../package.json")
|
|
7
|
+
def packageJson = new JsonSlurper().parseText(packageJsonFile.text)
|
|
8
|
+
return packageJson.version
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
group = 'com.circlefin.programmablewalletrnsdk'
|
|
12
|
+
version = getPackageJsonVersion()
|
|
13
|
+
|
|
14
|
+
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
15
|
+
apply from: expoModulesCorePlugin
|
|
16
|
+
applyKotlinExpoModulesCorePlugin()
|
|
17
|
+
useCoreDependencies()
|
|
18
|
+
useExpoPublishing()
|
|
19
|
+
|
|
20
|
+
// If you want to use the managed Android SDK versions from expo-modules-core, set this to true.
|
|
21
|
+
// The Android SDK versions will be bumped from time to time in SDK releases and may introduce breaking changes in your module code.
|
|
22
|
+
// Most of the time, you may like to manage the Android SDK versions yourself.
|
|
23
|
+
def useManagedAndroidSdkVersions = false
|
|
24
|
+
if (useManagedAndroidSdkVersions) {
|
|
25
|
+
useDefaultAndroidSdkVersions()
|
|
26
|
+
} else {
|
|
27
|
+
buildscript {
|
|
28
|
+
// Simple helper that allows the root project to override versions declared by this library.
|
|
29
|
+
ext.safeExtGet = { prop, fallback ->
|
|
30
|
+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
31
|
+
}
|
|
24
32
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
project.android {
|
|
34
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 34)
|
|
35
|
+
defaultConfig {
|
|
36
|
+
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
37
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 34)
|
|
38
|
+
}
|
|
30
39
|
}
|
|
31
40
|
}
|
|
32
41
|
|
|
33
|
-
def isNewArchitectureEnabled() {
|
|
34
|
-
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
apply plugin: "com.android.library"
|
|
38
|
-
apply plugin: "kotlin-android"
|
|
39
|
-
|
|
40
|
-
if (isNewArchitectureEnabled()) {
|
|
41
|
-
apply plugin: "com.facebook.react"
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
def getExtOrDefault(name) {
|
|
45
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["ProgrammablewalletRnSdk_" + name]
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
def getExtOrIntegerDefault(name) {
|
|
49
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ProgrammablewalletRnSdk_" + name]).toInteger()
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
def supportsNamespace() {
|
|
53
|
-
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
|
|
54
|
-
def major = parsed[0].toInteger()
|
|
55
|
-
def minor = parsed[1].toInteger()
|
|
56
|
-
|
|
57
|
-
// Namespace support was added in 7.3.0
|
|
58
|
-
return (major == 7 && minor >= 3) || major >= 8
|
|
59
|
-
}
|
|
60
|
-
|
|
61
42
|
android {
|
|
62
|
-
|
|
63
|
-
namespace "com.circlefin.programmablewalletrnsdk"
|
|
64
|
-
|
|
65
|
-
sourceSets {
|
|
66
|
-
main {
|
|
67
|
-
manifest.srcFile "src/main/AndroidManifestNew.xml"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
73
|
-
|
|
43
|
+
namespace "com.circlefin.programmablewalletrnsdk"
|
|
74
44
|
defaultConfig {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
78
|
-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
buildFeatures {
|
|
82
|
-
buildConfig true
|
|
45
|
+
versionCode 1
|
|
46
|
+
versionName getPackageJsonVersion()
|
|
83
47
|
}
|
|
84
|
-
|
|
85
|
-
buildTypes {
|
|
86
|
-
release {
|
|
87
|
-
minifyEnabled false
|
|
88
|
-
}
|
|
89
|
-
debug {
|
|
90
|
-
testCoverageEnabled false
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
48
|
lintOptions {
|
|
95
|
-
|
|
49
|
+
abortOnError false
|
|
96
50
|
}
|
|
97
|
-
|
|
98
|
-
compileOptions {
|
|
99
|
-
sourceCompatibility JavaVersion.VERSION_11
|
|
100
|
-
targetCompatibility JavaVersion.VERSION_11
|
|
101
|
-
}
|
|
102
|
-
sourceSets {
|
|
103
|
-
main {
|
|
104
|
-
if (isNewArchitectureEnabled()) {
|
|
105
|
-
java.srcDirs += [
|
|
106
|
-
"src/newarch",
|
|
107
|
-
// This is needed to build Kotlin project with NewArch enabled
|
|
108
|
-
"${project.buildDir}/generated/source/codegen/java"
|
|
109
|
-
]
|
|
110
|
-
} else {
|
|
111
|
-
java.srcDirs += ["src/oldarch"]
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
repositories {
|
|
117
|
-
mavenCentral()
|
|
118
|
-
google()
|
|
119
51
|
}
|
|
120
52
|
|
|
121
|
-
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
122
|
-
|
|
123
53
|
dependencies {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
//noinspection GradleDynamicVersion
|
|
127
|
-
implementation "com.facebook.react:react-native:+"
|
|
128
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
129
|
-
implementation "circle.programmablewallet:sdk:1.0.1102"
|
|
130
|
-
implementation 'com.github.bumptech.glide:glide:4.14.2'
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (isNewArchitectureEnabled()) {
|
|
134
|
-
react {
|
|
135
|
-
jsRootDir = file("../src/")
|
|
136
|
-
libraryName = "ProgrammablewalletRnSdk"
|
|
137
|
-
codegenJavaPackageName = "com.circlefin.programmablewalletrnsdk"
|
|
138
|
-
}
|
|
54
|
+
implementation("circle.programmablewallet:sdk:1.0.1102")
|
|
55
|
+
implementation("com.github.bumptech.glide:glide:4.16.0")
|
|
139
56
|
}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
Copyright
|
|
2
|
+
Copyright 2025 Circle Internet Group, Inc. All rights reserved.
|
|
3
3
|
|
|
4
|
-
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
6
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
you may not use this file except in compliance with the License.
|
|
8
|
-
You may obtain a copy of the License at
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this file except in compliance with the License.
|
|
8
|
+
You may obtain a copy of the License at
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
11
|
|
|
12
|
-
Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
See the License for the specific language governing permissions and
|
|
16
|
-
limitations under the License.
|
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
See the License for the specific language governing permissions and
|
|
16
|
+
limitations under the License.
|
|
17
17
|
-->
|
|
18
|
-
|
|
19
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
20
|
-
package="com.circlefin.programmablewalletrnsdk">
|
|
21
|
-
|
|
22
|
-
<uses-permission android:name="android.permission.REORDER_TASKS" />
|
|
18
|
+
<manifest>
|
|
23
19
|
</manifest>
|