Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ ruby ">= 2.6.10"
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '<= 1.3.4'
gem 'concurrent-ruby', '< 1.3.4'

# Ruby 3.4.0 has removed some libraries from the standard library.
gem 'bigdecimal'
gem 'logger'
gem 'benchmark'
gem 'mutex_m'
53 changes: 34 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.6)
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (6.1.7.6)
activesupport (6.1.7.10)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.2.2)
claide (1.1.0)
cocoapods (1.14.3)
cocoapods (1.15.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.14.3)
cocoapods-core (= 1.15.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
Expand All @@ -34,7 +39,7 @@ GEM
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.14.3)
cocoapods-core (1.15.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
Expand All @@ -54,45 +59,55 @@ GEM
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.2.2)
concurrent-ruby (1.3.3)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.16.3)
ffi (1.17.2)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.1)
httpclient (2.9.0)
mutex_m
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.7.1)
minitest (5.20.0)
json (2.7.6)
logger (1.7.0)
minitest (5.25.4)
molinillo (0.8.0)
mutex_m (0.3.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.2.6)
rexml (3.4.1)
ruby-macho (2.5.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.23.0)
xcodeproj (1.25.1)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.6.12)
rexml (>= 3.3.6, < 4.0)
zeitwerk (2.6.18)

PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 6.1.7.3, < 7.1.0)
cocoapods (~> 1.13)
activesupport (>= 6.1.7.5, != 7.1.0)
benchmark
bigdecimal
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
concurrent-ruby (< 1.3.4)
logger
mutex_m
xcodeproj (< 1.26.0)

RUBY VERSION
ruby 2.6.10p210
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

> Sample app for integrating Circle Programmable Wallet React Native SDK.

---

## ⚠️ SDK v1 (Legacy) Branch

**This branch (`sdk-v1`) is maintained for SDK v1 users.**

This branch contains the sample application for **SDK v1** (`@circle-fin/w3s-pw-react-native-sdk` v1.x), which uses traditional bare React Native architecture (non-Expo).

### Looking for SDK v2?

**SDK v2 (v2.0.0+) is now available on the `master` branch** with significant improvements:
- Built on Expo Modules architecture
- Simplified native code management with `expo prebuild`
- Better developer experience and maintainability
- Latest features and updates

**👉 To use SDK v2, please switch to the [`master` branch](https://github.com/circlefin/w3s-react-native-sample-app-wallets/tree/master).**

The `master` branch includes a comprehensive migration guide for upgrading from SDK v1 to v2.

---

- Bookmark
- [Requirement](#requirement)
- [Installation](#installation)
Expand Down
Binary file removed android/Screenshot_20240408_162334.png
Binary file not shown.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ def enableProguardInReleaseBuilds = true
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
* `def jscFlavor = 'io.github.react-native-community:jsc-android-intl:2026004.+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
def jscFlavor = 'io.github.react-native-community:jsc-android-intl:2026004.+'

android {
ndkVersion rootProject.ext.ndkVersion
Expand Down
Binary file removed android/app/debug.keystore
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.soloader.SoLoader
import com.facebook.react.soloader.OpenSourceMergedSoMapping

class MainApplication : Application(), ReactApplication {

Expand All @@ -50,7 +51,13 @@ class MainApplication : Application(), ReactApplication {

override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
// Updated for React Native 0.79.3 + New Architecture compatibility
// Using OpenSourceMergedSoMapping for proper single library support:
// 1. Required for New Architecture (newArchEnabled=true) in RN 0.79.3
// 2. Enables the "single library" feature introduced in RN 0.76+
// 3. Merges multiple native libraries into libreactnative.so for better performance
// 4. Fixes "libreact_featureflagsjni.so not found" errors with New Architecture
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
16 changes: 7 additions & 9 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 23
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.25"
buildToolsVersion = "35.0.0" // Upgraded: Required for AGP 8.6.0+
minSdkVersion = 24 // Upgraded: Required for JSC intl support
compileSdkVersion = 35 // Upgraded: Required for AGP 8.6.0
targetSdkVersion = 34 // Note: Consider upgrading to 35 after testing Android 14 behaviors
ndkVersion = "26.1.10909125" // Note: Can upgrade to 27.1.12297006 after testing native dependencies
kotlinVersion = "1.9.25" // Note: Consider upgrading to 2.0.21 after testing (major version change)
}
repositories {
google()
Expand All @@ -44,11 +44,9 @@ buildscript {
}
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.android.tools.build:gradle:8.6.0")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
classpath 'com.android.tools.build:gradle'
classpath 'com.android.tools.build:gradle:8.0.2'
classpath 'com.google.gms:google-services:4.4.2'
}
}
Expand Down
6 changes: 5 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
# Note: Keep false for initial upgrade to ensure compatibility with existing dependencies
# TODO: Test with newArchEnabled=true after verifying all dependencies support New Architecture
newArchEnabled=true

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
# Note: Keep false to use JSC international variant for better i18n support
# TODO: Consider hermesEnabled=true for better performance after testing (conflicts with JSC intl)
hermesEnabled=true

12 changes: 11 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@
#Tue Dec 26 21:00:39 CST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
# Note: Using Gradle 8.10.2 - minimum required by AGP 8.6.0
# Previous attempt with 8.10.1 failed CI with version check error
# AGP 8.6.0 specifically requires Gradle 8.10.2 or higher
# Using -all distribution for better IDE support and debugging
#
# Wrapper files (gradlew, gradlew.bat) intentionally kept at older version
# - New Gradle versions can run with older wrapper files (official recommendation)
# - Reduces change scope and potential compatibility issues
# - Current wrapper files are working correctly with our build setup
# To fully update wrapper files, run: ./gradlew wrapper --gradle-version 8.10.2 (twice)
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
66 changes: 66 additions & 0 deletions ios/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
//
// Copyright (c) 2025, Circle Internet Financial, LTD. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import UIKit
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

var reactNativeDelegate: ReactNativeDelegate?
var reactNativeFactory: RCTReactNativeFactory?

func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
let delegate = ReactNativeDelegate()
let factory = RCTReactNativeFactory(delegate: delegate)
delegate.dependencyProvider = RCTAppDependencyProvider()

reactNativeDelegate = delegate
reactNativeFactory = factory

window = UIWindow(frame: UIScreen.main.bounds)

factory.startReactNative(
withModuleName: "W3sSampleWallet",
in: window,
launchOptions: launchOptions
)

return true
}
}

class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
override func sourceURL(for bridge: RCTBridge) -> URL? {
self.bundleURL()
}

override func bundleURL() -> URL? {
#if DEBUG
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
}
Loading