Upgrade RN to 0.73 and deps

This commit is contained in:
minibits-cash
2024-04-09 11:48:09 +02:00
parent 12f5a21c2d
commit 571dc5d359
35 changed files with 3138 additions and 2676 deletions
+2 -1
View File
@@ -3,4 +3,5 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
gem 'cocoapods', '~> 1.12'
gem 'cocoapods', '~> 1.13'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
+1 -1
View File
@@ -6,7 +6,7 @@ import 'react-native';
import React from 'react';
import App from '../src/App';
// Note: import explicitly to use the types shiped with jest.
// Note: import explicitly to use the types shipped with jest.
import {it} from '@jest/globals';
// Note: test renderer must be required after react-native.
+10 -21
View File
@@ -1,8 +1,8 @@
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
// minibits:react-native-camera-kit
apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"
apply plugin: "org.jetbrains.kotlin.android"
// apply plugin: "kotlin-android" // minibits:react-native-camera-kit
// apply plugin: "kotlin-android-extensions"
import com.android.build.OutputFile
@@ -94,19 +94,16 @@ def reactNativeArchitectures() {
android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
namespace "com.minibits_wallet"
defaultConfig {
applicationId "com.minibits_wallet"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 33
versionName "0.1.6"
ndk {
abiFilters 'arm64-v8a', 'x86_64', 'x86', 'armeabi-v7a'
} // react-native-tor build
versionCode 34
versionName "0.1.7"
}
splits {
@@ -157,7 +154,6 @@ android {
pickFirst 'lib/x86/libcrypto.so'
pickFirst 'lib/x86_64/libcrypto.so'
pickFirst 'lib/armeabi-v7a/libcrypto.so'
pickFirst 'lib/arm64-v8a/libcrypto.so'
}
// applicationVariants are e.g. debug, release
@@ -180,16 +176,9 @@ android {
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
implementation files("../../node_modules/react-native-tor/android/libs/sifir_android.aar") // react-native-tor
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
+2 -6
View File
@@ -2,12 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
</manifest>
tools:ignore="GoogleAppIndexingWarning"/>
</manifest>
@@ -0,0 +1,22 @@
package com.minibits_wallet
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate
class MainActivity : ReactActivity() {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
override fun getMainComponentName(): String = "minibits_wallet"
/**
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
*/
override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
}
@@ -0,0 +1,45 @@
package com.minibits_wallet
import android.app.Application
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.flipper.ReactNativeFlipper
import com.facebook.soloader.SoLoader
class MainApplication : Application(), ReactApplication {
override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> {
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return PackageList(this).packages
}
override fun getJSMainModuleName(): String = "index"
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}
override val reactHost: ReactHost
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
}
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
}
}
+11 -8
View File
@@ -2,14 +2,14 @@
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 26 // react-native-tor // 23
compileSdkVersion = 33
targetSdkVersion = 33
buildToolsVersion = "34.0.0"
minSdkVersion = 23 // react-native-camera-kit
compileSdkVersion = 34
targetSdkVersion = 34
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
kotlin_version = "1.9.0" // minibits_wallet:react-native-camera-kit // 1.7.21
ndkVersion = "25.1.8937393"
kotlin_version = "1.8.0" // minibits_wallet:react-native-camera-kit
kotlinVersion = "1.8.0"
}
repositories {
@@ -18,8 +18,9 @@ buildscript {
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") // minibits_wallet:react-native-camera-kit
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
// classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") // minibits_wallet:react-native-camera-kit
}
}
// minibits_wallet:react-native-camera-kit
@@ -28,3 +29,5 @@ allprojects {
google()
}
}
apply plugin: "com.facebook.react.rootproject"
-3
View File
@@ -24,9 +24,6 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.182.0
# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
Binary file not shown.
+3 -2
View File
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
+12 -7
View File
@@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -133,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -197,6 +198,10 @@ if "$cygwin" || "$msys" ; then
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
+15 -15
View File
@@ -1,17 +1,17 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'module-resolver',
{
alias: {
'crypto': 'react-native-quick-crypto',
'stream': 'stream-browserify',
'buffer': '@craftzdog/react-native-buffer',
},
},
],
'module:react-native-dotenv',
'react-native-reanimated/plugin'
],
presets: ['module:@react-native/babel-preset'],
plugins: [
[
'module-resolver',
{
alias: {
'crypto': 'react-native-quick-crypto',
'stream': 'stream-browserify',
'buffer': '@craftzdog/react-native-buffer',
},
},
],
'module:react-native-dotenv',
'react-native-reanimated/plugin'
],
};
+1 -8
View File
@@ -28,14 +28,8 @@ end
target 'minibits_wallet' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
@@ -57,6 +51,5 @@ target 'minibits_wallet' do
config[:reactNativePath],
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
end
+9 -27
View File
@@ -188,8 +188,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "minibits_wallet" */;
buildPhases = (
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
FD10A7F022414F080027D42C /* Start Packager */,
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
@@ -391,25 +390,6 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-minibits_wallet-minibits_walletTests/Pods-minibits_wallet-minibits_walletTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
FD10A7F022414F080027D42C /* Start Packager */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Start Packager";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -451,7 +431,7 @@
"$(inherited)",
);
INFOPLIST_FILE = minibits_walletTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -475,7 +455,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = minibits_walletTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -549,7 +529,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
@@ -593,7 +573,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
@@ -610,6 +590,7 @@
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
);
SDKROOT = iphoneos;
};
@@ -620,7 +601,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
@@ -657,7 +638,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
@@ -673,6 +654,7 @@
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
);
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
+4
View File
@@ -15,6 +15,10 @@
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
return [self getBundleURL];
}
- (NSURL *)getBundleURL
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
+5 -8
View File
@@ -26,14 +26,11 @@
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string/>
+49 -49
View File
@@ -1,6 +1,6 @@
{
"name": "minibits_wallet",
"version": "0.1.6-beta.47",
"version": "0.1.7-beta",
"private": true,
"scripts": {
"android:clean": "cd android && ./gradlew clean",
@@ -15,82 +15,82 @@
"postinstall": "patch-package"
},
"dependencies": {
"@cashu/cashu-ts": "^0.9.0",
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-regular-svg-icons": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@cashu/cashu-ts": "^1.0.0-rc.2",
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-regular-svg-icons": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-native-fontawesome": "^0.3.0",
"@gocodingnow/rn-size-matters": "^0.0.2",
"@notifee/react-native": "^7.8.0",
"@react-native-clipboard/clipboard": "^1.11.2",
"@react-native-community/netinfo": "^9.4.1",
"@react-navigation/bottom-tabs": "^6.5.7",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"@react-navigation/stack": "^6.3.16",
"@sentry/react-native": "^5.6.0",
"date-fns": "^2.29.3",
"i18n-js": "^4.2.3",
"@gocodingnow/rn-size-matters": "^0.0.4",
"@notifee/react-native": "^7.8.2",
"@react-native-clipboard/clipboard": "^1.13.2",
"@react-native-community/netinfo": "^11.3.1",
"@react-navigation/bottom-tabs": "^6.5.20",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"@react-navigation/stack": "^6.3.29",
"@sentry/react-native": "^5.20.0",
"date-fns": "^3.6.0",
"i18n-js": "^4.4.3",
"js-lnurl": "^0.6.0",
"lodash.clonedeep": "^4.5.0",
"mobx": "^6.9.0",
"mobx-react-lite": "^3.4.3",
"mobx-state-tree": "^5.1.8",
"mobx": "^6.12.3",
"mobx-react-lite": "^4.0.7",
"mobx-state-tree": "^5.4.1",
"nostr-tools": "1.17.0",
"numbro": "^2.3.6",
"patch-package": "^7.0.0",
"numbro": "^2.5.0",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"react": "18.2.0",
"react-native": "0.72.2",
"react-native": "0.73.6",
"react-native-animated-pagination-dots": "^0.1.73",
"react-native-camera-kit": "^13.0.0",
"react-native-code-push": "^8.0.2",
"react-native-dotenv": "^3.4.8",
"react-native-code-push": "^8.2.1",
"react-native-dotenv": "^3.4.11",
"react-native-exit-app": "^2.0.0",
"react-native-flash-message": "^0.4.2",
"react-native-gesture-handler": "^2.9.0",
"react-native-gesture-handler": "^2.16.0",
"react-native-json-tree": "^1.3.0",
"react-native-keychain": "^8.1.2",
"react-native-logs": "^5.0.1",
"react-native-mmkv": "^2.11.0",
"react-native-keychain": "^8.2.0",
"react-native-logs": "^5.1.0",
"react-native-mmkv": "^2.12.2",
"react-native-modal": "^13.0.1",
"react-native-pager-view": "^6.2.0",
"react-native-qrcode-svg": "^6.2.0",
"react-native-quick-base64": "^2.0.7",
"react-native-pager-view": "^6.3.0",
"react-native-qrcode-svg": "^6.3.0",
"react-native-quick-base64": "^2.1.0",
"react-native-quick-crypto": "^0.6.1",
"react-native-quick-sqlite": "^8.0.2",
"react-native-reanimated": "3.3.0",
"react-native-safe-area-context": "^4.5.0",
"react-native-screens": "^3.20.0",
"react-native-svg": "^13.9.0",
"react-native-quick-sqlite": "^8.0.6",
"react-native-reanimated": "^3.8.1",
"react-native-safe-area-context": "^4.9.0",
"react-native-screens": "^3.30.1",
"react-native-svg": "^15.1.0",
"react-native-tab-view": "^3.5.2",
"react-native-tor": "^0.1.8",
"react-native-url-polyfill": "^1.3.0",
"simple-js-task-queue": "^0.1.7",
"react-native-url-polyfill": "^2.0.0",
"simple-js-task-queue": "^0.2.2",
"text-encoding-polyfill": "^0.6.7"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/eslint-config": "^0.72.2",
"@react-native/metro-config": "^0.72.9",
"@react-native/babel-preset": "0.73.21",
"@react-native/eslint-config": "0.73.2",
"@react-native/metro-config": "0.73.5",
"@react-native/typescript-config": "0.73.1",
"@tsconfig/react-native": "^3.0.0",
"@types/jest": "^29.2.1",
"@types/lodash.clonedeep": "^4.5.7",
"@types/react": "^18.0.24",
"@types/lodash.clonedeep": "^4.5.9",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.2.1",
"babel-jest": "^29.6.3",
"babel-plugin-module-resolver": "^5.0.0",
"eslint": "^8.19.0",
"eslint-plugin-unused-imports": "^2.0.0",
"jest": "^29.2.1",
"jest": "^29.6.3",
"metro-react-native-babel-preset": "0.76.7",
"prettier": "^2.4.1",
"prettier": "2.8.8",
"react-test-renderer": "18.2.0",
"typescript": "4.8.4"
"typescript": "5.0.4"
},
"engines": {
"node": ">=16"
"node": ">=18"
}
}
+130
View File
@@ -0,0 +1,130 @@
diff --git a/node_modules/@cashu/cashu-ts/src/CashuMint.ts b/node_modules/@cashu/cashu-ts/src/CashuMint.ts
index 198aa1f..e705235 100644
--- a/node_modules/@cashu/cashu-ts/src/CashuMint.ts
+++ b/node_modules/@cashu/cashu-ts/src/CashuMint.ts
@@ -17,9 +17,9 @@ import type {
PostRestorePayload,
MeltQuotePayload,
MeltQuoteResponse
-} from './model/types/index.js';
-import request from './request.js';
-import { isObj, joinUrls } from './utils.js';
+} from './model/types/index';
+import request from './request';
+import { isObj, joinUrls } from './utils';
/**
* Class represents Cashu Mint API. This class contains Lower level functions that are implemented by CashuWallet.
diff --git a/node_modules/@cashu/cashu-ts/src/CashuWallet.ts b/node_modules/@cashu/cashu-ts/src/CashuWallet.ts
index 75cb177..320a083 100644
--- a/node_modules/@cashu/cashu-ts/src/CashuWallet.ts
+++ b/node_modules/@cashu/cashu-ts/src/CashuWallet.ts
@@ -1,7 +1,7 @@
import { bytesToHex, randomBytes } from '@noble/hashes/utils';
-import { CashuMint } from './CashuMint.js';
-import * as dhke from './DHKE.js';
-import { BlindedMessage } from './model/BlindedMessage.js';
+import { CashuMint } from './CashuMint';
+import * as dhke from './DHKE';
+import { BlindedMessage } from './model/BlindedMessage';
import {
AmountPreference,
BlindedMessageData,
@@ -21,15 +21,15 @@ import {
CheckStateEnum,
Token,
TokenEntry
-} from './model/types/index.js';
+} from './model/types/index';
import {
bytesToNumber,
cleanToken,
getDecodedToken,
getDefaultAmountPreference,
splitAmount
-} from './utils.js';
-import { deriveBlindingFactor, deriveSecret, deriveSeedFromMnemonic } from './secrets.js';
+} from './utils';
+import { deriveBlindingFactor, deriveSecret, deriveSeedFromMnemonic } from './secrets';
import { validateMnemonic } from '@scure/bip39';
import { wordlist } from '@scure/bip39/wordlists/english';
import { createP2PKsecret, getSignedProofs } from '@gandlaf21/cashu-crypto/modules/client/NUT11';
diff --git a/node_modules/@cashu/cashu-ts/src/DHKE.ts b/node_modules/@cashu/cashu-ts/src/DHKE.ts
index da1dfe6..99f60a2 100644
--- a/node_modules/@cashu/cashu-ts/src/DHKE.ts
+++ b/node_modules/@cashu/cashu-ts/src/DHKE.ts
@@ -1,7 +1,7 @@
import { ProjPointType } from '@noble/curves/abstract/weierstrass';
import { secp256k1 } from '@noble/curves/secp256k1';
-import { MintKeys, Proof, SerializedBlindedSignature } from './model/types/index.js';
-import { bytesToNumber } from './utils.js';
+import { MintKeys, Proof, SerializedBlindedSignature } from './model/types/index';
+import { bytesToNumber } from './utils';
import { sha256 } from '@noble/hashes/sha256';
import { bytesToHex, hexToBytes } from '@noble/curves/abstract/utils';
import { Buffer } from 'buffer/';
diff --git a/node_modules/@cashu/cashu-ts/src/index.ts b/node_modules/@cashu/cashu-ts/src/index.ts
index f1c49f0..87476e9 100644
--- a/node_modules/@cashu/cashu-ts/src/index.ts
+++ b/node_modules/@cashu/cashu-ts/src/index.ts
@@ -1,8 +1,8 @@
-import { CashuMint } from './CashuMint.js';
-import { CashuWallet } from './CashuWallet.js';
-import { setGlobalRequestOptions } from './request.js';
-import { generateNewMnemonic, deriveSeedFromMnemonic } from './secrets.js';
-import { getEncodedToken, getDecodedToken, deriveKeysetId } from './utils.js';
+import { CashuMint } from './CashuMint';
+import { CashuWallet } from './CashuWallet';
+import { setGlobalRequestOptions } from './request';
+import { generateNewMnemonic, deriveSeedFromMnemonic } from './secrets';
+import { getEncodedToken, getDecodedToken, deriveKeysetId } from './utils';
export * from './model/types/index.js';
diff --git a/node_modules/@cashu/cashu-ts/src/model/BlindedMessage.ts b/node_modules/@cashu/cashu-ts/src/model/BlindedMessage.ts
index 9bd02f3..fe7e70b 100644
--- a/node_modules/@cashu/cashu-ts/src/model/BlindedMessage.ts
+++ b/node_modules/@cashu/cashu-ts/src/model/BlindedMessage.ts
@@ -1,4 +1,4 @@
-import { SerializedBlindedMessage } from './types/index.js';
+import { SerializedBlindedMessage } from './types/index';
import { ProjPointType } from '@noble/curves/abstract/weierstrass';
class BlindedMessage {
diff --git a/node_modules/@cashu/cashu-ts/src/model/BlindedSignature.ts b/node_modules/@cashu/cashu-ts/src/model/BlindedSignature.ts
index e998f32..16c4488 100644
--- a/node_modules/@cashu/cashu-ts/src/model/BlindedSignature.ts
+++ b/node_modules/@cashu/cashu-ts/src/model/BlindedSignature.ts
@@ -1,5 +1,5 @@
import { ProjPointType } from '@noble/curves/abstract/weierstrass';
-import { SerializedBlindedSignature } from './types/index.js';
+import { SerializedBlindedSignature } from './types/index';
class BlindedSignature {
id: string;
diff --git a/node_modules/@cashu/cashu-ts/src/model/Split.ts b/node_modules/@cashu/cashu-ts/src/model/Split.ts
index dab9010..ea21a04 100644
--- a/node_modules/@cashu/cashu-ts/src/model/Split.ts
+++ b/node_modules/@cashu/cashu-ts/src/model/Split.ts
@@ -1,5 +1,5 @@
-import { BlindedMessage } from './BlindedMessage.js';
-import { Proof } from './types/index.js';
+import { BlindedMessage } from './BlindedMessage';
+import { Proof } from './types/index';
class Split {
proofs: Array<Proof>;
diff --git a/node_modules/@cashu/cashu-ts/src/utils.ts b/node_modules/@cashu/cashu-ts/src/utils.ts
index 1729b99..5614b37 100644
--- a/node_modules/@cashu/cashu-ts/src/utils.ts
+++ b/node_modules/@cashu/cashu-ts/src/utils.ts
@@ -1,6 +1,6 @@
-import { encodeBase64ToJson, encodeJsonToBase64 } from './base64.js';
-import { AmountPreference, Keys, Proof, Token, TokenEntry, TokenV2 } from './model/types/index.js';
-import { TOKEN_PREFIX, TOKEN_VERSION } from './utils/Constants.js';
+import { encodeBase64ToJson, encodeJsonToBase64 } from './base64';
+import { AmountPreference, Keys, Proof, Token, TokenEntry, TokenV2 } from './model/types/index';
+import { TOKEN_PREFIX, TOKEN_VERSION } from './utils/Constants';
import { bytesToHex, hexToBytes } from '@noble/curves/abstract/utils';
import { sha256 } from '@noble/hashes/sha256';
+13
View File
@@ -0,0 +1,13 @@
diff --git a/node_modules/react-native-keychain/android/src/main/java/com/oblador/keychain/KeychainModuleBuilder.java b/node_modules/react-native-keychain/android/src/main/java/com/oblador/keychain/KeychainModuleBuilder.java
index b144915..278989b 100644
--- a/node_modules/react-native-keychain/android/src/main/java/com/oblador/keychain/KeychainModuleBuilder.java
+++ b/node_modules/react-native-keychain/android/src/main/java/com/oblador/keychain/KeychainModuleBuilder.java
@@ -3,7 +3,7 @@ package com.oblador.keychain;
import com.facebook.react.bridge.ReactApplicationContext;
public class KeychainModuleBuilder {
- public static final boolean DEFAULT_USE_WARM_UP = true;
+ public static final boolean DEFAULT_USE_WARM_UP = false;
private ReactApplicationContext reactContext;
private boolean useWarmUp = DEFAULT_USE_WARM_UP;
+1 -1
View File
@@ -1,6 +1,6 @@
module.exports = {
project: {
ios:{},
automaticPodsInstallation: true,
android:{}
},
assets:['./assets/fonts/'],
+1 -1
View File
@@ -14,7 +14,7 @@ export function Loading(props: ViewProps & {statusMessage?: string}) {
zIndex: 9999,
}, StyleSheet.absoluteFillObject, props.style]}>
<ActivityIndicator color="#ccc" animating size="large" />
{props.statusMessage && (<Text style={{opacity: 1}} text={props.statusMessage}/>)}
{props.statusMessage && (<Text style={[{opacity: 1}, props.textStyle]} text={props.statusMessage}/>)}
</View>
)
}
+24
View File
@@ -137,6 +137,30 @@ export const MintModel = types
self.keysets.push(keyset)
}
self.keys = keys
self.keysets = cast(self.keysets)
},
increaseProofsCounter(numberOfProofs: number) {
const currentCounter = self.currentProofsCounter
if (currentCounter) {
log.trace('[increaseProofsCounter]', 'Before update', {currentCounter})
currentCounter.counter += numberOfProofs
log.trace('[increaseProofsCounter]', 'Updated proofsCounter', {numberOfProofs, currentCounter})
} else {
// If the counter doesn't exist, create a new one
const currentKeyset = deriveKeysetId(self.keys)
const newCounter = {
keyset: currentKeyset,
counter: numberOfProofs,
}
self.proofsCounters.push(newCounter)
log.trace('[increaseProofsCounter]', 'Adding new proofsCounter', {newCounter})
}
// Make sure to cast the frozen array back to a mutable array
self.proofsCounters = cast(self.proofsCounters)
},
setInFlight(inFlightFrom: number, inFlightTo: number, inFlightTid: number) {
+10
View File
@@ -142,6 +142,16 @@ export const MintsStoreModel = types
}
return missingMints
},
currentProofsCounterValue(mintUrl: string) {
const mintInstance = self.findByUrl(mintUrl)
if (mintInstance) {
return mintInstance.currentProofsCounter?.counter || 0
}
log.warn('[currentProofsCounter]', 'Could not find mint', {mintUrl})
return 0
},
}))
export interface MintsStore extends Instance<typeof MintsStoreModel> {}
+1 -2
View File
@@ -16,9 +16,8 @@ import {
} from './Transaction'
import {Database, MintClient} from '../services'
import {log} from '../services/logService'
import { min } from 'date-fns'
import { getRootStore } from './helpers/getRootStore'
import formatDistance from 'date-fns/formatDistance'
import { formatDistance } from 'date-fns'
export const maxTransactionsInModel = 10
export const maxTransactionsByMint = 10
+1 -1
View File
@@ -94,7 +94,7 @@ export const BackupScreen: FC<SettingsStackScreenProps<'Backup'>> = observer(fun
Database.removeAllProofs()
setIsLoading(false)
setBackupResultMessage(
'Your backup of minibits tokens has been deleted. New tokens will NOT be backed up.',
'Your backup of minibits tokens has been deleted. New tokens will not be backed up.',
)
toggleBackupModal()
} catch (e: any) {
+1 -1
View File
@@ -1,4 +1,4 @@
import formatDistance from "date-fns/formatDistance"
import { formatDistance } from 'date-fns'
import { observer } from "mobx-react-lite"
import React from "react"
import { Image, ImageStyle, ScrollView, TextStyle, View, ViewStyle } from "react-native"
+1 -1
View File
@@ -1,4 +1,4 @@
import formatDistance from "date-fns/formatDistance"
import { formatDistance } from 'date-fns'
import { observer } from "mobx-react-lite"
import React from "react"
import { Image, TextStyle, View } from "react-native"
@@ -1,6 +1,6 @@
import { MINIBITS_NIP05_DOMAIN, MINIBITS_SERVER_API_HOST } from "@env"
import differenceInSeconds from "date-fns/differenceInSeconds"
import formatDistance from "date-fns/formatDistance"
import { formatDistance } from 'date-fns'
import { observer } from "mobx-react-lite"
import React from "react"
import { Image, ImageStyle, ScrollView, StyleSheet, TextStyle, View, ViewStyle } from "react-native"
+11 -11
View File
@@ -19,7 +19,7 @@ import {useHeader} from '../utils/useHeader'
import {useStores} from '../models'
import AppError from '../utils/AppError'
import {ResultModalInfo} from './Wallet/ResultModalInfo'
import { KeyChain, MinibitsClient, TorDaemon } from '../services'
import { KeyChain, MinibitsClient, } from '../services'
import { log } from '../services/logService'
import { OwnKeysScreen } from './OwnKeysScreen'
import { MINIBITS_NIP05_DOMAIN } from '@env'
@@ -75,10 +75,10 @@ export const PrivacyScreen: FC<SettingsStackScreenProps<'Privacy'>> = observer(f
return
}
const status = await TorDaemon.getStatus()
//const status = await TorDaemon.getStatus()
log.trace('torStatus', status, 'getTorStatus')
setTorStatus(status.toUpperCase())
//log.trace('torStatus', status, 'getTorStatus')
//setTorStatus(status.toUpperCase())
}
getTorStatus()
@@ -87,7 +87,7 @@ export const PrivacyScreen: FC<SettingsStackScreenProps<'Privacy'>> = observer(f
}, [])
const toggleTorDaemonSwitch = async () => {
/* const toggleTorDaemonSwitch = async () => {
try {
setIsLoading(true)
@@ -162,7 +162,7 @@ export const PrivacyScreen: FC<SettingsStackScreenProps<'Privacy'>> = observer(f
}
const toggleTorModal = () =>
setIsTorModalVisible(previousState => !previousState)
setIsTorModalVisible(previousState => !previousState) */
const toggleLoggerSwitch = async () => {
@@ -228,7 +228,7 @@ export const PrivacyScreen: FC<SettingsStackScreenProps<'Privacy'>> = observer(f
<Text preset="heading" text="Privacy" style={{color: 'white'}} />
</View>
<View style={$contentContainer}>
<Card
{/*<Card
style={[$card, {marginTop: spacing.medium}]}
ContentComponent={
<>
@@ -299,14 +299,14 @@ export const PrivacyScreen: FC<SettingsStackScreenProps<'Privacy'>> = observer(f
)}
</>
}
/>
/>*/}
<Card
style={[$card, {marginTop: spacing.medium}]}
ContentComponent={
<>
<ListItem
text="Use own Nostr profile"
subText={walletProfileStore.isOwnProfile ? walletProfileStore.nip05 : "Import your own Nostr address and keys. Your wallet will stop communicating with minibits.cash Nostr and LNURL address servers, disabling Lightning address features for receiving zaps and payments. Only for hardcore ecash-ers!"}
subText={walletProfileStore.isOwnProfile ? walletProfileStore.nip05 : "Import your own NOSTR address and keys. Your wallet stops communicate with minibits.cash Nostr and Lnurl address servers. However this will disable Lightning address features to receive zaps and payments. Only for hard core ecash-ers!"}
leftIcon={'faShareNodes'}
leftIconColor={
walletProfileStore.isOwnProfile
@@ -367,7 +367,7 @@ export const PrivacyScreen: FC<SettingsStackScreenProps<'Privacy'>> = observer(f
/>
{isLoading && <Loading />}
</View>
<BottomModal
{/*<BottomModal
isVisible={isTorModalVisible ? true : false}
ContentComponent={
<ResultModalInfo
@@ -385,7 +385,7 @@ export const PrivacyScreen: FC<SettingsStackScreenProps<'Privacy'>> = observer(f
}
onBackButtonPress={toggleTorModal}
onBackdropPress={toggleTorModal}
/>
/>*/}
{error && <ErrorModal error={error} />}
{info && <InfoModal message={info} />}
</Screen>
@@ -1,4 +1,4 @@
import formatDistance from "date-fns/formatDistance"
import { formatDistance } from 'date-fns'
import { observer } from "mobx-react-lite"
import React from "react"
import { ScrollView, TextStyle, View, ViewStyle } from "react-native"
+1 -1
View File
@@ -109,7 +109,7 @@ export const WalletScreen: FC<WalletScreenProps> = observer(
setUpdateDescription(update.description)
setUpdateSize(`${round(update.packageSize * 0.000001, 2)}MB`)
setIsUpdateAvailable(true)
toggleUpdateModal()
// toggleUpdateModal()
log.info('OTA Update available', update, 'checkForUpdate')
}
} catch (e: any) {
+1 -1
View File
@@ -241,7 +241,7 @@ export const WelcomeScreen: FC<AppStackScreenProps<'Welcome'>> =
</View>
</View>
{error && <ErrorModal error={error} />}
{isLoading && <Loading statusMessage={'Creating wallet seed, this takes a while...'} style={{backgroundColor: headerBg, opacity: 1}}/>}
{isLoading && <Loading statusMessage={'Creating wallet seed, this takes a while...'} style={{backgroundColor: headerBg, opacity: 1}} textStyle={{color: 'white'}}/>}
</Screen>
)
}
+3 -3
View File
@@ -1,8 +1,8 @@
import Tor, { RequestMethod, TorType } from 'react-native-tor'
// import Tor, { RequestMethod, TorType } from 'react-native-tor'
import AppError, { Err } from '../utils/AppError';
import { log } from './logService';
let _tor: TorType
/* let _tor: TorType
let _globalRequestOptions: Partial<RequestOptions> = {};
const getInstance = function () {
@@ -126,4 +126,4 @@ export const TorDaemon = {
getInstance,
torRequest,
setGlobalRequestOptions,
}
} */
+7 -7
View File
@@ -1,10 +1,10 @@
{
"extends": "@tsconfig/react-native/tsconfig.json",
"compilerOptions": {
"jsx": "react",
"typeRoots": ["./src/utils/envtypes"],
"paths": {
"nostr-tools/*": ["./node_modules/nostr-tools/lib/types/*"]
"extends": "@react-native/typescript-config/tsconfig.json",
"compilerOptions": {
"jsx": "react",
"typeRoots": ["./src/utils/envtypes"],
"paths": {
"nostr-tools/*": ["./node_modules/nostr-tools/lib/types/*"]
}
}
}
}
+2739 -2488
View File
File diff suppressed because it is too large Load Diff