Skip to content

Commit

Permalink
Feat/ledger solana (#505)
Browse files Browse the repository at this point in the history
* Add ledger signing via provider and ledger modal

* Check balance when searching for ledger accounts

* Bump minor

* Bring back frozen lockfile

* Update locks

* Attempt to fix lock

* Fix first sign issue

* Fix Ledger Modal and important account

* Fix patches

* Fix lint errors

* Debugging

* Fix ledger claim/claimall

* Fix ledger bottom sheet not appearing on swaps and claim rewards

* Rebasing

* Revert react native and reanimated bumps

* Bring back noble patch

* Cast as message

* Remove noble curves patch

---------

Co-authored-by: Luis Perrone <[email protected]>
Co-authored-by: bry <[email protected]>
  • Loading branch information
3 people authored Oct 11, 2023
1 parent 74caf62 commit 04906ee
Show file tree
Hide file tree
Showing 121 changed files with 578,980 additions and 2,992 deletions.
16 changes: 11 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { AppRegistry } from 'react-native'
import { Provider as ReduxProvider } from 'react-redux'
import { PersistGate } from 'redux-persist/integration/react'
import { persistStore } from 'redux-persist'
import { ThemeProvider } from '@shopify/restyle'
import { darkThemeColors, theme } from './src/theme/theme'
import App from './src/App'
import { name as appName } from './app.json'
import './src/utils/i18n'
Expand All @@ -12,7 +14,6 @@ import AppStorageProvider from './src/storage/AppStorageProvider'
import LanguageProvider from './src/storage/LanguageProvider'
import NotificationStorageProvider from './src/storage/NotificationStorageProvider'
import store from './src/store/store'
import SolanaProvider from './src/solana/SolanaProvider'

// eslint-disable-next-line no-undef
if (__DEV__) {
Expand All @@ -27,13 +28,18 @@ const render = () => {
<PersistGate loading={null} persistor={persistor}>
<LanguageProvider>
<AppStorageProvider>
<AccountStorageProvider>
<SolanaProvider>
<ThemeProvider
theme={{
...theme,
colors: darkThemeColors,
}}
>
<AccountStorageProvider>
<NotificationStorageProvider>
<App />
</NotificationStorageProvider>
</SolanaProvider>
</AccountStorageProvider>
</AccountStorageProvider>
</ThemeProvider>
</AppStorageProvider>
</LanguageProvider>
</PersistGate>
Expand Down
20 changes: 15 additions & 5 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,14 @@ PODS:
- glog (0.3.5)
- helium-react-native-sdk (3.0.0):
- React-Core
- hermes-engine (0.71.5):
- hermes-engine/Pre-built (= 0.71.5)
- hermes-engine/Pre-built (0.71.5)
- hermes-engine (0.71.10):
- hermes-engine/Pre-built (= 0.71.10)
- hermes-engine/Pre-built (0.71.10)
- libevent (2.1.12)
- lottie-ios (4.3.0)
- lottie-react-native (6.3.1):
- lottie-ios (~> 4.3.0)
- React-Core
- MapboxCommon (23.5.0)
- MapboxCoreMaps (10.13.1):
- MapboxCommon (~> 23.5)
Expand Down Expand Up @@ -578,6 +582,7 @@ DEPENDENCIES:
- "helium-react-native-sdk (from `../node_modules/@helium/react-native-sdk`)"
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
- libevent (~> 2.1.12)
- lottie-react-native (from `../node_modules/lottie-react-native`)
- OneSignalXCFramework (< 4.0, >= 3.0)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
Expand Down Expand Up @@ -652,6 +657,7 @@ SPEC REPOS:
- Charts
- fmt
- libevent
- lottie-ios
- MapboxCommon
- MapboxCoreMaps
- MapboxMaps
Expand Down Expand Up @@ -713,6 +719,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/@helium/react-native-sdk"
hermes-engine:
:podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
lottie-react-native:
:path: "../node_modules/lottie-react-native"
RCT-Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTRequired:
Expand Down Expand Up @@ -868,8 +876,10 @@ SPEC CHECKSUMS:
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 791fe035093b84822da7f0870421a25839ca7870
helium-react-native-sdk: 17b612b2dacebc8f10c18ba5611f200a81c940f9
hermes-engine: 7a53ccac09146018a08239c5425625fdb79a6162
hermes-engine: cdb8de7594393b62aaf9eba1877a78afeecac080
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
lottie-ios: c69214a487e1a1465a231c1918c6ce174e2d45bc
lottie-react-native: c9f1db4f4124dcce9f8159e65d8dc6e8bcb11fb4
MapboxCommon: fdf7fd31c90b7b607cd9c63e37797f023c01d860
MapboxCoreMaps: 24270c7c6b8cb71819fc2f3c549db9620ee4d019
MapboxMaps: cb76511b98d3b95c74b0771ed105bc69f30ace6b
Expand Down Expand Up @@ -947,4 +957,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 5b4d3c6d9c5a303c84f0b5427958ba4a25671e76

COCOAPODS: 1.11.3
COCOAPODS: 1.12.1
34 changes: 18 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"dependencies": {
"@babel/preset-typescript": "7.21.0",
"@bonfida/spl-name-service": "^1.1.1",
"@coral-xyz/anchor": "0.26.0",
"@coral-xyz/anchor": "0.28.0",
"@gorhom/bottom-sheet": "4.4.6",
"@gorhom/portal": "1.0.14",
"@helium/account-fetch-cache": "^0.3.2",
Expand All @@ -58,18 +58,19 @@
"@helium/onboarding": "4.9.0",
"@helium/proto-ble": "4.0.0",
"@helium/react-native-sdk": "^3.0.0",
"@helium/spl-utils": "^0.3.2",
"@helium/spl-utils": "^0.4.1-next.0",
"@helium/transactions": "4.8.1",
"@helium/treasury-management-sdk": "0.1.2",
"@helium/voter-stake-registry-sdk": "0.1.2",
"@helium/wallet-link": "4.10.0",
"@ledgerhq/hw-app-helium": "6.29.1",
"@ledgerhq/react-native-hid": "6.28.4",
"@ledgerhq/react-native-hw-transport-ble": "6.27.2",
"@ledgerhq/hw-app-solana": "7.0.13",
"@ledgerhq/react-native-hid": "6.30.0",
"@ledgerhq/react-native-hw-transport-ble": "6.29.5",
"@ledgerhq/types-devices": "^6.22.4",
"@metaplex-foundation/js": "0.17.6",
"@metaplex-foundation/mpl-bubblegum": "0.6.0",
"@onsol/tldparser": "^0.5.3",
"@pythnetwork/client": "^2.17.0",
"@pythnetwork/client": "2.17.0",
"@react-native-async-storage/async-storage": "1.18.1",
"@react-native-community/blur": "4.3.0",
"@react-native-community/checkbox": "0.5.15",
Expand All @@ -82,19 +83,19 @@
"@react-navigation/native-stack": "6.7.0",
"@react-navigation/stack": "6.2.2",
"@reduxjs/toolkit": "1.9.1",
"@rnmapbox/maps": "^10.0.7-rc.0",
"@rnmapbox/maps": "10.0.7-rc.0",
"@shopify/restyle": "1.8.0",
"@solana/spl-account-compression": "0.1.4",
"@solana/spl-memo": "^0.2.3",
"@solana/spl-memo": "0.2.3",
"@solana/spl-token": "0.3.6",
"@solana/spl-token-registry": "^0.2.4574",
"@solana/wallet-adapter-react": "^0.15.33",
"@solana/spl-token-registry": "0.2.4574",
"@solana/wallet-adapter-react": "0.15.33",
"@solana/wallet-standard-features": "1.0.0",
"@solana/web3.js": "1.64.0",
"@tradle/react-native-http": "2.0.1",
"@turf/bbox": "^6.5.0",
"@turf/center": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/bbox": "6.5.0",
"@turf/center": "6.5.0",
"@turf/helpers": "6.5.0",
"@walletconnect/react-native-compat": "2.2.1",
"@walletconnect/sign-client": "2.2.1",
"@walletconnect/types": "2.2.1",
Expand Down Expand Up @@ -129,11 +130,12 @@
"expo-secure-store": "12.1.1",
"expo-splash-screen": "0.18.2",
"fuse.js": "6.6.2",
"h3-js": "^4.1.0",
"h3-js": "4.1.0",
"https-browserify": "0.0.1",
"i18next": "21.9.1",
"lodash": "4.17.21",
"long": "5.2.0",
"lottie-react-native": "^6.3.1",
"parse5": "6.0.1",
"patch-package": "6.4.7",
"path-browserify": "0.0.0",
Expand Down Expand Up @@ -161,7 +163,7 @@
"react-native-level-fs": "3.0.1",
"react-native-linear-gradient": "2.6.2",
"react-native-localize": "2.2.3",
"react-native-mail": "^6.1.1",
"react-native-mail": "6.1.1",
"react-native-navigation-bar-color": "2.0.1",
"react-native-network-info": "5.2.1",
"react-native-onesignal": "4.4.1",
Expand All @@ -181,7 +183,7 @@
"react-native-svg": "13.4.0",
"react-native-tab-view": "3.3.4",
"react-native-tcp": "3.3.2",
"react-native-test-flight": "^1.1.0",
"react-native-test-flight": "1.1.0",
"react-native-text-ticker": "1.14.0",
"react-native-udp": "2.7.0",
"react-native-video": "5.2.1",
Expand Down
15 changes: 0 additions & 15 deletions patches/@ledgerhq/hw-transport-mocker+6.27.2.patch

This file was deleted.

57 changes: 0 additions & 57 deletions patches/@noble+curves+1.0.0.patch

This file was deleted.

93 changes: 45 additions & 48 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet'
import { PortalHost, PortalProvider } from '@gorhom/portal'
import { AccountContext } from '@helium/account-fetch-cache-hooks'
import { OnboardingProvider as HotspotOnboardingProvider } from '@helium/react-native-sdk'
import { DarkTheme, NavigationContainer } from '@react-navigation/native'
import MapboxGL from '@rnmapbox/maps'
Expand Down Expand Up @@ -28,7 +27,7 @@ import useMount from './hooks/useMount'
import { navigationRef } from './navigation/NavigationHelper'
import RootNavigator from './navigation/RootNavigator'
import './polyfill'
import { useSolana } from './solana/SolanaProvider'
import SolanaProvider from './solana/SolanaProvider'
import WalletSignProvider from './solana/WalletSignProvider'
import { useAccountStorage } from './storage/AccountStorageProvider'
import { useNotificationStorage } from './storage/NotificationStorageProvider'
Expand Down Expand Up @@ -58,7 +57,7 @@ const App = () => {

const { appState } = useAppState()
const { restored: accountsRestored } = useAccountStorage()
const { cache } = useSolana()
// const { cache } = useSolana()
const { setOpenedNotification } = useNotificationStorage()

const linking = useDeepLinking()
Expand Down Expand Up @@ -110,53 +109,51 @@ const App = () => {
<GestureHandlerRootView style={globalStyles.container}>
<SafeAreaProvider>
<ThemeProvider theme={colorAdaptedTheme}>
<SplashScreen>
<PortalProvider>
<BottomSheetModalProvider>
<PortalHost name="browser-portal" />
<WalletOnboardingProvider baseUrl={Config.ONBOARDING_API_URL}>
<WalletConnectProvider>
<HotspotOnboardingProvider
baseUrl={Config.ONBOARDING_API_URL}
>
{cache && (
<PortalProvider>
<BottomSheetModalProvider>
<PortalHost name="browser-portal" />
<SolanaProvider>
<SplashScreen>
<WalletOnboardingProvider baseUrl={Config.ONBOARDING_API_URL}>
<WalletConnectProvider>
<HotspotOnboardingProvider
baseUrl={Config.ONBOARDING_API_URL}
>
<LockScreen>
<AccountContext.Provider value={cache}>
{accountsRestored && (
<>
<NavigationContainer
theme={navTheme}
linking={linking}
ref={navigationRef}
>
<BalanceProvider>
<TokenListProvider>
<TokensProvider>
<WalletSignProvider>
<NetworkAwareStatusBar />
<RootNavigator />
</WalletSignProvider>
</TokensProvider>
</TokenListProvider>
</BalanceProvider>
</NavigationContainer>
<SecurityScreen
visible={
appState !== 'active' &&
appState !== 'unknown'
}
/>
</>
)}
</AccountContext.Provider>
{accountsRestored && (
<>
<NavigationContainer
theme={navTheme}
linking={linking}
ref={navigationRef}
>
<BalanceProvider>
<TokenListProvider>
<TokensProvider>
<WalletSignProvider>
<NetworkAwareStatusBar />
<RootNavigator />
</WalletSignProvider>
</TokensProvider>
</TokenListProvider>
</BalanceProvider>
</NavigationContainer>
<SecurityScreen
visible={
appState !== 'active' &&
appState !== 'unknown'
}
/>
</>
)}
</LockScreen>
)}
</HotspotOnboardingProvider>
</WalletConnectProvider>
</WalletOnboardingProvider>
</BottomSheetModalProvider>
</PortalProvider>
</SplashScreen>
</HotspotOnboardingProvider>
</WalletConnectProvider>
</WalletOnboardingProvider>
</SplashScreen>
</SolanaProvider>
</BottomSheetModalProvider>
</PortalProvider>
</ThemeProvider>
</SafeAreaProvider>
</GestureHandlerRootView>
Expand Down
Loading

0 comments on commit 04906ee

Please sign in to comment.