diff --git a/CHANGELOG.md b/CHANGELOG.md index 32e1140fc00..cd6353bcb29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,34 @@ ## Unreleased -## 4.16.0 +## 4.17.0 + +- added: Add TON +- added: Log swap errors to Sentry. +- added: Tracking for unexpected fiat provider errors. +- added: Add TON support to Banxa, Moonpay, Paybis, and Simplex fiat plugins +- added: Add OSMO support to Moonpay fiat plugin +- added: New post-install survey option for "BTCTKVR Magazine". +- changed: `FiatProviderError` messages now include `FiatProviderQuoteError` info. +- changed: Add explicit gas limit for Kiln staking. +- changed: Various strings updated to UK compliance spec +- changed: Track array of errors or AggregateErrors separately with a common tag +- changed: Use stack-specific scene navigation props instead of `NavigationProp` +- changed: Verbiage for login request scene for QR login has been updated to remove ambiguity. +- changed: Wording in light account persistent notification +- changed: (Android) Allow exporting multiple files +- fixed: Correctly report ETH Kiln balances +- fixed: Fix error massaging in trackError +- fixed: Normalized error messages for tracking; removing localization from error messages. +- fixed: Remove Kado deposit details for "Sell" orders. +- fixed: Sentry tagging and metadata data wasn't formed properly and caused some loss of tracked errors. +- fixed: Use Sentry context for logging metadata in `EdgeCrashEvent` +- removed: Bank Wire Transfer Buy for Florida +- removed: Paypal Sell for Canada +- removed: Moonpay, Simplex, and Paybis for UK +- removed: UK persistent investment risk banner + +## 4.16.0 (2024-10-30) - added: "Transaction Details" button to `SwapSuccessScene` - added: `WalletRestoreScene` @@ -10,9 +37,7 @@ - added: "Go to Parent Wallet" `WalletListMenuModal` option - added: Earn Scene - added: Include wallet creation date in wallet data in log output -- changed: Add explicit gas limit for Kiln staking. - changed: Allow 0 amount entry in `SpendingLimitsScene` -- changed: Various strings updated to UK compliance spec - changed: Wording on `SwapSuccessScene` - changed: `SettingsScene` disables "Restore Wallets" option if there are no wallets to restore - changed: FIO Home Scene tile replaced with Earn @@ -24,16 +49,11 @@ - changed: Navigate to wallet list after restoring wallets - changed: Update `NotificationCard` to UI4 styling - changed: Remove legacy non-segwit wallets from new account wallet selection scene -- fixed: Correctly report ETH Kiln balances - fixed: Deeplinking to `SendScene` may not retain memo information in the resulting broadcast - fixed: Use account default fiat for transaction fee display in `SweepPrivateKeyCalculateFeeScene` - fixed: Crash when archiving a wallet that recently accessed the trade modal - fixed: ACH sell option for Florida visible with no accepted currencies - fixed: Slow `TransactionDetailsScene` navigation on slow networks -- removed: Moonpay, Simplex, and Paybis for UK -- removed: UK persistent investment risk banner -- removed: Bank Wire Transfer Buy for Florida -- removed: Paypal Sell for Canada ## 4.15.1 (2024-10-18) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e3dbacc24b8..756d0c61c7c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -15,15 +15,15 @@ PODS: - disklet (0.5.2): - React - DoubleConversion (1.1.6) - - edge-core-js (2.19.1): + - edge-core-js (2.20.1): - React-Core - - edge-currency-accountbased (4.26.2): + - edge-currency-accountbased (4.27.1): - React-Core - - edge-currency-plugins (3.4.3): + - edge-currency-plugins (3.4.4): - React-Core - - edge-exchange-plugins (2.12.0): + - edge-exchange-plugins (2.13.0): - React-Core - - edge-login-ui-rn (3.22.5): + - edge-login-ui-rn (3.23.0): - React-Core - EXApplication (5.1.1): - ExpoModulesCore @@ -430,7 +430,7 @@ PODS: - react-native-webview (13.8.4): - RCT-Folly (= 2021.07.22.00) - React-Core - - react-native-zcash (0.9.1): + - react-native-zcash (0.9.2): - gRPC-Swift (~> 1.8) - MnemonicSwift (~> 2.2) - React-Core @@ -1080,11 +1080,11 @@ SPEC CHECKSUMS: CNIOWindows: 3047f2d8165848a3936a0a755fee27c6b5ee479b disklet: e7ed3e673ccad9d175a1675f9f3589ffbf69a5fd DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 - edge-core-js: 09206fe34acb8f4eebafe61e8c2eda6cbe81ba69 - edge-currency-accountbased: d4ac6411e4d3070606a3d07e0aacfd1e87220030 - edge-currency-plugins: 38eaf53c2d9fdbdd30ade3ad09fd698f428f208f - edge-exchange-plugins: 5037e196e652d1dca42afacd86b2395bd0d7f298 - edge-login-ui-rn: 33f78f4089a63314ca3d652b0ed235f1e1a1bd4c + edge-core-js: 9264309f29f398da3b714dc5e80702f102f9db2d + edge-currency-accountbased: 3ed33409d304a969392c9e205d115521aab49b8a + edge-currency-plugins: 95577a282061148263207fad9befe11bb07a57c1 + edge-exchange-plugins: 896eb55d2a03140bae7b45321efa9e9ac3d3bbe6 + edge-login-ui-rn: 58ee453724222a7feac090500587db8cbf2dd083 EXApplication: d8f53a7eee90a870a75656280e8d4b85726ea903 EXConstants: f348da07e21b23d2b085e270d7b74f282df1a7d9 EXFileSystem: 844e86ca9b5375486ecc4ef06d3838d5597d895d @@ -1141,7 +1141,7 @@ SPEC CHECKSUMS: react-native-safari-view: 955d7160d159241b8e9395d12d10ea0ef863dcdd react-native-safe-area-context: dcab599c527c2d7de2d76507a523d20a0b83823d react-native-webview: fa228e55c53372c2b361d2fa5e415844fa83eabf - react-native-zcash: c6f228ef34d408d14f38fbd2cf008b9d09b80a78 + react-native-zcash: 8d6da0be327896cd68c623e4d261aab0e497276e React-perflogger: 0cc42978a483a47f3696171dac2e7033936fc82d React-RCTActionSheet: ea922b476d24f6d40b8e02ac3228412bd3637468 React-RCTAnimation: 7be2c148398eaa5beac950b2b5ec7102389ec3ad diff --git a/package.json b/package.json index ce39248a265..31576a44ec3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "edge-react-gui", - "version": "4.16.0", + "version": "4.17.0", "private": true, "description": "Edge Wallet React GUI", "homepage": "https://edge.app", @@ -97,13 +97,13 @@ "deepmerge": "^4.3.1", "detect-bundler": "^1.1.0", "disklet": "^0.5.2", - "edge-core-js": "^2.19.1", - "edge-currency-accountbased": "^4.26.2", + "edge-core-js": "^2.20.1", + "edge-currency-accountbased": "^4.27.1", "edge-currency-monero": "^1.3.1", - "edge-currency-plugins": "^3.4.3", - "edge-exchange-plugins": "^2.12.0", + "edge-currency-plugins": "^3.4.4", + "edge-exchange-plugins": "^2.13.0", "edge-info-server": "^3.0.1", - "edge-login-ui-rn": "^3.22.5", + "edge-login-ui-rn": "^3.23.0", "ethers": "^5.7.2", "expo": "^48.0.0", "jsrsasign": "^11.1.0", @@ -141,7 +141,7 @@ "react-native-mymonero-core": "^0.3.1", "react-native-patina": "^0.1.6", "react-native-permissions": "^4.1.5", - "react-native-piratechain": "^0.5.3", + "react-native-piratechain": "^0.5.4", "react-native-power-saving-mode": "^0.1.1", "react-native-reanimated": "^3.14.0", "react-native-safari-view": "^2.1.0", @@ -156,7 +156,7 @@ "react-native-vector-icons": "^10.1.0", "react-native-webview": "^13.8.4", "react-native-wheel-picker-android": "^2.0.6", - "react-native-zcash": "^0.9.1", + "react-native-zcash": "^0.9.2", "react-redux": "^8.1.1", "redux": "^4.2.1", "redux-thunk": "^2.3.0", diff --git a/scripts/makeNativeHeaders.ts b/scripts/makeNativeHeaders.ts index cbdb35277b8..b60653f9ea0 100644 --- a/scripts/makeNativeHeaders.ts +++ b/scripts/makeNativeHeaders.ts @@ -7,7 +7,7 @@ function makeNativeHeaders() { // Grab the API key: let apiKey = 'Error: Set up env.json & re-run scripts/makeNativeHeaders.js' try { - apiKey = require('../env.json').AIRBITZ_API_KEY + apiKey = require('../env.json').EDGE_API_KEY } catch (e) { console.log(apiKey) } diff --git a/src/__tests__/components/TransactionListTop.test.tsx b/src/__tests__/components/TransactionListTop.test.tsx index 2168d8f91f8..08cfdb34f6c 100644 --- a/src/__tests__/components/TransactionListTop.test.tsx +++ b/src/__tests__/components/TransactionListTop.test.tsx @@ -6,7 +6,7 @@ import TestRenderer from 'react-test-renderer' import { TransactionListTop } from '../../components/themed/TransactionListTop' import { ENV } from '../../env' import { FakeProviders, FakeState } from '../../util/fake/FakeProviders' -import { fakeNavigation } from '../../util/fake/fakeSceneProps' +import { fakeCompositeNavigation } from '../../util/fake/fakeSceneProps' describe('TransactionListTop', () => { const currencyInfo: EdgeCurrencyInfo = { @@ -66,7 +66,7 @@ describe('TransactionListTop', () => { { { it('should render with loading props', () => { @@ -14,7 +14,7 @@ describe('ChangePasswordScene', () => { const actual = renderer.render( - + ) diff --git a/src/__tests__/scenes/ChangePinScene.test.tsx b/src/__tests__/scenes/ChangePinScene.test.tsx index a79235f4882..cfeeed5969f 100644 --- a/src/__tests__/scenes/ChangePinScene.test.tsx +++ b/src/__tests__/scenes/ChangePinScene.test.tsx @@ -5,7 +5,7 @@ import { createRenderer } from 'react-test-renderer/shallow' import { ChangePinScene } from '../../components/scenes/ChangePinScene' import { FakeProviders, FakeState } from '../../util/fake/FakeProviders' import { fakeRootState } from '../../util/fake/fakeRootState' -import { fakeSceneProps } from '../../util/fake/fakeSceneProps' +import { fakeEdgeAppSceneProps } from '../../util/fake/fakeSceneProps' describe('ChangePinComponent', () => { it('should render with loading props', () => { @@ -14,7 +14,7 @@ describe('ChangePinComponent', () => { const actual = renderer.render( - + ) diff --git a/src/__tests__/scenes/CreateWalletAccountSetupScene.test.tsx b/src/__tests__/scenes/CreateWalletAccountSetupScene.test.tsx index bbf6f6b93a4..25bd162b09d 100644 --- a/src/__tests__/scenes/CreateWalletAccountSetupScene.test.tsx +++ b/src/__tests__/scenes/CreateWalletAccountSetupScene.test.tsx @@ -5,7 +5,7 @@ import TestRenderer from 'react-test-renderer' import { CreateWalletAccountSetupScene } from '../../components/scenes/CreateWalletAccountSetupScene' import { btcCurrencyInfo } from '../../util/fake/fakeBtcInfo' import { FakeProviders, FakeState } from '../../util/fake/FakeProviders' -import { fakeSceneProps } from '../../util/fake/fakeSceneProps' +import { fakeEdgeAppSceneProps } from '../../util/fake/fakeSceneProps' describe('CreateWalletAccountSelect', () => { it('renders', () => { @@ -26,7 +26,7 @@ describe('CreateWalletAccountSelect', () => { const renderer = TestRenderer.create( { const mockState: FakeState = { @@ -54,7 +54,7 @@ describe('CreateWalletEditNameComponent', () => { const renderer = TestRenderer.create( { const KeyboardAwareScrollView = (blob: { children: React.ReactNode }) => blob.children @@ -33,7 +33,7 @@ describe('CreateWalletImportScene', () => { const renderer = TestRenderer.create( { const mockState: FakeState = { @@ -88,7 +88,7 @@ describe('CreateWalletSelectCrypto', () => { it('should render with loading props', () => { const renderer = TestRenderer.create( - + ) diff --git a/src/__tests__/scenes/CurrencyNotificationScene.test.tsx b/src/__tests__/scenes/CurrencyNotificationScene.test.tsx index 472cb4cd944..318a5eb4629 100644 --- a/src/__tests__/scenes/CurrencyNotificationScene.test.tsx +++ b/src/__tests__/scenes/CurrencyNotificationScene.test.tsx @@ -4,7 +4,7 @@ import TestRenderer from 'react-test-renderer' import { CurrencyNotificationScene } from '../../components/scenes/CurrencyNotificationScene' import { FakeProviders, FakeState } from '../../util/fake/FakeProviders' -import { fakeSceneProps } from '../../util/fake/fakeSceneProps' +import { fakeEdgeAppSceneProps } from '../../util/fake/fakeSceneProps' describe('CurrencyNotificationComponent', () => { const mockStore: FakeState = { @@ -24,7 +24,7 @@ describe('CurrencyNotificationComponent', () => { const renderer = TestRenderer.create( { it('should render', () => { @@ -37,7 +37,7 @@ describe('CurrencySettings', () => { const renderer = TestRenderer.create( diff --git a/src/__tests__/scenes/DefaultFiatSettingScene.test.tsx b/src/__tests__/scenes/DefaultFiatSettingScene.test.tsx index 0a4f69d2704..116f39808e4 100644 --- a/src/__tests__/scenes/DefaultFiatSettingScene.test.tsx +++ b/src/__tests__/scenes/DefaultFiatSettingScene.test.tsx @@ -4,7 +4,7 @@ import { createRenderer } from 'react-test-renderer/shallow' import { DefaultFiatSettingComponent } from '../../components/scenes/DefaultFiatSettingScene' import { getTheme } from '../../components/services/ThemeContext' -import { fakeSceneProps } from '../../util/fake/fakeSceneProps' +import { fakeEdgeAppSceneProps } from '../../util/fake/fakeSceneProps' describe('DefaultFiatSettingComponent', () => { it('should render with loading props', () => { @@ -12,7 +12,7 @@ describe('DefaultFiatSettingComponent', () => { const actual = renderer.render( { const renderer = TestRenderer.create( diff --git a/src/__tests__/scenes/FioAddressDetailsScene.test.tsx b/src/__tests__/scenes/FioAddressDetailsScene.test.tsx index 115fe12efdc..7411bd721de 100644 --- a/src/__tests__/scenes/FioAddressDetailsScene.test.tsx +++ b/src/__tests__/scenes/FioAddressDetailsScene.test.tsx @@ -4,7 +4,7 @@ import { createRenderer } from 'react-test-renderer/shallow' import { FioAddressDetails } from '../../components/scenes/Fio/FioAddressDetailsScene' import { getTheme } from '../../components/services/ThemeContext' -import { fakeSceneProps } from '../../util/fake/fakeSceneProps' +import { fakeEdgeAppSceneProps } from '../../util/fake/fakeSceneProps' describe('FioAddressDetails', () => { it('should render with loading props', () => { @@ -24,7 +24,7 @@ describe('FioAddressDetails', () => { const actual = renderer.render( { it('should render with loading props', () => { @@ -23,7 +23,7 @@ describe('FioAddressList', () => { const actual = renderer.render( { it('should render with loading props', () => { @@ -23,7 +23,7 @@ describe('FioAddressRegister', () => { const actual = renderer.render( { it('should render with loading props', () => { @@ -12,7 +12,7 @@ describe('FioAddressRegistered', () => { const actual = renderer.render( { it('should render with loading props', () => { @@ -12,7 +12,7 @@ describe('FioAddressRegistered', () => { const actual = renderer.render( { it('should render with loading props', () => { @@ -24,7 +24,7 @@ describe('FioAddressSettingsComponent', () => { const actual = renderer.render( { it('should render with loading props', () => { @@ -24,7 +24,7 @@ describe('FioConnectWalletConfirm', () => { const actual = renderer.render( { it('should render with loading props', () => { @@ -20,7 +20,7 @@ describe('FioDomainRegister', () => { const actual = renderer.render( { it('should render with loading props', () => { @@ -12,7 +12,7 @@ describe('Request', () => { const actual = renderer.render( { const actual = renderer.render( { const actual = renderer.render( { const renderer = TestRenderer.create( { const renderer = TestRenderer.create( { const renderer = TestRenderer.create( { const renderer = TestRenderer.create( { // Hide Address const renderer = TestRenderer.create( - + ) expect(renderer.toJSON()).toMatchSnapshot() @@ -209,7 +209,7 @@ describe('SendScene2', () => { params.hiddenFeaturesMap = { amount: true } const renderer2 = TestRenderer.create( - + ) expect(renderer2.toJSON()).toMatchSnapshot() @@ -218,7 +218,7 @@ describe('SendScene2', () => { params.hiddenFeaturesMap = { amount: true, address: true } const renderer3 = TestRenderer.create( - + ) expect(renderer3.toJSON()).toMatchSnapshot() @@ -245,7 +245,7 @@ describe('SendScene2', () => { // Lock Address const renderer = TestRenderer.create( - + ) expect(renderer.toJSON()).toMatchSnapshot() @@ -254,7 +254,7 @@ describe('SendScene2', () => { params.lockTilesMap = { amount: true } const renderer2 = TestRenderer.create( - + ) expect(renderer2.toJSON()).toMatchSnapshot() @@ -263,7 +263,7 @@ describe('SendScene2', () => { params.lockTilesMap = { amount: true, address: true } const renderer3 = TestRenderer.create( - + ) expect(renderer3.toJSON()).toMatchSnapshot() diff --git a/src/__tests__/scenes/SettingsScene.test.tsx b/src/__tests__/scenes/SettingsScene.test.tsx index b12980f456c..dfb33f32fa2 100644 --- a/src/__tests__/scenes/SettingsScene.test.tsx +++ b/src/__tests__/scenes/SettingsScene.test.tsx @@ -4,7 +4,7 @@ import TestRenderer from 'react-test-renderer' import { SettingsScene } from '../../components/scenes/SettingsScene' import { FakeProviders, FakeState } from '../../util/fake/FakeProviders' -import { fakeSceneProps } from '../../util/fake/fakeSceneProps' +import { fakeEdgeAppSceneProps } from '../../util/fake/fakeSceneProps' describe('SettingsScene', () => { const mockState: FakeState = { @@ -25,7 +25,7 @@ describe('SettingsScene', () => { it('should render SettingsScene', () => { const renderer = TestRenderer.create( - + ) diff --git a/src/__tests__/scenes/SwapConfirmationScene.test.tsx b/src/__tests__/scenes/SwapConfirmationScene.test.tsx index 3da8c014c26..4bd64124584 100644 --- a/src/__tests__/scenes/SwapConfirmationScene.test.tsx +++ b/src/__tests__/scenes/SwapConfirmationScene.test.tsx @@ -20,7 +20,7 @@ import { makeFakePlugin } from '../../util/fake/fakeCurrencyPlugin' import { ethCurrencyInfo } from '../../util/fake/fakeEthInfo' import { FakeProviders, FakeState } from '../../util/fake/FakeProviders' import { fakeRootState } from '../../util/fake/fakeRootState' -import { fakeSceneProps } from '../../util/fake/fakeSceneProps' +import { fakeSwapTabSceneProps } from '../../util/fake/fakeSceneProps' import fakeUser from '../../util/fake/fakeUserDump.json' jest.useRealTimers() @@ -134,7 +134,7 @@ describe('SwapConfirmationScene', () => { const renderer = TestRenderer.create( undefined diff --git a/src/__tests__/scenes/SwapCreateScene.test.tsx b/src/__tests__/scenes/SwapCreateScene.test.tsx index 3981c385f7b..e07e4693e64 100644 --- a/src/__tests__/scenes/SwapCreateScene.test.tsx +++ b/src/__tests__/scenes/SwapCreateScene.test.tsx @@ -5,7 +5,7 @@ import TestRenderer from 'react-test-renderer' import { SwapCreateScene } from '../../components/scenes/SwapCreateScene' import { FakeProviders, FakeState } from '../../util/fake/FakeProviders' import { fakeRootState } from '../../util/fake/fakeRootState' -import { fakeSceneProps } from '../../util/fake/fakeSceneProps' +import { fakeSwapTabSceneProps } from '../../util/fake/fakeSceneProps' describe('SwapCreateScene', () => { it('should render with loading props', () => { @@ -13,7 +13,7 @@ describe('SwapCreateScene', () => { const renderer = TestRenderer.create( - + ) diff --git a/src/__tests__/scenes/SwapSuccessScene.test.tsx b/src/__tests__/scenes/SwapSuccessScene.test.tsx index 5a6368f093a..19f42ddb85e 100644 --- a/src/__tests__/scenes/SwapSuccessScene.test.tsx +++ b/src/__tests__/scenes/SwapSuccessScene.test.tsx @@ -5,7 +5,7 @@ import TestRenderer from 'react-test-renderer' import { SwapSuccessScene } from '../../components/scenes/SwapSuccessScene' import { FakeProviders, FakeState } from '../../util/fake/FakeProviders' -import { fakeSceneProps } from '../../util/fake/fakeSceneProps' +import { fakeEdgeAppSceneProps } from '../../util/fake/fakeSceneProps' const currencyInfo: EdgeCurrencyInfo = { pluginId: 'bitcoin', @@ -63,7 +63,7 @@ describe('SwapSuccessSceneComponent', () => { const renderer = TestRenderer.create( { const renderer = TestRenderer.create( { const renderer = TestRenderer.create( - This application would like to create or access its wallet in your Edge account. + You have scanned a QR code to login to your account from another device. Accepting this login will grant full access to your account and funds on that other device. - It will not have access to any other wallets. +DO NOT accept this login unless you trust the application and person who provided the QR code diff --git a/src/__tests__/scenes/__snapshots__/FioAddressDetailsScene.test.tsx.snap b/src/__tests__/scenes/__snapshots__/FioAddressDetailsScene.test.tsx.snap index e5d80f98812..ab5b7ea1e45 100644 --- a/src/__tests__/scenes/__snapshots__/FioAddressDetailsScene.test.tsx.snap +++ b/src/__tests__/scenes/__snapshots__/FioAddressDetailsScene.test.tsx.snap @@ -52,23 +52,12 @@ exports[`FioAddressDetails should render with loading props 1`] = ` fioWallet={null} navigation={ { - "addListener": [Function], - "canGoBack": [Function], - "dispatch": [Function], - "getId": [Function], - "getParent": [Function], - "getState": [Function], - "goBack": [Function], - "isFocused": [Function], - "navigate": [Function], - "pop": [Function], - "popToTop": [Function], - "push": [Function], - "removeListener": [Function], - "replace": [Function], - "reset": [Function], - "setOptions": [Function], - "setParams": [Function], + "addListener": [MockFunction], + "goBack": [MockFunction], + "navigate": [MockFunction], + "pop": [MockFunction], + "push": [MockFunction], + "replace": [MockFunction], } } /> diff --git a/src/__tests__/scenes/__snapshots__/SwapSuccessScene.test.tsx.snap b/src/__tests__/scenes/__snapshots__/SwapSuccessScene.test.tsx.snap index 29da9d903b8..7f52bdba8e7 100644 --- a/src/__tests__/scenes/__snapshots__/SwapSuccessScene.test.tsx.snap +++ b/src/__tests__/scenes/__snapshots__/SwapSuccessScene.test.tsx.snap @@ -511,7 +511,7 @@ exports[`SwapSuccessSceneComponent should render with loading props 1`] = ` } type="warning" > - Guest Account + Create Username & Password - Tap to create a username and password + Funds will be lost if your device is lost or Edge is uninstalled. diff --git a/src/actions/LoginActions.tsx b/src/actions/LoginActions.tsx index 6c9d33b274b..a75b475e12e 100644 --- a/src/actions/LoginActions.tsx +++ b/src/actions/LoginActions.tsx @@ -18,7 +18,7 @@ import { AccountInitPayload, initialState } from '../reducers/scenes/SettingsRed import { WalletCreateItem } from '../selectors/getCreateWalletList' import { config } from '../theme/appConfig' import { Dispatch, ThunkAction } from '../types/reduxTypes' -import { NavigationBase, NavigationProp } from '../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../types/routerTypes' import { currencyCodesToEdgeAssets } from '../util/CurrencyInfoHelpers' import { logActivity } from '../util/logger' import { logEvent, trackError } from '../util/tracking' @@ -86,7 +86,7 @@ export function initializeAccount(navigation: NavigationBase, account: EdgeAccou await readLocalAccountSettings(account) const newAccountFlow = async ( - navigation: NavigationProp<'createWalletSelectCrypto' | 'createWalletSelectCryptoNewAccount'>, + navigation: EdgeAppSceneProps<'createWalletSelectCrypto' | 'createWalletSelectCryptoNewAccount'>['navigation'], items: WalletCreateItem[] ) => { navigation.replace('edgeTabs', { screen: 'home' }) @@ -110,7 +110,11 @@ export function initializeAccount(navigation: NavigationBase, account: EdgeAccou screen: 'edgeAppStack', params: { screen: 'createWalletSelectCryptoNewAccount', - params: { newAccountFlow, defaultSelection, disableLegacy: true } + params: { + newAccountFlow, + defaultSelection, + disableLegacy: true + } } }) diff --git a/src/actions/NotificationActions.ts b/src/actions/NotificationActions.ts index 5c72ac2644c..1131a1bb692 100644 --- a/src/actions/NotificationActions.ts +++ b/src/actions/NotificationActions.ts @@ -46,7 +46,7 @@ export function registerNotificationsV2(changeFiat: boolean = false): ThunkActio .catch(() => '') const body = { - apiKey: ENV.AIRBITZ_API_KEY, + apiKey: ENV.EDGE_API_KEY, deviceId: state.core.context.clientId, deviceToken, loginId: base64.stringify(base58.parse(state.core.account.rootLoginId)) @@ -193,7 +193,7 @@ async function updateServerSettings(context: EdgeContext, data: DeviceUpdatePayl .catch(() => '') const body = { - apiKey: ENV.AIRBITZ_API_KEY, + apiKey: ENV.EDGE_API_KEY, deviceId, deviceToken, data: { ...data, loginIds } @@ -279,7 +279,7 @@ async function legacyGet(path: string) { method: 'GET', headers: { 'Content-Type': 'application/json', - 'X-Api-Key': ENV.AIRBITZ_API_KEY + 'X-Api-Key': ENV.EDGE_API_KEY } }) if (response != null && response.ok) { diff --git a/src/actions/WalletListMenuActions.tsx b/src/actions/WalletListMenuActions.tsx index 9d98d2e3579..11b91af3bc0 100644 --- a/src/actions/WalletListMenuActions.tsx +++ b/src/actions/WalletListMenuActions.tsx @@ -13,7 +13,7 @@ import { Paragraph } from '../components/themed/EdgeText' import { deleteLoanAccount } from '../controllers/loan-manager/redux/actions' import { lstrings } from '../locales/strings' import { ThunkAction } from '../types/reduxTypes' -import { NavigationProp } from '../types/routerTypes' +import { WalletsTabSceneProps } from '../types/routerTypes' import { getCurrencyCode } from '../util/CurrencyInfoHelpers' import { getWalletName } from '../util/CurrencyWalletHelpers' import { logActivity } from '../util/logger' @@ -38,7 +38,7 @@ export type WalletListMenuKey = | string // for split keys like splitbitcoincash, splitethereum, etc. export function walletListMenuAction( - navigation: NavigationProp<'walletList'> | NavigationProp<'transactionList'>, + navigation: WalletsTabSceneProps<'walletList' | 'transactionList'>['navigation'], walletId: string, option: WalletListMenuKey, tokenId: EdgeTokenId, diff --git a/src/app.ts b/src/app.ts index afb82ebe6b2..d602ad0ca3e 100644 --- a/src/app.ts +++ b/src/app.ts @@ -34,7 +34,13 @@ if (ENV.SENTRY_ORGANIZATION_SLUG.includes('SENTRY_ORGANIZATION')) { // Initialize Sentry within native iOS and Android code so we can catch crashes at // early app startup. - autoInitializeNativeSdk: false + autoInitializeNativeSdk: false, + + integrations: [ + Sentry.breadcrumbsIntegration({ + console: false + }) + ] }) } diff --git a/src/components/Main.tsx b/src/components/Main.tsx index f66d139da24..58316790381 100644 --- a/src/components/Main.tsx +++ b/src/components/Main.tsx @@ -25,10 +25,10 @@ import { BuyTabParamList, DrawerParamList, EdgeAppStackParamList, - EdgeSceneProps, EdgeTabsParamList, NavigationBase, RootParamList, + RootSceneProps, SwapTabParamList, WalletsTabParamList } from '../types/routerTypes' @@ -874,14 +874,14 @@ export const Main = () => { - {(props: EdgeSceneProps<'gettingStarted'>) => { + {(props: RootSceneProps<'gettingStarted'>) => { if (navigation == null) setTimeout(() => setNavigation(props.navigation as NavigationBase), 0) return }} - {(props: EdgeSceneProps<'login'>) => { + {(props: RootSceneProps<'login'>) => { if (navigation == null) setTimeout(() => setNavigation(props.navigation as NavigationBase), 0) return }} diff --git a/src/components/cards/VisaCardCard.tsx b/src/components/cards/VisaCardCard.tsx index 515b9ca3fb4..301b38c83a4 100644 --- a/src/components/cards/VisaCardCard.tsx +++ b/src/components/cards/VisaCardCard.tsx @@ -9,7 +9,7 @@ import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { getDefaultFiat } from '../../selectors/SettingsSelectors' import { useDispatch, useSelector } from '../../types/reactRedux' -import { NavigationProp } from '../../types/routerTypes' +import { NavigationBase, WalletsTabSceneProps } from '../../types/routerTypes' import { getCurrencyIconUris } from '../../util/CdnUris' import { logEvent } from '../../util/tracking' import { EdgeTouchableOpacity } from '../common/EdgeTouchableOpacity' @@ -25,7 +25,7 @@ export const ioniaPluginIds = Object.keys(SPECIAL_CURRENCY_INFO).filter(pluginId interface Props { wallet: EdgeCurrencyWallet tokenId: EdgeTokenId - navigation: NavigationProp<'transactionList'> + navigation: WalletsTabSceneProps<'transactionList'>['navigation'] } export const VisaCardCard = (props: Props) => { @@ -36,7 +36,7 @@ export const VisaCardCard = (props: Props) => { const handlePress = useHandler(() => { dispatch(logEvent('Visa_Card_Launch')) - dispatch(executePluginAction(navigation, 'rewardscard', 'sell')).catch(err => showError(err)) + dispatch(executePluginAction(navigation as NavigationBase, 'rewardscard', 'sell')).catch(err => showError(err)) }) const defaultFiat = useSelector(state => getDefaultFiat(state)) diff --git a/src/components/modals/SurveyModal.tsx b/src/components/modals/SurveyModal.tsx index 7f1d0a25804..e6bdc883e86 100644 --- a/src/components/modals/SurveyModal.tsx +++ b/src/components/modals/SurveyModal.tsx @@ -26,6 +26,7 @@ const SURVEY_OPTS = [ { label: lstrings.survey_opt_in_person_event, selected: false }, { label: lstrings.survey_opt_personal_referral, selected: false }, { label: lstrings.survey_opt_article, selected: false }, + { label: lstrings.survey_opt_BTCTKVR_magazine, selected: false }, // Show names intentionally left untranslated: { label: 'Free Talk Live', selected: false }, { label: 'Crypto Canal', selected: false }, diff --git a/src/components/modals/WalletListMenuModal.tsx b/src/components/modals/WalletListMenuModal.tsx index 9ece3fd0abf..301d63ace93 100644 --- a/src/components/modals/WalletListMenuModal.tsx +++ b/src/components/modals/WalletListMenuModal.tsx @@ -11,7 +11,7 @@ import { useHandler } from '../../hooks/useHandler' import { useWatch } from '../../hooks/useWatch' import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' -import { NavigationProp } from '../../types/routerTypes' +import { WalletsTabSceneProps } from '../../types/routerTypes' import { getCurrencyCode, isKeysOnlyPlugin } from '../../util/CurrencyInfoHelpers' import { getWalletName } from '../../util/CurrencyWalletHelpers' import { EdgeTouchableOpacity } from '../common/EdgeTouchableOpacity' @@ -28,7 +28,7 @@ interface Option { interface Props { bridge: AirshipBridge - navigation: NavigationProp<'walletList'> | NavigationProp<'transactionList'> + navigation: WalletsTabSceneProps<'walletList' | 'transactionList'>['navigation'] // Wallet identity: tokenId: EdgeTokenId diff --git a/src/components/notification/NotificationView.tsx b/src/components/notification/NotificationView.tsx index ba10a5fb15f..81b3cf8beb5 100644 --- a/src/components/notification/NotificationView.tsx +++ b/src/components/notification/NotificationView.tsx @@ -146,8 +146,8 @@ const NotificationViewComponent = (props: Props) => { diff --git a/src/components/rows/CoinRankRow.tsx b/src/components/rows/CoinRankRow.tsx index 8312490dbe6..dd9caaa3216 100644 --- a/src/components/rows/CoinRankRow.tsx +++ b/src/components/rows/CoinRankRow.tsx @@ -8,7 +8,7 @@ import { formatFiatString } from '../../hooks/useFiatText' import { useHandler } from '../../hooks/useHandler' import { toPercentString } from '../../locales/intl' import { AssetSubText, CoinRanking, CoinRankingData, PercentChangeTimeFrame } from '../../types/coinrankTypes' -import { NavigationProp } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { triggerHaptic } from '../../util/haptic' import { debugLog, LOG_COINRANK } from '../../util/logger' import { DECIMAL_PRECISION } from '../../util/utils' @@ -21,7 +21,7 @@ interface Props { coinRanking: CoinRanking index: number fiatCurrencyCode: string - navigation: NavigationProp<'coinRanking'> + navigation: EdgeAppSceneProps<'coinRanking'>['navigation'] percentChangeTimeFrame: PercentChangeTimeFrame } diff --git a/src/components/scenes/AssetSettingsScene.tsx b/src/components/scenes/AssetSettingsScene.tsx index 72af2f1ebba..d489aff4556 100644 --- a/src/components/scenes/AssetSettingsScene.tsx +++ b/src/components/scenes/AssetSettingsScene.tsx @@ -5,14 +5,14 @@ import { CURRENCY_SETTINGS_KEYS } from '../../constants/WalletAndCurrencyConstan import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { SceneWrapper } from '../common/SceneWrapper' import { CryptoIcon } from '../icons/CryptoIcon' import { showToast } from '../services/AirshipInstance' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { SettingsTappableRow } from '../settings/SettingsTappableRow' -interface Props extends EdgeSceneProps<'assetSettings'> {} +interface Props extends EdgeAppSceneProps<'assetSettings'> {} export function AssetSettingsScene(props: Props) { const { navigation } = props diff --git a/src/components/scenes/ChangeMiningFeeScene.tsx b/src/components/scenes/ChangeMiningFeeScene.tsx index 5923c0f7599..c60b7e3a4fd 100644 --- a/src/components/scenes/ChangeMiningFeeScene.tsx +++ b/src/components/scenes/ChangeMiningFeeScene.tsx @@ -8,7 +8,7 @@ import { SCROLL_INDICATOR_INSET_FIX } from '../../constants/constantSettings' import { FEE_STRINGS } from '../../constants/WalletAndCurrencyConstants' import { useIconColor } from '../../hooks/useIconColor' import { lstrings } from '../../locales/strings' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { FeeOption } from '../../types/types' import { darkenHexColor } from '../../util/utils' import { AccentColors } from '../common/DotsBackground' @@ -29,7 +29,7 @@ export interface ChangeMiningFeeParams { onSubmit: (networkFeeOption: FeeOption, customNetworkFee: JsonObject) => void } -interface OwnProps extends EdgeSceneProps<'changeMiningFee2'> { +interface OwnProps extends EdgeAppSceneProps<'changeMiningFee2'> { wallet: EdgeCurrencyWallet } diff --git a/src/components/scenes/ChangePasswordScene.tsx b/src/components/scenes/ChangePasswordScene.tsx index e2dc0e2fd86..9acf7835f8a 100644 --- a/src/components/scenes/ChangePasswordScene.tsx +++ b/src/components/scenes/ChangePasswordScene.tsx @@ -3,12 +3,12 @@ import * as React from 'react' import { useHandler } from '../../hooks/useHandler' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { logActivity } from '../../util/logger' import { logEvent } from '../../util/tracking' import { SceneWrapper } from '../common/SceneWrapper' -interface Props extends EdgeSceneProps<'changePassword'> {} +interface Props extends EdgeAppSceneProps<'changePassword'> {} export const ChangePasswordScene = (props: Props) => { const { navigation } = props diff --git a/src/components/scenes/ChangePinScene.tsx b/src/components/scenes/ChangePinScene.tsx index 747f58c1cb1..827e10130f2 100644 --- a/src/components/scenes/ChangePinScene.tsx +++ b/src/components/scenes/ChangePinScene.tsx @@ -3,12 +3,12 @@ import * as React from 'react' import { useHandler } from '../../hooks/useHandler' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { logActivity } from '../../util/logger' import { logEvent } from '../../util/tracking' import { SceneWrapper } from '../common/SceneWrapper' -interface Props extends EdgeSceneProps<'changePin'> {} +interface Props extends EdgeAppSceneProps<'changePin'> {} export const ChangePinScene = (props: Props) => { const { navigation } = props diff --git a/src/components/scenes/CoinRankingDetailsScene.tsx b/src/components/scenes/CoinRankingDetailsScene.tsx index aaec97c3df3..1cfcd5db34c 100644 --- a/src/components/scenes/CoinRankingDetailsScene.tsx +++ b/src/components/scenes/CoinRankingDetailsScene.tsx @@ -9,7 +9,7 @@ import { lstrings } from '../../locales/strings' import { getDefaultFiat } from '../../selectors/SettingsSelectors' import { CoinRankingData, CoinRankingDataPercentChange } from '../../types/coinrankTypes' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { formatLargeNumberString as formatLargeNumber } from '../../util/utils' import { SwipeChart } from '../charts/SwipeChart' import { EdgeAnim, fadeInLeft } from '../common/EdgeAnim' @@ -25,7 +25,7 @@ export interface CoinRankingDetailsParams { fiatCurrencyCode: string } -interface Props extends EdgeSceneProps<'coinRankingDetails'> {} +interface Props extends EdgeAppSceneProps<'coinRankingDetails'> {} const COINRANKINGDATA_TITLE_MAP: { [key: string]: string } = { currencyCode: '', diff --git a/src/components/scenes/CoinRankingScene.tsx b/src/components/scenes/CoinRankingScene.tsx index e04bc7761c6..9cd402e08f6 100644 --- a/src/components/scenes/CoinRankingScene.tsx +++ b/src/components/scenes/CoinRankingScene.tsx @@ -11,7 +11,7 @@ import { FooterRender } from '../../state/SceneFooterState' import { useSceneScrollHandler } from '../../state/SceneScrollState' import { asCoinranking, AssetSubText, CoinRanking, PercentChangeTimeFrame } from '../../types/coinrankTypes' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { debugLog, enableDebugLogType, LOG_COINRANK } from '../../util/logger' import { fetchRates } from '../../util/network' import { EdgeAnim, MAX_LIST_ITEMS_ANIM } from '../common/EdgeAnim' @@ -76,7 +76,7 @@ export const COINGECKO_SUPPORTED_FIATS = { // Masking enable bit with 0 disables logging enableDebugLogType(LOG_COINRANK & 0) -interface Props extends EdgeSceneProps<'coinRanking'> {} +interface Props extends EdgeAppSceneProps<'coinRanking'> {} const percentChangeOrder: PercentChangeTimeFrame[] = ['hours1', 'hours24', 'days7', 'days30', 'year1'] const percentChangeStrings: { [pc: string]: string } = { diff --git a/src/components/scenes/ConfirmScene.tsx b/src/components/scenes/ConfirmScene.tsx index 6e38530ed18..7092f06de68 100644 --- a/src/components/scenes/ConfirmScene.tsx +++ b/src/components/scenes/ConfirmScene.tsx @@ -5,7 +5,7 @@ import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view import { SCROLL_INDICATOR_INSET_FIX } from '../../constants/constantSettings' import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { EdgeButton } from '../buttons/EdgeButton' import { SceneWrapper } from '../common/SceneWrapper' import { EdgeRow } from '../rows/EdgeRow' @@ -14,7 +14,7 @@ import { EdgeText } from '../themed/EdgeText' import { SafeSlider } from '../themed/SafeSlider' import { SceneHeaderUi4 } from '../themed/SceneHeaderUi4' -interface Props extends EdgeSceneProps<'confirmScene'> {} +interface Props extends EdgeAppSceneProps<'confirmScene'> {} export interface ConfirmSceneParams { titleText: string diff --git a/src/components/scenes/CreateWalletAccountSelectScene.tsx b/src/components/scenes/CreateWalletAccountSelectScene.tsx index 9636e2c6ce2..b87aa651291 100644 --- a/src/components/scenes/CreateWalletAccountSelectScene.tsx +++ b/src/components/scenes/CreateWalletAccountSelectScene.tsx @@ -12,7 +12,7 @@ import { lstrings } from '../../locales/strings' import { getExchangeDenomByCurrencyCode } from '../../selectors/DenominationSelectors' import { config } from '../../theme/appConfig' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../types/routerTypes' import { EdgeAsset } from '../../types/types' import { getCurrencyCode, getWalletTokenId } from '../../util/CurrencyInfoHelpers' import { getWalletName } from '../../util/CurrencyWalletHelpers' @@ -53,7 +53,7 @@ export interface AccountActivationPaymentInfo { expireTime: number } -interface Props extends EdgeSceneProps<'createWalletAccountSelect'> { +interface Props extends EdgeAppSceneProps<'createWalletAccountSelect'> { wallet: EdgeCurrencyWallet } @@ -108,7 +108,7 @@ export const CreateWalletAccountSelectScene = withWallet((props: Props) => { const handleSelect = useHandler(() => { Airship.show(bridge => ( - + )) .then(async result => { if (result?.type === 'wallet') { @@ -139,7 +139,9 @@ export const CreateWalletAccountSelectScene = withWallet((props: Props) => { const handleSubmit = useHandler(async () => { const createdWalletInstance = await handleRenameAndReturnWallet() - dispatch(createAccountTransaction(props.navigation, createdWalletInstance.id, accountName, walletId, activationPaymentInfo)).catch(err => showError(err)) + dispatch(createAccountTransaction(props.navigation as NavigationBase, createdWalletInstance.id, accountName, walletId, activationPaymentInfo)).catch(err => + showError(err) + ) }) const handleCancel = useHandler(() => setWalletId('')) diff --git a/src/components/scenes/CreateWalletAccountSetupScene.tsx b/src/components/scenes/CreateWalletAccountSetupScene.tsx index c6710746dda..697b427c78e 100644 --- a/src/components/scenes/CreateWalletAccountSetupScene.tsx +++ b/src/components/scenes/CreateWalletAccountSetupScene.tsx @@ -7,7 +7,7 @@ import { useHandler } from '../../hooks/useHandler' import { useMount } from '../../hooks/useMount' import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { logEvent } from '../../util/tracking' import { SceneWrapper } from '../common/SceneWrapper' import { withWallet } from '../hoc/withWallet' @@ -22,7 +22,7 @@ export interface CreateWalletAccountSetupParams { walletId: string } -interface Props extends EdgeSceneProps<'createWalletAccountSetup'> { +interface Props extends EdgeAppSceneProps<'createWalletAccountSetup'> { wallet: EdgeCurrencyWallet } diff --git a/src/components/scenes/CreateWalletCompletionScene.tsx b/src/components/scenes/CreateWalletCompletionScene.tsx index 93a88c7b9a8..0e0a31e5f20 100644 --- a/src/components/scenes/CreateWalletCompletionScene.tsx +++ b/src/components/scenes/CreateWalletCompletionScene.tsx @@ -12,7 +12,7 @@ import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { splitCreateWalletItems, WalletCreateItem } from '../../selectors/getCreateWalletList' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { SceneButtons } from '../buttons/SceneButtons' import { SceneWrapper } from '../common/SceneWrapper' import { IconDataRow } from '../rows/IconDataRow' @@ -30,7 +30,7 @@ export interface CreateWalletCompletionParams { keyOptions?: Map } -interface Props extends EdgeSceneProps<'createWalletCompletion'> {} +interface Props extends EdgeAppSceneProps<'createWalletCompletion'> {} const CreateWalletCompletionComponent = (props: Props) => { const { navigation, route } = props @@ -161,7 +161,7 @@ const CreateWalletCompletionComponent = (props: Props) => { return null }) - const handleNext = useHandler(() => navigation.navigate('walletsTab', { screen: 'walletList' })) + const handleNext = useHandler(() => navigation.navigate('edgeTabs', { screen: 'walletsTab', params: { screen: 'walletList' } })) const handleMigrate = useHandler(() => { // Transform filtered items into the structure expected by the migration component diff --git a/src/components/scenes/CreateWalletEditNameScene.tsx b/src/components/scenes/CreateWalletEditNameScene.tsx index c6162924957..e3019523841 100644 --- a/src/components/scenes/CreateWalletEditNameScene.tsx +++ b/src/components/scenes/CreateWalletEditNameScene.tsx @@ -12,7 +12,7 @@ import { useWatch } from '../../hooks/useWatch' import { lstrings } from '../../locales/strings' import { splitCreateWalletItems, WalletCreateItem } from '../../selectors/getCreateWalletList' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { getWalletName } from '../../util/CurrencyWalletHelpers' import { logEvent } from '../../util/tracking' import { ButtonsView } from '../buttons/ButtonsView' @@ -30,7 +30,7 @@ export interface CreateWalletEditNameParams { splitSourceWalletId?: string } -interface Props extends EdgeSceneProps<'createWalletEditName'> {} +interface Props extends EdgeAppSceneProps<'createWalletEditName'> {} const CreateWalletEditNameComponent = (props: Props) => { const { navigation, route } = props @@ -85,7 +85,7 @@ const CreateWalletEditNameComponent = (props: Props) => { showError(error) dispatch(logEvent('Create_Wallet_Failed', { error: String(error) })) } - navigation.navigate('walletsTab', { screen: 'walletList' }) + navigation.navigate('edgeTabs', { screen: 'walletsTab', params: { screen: 'walletList' } }) return } // Any other combination goes to the completion scene @@ -104,7 +104,7 @@ const CreateWalletEditNameComponent = (props: Props) => { break } } - navigation.navigate('walletsTab', { screen: 'walletList' }) + navigation.navigate('edgeTabs', { screen: 'walletsTab', params: { screen: 'walletList' } }) } }) @@ -161,7 +161,7 @@ const CreateWalletEditNameComponent = (props: Props) => { // If all remaining create items are tokens just go enable them and return home if (newWalletItemsCopy.length === 0 && newTokenItems.length > 0) { await dispatch(enableTokensAcrossWallets(newTokenItems)) - navigation.navigate('walletsTab', { screen: 'walletList' }) + navigation.navigate('edgeTabs', { screen: 'walletsTab', params: { screen: 'walletList' } }) return } diff --git a/src/components/scenes/CreateWalletImportOptionsScene.tsx b/src/components/scenes/CreateWalletImportOptionsScene.tsx index 5befa45e9dc..e97a5955d65 100644 --- a/src/components/scenes/CreateWalletImportOptionsScene.tsx +++ b/src/components/scenes/CreateWalletImportOptionsScene.tsx @@ -9,7 +9,7 @@ import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { WalletCreateItem } from '../../selectors/getCreateWalletList' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { FlatListItem } from '../../types/types' import { EdgeTouchableOpacity } from '../common/EdgeTouchableOpacity' import { SceneWrapper } from '../common/SceneWrapper' @@ -28,7 +28,7 @@ export interface CreateWalletImportOptionsParams { importText: string } -interface Props extends EdgeSceneProps<'createWalletImportOptions'> {} +interface Props extends EdgeAppSceneProps<'createWalletImportOptions'> {} const CreateWalletImportOptionsComponent = (props: Props) => { const { navigation, route } = props diff --git a/src/components/scenes/CreateWalletImportScene.tsx b/src/components/scenes/CreateWalletImportScene.tsx index 6b866deb595..6c93185a51e 100644 --- a/src/components/scenes/CreateWalletImportScene.tsx +++ b/src/components/scenes/CreateWalletImportScene.tsx @@ -11,7 +11,7 @@ import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { splitCreateWalletItems, WalletCreateItem } from '../../selectors/getCreateWalletList' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { SceneButtons } from '../buttons/SceneButtons' import { SceneWrapper } from '../common/SceneWrapper' import { ButtonsModal } from '../modals/ButtonsModal' @@ -26,7 +26,7 @@ export interface CreateWalletImportParams { walletNames: { [key: string]: string } } -interface Props extends EdgeSceneProps<'createWalletImport'> {} +interface Props extends EdgeAppSceneProps<'createWalletImport'> {} const CreateWalletImportComponent = (props: Props) => { const { navigation, route } = props diff --git a/src/components/scenes/CreateWalletSelectCryptoScene.tsx b/src/components/scenes/CreateWalletSelectCryptoScene.tsx index 78df018b0ef..692557fd7d9 100644 --- a/src/components/scenes/CreateWalletSelectCryptoScene.tsx +++ b/src/components/scenes/CreateWalletSelectCryptoScene.tsx @@ -17,7 +17,7 @@ import { WalletCreateItem } from '../../selectors/getCreateWalletList' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps, NavigationProp } from '../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../types/routerTypes' import { EdgeAsset } from '../../types/types' import { logEvent } from '../../util/tracking' import { EdgeButton } from '../buttons/EdgeButton' @@ -36,14 +36,17 @@ import { SimpleTextInput } from '../themed/SimpleTextInput' import { WalletListCurrencyRow } from '../themed/WalletListCurrencyRow' export interface CreateWalletSelectCryptoParams { - newAccountFlow?: (navigation: NavigationProp<'createWalletSelectCrypto' | 'createWalletSelectCryptoNewAccount'>, items: WalletCreateItem[]) => Promise + newAccountFlow?: ( + navigation: EdgeAppSceneProps<'createWalletSelectCrypto' | 'createWalletSelectCryptoNewAccount'>['navigation'], + items: WalletCreateItem[] + ) => Promise defaultSelection?: EdgeAsset[] disableLegacy?: boolean splitPluginIds?: string[] splitSourceWalletId?: string } -interface Props extends EdgeSceneProps<'createWalletSelectCrypto' | 'createWalletSelectCryptoNewAccount'> {} +interface Props extends EdgeAppSceneProps<'createWalletSelectCrypto' | 'createWalletSelectCryptoNewAccount'> {} const CreateWalletSelectCryptoComponent = (props: Props) => { const { navigation, route } = props @@ -221,7 +224,7 @@ const CreateWalletSelectCryptoComponent = (props: Props) => { } else { // Otherwise enable the tokens and return to the main scene. await dispatch(enableTokensAcrossWallets(newTokenItems)) - navigation.navigate('walletsTab', { screen: 'walletList' }) + navigation.navigate('edgeTabs', { screen: 'walletsTab', params: { screen: 'walletList' } }) } }) @@ -236,7 +239,7 @@ const CreateWalletSelectCryptoComponent = (props: Props) => { const walletListResult = await Airship.show(bridge => ( {} +interface Props extends EdgeAppSceneProps<'currencyNotificationSettings'> {} export const CurrencyNotificationScene = (props: Props) => { const { route } = props diff --git a/src/components/scenes/CurrencySettingsScene.tsx b/src/components/scenes/CurrencySettingsScene.tsx index a04c5c548b2..bc709ef44f6 100644 --- a/src/components/scenes/CurrencySettingsScene.tsx +++ b/src/components/scenes/CurrencySettingsScene.tsx @@ -6,7 +6,7 @@ import { setDenominationKeyRequest } from '../../actions/SettingsActions' import { useDisplayDenom } from '../../hooks/useDisplayDenom' import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { SceneWrapper } from '../common/SceneWrapper' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { SettingsHeaderRow } from '../settings/SettingsHeaderRow' @@ -18,7 +18,7 @@ export interface CurrencySettingsParams { currencyInfo: EdgeCurrencyInfo } -interface Props extends EdgeSceneProps<'currencySettings'> {} +interface Props extends EdgeAppSceneProps<'currencySettings'> {} export function CurrencySettingsScene(props: Props) { const { route } = props diff --git a/src/components/scenes/DefaultFiatSettingScene.tsx b/src/components/scenes/DefaultFiatSettingScene.tsx index 1ea0420957d..d24f54c6f8d 100644 --- a/src/components/scenes/DefaultFiatSettingScene.tsx +++ b/src/components/scenes/DefaultFiatSettingScene.tsx @@ -10,7 +10,7 @@ import { FIAT_COUNTRY } from '../../constants/CountryConstants' import { lstrings } from '../../locales/strings' import { getDefaultFiat } from '../../selectors/SettingsSelectors' import { connect } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { Theme } from '../../types/Theme' import { FlatListItem, GuiFiatType } from '../../types/types' import { getSupportedFiats } from '../../util/utils' @@ -22,7 +22,7 @@ import { SceneHeader } from '../themed/SceneHeader' import { SelectableRow } from '../themed/SelectableRow' import { SimpleTextInput } from '../themed/SimpleTextInput' -interface OwnProps extends EdgeSceneProps<'defaultFiatSetting'> {} +interface OwnProps extends EdgeAppSceneProps<'defaultFiatSetting'> {} interface StateProps { supportedFiats: GuiFiatType[] diff --git a/src/components/scenes/DevTestScene.tsx b/src/components/scenes/DevTestScene.tsx index eb044f26ef1..901abb4444c 100644 --- a/src/components/scenes/DevTestScene.tsx +++ b/src/components/scenes/DevTestScene.tsx @@ -15,7 +15,7 @@ import { lstrings } from '../../locales/strings' import { HomeAddress } from '../../types/FormTypes' import { useState } from '../../types/reactHooks' import { useDispatch } from '../../types/reactRedux' -import { EdgeSceneProps, NavigationBase } from '../../types/routerTypes' +import { EdgeTabsSceneProps, NavigationBase } from '../../types/routerTypes' import { parseDeepLink } from '../../util/DeepLinkParser' import { consify } from '../../util/utils' import { ButtonsView } from '../buttons/ButtonsView' @@ -47,7 +47,7 @@ import { SceneHeader } from '../themed/SceneHeader' import { SceneHeaderUi4 } from '../themed/SceneHeaderUi4' import { SimpleTextInput } from '../themed/SimpleTextInput' -interface Props extends EdgeSceneProps<'devTab'> {} +interface Props extends EdgeTabsSceneProps<'devTab'> {} export function DevTestScene(props: Props) { const { navigation } = props @@ -235,7 +235,7 @@ export function DevTestScene(props: Props) { label="PasswordReminderModal" marginRem={0.25} onPress={async () => { - await Airship.show(bridge => ) + await Airship.show(bridge => ) }} /> { if (coreWallet == null) return await Airship.show(bridge => ( - + )) }} /> @@ -263,7 +268,7 @@ export function DevTestScene(props: Props) { label="BackupModal (Long, Original with image)" marginRem={0.25} onPress={async () => { - showBackupModal({ navigation, forgetLoginId: 'test' }) + showBackupModal({ navigation: navigation as NavigationBase, forgetLoginId: 'test' }) }} /> { const parsed = parseDeepLink(deepLinkInputValue) console.debug('parsed deeplink: ', parsed) - dispatch(launchDeepLink(navigation, parsed)).catch(e => showError(e)) + dispatch(launchDeepLink(navigation as NavigationBase, parsed)).catch(e => showError(e)) }} label="Activate DeepLink" type="primary" diff --git a/src/components/scenes/EdgeLoginScene.tsx b/src/components/scenes/EdgeLoginScene.tsx index f812c568650..a35f8a20511 100644 --- a/src/components/scenes/EdgeLoginScene.tsx +++ b/src/components/scenes/EdgeLoginScene.tsx @@ -8,7 +8,7 @@ import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { config } from '../../theme/appConfig' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { WarningCard } from '../cards/WarningCard' import { CrossFade } from '../common/CrossFade' import { SceneWrapper } from '../common/SceneWrapper' @@ -23,7 +23,7 @@ export interface EdgeLoginParams { lobbyId: string } -interface Props extends EdgeSceneProps<'edgeLogin'> {} +interface Props extends EdgeAppSceneProps<'edgeLogin'> {} export const EdgeLoginScene = (props: Props) => { const { navigation, route } = props diff --git a/src/components/scenes/EditTokenScene.tsx b/src/components/scenes/EditTokenScene.tsx index f56634259a2..8aad8978da3 100644 --- a/src/components/scenes/EditTokenScene.tsx +++ b/src/components/scenes/EditTokenScene.tsx @@ -8,7 +8,7 @@ import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { config } from '../../theme/appConfig' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { getWalletName } from '../../util/CurrencyWalletHelpers' import { logActivity } from '../../util/logger' import { ButtonsView } from '../buttons/ButtonsView' @@ -33,7 +33,7 @@ export interface EditTokenParams { walletId: string } -interface Props extends EdgeSceneProps<'editToken'> { +interface Props extends EdgeAppSceneProps<'editToken'> { wallet: EdgeCurrencyWallet } diff --git a/src/components/scenes/ExtraTabScene.tsx b/src/components/scenes/ExtraTabScene.tsx index 2ce14bbfd18..27704814d6c 100644 --- a/src/components/scenes/ExtraTabScene.tsx +++ b/src/components/scenes/ExtraTabScene.tsx @@ -4,11 +4,11 @@ import WebView from 'react-native-webview' import { lstrings } from '../../locales/strings' import { config } from '../../theme/appConfig' import { GuiPlugin } from '../../types/GuiPluginTypes' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../types/routerTypes' import { SceneWrapper } from '../common/SceneWrapper' import { EdgeProviderComponent } from '../themed/EdgeProviderComponent' -interface Props extends EdgeSceneProps<'extraTab'> {} +interface Props extends EdgeAppSceneProps<'extraTab'> {} export function ExtraTabScene(props: Props) { if (config.extraTab == null) throw new Error('No extra tab config info') @@ -25,7 +25,7 @@ export function ExtraTabScene(props: Props) { return ( - + ) } diff --git a/src/components/scenes/Fio/FioAddressDetailsScene.tsx b/src/components/scenes/Fio/FioAddressDetailsScene.tsx index 95fd2c3340c..ebd377349b1 100644 --- a/src/components/scenes/Fio/FioAddressDetailsScene.tsx +++ b/src/components/scenes/Fio/FioAddressDetailsScene.tsx @@ -5,7 +5,7 @@ import IonIcon from 'react-native-vector-icons/Ionicons' import { lstrings } from '../../../locales/strings' import { connect } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../../types/routerTypes' import { BUNDLED_TXS_AMOUNT_ALERT, findWalletByFioAddress } from '../../../util/FioAddressUtils' import { AlertCardUi4 } from '../../cards/AlertCard' import { EdgeCard } from '../../cards/EdgeCard' @@ -28,7 +28,7 @@ interface StateProps { fioWallets: EdgeCurrencyWallet[] } -interface OwnProps extends EdgeSceneProps<'fioAddressDetails'> {} +interface OwnProps extends EdgeAppSceneProps<'fioAddressDetails'> {} interface LocalState { fioWalletLoading: boolean @@ -122,7 +122,12 @@ export class FioAddressDetails extends React.Component { icon={} label={lstrings.fio_address_details_connect_to_wallets} /> - + ) diff --git a/src/components/scenes/Fio/FioAddressListScene.tsx b/src/components/scenes/Fio/FioAddressListScene.tsx index 56aea86f687..07de9ddece9 100644 --- a/src/components/scenes/Fio/FioAddressListScene.tsx +++ b/src/components/scenes/Fio/FioAddressListScene.tsx @@ -9,7 +9,7 @@ import fioAddressLogo from '../../../assets/images/fio/fio_logo.png' import { SCROLL_INDICATOR_INSET_FIX } from '../../../constants/constantSettings' import { lstrings } from '../../../locales/strings' import { connect } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { FioAddress, FioDomain } from '../../../types/types' import { ButtonsView } from '../../buttons/ButtonsView' import { EdgeAnim, fadeIn, fadeOut } from '../../common/EdgeAnim' @@ -38,7 +38,7 @@ interface DispatchProps { refreshAllFioAddresses: () => Promise } -interface OwnProps extends EdgeSceneProps<'fioAddressList'> {} +interface OwnProps extends EdgeAppSceneProps<'fioAddressList'> {} type Props = StateProps & DispatchProps & OwnProps & ThemeProps diff --git a/src/components/scenes/Fio/FioAddressRegisterScene.tsx b/src/components/scenes/Fio/FioAddressRegisterScene.tsx index a6d413b4b0c..41223aa1b52 100644 --- a/src/components/scenes/Fio/FioAddressRegisterScene.tsx +++ b/src/components/scenes/Fio/FioAddressRegisterScene.tsx @@ -7,7 +7,7 @@ import { createFioWallet } from '../../../actions/FioAddressActions' import { FIO_ADDRESS_DELIMITER, FIO_DOMAIN_DEFAULT } from '../../../constants/WalletAndCurrencyConstants' import { lstrings } from '../../../locales/strings' import { connect } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../../types/routerTypes' import { FioDomain, FioPublicDomain } from '../../../types/types' import { getWalletName } from '../../../util/CurrencyWalletHelpers' import { checkIsDomainPublic } from '../../../util/FioAddressUtils' @@ -42,7 +42,7 @@ interface State { errorMessage: string } -interface OwnProps extends EdgeSceneProps<'fioAddressRegister'> {} +interface OwnProps extends EdgeAppSceneProps<'fioAddressRegister'> {} interface StateProps { fioWallets: EdgeCurrencyWallet[] @@ -289,7 +289,7 @@ export class FioAddressRegister extends React.Component { await Airship.show(bridge => ( @@ -306,7 +306,7 @@ export class FioAddressRegister extends React.Component { const { domainsLoading } = this.state if (domainsLoading) return const response = await Airship.show(bridge => ( - + )) if (response) { this.setState({ selectedDomain: response }) diff --git a/src/components/scenes/Fio/FioAddressRegisterSelectWalletScene.tsx b/src/components/scenes/Fio/FioAddressRegisterSelectWalletScene.tsx index 11d9788e85a..d855b9c5b5f 100644 --- a/src/components/scenes/Fio/FioAddressRegisterSelectWalletScene.tsx +++ b/src/components/scenes/Fio/FioAddressRegisterSelectWalletScene.tsx @@ -9,7 +9,7 @@ import { lstrings } from '../../../locales/strings' import { selectDisplayDenom } from '../../../selectors/DenominationSelectors' import { config } from '../../../theme/appConfig' import { connect } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../../types/routerTypes' import { EdgeAsset, FioDomain } from '../../../types/types' import { CryptoAmount } from '../../../util/CryptoAmount' import { getCurrencyCode } from '../../../util/CurrencyInfoHelpers' @@ -42,7 +42,7 @@ interface StateProps { isConnected: boolean } -interface OwnProps extends EdgeSceneProps<'fioAddressRegisterSelectWallet'> { +interface OwnProps extends EdgeAppSceneProps<'fioAddressRegisterSelectWallet'> { wallet: EdgeCurrencyWallet } @@ -132,7 +132,12 @@ export class FioAddressRegisterSelectWallet extends React.Component(bridge => ( - + )) if (result?.type === 'wallet') { const { walletId, tokenId } = result @@ -170,7 +175,7 @@ export class FioAddressRegisterSelectWallet extends React.Component {} +interface OwnProps extends EdgeAppSceneProps<'fioAddressRegisterSuccess'> {} type Props = OwnProps & ThemeProps diff --git a/src/components/scenes/Fio/FioAddressSettingsScene.tsx b/src/components/scenes/Fio/FioAddressSettingsScene.tsx index 032a6d531e3..4c83c50c936 100644 --- a/src/components/scenes/Fio/FioAddressSettingsScene.tsx +++ b/src/components/scenes/Fio/FioAddressSettingsScene.tsx @@ -5,7 +5,7 @@ import { View } from 'react-native' import { refreshAllFioAddresses } from '../../../actions/FioAddressActions' import { lstrings } from '../../../locales/strings' import { connect } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../../types/routerTypes' import { CryptoAmount } from '../../../util/CryptoAmount' import { addBundledTxs, getAddBundledTxsFee, getTransferFee } from '../../../util/FioAddressUtils' import { logEvent, TrackingEventName, TrackingValues } from '../../../util/tracking' @@ -44,7 +44,7 @@ interface DispatchProps { onLogEvent: (event: TrackingEventName, values: TrackingValues) => void } -interface OwnProps extends EdgeSceneProps<'fioAddressSettings'> { +interface OwnProps extends EdgeAppSceneProps<'fioAddressSettings'> { wallet: EdgeCurrencyWallet } @@ -192,7 +192,7 @@ export class FioAddressSettingsComponent extends React.Component )} {showTransfer && ( @@ -201,7 +201,7 @@ export class FioAddressSettingsComponent extends React.Component )} {!showAddBundledTxs && !showTransfer && ( diff --git a/src/components/scenes/Fio/FioConnectWalletConfirmScene.tsx b/src/components/scenes/Fio/FioConnectWalletConfirmScene.tsx index 4231eaeebe0..1057e02536b 100644 --- a/src/components/scenes/Fio/FioConnectWalletConfirmScene.tsx +++ b/src/components/scenes/Fio/FioConnectWalletConfirmScene.tsx @@ -5,7 +5,7 @@ import { View } from 'react-native' import { lstrings } from '../../../locales/strings' import { CcWalletMap } from '../../../reducers/FioReducer' import { connect } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { FioConnectionWalletItem } from '../../../types/types' import { FIO_NO_BUNDLED_ERR_CODE, updatePubAddressesForFioAddress } from '../../../util/FioAddressUtils' import { EdgeCard } from '../../cards/EdgeCard' @@ -38,7 +38,7 @@ interface StateProps { isConnected: boolean } -interface OwnProps extends EdgeSceneProps<'fioConnectToWalletsConfirm'> { +interface OwnProps extends EdgeAppSceneProps<'fioConnectToWalletsConfirm'> { wallet: EdgeCurrencyWallet } diff --git a/src/components/scenes/Fio/FioCreateHandleScene.tsx b/src/components/scenes/Fio/FioCreateHandleScene.tsx index a4cbe5e0bdb..58d417571ba 100644 --- a/src/components/scenes/Fio/FioCreateHandleScene.tsx +++ b/src/components/scenes/Fio/FioCreateHandleScene.tsx @@ -14,7 +14,7 @@ import { useAsyncEffect } from '../../../hooks/useAsyncEffect' import { useHandler } from '../../../hooks/useHandler' import { lstrings } from '../../../locales/strings' import { useDispatch, useSelector } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { getFioCustomizeHandleImage } from '../../../util/CdnUris' import { logEvent } from '../../../util/tracking' import { SceneWrapper } from '../../common/SceneWrapper' @@ -29,7 +29,7 @@ export interface FioCreateHandleParams { freeRegRefCode: string } -interface Props extends EdgeSceneProps<'fioCreateHandle'> {} +interface Props extends EdgeAppSceneProps<'fioCreateHandle'> {} const asRegisterSuccessRes = asObject({ account_id: asNumber, diff --git a/src/components/scenes/Fio/FioDomainRegisterScene.tsx b/src/components/scenes/Fio/FioDomainRegisterScene.tsx index cefc289cb22..6b42acdcc80 100644 --- a/src/components/scenes/Fio/FioDomainRegisterScene.tsx +++ b/src/components/scenes/Fio/FioDomainRegisterScene.tsx @@ -6,7 +6,7 @@ import IonIcon from 'react-native-vector-icons/Ionicons' import { createFioWallet } from '../../../actions/FioAddressActions' import { lstrings } from '../../../locales/strings' import { connect } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../../types/routerTypes' import { getWalletName } from '../../../util/CurrencyWalletHelpers' import { AlertCardUi4 } from '../../cards/AlertCard' import { EdgeCard } from '../../cards/EdgeCard' @@ -31,7 +31,7 @@ interface LocalState { errorMessage: string } -interface OwnProps extends EdgeSceneProps<'fioDomainRegister'> {} +interface OwnProps extends EdgeAppSceneProps<'fioDomainRegister'> {} interface StateProps { fioWallets: EdgeCurrencyWallet[] @@ -174,7 +174,7 @@ export class FioDomainRegister extends React.PureComponent { const result = await Airship.show(bridge => ( diff --git a/src/components/scenes/Fio/FioDomainRegisterSelectWalletScene.tsx b/src/components/scenes/Fio/FioDomainRegisterSelectWalletScene.tsx index 0182a9db966..7149c027004 100644 --- a/src/components/scenes/Fio/FioDomainRegisterSelectWalletScene.tsx +++ b/src/components/scenes/Fio/FioDomainRegisterSelectWalletScene.tsx @@ -10,7 +10,7 @@ import { lstrings } from '../../../locales/strings' import { selectDisplayDenomByCurrencyCode } from '../../../selectors/DenominationSelectors' import { config } from '../../../theme/appConfig' import { connect } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../../types/routerTypes' import { EdgeAsset } from '../../../types/types' import { CryptoAmount } from '../../../util/CryptoAmount' import { getCurrencyCode } from '../../../util/CurrencyInfoHelpers' @@ -42,7 +42,7 @@ interface StateProps { isConnected: boolean } -interface OwnProps extends EdgeSceneProps<'fioDomainRegisterSelectWallet'> { +interface OwnProps extends EdgeAppSceneProps<'fioDomainRegisterSelectWallet'> { wallet: EdgeCurrencyWallet } @@ -117,7 +117,7 @@ class FioDomainRegisterSelectWallet extends React.PureComponent(bridge => ( @@ -162,7 +162,7 @@ class FioDomainRegisterSelectWallet extends React.PureComponent Promise onLogEvent: (event: TrackingEventName, values: TrackingValues) => void } -interface OwnProps extends EdgeSceneProps<'fioDomainSettings'> { +interface OwnProps extends EdgeAppSceneProps<'fioDomainSettings'> { wallet: EdgeCurrencyWallet } @@ -204,7 +204,7 @@ export class FioDomainSettingsComponent extends React.Component { successMessage={isPublic ? lstrings.fio_domain_is_private_label : lstrings.fio_domain_is_public_label} fioWallet={fioWallet} showPaymentWalletPicker - navigation={this.props.navigation} + navigation={this.props.navigation as NavigationBase} /> )} {showRenew && ( @@ -216,11 +216,16 @@ export class FioDomainSettingsComponent extends React.Component { successMessage={lstrings.fio_request_renew_domain_ok_text} fioWallet={fioWallet} showPaymentWalletPicker - navigation={this.props.navigation} + navigation={this.props.navigation as NavigationBase} /> )} {showTransfer && ( - + )} {!showRenew && !showVisibility && !showTransfer && ( diff --git a/src/components/scenes/Fio/FioNameConfirmScene.tsx b/src/components/scenes/Fio/FioNameConfirmScene.tsx index e4223543ea5..ac44681ed32 100644 --- a/src/components/scenes/Fio/FioNameConfirmScene.tsx +++ b/src/components/scenes/Fio/FioNameConfirmScene.tsx @@ -5,7 +5,7 @@ import { View } from 'react-native' import { FIO_ADDRESS_DELIMITER } from '../../../constants/WalletAndCurrencyConstants' import { lstrings } from '../../../locales/strings' import { connect } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../../types/routerTypes' import { CryptoAmount } from '../../../util/CryptoAmount' import { fioMakeSpend, fioSignAndBroadcast } from '../../../util/FioAddressUtils' import { logEvent, TrackingEventName, TrackingValues } from '../../../util/tracking' @@ -31,7 +31,7 @@ interface StateProps { isConnected: boolean } -interface OwnProps extends EdgeSceneProps<'fioDomainConfirm' | 'fioNameConfirm'> { +interface OwnProps extends EdgeAppSceneProps<'fioDomainConfirm' | 'fioNameConfirm'> { wallet: EdgeCurrencyWallet } @@ -115,7 +115,7 @@ class FioNameConfirm extends React.PureComponent { buttons={{ ok: { label: lstrings.string_ok_cap } }} /> )) - navigation.navigate('home') + navigation.navigate('edgeTabs', { screen: 'home' }) } else { // no free domains showError(lstrings.fio_get_fee_err_msg) @@ -194,7 +194,7 @@ class FioNameConfirm extends React.PureComponent { onSubmit={this.saveFioName} getOperationFee={this.getFee} fioWallet={paymentWallet} - navigation={this.props.navigation} + navigation={this.props.navigation as NavigationBase} onCancel={() => navigation.goBack()} /> diff --git a/src/components/scenes/Fio/FioRequestConfirmationScene.tsx b/src/components/scenes/Fio/FioRequestConfirmationScene.tsx index c4e9eedc21d..59c82497d9d 100644 --- a/src/components/scenes/Fio/FioRequestConfirmationScene.tsx +++ b/src/components/scenes/Fio/FioRequestConfirmationScene.tsx @@ -9,7 +9,7 @@ import { CcWalletMap } from '../../../reducers/FioReducer' import { getExchangeDenom, selectDisplayDenom } from '../../../selectors/DenominationSelectors' import { getExchangeRate } from '../../../selectors/WalletSelectors' import { useSelector } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { getCurrencyCode } from '../../../util/CurrencyInfoHelpers' import { addToFioAddressCache, @@ -56,7 +56,7 @@ interface StateProps { defaultIsoFiat: string } -interface OwnProps extends EdgeSceneProps<'fioRequestConfirmation'> { +interface OwnProps extends EdgeAppSceneProps<'fioRequestConfirmation'> { wallet: EdgeCurrencyWallet } diff --git a/src/components/scenes/Fio/FioRequestListScene.tsx b/src/components/scenes/Fio/FioRequestListScene.tsx index 2bc4b211ebf..0b7384899e0 100644 --- a/src/components/scenes/Fio/FioRequestListScene.tsx +++ b/src/components/scenes/Fio/FioRequestListScene.tsx @@ -10,7 +10,7 @@ import { formatDate, SHORT_DATE_FMT } from '../../../locales/intl' import { lstrings } from '../../../locales/strings' import { getExchangeDenomByCurrencyCode } from '../../../selectors/DenominationSelectors' import { connect } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../../types/routerTypes' import { FioAddress, FioRequest } from '../../../types/types' import { getCurrencyCode, getTokenIdForced } from '../../../util/CurrencyInfoHelpers' import { @@ -63,7 +63,7 @@ interface DispatchProps { refreshAllFioAddresses: () => Promise } -interface OwnProps extends EdgeSceneProps<'fioRequestList'> {} +interface OwnProps extends EdgeAppSceneProps<'fioRequestList'> {} type Props = OwnProps & StateProps & ThemeProps & DispatchProps @@ -376,7 +376,12 @@ class FioRequestList extends React.Component { const allowedAssets = [{ pluginId, tokenId }] const result = await Airship.show(bridge => ( - + )) if (result?.type === 'wallet') { const { walletId, tokenId } = result diff --git a/src/components/scenes/Fio/FioSentRequestDetailsScene.tsx b/src/components/scenes/Fio/FioSentRequestDetailsScene.tsx index ec2483610b1..565d379006e 100644 --- a/src/components/scenes/Fio/FioSentRequestDetailsScene.tsx +++ b/src/components/scenes/Fio/FioSentRequestDetailsScene.tsx @@ -6,7 +6,7 @@ import { FIAT_CODES_SYMBOLS } from '../../../constants/WalletAndCurrencyConstant import { formatDate, formatNumber, SHORT_DATE_FMT } from '../../../locales/intl' import { lstrings } from '../../../locales/strings' import { connect } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { FioRequest, FioRequestStatus, GuiExchangeRates } from '../../../types/types' import { EdgeCard } from '../../cards/EdgeCard' import { SceneWrapper } from '../../common/SceneWrapper' @@ -19,7 +19,7 @@ export interface FioSentRequestDetailsParams { selectedFioSentRequest: FioRequest } -interface OwnProps extends EdgeSceneProps<'fioSentRequestDetails'> {} +interface OwnProps extends EdgeAppSceneProps<'fioSentRequestDetails'> {} interface StateProps { fiatSymbol: string diff --git a/src/components/scenes/Fio/FioStakingChangeScene.tsx b/src/components/scenes/Fio/FioStakingChangeScene.tsx index 4e201097ddd..81ab5a5ef78 100644 --- a/src/components/scenes/Fio/FioStakingChangeScene.tsx +++ b/src/components/scenes/Fio/FioStakingChangeScene.tsx @@ -14,7 +14,7 @@ import { formatNumber, formatTimeDate, SHORT_DATE_FMT } from '../../../locales/i import { lstrings } from '../../../locales/strings' import { getExchangeDenom } from '../../../selectors/DenominationSelectors' import { useDispatch, useSelector } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { getCurrencyCode } from '../../../util/CurrencyInfoHelpers' import { FioStakingBalanceType, getFioStakingBalances } from '../../../util/stakeUtils' import { convertCurrencyFromExchangeRates, convertNativeToDenomination } from '../../../util/utils' @@ -33,7 +33,7 @@ import { ModalTitle } from '../../themed/ModalParts' import { SceneHeader } from '../../themed/SceneHeader' import { Slider } from '../../themed/Slider' -interface Props extends EdgeSceneProps<'fioStakingChange'> { +interface Props extends EdgeAppSceneProps<'fioStakingChange'> { wallet: EdgeCurrencyWallet } diff --git a/src/components/scenes/Fio/FioStakingOverviewScene.tsx b/src/components/scenes/Fio/FioStakingOverviewScene.tsx index a61bdda98c0..d05f9868ef0 100644 --- a/src/components/scenes/Fio/FioStakingOverviewScene.tsx +++ b/src/components/scenes/Fio/FioStakingOverviewScene.tsx @@ -14,7 +14,7 @@ import { lstrings } from '../../../locales/strings' import { getExchangeDenomByCurrencyCode, selectDisplayDenomByCurrencyCode } from '../../../selectors/DenominationSelectors' import { convertCurrency } from '../../../selectors/WalletSelectors' import { connect } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { getCurrencyCode } from '../../../util/CurrencyInfoHelpers' import { getFioStakingBalances } from '../../../util/stakeUtils' import { convertNativeToDenomination } from '../../../util/utils' @@ -31,7 +31,7 @@ export interface FioStakingOverviewParams { walletId: string } -interface OwnProps extends EdgeSceneProps<'fioStakingOverview'> {} +interface OwnProps extends EdgeAppSceneProps<'fioStakingOverview'> {} interface StateProps { currencyWallet: EdgeCurrencyWallet diff --git a/src/components/scenes/GettingStartedScene.tsx b/src/components/scenes/GettingStartedScene.tsx index 9329c35e619..768b17a2ead 100644 --- a/src/components/scenes/GettingStartedScene.tsx +++ b/src/components/scenes/GettingStartedScene.tsx @@ -24,7 +24,7 @@ import { ExperimentConfig, UspSigninCtaType } from '../../experimentConfig' import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { RootSceneProps } from '../../types/routerTypes' import { ImageProp } from '../../types/Theme' import { parseMarkedText } from '../../util/parseMarkedText' import { logEvent } from '../../util/tracking' @@ -43,7 +43,7 @@ export interface GettingStartedParams { experimentConfig: ExperimentConfig // TODO: Create a new provider instead to serve the experimentConfig globally } -interface Props extends EdgeSceneProps<'gettingStarted'> {} +interface Props extends RootSceneProps<'gettingStarted'> {} interface SectionData { image: ImageProp diff --git a/src/components/scenes/GuiPluginListScene.tsx b/src/components/scenes/GuiPluginListScene.tsx index efbda2fb51c..a187cb0ebcb 100644 --- a/src/components/scenes/GuiPluginListScene.tsx +++ b/src/components/scenes/GuiPluginListScene.tsx @@ -28,7 +28,7 @@ import { SceneScrollHandler, useSceneScrollHandler } from '../../state/SceneScro import { asBuySellPlugins, asGuiPluginJson, BuySellPlugins, GuiPluginRow } from '../../types/GuiPluginTypes' import { useDispatch, useSelector } from '../../types/reactRedux' import { AccountReferral } from '../../types/ReferralTypes' -import { EdgeSceneProps } from '../../types/routerTypes' +import { BuyTabSceneProps, NavigationBase } from '../../types/routerTypes' import { PluginTweak } from '../../types/TweakTypes' import { getPartnerIconUri } from '../../util/CdnUris' import { getCurrencyCodeWithAccount } from '../../util/CurrencyInfoHelpers' @@ -94,7 +94,7 @@ const pluginPartnerLogos: { [key: string]: 'guiPluginLogoMoonpay' } = { moonpay: 'guiPluginLogoMoonpay' } -interface OwnProps extends EdgeSceneProps<'pluginListBuy' | 'pluginListSell'> {} +interface OwnProps extends BuyTabSceneProps<'pluginListBuy' | 'pluginListSell'> {} interface StateProps { account: EdgeAccount @@ -236,7 +236,7 @@ class GuiPluginList extends React.PureComponent { // Don't allow light accounts to enter buy webview plugins const direction = this.getSceneDirection() - if (direction === 'buy' && plugin.nativePlugin == null && checkAndShowLightBackupModal(account, navigation)) return + if (direction === 'buy' && plugin.nativePlugin == null && checkAndShowLightBackupModal(account, navigation as NavigationBase)) return // Grab a custom URI if necessary: let { deepPath = undefined } = listRow @@ -298,7 +298,7 @@ class GuiPluginList extends React.PureComponent { forcedWalletResult, guiPlugin: plugin, longPress, - navigation, + navigation: navigation as NavigationBase, paymentType, pluginPromotion, regionCode: { countryCode, stateProvinceCode }, diff --git a/src/components/scenes/GuiPluginViewScene.tsx b/src/components/scenes/GuiPluginViewScene.tsx index 35dacfddd68..58cc8b3a324 100644 --- a/src/components/scenes/GuiPluginViewScene.tsx +++ b/src/components/scenes/GuiPluginViewScene.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { checkAndShowLightBackupModal } from '../../actions/BackupModalActions' import { GuiPlugin } from '../../types/GuiPluginTypes' import { useSelector } from '../../types/reactRedux' -import { NavigationProp } from '../../types/routerTypes' +import { BuyTabSceneProps, EdgeAppSceneProps, NavigationBase, SellTabSceneProps } from '../../types/routerTypes' import { UriQueryMap } from '../../types/WebTypes' import { SceneWrapper } from '../common/SceneWrapper' import { EdgeProviderComponent } from '../themed/EdgeProviderComponent' @@ -18,10 +18,17 @@ export interface PluginViewParams { } interface Props { - navigation: NavigationProp<'pluginView' | 'pluginViewBuy' | 'pluginViewSell'> + navigation: + | EdgeAppSceneProps<'pluginView'>['navigation'] + | BuyTabSceneProps<'pluginViewBuy'>['navigation'] + | SellTabSceneProps<'pluginViewSell'>['navigation'] // Work around an extremely strange & hard-to-debug type error: - route: any // RouteProp<'pluginView' | 'pluginViewBuy' | 'pluginViewSell'> + // EdgeAppSceneProps<'pluginView'>['route'] | + // BuyTabSceneProps<'pluginViewBuy'>['route'] | + // SellTabSceneProps<'pluginViewSell'>['route'] + // TODO: Break up these "GuiPlugin" scenes. + route: any } export function GuiPluginViewScene(props: Props): JSX.Element { @@ -29,11 +36,11 @@ export function GuiPluginViewScene(props: Props): JSX.Element { const { deepPath, deepQuery, plugin } = route.params const account = useSelector(state => state.core.account) - if (checkAndShowLightBackupModal(account, navigation)) navigation.pop() + if (checkAndShowLightBackupModal(account, navigation as NavigationBase)) navigation.pop() return ( - + ) } diff --git a/src/components/scenes/HomeScene.tsx b/src/components/scenes/HomeScene.tsx index 9b5e9fc3bb3..328f5f544b3 100644 --- a/src/components/scenes/HomeScene.tsx +++ b/src/components/scenes/HomeScene.tsx @@ -13,7 +13,7 @@ import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { useSceneScrollHandler } from '../../state/SceneScrollState' import { config } from '../../theme/appConfig' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeTabsSceneProps, NavigationBase } from '../../types/routerTypes' import { getUi4ImageUri } from '../../util/CdnUris' import { infoServerData } from '../../util/network' import { BalanceCard } from '../cards/BalanceCard' @@ -29,7 +29,7 @@ import { SectionView } from '../layout/SectionView' import { AccountSyncBar } from '../progress-indicators/AccountSyncBar' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' -interface Props extends EdgeSceneProps<'home'> {} +interface Props extends EdgeTabsSceneProps<'home'> {} const TEMP_PADDING_REM = 0.5 // To be built-in to SceneWrapper when fully UI4 @@ -88,7 +88,7 @@ export const HomeScene = (props: Props) => { navigation.navigate('swapTab') }) const handleViewAssetsPress = useHandler(() => { - navigation.navigate('walletsTab', { screen: 'walletList' }) + navigation.navigate('edgeTabs', { screen: 'walletsTab', params: { screen: 'walletList' } }) }) const handleScroll = useSceneScrollHandler() @@ -138,14 +138,14 @@ export const HomeScene = (props: Props) => { <> - + {/* Animation inside PromoCardsUi4 component */} @@ -210,9 +210,13 @@ export const HomeScene = (props: Props) => { )} <> - navigation.navigate('coinRanking')} /> + navigation.navigate('edgeAppStack', { screen: 'coinRanking' })} + /> - + {videoPosts == null || videoPosts.length === 0 ? null : ( diff --git a/src/components/scenes/Loans/LoanCloseScene.tsx b/src/components/scenes/Loans/LoanCloseScene.tsx index 1cefbb4c81a..5ddd2bc4daa 100644 --- a/src/components/scenes/Loans/LoanCloseScene.tsx +++ b/src/components/scenes/Loans/LoanCloseScene.tsx @@ -17,7 +17,7 @@ import { useUrlHandler } from '../../../hooks/useUrlHandler' import { useWatch } from '../../../hooks/useWatch' import { lstrings } from '../../../locales/strings' import { useDispatch, useSelector } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { makeAaveCloseAction } from '../../../util/ActionProgramUtils' import { getExecutionNetworkFees } from '../../../util/networkFeeUtils' import { filterNull } from '../../../util/safeFilters' @@ -40,7 +40,7 @@ export interface LoanCloseParams { loanAccountId: string } -export interface Props extends EdgeSceneProps<'loanClose'> { +export interface Props extends EdgeAppSceneProps<'loanClose'> { loanAccount: LoanAccount } diff --git a/src/components/scenes/Loans/LoanCreateConfirmationScene.tsx b/src/components/scenes/Loans/LoanCreateConfirmationScene.tsx index 7d310291462..6b6aff6e7ef 100644 --- a/src/components/scenes/Loans/LoanCreateConfirmationScene.tsx +++ b/src/components/scenes/Loans/LoanCreateConfirmationScene.tsx @@ -17,7 +17,7 @@ import { lstrings } from '../../../locales/strings' import { BorrowEngine, BorrowPlugin } from '../../../plugins/borrow-plugins/types' import { convertCurrency } from '../../../selectors/WalletSelectors' import { useDispatch, useSelector } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { LoanAsset, makeAaveCreateActionProgram } from '../../../util/ActionProgramUtils' import { getExecutionNetworkFees } from '../../../util/networkFeeUtils' import { translateError } from '../../../util/translateError' @@ -53,7 +53,7 @@ const FEE_VOLATILITY_MULTIPLIER: { [network: string]: string } = { polygon: '1.5' } -interface Props extends EdgeSceneProps<'loanCreateConfirmation'> {} +interface Props extends EdgeAppSceneProps<'loanCreateConfirmation'> {} export const LoanCreateConfirmationScene = (props: Props) => { const dispatch = useDispatch() diff --git a/src/components/scenes/Loans/LoanCreateScene.tsx b/src/components/scenes/Loans/LoanCreateScene.tsx index 23a70a5417b..9326ac1fd67 100644 --- a/src/components/scenes/Loans/LoanCreateScene.tsx +++ b/src/components/scenes/Loans/LoanCreateScene.tsx @@ -25,7 +25,7 @@ import { BorrowEngine, BorrowPlugin } from '../../../plugins/borrow-plugins/type import { convertCurrency } from '../../../selectors/WalletSelectors' import { config } from '../../../theme/appConfig' import { useSelector } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../../types/routerTypes' import { getWalletPickerExcludeWalletIds } from '../../../util/borrowUtils' import { getBorrowPluginIconUri } from '../../../util/CdnUris' import { getCurrencyCode, getTokenId, getTokenIdForced } from '../../../util/CurrencyInfoHelpers' @@ -52,7 +52,7 @@ export interface LoanCreateParams { borrowPlugin: BorrowPlugin } -interface Props extends EdgeSceneProps<'loanCreate'> {} +interface Props extends EdgeAppSceneProps<'loanCreate'> {} export const LoanCreateScene = (props: Props) => { const { navigation, route } = props @@ -265,7 +265,7 @@ export const LoanCreateScene = (props: Props) => { Airship.show((bridge: AirshipBridge) => ( {} +interface Props extends EdgeAppSceneProps<'loanDashboard'> {} // First-element is the default wallet plugin used to create new wallet const SUPPORTED_WALLET_PLUGIN_IDS = ['polygon'] @@ -112,7 +112,7 @@ export const LoanDashboardScene = (props: Props) => { const result = await Airship.show(bridge => ( { +interface Props extends EdgeAppSceneProps<'loanDetails'> { loanAccount: LoanAccount } diff --git a/src/components/scenes/Loans/LoanManageScene.tsx b/src/components/scenes/Loans/LoanManageScene.tsx index 0f4ae03160d..1f988aa8058 100644 --- a/src/components/scenes/Loans/LoanManageScene.tsx +++ b/src/components/scenes/Loans/LoanManageScene.tsx @@ -25,7 +25,7 @@ import { toPercentString } from '../../../locales/intl' import { lstrings } from '../../../locales/strings' import { BorrowCollateral, BorrowDebt } from '../../../plugins/borrow-plugins/types' import { useDispatch, useSelector } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../../types/routerTypes' import { LoanAsset, makeAaveBorrowAction, makeAaveDepositAction } from '../../../util/ActionProgramUtils' import { getWalletPickerExcludeWalletIds } from '../../../util/borrowUtils' import { getBorrowPluginIconUri } from '../../../util/CdnUris' @@ -108,7 +108,7 @@ const MANAGE_ACTION_DATA_MAP: { } } -interface Props extends EdgeSceneProps<'loanManage'> { +interface Props extends EdgeAppSceneProps<'loanManage'> { loanAccount: LoanAccount } @@ -361,7 +361,7 @@ export const LoanManageSceneComponent = (props: Props) => { Airship.show((bridge: AirshipBridge) => ( { +interface Props extends EdgeAppSceneProps<'loanStatus'> { loanAccount: LoanAccount } diff --git a/src/components/scenes/LoginScene.tsx b/src/components/scenes/LoginScene.tsx index 10c28759328..4dd1860e18f 100644 --- a/src/components/scenes/LoginScene.tsx +++ b/src/components/scenes/LoginScene.tsx @@ -16,7 +16,7 @@ import { lstrings } from '../../locales/strings' import { performanceMarkersFromLoginUiPerfEvents } from '../../perf' import { config } from '../../theme/appConfig' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { NavigationBase, RootSceneProps } from '../../types/routerTypes' import { logEvent } from '../../util/tracking' import { DotsBackground } from '../common/DotsBackground' import { showHelpModal } from '../modals/HelpModal' @@ -34,7 +34,7 @@ export interface LoginParams { // @ts-expect-error global.ReactNativeBlurView = BlurView -interface Props extends EdgeSceneProps<'login'> {} +interface Props extends RootSceneProps<'login'> {} let firstRun = true @@ -66,7 +66,7 @@ export function LoginScene(props: Props) { context .loginWithPIN(YOLO_USERNAME, YOLO_PIN) .then(async account => { - await dispatch(initializeAccount(navigation, account)) + await dispatch(initializeAccount(navigation as NavigationBase, account)) }) .catch(error => showError(error)) } @@ -74,7 +74,7 @@ export function LoginScene(props: Props) { context .loginWithPassword(YOLO_USERNAME, YOLO_PASSWORD) .then(async account => { - await dispatch(initializeAccount(navigation, account)) + await dispatch(initializeAccount(navigation as NavigationBase, account)) }) .catch(error => showError(error)) } @@ -84,7 +84,7 @@ export function LoginScene(props: Props) { context .loginWithPIN(context.localUsers[0].loginId, YOLO_PIN, { useLoginId: true }) .then(async account => { - await dispatch(initializeAccount(navigation, account)) + await dispatch(initializeAccount(navigation as NavigationBase, account)) }) .catch(error => showError(error)) } @@ -98,7 +98,7 @@ export function LoginScene(props: Props) { () => ({ callback() { Keyboard.dismiss() - showHelpModal(navigation).catch(err => showDevError(err)) + showHelpModal(navigation as NavigationBase).catch(err => showDevError(err)) }, text: lstrings.string_help }), @@ -112,7 +112,7 @@ export function LoginScene(props: Props) { : undefined const handleLogin = useHandler(async (account: EdgeAccount) => { - await dispatch(initializeAccount(navigation, account)) + await dispatch(initializeAccount(navigation as NavigationBase, account)) }) const handleSendLogs = useHandler(() => { diff --git a/src/components/scenes/ManageTokensScene.tsx b/src/components/scenes/ManageTokensScene.tsx index c892bdff22f..b0894710481 100644 --- a/src/components/scenes/ManageTokensScene.tsx +++ b/src/components/scenes/ManageTokensScene.tsx @@ -9,7 +9,7 @@ import { useRowLayout } from '../../hooks/useRowLayout' import { useWalletName } from '../../hooks/useWalletName' import { useWatch } from '../../hooks/useWatch' import { lstrings } from '../../locales/strings' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { FlatListItem } from '../../types/types' import { normalizeForSearch } from '../../util/utils' import { ButtonsView } from '../buttons/ButtonsView' @@ -41,7 +41,7 @@ interface Section { data: string[] } -interface Props extends EdgeSceneProps<'manageTokens'> { +interface Props extends EdgeAppSceneProps<'manageTokens'> { wallet: EdgeCurrencyWallet } diff --git a/src/components/scenes/MigrateWalletCalculateFeeScene.tsx b/src/components/scenes/MigrateWalletCalculateFeeScene.tsx index 24fa3fba9a0..10076a5355e 100644 --- a/src/components/scenes/MigrateWalletCalculateFeeScene.tsx +++ b/src/components/scenes/MigrateWalletCalculateFeeScene.tsx @@ -12,7 +12,7 @@ import { useHandler } from '../../hooks/useHandler' import { useWatch } from '../../hooks/useWatch' import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../types/routerTypes' import { getWalletName } from '../../util/CurrencyWalletHelpers' import { convertTransactionFeeToDisplayFee, truncateDecimals } from '../../util/utils' import { SceneWrapper } from '../common/SceneWrapper' @@ -29,7 +29,7 @@ export interface MigrateWalletCalculateFeeParams { migrateWalletList: MigrateWalletItem[] } -interface Props extends EdgeSceneProps<'migrateWalletCalculateFee'> {} +interface Props extends EdgeAppSceneProps<'migrateWalletCalculateFee'> {} type AssetRowState = string | Error @@ -126,7 +126,9 @@ const MigrateWalletCalculateFeeComponent = (props: Props) => { const handleInsufficientFunds = useHandler(async (wallet, error) => { const { countryCode } = await getFirstOpenInfo() - await Airship.show(bridge => ) + await Airship.show(bridge => ( + + )) }) const handleSlidingComplete = useHandler(() => { diff --git a/src/components/scenes/MigrateWalletCompletionScene.tsx b/src/components/scenes/MigrateWalletCompletionScene.tsx index e4dfb0fa533..7403e25e44d 100644 --- a/src/components/scenes/MigrateWalletCompletionScene.tsx +++ b/src/components/scenes/MigrateWalletCompletionScene.tsx @@ -13,7 +13,7 @@ import { useHandler } from '../../hooks/useHandler' import { useWatch } from '../../hooks/useWatch' import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { getWalletName } from '../../util/CurrencyWalletHelpers' import { SceneWrapper } from '../common/SceneWrapper' import { showError } from '../services/AirshipInstance' @@ -27,7 +27,7 @@ export interface MigrateWalletCompletionParams { migrateWalletList: MigrateWalletItem[] } -interface Props extends EdgeSceneProps<'migrateWalletCompletion'> {} +interface Props extends EdgeAppSceneProps<'migrateWalletCompletion'> {} interface MigrateWalletTokenItem extends MigrateWalletItem { tokenId: string @@ -239,7 +239,7 @@ const MigrateWalletCompletionComponent = (props: Props) => { label={!done ? undefined : lstrings.string_done_cap} type="secondary" marginRem={[0, 0, 1]} - onPress={() => navigation.navigate('walletsTab', { screen: 'walletList' })} + onPress={() => navigation.navigate('edgeTabs', { screen: 'walletsTab', params: { screen: 'walletList' } })} /> ) diff --git a/src/components/scenes/MigrateWalletSelectCryptoScene.tsx b/src/components/scenes/MigrateWalletSelectCryptoScene.tsx index 1c644f02d84..b8340e9ddb0 100644 --- a/src/components/scenes/MigrateWalletSelectCryptoScene.tsx +++ b/src/components/scenes/MigrateWalletSelectCryptoScene.tsx @@ -9,7 +9,7 @@ import { useWatch } from '../../hooks/useWatch' import { lstrings } from '../../locales/strings' import { WalletCreateItem } from '../../selectors/getCreateWalletList' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { getCurrencyCode, isKeysOnlyPlugin } from '../../util/CurrencyInfoHelpers' import { getWalletName } from '../../util/CurrencyWalletHelpers' import { zeroString } from '../../util/utils' @@ -25,7 +25,7 @@ export interface MigrateWalletSelectCryptoParams { preSelectedWalletIds?: string[] } -interface Props extends EdgeSceneProps<'migrateWalletSelectCrypto'> {} +interface Props extends EdgeAppSceneProps<'migrateWalletSelectCrypto'> {} export interface MigrateWalletItem extends WalletCreateItem { createWalletIds: [string] diff --git a/src/components/scenes/NotificationScene.tsx b/src/components/scenes/NotificationScene.tsx index 52f4a3cc3a3..3c568dff2ac 100644 --- a/src/components/scenes/NotificationScene.tsx +++ b/src/components/scenes/NotificationScene.tsx @@ -5,14 +5,14 @@ import { SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstant import { useWatch } from '../../hooks/useWatch' import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { SceneWrapper } from '../common/SceneWrapper' import { CryptoIcon } from '../icons/CryptoIcon' import { showError } from '../services/AirshipInstance' import { SettingsSwitchRow } from '../settings/SettingsSwitchRow' import { SettingsTappableRow } from '../settings/SettingsTappableRow' -interface Props extends EdgeSceneProps<'notificationSettings'> {} +interface Props extends EdgeAppSceneProps<'notificationSettings'> {} type NotificationSettingToggleSetting = keyof NotificationSettings diff --git a/src/components/scenes/OtpRepairScene.tsx b/src/components/scenes/OtpRepairScene.tsx index 1c8e4701aa0..9021be3de09 100644 --- a/src/components/scenes/OtpRepairScene.tsx +++ b/src/components/scenes/OtpRepairScene.tsx @@ -5,7 +5,7 @@ import * as React from 'react' import { useHandler } from '../../hooks/useHandler' import { config } from '../../theme/appConfig' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { logEvent } from '../../util/tracking' import { SceneWrapper } from '../common/SceneWrapper' @@ -13,7 +13,7 @@ export interface OtpRepairParams { otpError: OtpError } -interface Props extends EdgeSceneProps<'otpRepair'> {} +interface Props extends EdgeAppSceneProps<'otpRepair'> {} export const OtpRepairScene = (props: Props) => { const { navigation, route } = props diff --git a/src/components/scenes/OtpSettingsScene.tsx b/src/components/scenes/OtpSettingsScene.tsx index 32c25da52a4..fa1d78e33c9 100644 --- a/src/components/scenes/OtpSettingsScene.tsx +++ b/src/components/scenes/OtpSettingsScene.tsx @@ -10,7 +10,7 @@ import { lstrings } from '../../locales/strings' import { B } from '../../styles/common/textStyles' import { config } from '../../theme/appConfig' import { connect } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { logActivity } from '../../util/logger' import { EdgeTouchableOpacity } from '../common/EdgeTouchableOpacity' import { SceneWrapper } from '../common/SceneWrapper' @@ -19,7 +19,7 @@ import { Airship, showError, showToast } from '../services/AirshipInstance' import { Theme, ThemeProps, withTheme } from '../services/ThemeContext' import { MainButton } from '../themed/MainButton' -interface OwnProps extends EdgeSceneProps<'otpSetup'> {} +interface OwnProps extends EdgeAppSceneProps<'otpSetup'> {} interface StateProps { account: EdgeAccount diff --git a/src/components/scenes/PasswordRecoveryScene.tsx b/src/components/scenes/PasswordRecoveryScene.tsx index b72b95b5e74..ae2cee314de 100644 --- a/src/components/scenes/PasswordRecoveryScene.tsx +++ b/src/components/scenes/PasswordRecoveryScene.tsx @@ -4,11 +4,11 @@ import * as React from 'react' import { useHandler } from '../../hooks/useHandler' import { config } from '../../theme/appConfig' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { logEvent } from '../../util/tracking' import { SceneWrapper } from '../common/SceneWrapper' -interface Props extends EdgeSceneProps<'passwordRecovery'> {} +interface Props extends EdgeAppSceneProps<'passwordRecovery'> {} export const ChangeRecoveryScene = (props: Props) => { const { navigation } = props diff --git a/src/components/scenes/PromotionSettingsScene.tsx b/src/components/scenes/PromotionSettingsScene.tsx index d2d4c14a916..ab3e883f3fc 100644 --- a/src/components/scenes/PromotionSettingsScene.tsx +++ b/src/components/scenes/PromotionSettingsScene.tsx @@ -5,7 +5,7 @@ import { activatePromotion, removePromotion } from '../../actions/AccountReferra import { lstrings } from '../../locales/strings' import { connect } from '../../types/reactRedux' import { AccountReferral, DeviceReferral } from '../../types/ReferralTypes' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { SceneWrapper } from '../common/SceneWrapper' import { TextInputModal } from '../modals/TextInputModal' import { Airship, showError } from '../services/AirshipInstance' @@ -14,7 +14,7 @@ import { SettingsHeaderRow } from '../settings/SettingsHeaderRow' import { SettingsSubHeader } from '../settings/SettingsSubHeader' import { SettingsTappableRow } from '../settings/SettingsTappableRow' -interface OwnProps extends EdgeSceneProps<'promotionSettings'> {} +interface OwnProps extends EdgeAppSceneProps<'promotionSettings'> {} interface StateProps { accountReferral: AccountReferral diff --git a/src/components/scenes/RequestScene.tsx b/src/components/scenes/RequestScene.tsx index cb7ae90adf5..d61ee0ca2fc 100644 --- a/src/components/scenes/RequestScene.tsx +++ b/src/components/scenes/RequestScene.tsx @@ -18,7 +18,7 @@ import { selectDisplayDenom } from '../../selectors/DenominationSelectors' import { getExchangeRate } from '../../selectors/WalletSelectors' import { config } from '../../theme/appConfig' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../types/routerTypes' import { getCurrencyCode, isKeysOnlyPlugin } from '../../util/CurrencyInfoHelpers' import { getAvailableBalance, getWalletName } from '../../util/CurrencyWalletHelpers' import { triggerHaptic } from '../../util/haptic' @@ -51,7 +51,7 @@ export interface RequestParams { walletId: string } -interface OwnProps extends EdgeSceneProps<'request'> { +interface OwnProps extends EdgeAppSceneProps<'request'> { wallet: EdgeCurrencyWallet } @@ -260,7 +260,7 @@ export class RequestSceneComponent extends React.Component { const { navigation } = this.props const result = await Airship.show(bridge => ( - + )) if (result?.type === 'wallet') { const { walletId, tokenId } = result @@ -297,7 +297,7 @@ export class RequestSceneComponent extends React.Component - {lstrings.backup_for_transfer_message} + {sprintf(lstrings.backup_for_transfer_message, config.appName)} @@ -650,7 +650,7 @@ export const RequestScene = withWallet((props: OwnProps) => { wallet={wallet} refreshAllFioAddresses={async () => await dispatch(refreshAllFioAddresses())} onSelectWallet={async (walletId: string, tokenId: EdgeTokenId) => { - await dispatch(selectWalletToken({ navigation, walletId, tokenId })) + await dispatch(selectWalletToken({ navigation: navigation as NavigationBase, walletId, tokenId })) }} toggleAccountBalanceVisibility={() => dispatch(toggleAccountBalanceVisibility())} /> diff --git a/src/components/scenes/SecurityAlertsScene.tsx b/src/components/scenes/SecurityAlertsScene.tsx index 93b70ff033a..35e22c0fde5 100644 --- a/src/components/scenes/SecurityAlertsScene.tsx +++ b/src/components/scenes/SecurityAlertsScene.tsx @@ -3,11 +3,11 @@ import * as React from 'react' import { useHandler } from '../../hooks/useHandler' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { logEvent } from '../../util/tracking' import { SceneWrapper } from '../common/SceneWrapper' -interface Props extends EdgeSceneProps<'securityAlerts'> {} +interface Props extends EdgeAppSceneProps<'securityAlerts'> {} export const SecurityAlertsScene = (props: Props) => { const { navigation } = props diff --git a/src/components/scenes/SendScene2.tsx b/src/components/scenes/SendScene2.tsx index 229b37ecdb4..209e62618a9 100644 --- a/src/components/scenes/SendScene2.tsx +++ b/src/components/scenes/SendScene2.tsx @@ -34,7 +34,7 @@ import { getExchangeDenom } from '../../selectors/DenominationSelectors' import { config } from '../../theme/appConfig' import { useState } from '../../types/reactHooks' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../types/routerTypes' import { FioRequest, GuiExchangeRates } from '../../types/types' import { getCurrencyCode } from '../../util/CurrencyInfoHelpers' import { getWalletName } from '../../util/CurrencyWalletHelpers' @@ -68,7 +68,7 @@ import { ErrorTile } from '../tiles/ErrorTile' // TODO: Check contentPadding -interface Props extends EdgeSceneProps<'send2'> {} +interface Props extends EdgeAppSceneProps<'send2'> {} export interface SendScene2Params { walletId: string @@ -218,7 +218,7 @@ const SendComponent = (props: Props) => { async function showInsufficientFeesModal(error: InsufficientFundsError): Promise { const { countryCode } = await getFirstOpenInfo() await Airship.show(bridge => ( - + )) } @@ -307,7 +307,7 @@ const SendComponent = (props: Props) => { lockInputs={lockTilesMap.address} isCameraOpen={doOpenCamera} fioToAddress={fioAddress} - navigation={navigation} + navigation={navigation as NavigationBase} /> ) } @@ -414,7 +414,9 @@ const SendComponent = (props: Props) => { } const handleWalletPress = useHandler(() => { - Airship.show(bridge => ) + Airship.show(bridge => ( + + )) .then(result => { if (result?.type !== 'wallet') { return @@ -585,7 +587,7 @@ const SendComponent = (props: Props) => { return ( { // Mount/Unmount life-cycle events: useMount(() => { if (doCheckAndShowGetCryptoModal) { - dispatch(checkAndShowGetCryptoModal(navigation, coreWallet, tokenId)).catch(err => showError(err)) + dispatch(checkAndShowGetCryptoModal(navigation as NavigationBase, coreWallet, tokenId)).catch(err => showError(err)) } }) useUnmount(() => { diff --git a/src/components/scenes/SettingsScene.tsx b/src/components/scenes/SettingsScene.tsx index 7fcc02398cd..5a8e0fa7c70 100644 --- a/src/components/scenes/SettingsScene.tsx +++ b/src/components/scenes/SettingsScene.tsx @@ -29,7 +29,7 @@ import { getDefaultFiat } from '../../selectors/SettingsSelectors' import { config } from '../../theme/appConfig' import { useState } from '../../types/reactHooks' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../types/routerTypes' import { secondsToDisplay } from '../../util/displayTime' import { getDisplayUsername, removeIsoPrefix } from '../../util/utils' import { ButtonsView } from '../buttons/ButtonsView' @@ -48,7 +48,7 @@ import { SettingsLabelRow } from '../settings/SettingsLabelRow' import { SettingsSwitchRow } from '../settings/SettingsSwitchRow' import { SettingsTappableRow } from '../settings/SettingsTappableRow' -interface Props extends EdgeSceneProps<'settingsOverview'> {} +interface Props extends EdgeAppSceneProps<'settingsOverview'> {} export const SettingsScene = (props: Props) => { const { navigation } = props @@ -94,7 +94,7 @@ export const SettingsScene = (props: Props) => { const autoLogoutRightText = autoLogout.value === 0 ? lstrings.string_disable : `${autoLogout.value} ${timeStrings[autoLogout.measurement]}` const handleUpgrade = useHandler(() => { - showBackupModal({ navigation }) + showBackupModal({ navigation: navigation as NavigationBase }) }) const handleUnlock = useHandler(() => { @@ -207,7 +207,7 @@ export const SettingsScene = (props: Props) => { onSubmit={async text => { if (text !== username) return lstrings.delete_account_verification_error await account.deleteRemoteAccount() - await dispatch(logoutRequest(navigation)) + await dispatch(logoutRequest(navigation as NavigationBase)) await context.forgetAccount(rootLoginId) Airship.show(bridge => ).catch(err => showDevError(err)) return true diff --git a/src/components/scenes/SpendingLimitsScene.tsx b/src/components/scenes/SpendingLimitsScene.tsx index 565b24368b5..1266c34cfda 100644 --- a/src/components/scenes/SpendingLimitsScene.tsx +++ b/src/components/scenes/SpendingLimitsScene.tsx @@ -8,7 +8,7 @@ import { getFiatSymbol } from '../../constants/WalletAndCurrencyConstants' import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { zeroString } from '../../util/utils' import { SceneWrapper } from '../common/SceneWrapper' import { showError, showToast } from '../services/AirshipInstance' @@ -18,7 +18,7 @@ import { EdgeText } from '../themed/EdgeText' import { FilledTextInput } from '../themed/FilledTextInput' import { MainButton } from '../themed/MainButton' -interface Props extends EdgeSceneProps<'spendingLimits'> {} +interface Props extends EdgeAppSceneProps<'spendingLimits'> {} export const SpendingLimitsScene = (props: Props) => { const { navigation } = props diff --git a/src/components/scenes/Staking/EarnScene.tsx b/src/components/scenes/Staking/EarnScene.tsx index 69f655c96e0..83b6c121d43 100644 --- a/src/components/scenes/Staking/EarnScene.tsx +++ b/src/components/scenes/Staking/EarnScene.tsx @@ -11,7 +11,7 @@ import { lstrings } from '../../../locales/strings' import { getStakePlugins } from '../../../plugins/stake-plugins/stakePlugins' import { StakePlugin, StakePolicy, StakePosition } from '../../../plugins/stake-plugins/types' import { useSelector } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { getPluginFromPolicy, getPositionAllocations } from '../../../util/stakeUtils' import { zeroString } from '../../../util/utils' import { EdgeSwitch } from '../../buttons/EdgeSwitch' @@ -22,7 +22,7 @@ import { SectionHeader } from '../../common/SectionHeader' import { showDevError } from '../../services/AirshipInstance' import { cacheStyles, Theme, useTheme } from '../../services/ThemeContext' -interface Props extends EdgeSceneProps<'earnScene'> {} +interface Props extends EdgeAppSceneProps<'earnScene'> {} export interface EarnSceneParams {} diff --git a/src/components/scenes/Staking/StakeModifyScene.tsx b/src/components/scenes/Staking/StakeModifyScene.tsx index 77ee72f148f..cb138642fff 100644 --- a/src/components/scenes/Staking/StakeModifyScene.tsx +++ b/src/components/scenes/Staking/StakeModifyScene.tsx @@ -19,7 +19,7 @@ import { import { getExchangeDenomByCurrencyCode } from '../../../selectors/DenominationSelectors' import { HumanFriendlyError } from '../../../types/HumanFriendlyError' import { useSelector } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { getCurrencyIconUris } from '../../../util/CdnUris' import { getTokenIdForced, getWalletTokenId } from '../../../util/CurrencyInfoHelpers' import { getWalletName } from '../../../util/CurrencyWalletHelpers' @@ -54,7 +54,7 @@ export interface StakeModifyParams { modification: ChangeQuoteRequest['action'] } -interface Props extends EdgeSceneProps<'stakeModify'> { +interface Props extends EdgeAppSceneProps<'stakeModify'> { wallet: EdgeCurrencyWallet } diff --git a/src/components/scenes/Staking/StakeOptionsScene.tsx b/src/components/scenes/Staking/StakeOptionsScene.tsx index 02bddfbf2f2..f53b9fa2402 100644 --- a/src/components/scenes/Staking/StakeOptionsScene.tsx +++ b/src/components/scenes/Staking/StakeOptionsScene.tsx @@ -11,7 +11,7 @@ import { useIconColor } from '../../../hooks/useIconColor' import { lstrings } from '../../../locales/strings' import { StakePlugin, StakePolicy, StakePositionMap } from '../../../plugins/stake-plugins/types' import { useSelector } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { getTokenIdForced } from '../../../util/CurrencyInfoHelpers' import { getPluginFromPolicy, getPolicyAssetName, getPolicyIconUris, getPolicyTitleName } from '../../../util/stakeUtils' import { darkenHexColor } from '../../../util/utils' @@ -25,7 +25,7 @@ import { cacheStyles, Theme, useTheme } from '../../services/ThemeContext' import { EdgeText } from '../../themed/EdgeText' import { SceneHeader } from '../../themed/SceneHeader' -interface Props extends EdgeSceneProps<'stakeOptions'> { +interface Props extends EdgeAppSceneProps<'stakeOptions'> { wallet: EdgeCurrencyWallet } diff --git a/src/components/scenes/Staking/StakeOverviewScene.tsx b/src/components/scenes/Staking/StakeOverviewScene.tsx index db8f96abd2f..d405c31bf62 100644 --- a/src/components/scenes/Staking/StakeOverviewScene.tsx +++ b/src/components/scenes/Staking/StakeOverviewScene.tsx @@ -11,7 +11,7 @@ import { lstrings } from '../../../locales/strings' import { ChangeQuoteRequest, PositionAllocation, StakePlugin, StakePolicy, StakePosition } from '../../../plugins/stake-plugins/types' import { selectDisplayDenomByCurrencyCode } from '../../../selectors/DenominationSelectors' import { useDispatch, useSelector } from '../../../types/reactRedux' -import { EdgeSceneProps } from '../../../types/routerTypes' +import { EdgeAppSceneProps } from '../../../types/routerTypes' import { getTokenIdForced } from '../../../util/CurrencyInfoHelpers' import { getAllocationLocktimeMessage, getPolicyTitleName, getPositionAllocations } from '../../../util/stakeUtils' import { StyledButtonContainer } from '../../buttons/ButtonsView' @@ -26,7 +26,7 @@ import { MainButton } from '../../themed/MainButton' import { SceneHeader } from '../../themed/SceneHeader' import { CryptoFiatAmountTile } from '../../tiles/CryptoFiatAmountTile' -interface Props extends EdgeSceneProps<'stakeOverview'> { +interface Props extends EdgeAppSceneProps<'stakeOverview'> { wallet: EdgeCurrencyWallet } diff --git a/src/components/scenes/SwapConfirmationScene.tsx b/src/components/scenes/SwapConfirmationScene.tsx index 8f34b223aa3..24e033fd995 100644 --- a/src/components/scenes/SwapConfirmationScene.tsx +++ b/src/components/scenes/SwapConfirmationScene.tsx @@ -17,7 +17,7 @@ import { getExchangeDenom, selectDisplayDenom } from '../../selectors/Denominati import { convertCurrency } from '../../selectors/WalletSelectors' import { useDispatch, useSelector } from '../../types/reactRedux' import { ThunkAction } from '../../types/reduxTypes' -import { EdgeSceneProps } from '../../types/routerTypes' +import { SwapTabSceneProps } from '../../types/routerTypes' import { GuiSwapInfo } from '../../types/types' import { getSwapPluginIconUri } from '../../util/CdnUris' import { CryptoAmount } from '../../util/CryptoAmount' @@ -50,7 +50,7 @@ export interface SwapConfirmationParams { onApprove: () => void } -interface Props extends EdgeSceneProps<'swapConfirmation'> {} +interface Props extends SwapTabSceneProps<'swapConfirmation'> {} interface Section { title: { title: string; rightTitle: string } diff --git a/src/components/scenes/SwapCreateScene.tsx b/src/components/scenes/SwapCreateScene.tsx index 4d30a9fe90c..ab8b9cb5c94 100644 --- a/src/components/scenes/SwapCreateScene.tsx +++ b/src/components/scenes/SwapCreateScene.tsx @@ -22,7 +22,7 @@ import { useHandler } from '../../hooks/useHandler' import { useWatch } from '../../hooks/useWatch' import { lstrings } from '../../locales/strings' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { NavigationBase, SwapTabSceneProps } from '../../types/routerTypes' import { getCurrencyCode } from '../../util/CurrencyInfoHelpers' import { getWalletName } from '../../util/CurrencyWalletHelpers' import { zeroString } from '../../util/utils' @@ -59,7 +59,7 @@ export interface SwapErrorDisplayInfo { error: unknown } -interface Props extends EdgeSceneProps<'swapCreate'> {} +interface Props extends SwapTabSceneProps<'swapCreate'> {} export const SwapCreateScene = (props: Props) => { const { navigation, route } = props @@ -223,7 +223,7 @@ export const SwapCreateScene = (props: Props) => { const result = await Airship.show(bridge => ( void } -interface Props extends EdgeSceneProps<'swapProcessing'> {} +interface Props extends SwapTabSceneProps<'swapProcessing'> {} export function SwapProcessingScene(props: Props) { const { route, navigation } = props @@ -83,7 +84,7 @@ export function SwapProcessingScene(props: Props) { return ( - navigation={navigation} + navigation={navigation as NavigationBase} doWork={doWork} onCancel={onCancel} onDone={onDone} @@ -111,6 +112,9 @@ function processSwapQuoteError({ // Some plugins get the insufficient funds error wrong: const errorMessage = error instanceof Error ? error.message : String(error) + // Track swap errors to sentry: + trackSwapError(error, swapRequest) + // Check for known error types: const insufficientFunds = asMaybeInsufficientFundsError(error) if (insufficientFunds != null || errorMessage === 'InsufficientFundsError') { @@ -179,3 +183,36 @@ function processSwapQuoteError({ error } } + +/** + * REVIEWER BEWARE!! + * + * No specific account/wallet information should be included within the + * scope for this capture. No personal information such as wallet IDs, + * public keys, or transaction details, amounts, should be collected + * according to Edge's company policy. + */ +function trackSwapError(error: unknown, swapRequest: EdgeSwapRequest): void { + captureException(error, scope => { + // This is a warning level error because it's expected to occur but not wanted. + scope.setLevel('warning') + // Searchable tags: + scope.setTags({ + errorType: 'swapQuoteFailure', + swapFromWalletKind: swapRequest.fromWallet.currencyInfo.pluginId, + swapFromCurrency: getCurrencyCode(swapRequest.fromWallet, swapRequest.fromTokenId), + swapToCurrency: getCurrencyCode(swapRequest.toWallet, swapRequest.toTokenId), + swapToWalletKind: swapRequest.toWallet.currencyInfo.pluginId, + swapDirectionType: swapRequest.quoteFor + }) + // Unsearchable context data: + scope.setContext('Swap Request Details', { + fromTokenId: String(swapRequest.fromTokenId), // Stringify to include "null" + fromWalletType: swapRequest.fromWallet.type, + toTokenId: String(swapRequest.toTokenId), // Stringify to include "null" + toWalletType: swapRequest.fromWallet.type, + quoteFor: swapRequest.quoteFor + }) + return scope + }) +} diff --git a/src/components/scenes/SwapSettingsScene.tsx b/src/components/scenes/SwapSettingsScene.tsx index ae429ffe10d..276f307bd6a 100644 --- a/src/components/scenes/SwapSettingsScene.tsx +++ b/src/components/scenes/SwapSettingsScene.tsx @@ -13,7 +13,7 @@ import { SCROLL_INDICATOR_INSET_FIX } from '../../constants/constantSettings' import { lstrings } from '../../locales/strings' import { connect } from '../../types/reactRedux' import { AccountReferral } from '../../types/ReferralTypes' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { PluginTweak } from '../../types/TweakTypes' import { getSwapPluginIconUri } from '../../util/CdnUris' import { bestOfPlugins } from '../../util/ReferralHelpers' @@ -26,7 +26,7 @@ import { SettingsSubHeader } from '../settings/SettingsSubHeader' import { SettingsSwitchRow } from '../settings/SettingsSwitchRow' import { SettingsTappableRow } from '../settings/SettingsTappableRow' -interface OwnProps extends EdgeSceneProps<'swapSettings'> {} +interface OwnProps extends EdgeAppSceneProps<'swapSettings'> {} interface DispatchProps { changePreferredSwapPlugin: (pluginId: string | undefined) => void diff --git a/src/components/scenes/SwapSuccessScene.tsx b/src/components/scenes/SwapSuccessScene.tsx index cdcc5d64699..fbda4e15fb0 100644 --- a/src/components/scenes/SwapSuccessScene.tsx +++ b/src/components/scenes/SwapSuccessScene.tsx @@ -7,7 +7,7 @@ import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { needToShowConfetti } from '../../util/show-confetti' import { SceneButtons } from '../buttons/SceneButtons' import { EdgeAnim, fadeIn } from '../common/EdgeAnim' @@ -20,7 +20,7 @@ export interface SwapSuccessParams { walletId: string } -interface Props extends EdgeSceneProps<'swapSuccess'> {} +interface Props extends EdgeAppSceneProps<'swapSuccess'> {} const confettiProps = { count: 250, @@ -42,11 +42,15 @@ export const SwapSuccessScene = (props: Props) => { const handleDone = useHandler(() => { setShowButton(false) - navigation.navigate('swapTab', { screen: 'swapCreate' }) + // Reset swap navigation stack: + navigation.navigate('edgeTabs', { screen: 'swapTab', params: { screen: 'swapCreate' } }) }) const handleTransactionDetails = useHandler(() => { - navigation.replace('transactionDetails', { edgeTransaction, walletId, onDone: handleDone }) + // Reset swap navigation stack: + navigation.navigate('edgeTabs', { screen: 'swapTab', params: { screen: 'swapCreate' } }) + // Navigate to transaction details: + navigation.navigate('transactionDetails', { edgeTransaction, walletId, onDone: handleDone }) }) useAsyncEffect( diff --git a/src/components/scenes/SweepPrivateKeyCalculateFeeScene.tsx b/src/components/scenes/SweepPrivateKeyCalculateFeeScene.tsx index 118b576ca3a..146431b11de 100644 --- a/src/components/scenes/SweepPrivateKeyCalculateFeeScene.tsx +++ b/src/components/scenes/SweepPrivateKeyCalculateFeeScene.tsx @@ -18,7 +18,7 @@ import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../types/routerTypes' import { convertTransactionFeeToDisplayFee, truncateDecimals } from '../../util/utils' import { SceneWrapper } from '../common/SceneWrapper' import { InsufficientFeesModal } from '../modals/InsufficientFeesModal' @@ -36,7 +36,7 @@ export interface SweepPrivateKeyCalculateFeeParams { sweepPrivateKeyList: SweepPrivateKeyItem[] } -interface Props extends EdgeSceneProps<'sweepPrivateKeyCalculateFee'> {} +interface Props extends EdgeAppSceneProps<'sweepPrivateKeyCalculateFee'> {} const SweepPrivateKeyCalculateFeeComponent = (props: Props) => { const { navigation, route } = props @@ -112,7 +112,9 @@ const SweepPrivateKeyCalculateFeeComponent = (props: Props) => { const handleInsufficientFunds = useHandler(async (wallet, error) => { const { countryCode } = await getFirstOpenInfo() - await Airship.show(bridge => ) + await Airship.show(bridge => ( + + )) }) const handleSlidingComplete = useHandler(() => { diff --git a/src/components/scenes/SweepPrivateKeyCompletionScene.tsx b/src/components/scenes/SweepPrivateKeyCompletionScene.tsx index 404c001394d..cc21314c667 100644 --- a/src/components/scenes/SweepPrivateKeyCompletionScene.tsx +++ b/src/components/scenes/SweepPrivateKeyCompletionScene.tsx @@ -9,7 +9,7 @@ import { SCROLL_INDICATOR_INSET_FIX } from '../../constants/constantSettings' import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { getWalletName } from '../../util/CurrencyWalletHelpers' import { SceneWrapper } from '../common/SceneWrapper' import { showError } from '../services/AirshipInstance' @@ -24,7 +24,7 @@ export interface SweepPrivateKeyCompletionParams { unsignedEdgeTransactions: EdgeTransaction[] } -interface Props extends EdgeSceneProps<'sweepPrivateKeyCompletion'> {} +interface Props extends EdgeAppSceneProps<'sweepPrivateKeyCompletion'> {} const SweepPrivateKeyCompletionComponent = (props: Props) => { const { navigation, route } = props @@ -137,13 +137,13 @@ const SweepPrivateKeyCompletionComponent = (props: Props) => { label={!done ? undefined : lstrings.string_done_cap} type="secondary" marginRem={[0, 0, 1]} - onPress={() => navigation.navigate('walletsTab', { screen: 'walletList' })} + onPress={() => navigation.navigate('edgeTabs', { screen: 'walletsTab', params: { screen: 'walletList' } })} /> ) }, [done, navigation, styles.bottomButton]) - const keyExtractor = useHandler((tx: EdgeTransaction) => tx.walletId + tx.tokenId ?? '') + const keyExtractor = useHandler((tx: EdgeTransaction) => tx.walletId + tx.tokenId) return ( diff --git a/src/components/scenes/SweepPrivateKeyProcessingScene.tsx b/src/components/scenes/SweepPrivateKeyProcessingScene.tsx index 0e2c3912a42..b31e53d8bea 100644 --- a/src/components/scenes/SweepPrivateKeyProcessingScene.tsx +++ b/src/components/scenes/SweepPrivateKeyProcessingScene.tsx @@ -2,7 +2,7 @@ import { EdgeCurrencyWallet, EdgeMemoryWallet, EdgeTokenId } from 'edge-core-js' import * as React from 'react' import { lstrings } from '../../locales/strings' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../types/routerTypes' import { zeroString } from '../../util/utils' import { CancellableProcessingScene } from '../progress-indicators/CancellableProcessingScene' import { showError } from '../services/AirshipInstance' @@ -20,7 +20,7 @@ export interface SweepPrivateKeyItem { tokenId: EdgeTokenId } -interface Props extends EdgeSceneProps<'sweepPrivateKeyProcessing'> {} +interface Props extends EdgeAppSceneProps<'sweepPrivateKeyProcessing'> {} export function SweepPrivateKeyProcessingScene(props: Props) { const { route, navigation } = props @@ -81,7 +81,7 @@ export function SweepPrivateKeyProcessingScene(props: Props) { return ( {} +interface Props extends EdgeAppSceneProps<'sweepPrivateKeySelectCrypto'> {} const SweepPrivateKeySelectCryptoComponent = (props: Props) => { const { navigation, route } = props diff --git a/src/components/scenes/TransactionDetailsScene.tsx b/src/components/scenes/TransactionDetailsScene.tsx index 2c7fcfd527c..83410a04f74 100644 --- a/src/components/scenes/TransactionDetailsScene.tsx +++ b/src/components/scenes/TransactionDetailsScene.tsx @@ -19,7 +19,7 @@ import { toPercentString } from '../../locales/intl' import { lstrings } from '../../locales/strings' import { getExchangeDenom } from '../../selectors/DenominationSelectors' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { getCurrencyCodeWithAccount } from '../../util/CurrencyInfoHelpers' import { matchJson } from '../../util/matchJson' import { getMemoTitle } from '../../util/memoUtils' @@ -43,7 +43,7 @@ import { Airship, showError, showToast } from '../services/AirshipInstance' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { EdgeText } from '../themed/EdgeText' -interface Props extends EdgeSceneProps<'transactionDetails'> { +interface Props extends EdgeAppSceneProps<'transactionDetails'> { wallet: EdgeCurrencyWallet } diff --git a/src/components/scenes/TransactionListScene.tsx b/src/components/scenes/TransactionListScene.tsx index fca01b84a4a..86953c559e6 100644 --- a/src/components/scenes/TransactionListScene.tsx +++ b/src/components/scenes/TransactionListScene.tsx @@ -17,7 +17,7 @@ import { getExchangeDenomByCurrencyCode } from '../../selectors/DenominationSele import { FooterRender } from '../../state/SceneFooterState' import { useSceneScrollHandler } from '../../state/SceneScrollState' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps, NavigationBase } from '../../types/routerTypes' +import { NavigationBase, WalletsTabSceneProps } from '../../types/routerTypes' import { infoServerData } from '../../util/network' import { calculateSpamThreshold, darkenHexColor, unixToLocaleDateTime, zeroString } from '../../util/utils' import { InfoCardCarousel } from '../cards/InfoCardCarousel' @@ -41,7 +41,7 @@ export interface TransactionListParams { } type ListItem = EdgeTransaction | string | null -interface Props extends EdgeSceneProps<'transactionList'> { +interface Props extends WalletsTabSceneProps<'transactionList'> { wallet: EdgeCurrencyWallet } @@ -150,7 +150,7 @@ function TransactionListComponent(props: Props) { async () => { if (unactivatedTokenIds.length > 0) { if (unactivatedTokenIds.some(unactivatedTokenId => unactivatedTokenId === tokenId)) { - await dispatch(activateWalletTokens(navigation, wallet, [tokenId])) + await dispatch(activateWalletTokens(navigation as NavigationBase, wallet, [tokenId])) } } }, @@ -218,7 +218,7 @@ function TransactionListComponent(props: Props) { @@ -251,7 +251,7 @@ function TransactionListComponent(props: Props) { } return ( - + ) }) diff --git a/src/components/scenes/TransactionsExportScene.tsx b/src/components/scenes/TransactionsExportScene.tsx index db228fe6368..c95c7cb223d 100644 --- a/src/components/scenes/TransactionsExportScene.tsx +++ b/src/components/scenes/TransactionsExportScene.tsx @@ -12,7 +12,7 @@ import { formatDate } from '../../locales/intl' import { lstrings } from '../../locales/strings' import { getExchangeDenom, getExchangeDenomByCurrencyCode, selectDisplayDenomByCurrencyCode } from '../../selectors/DenominationSelectors' import { connect } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { getTokenIdForced } from '../../util/CurrencyInfoHelpers' import { getWalletName } from '../../util/CurrencyWalletHelpers' import { SceneWrapper } from '../common/SceneWrapper' @@ -22,7 +22,6 @@ import { Airship, showError, showToast } from '../services/AirshipInstance' import { ThemeProps, withTheme } from '../services/ThemeContext' import { SettingsHeaderRow } from '../settings/SettingsHeaderRow' import { SettingsLabelRow } from '../settings/SettingsLabelRow' -import { SettingsRadioRow } from '../settings/SettingsRadioRow' import { SettingsRow } from '../settings/SettingsRow' import { SettingsSwitchRow } from '../settings/SettingsSwitchRow' import { MainButton } from '../themed/MainButton' @@ -38,7 +37,7 @@ interface File { fileName: string // wallet-btc-2020.csv } -interface OwnProps extends EdgeSceneProps<'transactionsExport'> {} +interface OwnProps extends EdgeAppSceneProps<'transactionsExport'> {} interface StateProps { account: EdgeAccount @@ -119,6 +118,7 @@ class TransactionsExportSceneComponent extends React.PureComponent const tokenCurrencyCode = tokenId ?? sourceWallet.currencyInfo.currencyCode const { isExportBitwave, isExportCsv, isExportQbo } = exportTxInfoMap[tokenCurrencyCode] + this.setState({ isExportBitwave, isExportCsv, @@ -149,24 +149,13 @@ class TransactionsExportSceneComponent extends React.PureComponent } label={lstrings.export_transaction_export_type} /> - {Platform.OS === 'android' ? this.renderAndroidSwitches() : this.renderIosSwitches()} + {this.renderSwitches()} {disabledExport ? null : } ) } - renderAndroidSwitches() { - const { isExportBitwave, isExportCsv, isExportQbo } = this.state - return ( - <> - - - - - ) - } - - renderIosSwitches() { + renderSwitches() { const { isExportBitwave, isExportCsv, isExportQbo } = this.state return ( <> @@ -190,27 +179,15 @@ class TransactionsExportSceneComponent extends React.PureComponent } handleQboToggle = () => { - if (Platform.OS === 'android') { - this.setState({ isExportQbo: true, isExportCsv: false, isExportBitwave: false }) - } else { - this.setState(state => ({ isExportQbo: !state.isExportQbo })) - } + this.setState(state => ({ isExportQbo: !state.isExportQbo })) } handleCsvToggle = () => { - if (Platform.OS === 'android') { - this.setState({ isExportCsv: true, isExportBitwave: false, isExportQbo: false }) - } else { - this.setState(state => ({ isExportCsv: !state.isExportCsv })) - } + this.setState(state => ({ isExportCsv: !state.isExportCsv })) } handleBitwaveToggle = () => { - if (Platform.OS === 'android') { - this.setState({ isExportBitwave: true, isExportCsv: false, isExportQbo: false }) - } else { - this.setState(state => ({ isExportBitwave: !state.isExportBitwave })) - } + this.setState(state => ({ isExportBitwave: !state.isExportBitwave })) } handleSubmit = async (): Promise => { @@ -350,24 +327,27 @@ class TransactionsExportSceneComponent extends React.PureComponent const title = 'Share Transactions ' + formats.join(', ') if (Platform.OS === 'android') { - await this.shareAndroid(title, files[0]) + await this.shareAndroid(title, files) } else { await this.shareIos(title, files) } } - async shareAndroid(title: string, file: File): Promise { + async shareAndroid(title: string, files: File[]): Promise { try { const directory = RNFS.ExternalCachesDirectoryPath - const url = `file://${directory}/${file.fileName}` - await RNFS.writeFile(`${directory}/${file.fileName}`, file.contents, 'utf8') + const urls: string[] = [] + for (const file of files) { + const url = `file://${directory}/${file.fileName}` + urls.push(url) + await RNFS.writeFile(`${directory}/${file.fileName}`, file.contents, 'utf8') + } await Share.open({ title, message: '', - url, + urls, failOnCancel: false, - filename: file.fileName, subject: title }).catch(error => console.log('Share error', error)) } catch (error: any) { diff --git a/src/components/scenes/UpgradeUsernameScreen.tsx b/src/components/scenes/UpgradeUsernameScreen.tsx index bd1f77a7100..27a0f7f90ad 100644 --- a/src/components/scenes/UpgradeUsernameScreen.tsx +++ b/src/components/scenes/UpgradeUsernameScreen.tsx @@ -3,12 +3,12 @@ import * as React from 'react' import { useHandler } from '../../hooks/useHandler' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { logActivity } from '../../util/logger' import { logEvent } from '../../util/tracking' import { SceneWrapper } from '../common/SceneWrapper' -interface Props extends EdgeSceneProps<'upgradeUsername'> {} +interface Props extends EdgeAppSceneProps<'upgradeUsername'> {} export const UpgradeUsernameScene = (props: Props) => { const { navigation } = props diff --git a/src/components/scenes/WalletListScene.tsx b/src/components/scenes/WalletListScene.tsx index 5af75810981..417a98b8d89 100644 --- a/src/components/scenes/WalletListScene.tsx +++ b/src/components/scenes/WalletListScene.tsx @@ -8,7 +8,7 @@ import { useWatch } from '../../hooks/useWatch' import { lstrings } from '../../locales/strings' import { FooterRender, useSceneFooterState } from '../../state/SceneFooterState' import { useDispatch, useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { NavigationBase, WalletsTabSceneProps } from '../../types/routerTypes' import { EdgeButton } from '../buttons/EdgeButton' import { SceneButtons } from '../buttons/SceneButtons' import { CrossFade } from '../common/CrossFade' @@ -23,7 +23,7 @@ import { WalletListHeader } from '../themed/WalletListHeader' import { WalletListSortable } from '../themed/WalletListSortable' import { WalletListSwipeable } from '../themed/WalletListSwipeable' -interface Props extends EdgeSceneProps<'walletList'> {} +interface Props extends WalletsTabSceneProps<'walletList'> {} export function WalletListScene(props: Props) { const { navigation } = props @@ -94,7 +94,7 @@ export function WalletListScene(props: Props) { // const renderHeader = React.useMemo(() => { - return + return }, [handleSort, navigation, isSearching, sorting]) const renderListFooter = React.useMemo(() => { diff --git a/src/components/scenes/WalletRestoreScene.tsx b/src/components/scenes/WalletRestoreScene.tsx index 83427f9cbad..f9eefcfc6cf 100644 --- a/src/components/scenes/WalletRestoreScene.tsx +++ b/src/components/scenes/WalletRestoreScene.tsx @@ -7,7 +7,7 @@ import { useWatch } from '../../hooks/useWatch' import { toLocaleDate } from '../../locales/intl' import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { FlatListItem } from '../../types/types' import { findCurrencyInfo } from '../../util/CurrencyInfoHelpers' import { logActivity } from '../../util/logger' @@ -24,7 +24,7 @@ import { SceneHeaderUi4 } from '../themed/SceneHeaderUi4' import { SimpleTextInput } from '../themed/SimpleTextInput' import { WalletListSectionHeader } from '../themed/WalletListSectionHeader' -interface Props extends EdgeSceneProps<'walletRestore'> {} +interface Props extends EdgeAppSceneProps<'walletRestore'> {} export function WalletRestoreScene(props: Props) { const { navigation } = props @@ -64,7 +64,7 @@ export function WalletRestoreScene(props: Props) { await account.changeWalletStates(states) logActivity(`Restore Wallets: ${account.username}`) - navigation.navigate('walletsTab', { screen: 'walletList' }) + navigation.navigate('edgeTabs', { screen: 'walletsTab', params: { screen: 'walletList' } }) } }) diff --git a/src/components/scenes/WcConnectScene.tsx b/src/components/scenes/WcConnectScene.tsx index e1c6b1f3bd4..7120b4c6159 100644 --- a/src/components/scenes/WcConnectScene.tsx +++ b/src/components/scenes/WcConnectScene.tsx @@ -13,7 +13,7 @@ import { useUnmount } from '../../hooks/useUnmount' import { useWalletConnect } from '../../hooks/useWalletConnect' import { useWalletName } from '../../hooks/useWalletName' import { lstrings } from '../../locales/strings' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../types/routerTypes' import { EdgeAsset } from '../../types/types' import { truncateString } from '../../util/utils' import { ButtonsView } from '../buttons/ButtonsView' @@ -28,7 +28,7 @@ import { EdgeText } from '../themed/EdgeText' import { SceneHeader } from '../themed/SceneHeader' import { SelectableRow } from '../themed/SelectableRow' -interface Props extends EdgeSceneProps<'wcConnect'> { +interface Props extends EdgeAppSceneProps<'wcConnect'> { wallet: EdgeCurrencyWallet } @@ -80,7 +80,13 @@ export const WcConnectScene = withWallet((props: Props) => { const handleWalletListModal = useHandler(async () => { const result = await Airship.show(bridge => ( - + )) if (result?.type === 'wallet') { const { walletId } = result diff --git a/src/components/scenes/WcConnectionsScene.tsx b/src/components/scenes/WcConnectionsScene.tsx index 00c32edc8e2..bef858768d0 100644 --- a/src/components/scenes/WcConnectionsScene.tsx +++ b/src/components/scenes/WcConnectionsScene.tsx @@ -16,7 +16,7 @@ import { useMount } from '../../hooks/useMount' import { UNSUPPORTED_WC_VERSION, useWalletConnect, walletConnectClient } from '../../hooks/useWalletConnect' import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps, NavigationBase } from '../../types/routerTypes' import { EdgeAsset, WcConnectionInfo } from '../../types/types' import { EdgeTouchableOpacity } from '../common/EdgeTouchableOpacity' import { SceneWrapper } from '../common/SceneWrapper' @@ -28,7 +28,7 @@ import { EdgeText } from '../themed/EdgeText' import { MainButton } from '../themed/MainButton' import { SceneHeader } from '../themed/SceneHeader' -interface Props extends EdgeSceneProps<'wcConnections'> {} +interface Props extends EdgeAppSceneProps<'wcConnections'> {} const NO_WALLETS_DAPP_REQUIREMENTS = 'NO_WALLETS_DAPP_REQUIREMENTS' export interface WcConnectionsParams { @@ -77,7 +77,13 @@ export const WcConnectionsScene = (props: Props) => { } const edgeTokenIds = getProposalNamespaceCompatibleEdgeTokenIds(proposal, account.currencyConfig) const result = await Airship.show(bridge => ( - + )) if (result?.type === 'wallet') { @@ -103,7 +109,7 @@ export const WcConnectionsScene = (props: Props) => { // Show the scam warning modal if needed await showScamWarningModal('firstWalletConnect') - if (checkAndShowLightBackupModal(account, navigation)) { + if (checkAndShowLightBackupModal(account, navigation as NavigationBase)) { return await Promise.resolve() } else { const result = await Airship.show(bridge => ( diff --git a/src/components/scenes/WcDisconnectScene.tsx b/src/components/scenes/WcDisconnectScene.tsx index a5221b62480..2bd1cc25294 100644 --- a/src/components/scenes/WcDisconnectScene.tsx +++ b/src/components/scenes/WcDisconnectScene.tsx @@ -4,7 +4,7 @@ import FastImage from 'react-native-fast-image' import { useWalletConnect } from '../../hooks/useWalletConnect' import { lstrings } from '../../locales/strings' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { WcConnectionInfo } from '../../types/types' import { EdgeCard } from '../cards/EdgeCard' import { SceneWrapper } from '../common/SceneWrapper' @@ -15,7 +15,7 @@ import { EdgeText } from '../themed/EdgeText' import { MainButton } from '../themed/MainButton' import { SceneHeader } from '../themed/SceneHeader' -interface Props extends EdgeSceneProps<'wcDisconnect'> {} +interface Props extends EdgeAppSceneProps<'wcDisconnect'> {} export interface WcDisconnectParams { wcConnectionInfo: WcConnectionInfo diff --git a/src/components/scenes/WebViewScene.tsx b/src/components/scenes/WebViewScene.tsx index 4af7cdb7b8f..21ef2faa1d8 100644 --- a/src/components/scenes/WebViewScene.tsx +++ b/src/components/scenes/WebViewScene.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { WebView } from 'react-native-webview' -import { EdgeSceneProps } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { SceneWrapper } from '../common/SceneWrapper' export interface WebViewSceneParams { @@ -9,7 +9,7 @@ export interface WebViewSceneParams { uri: string } -interface Props extends EdgeSceneProps<'webView'> {} +interface Props extends EdgeAppSceneProps<'webView'> {} export const WebViewScene = (props: Props) => { const { uri } = props.route.params diff --git a/src/components/services/AirshipInstance.tsx b/src/components/services/AirshipInstance.tsx index 7f015a5ee0b..98e6cb82d92 100644 --- a/src/components/services/AirshipInstance.tsx +++ b/src/components/services/AirshipInstance.tsx @@ -24,14 +24,7 @@ export function showError(error: unknown, options: ShowErrorWarningOptions = {}) const tagMessage = tag == null ? '' : ` Tag: ${tag}.` const translatedMessage = translateError(error) + tagMessage if (doTrackError) { - if (error instanceof Error) { - // Log error with stack trace and a translated message to bug tracker - error.message = translatedMessage - trackError(error) - } else { - // Any other types we just send the translated message to bug tracker - trackError(translatedMessage) - } + trackError(error) } console.log(redText('Showing error drop-down alert: ' + makeErrorLog(error))) @@ -84,7 +77,7 @@ export function showWarning(error: unknown, options: ShowErrorWarningOptions = { const { trackError: doTrackError = true, tag } = options const translatedError = tag ? `Tag: ${tag}. ` + translateError(error) : translateError(error) if (doTrackError) { - trackError(`showWarning: ${translatedError}`) + trackError(error, tag) } console.log(yellowText('Showing warning drop-down alert: ' + makeErrorLog(error))) Airship.show(bridge => ).catch(err => console.error(err)) diff --git a/src/components/services/EdgeCoreManager.tsx b/src/components/services/EdgeCoreManager.tsx index d4669143962..7cbcf301133 100644 --- a/src/components/services/EdgeCoreManager.tsx +++ b/src/components/services/EdgeCoreManager.tsx @@ -14,6 +14,7 @@ import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useHandler } from '../../hooks/useHandler' import { useIsAppForeground } from '../../hooks/useIsAppForeground' import { lstrings } from '../../locales/strings' +import { addMetadataToContext } from '../../util/addMetadataToContext' import { allPlugins } from '../../util/corePlugins' import { fakeUser } from '../../util/fake-user' import { isMaestro } from '../../util/maestro' @@ -29,7 +30,8 @@ const SYNC_TEST_SERVER = 'https://sync-tester-us1.edge.app' interface Props {} const contextOptions: EdgeContextOptions = { - apiKey: ENV.AIRBITZ_API_KEY, + apiKey: ENV.EDGE_API_KEY, + apiSecret: ENV.EDGE_API_SECRET, appId: '', deviceDescription: `${getBrand()} ${getDeviceId()}`, @@ -67,8 +69,20 @@ const crashReporter: EdgeCrashReporter = { }) }, logCrash(event) { - const eventString = JSON.stringify(event, null, 2) - captureException(eventString, { level: 'fatal' }) + // Index the crash error by the source and original error name: + const error = new Error(`${event.source}: ${String(event.error)}`) + // All of these crash errors are grouped together using this error name: + error.name = 'EdgeCrashLog' + + captureException(error, scope => { + scope.setLevel('fatal') + + const context: Record = {} + addMetadataToContext(context, event.metadata) + scope.setContext('Edge Crash Metadata', context) + + return scope + }) } } diff --git a/src/components/themed/ManageTokensRow.tsx b/src/components/themed/ManageTokensRow.tsx index 57c2f183794..b8cd50098c0 100644 --- a/src/components/themed/ManageTokensRow.tsx +++ b/src/components/themed/ManageTokensRow.tsx @@ -9,7 +9,7 @@ import { useHandler } from '../../hooks/useHandler' import { usePendingPressAnimation } from '../../hooks/usePendingPress' import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' -import { NavigationProp } from '../../types/routerTypes' +import { EdgeAppSceneProps } from '../../types/routerTypes' import { getWalletName } from '../../util/CurrencyWalletHelpers' import { logActivity } from '../../util/logger' import { EdgeTouchableOpacity } from '../common/EdgeTouchableOpacity' @@ -19,7 +19,7 @@ import { EdgeText } from './EdgeText' export interface Props { // Scene properties: - navigation: NavigationProp<'manageTokens'> + navigation: EdgeAppSceneProps<'manageTokens'>['navigation'] wallet: EdgeCurrencyWallet // Token information: diff --git a/src/components/themed/SideMenu.tsx b/src/components/themed/SideMenu.tsx index 08dfd3f5f78..d1d9d5d7169 100644 --- a/src/components/themed/SideMenu.tsx +++ b/src/components/themed/SideMenu.tsx @@ -26,7 +26,7 @@ import { lstrings } from '../../locales/strings' import { getDefaultFiat } from '../../selectors/SettingsSelectors' import { config } from '../../theme/appConfig' import { useDispatch, useSelector } from '../../types/reactRedux' -import { NavigationBase } from '../../types/routerTypes' +import { DrawerSceneProps, NavigationBase } from '../../types/routerTypes' import { parseDeepLink } from '../../util/DeepLinkParser' import { getDisplayUsername } from '../../util/utils' import { IONIA_SUPPORTED_FIATS } from '../cards/VisaCardCard' @@ -45,8 +45,10 @@ const footerGradientStart = { x: 0, y: 0 } const footerGradientEnd = { x: 0, y: 0.75 } export function SideMenu(props: DrawerContentComponentProps) { - // Fix this type assertion (seems like DrawerContentComponentProps works just fine as NavigationBase?) - const navigation: NavigationBase = props.navigation as any + // Fix this type assertion (seems like DrawerContentComponentProps works just + // fine as NavigationBase?) + const { navigation } = props as any as DrawerSceneProps<'edgeAppStack'> + const navigationBase = props.navigation as any as NavigationBase const isDrawerOpen = useDrawerStatus() === 'open' const dispatch = useDispatch() @@ -90,7 +92,7 @@ export function SideMenu(props: DrawerContentComponentProps) { const handleDeleteAccount = (userInfo: EdgeUserInfo) => () => { if (userInfo.username == null) { - showBackupModal({ navigation, forgetLoginId: userInfo.loginId }) + showBackupModal({ navigation: navigationBase, forgetLoginId: userInfo.loginId }) } else { Airship.show<'ok' | 'cancel' | undefined>(bridge => ( () => { dispatch( - logoutRequest(navigation, { + logoutRequest(navigationBase, { nextLoginId: userInfo.loginId }) ).catch(err => showError(err)) } const handleBorrow = () => { - navigation.navigate('loanDashboard') + navigation.navigate('edgeAppStack', { screen: 'loanDashboard' }) navigation.dispatch(DrawerActions.closeDrawer()) } @@ -141,14 +143,14 @@ export function SideMenu(props: DrawerContentComponentProps) { .then(async (result: string | undefined) => { if (result) { const deepLink = parseDeepLink(result) - await dispatch(launchDeepLink(navigation, deepLink)) + await dispatch(launchDeepLink(navigationBase, deepLink)) } }) .catch(err => showError(err)) } const handleMarketsPress = () => { - navigation.navigate('coinRanking') + navigation.navigate('edgeAppStack', { screen: 'coinRanking' }) } const handleShareApp = () => { @@ -216,7 +218,7 @@ export function SideMenu(props: DrawerContentComponentProps) { }> = [ { pressHandler: () => { - navigation.navigate('fioAddressList') + navigation.navigate('edgeAppStack', { screen: 'fioAddressList' }) navigation.dispatch(DrawerActions.closeDrawer()) }, iconName: 'control-panel-fio-names', @@ -224,7 +226,7 @@ export function SideMenu(props: DrawerContentComponentProps) { }, { pressHandler: () => { - navigation.navigate('fioRequestList') + navigation.navigate('edgeAppStack', { screen: 'fioRequestList' }) navigation.dispatch(DrawerActions.closeDrawer()) }, iconName: 'control-panel-fio', @@ -232,7 +234,7 @@ export function SideMenu(props: DrawerContentComponentProps) { }, { pressHandler: () => { - navigation.navigate('wcConnections', {}) + navigation.navigate('edgeAppStack', { screen: 'wcConnections', params: {} }) navigation.dispatch(DrawerActions.closeDrawer()) }, iconName: 'control-panel-wallet-connect', @@ -252,14 +254,14 @@ export function SideMenu(props: DrawerContentComponentProps) { { pressHandler: handleShareApp, iconName: 'control-panel-share', title: lstrings.string_share + ' ' + config.appName }, { pressHandler: () => { - navigation.navigate('settingsOverview') + navigation.navigate('edgeAppStack', { screen: 'settingsOverview' }) navigation.dispatch(DrawerActions.closeDrawer()) }, iconName: 'control-panel-settings', title: lstrings.settings_title }, { - pressHandler: async () => await dispatch(logoutRequest(navigation)), + pressHandler: async () => await dispatch(logoutRequest(navigationBase)), iconName: 'control-panel-logout', title: lstrings.settings_button_logout }, @@ -273,7 +275,7 @@ export function SideMenu(props: DrawerContentComponentProps) { if (ENV.ENABLE_VISA_PROGRAM && IONIA_SUPPORTED_FIATS.includes(defaultFiat)) { rowDatas.unshift({ pressHandler: () => { - dispatch(executePluginAction(navigation, 'rewardscard', 'sell')).catch(err => showError(err)) + dispatch(executePluginAction(navigationBase, 'rewardscard', 'sell')).catch(err => showError(err)) navigation.dispatch(DrawerActions.closeDrawer()) }, iconNameFontAwesome: 'credit-card', @@ -283,7 +285,7 @@ export function SideMenu(props: DrawerContentComponentProps) { const footerTopColor = theme.modal + '00' // Add full transparency to the modal color const footerBottomColor = theme.modal - const rootNavigation = getRootNavigation(navigation) + const rootNavigation = getRootNavigation(navigationBase) /// ---- Renderers ---- diff --git a/src/components/themed/TransactionListTop.tsx b/src/components/themed/TransactionListTop.tsx index 24884c1ccce..ef8ae6c391c 100644 --- a/src/components/themed/TransactionListTop.tsx +++ b/src/components/themed/TransactionListTop.tsx @@ -27,7 +27,7 @@ import { getExchangeDenomByCurrencyCode, selectDisplayDenomByCurrencyCode } from import { getExchangeRate } from '../../selectors/WalletSelectors' import { config } from '../../theme/appConfig' import { useDispatch, useSelector } from '../../types/reactRedux' -import { NavigationProp } from '../../types/routerTypes' +import { NavigationBase, WalletsTabSceneProps } from '../../types/routerTypes' import { GuiExchangeRates } from '../../types/types' import { CryptoAmount } from '../../util/CryptoAmount' import { triggerHaptic } from '../../util/haptic' @@ -64,7 +64,7 @@ const SWAP_ASSET_PRIORITY: Array<{ pluginId: string; tokenId: EdgeTokenId }> = [ ] interface OwnProps { - navigation: NavigationProp<'transactionList'> + navigation: WalletsTabSceneProps<'transactionList'>['navigation'] isLightAccount: boolean @@ -214,7 +214,7 @@ export class TransactionListTopComponent extends React.PureComponent )) .then(result => { @@ -602,7 +602,7 @@ export class TransactionListTopComponent extends React.PureComponent )} - {isEmpty || searching ? null : } + {isEmpty || searching ? null : } {isEmpty || searching ? null : ( diff --git a/src/components/themed/WalletListSwipeable.tsx b/src/components/themed/WalletListSwipeable.tsx index a24fc8b30d7..76d9c804b5c 100644 --- a/src/components/themed/WalletListSwipeable.tsx +++ b/src/components/themed/WalletListSwipeable.tsx @@ -11,7 +11,7 @@ import { useHandler } from '../../hooks/useHandler' import { filterWalletCreateItemListBySearchText, getCreateWalletList, WalletCreateItem } from '../../selectors/getCreateWalletList' import { useSceneScrollHandler } from '../../state/SceneScrollState' import { useDispatch, useSelector } from '../../types/reactRedux' -import { NavigationProp } from '../../types/routerTypes' +import { NavigationBase, WalletsTabSceneProps } from '../../types/routerTypes' import { FlatListItem } from '../../types/types' import { EdgeAnim, MAX_LIST_ITEMS_ANIM } from '../common/EdgeAnim' import { InsetStyle } from '../common/SceneWrapper' @@ -24,7 +24,8 @@ import { WalletListSwipeableLoadingRow } from './WalletListSwipeableLoadingRow' interface Props { footer?: React.ComponentType<{}> | React.ReactElement header?: React.ComponentType<{}> | React.ReactElement - navigation: NavigationProp<'walletList'> + navigation: WalletsTabSceneProps<'walletList'>['navigation'] + searching: boolean searchText: string insetStyle: InsetStyle @@ -68,7 +69,7 @@ function WalletListSwipeableComponent(props: Props) { const handleCreateWallet = useHandler(async (walletId: string, tokenId: EdgeTokenId) => { const wallet = account.currencyWallets[walletId] const { countryCode } = await getFirstOpenInfo() - dispatch(selectWalletToken({ navigation, walletId, tokenId })) + dispatch(selectWalletToken({ navigation: navigation as NavigationBase, walletId, tokenId })) .then( activationNotRequired => activationNotRequired && diff --git a/src/components/themed/WalletListSwipeableCurrencyRow.tsx b/src/components/themed/WalletListSwipeableCurrencyRow.tsx index 73c45d5d7eb..b88abd6d19f 100644 --- a/src/components/themed/WalletListSwipeableCurrencyRow.tsx +++ b/src/components/themed/WalletListSwipeableCurrencyRow.tsx @@ -9,7 +9,7 @@ import { selectWalletToken } from '../../actions/WalletActions' import { Fontello } from '../../assets/vector/index' import { useHandler } from '../../hooks/useHandler' import { useDispatch, useSelector } from '../../types/reactRedux' -import { NavigationProp } from '../../types/routerTypes' +import { NavigationBase, WalletsTabSceneProps } from '../../types/routerTypes' import { EdgeTouchableOpacity } from '../common/EdgeTouchableOpacity' import { SwipeableRowIcon } from '../icons/SwipeableRowIcon' import { WalletListMenuModal } from '../modals/WalletListMenuModal' @@ -19,7 +19,7 @@ import { SwipableRowRef, SwipeableRow } from '../themed/SwipeableRow' import { WalletListCurrencyRow } from '../themed/WalletListCurrencyRow' interface Props { - navigation: NavigationProp<'walletList'> + navigation: WalletsTabSceneProps<'walletList'>['navigation'] token?: EdgeToken tokenId: EdgeTokenId @@ -55,8 +55,8 @@ function WalletListSwipeableCurrencyRowComponent(props: Props) { const handleRequest = useHandler(() => { closeRow() - if (!checkAndShowLightBackupModal(account, navigation)) { - dispatch(selectWalletToken({ navigation, walletId: wallet.id, tokenId, alwaysActivate: true })) + if (!checkAndShowLightBackupModal(account, navigation as NavigationBase)) { + dispatch(selectWalletToken({ navigation: navigation as NavigationBase, walletId: wallet.id, tokenId, alwaysActivate: true })) .then(activated => { if (activated) { navigation.navigate('request', { tokenId, walletId: wallet.id }) @@ -68,7 +68,7 @@ function WalletListSwipeableCurrencyRowComponent(props: Props) { const handleSelect = useHandler(() => { closeRow() - dispatch(selectWalletToken({ navigation, walletId: wallet.id, tokenId, alwaysActivate: true })) + dispatch(selectWalletToken({ navigation: navigation as NavigationBase, walletId: wallet.id, tokenId, alwaysActivate: true })) .then(async activated => { const { countryCode } = await getFirstOpenInfo() if (activated) { @@ -80,7 +80,7 @@ function WalletListSwipeableCurrencyRowComponent(props: Props) { const handleSend = useHandler(() => { closeRow() - dispatch(selectWalletToken({ navigation, walletId: wallet.id, tokenId, alwaysActivate: true })) + dispatch(selectWalletToken({ navigation: navigation as NavigationBase, walletId: wallet.id, tokenId, alwaysActivate: true })) .then(activated => { if (activated) { navigation.navigate('send2', { diff --git a/src/components/themed/WalletListSwipeableLoadingRow.tsx b/src/components/themed/WalletListSwipeableLoadingRow.tsx index bee2b436df1..540cf8f8e89 100644 --- a/src/components/themed/WalletListSwipeableLoadingRow.tsx +++ b/src/components/themed/WalletListSwipeableLoadingRow.tsx @@ -5,7 +5,7 @@ import { SharedValue } from 'react-native-reanimated' import { useHandler } from '../../hooks/useHandler' import { useWatch } from '../../hooks/useWatch' import { useSelector } from '../../types/reactRedux' -import { NavigationProp } from '../../types/routerTypes' +import { WalletsTabSceneProps } from '../../types/routerTypes' import { EdgeTouchableOpacity } from '../common/EdgeTouchableOpacity' import { SwipeableRowIcon } from '../icons/SwipeableRowIcon' import { WalletListMenuModal } from '../modals/WalletListMenuModal' @@ -16,7 +16,7 @@ import { WalletListErrorRow } from './WalletListErrorRow' import { WalletListLoadingRow } from './WalletListLoadingRow' interface Props { - navigation: NavigationProp<'walletList'> + navigation: WalletsTabSceneProps<'walletList'>['navigation'] walletId: string } diff --git a/src/constants/WalletAndCurrencyConstants.ts b/src/constants/WalletAndCurrencyConstants.ts index be4df0e801c..d58587da2ab 100644 --- a/src/constants/WalletAndCurrencyConstants.ts +++ b/src/constants/WalletAndCurrencyConstants.ts @@ -70,6 +70,7 @@ export const WALLET_TYPE_ORDER = [ 'wallet:tron', 'wallet:polkadot', 'wallet:optimism', + 'wallet:ton', 'wallet:ethereumclassic', 'wallet:binance', 'wallet:solana', @@ -510,6 +511,13 @@ export const SPECIAL_CURRENCY_INFO: { reference: 'osmosis-1' } }, + ton: { + initWalletName: lstrings.string_first_ton_wallet_name, + chainCode: 'TON', + dummyPublicAddress: 'UQAc_4sYewa5e5eN1D3nrt9wDy2akCCQ3VyNlhcxF4VozlO5', + isImportKeySupported: false, + noChangeMiningFee: true + }, thorchainrune: { initWalletName: lstrings.string_first_thorchainrune_wallet_name, chainCode: 'RUNE', diff --git a/src/envConfig.ts b/src/envConfig.ts index 5231e1a7fa3..4bf3d927afa 100644 --- a/src/envConfig.ts +++ b/src/envConfig.ts @@ -1,5 +1,7 @@ import { asArray, asBoolean, asEither, asNumber, asObject, asOptional, asString, asValue, Cleaner } from 'cleaners' +import { asBase16 } from './util/cleaners/asHex' + function asNullable(cleaner: Cleaner): Cleaner { return function asNullable(raw) { if (raw == null) return null @@ -29,7 +31,9 @@ const asEvmApiKeys = asObject({ export const asEnvConfig = asObject({ // API keys: - AIRBITZ_API_KEY: asOptional(asString, ''), + EDGE_API_KEY: asOptional(asString, ''), + EDGE_API_SECRET: asOptional(asBase16), + COINGECKO_API_KEY: asOptional(asString, 'a0000000000000000000000000000000'), IP_API_KEY: asOptional(asString, ''), SENTRY_DSN_URL: asOptional(asString, 'SENTRY_DSN_URL'), diff --git a/src/hooks/useAsyncNavigation.tsx b/src/hooks/useAsyncNavigation.tsx index 4939b46888d..0d69e637d0c 100644 --- a/src/hooks/useAsyncNavigation.tsx +++ b/src/hooks/useAsyncNavigation.tsx @@ -1,16 +1,12 @@ -import { NavigationProp as NavigationCoreProp, StackActionHelpers } from '@react-navigation/native' +import { NavigationProp } from '@react-navigation/native' import * as React from 'react' -import { AppParamList, NavigationBase } from '../types/routerTypes' - /** - * Use this in place of NavigationProp/NavigationBase methods to prevent + * Use this in place of navigation methods to prevent * multiple navigations from rapid tapping. Navigation calls are only executed * if there isn't already another one in flight */ -export const useAsyncNavigation = ( - navigation: NavigationBase | (NavigationCoreProp & StackActionHelpers) -): NavigationBase & (NavigationCoreProp & StackActionHelpers) => { +export const useAsyncNavigation =