diff --git a/app/__mocks__/@exodus/react-native-payments.ts b/app/__mocks__/@exodus/react-native-payments.ts deleted file mode 100644 index 440d682858e..00000000000 --- a/app/__mocks__/@exodus/react-native-payments.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from '@exodus/react-native-payments/lib/js/__mocks__'; diff --git a/app/__mocks__/@metamask/react-native-payments.ts b/app/__mocks__/@metamask/react-native-payments.ts new file mode 100644 index 00000000000..8a926b719a3 --- /dev/null +++ b/app/__mocks__/@metamask/react-native-payments.ts @@ -0,0 +1 @@ +export { default } from '@metamask/react-native-payments/lib/js/__mocks__'; diff --git a/app/components/UI/Ramp/hooks/useApplePay.ts b/app/components/UI/Ramp/hooks/useApplePay.ts index 5574cdbdaa7..3faefba3394 100644 --- a/app/components/UI/Ramp/hooks/useApplePay.ts +++ b/app/components/UI/Ramp/hooks/useApplePay.ts @@ -1,6 +1,6 @@ import { useCallback } from 'react'; // @ts-expect-error ts(7016) react-native-payments is not typed -import { PaymentRequest } from '@exodus/react-native-payments'; +import { PaymentRequest } from '@metamask/react-native-payments'; import { strings } from '../../../../../locales/i18n'; import Logger from '../../../../util/Logger'; diff --git a/app/declarations.d.ts b/app/declarations.d.ts index 29c1a5991f0..69bf0090af8 100644 --- a/app/declarations.d.ts +++ b/app/declarations.d.ts @@ -2,7 +2,7 @@ // Ex. This makes it so that when you import CloseIcon from './close-icon.svg, CloseIcon, will be detected as a React.FC component. declare module '*.mp4'; -declare module '@exodus/react-native-payments/lib/js/__mocks__'; +declare module '@metamask/react-native-payments/lib/js/__mocks__'; declare module 'react-native-fade-in-image'; diff --git a/ios/Podfile b/ios/Podfile index d8fadc20fb7..3d0274215ab 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -80,7 +80,7 @@ def common_target_logic # Pods for MetaMask pod 'React-RCTPushNotification', :path => '../node_modules/react-native/Libraries/PushNotificationIOS' - pod 'ReactNativePayments', :path => '../node_modules/@exodus/react-native-payments/lib/ios/' + pod 'ReactNativePayments', :path => '../node_modules/@metamask/react-native-payments/lib/ios/' # Pods for Push Notifications pod 'Firebase', :modular_headers => true diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 9b0cf27d03f..5b9ca46ccfd 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -587,7 +587,7 @@ PODS: - React-jsi (= 0.71.15) - React-logger (= 0.71.15) - React-perflogger (= 0.71.15) - - ReactNativePayments (1.5.0): + - ReactNativePayments (2.0.0): - React - rn-fetch-blob (0.12.0): - React-Core @@ -776,7 +776,7 @@ DEPENDENCIES: - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - - "ReactNativePayments (from `../node_modules/@exodus/react-native-payments/lib/ios/`)" + - "ReactNativePayments (from `../node_modules/@metamask/react-native-payments/lib/ios/`)" - rn-fetch-blob (from `../node_modules/rn-fetch-blob`) - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)" - "RNCCheckbox (from `../node_modules/@react-native-community/checkbox`)" @@ -968,7 +968,7 @@ EXTERNAL SOURCES: ReactCommon: :path: "../node_modules/react-native/ReactCommon" ReactNativePayments: - :path: "../node_modules/@exodus/react-native-payments/lib/ios/" + :path: "../node_modules/@metamask/react-native-payments/lib/ios/" rn-fetch-blob: :path: "../node_modules/rn-fetch-blob" RNCAsyncStorage: @@ -1028,7 +1028,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Base64: cecfb41a004124895a7bcee567a89bae5a89d49b - boost: 57d2868c099736d80fcd648bf211b4431e51a558 + boost: 7dcd2de282d72e344012f7d6564d024930a6a440 Branch: 4ac024cb3c29b0ef628048694db3c4cfa679beb0 BVLinearGradient: e3aad03778a456d77928f594a649e96995f1c872 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 @@ -1118,7 +1118,7 @@ SPEC CHECKSUMS: React-RCTVibration: a97783e3645ddf852e34da2e015656e309f3a083 React-runtimeexecutor: 8f2ddd9db7874ec7de84f5c55d73aeaaf82908e2 ReactCommon: 4a6ace8e5bd40d585223775ba56d002173e72fb2 - ReactNativePayments: a4e3ac915256a4e759c8a04338b558494a63a0f5 + ReactNativePayments: db62ee22a825e9e9c3e19c276d8d020881dd0630 rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba RNCAsyncStorage: 826b603ae9c0f88b5ac4e956801f755109fa4d5c RNCCheckbox: ed1b4ca295475b41e7251ebae046360a703b6eb5 @@ -1152,6 +1152,6 @@ SPEC CHECKSUMS: Yoga: 68c9c592c3e80ec37ff28db20eedb13d84aae5df YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 6c1ebc1c49e824e5d559b52f89962406257a7f5c +PODFILE CHECKSUM: b041bcd5cf0f3b6d41c16392ee13a01dd5e6052a COCOAPODS: 1.12.1 diff --git a/package.json b/package.json index 97ff3267e35..44bbeaf33a1 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "react-native-level-fs/**/bl": "^1.2.3", "react-native-level-fs/levelup/semver": "^5.7.2", "@metamask/contract-metadata": "^2.1.0", - "@exodus/react-native-payments/validator": "^13.7.0", + "@metamask/react-native-payments/validator": "^13.7.0", "**/minimist": "1.2.6", "d3-color": "3.1.0", "tough-cookie": "4.1.3", @@ -131,7 +131,6 @@ "@eth-optimism/contracts": "0.0.0-2021919175625", "@ethereumjs/tx": "^3.2.1", "@ethersproject/abi": "^5.7.0", - "@exodus/react-native-payments": "git+https://github.com/MetaMask/react-native-payments.git#dbc8cbbed570892d2fea5e3d183bf243e062c1e5", "@keystonehq/bc-ur-registry-eth": "^0.19.1", "@keystonehq/metamask-airgapped-keyring": "^0.13.1", "@keystonehq/ur-decoder": "^0.12.2", @@ -160,6 +159,7 @@ "@metamask/preferences-controller": "^4.0.0", "@metamask/react-native-animated-fox": "^2.1.0", "@metamask/react-native-button": "^3.0.0", + "@metamask/react-native-payments": "^2.0.0", "@metamask/react-native-splash-screen": "^3.2.0", "@metamask/rpc-errors": "^6.2.1", "@metamask/scure-bip39": "^2.1.0", diff --git a/patches/@exodus+react-native-payments+1.5.0.patch b/patches/@exodus+react-native-payments+1.5.0.patch deleted file mode 100644 index 85bf03b0f22..00000000000 --- a/patches/@exodus+react-native-payments+1.5.0.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff --git a/node_modules/@exodus/react-native-payments/android/build.gradle b/node_modules/@exodus/react-native-payments/android/build.gradle -index 2dac59c..0d066bd 100644 ---- a/node_modules/@exodus/react-native-payments/android/build.gradle -+++ b/node_modules/@exodus/react-native-payments/android/build.gradle -@@ -1,12 +1,12 @@ - apply plugin: 'com.android.library' - - android { -- compileSdkVersion 23 -- buildToolsVersion "23.0.1" -+ compileSdkVersion 28 -+ buildToolsVersion "28.0.3" - - defaultConfig { -- minSdkVersion 16 -- targetSdkVersion 22 -+ minSdkVersion 21 -+ targetSdkVersion 28 - versionCode 1 - versionName "1.0" - ndk { -@@ -19,7 +19,9 @@ android { - } - - dependencies { -- compile 'com.facebook.react:react-native:+' -- compile 'com.google.android.gms:play-services-wallet:11.0.4' -- compile 'com.android.support:support-v4:23.0.1' -+ implementation 'com.facebook.react:react-native:+' -+ implementation 'com.google.android.gms:play-services-base:17.0.0' -+ implementation 'com.google.android.gms:play-services-identity:17.0.0' -+ implementation 'com.google.android.gms:play-services-wallet:17.0.0' -+ implementation 'com.android.support:support-v4:23.0.1' - } -diff --git a/node_modules/@exodus/react-native-payments/lib/js/PaymentRequest.js b/node_modules/@exodus/react-native-payments/lib/js/PaymentRequest.js -index 0ae7fcd..320e1a6 100644 ---- a/node_modules/@exodus/react-native-payments/lib/js/PaymentRequest.js -+++ b/node_modules/@exodus/react-native-payments/lib/js/PaymentRequest.js -@@ -414,16 +414,12 @@ export default class PaymentRequest { - - _removeEventListeners() { - // Internal Events -- DeviceEventEmitter.removeSubscription(this._userDismissSubscription); -- DeviceEventEmitter.removeSubscription(this._userAcceptSubscription); -+ this._userDismissSubscription?.remove?.() -+ this._userAcceptSubscription?.remove?.() - - if (IS_IOS) { -- DeviceEventEmitter.removeSubscription( -- this._shippingAddressChangeSubscription -- ); -- DeviceEventEmitter.removeSubscription( -- this._shippingOptionChangeSubscription -- ); -+ this._shippingAddressChangeSubscription?.remove?.(); -+ this._shippingOptionChangeSubscription?.remove?.(); - } - } - diff --git a/yarn.lock b/yarn.lock index da0c0041c70..6b5616e326d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2289,14 +2289,6 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@exodus/react-native-payments@git+https://github.com/MetaMask/react-native-payments.git#dbc8cbbed570892d2fea5e3d183bf243e062c1e5": - version "1.5.0" - resolved "git+https://github.com/MetaMask/react-native-payments.git#dbc8cbbed570892d2fea5e3d183bf243e062c1e5" - dependencies: - es6-error "^4.0.2" - uuid "3.3.2" - validator "^7.0.0" - "@expo/config-plugins@^7.2.5": version "7.2.5" resolved "https://registry.yarnpkg.com/@expo/config-plugins/-/config-plugins-7.2.5.tgz#b15f22878975fdc4ddcfa8cdc971937ddc4c0249" @@ -4406,6 +4398,15 @@ dependencies: prop-types "^15.5.10" +"@metamask/react-native-payments@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@metamask/react-native-payments/-/react-native-payments-2.0.0.tgz#64d48028a8c0de1bf5332b01c3ddd5ca61c8fbdb" + integrity sha512-XUdZsD+RpNGwUPpwdgcVqe+ugRqhpvEU9ihL9n3VbWN7g6p3RdK0JuQ9g19WA7xcU1l2Rg9dCxkMytNin+uOSA== + dependencies: + es6-error "^4.0.2" + uuid "3.3.2" + validator "^7.0.0" + "@metamask/react-native-splash-screen@^3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@metamask/react-native-splash-screen/-/react-native-splash-screen-3.2.0.tgz#06a6547c143b088e47af40eacea9ac6657ac937f"