From 5e3025c0862b8982d82febb84e64047aab429f52 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Thu, 17 Feb 2022 13:28:44 -0800 Subject: [PATCH 001/287] Add an `escape` style to `MainButton` --- src/components/modals/ButtonsModal.js | 2 +- src/components/themed/MainButton.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/modals/ButtonsModal.js b/src/components/modals/ButtonsModal.js index 7b1cc317ceb..4ca0b1cab93 100644 --- a/src/components/modals/ButtonsModal.js +++ b/src/components/modals/ButtonsModal.js @@ -11,7 +11,7 @@ import { ThemedModal } from '../themed/ThemedModal.js' export type ButtonInfo = { label: string, - type?: 'primary' | 'secondary', + type?: 'primary' | 'secondary' | 'escape', // The modal will show a spinner as long as this promise is pending. // Returning true will dismiss the modal, diff --git a/src/components/themed/MainButton.js b/src/components/themed/MainButton.js index 28c01c0a9b2..6d165adfb3f 100644 --- a/src/components/themed/MainButton.js +++ b/src/components/themed/MainButton.js @@ -38,7 +38,7 @@ type Props = {| spinner?: boolean, // Which visual style to use. Defaults to primary (solid): - type?: 'primary' | 'secondary' + type?: 'primary' | 'secondary' | 'escape' |} /** @@ -53,12 +53,12 @@ export function MainButton(props: Props) { // Styles: const theme = useTheme() const styles = getStyles(theme) - const touchableStyle = type === 'primary' ? styles.primaryButton : styles.secondaryButton + const touchableStyle = type === 'primary' ? styles.primaryButton : type === 'escape' ? styles.escapeButton : styles.secondaryButton const textStyle = type === 'primary' ? styles.primaryText : styles.secondaryText const spinnerColor = type === 'primary' ? theme.primaryButtonText : theme.secondaryButtonText const dynamicStyles = { alignSelf, - opacity: disabled || pending ? 0.7 : 1, + opacity: disabled ? 0.3 : pending ? 0.7 : 1, ...sidesToMargin(mapSides(fixSides(marginRem, 0), theme.rem)), ...sidesToPadding(mapSides(fixSides(paddingRem, 0.5), theme.rem)) } @@ -113,6 +113,12 @@ const getStyles = cacheStyles((theme: Theme) => { color: theme.secondaryButtonText }, + escapeButton: { + ...commonButton, + backgroundColor: theme.secondaryButton, + borderColor: 'transparent' + }, + // Common styles: spinner: { height: theme.rem(2), From 8404ec521ebb79fcd5febc694b9fd37799006109 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 24 Feb 2022 11:36:20 -0800 Subject: [PATCH 002/287] Replace broken find method with includes --- src/actions/BitPayActions.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/actions/BitPayActions.js b/src/actions/BitPayActions.js index 02995476bd4..a1685b65757 100644 --- a/src/actions/BitPayActions.js +++ b/src/actions/BitPayActions.js @@ -82,10 +82,11 @@ export async function launchBitPay( const isTestBp = uri.toLowerCase().includes('test.bitpay.com') const paymentCurrencies: string[] = options .map(po => po.currency) - .filter(currency => { - // Omit 'BTC' if using BitPay testnet, since our testnet BTC has its own currency code. - return bitPaySupportedCurrencyCodes.find(currency) != null && !(isTestBp && currency === 'BTC') - }) + .filter( + currency => + // Omit 'BTC' if using BitPay testnet, since our testnet BTC has its own currency code. + bitPaySupportedCurrencyCodes.includes(currency) && !(isTestBp && currency === 'BTC') + ) // Add our test BTC currency code for BitPay testnet if (isTestBp) { From 807c214ab40b7a68ab2f64c0d88dcf3f1d6f5ad3 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 24 Feb 2022 12:25:43 -0800 Subject: [PATCH 003/287] Replace walletType with pluginId --- src/components/themed/WalletListCreateRow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/themed/WalletListCreateRow.js b/src/components/themed/WalletListCreateRow.js index 32c3eed64d7..37657963e2c 100644 --- a/src/components/themed/WalletListCreateRow.js +++ b/src/components/themed/WalletListCreateRow.js @@ -9,7 +9,7 @@ import FastImage from 'react-native-fast-image' import { createCurrencyWallet } from '../../actions/CreateWalletActions' import { approveTokenTerms } from '../../actions/TokenTermsActions.js' import { refreshWallet, selectWallet } from '../../actions/WalletActions.js' -import { SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants.js' +import { getPluginId, SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants.js' import s from '../../locales/strings.js' import { setEnabledTokens } from '../../modules/Core/Wallets/EnabledTokens.js' import { connect } from '../../types/reactRedux.js' @@ -50,7 +50,7 @@ class WalletListCreateRowComponent extends React.PureComponent Date: Thu, 24 Feb 2022 12:44:02 -0800 Subject: [PATCH 004/287] Add fallback value to balance check --- src/components/scenes/RequestScene.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/scenes/RequestScene.js b/src/components/scenes/RequestScene.js index a168c55f2f9..099b8f4e441 100644 --- a/src/components/scenes/RequestScene.js +++ b/src/components/scenes/RequestScene.js @@ -389,7 +389,7 @@ export class RequestComponent extends React.Component { if (this.state.minimumPopupModalState[pluginId] === 'NOT_YET_SHOWN') { const { minimumPopupModals } = getSpecialCurrencyInfo(pluginId) const minBalance = minimumPopupModals != null ? minimumPopupModals.minimumNativeBalance : '0' - if (lt(edgeWallet.balances[currencyCode], minBalance)) { + if (lt(edgeWallet.balances[currencyCode] ?? '0', minBalance)) { return true } } From 34ac2a91fce6e7c9f894fa02774e50c24bbb1e56 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 24 Feb 2022 16:42:52 -0800 Subject: [PATCH 005/287] Add BNB Smart Chain --- env.example.json | 3 +++ src/constants/WalletAndCurrencyConstants.js | 15 ++++++++++++++- src/locales/en_US.js | 1 + src/locales/strings/enUS.json | 1 + src/util/corePlugins.js | 1 + 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/env.example.json b/env.example.json index 5a805252ffc..c3982f4bd42 100644 --- a/env.example.json +++ b/env.example.json @@ -26,6 +26,9 @@ "alethioApiKey": "", "amberdataApiKey": "" }, + "x_BINANCE_SMART_CHAIN_INIT": { + "bscscanApiKey": [] + }, "x_EXOLIX_INIT": { "apiKey": "" }, diff --git a/src/constants/WalletAndCurrencyConstants.js b/src/constants/WalletAndCurrencyConstants.js index 3a4a8951a1e..3daf117d5df 100644 --- a/src/constants/WalletAndCurrencyConstants.js +++ b/src/constants/WalletAndCurrencyConstants.js @@ -91,7 +91,8 @@ export const WALLET_TYPE_ORDER = [ 'wallet:fantom', 'wallet:hedera', 'wallet:polygon', - 'wallet:avalanche' + 'wallet:avalanche', + 'wallet:binancesmartchain' ] // Put these in reverse order of preference @@ -374,6 +375,18 @@ export const SPECIAL_CURRENCY_INFO: { }, dummyPublicAddress: 'bnb1rt449yu7us6hmk4pmyr8talc60ydkwp4qkvcl7' }, + binancesmartchain: { + initWalletName: s.strings.string_first_binance_smart_chain_wallet_name, + chainCode: 'BNB', + allowZeroTx: true, + isImportKeySupported: { + privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, + privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions + }, + dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', + isCustomTokensSupported: true, + isRbfSupported: true + }, solana: { initWalletName: s.strings.string_first_solana_wallet_name, chainCode: 'SOL', diff --git a/src/locales/en_US.js b/src/locales/en_US.js index 3bf87c61950..96430747ce2 100644 --- a/src/locales/en_US.js +++ b/src/locales/en_US.js @@ -388,6 +388,7 @@ const strings = { string_first_tezos_wallet_name: 'My Tezos', string_first_rsk_wallet_name: 'My RSK', string_first_bnb_wallet_name: 'My BNB', + string_first_binance_smart_chain_wallet_name: 'My Binance Smart Chain', string_first_eboost_wallet_name: 'My eBoost', string_first_celo_wallet_name: 'My Celo', string_first_solana_wallet_name: 'My Solana', diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json index 80e4c7bd198..dacd53605e3 100644 --- a/src/locales/strings/enUS.json +++ b/src/locales/strings/enUS.json @@ -363,6 +363,7 @@ "string_first_tezos_wallet_name": "My Tezos", "string_first_rsk_wallet_name": "My RSK", "string_first_bnb_wallet_name": "My BNB", + "string_first_binance_smart_chain_wallet_name": "My Binance Smart Chain", "string_first_eboost_wallet_name": "My eBoost", "string_first_celo_wallet_name": "My Celo", "string_first_solana_wallet_name": "My Solana", diff --git a/src/util/corePlugins.js b/src/util/corePlugins.js index 0c2b2d8b712..2d67ed8bd94 100644 --- a/src/util/corePlugins.js +++ b/src/util/corePlugins.js @@ -28,6 +28,7 @@ if (ENV.CHANGE_NOW_INIT == null && ENV.CHANGE_NOW_API_KEY) { export const currencyPlugins = { // edge-currency-accountbased: binance: true, + binancesmartchain: ENV.BINANCE_SMART_CHAIN_INIT, hedera: true, eos: true, telos: true, From 37914f8d328e19973e0ba25264e8ff17a6a94f33 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 24 Feb 2022 20:55:11 -0800 Subject: [PATCH 006/287] Update edge-plugin-bity to 2a52e6cb86512b98f69f8f5dd3105cdf6d0c2d8a --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 03228ea98a4..4b0344b8f91 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "edge-currency-monero": "^0.3.4", "edge-exchange-plugins": "^0.12.11", "edge-login-ui-rn": "^0.9.29", - "edge-plugin-bity": "https://github.com/EdgeApp/edge-plugin-bity.git#c2e4d320b1863ebad5fb994f5bd03ccd6a0cb9c8", + "edge-plugin-bity": "https://github.com/EdgeApp/edge-plugin-bity.git#2a52e6cb86512b98f69f8f5dd3105cdf6d0c2d8a", "edge-plugin-simplex": "https://github.com/EdgeApp/edge-plugin-simplex.git#4842daad5fd560cd462f4668ab17c521a16a6cd9", "edge-plugin-wyre": "https://github.com/EdgeApp/edge-plugin-wyre.git#6412ad28462278b84313537f21a53d307633c5d0", "qrcode-generator": "^1.4.4", diff --git a/yarn.lock b/yarn.lock index 0396d433ef7..0c8a4db4656 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5585,9 +5585,9 @@ edge-login-ui-rn@^0.9.29: sprintf-js "^1.0.3" zxcvbn "^4.4.2" -"edge-plugin-bity@https://github.com/EdgeApp/edge-plugin-bity.git#c2e4d320b1863ebad5fb994f5bd03ccd6a0cb9c8": +"edge-plugin-bity@https://github.com/EdgeApp/edge-plugin-bity.git#2a52e6cb86512b98f69f8f5dd3105cdf6d0c2d8a": version "0.0.1" - resolved "https://github.com/EdgeApp/edge-plugin-bity.git#c2e4d320b1863ebad5fb994f5bd03ccd6a0cb9c8" + resolved "https://github.com/EdgeApp/edge-plugin-bity.git#2a52e6cb86512b98f69f8f5dd3105cdf6d0c2d8a" dependencies: cleaners "^0.3.1" From 87277d9264ad64b562a309be79f307660ee82580 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 24 Feb 2022 20:58:34 -0800 Subject: [PATCH 007/287] Add isRbfSupported flag to remaining EVM chains --- src/constants/WalletAndCurrencyConstants.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/constants/WalletAndCurrencyConstants.js b/src/constants/WalletAndCurrencyConstants.js index 3daf117d5df..be0120967d7 100644 --- a/src/constants/WalletAndCurrencyConstants.js +++ b/src/constants/WalletAndCurrencyConstants.js @@ -221,6 +221,7 @@ export const SPECIAL_CURRENCY_INFO: { privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions }, isSplittingDisabled: true, + isRbfSupported: true, isCustomTokensSupported: true }, stellar: { @@ -344,6 +345,7 @@ export const SPECIAL_CURRENCY_INFO: { chainCode: 'ETC', dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', isSplittingDisabled: true, + isRbfSupported: true, isImportKeySupported: { privateKeyLabel: s.strings.create_wallet_import_input_key_or_seed_prompt, privateKeyInstructions: s.strings.create_wallet_import_input_key_or_seed_instructions @@ -511,6 +513,7 @@ export const SPECIAL_CURRENCY_INFO: { privateKeyLabel: s.strings.create_wallet_import_input_prompt, privateKeyInstructions: s.strings.create_wallet_import_instructions }, + isRbfSupported: true, isCustomTokensSupported: true }, hedera: { From 39492d0b98014d7747aa577ca28007ad12d44a18 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 25 Feb 2022 10:48:07 -0800 Subject: [PATCH 008/287] Fix splittable list filtering --- src/components/modals/WalletListMenuModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/modals/WalletListMenuModal.js b/src/components/modals/WalletListMenuModal.js index 4d142bb657e..e8645037d0c 100644 --- a/src/components/modals/WalletListMenuModal.js +++ b/src/components/modals/WalletListMenuModal.js @@ -80,7 +80,7 @@ const getWalletOptions = async (params: { const currencyInfos = getCurrencyInfos(account) for (const splitWalletType of splittable) { const info = currencyInfos.find(({ walletType }) => walletType === splitWalletType) - if (info == null || getSpecialCurrencyInfo(info.currencyCode).isSplittingDisabled) continue + if (info == null || getSpecialCurrencyInfo(info.pluginId).isSplittingDisabled) continue result.push({ label: sprintf(s.strings.string_split_wallet, info.displayName), value: `split${info.currencyCode}` }) } From 667694dd14fc51585722caad99f1fbc061b1f838 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 25 Feb 2022 11:58:36 -0800 Subject: [PATCH 009/287] Parity with Staging branch --- CHANGELOG.md | 5 +++++ ios/edge.xcodeproj/project.pbxproj | 3 +++ src/modules/FioAddress/components/FioActionSubmit.js | 3 +++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85ababa01fe..d3eac4cb69a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -221,6 +221,11 @@ - Upgrade edge-currency-accountbased to v0.9.3 - Update ZEC checkpoints +## 2.6.1 (2021-11-24) + +- Force Android to create a compressed APK to reduce app size +- Fix ZEC Trasaction Exchange details + ## 2.6.0 (2021-11-21) - Add Zcash (Android only) diff --git a/ios/edge.xcodeproj/project.pbxproj b/ios/edge.xcodeproj/project.pbxproj index fa736f6d094..92b2da1e89c 100644 --- a/ios/edge.xcodeproj/project.pbxproj +++ b/ios/edge.xcodeproj/project.pbxproj @@ -14,6 +14,7 @@ 31BE19EEE2CA4692A7873F5F /* SourceSansPro-BoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 27D9F41192F8419DA0531DFF /* SourceSansPro-BoldItalic.ttf */; }; 3D1368BD21DD76BB00DC8CE4 /* edge-core in Resources */ = {isa = PBXBuildFile; fileRef = 3D1368BC21DD76BB00DC8CE4 /* edge-core */; }; 3D2A4BE322934B0000E1EC61 /* blank.html in Resources */ = {isa = PBXBuildFile; fileRef = 3D2A4BE222934B0000E1EC61 /* blank.html */; }; + 3D3A45142710DEF40036CF4B /* LinkPresentation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3A45132710DEF40036CF4B /* LinkPresentation.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 3DC7E8532525AB490061CF16 /* Dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DC7E8522525AB490061CF16 /* Dummy.swift */; }; 50FDCD65EBE045E282509085 /* SourceSansPro-Italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AA0A843F10D9480786517FEF /* SourceSansPro-Italic.ttf */; }; 5872448FDFE840DEBB46A6BA /* SourceSansPro-ExtraLightItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 38A5524778E84A41B960E513 /* SourceSansPro-ExtraLightItalic.ttf */; }; @@ -55,6 +56,7 @@ 38A5524778E84A41B960E513 /* SourceSansPro-ExtraLightItalic.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "SourceSansPro-ExtraLightItalic.ttf"; path = "../src/assets/fonts/SourceSansPro-ExtraLightItalic.ttf"; sourceTree = ""; }; 3D1368BC21DD76BB00DC8CE4 /* edge-core */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "edge-core"; path = "../android/app/src/main/assets/edge-core"; sourceTree = ""; }; 3D2A4BE222934B0000E1EC61 /* blank.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = blank.html; path = ../android/app/src/main/assets/blank.html; sourceTree = ""; }; + 3D3A45132710DEF40036CF4B /* LinkPresentation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LinkPresentation.framework; path = System/Library/Frameworks/LinkPresentation.framework; sourceTree = SDKROOT; }; 3DC7E8522525AB490061CF16 /* Dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dummy.swift; sourceTree = ""; }; 5374C609A9164C53819F3FDD /* SourceSansPro-Semibold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "SourceSansPro-Semibold.ttf"; path = "../src/assets/fonts/SourceSansPro-Semibold.ttf"; sourceTree = ""; }; 550016E295D7C4722CD35EF9 /* Pods-edge.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-edge.debug.xcconfig"; path = "Pods/Target Support Files/Pods-edge/Pods-edge.debug.xcconfig"; sourceTree = ""; }; @@ -89,6 +91,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 3D3A45142710DEF40036CF4B /* LinkPresentation.framework in Frameworks */, D6181FED10025926C9F176BD /* libPods-edge.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/src/modules/FioAddress/components/FioActionSubmit.js b/src/modules/FioAddress/components/FioActionSubmit.js index 7e5d22de78e..6515344de76 100644 --- a/src/modules/FioAddress/components/FioActionSubmit.js +++ b/src/modules/FioAddress/components/FioActionSubmit.js @@ -265,6 +265,9 @@ const getStyles = cacheStyles((theme: Theme) => ({ paddingLeft: theme.rem(1.25), paddingRight: theme.rem(1.25) }, + slider: { + alignItems: 'center' + }, spacer: { paddingTop: theme.rem(1.25) } From b40faaef4b4d3df35cdb0071f3bdf3cbee11aac2 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 25 Feb 2022 12:05:19 -0800 Subject: [PATCH 010/287] Remove junk entries to project.pbxproj and unused style from FioActionSubmit.js --- ios/edge.xcodeproj/project.pbxproj | 3 --- src/modules/FioAddress/components/FioActionSubmit.js | 3 --- 2 files changed, 6 deletions(-) diff --git a/ios/edge.xcodeproj/project.pbxproj b/ios/edge.xcodeproj/project.pbxproj index 92b2da1e89c..fa736f6d094 100644 --- a/ios/edge.xcodeproj/project.pbxproj +++ b/ios/edge.xcodeproj/project.pbxproj @@ -14,7 +14,6 @@ 31BE19EEE2CA4692A7873F5F /* SourceSansPro-BoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 27D9F41192F8419DA0531DFF /* SourceSansPro-BoldItalic.ttf */; }; 3D1368BD21DD76BB00DC8CE4 /* edge-core in Resources */ = {isa = PBXBuildFile; fileRef = 3D1368BC21DD76BB00DC8CE4 /* edge-core */; }; 3D2A4BE322934B0000E1EC61 /* blank.html in Resources */ = {isa = PBXBuildFile; fileRef = 3D2A4BE222934B0000E1EC61 /* blank.html */; }; - 3D3A45142710DEF40036CF4B /* LinkPresentation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3A45132710DEF40036CF4B /* LinkPresentation.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 3DC7E8532525AB490061CF16 /* Dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DC7E8522525AB490061CF16 /* Dummy.swift */; }; 50FDCD65EBE045E282509085 /* SourceSansPro-Italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AA0A843F10D9480786517FEF /* SourceSansPro-Italic.ttf */; }; 5872448FDFE840DEBB46A6BA /* SourceSansPro-ExtraLightItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 38A5524778E84A41B960E513 /* SourceSansPro-ExtraLightItalic.ttf */; }; @@ -56,7 +55,6 @@ 38A5524778E84A41B960E513 /* SourceSansPro-ExtraLightItalic.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "SourceSansPro-ExtraLightItalic.ttf"; path = "../src/assets/fonts/SourceSansPro-ExtraLightItalic.ttf"; sourceTree = ""; }; 3D1368BC21DD76BB00DC8CE4 /* edge-core */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "edge-core"; path = "../android/app/src/main/assets/edge-core"; sourceTree = ""; }; 3D2A4BE222934B0000E1EC61 /* blank.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = blank.html; path = ../android/app/src/main/assets/blank.html; sourceTree = ""; }; - 3D3A45132710DEF40036CF4B /* LinkPresentation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LinkPresentation.framework; path = System/Library/Frameworks/LinkPresentation.framework; sourceTree = SDKROOT; }; 3DC7E8522525AB490061CF16 /* Dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dummy.swift; sourceTree = ""; }; 5374C609A9164C53819F3FDD /* SourceSansPro-Semibold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "SourceSansPro-Semibold.ttf"; path = "../src/assets/fonts/SourceSansPro-Semibold.ttf"; sourceTree = ""; }; 550016E295D7C4722CD35EF9 /* Pods-edge.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-edge.debug.xcconfig"; path = "Pods/Target Support Files/Pods-edge/Pods-edge.debug.xcconfig"; sourceTree = ""; }; @@ -91,7 +89,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3D3A45142710DEF40036CF4B /* LinkPresentation.framework in Frameworks */, D6181FED10025926C9F176BD /* libPods-edge.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/src/modules/FioAddress/components/FioActionSubmit.js b/src/modules/FioAddress/components/FioActionSubmit.js index 6515344de76..7e5d22de78e 100644 --- a/src/modules/FioAddress/components/FioActionSubmit.js +++ b/src/modules/FioAddress/components/FioActionSubmit.js @@ -265,9 +265,6 @@ const getStyles = cacheStyles((theme: Theme) => ({ paddingLeft: theme.rem(1.25), paddingRight: theme.rem(1.25) }, - slider: { - alignItems: 'center' - }, spacer: { paddingTop: theme.rem(1.25) } From 51fa540fd7d0130812f12d78882ca3fb806179d8 Mon Sep 17 00:00:00 2001 From: eliran zach Date: Mon, 28 Feb 2022 22:19:21 -0800 Subject: [PATCH 011/287] Use 'pluginId' to get the special currency info instead of 'currencyCode' --- src/components/scenes/StakingChangeScene.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/scenes/StakingChangeScene.js b/src/components/scenes/StakingChangeScene.js index 096565a69ac..91b1892de3b 100644 --- a/src/components/scenes/StakingChangeScene.js +++ b/src/components/scenes/StakingChangeScene.js @@ -367,7 +367,7 @@ export const StakingChangeScene = connect( const currencyDenomination = getDisplayDenomination(state, currencyWallet.currencyInfo.pluginId, currencyCode) const defaultDenomination = getExchangeDenomination(state, currencyWallet.currencyInfo.pluginId, currencyCode) - if (SPECIAL_CURRENCY_INFO[currencyCode]?.isStakingSupported) { + if (SPECIAL_CURRENCY_INFO[currencyWallet.currencyInfo.pluginId]?.isStakingSupported) { for (const cCodeKey in STAKING_BALANCES) { const stakingCurrencyCode = `${currencyCode}${STAKING_BALANCES[cCodeKey]}` From 80a1b364d9c2e8fc8d20ddb635181af412087d35 Mon Sep 17 00:00:00 2001 From: eliran zach Date: Mon, 28 Feb 2022 22:40:24 -0800 Subject: [PATCH 012/287] Call 'refreshAllFioAddresses' in the constructor to fix the missing requests on first load problem --- src/components/scenes/FioRequestListScene.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/scenes/FioRequestListScene.js b/src/components/scenes/FioRequestListScene.js index e95f36d686d..018fae3fd6a 100644 --- a/src/components/scenes/FioRequestListScene.js +++ b/src/components/scenes/FioRequestListScene.js @@ -73,6 +73,7 @@ class FioRequestList extends React.Component { constructor(props: Props) { super(props) + this.props.refreshAllFioAddresses() this.state = { loadingPending: true, loadingSent: true, From 1cb93ce8991a5e598b10254ab19c4d6d3460e16e Mon Sep 17 00:00:00 2001 From: eliran zach Date: Mon, 28 Feb 2022 23:54:35 -0800 Subject: [PATCH 013/287] Get the correct "actionName" value --- src/components/scenes/StakingChangeScene.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/scenes/StakingChangeScene.js b/src/components/scenes/StakingChangeScene.js index 91b1892de3b..f7291d9f130 100644 --- a/src/components/scenes/StakingChangeScene.js +++ b/src/components/scenes/StakingChangeScene.js @@ -202,7 +202,7 @@ export const StakingChangeSceneComponent = (props: Props) => { return } - const actionName = SPECIAL_CURRENCY_INFO[pluginId]?.stakeActions ?? '' + const { [change]: actionName } = SPECIAL_CURRENCY_INFO[pluginId]?.stakeActions ?? { [change]: '' } currencyWallet .makeSpend({ spendTargets: [ From cfed67a5b0aeab1a092986cc3d54b61a5d3a223d Mon Sep 17 00:00:00 2001 From: eliran zach Date: Tue, 1 Mar 2022 00:14:03 -0800 Subject: [PATCH 014/287] Update the warning message for the "getRawKeys" and "getSeed" modals --- src/locales/en_US.js | 4 ++-- src/locales/strings/enUS.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/locales/en_US.js b/src/locales/en_US.js index 96430747ce2..635fc3e545d 100644 --- a/src/locales/en_US.js +++ b/src/locales/en_US.js @@ -143,10 +143,10 @@ const strings = { fragment_wallets_split_wallet_first_confirm_message_mobile: 'Are you sure you want to split \n', fragment_wallets_get_seed_title: 'Reveal Master Private Key', fragment_wallets_get_seed_warning_message: - 'Sharing your master private key may put you at risk of fraudulent tokens and loss of funds.\n\nDo NOT share with anyone.', + 'Sharing your master private key may put you at risk of fraudulent tokens and loss of funds.\n\nDo not share your key with anyone.\n\nBy entering your password, you are confirming that you understand the risks.', fragment_wallets_get_raw_keys_title: 'Reveal Raw Keys', fragment_wallets_get_raw_keys_warning_message: - 'Sharing your raw keys may put you at risk of fraudulent tokens and loss of funds.\n\nDo not share this with anyone.\n\nBy entering your password, you are confirming that you understand the risks.', + 'Sharing your raw keys may put you at risk of fraudulent tokens and loss of funds.\n\nDo not share your keys with anyone.\n\nBy entering your password, you are confirming that you understand the risks.', fragmet_wallets_delete_wallet_first_confirm_message_mobile: 'Are you sure you want to archive ', fragmet_wallets_delete_fio_extra_message_mobile: 'Archiving this FIO wallet will remove access to any FIO addresses you have linked to this wallet.', fragmet_wallets_delete_eth_extra_message: 'Archiving this wallet will also archive any enabled tokens for this wallet.', diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json index dacd53605e3..f8133517878 100644 --- a/src/locales/strings/enUS.json +++ b/src/locales/strings/enUS.json @@ -124,9 +124,9 @@ "fragment_wallets_split_wallet_bch_to_bsv": "You are about to split this BCH wallet and create a new BSV wallet from your BCH private keys. This requires a BCH transaction to protect your funds from unintentionally being spent on the wrong chain. This will incur a small network transaction fee on the BCH wallet. Please make sure this transaction confirms before making any further BCH transactions. Are you sure you want to split \n", "fragment_wallets_split_wallet_first_confirm_message_mobile": "Are you sure you want to split \n", "fragment_wallets_get_seed_title": "Reveal Master Private Key", - "fragment_wallets_get_seed_warning_message": "Sharing your master private key may put you at risk of fraudulent tokens and loss of funds.\n\nDo NOT share with anyone.", + "fragment_wallets_get_seed_warning_message": "Sharing your master private key may put you at risk of fraudulent tokens and loss of funds.\n\nDo not share your key with anyone.\n\nBy entering your password, you are confirming that you understand the risks.", "fragment_wallets_get_raw_keys_title": "Reveal Raw Keys", - "fragment_wallets_get_raw_keys_warning_message": "Sharing your raw keys may put you at risk of fraudulent tokens and loss of funds.\n\nDo not share this with anyone.\n\nBy entering your password, you are confirming that you understand the risks.", + "fragment_wallets_get_raw_keys_warning_message": "Sharing your raw keys may put you at risk of fraudulent tokens and loss of funds.\n\nDo not share your keys with anyone.\n\nBy entering your password, you are confirming that you understand the risks.", "fragmet_wallets_delete_wallet_first_confirm_message_mobile": "Are you sure you want to archive ", "fragmet_wallets_delete_fio_extra_message_mobile": "Archiving this FIO wallet will remove access to any FIO addresses you have linked to this wallet.", "fragmet_wallets_delete_eth_extra_message": "Archiving this wallet will also archive any enabled tokens for this wallet.", From 7d263bf33f60b72ec266f5d9d56c18c6ad7cc0ab Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 1 Mar 2022 14:50:55 -0800 Subject: [PATCH 015/287] Use pluginId and contract address instead of currency codes in getCurrencyIcon util function This changes the URL path for icons EDGE_CONTENT_SERVER/BTC/BTC.png => EDGE_CONTENT_SERVER/currencyIcons/bitcoin/bitcoin.png EDGE_CONTENT_SERVER/ETH/USDT.png => EDGE_CONTENT_SERVER/currencyIcons/ethereum/dac17f958d2ee523a2206206994597c13d831ec7.png --- src/actions/CryptoExchangeActions.js | 5 +++-- src/components/modals/FlipInputModal.js | 5 +++-- src/components/modals/WcSmartContractModal.js | 5 +++-- .../navigation/CurrencySettingsTitle.js | 2 +- .../scenes/CreateWalletAccountSelectScene.js | 2 +- .../scenes/CreateWalletAccountSetupScene.js | 2 +- src/components/scenes/ManageTokensScene.js | 9 +++++---- src/components/scenes/NotificationScene.js | 6 +++--- src/components/scenes/RequestScene.js | 4 +++- src/components/scenes/SettingsScene.js | 4 ++-- src/components/scenes/WcConnectScene.js | 6 ++++-- src/components/themed/ControlPanel.js | 4 +++- src/components/themed/WalletList.js | 4 ++-- src/components/themed/WalletListSortableRow.js | 2 +- src/components/themed/WalletListSwipeRow.js | 6 ++++-- src/components/themed/WalletProgressIcon.js | 5 ++++- src/modules/FioAddress/util.js | 7 ++++--- src/reducers/scenes/WalletsReducer.js | 8 +++----- src/util/CurrencyInfoHelpers.js | 18 +++++++++--------- 19 files changed, 59 insertions(+), 45 deletions(-) diff --git a/src/actions/CryptoExchangeActions.js b/src/actions/CryptoExchangeActions.js index 7d72a4058e5..c695e3ca4c9 100644 --- a/src/actions/CryptoExchangeActions.js +++ b/src/actions/CryptoExchangeActions.js @@ -372,7 +372,7 @@ export const shiftCryptoCurrency = (swapInfo: GuiSwapInfo, onApprove: () => void export const selectWalletForExchange = (walletId: string, currencyCode: string, direction: 'from' | 'to') => async (dispatch: Dispatch, getState: GetState) => { const state = getState() const wallet = state.core.account.currencyWallets[walletId] - const chainCc = wallet.currencyInfo.currencyCode + const { currencyCode: chainCc, pluginId, metaTokens } = wallet.currencyInfo const cc = currencyCode || chainCc const balanceMessage = await getBalanceMessage(state, walletId, cc) const primaryDisplayDenomination: GuiDenomination = getDisplayDenomination(state, wallet.currencyInfo.pluginId, cc) @@ -383,13 +383,14 @@ export const selectWalletForExchange = (walletId: string, currencyCode: string, displayDenomination: primaryDisplayDenomination, exchangeDenomination: primaryExchangeDenomination } + const contractAddress = metaTokens.find(token => token.currencyCode === cc)?.contractAddress const data = { walletId, balanceMessage, currencyCode: cc, primaryInfo, - ...getCurrencyIcon(chainCc, cc) + ...getCurrencyIcon(pluginId, contractAddress) } if (direction === 'from') { diff --git a/src/components/modals/FlipInputModal.js b/src/components/modals/FlipInputModal.js index 087500c7bec..ca5b6618ad5 100644 --- a/src/components/modals/FlipInputModal.js +++ b/src/components/modals/FlipInputModal.js @@ -308,8 +308,9 @@ export const FlipInputModal = connect( const wallet = state.core.account.currencyWallets[walletId] const name = getWalletName(wallet) const { fiatCurrencyCode, isoFiatCurrencyCode } = getWalletFiat(wallet) - const { symbolImageDarkMono } = getCurrencyIcon(wallet.currencyInfo.currencyCode, currencyCode) - const { pluginId } = wallet.currencyInfo + const { pluginId, metaTokens } = wallet.currencyInfo + const contractAddress = metaTokens.find(token => token.currencyCode === currencyCode)?.contractAddress + const { symbolImageDarkMono } = getCurrencyIcon(pluginId, contractAddress) // Denominations const cryptoDenomination = getDisplayDenomination(state, pluginId, currencyCode) diff --git a/src/components/modals/WcSmartContractModal.js b/src/components/modals/WcSmartContractModal.js index 93bc79253a8..429cad9c4d6 100644 --- a/src/components/modals/WcSmartContractModal.js +++ b/src/components/modals/WcSmartContractModal.js @@ -57,7 +57,7 @@ export const WcSmartContractModal = (props: Props) => { const token = metaTokens.find(token => token.contractAddress != null && token.contractAddress.toLowerCase() === toAddress.toLowerCase()) if (token != null) amountCurrencyCode = token.currencyCode } - const feeCurrencyCode = wallet.currencyInfo.currencyCode + const { currencyCode: feeCurrencyCode, pluginId, metaTokens } = wallet.currencyInfo const { isoFiatCurrencyCode } = guiWallet @@ -111,7 +111,8 @@ export const WcSmartContractModal = (props: Props) => { ) } - const walletImageUri = getCurrencyIcon(feeCurrencyCode, amountCurrencyCode).symbolImage + const contractAddress = metaTokens.find(token => token.currencyCode === amountCurrencyCode)?.contractAddress + const walletImageUri = getCurrencyIcon(pluginId, contractAddress).symbolImage const slider = isInsufficientBal ? null : ( ) diff --git a/src/components/navigation/CurrencySettingsTitle.js b/src/components/navigation/CurrencySettingsTitle.js index e4ae3d4a92e..070f6a220bd 100644 --- a/src/components/navigation/CurrencySettingsTitle.js +++ b/src/components/navigation/CurrencySettingsTitle.js @@ -15,7 +15,7 @@ type Props = { export function CurrencySettingsTitle(props: Props) { const { displayName } = props.currencyInfo - const { symbolImage } = getCurrencyIcon(props.currencyInfo.currencyCode) + const { symbolImage } = getCurrencyIcon(props.currencyInfo.pluginId) const styles = getStyles(useTheme()) return ( diff --git a/src/components/scenes/CreateWalletAccountSelectScene.js b/src/components/scenes/CreateWalletAccountSelectScene.js index 148ba034b92..867e1f68982 100644 --- a/src/components/scenes/CreateWalletAccountSelectScene.js +++ b/src/components/scenes/CreateWalletAccountSelectScene.js @@ -248,7 +248,7 @@ class CreateWalletAccountSelect extends React.Component { const { selectedWalletType } = route.params const { walletId } = this.state const walletTypeValue = selectedWalletType.walletType.replace('wallet:', '') - const { symbolImage } = getCurrencyIcon(currencyConfigs[walletTypeValue].currencyInfo.currencyCode) + const { symbolImage } = getCurrencyIcon(currencyConfigs[walletTypeValue].currencyInfo.pluginId) const instructionSyntax = sprintf( s.strings.create_wallet_account_select_instructions_with_cost, selectedWalletType.currencyCode, diff --git a/src/components/scenes/CreateWalletAccountSetupScene.js b/src/components/scenes/CreateWalletAccountSetupScene.js index 4076a762166..6326c85f4c9 100644 --- a/src/components/scenes/CreateWalletAccountSetupScene.js +++ b/src/components/scenes/CreateWalletAccountSetupScene.js @@ -106,7 +106,7 @@ class CreateWalletAccountSetup extends React.Component { const { selectedWalletType } = route.params const { currencyCode } = selectedWalletType const walletTypeValue = selectedWalletType.walletType.replace('wallet:', '') - const { symbolImage } = getCurrencyIcon(currencyConfigs[walletTypeValue].currencyInfo.currencyCode) + const { symbolImage } = getCurrencyIcon(currencyConfigs[walletTypeValue].currencyInfo.pluginId) const isHandleAvailable: boolean = handleAvailableStatus === 'AVAILABLE' const validityIcon = isHandleAvailable ? validIcon : invalidIcon diff --git a/src/components/scenes/ManageTokensScene.js b/src/components/scenes/ManageTokensScene.js index 4a2ac8db899..0bea146f89d 100644 --- a/src/components/scenes/ManageTokensScene.js +++ b/src/components/scenes/ManageTokensScene.js @@ -195,11 +195,12 @@ class ManageTokensSceneComponent extends React.Component { } render() { - const { route, manageTokensPending, theme, wallets, enabledTokens } = this.props + const { route, manageTokensPending, theme, wallets, enabledTokens, currencyWallets } = this.props const { searchValue } = this.state const { walletId } = route.params - if (wallets[walletId] == null) return null - const { name, currencyCode, metaTokens } = wallets[walletId] + if (wallets[walletId] == null || currencyWallets[walletId] == null) return null + const { name, currencyCode } = wallets[walletId] + const { pluginId, metaTokens } = currencyWallets[walletId].currencyInfo const styles = getStyles(theme) const tempEnabledTokens = difference(union(this.state.tokensToEnable, enabledTokens), this.state.tokensToDisable) @@ -223,7 +224,7 @@ class ManageTokensSceneComponent extends React.Component { goToEditTokenScene={this.goToEditTokenScene} metaToken={metaToken} walletId={walletId} - symbolImage={getCurrencyIcon(currencyCode, metaToken.item.currencyCode).symbolImage} + symbolImage={getCurrencyIcon(pluginId, metaToken.item.contractAddress).symbolImage} toggleToken={this.toggleToken} enabledList={tempEnabledTokens} metaTokens={metaTokens} diff --git a/src/components/scenes/NotificationScene.js b/src/components/scenes/NotificationScene.js index 3a494efc2d1..f2fecef32e6 100644 --- a/src/components/scenes/NotificationScene.js +++ b/src/components/scenes/NotificationScene.js @@ -97,8 +97,8 @@ class NotificationComponent extends React.Component { {this.props.currencyInfos.map((currencyInfo: EdgeCurrencyInfo) => { - const { displayName, currencyCode } = currencyInfo - const { symbolImage } = getCurrencyIcon(currencyCode) + const { displayName, pluginId } = currencyInfo + const { symbolImage } = getCurrencyIcon(pluginId) const onPress = () => enabled ? navigation.navigate('currencyNotificationSettings', { @@ -107,7 +107,7 @@ class NotificationComponent extends React.Component { : undefined return ( - + ) diff --git a/src/components/scenes/RequestScene.js b/src/components/scenes/RequestScene.js index 099b8f4e441..80e4da24eb2 100644 --- a/src/components/scenes/RequestScene.js +++ b/src/components/scenes/RequestScene.js @@ -579,7 +579,9 @@ export const Request = connect( const fioAddressesExist = !!state.ui.scenes.fioAddress.fioAddresses.length // Icon - const currencyIcon = getCurrencyIcon(guiWallet.currencyCode, currencyCode).symbolImage + const { pluginId, metaTokens } = edgeWallet.currencyInfo + const contractAddress = metaTokens.find(token => token.currencyCode === currencyCode)?.contractAddress + const currencyIcon = getCurrencyIcon(pluginId, contractAddress).symbolImage return { currencyCode, diff --git a/src/components/scenes/SettingsScene.js b/src/components/scenes/SettingsScene.js index e48ca268038..afdb0431dc5 100644 --- a/src/components/scenes/SettingsScene.js +++ b/src/components/scenes/SettingsScene.js @@ -252,8 +252,8 @@ export class SettingsSceneComponent extends React.Component { {CURRENCY_SETTINGS_KEYS.map(pluginId => { if (account.currencyConfig[pluginId] == null) return null const { currencyInfo } = account.currencyConfig[pluginId] - const { displayName, currencyCode } = currencyInfo - const { symbolImage } = getCurrencyIcon(currencyCode) + const { displayName } = currencyInfo + const { symbolImage } = getCurrencyIcon(pluginId) const onPress = () => navigation.navigate('currencySettings', { currencyInfo diff --git a/src/components/scenes/WcConnectScene.js b/src/components/scenes/WcConnectScene.js index 0f7d8e2d4e9..3a4675ad71d 100644 --- a/src/components/scenes/WcConnectScene.js +++ b/src/components/scenes/WcConnectScene.js @@ -43,11 +43,13 @@ export const WcConnectScene = (props: Props) => { const { walletAddress, walletImageUri, walletName, wallet, currencyWallets } = useSelector(state => { const { currencyWallets } = state.core.account const guiWallet = getSelectedWallet(state) + const wallet = currencyWallets[guiWallet.id] + const { pluginId, metaTokens } = wallet.currencyInfo const walletCurrencyCode = state.ui.wallets.selectedCurrencyCode - const walletImageUri = getCurrencyIcon(guiWallet.currencyCode, walletCurrencyCode).symbolImage + const contractAddress = metaTokens.find(token => token.currencyCode === walletCurrencyCode)?.contractAddress + const walletImageUri = getCurrencyIcon(pluginId, contractAddress).symbolImage const walletName = guiWallet.name const walletAddress = guiWallet.receiveAddress.publicAddress - const wallet = currencyWallets[guiWallet.id] return { walletAddress, walletImageUri, diff --git a/src/components/themed/ControlPanel.js b/src/components/themed/ControlPanel.js index 2ce532db876..0c57d71b211 100644 --- a/src/components/themed/ControlPanel.js +++ b/src/components/themed/ControlPanel.js @@ -58,7 +58,9 @@ export function ControlPanel(props: Props) { const selectedCurrencyCode = useSelector(state => state.ui.wallets.selectedCurrencyCode) const selectedWallet = useSelector(state => state.core.account.currencyWallets[state.ui.wallets.selectedWalletId]) const guiWallet = useSelector(getSelectedWallet) - const currencyLogo = guiWallet != null ? getCurrencyIcon(guiWallet.currencyCode, selectedCurrencyCode).symbolImage : null + const metaTokens = guiWallet?.metaTokens ?? [] + const contractAddress = metaTokens.find(token => token.currencyCode === selectedCurrencyCode)?.contractAddress + const currencyLogo = guiWallet != null ? getCurrencyIcon(selectedWallet.currencyInfo.pluginId, contractAddress).symbolImage : null const { name: currencyDenomName, multiplier: currencyDenomMult } = useSelector(state => guiWallet != null ? getDisplayDenomination(state, selectedWallet.currencyInfo.pluginId, selectedCurrencyCode) : { name: '', multiplier: '1' } ) diff --git a/src/components/themed/WalletList.js b/src/components/themed/WalletList.js index 1ffb52833b6..703fcf2e75b 100644 --- a/src/components/themed/WalletList.js +++ b/src/components/themed/WalletList.js @@ -222,7 +222,7 @@ class WalletListComponent extends React.PureComponent { const currencyInfos = getCurrencyInfos(account) for (const currencyInfo of currencyInfos) { for (const metaToken of currencyInfo.metaTokens) { - const { currencyCode, currencyName } = metaToken + const { currencyCode, currencyName, contractAddress } = metaToken // Fix for when the token code and chain code are the same (like EOS/TLOS) if (currencyCode === currencyInfo.currencyCode) continue const fullCurrencyCode = `${currencyInfo.currencyCode}-${currencyCode}` @@ -235,7 +235,7 @@ class WalletListComponent extends React.PureComponent { createTokenType: { currencyCode, currencyName, - ...getCurrencyIcon(currencyInfo.currencyCode, currencyCode), + ...getCurrencyIcon(currencyInfo.pluginId, contractAddress), parentCurrencyCode: currencyInfo.currencyCode } }) diff --git a/src/components/themed/WalletListSortableRow.js b/src/components/themed/WalletListSortableRow.js index fd306bf04d4..653c80be7cc 100644 --- a/src/components/themed/WalletListSortableRow.js +++ b/src/components/themed/WalletListSortableRow.js @@ -59,7 +59,7 @@ class WalletListSortableRowComponent extends React.PureComponent { const multiplier = displayDenomination.multiplier const name = getWalletName(wallet) const symbol = displayDenomination.symbol - const { symbolImageDarkMono } = getCurrencyIcon(currencyCode) + const { symbolImageDarkMono } = getCurrencyIcon(pluginId) const balance = wallet.balances[currencyCode] ?? '0' const preliminaryCryptoAmount = truncateDecimals(div(balance, multiplier, DECIMAL_PRECISION)) diff --git a/src/components/themed/WalletListSwipeRow.js b/src/components/themed/WalletListSwipeRow.js index 76987df8885..283908ad35f 100644 --- a/src/components/themed/WalletListSwipeRow.js +++ b/src/components/themed/WalletListSwipeRow.js @@ -6,7 +6,7 @@ import { SwipeRow } from 'react-native-swipe-list-view' import { Fontello } from '../../assets/vector/index.js' import { REQUEST, SEND, TRANSACTION_LIST } from '../../constants/SceneKeys.js' -import { getSpecialCurrencyInfo, WALLET_LIST_OPTIONS_ICON } from '../../constants/WalletAndCurrencyConstants.js' +import { getPluginId, getSpecialCurrencyInfo, WALLET_LIST_OPTIONS_ICON } from '../../constants/WalletAndCurrencyConstants.js' import { Actions } from '../../types/routerTypes.js' import type { GuiWallet } from '../../types/types.js' import { getCurrencyIcon } from '../../util/CurrencyInfoHelpers.js' @@ -85,7 +85,9 @@ class WalletListSwipeRowComponent extends React.PureComponent { const { currencyCode, guiWallet, isToken } = this.props - const { symbolImage } = getCurrencyIcon(guiWallet.currencyCode, currencyCode) + const { metaTokens } = guiWallet + const contractAddress = metaTokens.find(token => token.currencyCode === currencyCode)?.contractAddress + const { symbolImage } = getCurrencyIcon(getPluginId(guiWallet.type), contractAddress) this.closeRow() Airship.show(bridge => ( diff --git a/src/components/themed/WalletProgressIcon.js b/src/components/themed/WalletProgressIcon.js index 43af7ce460d..2d3ba1915fb 100644 --- a/src/components/themed/WalletProgressIcon.js +++ b/src/components/themed/WalletProgressIcon.js @@ -5,6 +5,7 @@ import { View } from 'react-native' import { AnimatedCircularProgress } from 'react-native-circular-progress' import FastImage from 'react-native-fast-image' +import { getPluginId } from '../../constants/WalletAndCurrencyConstants.js' import { connect } from '../../types/reactRedux.js' import { getCurrencyIcon } from '../../util/CurrencyInfoHelpers.js' import { type ThemeProps, withTheme } from '../services/ThemeContext.js' @@ -103,7 +104,9 @@ export const WalletProgressIcon = connect( if (walletId) { const guiWallet = state.ui.wallets.byId[walletId] - icon = getCurrencyIcon(guiWallet.currencyCode, currencyCode).symbolImage + const { metaTokens } = guiWallet + const contractAddress = metaTokens.find(token => token.currencyCode === currencyCode)?.contractAddress + icon = getCurrencyIcon(getPluginId(guiWallet.type), contractAddress).symbolImage const walletsProgress = state.ui.wallets.walletLoadingProgress progress = walletsProgress[walletId] ? walletsProgress[walletId] * 100 : 0 } diff --git a/src/modules/FioAddress/util.js b/src/modules/FioAddress/util.js index ea7882feeef..b62f7d2a203 100644 --- a/src/modules/FioAddress/util.js +++ b/src/modules/FioAddress/util.js @@ -5,7 +5,7 @@ import type { Disklet } from 'disklet' import type { EdgeAccount, EdgeCurrencyConfig, EdgeCurrencyWallet, EdgeDenomination } from 'edge-core-js' import { sprintf } from 'sprintf-js' -import { FIO_STR, FIO_WALLET_TYPE } from '../../constants/WalletAndCurrencyConstants' +import { FIO_STR, FIO_WALLET_TYPE, getPluginId } from '../../constants/WalletAndCurrencyConstants' import s from '../../locales/strings' import type { CcWalletMap } from '../../reducers/FioReducer' import type { FioAddress, FioConnectionWalletItem, FioDomain, FioObtRecord, GuiWallet } from '../../types/types' @@ -387,7 +387,8 @@ export const makeConnectWallets = (wallets: { [walletId: string]: GuiWallet }, c if (!tokenData) { tokenData = { currencyCode: enabledToken, - symbolImage: '' + symbolImage: '', + contractAddress: undefined } } const fullCurrencyCode = `${wallets[walletKey].currencyCode}:${tokenData.currencyCode}` @@ -395,7 +396,7 @@ export const makeConnectWallets = (wallets: { [walletId: string]: GuiWallet }, c key: `${wallets[walletKey].id}-${tokenData.currencyCode}`, id: wallets[walletKey].id, publicAddress, - ...getCurrencyIcon(wallets[walletKey].currencyCode, tokenData.currencyCode), + ...getCurrencyIcon(getPluginId(wallets[walletKey].type), tokenData.contractAddress), name: wallets[walletKey].name, currencyCode: tokenData.currencyCode, chainCode: wallets[walletKey].currencyCode, diff --git a/src/reducers/scenes/WalletsReducer.js b/src/reducers/scenes/WalletsReducer.js index 0fa1d5d89d7..53767d67f15 100644 --- a/src/reducers/scenes/WalletsReducer.js +++ b/src/reducers/scenes/WalletsReducer.js @@ -1,6 +1,6 @@ // @flow -import type { EdgeCurrencyWallet, EdgeDenomination, EdgeMetaToken, EdgeReceiveAddress } from 'edge-core-js' +import type { EdgeCurrencyWallet, EdgeDenomination, EdgeReceiveAddress } from 'edge-core-js' import { type Reducer, combineReducers } from 'redux' import { FIO_WALLET_TYPE, SPECIAL_CURRENCY_INFO, STAKING_BALANCES } from '../../constants/WalletAndCurrencyConstants' @@ -290,11 +290,9 @@ function schema(wallet: EdgeCurrencyWallet, receiveAddress: EdgeReceiveAddress): const type: string = wallet.type const name: string = wallet.name || 'no wallet name' - const currencyCode: string = wallet.currencyInfo.currencyCode + const { currencyCode, metaTokens, denominations, pluginId } = wallet.currencyInfo const fiatCurrencyCode: string = wallet.fiatCurrencyCode.replace('iso:', '') const isoFiatCurrencyCode: string = wallet.fiatCurrencyCode - const metaTokens: EdgeMetaToken[] = wallet.currencyInfo.metaTokens - const denominations: EdgeDenomination[] = wallet.currencyInfo.denominations const blockHeight: number = wallet.blockHeight // TODO: Fetch the token list asynchonously before dispatching `schema`: const enabledTokens: string[] = [] @@ -357,7 +355,7 @@ function schema(wallet: EdgeCurrencyWallet, receiveAddress: EdgeReceiveAddress): enabledTokens, receiveAddress, blockHeight, - ...getCurrencyIcon(currencyCode) + ...getCurrencyIcon(pluginId) } return newWallet diff --git a/src/util/CurrencyInfoHelpers.js b/src/util/CurrencyInfoHelpers.js index 0399c40d733..19aacca0c71 100644 --- a/src/util/CurrencyInfoHelpers.js +++ b/src/util/CurrencyInfoHelpers.js @@ -18,8 +18,8 @@ const activationRequiredCurrencyCodes = Object.keys(SPECIAL_CURRENCY_INFO) .filter(pluginId => SPECIAL_CURRENCY_INFO[pluginId].isAccountActivationRequired ?? false) .map(pluginId => SPECIAL_CURRENCY_INFO[pluginId].chainCode) -export function getCurrencyIcon(chainCode: string, currencyCode: string = chainCode): CurrencyIcons { - const url = `${EDGE_CONTENT_SERVER}/${chainCode}/${currencyCode}` +export function getCurrencyIcon(pluginId: string, contractAddress?: string = pluginId): CurrencyIcons { + const url = `${EDGE_CONTENT_SERVER}/currencyIcons/${pluginId.toLowerCase()}/${contractAddress.toLowerCase().replace('0x', '')}` return { symbolImage: `${url}.png`, symbolImageDarkMono: `${url}_dark.png` @@ -61,12 +61,12 @@ export function sortCurrencyInfos(infos: EdgeCurrencyInfo[]): EdgeCurrencyInfo[] * so make that. */ export function makeCreateWalletType(currencyInfo: EdgeCurrencyInfo): CreateWalletType { - const { currencyCode, walletType, displayName: currencyName } = currencyInfo + const { currencyCode, walletType, displayName: currencyName, pluginId } = currencyInfo return { currencyName, walletType, currencyCode, - ...getCurrencyIcon(currencyCode) + ...getCurrencyIcon(pluginId) } } @@ -78,23 +78,23 @@ export function getCreateWalletTypes(account: EdgeAccount, filterActivation: boo const out: CreateWalletType[] = [] for (const currencyInfo of infos) { - const { currencyCode } = currencyInfo + const { currencyCode, pluginId } = currencyInfo // Prevent currencies that needs activation from being created from a modal if (filterActivation && activationRequiredCurrencyCodes.includes(currencyCode.toUpperCase())) continue // FIO disable changes - if (currencyInfo.pluginId === 'fio' && global.isFioDisabled) continue - if (currencyInfo.pluginId === 'bitcoin') { + if (pluginId === 'fio' && global.isFioDisabled) continue + if (pluginId === 'bitcoin') { out.push({ currencyName: 'Bitcoin (Segwit)', walletType: 'wallet:bitcoin-bip49', currencyCode, - ...getCurrencyIcon(currencyCode) + ...getCurrencyIcon(pluginId) }) out.push({ currencyName: 'Bitcoin (no Segwit)', walletType: 'wallet:bitcoin-bip44', currencyCode, - ...getCurrencyIcon(currencyCode) + ...getCurrencyIcon(pluginId) }) } else { out.push(makeCreateWalletType(currencyInfo)) From 59b646aefe6115aecc07b6e5a9d442b6e3be4b5e Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 2 Mar 2022 09:22:06 -0800 Subject: [PATCH 016/287] Upgrade edge-exchange-plugins to v0.12.12 --- CHANGELOG.md | 5 ++++- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3eac4cb69a..4ad7d311b73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,12 +33,15 @@ - Add getSplittableTypes method to ethEngine - Use binary search in ethEngine's getMaxSpendable for main chain currency code - Update ZEC checkpoints -- Upgrade edge-exchange-plugins to v0.12.11 +- Upgrade edge-exchange-plugins to v0.12.12 - Add Binance Smart Chain to swap partners + - Changelly: Add BNB Smart Chain support - Changenow: Fix corner case where standard flow was skipped - Exolix: Update plugin to use mainchain:tokencode values in requests - Coingecko: Add Celo and Aave unique IDs - Godex: Disable DGB selling + - Disable BNB Beacon Chain in all swap plugins + - Transfer: Use pluginIds instead of currency codes - Use pluginIds instead of currency code keys in transcription and invalid-code maps - Add helper function and transcription maps for changing mainnet codes diff --git a/package.json b/package.json index 4b0344b8f91..4b3b606241a 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "edge-currency-accountbased": "^0.14.1", "edge-currency-bitcoin": "^4.9.20", "edge-currency-monero": "^0.3.4", - "edge-exchange-plugins": "^0.12.11", + "edge-exchange-plugins": "^0.12.12", "edge-login-ui-rn": "^0.9.29", "edge-plugin-bity": "https://github.com/EdgeApp/edge-plugin-bity.git#2a52e6cb86512b98f69f8f5dd3105cdf6d0c2d8a", "edge-plugin-simplex": "https://github.com/EdgeApp/edge-plugin-simplex.git#4842daad5fd560cd462f4668ab17c521a16a6cd9", diff --git a/yarn.lock b/yarn.lock index 0c8a4db4656..f37174e2e65 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5547,10 +5547,10 @@ edge-currency-monero@^0.3.4: mymonero-core-js "https://github.com/EdgeApp/mymonero-core-js.git#matthew/txPrivateKey" uri-js "^3.0.2" -edge-exchange-plugins@^0.12.11: - version "0.12.11" - resolved "https://registry.yarnpkg.com/edge-exchange-plugins/-/edge-exchange-plugins-0.12.11.tgz#ca222483d77a9d066a69552fe31e2c2c39f150d6" - integrity sha512-s+HJ53CyhRXyBWTw3ooJCjXbRB94Tae/gw7IKyTaCkeYqBBvjg/unf+kB8YQj92ll43PkEpyOOlfsNvd1lisZA== +edge-exchange-plugins@^0.12.12: + version "0.12.12" + resolved "https://registry.yarnpkg.com/edge-exchange-plugins/-/edge-exchange-plugins-0.12.12.tgz#502b7f7a91f10a7bbde8851c23f7191d7928290e" + integrity sha512-gwNu+fTlASx4oMgdCTqDAWdUR3FJMFKjSMnKICXr7wMTaLMBo0AYcm7sA/x7YA30fcInXWVx/lK3vWCRwf8d8w== dependencies: biggystring "^3.0.2" cleaners "^0.3.9" From 535612e6ba96413061379c2a23b799b4b05dacd8 Mon Sep 17 00:00:00 2001 From: Paul Puey Date: Wed, 2 Mar 2022 03:37:45 -0800 Subject: [PATCH 017/287] Improve logs with date and wallet info --- src/actions/WalletActions.js | 12 +++++++---- .../services/EdgeWalletCallbackManager.js | 21 ++++++++++--------- src/util/utils.js | 6 ++++++ 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/actions/WalletActions.js b/src/actions/WalletActions.js index 81003b33fa9..bdb968a231d 100644 --- a/src/actions/WalletActions.js +++ b/src/actions/WalletActions.js @@ -15,7 +15,7 @@ import { type Dispatch, type GetState } from '../types/reduxTypes.js' import { Actions } from '../types/routerTypes.js' import { type CustomTokenInfo } from '../types/types.js' import { getCurrencyInfos, makeCreateWalletType } from '../util/CurrencyInfoHelpers.js' -import { getReceiveAddresses, getSupportedFiats, mergeTokens } from '../util/utils.js' +import { getReceiveAddresses, getSupportedFiats, logPrefix, mergeTokens } from '../util/utils.js' import { addTokenAsync } from './AddTokenActions.js' import { updateExchangeRates } from './ExchangeRateActions.js' import { refreshConnectedWallets } from './FioActions.js' @@ -157,18 +157,22 @@ export const refreshWallet = (walletId: string) => (dispatch: Dispatch, getState const { currencyWallets } = state.core.account const wallet = currencyWallets[walletId] if (wallet) { + const prefix = logPrefix(wallet) + if (!refreshDetails.delayUpsert) { const now = Date.now() if (now - refreshDetails.lastUpsert > upsertFrequency) { dispatchUpsertWallets(dispatch, [wallet]) refreshDetails.lastUpsert = Date.now() } else { - console.log('refreshWallets setTimeout delay upsert id:' + walletId) + console.log(`${prefix}: refreshWallets setTimeout delay upsert`) refreshDetails.delayUpsert = true refreshDetails.walletIds[walletId] = wallet setTimeout(() => { const wallets = [] for (const wid of Object.keys(refreshDetails.walletIds)) { + const w = refreshDetails.walletIds[wid] + console.log(`${logPrefix(w)}: refreshWallets upserting now`) wallets.push(refreshDetails.walletIds[wid]) } dispatchUpsertWallets(dispatch, wallets) @@ -180,10 +184,10 @@ export const refreshWallet = (walletId: string) => (dispatch: Dispatch, getState } else { // Add wallet to the queue to upsert refreshDetails.walletIds[walletId] = wallet - console.log('refreshWallets delayUpsert id:' + walletId) + console.log(`${prefix}: refreshWallets delayUpsert`) } } else { - console.log('refreshWallets no wallet. id:' + walletId) + console.log(`${walletId.slice(0, 2)} refreshWallets no wallet`) } } diff --git a/src/components/services/EdgeWalletCallbackManager.js b/src/components/services/EdgeWalletCallbackManager.js index 2d28c33ca9f..b4a55462d07 100644 --- a/src/components/services/EdgeWalletCallbackManager.js +++ b/src/components/services/EdgeWalletCallbackManager.js @@ -7,7 +7,7 @@ import { checkPasswordRecovery } from '../../actions/RecoveryReminderActions.js' import { newTransactionsRequest, refreshTransactionsRequest } from '../../actions/TransactionListActions.js' import { refreshReceiveAddressRequest, refreshWallet, updateWalletLoadingProgress } from '../../actions/WalletActions.js' import { connect } from '../../types/reactRedux.js' -import { isReceivedTransaction } from '../../util/utils.js' +import { isReceivedTransaction, logPrefix } from '../../util/utils.js' import { WcSmartContractModal } from '../modals/WcSmartContractModal.js' import { Airship } from './AirshipInstance.js' @@ -37,15 +37,16 @@ class EdgeWalletCallbackManagerComponent extends React.Component { componentDidMount() { const { wallet } = this.props + const prefix = logPrefix(wallet) wallet.on('newTransactions', transactions => { if (transactions && transactions.length) { - console.log(`${this.props.id} - onNewTransactions, num of new tx's: ${transactions.length}`) + console.log(`${prefix} - onNewTransactions, num of new tx's: ${transactions.length}`) for (const tx of transactions) { - console.log(`${this.props.id} - onNewTransactions with TXID: ${tx.txid}`) + console.log(`${prefix} - onNewTransactions with TXID: ${tx.txid}`) } } else { - console.log(`${this.props.id} - onNewTransactions: No transactions`) + console.log(`${prefix} - onNewTransactions: No transactions`) } this.props.refreshReceiveAddressRequest(this.props.id) @@ -59,12 +60,12 @@ class EdgeWalletCallbackManagerComponent extends React.Component { wallet.on('transactionsChanged', transactions => { if (transactions && transactions.length) { - console.log(`${this.props.id} - onTransactionsChanged, num of tx's changed: ${transactions.length}`) + console.log(`${prefix} - onTransactionsChanged, num of tx's changed: ${transactions.length}`) for (const tx of transactions) { - console.log(`${this.props.id} - onTransactionsChanged with TXID: ${tx.txid}`) + console.log(`${prefix} - onTransactionsChanged with TXID: ${tx.txid}`) } } else { - console.log(`${this.props.id} - onTransactionsChanged: No transactions`) + console.log(`${prefix} - onTransactionsChanged: No transactions`) } this.props.refreshReceiveAddressRequest(this.props.id) @@ -77,7 +78,7 @@ class EdgeWalletCallbackManagerComponent extends React.Component { }) wallet.watch('syncRatio', transactionCount => { - console.log(`${this.props.id} - onAddressesChecked with progress ratio: ${transactionCount}`) + console.log(`${prefix} - onAddressesChecked with progress ratio: ${transactionCount}`) if (transactionCount > 0) { this.props.updateWalletLoadingProgress(this.props.id, transactionCount) @@ -89,13 +90,13 @@ class EdgeWalletCallbackManagerComponent extends React.Component { }) wallet.watch('blockHeight', blockHeight => { - console.log(`${this.props.id} - onBlockHeightChanged with height:${blockHeight}`) + console.log(`${prefix} - onBlockHeightChanged with height:${blockHeight}`) this.props.refreshWallet(this.props.id) }) wallet.watch('name', walletName => { - console.log(`${this.props.id} - onWalletNameChanged with new name:${walletName || ''}`) + console.log(`${prefix} - onWalletNameChanged with new name:${walletName || ''}`) this.props.refreshWallet(this.props.id) }) diff --git a/src/util/utils.js b/src/util/utils.js index 58f41e38aa0..3104083fde7 100644 --- a/src/util/utils.js +++ b/src/util/utils.js @@ -796,3 +796,9 @@ export function unixToLocaleDateTime(unixDate: number): { date: string, time: st dateTime: toLocaleDateTime(date) } } + +export function logPrefix(wallet: EdgeCurrencyWallet): string { + const prettyDate = new Date().toISOString().replace(/.*(\d\d-\d\d)T(\d\d:\d\d:\d\d).*/, '$1 $2') + const name = wallet.name ? wallet.name : 'NULL' + return `${prettyDate} ${wallet.currencyInfo.currencyCode}-${wallet.id.slice(0, 2)}-${name}` +} From ca5a6589e3ad08c959cb96b69b3c3d1efcb148cd Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 2 Mar 2022 10:19:35 -0800 Subject: [PATCH 018/287] Upgrade edge-exchange-plugins to v0.12.13 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4b3b606241a..c81f5b78dba 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "edge-currency-accountbased": "^0.14.1", "edge-currency-bitcoin": "^4.9.20", "edge-currency-monero": "^0.3.4", - "edge-exchange-plugins": "^0.12.12", + "edge-exchange-plugins": "^0.12.13", "edge-login-ui-rn": "^0.9.29", "edge-plugin-bity": "https://github.com/EdgeApp/edge-plugin-bity.git#2a52e6cb86512b98f69f8f5dd3105cdf6d0c2d8a", "edge-plugin-simplex": "https://github.com/EdgeApp/edge-plugin-simplex.git#4842daad5fd560cd462f4668ab17c521a16a6cd9", diff --git a/yarn.lock b/yarn.lock index f37174e2e65..b80b14a83a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5547,10 +5547,10 @@ edge-currency-monero@^0.3.4: mymonero-core-js "https://github.com/EdgeApp/mymonero-core-js.git#matthew/txPrivateKey" uri-js "^3.0.2" -edge-exchange-plugins@^0.12.12: - version "0.12.12" - resolved "https://registry.yarnpkg.com/edge-exchange-plugins/-/edge-exchange-plugins-0.12.12.tgz#502b7f7a91f10a7bbde8851c23f7191d7928290e" - integrity sha512-gwNu+fTlASx4oMgdCTqDAWdUR3FJMFKjSMnKICXr7wMTaLMBo0AYcm7sA/x7YA30fcInXWVx/lK3vWCRwf8d8w== +edge-exchange-plugins@^0.12.13: + version "0.12.13" + resolved "https://registry.yarnpkg.com/edge-exchange-plugins/-/edge-exchange-plugins-0.12.13.tgz#acef8f3faf2ac2e502956cdd5f659210ff27ec43" + integrity sha512-G27M7qMsmPnPT66RlAv0tQ5aeZmUCkFYTw/gQ6edC3ItRNfbp/meEFYF49dByD3kbsLxR+K96MlkUzh6F38O2Q== dependencies: biggystring "^3.0.2" cleaners "^0.3.9" From 73fe19263c202d4a619c92a740ee317ef7787230 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 2 Mar 2022 10:32:06 -0800 Subject: [PATCH 019/287] Upgrade edge-core-js to v0.19.10 --- ios/Podfile.lock | 4 ++-- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 77ad4e8f7c4..4ebcd3b6048 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -18,7 +18,7 @@ PODS: - disklet (0.5.2): - React - DoubleConversion (1.1.6) - - edge-core-js (0.19.9): + - edge-core-js (0.19.10): - React - edge-login-ui-rn (0.9.29): - React @@ -986,7 +986,7 @@ SPEC CHECKSUMS: CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 disklet: e7ed3e673ccad9d175a1675f9f3589ffbf69a5fd DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de - edge-core-js: e0919eed0a701479efcb3ee616d5f29162f8b7d6 + edge-core-js: 0f4ff3105e6008d0795d77fb81f3e4893c6f706e edge-login-ui-rn: bb229d0087d664f76a03949df7627ed49fed4144 FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b FBReactNativeSpec: 86d9e030dbb7af0ba0eb4e1b6d52e4af26c7f1f3 diff --git a/package.json b/package.json index c81f5b78dba..094644e5802 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "detect-bundler": "^1.0.0", "detox": "^18.10.0", "disklet": "^0.5.2", - "edge-core-js": "^0.19.9", + "edge-core-js": "^0.19.10", "edge-currency-accountbased": "^0.14.1", "edge-currency-bitcoin": "^4.9.20", "edge-currency-monero": "^0.3.4", diff --git a/yarn.lock b/yarn.lock index b80b14a83a4..7c7f1f1c192 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5452,10 +5452,10 @@ ed25519@0.0.4: bindings "^1.2.1" nan "^2.0.9" -edge-core-js@^0.19.9: - version "0.19.9" - resolved "https://registry.yarnpkg.com/edge-core-js/-/edge-core-js-0.19.9.tgz#c7186f54ca204827a344a66e135175057590e0a9" - integrity sha512-IZl9v2hda36pN8VxbMCuGSE+itL5dThPgc95V/y5ZOEOGkpvusu4kEKH05s7qJJh0j1Oe6b0PkkLtzl49gWOmw== +edge-core-js@^0.19.10: + version "0.19.10" + resolved "https://registry.yarnpkg.com/edge-core-js/-/edge-core-js-0.19.10.tgz#a03e2b805cbc4538817d6170471f2e368c605765" + integrity sha512-XEi0YAVIEvwOejsKMAahmDj44ogVcjwNiM3AN0Hyo4ZR+U3AL2NzJOhWItofsXz7+HB/LeHTvhvUR8vLJB0+vA== dependencies: aes-js "^3.1.0" base-x "^1.0.4" From 447fe2f6cc1148083c057f979503ee50062b8371 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 2 Mar 2022 11:23:42 -0800 Subject: [PATCH 020/287] Update changelog --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ad7d311b73..4e201e8dc21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,17 +13,19 @@ - Convert special currency info map keys from currency code to pluginId - Fix fee display in flip input - Import biggystring functions individually -- Upgrade edge-core-js to v0.19.9 +- Upgrade edge-core-js to v0.19.10 - fixed: Stop adding undefined entries to EdgeAccount.currencyWallets. - added: Define a new EdgeToken type and make that available as EdgeCurrencyConfig.builtinTokens and EdgeCurrencyConfig.customTokens. - added: Define a new EdgeCurrencyPlugin.getBuiltinTokens method, and use that to populate EdgeCurrencyConfig.builtinTokens when available. - added: Pass EdgeToken fields to EdgeCurrencyEngine.addCustomToken, along with the existing EdgeMetaToken fields. + - added: EdgeCurrencyInfo.canReplaceByFee. - deprecated: EdgeCurrencyInfo.defaultSettings - deprecated: EdgeCurrencyInfo.metaTokens - deprecated: EdgeCurrencyInfo.symbolImage - deprecated: EdgeCurrencyInfo.symbolImageDarkMono - added: Include an imported flag with all new wallet keys, to indicate whether they were derived freshly or imported from user-entered data. - fixed: Do not hang forever if creating a currency engine fails. + - changed: Make denominationToNative and nativeToDenomination only look at the currencies available on the current wallet. - changed: Add comments and improve organization in the public types file. - changed: Use cleaners to load & save many files for additional safety. - fixed: Improve wallet start-up performance by loading fewer files. @@ -33,14 +35,13 @@ - Add getSplittableTypes method to ethEngine - Use binary search in ethEngine's getMaxSpendable for main chain currency code - Update ZEC checkpoints -- Upgrade edge-exchange-plugins to v0.12.12 +- Upgrade edge-exchange-plugins to v0.12.13 - Add Binance Smart Chain to swap partners - Changelly: Add BNB Smart Chain support - Changenow: Fix corner case where standard flow was skipped - Exolix: Update plugin to use mainchain:tokencode values in requests - Coingecko: Add Celo and Aave unique IDs - Godex: Disable DGB selling - - Disable BNB Beacon Chain in all swap plugins - Transfer: Use pluginIds instead of currency codes - Use pluginIds instead of currency code keys in transcription and invalid-code maps - Add helper function and transcription maps for changing mainnet codes From 54876f4e070294311a58a2f73f51e28426c9afab Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 2 Mar 2022 14:47:44 -0800 Subject: [PATCH 021/287] Update Moonpay description --- src/__tests__/__snapshots__/GuiPlugins.test.js.snap | 4 ++-- src/constants/plugins/buyPluginList.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/__tests__/__snapshots__/GuiPlugins.test.js.snap b/src/__tests__/__snapshots__/GuiPlugins.test.js.snap index 4ad77704bde..a02530e708d 100644 --- a/src/__tests__/__snapshots__/GuiPlugins.test.js.snap +++ b/src/__tests__/__snapshots__/GuiPlugins.test.js.snap @@ -140,7 +140,7 @@ Monthly Limit: $47000", "EOS", "XLM", "BAT", - "BNB", + "BNB Beacon Chain", "PAX", "QTUM", "RVN", @@ -220,7 +220,7 @@ Monthly Limit: $47000", "EOS", "XLM", "BAT", - "BNB", + "BNB Beacon Chain", "PAX", "QTUM", "RVN", diff --git a/src/constants/plugins/buyPluginList.json b/src/constants/plugins/buyPluginList.json index fac6ffd9fdf..1dd59daa963 100644 --- a/src/constants/plugins/buyPluginList.json +++ b/src/constants/plugins/buyPluginList.json @@ -497,7 +497,7 @@ "EOS", "XLM", "BAT", - "BNB", + "BNB Beacon Chain", "PAX", "QTUM", "RVN", From 07682f7fe45e6f32641fb9e0bece11b0d77462fa Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 2 Mar 2022 17:19:29 -0800 Subject: [PATCH 022/287] Upgrade edge-exchange-plugins to v0.12.14 --- CHANGELOG.md | 3 ++- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e201e8dc21..30974b51e4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,7 @@ - Add getSplittableTypes method to ethEngine - Use binary search in ethEngine's getMaxSpendable for main chain currency code - Update ZEC checkpoints -- Upgrade edge-exchange-plugins to v0.12.13 +- Upgrade edge-exchange-plugins to v0.12.14 - Add Binance Smart Chain to swap partners - Changelly: Add BNB Smart Chain support - Changenow: Fix corner case where standard flow was skipped @@ -43,6 +43,7 @@ - Coingecko: Add Celo and Aave unique IDs - Godex: Disable DGB selling - Transfer: Use pluginIds instead of currency codes + - Fix calling denomination methods from wrong wallet - Use pluginIds instead of currency code keys in transcription and invalid-code maps - Add helper function and transcription maps for changing mainnet codes diff --git a/package.json b/package.json index 094644e5802..a2eb6ee873e 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "edge-currency-accountbased": "^0.14.1", "edge-currency-bitcoin": "^4.9.20", "edge-currency-monero": "^0.3.4", - "edge-exchange-plugins": "^0.12.13", + "edge-exchange-plugins": "^0.12.14", "edge-login-ui-rn": "^0.9.29", "edge-plugin-bity": "https://github.com/EdgeApp/edge-plugin-bity.git#2a52e6cb86512b98f69f8f5dd3105cdf6d0c2d8a", "edge-plugin-simplex": "https://github.com/EdgeApp/edge-plugin-simplex.git#4842daad5fd560cd462f4668ab17c521a16a6cd9", diff --git a/yarn.lock b/yarn.lock index 7c7f1f1c192..7e0fa127b8b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5547,10 +5547,10 @@ edge-currency-monero@^0.3.4: mymonero-core-js "https://github.com/EdgeApp/mymonero-core-js.git#matthew/txPrivateKey" uri-js "^3.0.2" -edge-exchange-plugins@^0.12.13: - version "0.12.13" - resolved "https://registry.yarnpkg.com/edge-exchange-plugins/-/edge-exchange-plugins-0.12.13.tgz#acef8f3faf2ac2e502956cdd5f659210ff27ec43" - integrity sha512-G27M7qMsmPnPT66RlAv0tQ5aeZmUCkFYTw/gQ6edC3ItRNfbp/meEFYF49dByD3kbsLxR+K96MlkUzh6F38O2Q== +edge-exchange-plugins@^0.12.14: + version "0.12.14" + resolved "https://registry.yarnpkg.com/edge-exchange-plugins/-/edge-exchange-plugins-0.12.14.tgz#baf538d5d5f380e79ea88708de4774990e84023c" + integrity sha512-i/iBlMGjDLFcztytcpnsgEbZID0iA4M4UmLzGTd7cPqmk7iGAVC6xnSrHP5PjPVMnBNURRGo7k8cW7u2k2mRAQ== dependencies: biggystring "^3.0.2" cleaners "^0.3.9" From ed9d0f59e6f00c970a3ca723be49100919e520f0 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Thu, 6 Jan 2022 12:30:34 -0800 Subject: [PATCH 023/287] Fix Android studio warning --- android/app/src/main/AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 00237110450..21d3c02d11d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -49,6 +49,7 @@ android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" + android:exported="true" android:windowSoftInputMode="adjustPan" android:launchMode="singleTask"> From afb400dc8fdc8561402ae13fe2de30d1e1942e51 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Mon, 31 Jan 2022 23:14:14 -0800 Subject: [PATCH 024/287] Fix the BlurView not to depend on JCenter --- android/build.gradle | 1 - .../@react-native-community+blur+3.6.0.patch | 17 +++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 6edff4d2d1a..c3fe894b53a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -43,7 +43,6 @@ allprojects { includeGroup("com.facebook.flipper") includeGroup("com.facebook.fresco") includeGroup("com.facebook.yoga") - includeGroup("com.eightbitlab") } } maven { url 'https://www.jitpack.io' } diff --git a/patches/@react-native-community+blur+3.6.0.patch b/patches/@react-native-community+blur+3.6.0.patch index da566826a2a..696cd4dc14f 100644 --- a/patches/@react-native-community+blur+3.6.0.patch +++ b/patches/@react-native-community+blur+3.6.0.patch @@ -1,11 +1,20 @@ diff --git a/node_modules/@react-native-community/blur/android/build.gradle b/node_modules/@react-native-community/blur/android/build.gradle -index 8177235..45a9534 100644 +index 8177235..fcdeb1c 100644 --- a/node_modules/@react-native-community/blur/android/build.gradle +++ b/node_modules/@react-native-community/blur/android/build.gradle -@@ -38,10 +38,12 @@ android { +@@ -9,7 +9,6 @@ buildscript { + if (project == rootProject) { + repositories { + google() +- jcenter() + } + + dependencies { +@@ -37,11 +36,12 @@ android { + repositories { google() - jcenter() +- jcenter() + maven { url 'https://jitpack.io' } } @@ -13,7 +22,7 @@ index 8177235..45a9534 100644 //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' - implementation 'com.eightbitlab:blurview:1.6.3' -+ implementation 'com.eightbitlab:blurview:1.6.6' ++ implementation 'com.github.Dimezis:BlurView:version-1.6.6' + implementation 'com.github.android:renderscript-intrinsics-replacement-toolkit:b6363490c3' } diff --git a/node_modules/@react-native-community/blur/android/src/main/java/com/cmcewen/blurview/BlurViewManager.java b/node_modules/@react-native-community/blur/android/src/main/java/com/cmcewen/blurview/BlurViewManager.java From 41b573b53600c91746640697365691c5dbfdbe02 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Fri, 4 Feb 2022 13:40:49 -0800 Subject: [PATCH 025/287] Improve the Podfile organization --- ios/Podfile | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index 0906b73dcb0..9ae04e06774 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -18,22 +18,14 @@ target 'edge' do # you should disable the next line. use_flipper!() - pod 'react-native-zcash', :path => '../node_modules/react-native-zcash' - # Necessary for Zcash - pod ‘CNIOAtomics’,:modular_headers => true - pod ‘CNIOBoringSSL’,:modular_headers => true - pod ‘CNIOBoringSSLShims’,:modular_headers => true - pod ‘CNIOLinux’,:modular_headers => true - pod ‘CNIODarwin’,:modular_headers => true - pod ‘CNIOHTTPParser’,:modular_headers => true - pod ‘CNIOWindows’,:modular_headers => true - pod ‘CGRPCZlib’,:modular_headers => true - post_install do |installer| react_native_post_install(installer) end + # -------------------------------------------------------------------------- # Edge additions + # -------------------------------------------------------------------------- + pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons' # Permissions @@ -46,4 +38,14 @@ target 'edge' do pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse" pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications" + # Necessary for Zcash + pod 'react-native-zcash', :path => '../node_modules/react-native-zcash' + pod 'CNIOAtomics', :modular_headers => true + pod 'CNIOBoringSSL', :modular_headers => true + pod 'CNIOBoringSSLShims', :modular_headers => true + pod 'CNIOLinux', :modular_headers => true + pod 'CNIODarwin', :modular_headers => true + pod 'CNIOHTTPParser', :modular_headers => true + pod 'CNIOWindows', :modular_headers => true + pod 'CGRPCZlib', :modular_headers => true end From 22c6720d0eeacbba86b26317bdcdb722b3db263b Mon Sep 17 00:00:00 2001 From: William Swanson Date: Wed, 12 Jan 2022 10:15:44 -0800 Subject: [PATCH 026/287] Upgrade to react-native v0.67.2 --- .gitattributes | 3 - .gitignore | 5 +- android/app/build.gradle | 9 +- android/app/proguard-rules.pro | 4 - android/app/src/main/AndroidManifest.xml | 16 +- android/app/src/main/res/values/styles.xml | 1 - android/build.gradle | 28 +- android/gradle.properties | 4 +- android/gradle/wrapper/gradle-wrapper.jar | Bin 58695 -> 55616 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/keystores/debug.keystore.properties | 4 - ios/Podfile | 2 + ios/Podfile.lock | 701 ++-- ios/edge.xcodeproj/project.pbxproj | 16 +- package.json | 15 +- .../__snapshots__/Request.test.js.snap | 14 +- .../__snapshots__/SettingsScene.test.js.snap | 12 + src/locales/intl.test.js | 6 +- yarn.lock | 3224 +++++++++-------- 19 files changed, 2089 insertions(+), 1977 deletions(-) delete mode 100644 .gitattributes delete mode 100644 android/keystores/debug.keystore.properties diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 45a3dcb2a20..00000000000 --- a/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -# Windows files should use crlf line endings -# https://help.github.com/articles/dealing-with-line-endings/ -*.bat text eol=crlf diff --git a/.gitignore b/.gitignore index 385f8a79cbc..1c69566eee4 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,7 @@ build/ .gradle local.properties *.iml +*.hprof # node.js # @@ -85,6 +86,7 @@ yarn-error.log buck-out/ \.buckd/ *.keystore +!debug.keystore # fastlane # @@ -102,6 +104,3 @@ buck-out/ # CocoaPods /ios/Pods/ - -# Detox Test Artifacts -artifacts/ diff --git a/android/app/build.gradle b/android/app/build.gradle index 695b9cc27e6..5628ffa2993 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -114,7 +114,7 @@ def jscFlavor = 'org.webkit:android-jsc:+' /** * Whether to enable the Hermes VM. * - * This should be set on project.ext.react and mirrored here. If it is not set + * This should be set on project.ext.react and that value will be read here. If it is not set * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode * and the benefits of using Hermes will therefore be sharply reduced. */ @@ -125,11 +125,6 @@ android { compileSdkVersion rootProject.ext.compileSdkVersion - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - defaultConfig { multiDexEnabled true applicationId "co.edgesecure.app" @@ -218,7 +213,7 @@ dependencies { // Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { - from configurations.compile + from configurations.implementation into 'libs' } diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 7605644f3f4..11b025724a3 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -8,7 +8,3 @@ # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: - -# Hermes --keep class com.facebook.hermes.unicode.** { *; } --keep class com.facebook.jni.** { *; } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 21d3c02d11d..83db8d8f926 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,5 @@ + package="co.edgesecure.app"> @@ -22,9 +20,6 @@ - - @@ -34,6 +29,7 @@ + + android:usesCleartextTraffic="true" + android:theme="@style/AppTheme"> + android:launchMode="singleTask" + android:windowSoftInputMode="adjustPan"> diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index bb0702ee5a1..44f3c32e431 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -3,7 +3,6 @@