diff --git a/android/.settings/org.eclipse.buildship.core.prefs b/android/.settings/org.eclipse.buildship.core.prefs index c2c600fae..11a41a9d6 100644 --- a/android/.settings/org.eclipse.buildship.core.prefs +++ b/android/.settings/org.eclipse.buildship.core.prefs @@ -1,11 +1,11 @@ -arguments=--init-script /var/folders/_m/gmgx0cmn6rzb80znp6s3hl800000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/_m/gmgx0cmn6rzb80znp6s3hl800000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle +arguments=--init-script /var/folders/tm/qsvqk80d0t30zlr71v0yf1m00000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/tm/qsvqk80d0t30zlr71v0yf1m00000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle auto.sync=false build.scans.enabled=false connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) connection.project.dir= eclipse.preferences.version=1 gradle.user.home= -java.home=/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home +java.home=/Users/peronif5/Library/Java/JavaVirtualMachines/openjdk-21.0.2/Contents/Home jvm.arguments= offline.mode=false override.workspace.settings=true diff --git a/android/app/.settings/org.eclipse.jdt.core.prefs b/android/app/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..626e0e1d5 --- /dev/null +++ b/android/app/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.source=17 diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index eb98c01af..62d7d130c 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -6,4 +6,4 @@ android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning"/> - + \ No newline at end of file diff --git a/android/app/src/main/assets/fonts/Figtree-Italic-VariableFont_wght.ttf b/android/app/src/main/assets/fonts/Figtree-Italic-VariableFont_wght.ttf new file mode 100644 index 000000000..fd997441d Binary files /dev/null and b/android/app/src/main/assets/fonts/Figtree-Italic-VariableFont_wght.ttf differ diff --git a/android/app/src/main/assets/fonts/Figtree-VariableFont_wght.ttf b/android/app/src/main/assets/fonts/Figtree-VariableFont_wght.ttf new file mode 100644 index 000000000..06f9fe572 Binary files /dev/null and b/android/app/src/main/assets/fonts/Figtree-VariableFont_wght.ttf differ diff --git a/android/link-assets-manifest.json b/android/link-assets-manifest.json new file mode 100644 index 000000000..d1e688d7f --- /dev/null +++ b/android/link-assets-manifest.json @@ -0,0 +1,13 @@ +{ + "migIndex": 1, + "data": [ + { + "path": "src/assets/fonts/Figtree-Italic-VariableFont_wght.ttf", + "sha1": "8e76cbc3e74d415e8790eb62dfa1705539609dcb" + }, + { + "path": "src/assets/fonts/Figtree-VariableFont_wght.ttf", + "sha1": "118c5e4678ec5f5f7222fb968cd88a5a92e7629d" + } + ] +} diff --git a/babel.config.js b/babel.config.js index 0c546e12c..8029e1c0f 100644 --- a/babel.config.js +++ b/babel.config.js @@ -20,12 +20,14 @@ const baseConfig = { '@helium/crypto': './node_modules/@helium/crypto-react-native', '@assets': './src/assets', '@components': './src/components', - '@constants': './src/constants', '@hooks': './src/hooks', - '@theme': './src/theme', '@utils': './src/utils', - '@storage': './src/storage', + '@config': './src/config', '@types': './src/types', + '@features': './src/features', + '@services': './src/app/services', + '@store': './src/store', + '@app': './src/app', }, extensions: ['.ios.js', '.android.js', '.js', '.ts', '.tsx', '.json'], root: ['./src'], diff --git a/index.js b/index.js index d36d631a1..0807a1438 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,4 @@ import './shim' -import { ThemeProvider } from '@shopify/restyle' import React from 'react' import { ErrorBoundary } from 'react-error-boundary' import { AppRegistry } from 'react-native' @@ -9,15 +8,14 @@ import 'react-native-url-polyfill/auto' import { Provider as ReduxProvider } from 'react-redux' import { PersistGate } from 'redux-persist/integration/react' import { name as appName } from './app.json' -import App from './src/App' +import App from './src/app/App' import { GlobalError } from './src/components/GlobalError' -import AccountStorageProvider from './src/storage/AccountStorageProvider' -import AppStorageProvider from './src/storage/AppStorageProvider' -import LanguageProvider from './src/storage/LanguageProvider' -import NotificationStorageProvider from './src/storage/NotificationStorageProvider' +import AccountStorageProvider from './src/config/storage/AccountStorageProvider' +import AppStorageProvider from './src/config/storage/AppStorageProvider' +import LanguageProvider from './src/config/storage/LanguageProvider' +import NotificationStorageProvider from './src/config/storage/NotificationStorageProvider' import { persistor } from './src/store/persistence' import store from './src/store/store' -import { darkThemeColors, theme } from './src/theme/theme' import './src/utils/i18n' // eslint-disable-next-line no-undef @@ -35,33 +33,26 @@ function fallbackRender(props) { const render = () => { return ( - { + await persistor.purge() }} > - { - await persistor.purge() - }} - > - - - - - - - - - - - - - - - + + + + + + + + + + + + + + ) } diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock index 454a44902..aab86a0a8 100644 --- a/ios/Gemfile.lock +++ b/ios/Gemfile.lock @@ -5,25 +5,25 @@ GEM base64 nkf rexml - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.912.0) - aws-sdk-core (3.191.6) + aws-partitions (1.986.0) + aws-sdk-core (3.209.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.8) + aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.78.0) - aws-sdk-core (~> 3, >= 3.191.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.146.1) - aws-sdk-core (~> 3, >= 3.191.0) + aws-sdk-kms (1.94.0) + aws-sdk-core (~> 3, >= 3.207.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.167.0) + aws-sdk-core (~> 3, >= 3.207.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.8) - aws-sigv4 (1.8.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.10.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) base64 (0.2.0) @@ -38,8 +38,8 @@ GEM domain_name (0.6.20240107) dotenv (2.8.1) emoji_regex (3.2.3) - excon (0.110.0) - faraday (1.10.3) + excon (0.112.0) + faraday (1.10.4) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -60,15 +60,15 @@ GEM faraday-httpclient (1.0.1) faraday-multipart (1.0.4) multipart-post (~> 2) - faraday-net_http (1.0.1) + faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) faraday-retry (1.0.3) - faraday_middleware (1.2.0) + faraday_middleware (1.2.1) faraday (~> 1.0) fastimage (2.3.1) - fastlane (2.220.0) + fastlane (2.224.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -126,7 +126,7 @@ GEM google-apis-core (>= 0.11.0, < 2.a) google-apis-storage_v1 (0.31.0) google-apis-core (>= 0.11.0, < 2.a) - google-cloud-core (1.7.0) + google-cloud-core (1.7.1) google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) google-cloud-env (1.6.0) @@ -147,31 +147,31 @@ GEM os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) highline (2.0.3) - http-cookie (1.0.5) + http-cookie (1.0.7) domain_name (~> 0.5) httpclient (2.8.3) jmespath (1.6.2) json (2.7.2) - jwt (2.8.1) + jwt (2.9.3) base64 - mini_magick (4.12.0) + mini_magick (4.13.2) mini_mime (1.1.5) multi_json (1.15.0) - multipart-post (2.4.0) + multipart-post (2.4.1) nanaimo (0.3.0) naturally (2.2.1) nkf (0.2.0) - optparse (0.4.0) + optparse (0.5.0) os (1.1.4) plist (3.7.1) - public_suffix (5.0.5) + public_suffix (6.0.1) rake (13.2.1) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.2.6) + rexml (3.3.8) rouge (2.0.7) ruby2_keywords (0.0.5) rubyzip (2.3.2) @@ -193,15 +193,15 @@ GEM tty-spinner (0.9.3) tty-cursor (~> 0.7) uber (0.1.0) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) word_wrap (1.0.0) - xcodeproj (1.24.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) + rexml (>= 3.3.6, < 4.0) xcpretty (0.3.0) rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) @@ -215,4 +215,4 @@ DEPENDENCIES fastlane BUNDLED WITH - 2.5.4 + 2.5.18 diff --git a/ios/HeliumWallet.xcodeproj/project.pbxproj b/ios/HeliumWallet.xcodeproj/project.pbxproj index 451d12700..1ca57faaf 100644 --- a/ios/HeliumWallet.xcodeproj/project.pbxproj +++ b/ios/HeliumWallet.xcodeproj/project.pbxproj @@ -8,18 +8,14 @@ /* Begin PBXBuildFile section */ 00E356F31AD99517003FC87E /* HeliumWalletTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HeliumWalletTests.m */; }; + 117516811AB44418A8ACF34F /* Figtree-VariableFont_wght.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C11FA61F64A54BB9B8AFA5F6 /* Figtree-VariableFont_wght.ttf */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.mm */; }; 1A7DAB918483F1C2761BA7A4 /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296757835722BB74360F9FEF /* ExpoModulesProvider.swift */; }; 31B6D29CFC726A9C37946D71 /* libPods-HeliumWallet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B83B6ABAD63F1D810AF84CE5 /* libPods-HeliumWallet.a */; }; 45330C4A223536223298B2A3 /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 645194928E31AE79BE70ED88 /* ExpoModulesProvider.swift */; }; - 50D1D6AC2763AAA2009D52C0 /* DMSans-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 50D1D6A62763AAA2009D52C0 /* DMSans-Bold.ttf */; }; - 50D1D6AD2763AAA2009D52C0 /* DMSans-BoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 50D1D6A72763AAA2009D52C0 /* DMSans-BoldItalic.ttf */; }; - 50D1D6AE2763AAA2009D52C0 /* DMSans-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 50D1D6A82763AAA2009D52C0 /* DMSans-Medium.ttf */; }; - 50D1D6AF2763AAA2009D52C0 /* DMSans-MediumItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 50D1D6A92763AAA2009D52C0 /* DMSans-MediumItalic.ttf */; }; - 50D1D6B02763AAA2009D52C0 /* DMSans-Italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 50D1D6AA2763AAA2009D52C0 /* DMSans-Italic.ttf */; }; - 50D1D6B12763AAA2009D52C0 /* DMSans-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 50D1D6AB2763AAA2009D52C0 /* DMSans-Regular.ttf */; }; + 7AA19242A2DE47E8AFC56882 /* Figtree-Italic-VariableFont_wght.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3440BC62530D461681D28DD7 /* Figtree-Italic-VariableFont_wght.ttf */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 9609D00027F4DE8D00CE3F93 /* RCTDateModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9609CFFF27F4DE8D00CE3F93 /* RCTDateModule.mm */; }; 962862712BDCCAF70073839C /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; @@ -57,6 +53,10 @@ 9DE3051C28510B8E00E46F9B /* HeliumWalletWidgetBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DE3051B28510B8E00E46F9B /* HeliumWalletWidgetBundle.swift */; }; 9DE3051E28510E3900E46F9B /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DE3051D28510E3900E46F9B /* Utils.swift */; }; 9DE305212851187D00E46F9B /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9DE305232851187D00E46F9B /* Localizable.strings */; }; + 9DEC730B2CAB265100DA649B /* Mapbox in Frameworks */ = {isa = PBXBuildFile; productRef = 5A94DB7A8D2811C850C94941 /* Mapbox */; }; + 9DEC730C2CAB265100DA649B /* Mapbox in Frameworks */ = {isa = PBXBuildFile; productRef = CE0525B8C0183FCA3071F4F6 /* Mapbox */; }; + 9DEC730D2CAB265100DA649B /* Mapbox in Frameworks */ = {isa = PBXBuildFile; productRef = 6B1147D96DED6C57572658F4 /* Mapbox */; }; + 9DEC730E2CAB265100DA649B /* Mapbox in Frameworks */ = {isa = PBXBuildFile; productRef = 899688236472B5978CFDB459 /* Mapbox */; }; 9DF6297C28D159FD002601C9 /* HeliumTickerAccessoryCornerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF6297B28D159FD002601C9 /* HeliumTickerAccessoryCornerView.swift */; }; 9DF6297E28D1782D002601C9 /* HeliumTickerAccessoryRectangularView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF6297D28D1782D002601C9 /* HeliumTickerAccessoryRectangularView.swift */; }; 9DF6298128D1787A002601C9 /* HeliumTickerAccessoryInlineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF6298028D1787A002601C9 /* HeliumTickerAccessoryInlineView.swift */; }; @@ -128,17 +128,12 @@ 1EFDB5FA77191A99A2371AFB /* Pods-HeliumWallet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeliumWallet.debug.xcconfig"; path = "Target Support Files/Pods-HeliumWallet/Pods-HeliumWallet.debug.xcconfig"; sourceTree = ""; }; 1F0BFD5C668192F29DFDE754 /* Pods-OneSignalNotificationServiceExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OneSignalNotificationServiceExtension.release.xcconfig"; path = "Target Support Files/Pods-OneSignalNotificationServiceExtension/Pods-OneSignalNotificationServiceExtension.release.xcconfig"; sourceTree = ""; }; 296757835722BB74360F9FEF /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-HeliumWallet-HeliumWalletTests/ExpoModulesProvider.swift"; sourceTree = ""; }; + 3440BC62530D461681D28DD7 /* Figtree-Italic-VariableFont_wght.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Figtree-Italic-VariableFont_wght.ttf"; path = "../src/assets/fonts/Figtree-Italic-VariableFont_wght.ttf"; sourceTree = ""; }; 3B30E772B033A435C849D9CD /* Pods-HeliumWalletWidgetExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeliumWalletWidgetExtension.release.xcconfig"; path = "Target Support Files/Pods-HeliumWalletWidgetExtension/Pods-HeliumWalletWidgetExtension.release.xcconfig"; sourceTree = ""; }; 48E9A2B05D9F581F3DF9C71D /* libPods-HeliumWallet-HeliumWalletTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HeliumWallet-HeliumWalletTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 4C49B6B232EE708CBD605BA8 /* Pods-HeliumWallet-HeliumWalletTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeliumWallet-HeliumWalletTests.debug.xcconfig"; path = "Target Support Files/Pods-HeliumWallet-HeliumWalletTests/Pods-HeliumWallet-HeliumWalletTests.debug.xcconfig"; sourceTree = ""; }; 508E6F6B26FA22F400774B67 /* HeliumWallet-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "HeliumWallet-Bridging-Header.h"; sourceTree = ""; }; 50D1D6A42763AA88009D52C0 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = fonts; path = ../src/assets/fonts; sourceTree = ""; }; - 50D1D6A62763AAA2009D52C0 /* DMSans-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "DMSans-Bold.ttf"; path = "../src/assets/fonts/DMSans-Bold.ttf"; sourceTree = ""; }; - 50D1D6A72763AAA2009D52C0 /* DMSans-BoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "DMSans-BoldItalic.ttf"; path = "../src/assets/fonts/DMSans-BoldItalic.ttf"; sourceTree = ""; }; - 50D1D6A82763AAA2009D52C0 /* DMSans-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "DMSans-Medium.ttf"; path = "../src/assets/fonts/DMSans-Medium.ttf"; sourceTree = ""; }; - 50D1D6A92763AAA2009D52C0 /* DMSans-MediumItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "DMSans-MediumItalic.ttf"; path = "../src/assets/fonts/DMSans-MediumItalic.ttf"; sourceTree = ""; }; - 50D1D6AA2763AAA2009D52C0 /* DMSans-Italic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "DMSans-Italic.ttf"; path = "../src/assets/fonts/DMSans-Italic.ttf"; sourceTree = ""; }; - 50D1D6AB2763AAA2009D52C0 /* DMSans-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "DMSans-Regular.ttf"; path = "../src/assets/fonts/DMSans-Regular.ttf"; sourceTree = ""; }; 57910DBDCCCCDF8BFA3C6D9E /* Pods-OneSignalNotificationServiceExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OneSignalNotificationServiceExtension.debug.xcconfig"; path = "Target Support Files/Pods-OneSignalNotificationServiceExtension/Pods-OneSignalNotificationServiceExtension.debug.xcconfig"; sourceTree = ""; }; 596BDD75E9EC4091C6156C0E /* libPods-HeliumWalletWidgetExtension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HeliumWalletWidgetExtension.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 645194928E31AE79BE70ED88 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-HeliumWallet/ExpoModulesProvider.swift"; sourceTree = ""; }; @@ -150,7 +145,7 @@ 96E4147227BEE4C300CE6EC1 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = ""; }; 96E4147427BEE4C300CE6EC1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 96E4147C27BEE61400CE6EC1 /* OneSignalNotificationServiceExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = OneSignalNotificationServiceExtension.entitlements; sourceTree = ""; }; - 99ED3018E9DBF6106B1DE1A7 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = HeliumWallet/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 99ED3018E9DBF6106B1DE1A7 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = HeliumWallet/PrivacyInfo.xcprivacy; sourceTree = ""; }; 9D05C88428527DF0008198FC /* HeliumWalletWidgetProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeliumWalletWidgetProvider.swift; sourceTree = ""; }; 9D05C88628527E1E008198FC /* HeliumWalletWidgetSmallView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeliumWalletWidgetSmallView.swift; sourceTree = ""; }; 9D05C88828527E40008198FC /* HeliumWalletWidgetMediumView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeliumWalletWidgetMediumView.swift; sourceTree = ""; }; @@ -187,6 +182,7 @@ 9DF6298028D1787A002601C9 /* HeliumTickerAccessoryInlineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeliumTickerAccessoryInlineView.swift; sourceTree = ""; }; A887C33D5275223BA0B76656 /* Pods-HeliumWalletWidgetExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeliumWalletWidgetExtension.debug.xcconfig"; path = "Target Support Files/Pods-HeliumWalletWidgetExtension/Pods-HeliumWalletWidgetExtension.debug.xcconfig"; sourceTree = ""; }; B83B6ABAD63F1D810AF84CE5 /* libPods-HeliumWallet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HeliumWallet.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + C11FA61F64A54BB9B8AFA5F6 /* Figtree-VariableFont_wght.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Figtree-VariableFont_wght.ttf"; path = "../src/assets/fonts/Figtree-VariableFont_wght.ttf"; sourceTree = ""; }; DABD45A4821A707AEDF47E54 /* Pods-HeliumWallet-HeliumWalletTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeliumWallet-HeliumWalletTests.release.xcconfig"; path = "Target Support Files/Pods-HeliumWallet-HeliumWalletTests/Pods-HeliumWallet-HeliumWalletTests.release.xcconfig"; sourceTree = ""; }; EA3C262A651DB9218F30F0E1 /* Pods-HeliumWallet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeliumWallet.release.xcconfig"; path = "Target Support Files/Pods-HeliumWallet/Pods-HeliumWallet.release.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; @@ -198,6 +194,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 9DEC730E2CAB265100DA649B /* Mapbox in Frameworks */, 962862742BDCCAF70073839C /* BuildFile in Frameworks */, B3469F859005A4F164D08293 /* libPods-HeliumWallet-HeliumWalletTests.a in Frameworks */, ); @@ -207,6 +204,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 9DEC730B2CAB265100DA649B /* Mapbox in Frameworks */, 962862712BDCCAF70073839C /* BuildFile in Frameworks */, 31B6D29CFC726A9C37946D71 /* libPods-HeliumWallet.a in Frameworks */, ); @@ -216,6 +214,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 9DEC730C2CAB265100DA649B /* Mapbox in Frameworks */, 962862722BDCCAF70073839C /* BuildFile in Frameworks */, C4EB4BD0A9AAABC0002181CC /* libPods-OneSignalNotificationServiceExtension.a in Frameworks */, ); @@ -225,6 +224,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 9DEC730D2CAB265100DA649B /* Mapbox in Frameworks */, 962862732BDCCAF70073839C /* BuildFile in Frameworks */, 9D7DB3B02850EC14004D9409 /* SwiftUI.framework in Frameworks */, 9D7DB3AF2850EC14004D9409 /* WidgetKit.framework in Frameworks */, @@ -281,6 +281,15 @@ name = ExpoModulesProviders; sourceTree = ""; }; + 1DE256FAD99A492B952D4632 /* Resources */ = { + isa = PBXGroup; + children = ( + 3440BC62530D461681D28DD7 /* Figtree-Italic-VariableFont_wght.ttf */, + C11FA61F64A54BB9B8AFA5F6 /* Figtree-VariableFont_wght.ttf */, + ); + name = Resources; + sourceTree = ""; + }; 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { isa = PBXGroup; children = ( @@ -313,12 +322,6 @@ 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( - 50D1D6A62763AAA2009D52C0 /* DMSans-Bold.ttf */, - 50D1D6A72763AAA2009D52C0 /* DMSans-BoldItalic.ttf */, - 50D1D6AA2763AAA2009D52C0 /* DMSans-Italic.ttf */, - 50D1D6A82763AAA2009D52C0 /* DMSans-Medium.ttf */, - 50D1D6A92763AAA2009D52C0 /* DMSans-MediumItalic.ttf */, - 50D1D6AB2763AAA2009D52C0 /* DMSans-Regular.ttf */, 50D1D6A42763AA88009D52C0 /* fonts */, 13B07FAE1A68108700A75B9A /* HeliumWallet */, 832341AE1AAA6A7D00B99B32 /* Libraries */, @@ -329,6 +332,7 @@ 2D16E6871FA4F8E400B85C8A /* Frameworks */, E233CBF5F47BEE60B243DCF8 /* Pods */, 1DC951AB9D06BB3015E8CAE6 /* ExpoModulesProviders */, + 1DE256FAD99A492B952D4632 /* Resources */, ); indentWidth = 2; sourceTree = ""; @@ -627,15 +631,11 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 50D1D6AC2763AAA2009D52C0 /* DMSans-Bold.ttf in Resources */, - 50D1D6AD2763AAA2009D52C0 /* DMSans-BoldItalic.ttf in Resources */, - 50D1D6AE2763AAA2009D52C0 /* DMSans-Medium.ttf in Resources */, - 50D1D6AF2763AAA2009D52C0 /* DMSans-MediumItalic.ttf in Resources */, - 50D1D6B02763AAA2009D52C0 /* DMSans-Italic.ttf in Resources */, - 50D1D6B12763AAA2009D52C0 /* DMSans-Regular.ttf in Resources */, 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, AB02F1297F7F91A0FD2532BD /* PrivacyInfo.xcprivacy in Resources */, + 7AA19242A2DE47E8AFC56882 /* Figtree-Italic-VariableFont_wght.ttf in Resources */, + 117516811AB44418A8ACF34F /* Figtree-VariableFont_wght.ttf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1079,7 +1079,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.10.0; + MARKETING_VERSION = 3.0.0; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "$(inherited)", @@ -1117,7 +1117,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.10.0; + MARKETING_VERSION = 3.0.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1303,7 +1303,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.10.0; + MARKETING_VERSION = 3.0.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; @@ -1348,7 +1348,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.10.0; + MARKETING_VERSION = 3.0.0; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; PRODUCT_BUNDLE_IDENTIFIER = com.helium.wallet.app.OneSignalNotificationServiceExtension; @@ -1396,7 +1396,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.10.0; + MARKETING_VERSION = 3.0.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; @@ -1445,7 +1445,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.10.0; + MARKETING_VERSION = 3.0.0; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; PRODUCT_BUNDLE_IDENTIFIER = com.helium.wallet.app.HeliumWalletWidget; diff --git a/ios/HeliumWallet.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/HeliumWallet.xcworkspace/xcshareddata/swiftpm/Package.resolved index 8c8230ba7..7ebcc34da 100644 --- a/ios/HeliumWallet.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ios/HeliumWallet.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,4 @@ { - "originHash" : "e70d3525c8e2819a8b34f22909815dab5c700c25a06c32388f3930f7b3627768", "pins" : [ { "identity" : "maplibre-gl-native-distribution", @@ -9,7 +8,25 @@ "revision" : "ffda61e298c1490d4860d5184e80d618aaadc089", "version" : "5.13.0" } + }, + { + "identity" : "swiftui-charts", + "kind" : "remoteSourceControl", + "location" : "https://github.com/spacenation/swiftui-charts", + "state" : { + "revision" : "b044e7eb04d0026490eecb115f4fc07197dad942", + "version" : "1.1.0" + } + }, + { + "identity" : "swiftui-shapes", + "kind" : "remoteSourceControl", + "location" : "https://github.com/spacenation/swiftui-shapes.git", + "state" : { + "revision" : "c58b15c37eae9bd20525c6daa93a06a689ca75cb", + "version" : "1.1.0" + } } ], - "version" : 3 + "version" : 2 } diff --git a/ios/HeliumWallet/Info.plist b/ios/HeliumWallet/Info.plist index 70ace53b9..99d6bd42d 100644 --- a/ios/HeliumWallet/Info.plist +++ b/ios/HeliumWallet/Info.plist @@ -44,12 +44,11 @@ LSRequiresIPhoneOS NSAppTransportSecurity - - + NSAllowsArbitraryLoads NSAllowsLocalNetworking - + NSExceptionDomains ec2-35-82-2-45.us-west-2.compute.amazonaws.com @@ -79,12 +78,8 @@ UIAppFonts - DMSans-Bold.ttf - DMSans-BoldItalic.ttf - DMSans-Italic.ttf - DMSans-Medium.ttf - DMSans-MediumItalic.ttf - DMSans-Regular.ttf + Figtree-Italic-VariableFont_wght.ttf + Figtree-VariableFont_wght.ttf UIBackgroundModes diff --git a/ios/Podfile b/ios/Podfile index 0d64adb7d..6349f49dd 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -56,8 +56,11 @@ target 'HeliumWallet' do permissions_path = '../node_modules/react-native-permissions/ios' setup_permissions(['BluetoothPeripheral']) + $RNMapboxMapsImpl = 'mapbox' + $RNMapboxMapsVersion = '= 11.4.0' + post_install do |installer| - $RNMBGL.post_install(installer) + $RNMapboxMaps.post_install(installer) # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 react_native_post_install( diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 3a1791f8c..4a38b3db0 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -22,6 +22,8 @@ PODS: - EXImageLoader (4.7.0): - ExpoModulesCore - React-Core + - EXLocation (17.0.1): + - ExpoModulesCore - Expo (51.0.24): - ExpoModulesCore - ExpoAsset (10.0.10): @@ -118,13 +120,13 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - maplibre-react-native (9.1.0): - - maplibre-react-native/DynamicLibrary (= 9.1.0) - - React - - React-Core - - maplibre-react-native/DynamicLibrary (9.1.0): - - React - - React-Core + - MapboxCommon (24.4.0) + - MapboxCoreMaps (11.4.0): + - MapboxCommon (~> 24.4) + - MapboxMaps (11.4.0): + - MapboxCommon (= 24.4.0) + - MapboxCoreMaps (= 11.4.0) + - Turf (= 2.8.0) - MultiplatformBleAdapter (0.1.9) - OneSignalXCFramework (5.2.2): - OneSignalXCFramework/OneSignalComplete (= 5.2.2) @@ -1109,6 +1111,8 @@ PODS: - Charts (= 4.1.0) - React - SwiftyJSON (= 5.0) + - react-native-compass-heading (1.5.0): + - React-Core - react-native-config (1.4.6): - react-native-config/App (= 1.4.6) - react-native-config/App (1.4.6): @@ -1421,6 +1425,27 @@ PODS: - React-Core - RNCClipboard (1.5.1): - React-Core + - RNCMaskedView (0.3.2): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly (= 2024.01.01.00) + - RCTRequired + - RCTTypeSafety + - React-Codegen + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-NativeModulesApple + - React-RCTFabric + - React-rendererdebug + - React-utils + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - Yoga - RNDeviceInfo (8.7.1): - React-Core - RNGestureHandler (2.18.1): @@ -1448,6 +1473,17 @@ PODS: - React - RNLocalize (2.2.3): - React-Core + - rnmapbox-maps (10.1.31): + - MapboxMaps (= 11.4.0) + - React + - React-Core + - rnmapbox-maps/DynamicLibrary (= 10.1.31) + - Turf + - rnmapbox-maps/DynamicLibrary (10.1.31): + - MapboxMaps (= 11.4.0) + - React + - React-Core + - Turf - RNOS (1.2.6): - React - RNPermissions (3.9.2): @@ -1509,6 +1545,13 @@ PODS: - TcpSockets (3.3.2): - React - Toast (4.0.0) + - Turf (2.8.0) + - VisionCamera (4.5.3): + - VisionCamera/Core (= 4.5.3) + - VisionCamera/React (= 4.5.3) + - VisionCamera/Core (4.5.3) + - VisionCamera/React (4.5.3): + - React-Core - Yoga (0.0.0) - ZXingObjC/Core (3.6.9) - ZXingObjC/OneD (3.6.9): @@ -1524,6 +1567,7 @@ DEPENDENCIES: - EXBarCodeScanner (from `../node_modules/expo-barcode-scanner/ios`) - EXConstants (from `../node_modules/expo-constants/ios`) - EXImageLoader (from `../node_modules/expo-image-loader/ios`) + - EXLocation (from `../node_modules/expo-location/ios`) - Expo (from `../node_modules/expo`) - ExpoAsset (from `../node_modules/expo-asset/ios`) - ExpoCamera (from `../node_modules/expo-camera/ios`) @@ -1542,7 +1586,6 @@ DEPENDENCIES: - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - lottie-ios (from `../node_modules/lottie-ios`) - lottie-react-native (from `../node_modules/lottie-react-native`) - - "maplibre-react-native (from `../node_modules/@maplibre/maplibre-react-native`)" - OneSignalXCFramework (< 6.0, >= 5.0) - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) - RCT-Folly/Fabric (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) @@ -1573,6 +1616,7 @@ DEPENDENCIES: - react-native-ble-plx (from `../node_modules/react-native-ble-plx`) - "react-native-blur (from `../node_modules/@react-native-community/blur`)" - react-native-charts-wrapper (from `../node_modules/react-native-charts-wrapper`) + - react-native-compass-heading (from `../node_modules/react-native-compass-heading`) - react-native-config (from `../node_modules/react-native-config`) - react-native-config/Extension (from `../node_modules/react-native-config`) - react-native-get-random-values (from `../node_modules/react-native-get-random-values`) @@ -1615,10 +1659,12 @@ DEPENDENCIES: - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)" - "RNCCheckbox (from `../node_modules/@react-native-community/checkbox`)" - "RNCClipboard (from `../node_modules/@react-native-community/clipboard`)" + - "RNCMaskedView (from `../node_modules/@react-native-masked-view/masked-view`)" - RNDeviceInfo (from `../node_modules/react-native-device-info`) - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - RNICloudStore (from `../node_modules/react-native-icloudstore`) - RNLocalize (from `../node_modules/react-native-localize`) + - "rnmapbox-maps (from `../node_modules/@rnmapbox/maps`)" - RNOS (from `../node_modules/react-native-os`) - RNPermissions (from `../node_modules/react-native-permissions`) - RNReactNativeSharedGroupPreferences (from `../node_modules/react-native-shared-group-preferences`) @@ -1628,6 +1674,7 @@ DEPENDENCIES: - RNSVG (from `../node_modules/react-native-svg`) - RNTestFlight (from `../node_modules/react-native-test-flight`) - TcpSockets (from `../node_modules/react-native-tcp`) + - VisionCamera (from `../node_modules/react-native-vision-camera`) - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) SPEC REPOS: @@ -1635,12 +1682,16 @@ SPEC REPOS: - BCrypt - BEMCheckBox - Charts + - MapboxCommon + - MapboxCoreMaps + - MapboxMaps - MultiplatformBleAdapter - OneSignalXCFramework - SocketRocket - SwiftAlgorithms - SwiftyJSON - Toast + - Turf - ZXingObjC EXTERNAL SOURCES: @@ -1658,6 +1709,8 @@ EXTERNAL SOURCES: :path: "../node_modules/expo-constants/ios" EXImageLoader: :path: "../node_modules/expo-image-loader/ios" + EXLocation: + :path: "../node_modules/expo-location/ios" Expo: :path: "../node_modules/expo" ExpoAsset: @@ -1695,8 +1748,6 @@ EXTERNAL SOURCES: :path: "../node_modules/lottie-ios" lottie-react-native: :path: "../node_modules/lottie-react-native" - maplibre-react-native: - :path: "../node_modules/@maplibre/maplibre-react-native" RCT-Folly: :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" RCTDeprecation: @@ -1751,6 +1802,8 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-community/blur" react-native-charts-wrapper: :path: "../node_modules/react-native-charts-wrapper" + react-native-compass-heading: + :path: "../node_modules/react-native-compass-heading" react-native-config: :path: "../node_modules/react-native-config" react-native-get-random-values: @@ -1833,6 +1886,8 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-community/checkbox" RNCClipboard: :path: "../node_modules/@react-native-community/clipboard" + RNCMaskedView: + :path: "../node_modules/@react-native-masked-view/masked-view" RNDeviceInfo: :path: "../node_modules/react-native-device-info" RNGestureHandler: @@ -1841,6 +1896,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-icloudstore" RNLocalize: :path: "../node_modules/react-native-localize" + rnmapbox-maps: + :path: "../node_modules/@rnmapbox/maps" RNOS: :path: "../node_modules/react-native-os" RNPermissions: @@ -1859,6 +1916,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-test-flight" TcpSockets: :path: "../node_modules/react-native-tcp" + VisionCamera: + :path: "../node_modules/react-native-vision-camera" Yoga: :path: "../node_modules/react-native/ReactCommon/yoga" @@ -1873,6 +1932,7 @@ SPEC CHECKSUMS: EXBarCodeScanner: e2dd9b42c1b522a2adc9202b1dfbc64cb34456d1 EXConstants: 409690fbfd5afea964e5e9d6c4eb2c2b59222c59 EXImageLoader: ab589d67d6c5f2c33572afea9917304418566334 + EXLocation: 43e9b582ca63a23c6f0a18d8cbe2145b3a388b55 Expo: 798848eae1daf13363d69790986146b08d0cf92f ExpoAsset: 323700f291684f110fb55f0d4022a3362ea9f875 ExpoCamera: a5d000b22cd7dfd2c5904ed960e549de42c96da0 @@ -1885,16 +1945,18 @@ SPEC CHECKSUMS: ExpoSecureStore: 060cebcb956b80ddae09821610ac1aa9e1ac74cd EXSplashScreen: fbf0ec78e9cee911df188bf17b4fe51d15a84b87 FBLazyVector: ac12dc084d1c8ec4cc4d7b3cf1b0ebda6dab85af - fmt: 8083860262b879fc92bca720969c91bdb88ada93 - glog: 77f46f3d5c779b34a09b51a92fa9e0fcab64df1c + fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 + glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f helium-react-native-sdk: 54928dcd95ea131437ac6e269cf5bb2d473bf57f - hermes-engine: e52d9706e7fd6078e529d8ada1af7b95946c4ce6 + hermes-engine: 8c1577f3fdb849cbe7729c2e7b5abc4b845e88f8 lottie-ios: e047b1d2e6239b787cc5e9755b988869cf190494 lottie-react-native: f851c0e235f171d99083c803f728f644be1dcf65 - maplibre-react-native: 3a0d9beca427ff9000d75e0974c366ecd3c5375e + MapboxCommon: 6acbd8ff41d66abf498e1558b0739f25c562945a + MapboxCoreMaps: f306bb1b10ebe995a2247b40e99322ab7f9b8071 + MapboxMaps: 82044383ae19ec124ff444ec4b5d3ce82cb36ba5 MultiplatformBleAdapter: 5a6a897b006764392f9cef785e4360f54fb9477d OneSignalXCFramework: f06edd9b146c7ac5935136a117ce2a5fdd6420f6 - RCT-Folly: 36944e180e3143948e1c8b0c5eade65a3dd45142 + RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47 RCTDeprecation: 3afceddffa65aee666dafd6f0116f1d975db1584 RCTRequired: ec1239bc9d8bf63e10fb92bd8b26171a9258e0c1 RCTTypeSafety: f5ecbc86c5c5fa163c05acb7a1c5012e15b5f994 @@ -1921,6 +1983,7 @@ SPEC CHECKSUMS: react-native-ble-plx: f10240444452dfb2d2a13a0e4f58d7783e92d76e react-native-blur: 50c9feabacbc5f49b61337ebc32192c6be7ec3c3 react-native-charts-wrapper: 4268219d67a6fd7e94453d77d31b38ef1cd23860 + react-native-compass-heading: 1b4403d1c99dfd8311073ca8fc52bfc8e365cfac react-native-config: 7cd105e71d903104e8919261480858940a6b9c0e react-native-get-random-values: a6ea6a8a65dc93e96e24a11105b1a9c8cfe1d72a react-native-mail: 8fdcd3aef007c33a6877a18eb4cf7447a1d4ce4a @@ -1962,10 +2025,12 @@ SPEC CHECKSUMS: RNCAsyncStorage: b90b71f45b8b97be43bc4284e71a6af48ac9f547 RNCCheckbox: a3ca9978cb0846b981d28da4e9914bd437403d77 RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495 + RNCMaskedView: da52ec927af4b4c3f3f6b5b5e816a69be62fe642 RNDeviceInfo: aad3c663b25752a52bf8fce93f2354001dd185aa RNGestureHandler: efed690b8493a00b99654043daeb1335276ac4a2 RNICloudStore: bc6e225811637c09bd1eb055d6cd7448e61cd451 RNLocalize: a64514b46a01375fdfae9349036b4dc7130333b5 + rnmapbox-maps: 961b998761de9672c448aa17144b987410890992 RNOS: 6f2f9a70895bbbfbdad7196abd952e7b01d45027 RNPermissions: 2af759cf053542b2b4b3c4cf9f43874796106f2c RNReactNativeSharedGroupPreferences: 29092869fc2e40d5baca5e15d82fa5c24a668977 @@ -1979,9 +2044,11 @@ SPEC CHECKSUMS: SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7 TcpSockets: 14306fb79f9750ea7d2ddd02d8bed182abb01797 Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 - Yoga: 2246eea72aaf1b816a68a35e6e4b74563653ae09 + Turf: aa2ede4298009639d10db36aba1a7ebaad072a5e + VisionCamera: cb84d0d8485b3e67c91b62931d3aa88f49747c92 + Yoga: 950bbfd7e6f04790fdb51149ed51df41f329fcc8 ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5 -PODFILE CHECKSUM: d44dfed27ca86fe0b1eb67aab0856b7cc9e24ff7 +PODFILE CHECKSUM: af8e0f0904c0f9cc43a95eef4e1feb504870ee6e -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.1 diff --git a/ios/link-assets-manifest.json b/ios/link-assets-manifest.json new file mode 100644 index 000000000..d1e688d7f --- /dev/null +++ b/ios/link-assets-manifest.json @@ -0,0 +1,13 @@ +{ + "migIndex": 1, + "data": [ + { + "path": "src/assets/fonts/Figtree-Italic-VariableFont_wght.ttf", + "sha1": "8e76cbc3e74d415e8790eb62dfa1705539609dcb" + }, + { + "path": "src/assets/fonts/Figtree-VariableFont_wght.ttf", + "sha1": "118c5e4678ec5f5f7222fb968cd88a5a92e7629d" + } + ] +} diff --git a/package.json b/package.json index 56c68acb9..5089cd4ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "helium-wallet", - "version": "2.10.0", + "version": "3.0.0", "private": true, "scripts": { "postinstall": "patch-package && ./node_modules/.bin/rn-nodeify --hack --install && npx jetify", @@ -17,6 +17,8 @@ "bump-patch": "npx react-native bump-version --skip-semver-for android --skip-code-for all --type patch", "bump-minor": "npx react-native bump-version --skip-semver-for android --skip-code-for all --type minor", "bump-major": "npx react-native bump-version --skip-semver-for android --skip-code-for all --type major", + "gen-ims-api": "graphql-codegen --config src/store/apis/ims/dashboard/codegen.yml", + "gen-ims-payments-api": "graphql-codegen --config src/store/apis/ims/payments/codegen.yml", "prettier": "prettier --write *.ts*", "gen-types:all": "yarn gen-types", "prepare": "husky install" @@ -29,36 +31,40 @@ "@babel/preset-typescript": "7.21.0", "@bonfida/spl-name-service": "^1.1.1", "@coral-xyz/anchor": "^0.28.0", - "@gorhom/bottom-sheet": "4.6.0", + "@gorhom/bottom-sheet": "5.0.4", "@gorhom/portal": "1.0.14", - "@helium/account-fetch-cache": "0.9.7", - "@helium/account-fetch-cache-hooks": "0.9.7", + "@graphql-codegen/cli": "^5.0.0", + "@graphql-codegen/typescript": "^4.0.1", + "@graphql-codegen/typescript-operations": "^4.0.1", + "@graphql-codegen/typescript-rtk-query": "^3.1.1", + "@helium/account-fetch-cache": "0.9.14", + "@helium/account-fetch-cache-hooks": "0.9.14", "@helium/address": "4.10.2", - "@helium/circuit-breaker-sdk": "^0.9.7", + "@helium/circuit-breaker-sdk": "^0.9.14", "@helium/crypto-react-native": "4.8.0", - "@helium/currency-utils": "^0.9.7", - "@helium/data-credits-sdk": "^0.9.7", - "@helium/distributor-oracle": "0.9.7", - "@helium/fanout-sdk": "^0.9.7", - "@helium/helium-entity-manager-sdk": "^0.9.7", - "@helium/helium-react-hooks": "0.9.7", - "@helium/helium-sub-daos-sdk": "^0.9.7", + "@helium/currency-utils": "^0.9.14", + "@helium/data-credits-sdk": "^0.9.14", + "@helium/distributor-oracle": "0.9.14", + "@helium/fanout-sdk": "^0.9.14", + "@helium/helium-entity-manager-sdk": "^0.9.14", + "@helium/helium-react-hooks": "0.9.14", + "@helium/helium-sub-daos-sdk": "^0.9.14", "@helium/http": "4.7.5", - "@helium/idls": "0.9.7", - "@helium/lazy-distributor-sdk": "^0.9.7", + "@helium/idls": "0.9.14", + "@helium/lazy-distributor-sdk": "^0.9.14", "@helium/modular-governance-hooks": "^0.0.13", "@helium/modular-governance-idls": "0.0.13", "@helium/onboarding": "4.11.0", "@helium/organization-sdk": "^0.0.13", "@helium/proto-ble": "4.0.0", "@helium/react-native-sdk": "3.0.5", - "@helium/spl-utils": "0.9.7", + "@helium/spl-utils": "0.9.14", "@helium/state-controller-sdk": "^0.0.13", - "@helium/sus": "0.9.7", + "@helium/sus": "0.9.14", "@helium/transactions": "4.8.1", - "@helium/treasury-management-sdk": "^0.9.7", - "@helium/voter-stake-registry-hooks": "0.9.7", - "@helium/voter-stake-registry-sdk": "0.9.7", + "@helium/treasury-management-sdk": "^0.9.14", + "@helium/voter-stake-registry-hooks": "0.9.14", + "@helium/voter-stake-registry-sdk": "0.9.14", "@helium/wallet-link": "4.11.0", "@jup-ag/api": "^6.0.6", "@keystonehq/keystone-sdk": "^0.8.0", @@ -66,10 +72,11 @@ "@ledgerhq/react-native-hid": "6.30.0", "@ledgerhq/react-native-hw-transport-ble": "6.29.5", "@ledgerhq/types-devices": "^6.22.4", - "@maplibre/maplibre-react-native": "^9.1.0", + "@metaplex-foundation/js": "^0.19.5", "@metaplex-foundation/mpl-bubblegum": "0.6.0", "@metaplex-foundation/mpl-token-metadata": "2.10.0", "@ngraveio/bc-ur": "^1.1.13", + "@novalabsxyz/mobile-theme": "2.0.0-y.26", "@onsol/tldparser": "^0.5.3", "@react-native-async-storage/async-storage": "1.18.1", "@react-native-community/blur": "4.3.0", @@ -78,13 +85,15 @@ "@react-native-community/hooks": "2.8.1", "@react-native-community/netinfo": "9.3.7", "@react-native-community/slider": "^4.5.2", + "@react-native-masked-view/masked-view": "^0.3.2", "@react-navigation/bottom-tabs": "6.4.0", "@react-navigation/material-top-tabs": "6.5.1", "@react-navigation/native": "6.0.11", "@react-navigation/native-stack": "6.7.0", "@react-navigation/stack": "6.2.2", "@reduxjs/toolkit": "1.9.1", - "@shopify/restyle": "1.8.0", + "@rnmapbox/maps": "^10.1.31", + "@shopify/restyle": "2.4.2", "@solana/spl-account-compression": "0.1.4", "@solana/spl-memo": "0.2.3", "@solana/spl-token": "0.3.6", @@ -132,9 +141,11 @@ "expo-haptics": "13.0.1", "expo-linking": "6.3.1", "expo-local-authentication": "14.0.1", + "expo-location": "^17.0.1", "expo-secure-store": "13.0.2", "expo-splash-screen": "0.27.5", "fuse.js": "6.6.2", + "geolib": "^3.3.4", "h3-js": "4.1.0", "https-browserify": "0.0.1", "i18next": "21.9.1", @@ -156,13 +167,17 @@ "react-error-boundary": "^4.0.13", "react-i18next": "11.18.4", "react-native": "0.74.5", + "react-native-animated-numbers": "^0.6.2", "react-native-appstate-hook": "1.0.6", "react-native-ble-plx": "2.0.3", "react-native-charts-wrapper": "0.5.10", + "react-native-compass-heading": "^1.5.0", + "react-native-confetti-cannon": "^1.5.2", "react-native-config": "1.4.6", "react-native-crypto": "2.2.0", "react-native-device-info": "8.7.1", "react-native-flash-message": "0.2.1", + "react-native-geocoding": "^0.5.0", "react-native-gesture-handler": "2.18.1", "react-native-get-random-values": "1.8.0", "react-native-icloudstore": "0.9.0", @@ -173,13 +188,13 @@ "react-native-localize": "2.2.3", "react-native-mail": "6.1.1", "react-native-markdown-display": "^7.0.0-alpha.2", - "react-native-navigation-bar-color": "2.0.2", + "react-native-navigation-bar-color": "^2.0.2", "react-native-network-info": "5.2.1", "react-native-onesignal": "5.2.2", "react-native-os": "^1.2.6", "react-native-pager-view": "6.1.2", "react-native-permissions": "^3.9.0", - "react-native-qrcode-svg": "6.1.2", + "react-native-qrcode-svg": "^6.3.2", "react-native-randombytes": "3.6.1", "react-native-reanimated": "3.14.0", "react-native-safe-area-context": "4.10.8", @@ -187,6 +202,7 @@ "react-native-share": "7.9.0", "react-native-shared-group-preferences": "1.1.24", "react-native-simple-toast": "1.1.4", + "react-native-skeleton-placeholder": "^5.2.4", "react-native-snap-carousel": "4.0.0-beta.6", "react-native-sodium": "^0.4.0", "react-native-svg": "13.4.0", @@ -197,6 +213,7 @@ "react-native-udp": "2.7.0", "react-native-url-polyfill": "^2.0.0", "react-native-video": "5.2.1", + "react-native-vision-camera": "^4.5.3", "react-native-webview": "13.10.5", "react-redux": "8.0.4", "readable-stream": "3.6.0", @@ -276,11 +293,11 @@ "@types/react": "18", "react": "18.2.0", "@solana/wallet-adapter-react": "0.15.33", - "@helium/account-fetch-cache": "^0.9.7", - "@helium/account-fetch-cache-hooks": "^0.9.7", - "@helium/helium-react-hooks": "^0.9.7", - "@helium/voter-stake-registry-hooks": "^0.9.7", - "@helium/voter-stake-registry-sdk": "^0.9.7", + "@helium/account-fetch-cache": "^0.9.14", + "@helium/account-fetch-cache-hooks": "^0.9.14", + "@helium/helium-react-hooks": "^0.9.14", + "@helium/voter-stake-registry-hooks": "^0.9.14", + "@helium/voter-stake-registry-sdk": "^0.9.14", "@helium/modular-governance-hooks": "^0.0.13", "@helium/onboarding": "4.11.0" }, diff --git a/patches/@maplibre+maplibre-react-native+9.1.0.patch b/patches/@maplibre+maplibre-react-native+9.1.0.patch deleted file mode 100644 index 61d3b0349..000000000 --- a/patches/@maplibre+maplibre-react-native+9.1.0.patch +++ /dev/null @@ -1,316 +0,0 @@ -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/generated/source/buildConfig/debug/com/mapbox/rctmgl/BuildConfig.java b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/generated/source/buildConfig/debug/com/mapbox/rctmgl/BuildConfig.java -new file mode 100644 -index 0000000..ea64509 ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/generated/source/buildConfig/debug/com/mapbox/rctmgl/BuildConfig.java -@@ -0,0 +1,10 @@ -+/** -+ * Automatically generated file. DO NOT MODIFY -+ */ -+package com.mapbox.rctmgl; -+ -+public final class BuildConfig { -+ public static final boolean DEBUG = Boolean.parseBoolean("true"); -+ public static final String LIBRARY_PACKAGE_NAME = "com.mapbox.rctmgl"; -+ public static final String BUILD_TYPE = "debug"; -+} -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml -new file mode 100644 -index 0000000..eecf75d ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml -@@ -0,0 +1,10 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -\ No newline at end of file -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json -new file mode 100644 -index 0000000..67b2315 ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json -@@ -0,0 +1,18 @@ -+{ -+ "version": 3, -+ "artifactType": { -+ "type": "AAPT_FRIENDLY_MERGED_MANIFESTS", -+ "kind": "Directory" -+ }, -+ "applicationId": "com.mapbox.rctmgl", -+ "variantName": "debug", -+ "elements": [ -+ { -+ "type": "SINGLE", -+ "filters": [], -+ "attributes": [], -+ "outputFile": "AndroidManifest.xml" -+ } -+ ], -+ "elementType": "File" -+} -\ No newline at end of file -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/aar_metadata/debug/aar-metadata.properties b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/aar_metadata/debug/aar-metadata.properties -new file mode 100644 -index 0000000..1211b1e ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/aar_metadata/debug/aar-metadata.properties -@@ -0,0 +1,6 @@ -+aarFormatVersion=1.0 -+aarMetadataVersion=1.0 -+minCompileSdk=1 -+minCompileSdkExtension=0 -+minAndroidGradlePluginVersion=1.0.0 -+coreLibraryDesugaringEnabled=false -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/annotation_processor_list/debug/annotationProcessors.json b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/annotation_processor_list/debug/annotationProcessors.json -new file mode 100644 -index 0000000..9e26dfe ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/annotation_processor_list/debug/annotationProcessors.json -@@ -0,0 +1 @@ -+{} -\ No newline at end of file -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compile_r_class_jar/debug/R.jar b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compile_r_class_jar/debug/R.jar -new file mode 100644 -index 0000000..190e46b -Binary files /dev/null and b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compile_r_class_jar/debug/R.jar differ -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compile_symbol_list/debug/R.txt b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compile_symbol_list/debug/R.txt -new file mode 100644 -index 0000000..e6bb791 ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compile_symbol_list/debug/R.txt -@@ -0,0 +1,8 @@ -+int drawable empty 0x0 -+int drawable empty_drawable 0x0 -+int drawable red_marker 0x0 -+int id annotation_img 0x0 -+int id annotation_layout 0x0 -+int id annotation_view_container 0x0 -+int layout annotation 0x0 -+int string app_name 0x0 -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compiled_local_resources/debug/out/drawable-xxhdpi-v4_red_marker.png.flat b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compiled_local_resources/debug/out/drawable-xxhdpi-v4_red_marker.png.flat -new file mode 100644 -index 0000000..5b0aa33 -Binary files /dev/null and b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compiled_local_resources/debug/out/drawable-xxhdpi-v4_red_marker.png.flat differ -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compiled_local_resources/debug/out/drawable_empty.xml.flat b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compiled_local_resources/debug/out/drawable_empty.xml.flat -new file mode 100644 -index 0000000..8a833ad -Binary files /dev/null and b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compiled_local_resources/debug/out/drawable_empty.xml.flat differ -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compiled_local_resources/debug/out/drawable_empty_drawable.png.flat b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compiled_local_resources/debug/out/drawable_empty_drawable.png.flat -new file mode 100644 -index 0000000..b53aa0c -Binary files /dev/null and b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compiled_local_resources/debug/out/drawable_empty_drawable.png.flat differ -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compiled_local_resources/debug/out/layout_annotation.xml.flat b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compiled_local_resources/debug/out/layout_annotation.xml.flat -new file mode 100644 -index 0000000..942d161 -Binary files /dev/null and b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/compiled_local_resources/debug/out/layout_annotation.xml.flat differ -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties -new file mode 100644 -index 0000000..62539fb ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties -@@ -0,0 +1,5 @@ -+#Mon Aug 05 14:40:58 PDT 2024 -+com.mapbox.rctmgl.maplibre_maplibre-react-native-main-6\:/drawable-xxhdpi/red_marker.png=/Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/red_marker.png -+com.mapbox.rctmgl.maplibre_maplibre-react-native-main-6\:/drawable/empty.xml=/Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/drawable/empty.xml -+com.mapbox.rctmgl.maplibre_maplibre-react-native-main-6\:/layout/annotation.xml=/Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/layout/annotation.xml -+com.mapbox.rctmgl.maplibre_maplibre-react-native-main-6\:/drawable/empty_drawable.png=/Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/drawable/empty_drawable.png -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/incremental/debug/packageDebugResources/merged.dir/values/values.xml b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/incremental/debug/packageDebugResources/merged.dir/values/values.xml -new file mode 100644 -index 0000000..1b0b5d6 ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/incremental/debug/packageDebugResources/merged.dir/values/values.xml -@@ -0,0 +1,4 @@ -+ -+ -+ RCTMGL -+ -\ No newline at end of file -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/incremental/debug/packageDebugResources/merger.xml b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/incremental/debug/packageDebugResources/merger.xml -new file mode 100644 -index 0000000..5f8b0ab ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/incremental/debug/packageDebugResources/merger.xml -@@ -0,0 +1,2 @@ -+ -+RCTMGL -\ No newline at end of file -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/local_only_symbol_list/debug/R-def.txt b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/local_only_symbol_list/debug/R-def.txt -new file mode 100644 -index 0000000..826dbbd ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/local_only_symbol_list/debug/R-def.txt -@@ -0,0 +1,10 @@ -+R_DEF: Internal format may change without notice -+local -+drawable empty -+drawable empty_drawable -+drawable red_marker -+id annotation_img -+id annotation_layout -+id annotation_view_container -+layout annotation -+string app_name -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt -new file mode 100644 -index 0000000..9065ef8 ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt -@@ -0,0 +1,14 @@ -+1 -+2 -+4 -+5 -+6 -+7 -+7-->/Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml:2:5-67 -+7-->/Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml:2:22-64 -+8 -+8-->/Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml:3:5-78 -+8-->/Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml:3:22-76 -+9 -+10 -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/merged_manifest/debug/AndroidManifest.xml b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/merged_manifest/debug/AndroidManifest.xml -new file mode 100644 -index 0000000..eecf75d ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/merged_manifest/debug/AndroidManifest.xml -@@ -0,0 +1,10 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -\ No newline at end of file -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/navigation_json/debug/navigation.json b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/navigation_json/debug/navigation.json -new file mode 100644 -index 0000000..0637a08 ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/navigation_json/debug/navigation.json -@@ -0,0 +1 @@ -+[] -\ No newline at end of file -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/red_marker.png b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/red_marker.png -new file mode 100644 -index 0000000..be782e1 -Binary files /dev/null and b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/drawable-xxhdpi-v4/red_marker.png differ -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/drawable/empty.xml b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/drawable/empty.xml -new file mode 100644 -index 0000000..1f83bff ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/drawable/empty.xml -@@ -0,0 +1,5 @@ -+ -+ -+ -+ -+ -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/drawable/empty_drawable.png b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/drawable/empty_drawable.png -new file mode 100644 -index 0000000..9da19ea -Binary files /dev/null and b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/drawable/empty_drawable.png differ -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/layout/annotation.xml b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/layout/annotation.xml -new file mode 100644 -index 0000000..4994bd0 ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/layout/annotation.xml -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/values/values.xml b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/values/values.xml -new file mode 100644 -index 0000000..1b0b5d6 ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/packaged_res/debug/values/values.xml -@@ -0,0 +1,4 @@ -+ -+ -+ RCTMGL -+ -\ No newline at end of file -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt -new file mode 100644 -index 0000000..44307d6 ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt -@@ -0,0 +1,9 @@ -+com.mapbox.rctmgl -+drawable empty -+drawable empty_drawable -+drawable red_marker -+id annotation_img -+id annotation_layout -+id annotation_view_container -+layout annotation -+string app_name -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/outputs/logs/manifest-merger-debug-report.txt b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/outputs/logs/manifest-merger-debug-report.txt -new file mode 100644 -index 0000000..3581c51 ---- /dev/null -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/build/outputs/logs/manifest-merger-debug-report.txt -@@ -0,0 +1,25 @@ -+-- Merging decision tree log --- -+manifest -+ADDED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml:1:1-4:12 -+INJECTED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml:1:1-4:12 -+ package -+ ADDED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml:1:70-97 -+ INJECTED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml -+ xmlns:android -+ ADDED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml:1:11-69 -+uses-permission#android.permission.INTERNET -+ADDED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml:2:5-67 -+ android:name -+ ADDED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml:2:22-64 -+uses-permission#android.permission.ACCESS_FINE_LOCATION -+ADDED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml:3:5-78 -+ android:name -+ ADDED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml:3:22-76 -+uses-sdk -+INJECTED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml reason: use-sdk injection requested -+INJECTED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml -+INJECTED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml -+ android:targetSdkVersion -+ INJECTED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml -+ android:minSdkVersion -+ INJECTED from /Users/noahprince/source/wallet-app/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/AndroidManifest.xml -diff --git a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/java/com/mapbox/rctmgl/components/styles/RCTMGLStyleFunctionParser.java b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/java/com/mapbox/rctmgl/components/styles/RCTMGLStyleFunctionParser.java -index 3aa0522..9a2248f 100644 ---- a/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/java/com/mapbox/rctmgl/components/styles/RCTMGLStyleFunctionParser.java -+++ b/node_modules/@maplibre/maplibre-react-native/android/rctmgl/src/main/java/com/mapbox/rctmgl/components/styles/RCTMGLStyleFunctionParser.java -@@ -3,7 +3,7 @@ package com.mapbox.rctmgl.components.styles; - import android.util.Log; - - import com.facebook.react.bridge.Dynamic; --import com.facebook.react.bridge.DynamicFromMap; -+// import com.facebook.react.bridge.DynamicFromMap; - import com.facebook.react.bridge.NoSuchKeyException; - import com.facebook.react.bridge.ReadableArray; - import com.facebook.react.bridge.ReadableMap; diff --git a/project-structure.md b/project-structure.md new file mode 100644 index 000000000..ca4df77c2 --- /dev/null +++ b/project-structure.md @@ -0,0 +1,71 @@ +# 🗄️ Project Structure + +Most of the code lives in the `src` folder and looks something like this: + +```sh +src +| ++-- app # application layer containing: +| | # this folder might differ based on the meta framework used +| +-- services # application services. The super app top level navigation is defined as a set of services +| +-- RootNavigator.tsx # Main navigator for the app that determines the initial route. Either app onboarding UI or the top level service navigator +| +-- App.tsx # main application component ++-- assets # assets folder can contain all the static files such as images, fonts, etc. +| ++-- components # shared components used across the entire application +| ++-- config # global configurations, exported env variables etc. +| ++-- features # feature based modules +| ++-- hooks # shared hooks used across the entire application +| ++-- lib # reusable libraries preconfigured for the application +| ++-- stores # global state stores +| ++-- testing # test utilities and mocks +| ++-- types # shared types used across the application +| ++-- utils # shared utility functions +``` + +A service could have the following structure: + +```sh +src/services/srcful +| ++-- pages # pages scoped to a specific service +| ++-- index.tsx # service entry point +``` + +For easy scalability and maintenance, organize most of the code within the features folder. Each feature folder should contain code specific to that feature, keeping things neatly separated. This approach helps prevent mixing feature-related code with shared components, making it simpler to manage and maintain the codebase compared to having many files in a flat folder structure. By adopting this method, you can enhance collaboration, readability, and scalability in the application's architecture. + +A feature could have the following structure: + +```sh +src/features/awesome-feature +| ++-- api # exported API request declarations and api hooks related to a specific feature +| ++-- assets # assets folder can contain all the static files for a specific feature +| ++-- components # components scoped to a specific feature +| ++-- screens # screens scoped to a specific feature +| ++-- hooks # hooks scoped to a specific feature +| ++-- stores # state stores for a specific feature +| ++-- types # typescript types used within the feature +| ++-- utils # utility functions for a specific feature +``` + +NOTE: You don't need all of these folders for every feature. Only include the ones that are necessary for the feature. + +By following these practices, you can ensure that your codebase is well-organized, scalable, and maintainable. This will help you and your team to work more efficiently and effectively on the project. +This approach can also make it easier to apply similar architecture to apps built with Next.js, Remix or React Native. diff --git a/src/Input.tsx b/src/Input.tsx deleted file mode 100644 index 0ecb1e4a0..000000000 --- a/src/Input.tsx +++ /dev/null @@ -1,27 +0,0 @@ -/* eslint-disable react/jsx-props-no-spreading */ -import React from 'react' -import { - Text, - TextInput, - TextInputProps, - TextProps, - View, - ViewStyle, -} from 'react-native' - -type Props = { - title: string - textProps?: TextProps - inputProps?: TextInputProps - style?: ViewStyle -} -const Input = ({ style, title, textProps, inputProps }: Props) => { - return ( - - {title} - - - ) -} - -export default Input diff --git a/src/App.tsx b/src/app/App.tsx similarity index 71% rename from src/App.tsx rename to src/app/App.tsx index 0eaba2306..5e3bd0983 100644 --- a/src/App.tsx +++ b/src/app/App.tsx @@ -2,43 +2,41 @@ import AutoGasBanner from '@components/AutoGasBanner' import { BottomSheetModalProvider } from '@gorhom/bottom-sheet' import { PortalProvider } from '@gorhom/portal' import { OnboardingProvider as HotspotOnboardingProvider } from '@helium/react-native-sdk' -import MapLibreGL from '@maplibre/maplibre-react-native' import { DarkTheme, NavigationContainer } from '@react-navigation/native' import { ThemeProvider } from '@shopify/restyle' -import { ModalProvider } from '@storage/ModalsProvider' -import TokensProvider from '@storage/TokensProvider' +import { ModalProvider } from '@config/storage/ModalsProvider' +import TokensProvider from '@config/storage/TokensProvider' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' -import globalStyles from '@theme/globalStyles' -import { darkThemeColors, lightThemeColors, theme } from '@theme/theme' -import { useColorScheme } from '@theme/themeHooks' +import globalStyles from '@config/theme/globalStyles' +import { darkTheme } from '@config/theme/theme' import * as SplashLib from 'expo-splash-screen' import React, { useMemo } from 'react' -import { LogBox } from 'react-native' +import Mapbox from '@rnmapbox/maps' +import { LogBox, Platform, StatusBar, UIManager } from 'react-native' import useAppState from 'react-native-appstate-hook' import Config from 'react-native-config' import { GestureHandlerRootView } from 'react-native-gesture-handler' import { OneSignal } from 'react-native-onesignal' import { SafeAreaProvider } from 'react-native-safe-area-context' import 'text-encoding-polyfill' -import NetworkAwareStatusBar from './components/NetworkAwareStatusBar' -import SplashScreen from './components/SplashScreen' -import WalletConnectProvider from './features/dappLogin/WalletConnectProvider' -import LockScreen from './features/lock/LockScreen' -import InsufficientSolConversionModal from './features/modals/InsufficientSolConversionModal' -import WalletOnboardingProvider from './features/onboarding/OnboardingProvider' -import SecurityScreen from './features/security/SecurityScreen' -import useMount from './hooks/useMount' -import { navigationRef } from './navigation/NavigationHelper' -import RootNavigator from './navigation/RootNavigator' -import './polyfill' -import SolanaProvider from './solana/SolanaProvider' -import WalletSignProvider from './solana/WalletSignProvider' -import { useAccountStorage } from './storage/AccountStorageProvider' -import { GovernanceProvider } from './storage/GovernanceProvider' -import { useNotificationStorage } from './storage/NotificationStorageProvider' -import { BalanceProvider } from './utils/Balance' -import { useDeepLinking } from './utils/linking' -import KeystoneOnboardingProvider from './features/keystone/KeystoneOnboardingProvider' +import SolanaProvider from '@features/solana/SolanaProvider' +import WalletSignProvider from '@features/solana/WalletSignProvider' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { GovernanceProvider } from '@config/storage/GovernanceProvider' +import { useNotificationStorage } from '@config/storage/NotificationStorageProvider' +import { BalanceProvider } from '@utils/Balance' +import { useDeepLinking } from '@utils/linking' +import KeystoneOnboardingProvider from '@features/keystone/KeystoneOnboardingProvider' +import SplashScreen from '../components/SplashScreen' +import WalletConnectProvider from '../features/dappLogin/WalletConnectProvider' +import LockScreen from '../features/lock/LockScreen' +import InsufficientSolConversionModal from '../features/modals/InsufficientSolConversionModal' +import WalletOnboardingProvider from '../features/onboarding/OnboardingProvider' +import SecurityScreen from '../features/security/SecurityScreen' +import useMount from '../hooks/useMount' +import { navigationRef } from './NavigationHelper' +import RootNavigator from './RootNavigator' +import '../polyfill' SplashLib.preventAutoHideAsync().catch(() => { /* reloading the app might trigger some race conditions, ignore them */ @@ -48,7 +46,8 @@ const App = () => { // Note that the Android SDK is slightly peculiar // in that it requires setting an access token, // even though it will be null for most users(only Mapbox authenticates this way) - MapLibreGL.setAccessToken(null) + // MapLibreGL.setAccessToken(null) + Mapbox.setAccessToken(Config.MAPBOX_ACCESS_TOKEN) LogBox.ignoreLogs([ 'Module iCloudStorage', @@ -64,38 +63,41 @@ const App = () => { 'ws error: received bad response code from server 429', 'Ignored unsubscribe request because an active subscription with id', 'accountFetchCache Batching account fetch of', + 'VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead.', ]) const { appState } = useAppState() const { restored: accountsRestored } = useAccountStorage() - // const { cache } = useSolana() const { setOpenedNotification } = useNotificationStorage() const linking = useDeepLinking() - const colorScheme = useColorScheme() + const themeObject = useMemo(() => { + return darkTheme + }, []) + + if (Platform.OS === 'android') { + if (UIManager.setLayoutAnimationEnabledExperimental) { + UIManager.setLayoutAnimationEnabledExperimental(true) + } + } const colorAdaptedTheme = useMemo( () => ({ - ...theme, - colors: colorScheme === 'light' ? lightThemeColors : darkThemeColors, + ...themeObject, }), - [colorScheme], + [themeObject], ) const navTheme = useMemo( () => ({ ...DarkTheme, - dark: colorScheme === 'light', + dark: true, colors: { ...DarkTheme.colors, - background: - colorScheme === 'light' - ? lightThemeColors.primaryBackground - : darkThemeColors.primaryBackground, + background: themeObject.colors.primaryBackground, }, }), - - [colorScheme], + [themeObject], ) useMount(() => { @@ -114,6 +116,10 @@ const App = () => { return ( + @@ -142,7 +148,6 @@ const App = () => { - {/* place app specific modals here */} diff --git a/src/navigation/NavigationHelper.ts b/src/app/NavigationHelper.ts similarity index 70% rename from src/navigation/NavigationHelper.ts rename to src/app/NavigationHelper.ts index fc6120b1b..e887d1886 100644 --- a/src/navigation/NavigationHelper.ts +++ b/src/app/NavigationHelper.ts @@ -1,11 +1,11 @@ import { createNavigationContainerRef } from '@react-navigation/native' -import { HomeStackParamList } from '../features/home/homeTypes' +import { AccountsServiceStackParamList } from 'src/app/services/AccountsService' import { RootStackParamList } from './rootTypes' export const navigationRef = createNavigationContainerRef() export const navToImportAccount = ( - params: HomeStackParamList['ReImportAccountNavigator'], + params: AccountsServiceStackParamList['ReImportAccountNavigator'], ) => { if (!navigationRef.isReady()) return navigationRef.navigate('ReImportAccountNavigator' as any, params as any) diff --git a/src/app/RootNavigator.tsx b/src/app/RootNavigator.tsx new file mode 100644 index 000000000..1535cdc85 --- /dev/null +++ b/src/app/RootNavigator.tsx @@ -0,0 +1,96 @@ +import { + StackNavigationOptions, + createStackNavigator, +} from '@react-navigation/stack' +import { useColors } from '@config/theme/themeHooks' +import React, { memo, useEffect, useMemo } from 'react' +import changeNavigationBarColor from 'react-native-navigation-bar-color' +import ServiceSheetNavigator from '@services/ServiceSheetNavigator' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import ScanQrCodeScreen from '@features/keystone/ScanQrCodeScreen' +import SelectKeystoneAccountsScreen from '@features/keystone/SelectKeystoneAccountsScreen' +import DappLoginScreen from '@features/dappLogin/DappLoginScreen' +import OnboardingNavigator from '@features/onboarding/OnboardingNavigator' +import ImportPrivateKey from '@features/onboarding/import/ImportPrivateKey' +import PaymentScreen from '@features/payment/PaymentScreen' +import LinkWallet from '@features/txnDelegation/LinkWallet' +import SignHotspot from '@features/txnDelegation/SignHotspot' +import { RootStackParamList } from './rootTypes' + +const screenOptions = { headerShown: false } as StackNavigationOptions + +const RootNavigator = () => { + const { currentAccount } = useAccountStorage() + const colors = useColors() + const RootStack = createStackNavigator() + + useEffect(() => { + if (currentAccount) { + changeNavigationBarColor(colors.primaryText, true, false) + } else { + changeNavigationBarColor(colors.primaryBackground, true, false) + } + }, [colors, currentAccount]) + + const initialRouteName = useMemo(() => { + return currentAccount ? 'ServiceSheetNavigator' : 'OnboardingNavigator' + }, [currentAccount]) + + return ( + + + + + + + + + + + + ) +} + +export default memo(RootNavigator) diff --git a/src/navigation/rootTypes.ts b/src/app/rootTypes.ts similarity index 90% rename from src/navigation/rootTypes.ts rename to src/app/rootTypes.ts index 79ddc408e..95b145444 100644 --- a/src/navigation/rootTypes.ts +++ b/src/app/rootTypes.ts @@ -1,11 +1,11 @@ import { LinkWalletRequest, SignHotspotRequest } from '@helium/wallet-link' import { StackNavigationProp } from '@react-navigation/stack' import { KeystoneAccountType } from 'src/features/keystone/SelectKeystoneAccountsScreen' -import { PaymentRouteParam } from '../features/home/homeTypes' +import { PaymentRouteParam } from 'src/app/services/WalletService' export type RootStackParamList = { OnboardingNavigator: undefined - TabBarNavigator: undefined + ServiceSheetNavigator: undefined LinkWallet: LinkWalletRequest SignHotspot: SignHotspotRequest & { submit?: boolean } PaymentScreen: undefined | PaymentRouteParam diff --git a/src/app/services/AccountsService/accountServiceTypes.ts b/src/app/services/AccountsService/accountServiceTypes.ts new file mode 100644 index 000000000..0bb837239 --- /dev/null +++ b/src/app/services/AccountsService/accountServiceTypes.ts @@ -0,0 +1,9 @@ +import { StackNavigationProp } from '@react-navigation/stack' + +export type AccountsServiceStackParamList = { + YourWalletsPage: undefined + AddNewAccountNavigator: undefined +} + +export type AccountsServiceNavigationProp = + StackNavigationProp diff --git a/src/app/services/AccountsService/index.tsx b/src/app/services/AccountsService/index.tsx new file mode 100644 index 000000000..b2aea7e1d --- /dev/null +++ b/src/app/services/AccountsService/index.tsx @@ -0,0 +1,78 @@ +import React, { useMemo } from 'react' +import { + StackNavigationOptions, + StackNavigationProp, + createStackNavigator, +} from '@react-navigation/stack' +import { useColors } from '@config/theme/themeHooks' +import AddNewAccountNavigator from '@features/home/addNewAccount/AddNewAccountNavigator' +import AccountAssignScreen from '@features/onboarding/AccountAssignScreen' +import { RouteAccount } from '@features/onboarding/create/createAccountNavTypes' +import ImportAccountNavigator from '@features/onboarding/import/ImportAccountNavigator' +import KeystoneNavigator from '@features/keystone/KeystoneNavigator' +import YourWalletsPage from './pages/YourWalletsPage' + +export type AccountsServiceStackParamList = { + YourWalletsPage: undefined + AddNewAccountNavigator: undefined + AccountAssignScreen: undefined | RouteAccount + ReImportAccountNavigator: + | undefined + | { + screen: 'AccountImportScreen' + params: { + restoringAccount?: boolean + accountAddress?: string + } + } + KeystoneNavigator: { + screen: 'KeystoneNavigator' + params: { + screen: string + } + } +} + +export type AccountsServiceNavigationProp = + StackNavigationProp + +const AccountsServiceStack = + createStackNavigator() + +const AccountsService = () => { + const colors = useColors() + const screenOptions: StackNavigationOptions = useMemo( + () => ({ + headerShown: false, + animationEnabled: false, + cardStyle: { backgroundColor: colors.primaryBackground }, + }), + [colors], + ) + return ( + + + + + + + + ) +} + +export default AccountsService diff --git a/src/app/services/AccountsService/pages/YourWalletsPage.tsx b/src/app/services/AccountsService/pages/YourWalletsPage.tsx new file mode 100644 index 000000000..395af534b --- /dev/null +++ b/src/app/services/AccountsService/pages/YourWalletsPage.tsx @@ -0,0 +1,419 @@ +import React, { useCallback, useEffect, useMemo, useState } from 'react' +import Text from '@components/Text' +import { useTranslation } from 'react-i18next' +import { ReAnimatedBox } from '@components/AnimatedBox' +import { FadeIn } from 'react-native-reanimated' +import Box from '@components/Box' +import { Image, SectionList } from 'react-native' +import { useAccountStorage } from '@config/storage/AccountStorageProvider' +import { NetTypes } from '@helium/address' +import { CSAccount } from '@config/storage/cloudStorage' +import TouchableContainer from '@components/TouchableContainer' +import AccountIcon from '@components/AccountIcon' +import { ellipsizeAddress } from '@utils/accountUtils' +import { useColors, useSpacing } from '@config/theme/themeHooks' +import SmallAdd from '@assets/svgs/smallAdd.svg' +import BigAdd from '@assets/svgs/bigAdd.svg' +import Checkmark from '@assets/svgs/checkmark.svg' +import { useNavigation } from '@react-navigation/native' +import { + HELIUM_DERIVATION, + keypairFromSeed, + solanaDerivation, +} from '@hooks/useDerivationAccounts' +import { getSecureAccount } from '@config/storage/secureStorage' +import * as bip39 from 'bip39' +import { useOnboarding } from '@features/onboarding/OnboardingProvider' +import Toast from 'react-native-simple-toast' +import { useSafeAreaInsets } from 'react-native-safe-area-context' +import TouchableOpacityBox from '@components/TouchableOpacityBox' +import useLayoutHeight from '@hooks/useLayoutHeight' +import { ServiceSheetNavigationProp } from 'src/app/services/serviceSheetTypes' +import CircleLoader from '@components/CircleLoader' +import ScrollBox from '@components/ScrollBox' +import { AccountsServiceNavigationProp } from '../accountServiceTypes' + +const YourWalletsPage = () => { + const { t } = useTranslation() + const [addingSubAccount, setAddingSubAccount] = useState(false) + const [switchingAccounts, setSwitchingAccounts] = useState< + CSAccount | undefined + >() + const spacing = useSpacing() + const { setOnboardingData, onboardingData } = useOnboarding() + const colors = useColors() + const navigation = useNavigation< + AccountsServiceNavigationProp & ServiceSheetNavigationProp + >() + const { sortedAccounts, currentAccount, setCurrentAccount, accounts } = + useAccountStorage() + const { bottom } = useSafeAreaInsets() + const [footerHeight, setFooterHeight] = useLayoutHeight() + + const handleAddSub = useCallback( + async (acc: CSAccount) => { + setAddingSubAccount(true) + try { + if (!currentAccount) { + throw new Error('No current account') + } + const storage = await getSecureAccount(currentAccount.address) + const seed = bip39.mnemonicToSeedSync( + storage?.mnemonic?.join(' ') || '', + '', + ) + + if (!seed || !acc?.derivationPath) { + throw new Error('Missing seed or derivation path') + } + const currentPath = acc.derivationPath + const takenAddresses = new Set( + Object.values(accounts || {}).map((a) => a.solanaAddress), + ) + let currentAccountNum = + currentPath === HELIUM_DERIVATION + ? 0 + : Number(currentPath.split('/')[3].replace("'", '')) + 1 + let derivationPath = solanaDerivation(currentAccountNum, 0) + let keypair = await keypairFromSeed(seed, derivationPath) + while ( + currentAccountNum < 100 && + (!keypair || takenAddresses.has(keypair.publicKey.toBase58())) + ) { + currentAccountNum += 1 + derivationPath = solanaDerivation(currentAccountNum, 0) + keypair = await keypairFromSeed(seed, derivationPath) + } + if (currentAccountNum >= 100) { + throw new Error('More than 100 accounts are not supported') + } + if (keypair) { + const words = (await getSecureAccount(acc.address))?.mnemonic + setOnboardingData({ + ...onboardingData, + words, + paths: [ + { + derivationPath, + keypair, + }, + ], + }) + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + navigation.navigate('AccountAssignScreen', { + words, + }) + } + + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + } catch (e: any) { + Toast.show(e.message || e.toString()) + } finally { + setAddingSubAccount(false) + } + }, + [accounts, currentAccount, navigation, onboardingData, setOnboardingData], + ) + + const filteredAccounts = useMemo(() => { + const grouped = sortedAccounts + .filter((a) => a.netType !== NetTypes.TESTNET) + .reduce((acc, account) => { + acc[account.mnemonicHash || 'none'] = [ + ...(acc[account.mnemonicHash || 'none'] || []), + account, + ] + return acc + }, {} as { [key: string]: CSAccount[] }) + + const { none, ...rest } = grouped + const ret = Object.values(rest).map((accs, index) => ({ + title: `Seed Phrase ${index + 1}`, + data: accs, + })) + if (none) { + ret.push({ + title: 'Private Keys', + data: none, + }) + } + + return ret + }, [sortedAccounts]) + + const Header = useCallback(() => { + return ( + + + + {t('accountsService.title')} + + + ) + }, [t]) + + const keyExtractor = useCallback((item) => item.address, []) + + const handleAccountChange = useCallback( + (item: CSAccount) => () => { + setSwitchingAccounts(item) + }, + [setSwitchingAccounts], + ) + + useEffect(() => { + if (!switchingAccounts) return + + // Need to wait for a UI tick to allow the animation to finish + setTimeout(() => { + setCurrentAccount(switchingAccounts) + navigation.replace('WalletService') + }, 0) + }, [switchingAccounts, setCurrentAccount, navigation]) + + const renderItem = useCallback( + ({ + item, + index, + section, + }: { + // eslint-disable-next-line react/no-unused-prop-types + index: number + // eslint-disable-next-line react/no-unused-prop-types + item: CSAccount + // eslint-disable-next-line react/no-unused-prop-types + section: { + title: string + data: CSAccount[] + } + }) => { + const { data } = section + + const isSelected = item.address === currentAccount?.address + const showBottomBorder = + (data[index] && + data[index].mnemonicHash !== currentAccount?.mnemonicHash) || + section.title === 'Private Keys' + const isLast = index === data.length - 1 + const accountAddress = item?.solanaAddress + const borderTopStartRadius = index === 0 ? '2xl' : undefined + const borderTopEndRadius = index === 0 ? '2xl' : undefined + const borderBottomStartRadius = + index === data.length - 1 && showBottomBorder ? '2xl' : undefined + const borderBottomEndRadius = + index === data.length - 1 && showBottomBorder ? '2xl' : undefined + + return ( + + + + + {item.alias} + + + {ellipsizeAddress(accountAddress || '', { + numChars: 4, + })} + + + {isSelected && ( + + )} + + ) + }, + [currentAccount, handleAccountChange, colors], + ) + + const handleNetTypeChange = useCallback( + (nextNetType?: NetTypes.NetType) => { + setOnboardingData((prev) => { + let netType = nextNetType + if (netType === undefined) { + netType = + prev.netType === NetTypes.MAINNET + ? NetTypes.TESTNET + : NetTypes.MAINNET + } + return { ...prev, netType } + }) + }, + [setOnboardingData], + ) + + const handleAddNew = useCallback(() => { + handleNetTypeChange(NetTypes.MAINNET) + navigation.navigate('AddNewAccountNavigator') + }, [handleNetTypeChange, navigation]) + + const renderSectionHeader = useCallback( + ({ section: { title, data } }) => { + const firstSection = filteredAccounts[0].title === title + + return ( + + + {title} + + + ) + }, + [filteredAccounts, currentAccount], + ) + + const renderSectionFooter = useCallback( + ({ section: { data } }) => { + return ( + + ) + }, + [handleAddSub, currentAccount?.mnemonicHash], + ) + + const Footer = useCallback(() => { + return ( + + {/** TODO: Bring back when stickers page is added */} + {/* + + */} + + + + + + ) + }, [bottom, handleAddNew, setFooterHeight]) + + if (switchingAccounts || addingSubAccount) { + return ( + + + {addingSubAccount + ? t('accountsService.addingSubAccount') + : t('accountsService.switchingAccounts')} + + + {t('accountsService.pleaseBePatient')} + + + + + + ) + } + + return ( + + + + +