From 0d3dcd2c6a72a0287b4899eb8aafb0974b174598 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 23:54:57 +0000 Subject: [PATCH 01/10] Bump ip from 1.1.8 to 1.1.9 Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9. - [Commits](https://github.com/indutny/node-ip/compare/v1.1.8...v1.1.9) --- updated-dependencies: - dependency-name: ip dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7ddd5bb5..0878c0ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6109,14 +6109,14 @@ ip-regex@^4.1.0: integrity sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q== ip@^1.1.5: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.8.tgz#ae05948f6b075435ed3307acce04629da8cdbf48" - integrity sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg== + version "1.1.9" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.9.tgz#8dfbcc99a754d07f425310b86a99546b1151e396" + integrity sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ== ip@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.0.tgz#4cf4ab182fee2314c75ede1276f8c80b479936da" - integrity sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ== + version "2.0.1" + resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.1.tgz#e8f3595d33a3ea66490204234b77636965307105" + integrity sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ== is-accessor-descriptor@^0.1.6: version "0.1.6" From afc36af7e552e0703978c402e6e5e40ff2298d21 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Wed, 28 Feb 2024 11:47:03 +0100 Subject: [PATCH 02/10] Add password score to account creation --- src/actions/actions/UserData.js | 34 +++++----- .../CreateProfile/Forms/CreatePassword.js | 52 ++++++++++++++- src/utils/auth/scorePassword.js | 63 +++++++++++++++++++ src/utils/constants/constants.js | 7 ++- 4 files changed, 133 insertions(+), 23 deletions(-) create mode 100644 src/utils/auth/scorePassword.js diff --git a/src/actions/actions/UserData.js b/src/actions/actions/UserData.js index 37ba4816..18e4831f 100644 --- a/src/actions/actions/UserData.js +++ b/src/actions/actions/UserData.js @@ -50,7 +50,7 @@ import {clearEncryptedServiceStoredDataForUser} from './services/dispatchers/ser import {clearActiveAccountLifecycles} from './account/dispatchers/account'; import {WYRE_SERVICE_ID} from '../../utils/constants/services'; -export const addUser = ( +export const addUser = async ( userName, seeds, password, @@ -60,24 +60,20 @@ export const addUser = ( disabledServices = SERVICES_DISABLED_DEFAULT, testnetOverrides = {}, ) => { - return new Promise((resolve, reject) => { - storeUser( - { - seeds, - password, - userName, - biometry, - keyDerivationVersion, - disabledServices, - testnetOverrides, - }, - users, - ) - .then(res => { - resolve(setAccounts(res)); - }) - .catch(err => reject(err)); - }); + const res = await storeUser( + { + seeds, + password, + userName, + biometry, + keyDerivationVersion, + disabledServices, + testnetOverrides, + }, + users, + ) + + return setAccounts(res); }; export const resetPwd = (userID, newPwd, oldPwd) => { diff --git a/src/containers/Onboard/CreateProfile/Forms/CreatePassword.js b/src/containers/Onboard/CreateProfile/Forms/CreatePassword.js index ddec8d29..aeff9577 100644 --- a/src/containers/Onboard/CreateProfile/Forms/CreatePassword.js +++ b/src/containers/Onboard/CreateProfile/Forms/CreatePassword.js @@ -1,4 +1,4 @@ -import React, {useState} from 'react'; +import React, {useEffect, useState} from 'react'; import { View, Dimensions, @@ -11,23 +11,68 @@ import {createAlert} from '../../../../actions/actions/alert/dispatchers/alert'; import TallButton from '../../../../components/LargerButton'; import Colors from '../../../../globals/colors'; import { getSupportedBiometryType } from '../../../../utils/keychain/keychain'; +import scorePassword from '../../../../utils/auth/scorePassword'; +import { MIN_PASS_LENGTH, MIN_PASS_SCORE, PASS_SCORE_LIMIT } from '../../../../utils/constants/constants'; export default function CreatePassword({password, setPassword, navigation}) { const {height} = Dimensions.get('window'); const [firstBox, setFirstBox] = useState(''); const [secondBox, setSecondBox] = useState(''); + const [passwordStrength, setPasswordStrength] = useState(null); + const [passwordAffixDetails, setPasswordAffixDetails] = useState({ + text: "strength", + color: Colors.tertiaryColor + }); const isKeyboardActive = useSelector(state => state.keyboard.active); + useEffect(() => { + calculatePasswordAffix() + }, [firstBox]) + + const calculatePasswordAffix = () => { + if (!firstBox) { + setPasswordAffixDetails({ + text: "strength", + color: Colors.tertiaryColor + }) + } else { + const passScore = scorePassword(firstBox, MIN_PASS_LENGTH, PASS_SCORE_LIMIT); + setPasswordStrength(passScore); + + if (passScore < MIN_PASS_SCORE) { + setPasswordAffixDetails({ + text: "weak", + color: Colors.warningButtonColor + }) + } else if (passScore < PASS_SCORE_LIMIT - ((PASS_SCORE_LIMIT - MIN_PASS_SCORE) / 2)) { + setPasswordAffixDetails({ + text: "mediocre", + color: Colors.infoButtonColor + }) + } else if (passScore < PASS_SCORE_LIMIT) { + setPasswordAffixDetails({ + text: "good", + color: Colors.primaryColor + }) + } else { + setPasswordAffixDetails({ + text: "excellent", + color: Colors.verusGreenColor + }) + } + } + } + const validate = () => { const res = {valid: false, message: ''}; if (!firstBox || firstBox.length < 1) { res.message = 'Please enter a password.'; return res; - } else if (firstBox.length < 5) { - res.message = 'Please enter a password longer than 5 characters.'; + } else if (passwordStrength < MIN_PASS_SCORE) { + res.message = 'Please enter a stronger password.'; return res; } else if (firstBox !== secondBox) { res.message = 'Password and confirm password do not match.'; @@ -107,6 +152,7 @@ export default function CreatePassword({password, setPassword, navigation}) { autoCapitalize={'none'} autoCorrect={false} secureTextEntry={true} + right={} /> { + const variationCheck = variations[variation].test(pass); + variationCount += variationCheck === true ? 1 : 0; + }); + score += (variationCount - 1) * 10; + + return limitValue(score, 0, limit); +} + +export default scorePassword; \ No newline at end of file diff --git a/src/utils/constants/constants.js b/src/utils/constants/constants.js index 9a0a9a29..0f1434ac 100644 --- a/src/utils/constants/constants.js +++ b/src/utils/constants/constants.js @@ -199,4 +199,9 @@ export const R_ADDRESS_VERSION = 60; export const I_ADDRESS_VERSION = 102; // Address blocklist -export const DEFAULT_ADDRESS_BLOCKLIST_WEBSERVER = 'https://eth.verusbridge.io/exclude.json' \ No newline at end of file +export const DEFAULT_ADDRESS_BLOCKLIST_WEBSERVER = 'https://eth.verusbridge.io/exclude.json' + +// Password Strength +export const MIN_PASS_LENGTH = 7 +export const MIN_PASS_SCORE = 65 +export const PASS_SCORE_LIMIT = 100 \ No newline at end of file From 48035dd9eb6522fe891b22815d643ba058cd6484 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Thu, 21 Mar 2024 15:00:54 +0100 Subject: [PATCH 03/10] Update react-native-keychain --- ios/Podfile.lock | 6 +++--- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 5b95dec6..083973e4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -356,8 +356,8 @@ PODS: - React - RNGestureHandler (2.9.0): - React-Core - - RNKeychain (6.2.0): - - React + - RNKeychain (8.1.3): + - React-Core - RNOS (1.2.7): - React - RNPermissions (3.1.0): @@ -838,7 +838,7 @@ SPEC CHECKSUMS: RNDateTimePicker: e073697ac3e8a378968d68ab0581fef542b8af8a RNFS: 3ab21fa6c56d65566d1fb26c2228e2b6132e5e32 RNGestureHandler: 071d7a9ad81e8b83fe7663b303d132406a7d8f39 - RNKeychain: b8e0711b959a19c5b057d1e970d3c83d159b6da5 + RNKeychain: f1b48665a4646f61191eb048c4c05c58d9a7596f RNOS: 728cdea6d232de48cfede274443dbe3f669b86e9 RNPermissions: 4b54095940aea8c03fa3e6c92d4ac3647b31ed4e RNReactNativeHapticFeedback: 653a8c126a0f5e88ce15ffe280b3ff37e1fbb285 diff --git a/package.json b/package.json index c632256d..cc50faf0 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "react-native-haptic-feedback": "1.11.0", "react-native-image-picker": "5.7.0", "react-native-keyboard-aware-scroll-view": "0.9.5", - "react-native-keychain": "6.2.0", + "react-native-keychain": "8.1.3", "react-native-level-fs": "3.0.0", "react-native-loading-spinner-overlay": "1.0.1", "react-native-modal-datetime-picker": "15.0.0", diff --git a/yarn.lock b/yarn.lock index 7ddd5bb5..ea35c00e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9496,10 +9496,10 @@ react-native-keyboard-aware-scroll-view@0.9.5: prop-types "^15.6.2" react-native-iphone-x-helper "^1.0.3" -react-native-keychain@6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/react-native-keychain/-/react-native-keychain-6.2.0.tgz#8f4cff503aad367141db5aea0189ead9240c28ff" - integrity sha512-U6fnOQRJPq+c0Abl+FoYy9v0H3kQU587tMamU/o+MoBSUScFLE3DQpkyT1PW4NF5IObgiGuqQdmjC2KgtBpjGA== +react-native-keychain@8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/react-native-keychain/-/react-native-keychain-8.1.3.tgz#3d9ccc5e4884a59521cbf6a2a529a41314497367" + integrity sha512-Y4PMfY+VpXn7P1HhszJkWJ5ikKxKwg8djoDxyy7mO3jbsiWtWUtb3AGbFkdOuYaEp7lDc/TPiQgWO8yZ+AMzmw== react-native-level-fs@3.0.0: version "3.0.0" From 06598d6bf1880a648537e5c13d653af802823fd5 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Fri, 22 Mar 2024 11:06:22 +0100 Subject: [PATCH 04/10] Add Pure, tBTC, USDC, EURC, logos, and corresponding mapped currencies if applicable --- src/containers/AddCoin/AddCoin.js | 69 +- .../pbaas/bridge-veth/bridge-veth_dark.svg | 8 + .../pbaas/bridge-veth/bridge-veth_light.svg | 8 + src/images/cryptologo/default/pbaas/index.js | 9 +- .../default/pbaas/pure/pure_dark.svg | 721 ++++++++++++++++++ .../default/pbaas/pure/pure_light.svg | 721 ++++++++++++++++++ .../default/web3/eurc/eurc_dark.svg | 1 + .../default/web3/eurc/eurc_light.svg | 1 + src/images/cryptologo/default/web3/index.js | 6 + .../default/web3/tbtc/tbtc_dark.svg | 5 + .../default/web3/tbtc/tbtc_light.svg | 5 + .../default/web3/usdc/usdc_dark.svg | 21 +- .../default/web3/usdc/usdc_light.svg | 21 +- src/utils/CoinData/CoinData.js | 13 + src/utils/CoinData/CoinsList.js | 150 +++- 15 files changed, 1673 insertions(+), 86 deletions(-) create mode 100644 src/images/cryptologo/default/pbaas/bridge-veth/bridge-veth_dark.svg create mode 100644 src/images/cryptologo/default/pbaas/bridge-veth/bridge-veth_light.svg create mode 100644 src/images/cryptologo/default/pbaas/pure/pure_dark.svg create mode 100644 src/images/cryptologo/default/pbaas/pure/pure_light.svg create mode 100644 src/images/cryptologo/default/web3/eurc/eurc_dark.svg create mode 100644 src/images/cryptologo/default/web3/eurc/eurc_light.svg create mode 100644 src/images/cryptologo/default/web3/tbtc/tbtc_dark.svg create mode 100644 src/images/cryptologo/default/web3/tbtc/tbtc_light.svg diff --git a/src/containers/AddCoin/AddCoin.js b/src/containers/AddCoin/AddCoin.js index 7cbcd343..5c9d8673 100644 --- a/src/containers/AddCoin/AddCoin.js +++ b/src/containers/AddCoin/AddCoin.js @@ -55,6 +55,19 @@ const AddCoin = props => { : CoinDirectory.supportedCoinList; const activeCoinIds = activeCoinsForUser.map(coinObj => coinObj.id); + // Define the order of priority for currency IDs + const priorityOrder = [ + 'VRSC', '0xBc2738BA63882891094C99E59a02141Ca1A1C36a', + 'VRSCTEST', + 'BTC', '0x18084fbA666a33d37592fA2633fD49a74DD93a88', 'iS8TfRPfVpKo5FVfSUzfHBQxo9KuzpnqLU', + 'DAI', 'iGBs4DWztRNvNEJBt4mqHszLxfKTNHTkhM', + 'MKR', 'iCkKJuJScy4Z6NSDK7Mt42ZAB2NEnAE1o4', + 'ETH', 'i9nwxtKuVYX4MSbeULLiK2ttVi6rUEhh4X', + 'i3f7tSctFkiPpiedY8QR5Tep9p4qDVebDx', '0xE6052Dcc60573561ECef2D9A4C0FEA6d3aC5B9A2', + 'USDC', 'i61cV2uicKSi1rSMQCBNQeSYC3UAi9GVzd', + '0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c', 'iC5TQFrFXSYLQGkiZ8FYmZHFJzaRF5CYgE', + ]; + return displayedCoinList .map(x => { return { @@ -63,7 +76,7 @@ const AddCoin = props => { }; }) .filter(item => { - const {coinObj} = item; + const { coinObj } = item; const queryLc = query.toLowerCase(); const coinIdLc = coinObj.id.toLowerCase(); const coinNameLc = coinObj.display_name.toLowerCase(); @@ -77,40 +90,30 @@ const AddCoin = props => { ); }) .sort((a, b) => { - const {coinObj: currencyA} = a; - const {coinObj: currencyB} = b; - - if ( - currencyB.id === 'VRSC' || - currencyB.id === 'BTC' || - currencyB.id === 'VRSCTEST' || - currencyB.id === "iGBs4DWztRNvNEJBt4mqHszLxfKTNHTkhM" || - currencyB.id === "iCkKJuJScy4Z6NSDK7Mt42ZAB2NEnAE1o4" || - currencyB.id === "i9nwxtKuVYX4MSbeULLiK2ttVi6rUEhh4X" || - currencyB.id === "i3f7tSctFkiPpiedY8QR5Tep9p4qDVebDx" || - currencyB.id === '0xBc2738BA63882891094C99E59a02141Ca1A1C36a' || - currencyB.id === '0xE6052Dcc60573561ECef2D9A4C0FEA6d3aC5B9A2' || - currencyB.id === 'MKR' || - currencyB.id === 'DAI' - ) { - return 1; - } else if ( - currencyA.id === 'VRSC' || - currencyA.id === 'BTC' || - currencyA.id === 'VRSCTEST' || - currencyA.id === "iGBs4DWztRNvNEJBt4mqHszLxfKTNHTkhM" || - currencyA.id === "iCkKJuJScy4Z6NSDK7Mt42ZAB2NEnAE1o4" || - currencyA.id === "i9nwxtKuVYX4MSbeULLiK2ttVi6rUEhh4X" || - currencyA.id === "i3f7tSctFkiPpiedY8QR5Tep9p4qDVebDx" || - currencyA.id === '0xBc2738BA63882891094C99E59a02141Ca1A1C36a' || - currencyA.id === '0xE6052Dcc60573561ECef2D9A4C0FEA6d3aC5B9A2' || - currencyA.id === 'MKR' || - currencyA.id === 'DAI' - ) { + const { coinObj: currencyA } = a; + const { coinObj: currencyB } = b; + + // Determine the rank based on the position in the priorityOrder array + const rankA = priorityOrder.indexOf(currencyA.id); + const rankB = priorityOrder.indexOf(currencyB.id); + + // If both currencies are in the priority list, sort by their order in the list + if (rankA !== -1 && rankB !== -1) { + return rankA - rankB; + } + + // If only currencyA is in the priority list, it should come first + if (rankA !== -1) { return -1; - } else { - return currencyA.display_ticker <= currencyB.display_ticker ? -1 : 1; } + + // If only currencyB is in the priority list, it should come first + if (rankB !== -1) { + return 1; + } + + // If neither currency is in the priority list, sort by display_ticker + return currencyA.display_ticker.localeCompare(currencyB.display_ticker); }); }; diff --git a/src/images/cryptologo/default/pbaas/bridge-veth/bridge-veth_dark.svg b/src/images/cryptologo/default/pbaas/bridge-veth/bridge-veth_dark.svg new file mode 100644 index 00000000..2c0e59ee --- /dev/null +++ b/src/images/cryptologo/default/pbaas/bridge-veth/bridge-veth_dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/images/cryptologo/default/pbaas/bridge-veth/bridge-veth_light.svg b/src/images/cryptologo/default/pbaas/bridge-veth/bridge-veth_light.svg new file mode 100644 index 00000000..2c0e59ee --- /dev/null +++ b/src/images/cryptologo/default/pbaas/bridge-veth/bridge-veth_light.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/images/cryptologo/default/pbaas/index.js b/src/images/cryptologo/default/pbaas/index.js index 1f3a334b..6d7ceec8 100644 --- a/src/images/cryptologo/default/pbaas/index.js +++ b/src/images/cryptologo/default/pbaas/index.js @@ -1,6 +1,11 @@ import React from 'react' import { View } from "react-native" +import PURE_DARK from './pure/pure_dark.svg' +import PURE_LIGHT from './pure/pure_light.svg' +import BRIDGE_VETH_DARK from './bridge-veth/bridge-veth_dark.svg' +import BRIDGE_VETH_LIGHT from './bridge-veth/bridge-veth_light.svg' + const RenderPbaasCurrencyLogo = (iAddr) => { function hashCode(str) { var hash = 0; @@ -65,5 +70,7 @@ const RenderPbaasCurrencyLogo = (iAddr) => { } export default { - RenderPbaasCurrencyLogo + RenderPbaasCurrencyLogo, + PURE: { light: PURE_LIGHT, dark: PURE_DARK }, + BRIDGE_VETH: { light: BRIDGE_VETH_LIGHT, dark: BRIDGE_VETH_DARK } } \ No newline at end of file diff --git a/src/images/cryptologo/default/pbaas/pure/pure_dark.svg b/src/images/cryptologo/default/pbaas/pure/pure_dark.svg new file mode 100644 index 00000000..3b256f84 --- /dev/null +++ b/src/images/cryptologo/default/pbaas/pure/pure_dark.svg @@ -0,0 +1,721 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/images/cryptologo/default/pbaas/pure/pure_light.svg b/src/images/cryptologo/default/pbaas/pure/pure_light.svg new file mode 100644 index 00000000..3b256f84 --- /dev/null +++ b/src/images/cryptologo/default/pbaas/pure/pure_light.svg @@ -0,0 +1,721 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/images/cryptologo/default/web3/eurc/eurc_dark.svg b/src/images/cryptologo/default/web3/eurc/eurc_dark.svg new file mode 100644 index 00000000..a9bf20c1 --- /dev/null +++ b/src/images/cryptologo/default/web3/eurc/eurc_dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/images/cryptologo/default/web3/eurc/eurc_light.svg b/src/images/cryptologo/default/web3/eurc/eurc_light.svg new file mode 100644 index 00000000..e40e10eb --- /dev/null +++ b/src/images/cryptologo/default/web3/eurc/eurc_light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/images/cryptologo/default/web3/index.js b/src/images/cryptologo/default/web3/index.js index 08c65597..57b2f353 100644 --- a/src/images/cryptologo/default/web3/index.js +++ b/src/images/cryptologo/default/web3/index.js @@ -38,6 +38,10 @@ import CRV_DARK from './crv/crv_dark.svg' import MKR_DARK from './mkr/mkr_dark.svg' import SUSHI_DARK from './sushi/sushi_dark.svg' import WBTC_DARK from './wbtc/wbtc_dark.svg' +import TBTC_LIGHT from './tbtc/tbtc_light.svg' +import TBTC_DARK from './tbtc/tbtc_dark.svg' +import EURC_LIGHT from './eurc/eurc_light.svg' +import EURC_DARK from './eurc/eurc_dark.svg' export default { ETH: { light: ETH_LIGHT, dark: ETH_DARK }, @@ -60,4 +64,6 @@ export default { MKR: { light: MKR_LIGHT, dark: MKR_DARK }, SUSHI: { light: SUSHI_LIGHT, dark: SUSHI_DARK }, WBTC: { light: WBTC_LIGHT, dark: WBTC_DARK }, + TBTC: { light: TBTC_LIGHT, dark: TBTC_DARK }, + EURC: { light: EURC_LIGHT, dark: EURC_DARK }, } \ No newline at end of file diff --git a/src/images/cryptologo/default/web3/tbtc/tbtc_dark.svg b/src/images/cryptologo/default/web3/tbtc/tbtc_dark.svg new file mode 100644 index 00000000..6a461a00 --- /dev/null +++ b/src/images/cryptologo/default/web3/tbtc/tbtc_dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/images/cryptologo/default/web3/tbtc/tbtc_light.svg b/src/images/cryptologo/default/web3/tbtc/tbtc_light.svg new file mode 100644 index 00000000..11f8ee97 --- /dev/null +++ b/src/images/cryptologo/default/web3/tbtc/tbtc_light.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/images/cryptologo/default/web3/usdc/usdc_dark.svg b/src/images/cryptologo/default/web3/usdc/usdc_dark.svg index bcec7821..96ca838e 100644 --- a/src/images/cryptologo/default/web3/usdc/usdc_dark.svg +++ b/src/images/cryptologo/default/web3/usdc/usdc_dark.svg @@ -1,20 +1 @@ - - - - - - - - - + \ No newline at end of file diff --git a/src/images/cryptologo/default/web3/usdc/usdc_light.svg b/src/images/cryptologo/default/web3/usdc/usdc_light.svg index bcec7821..00aa190b 100644 --- a/src/images/cryptologo/default/web3/usdc/usdc_light.svg +++ b/src/images/cryptologo/default/web3/usdc/usdc_light.svg @@ -1,20 +1 @@ - - - - - - - - - + \ No newline at end of file diff --git a/src/utils/CoinData/CoinData.js b/src/utils/CoinData/CoinData.js index f366badf..c77826c6 100644 --- a/src/utils/CoinData/CoinData.js +++ b/src/utils/CoinData/CoinData.js @@ -144,6 +144,16 @@ export const CoinLogos = { LTC: CoinLogoIcons.btc.LTC, CCL: CoinLogoIcons.btc.CCL, + // pbaas protocol + ["iHax5qYQGbcMGqJKKrPorpzUBX2oFFXGnY"]: CoinLogoIcons.pbaas.PURE, + ["i3f7tSctFkiPpiedY8QR5Tep9p4qDVebDx"]: CoinLogoIcons.pbaas.BRIDGE_VETH, + ["iGBs4DWztRNvNEJBt4mqHszLxfKTNHTkhM"]: CoinLogoIcons.web3.DAI, // DAI on Verus + ["iCkKJuJScy4Z6NSDK7Mt42ZAB2NEnAE1o4"]: CoinLogoIcons.web3.MKR, // MKR on Verus + ["i9nwxtKuVYX4MSbeULLiK2ttVi6rUEhh4X"]: CoinLogoIcons.web3.ETH, // ETH on Verus + ["iS8TfRPfVpKo5FVfSUzfHBQxo9KuzpnqLU"]: CoinLogoIcons.web3.TBTC, // TBTC on Verus + ["i61cV2uicKSi1rSMQCBNQeSYC3UAi9GVzd"]: CoinLogoIcons.web3.USDC, // TBTC on Verus + ["iC5TQFrFXSYLQGkiZ8FYmZHFJzaRF5CYgE"]: CoinLogoIcons.web3.EURC, // TBTC on Verus + // web3 protocol BAT: CoinLogoIcons.web3.BAT, TST: CoinLogoIcons.web3.ETH, @@ -171,6 +181,9 @@ export const CoinLogos = { MKR: CoinLogoIcons.web3.MKR, WBTC: CoinLogoIcons.web3.WBTC, ["0xBc2738BA63882891094C99E59a02141Ca1A1C36a"]: CoinLogoIcons.btc.VRSC, // VRSC on Ethereum + ["0x18084fbA666a33d37592fA2633fD49a74DD93a88"]: CoinLogoIcons.web3.TBTC, // TBTC + ["0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c"]: CoinLogoIcons.web3.EURC, // EURC + ["0xE6052Dcc60573561ECef2D9A4C0FEA6d3aC5B9A2"]: CoinLogoIcons.pbaas.BRIDGE_VETH, // BRIDGE.VETH on Ethereum // fiat "protocol" USD: CoinLogoIcons.fiat.USD, diff --git a/src/utils/CoinData/CoinsList.js b/src/utils/CoinData/CoinsList.js index a8b0bdbb..b5bec549 100644 --- a/src/utils/CoinData/CoinsList.js +++ b/src/utils/CoinData/CoinsList.js @@ -116,7 +116,7 @@ export const coinsList = { display_ticker: "DAI.vETH", display_name: "DAI on Verus", alt_names: [], - theme_color: "#232323", + theme_color: "#F5AC37", compatible_channels: [VERUSID, VRPC, GENERAL], tags: [IS_VERUS, IS_ZCASH, IS_PBAAS], proto: "vrsc", @@ -126,7 +126,7 @@ export const coinsList = { default_app: "wallet", apps: VERUS_APPS, rate_url_params: {coin_paprika: 'dai-dai'}, - website: 'https://verus.io', + website: 'https://makerdao.com/en/', mapped_to: 'DAI' }, ["iCkKJuJScy4Z6NSDK7Mt42ZAB2NEnAE1o4"]: { @@ -138,9 +138,9 @@ export const coinsList = { launch_system_id: "i9nwxtKuVYX4MSbeULLiK2ttVi6rUEhh4X", bitgojs_network_key: "verus", display_ticker: "MKR.vETH", - display_name: "Maker on Verus", + display_name: "MKR on Verus", alt_names: [], - theme_color: "#232323", + theme_color: "#1AAB9B", compatible_channels: [VERUSID, VRPC, GENERAL], tags: [IS_VERUS, IS_ZCASH, IS_PBAAS], proto: "vrsc", @@ -150,9 +150,81 @@ export const coinsList = { default_app: "wallet", apps: VERUS_APPS, rate_url_params: {coin_paprika: 'mkr-maker'}, - website: 'https://verus.io', + website: 'https://makerdao.com/en/', mapped_to: 'MKR' }, + ["iS8TfRPfVpKo5FVfSUzfHBQxo9KuzpnqLU"]: { + pbaas_options: 32, + system_options: 128, + id: "iS8TfRPfVpKo5FVfSUzfHBQxo9KuzpnqLU", + currency_id: "iS8TfRPfVpKo5FVfSUzfHBQxo9KuzpnqLU", + system_id: "i9nwxtKuVYX4MSbeULLiK2ttVi6rUEhh4X", + launch_system_id: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + bitgojs_network_key: "verus", + display_ticker: "tBTC.vETH", + display_name: "tBTC on Verus", + alt_names: [], + theme_color: "#000000", + compatible_channels: [VERUSID, VRPC, GENERAL], + tags: [IS_VERUS, IS_ZCASH, IS_PBAAS], + proto: "vrsc", + vrpc_endpoints: ["https://api.verus.services"], + decimals: 8, + seconds_per_block: 60, + default_app: "wallet", + apps: VERUS_APPS, + rate_url_params: {coin_paprika: 'tbtc-tbtc'}, + website: 'https://tbtc.network/', + mapped_to: '0x18084fbA666a33d37592fA2633fD49a74DD93a88' + }, + ["i61cV2uicKSi1rSMQCBNQeSYC3UAi9GVzd"]: { + pbaas_options: 32, + system_options: 128, + id: "i61cV2uicKSi1rSMQCBNQeSYC3UAi9GVzd", + currency_id: "i61cV2uicKSi1rSMQCBNQeSYC3UAi9GVzd", + system_id: "i9nwxtKuVYX4MSbeULLiK2ttVi6rUEhh4X", + launch_system_id: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + bitgojs_network_key: "verus", + display_ticker: "vUSDC.vETH", + display_name: "USDC on Verus", + alt_names: [], + theme_color: '#29233b', + compatible_channels: [VERUSID, VRPC, GENERAL], + tags: [IS_VERUS, IS_ZCASH, IS_PBAAS], + proto: "vrsc", + vrpc_endpoints: ["https://api.verus.services"], + decimals: 8, + seconds_per_block: 60, + default_app: "wallet", + apps: VERUS_APPS, + rate_url_params: {coin_paprika: 'usdc-usd-coin'}, + website: 'https://www.circle.com/en/usdc', + mapped_to: 'USDC' + }, + ["iC5TQFrFXSYLQGkiZ8FYmZHFJzaRF5CYgE"]: { + pbaas_options: 32, + system_options: 128, + id: "iC5TQFrFXSYLQGkiZ8FYmZHFJzaRF5CYgE", + currency_id: "iC5TQFrFXSYLQGkiZ8FYmZHFJzaRF5CYgE", + system_id: "i9nwxtKuVYX4MSbeULLiK2ttVi6rUEhh4X", + launch_system_id: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + bitgojs_network_key: "verus", + display_ticker: "EURC.vETH", + display_name: "EURC on Verus", + alt_names: [], + theme_color: '#29233b', + compatible_channels: [VERUSID, VRPC, GENERAL], + tags: [IS_VERUS, IS_ZCASH, IS_PBAAS], + proto: "vrsc", + vrpc_endpoints: ["https://api.verus.services"], + decimals: 8, + seconds_per_block: 60, + default_app: "wallet", + apps: VERUS_APPS, + rate_url_params: {coin_paprika: 'eurc-eurc'}, + website: 'https://www.circle.com/en/usdc', + mapped_to: '0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c' + }, ["i9nwxtKuVYX4MSbeULLiK2ttVi6rUEhh4X"]: { pbaas_options: 128, system_options: 264, @@ -164,7 +236,7 @@ export const coinsList = { display_ticker: "vETH", display_name: "Ethereum on Verus", alt_names: [], - theme_color: "#232323", + theme_color: "#141C30", compatible_channels: [VERUSID, VRPC, GENERAL], tags: [IS_VERUS, IS_ZCASH, IS_PBAAS], proto: "vrsc", @@ -174,7 +246,7 @@ export const coinsList = { default_app: "wallet", apps: VERUS_APPS, rate_url_params: {coin_paprika: 'eth-ethereum'}, - website: 'https://verus.io', + website: 'https://ethereum.org/en/', mapped_to: 'ETH' }, ["i3f7tSctFkiPpiedY8QR5Tep9p4qDVebDx"]: { @@ -188,7 +260,7 @@ export const coinsList = { display_ticker: "Bridge.vETH", display_name: "Bridge.vETH", alt_names: [], - theme_color: "#232323", + theme_color: "#081C45", compatible_channels: [VERUSID, VRPC], tags: [IS_VERUS, IS_ZCASH, IS_PBAAS], proto: "vrsc", @@ -200,6 +272,28 @@ export const coinsList = { website: 'https://verus.io', mapped_to: '0xE6052Dcc60573561ECef2D9A4C0FEA6d3aC5B9A2' }, + ["iHax5qYQGbcMGqJKKrPorpzUBX2oFFXGnY"]: { + pbaas_options: 41, + system_options: 264, + id: "iHax5qYQGbcMGqJKKrPorpzUBX2oFFXGnY", + currency_id: "iHax5qYQGbcMGqJKKrPorpzUBX2oFFXGnY", + system_id: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + launch_system_id: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + bitgojs_network_key: "verus", + display_ticker: "Pure", + display_name: "Pure", + alt_names: [], + theme_color: "#484C52", + compatible_channels: [VERUSID, VRPC], + tags: [IS_VERUS, IS_ZCASH, IS_PBAAS], + proto: "vrsc", + vrpc_endpoints: ["https://api.verus.services"], + decimals: 8, + seconds_per_block: 60, + default_app: "wallet", + apps: VERUS_APPS, + website: 'https://verus.io' + }, KMD: { id: 'KMD', display_name: 'Komodo', @@ -646,8 +740,8 @@ export const coinsList = { display_ticker: 'USDC', display_name: 'USDC', alt_names: [], - theme_color: '#4E4E50', - website: 'https://www.centre.io/usdc', + theme_color: '#29233b', + website: 'https://www.circle.com/en/usdc', compatible_channels: [ERC20, GENERAL], dominant_channel: ERC20, decimals: STABLECOIN_DECIMALS, @@ -655,6 +749,22 @@ export const coinsList = { proto: 'erc20', rate_url_params: {coin_paprika: 'usdc-usd-coin'}, }, + ["0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c"]: { + id: '0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c', + currency_id: '0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c', + system_id: '.eth', + display_ticker: 'EURC', + display_name: 'EURC', + alt_names: [], + theme_color: '#29233b', + website: 'https://www.circle.com/en/eurc', + compatible_channels: [ERC20, GENERAL], + dominant_channel: ERC20, + decimals: STABLECOIN_DECIMALS, + tags: [], + proto: 'erc20', + rate_url_params: {coin_paprika: 'eurc-eurc'}, + }, USDCWYRE: { id: 'USDCWYRE', currency_id: 'USDC', @@ -729,7 +839,7 @@ export const coinsList = { website: 'https://verus.io/', compatible_channels: [ERC20, GENERAL], rate_url_params: {coin_paprika: 'vrsc-verus-coin'}, - theme_color: '#141C30', + theme_color: '#3165D4', dominant_channel: ERC20, decimals: ETHERS, tags: [], @@ -744,12 +854,28 @@ export const coinsList = { alt_names: [], website: 'https://verus.io/', compatible_channels: [ERC20, GENERAL], - theme_color: '#141C30', + theme_color: '#081C45', dominant_channel: ERC20, decimals: ETHERS, tags: [], proto: 'erc20', }, + ["0x18084fbA666a33d37592fA2633fD49a74DD93a88"]: { + id: '0x18084fbA666a33d37592fA2633fD49a74DD93a88', + currency_id: '0x18084fbA666a33d37592fA2633fD49a74DD93a88', + system_id: '.eth', + display_ticker: 'tBTC', + display_name: 'tBTC', + alt_names: [], + website: 'https://tbtc.network/', + compatible_channels: [ERC20, GENERAL], + theme_color: '#000000', + dominant_channel: ERC20, + decimals: DEFAULT_DECIMALS, + tags: [], + proto: 'erc20', + rate_url_params: {coin_paprika: 'tbtc-tbtc'}, + }, MKR: { id: 'MKR', currency_id: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2', From 7f07c179d7e573e3590c90420b872759a400a181 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Mon, 25 Mar 2024 14:55:22 +0100 Subject: [PATCH 05/10] Add Switch currency --- src/images/cryptologo/default/pbaas/index.js | 5 +++- .../default/pbaas/switch/switch_dark.svg | 19 +++++++++++++++ .../default/pbaas/switch/switch_light.svg | 19 +++++++++++++++ src/utils/CoinData/CoinData.js | 1 + src/utils/CoinData/CoinsList.js | 24 ++++++++++++++++++- 5 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 src/images/cryptologo/default/pbaas/switch/switch_dark.svg create mode 100644 src/images/cryptologo/default/pbaas/switch/switch_light.svg diff --git a/src/images/cryptologo/default/pbaas/index.js b/src/images/cryptologo/default/pbaas/index.js index 6d7ceec8..72e8afb7 100644 --- a/src/images/cryptologo/default/pbaas/index.js +++ b/src/images/cryptologo/default/pbaas/index.js @@ -5,6 +5,8 @@ import PURE_DARK from './pure/pure_dark.svg' import PURE_LIGHT from './pure/pure_light.svg' import BRIDGE_VETH_DARK from './bridge-veth/bridge-veth_dark.svg' import BRIDGE_VETH_LIGHT from './bridge-veth/bridge-veth_light.svg' +import SWITCH_DARK from './switch/switch_dark.svg' +import SWITCH_LIGHT from './switch/switch_light.svg' const RenderPbaasCurrencyLogo = (iAddr) => { function hashCode(str) { @@ -72,5 +74,6 @@ const RenderPbaasCurrencyLogo = (iAddr) => { export default { RenderPbaasCurrencyLogo, PURE: { light: PURE_LIGHT, dark: PURE_DARK }, - BRIDGE_VETH: { light: BRIDGE_VETH_LIGHT, dark: BRIDGE_VETH_DARK } + BRIDGE_VETH: { light: BRIDGE_VETH_LIGHT, dark: BRIDGE_VETH_DARK }, + SWITCH: { light: SWITCH_LIGHT, dark: SWITCH_DARK } } \ No newline at end of file diff --git a/src/images/cryptologo/default/pbaas/switch/switch_dark.svg b/src/images/cryptologo/default/pbaas/switch/switch_dark.svg new file mode 100644 index 00000000..39952529 --- /dev/null +++ b/src/images/cryptologo/default/pbaas/switch/switch_dark.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/images/cryptologo/default/pbaas/switch/switch_light.svg b/src/images/cryptologo/default/pbaas/switch/switch_light.svg new file mode 100644 index 00000000..39952529 --- /dev/null +++ b/src/images/cryptologo/default/pbaas/switch/switch_light.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/utils/CoinData/CoinData.js b/src/utils/CoinData/CoinData.js index c77826c6..5c672102 100644 --- a/src/utils/CoinData/CoinData.js +++ b/src/utils/CoinData/CoinData.js @@ -147,6 +147,7 @@ export const CoinLogos = { // pbaas protocol ["iHax5qYQGbcMGqJKKrPorpzUBX2oFFXGnY"]: CoinLogoIcons.pbaas.PURE, ["i3f7tSctFkiPpiedY8QR5Tep9p4qDVebDx"]: CoinLogoIcons.pbaas.BRIDGE_VETH, + ["i4Xr5TAMrDTD99H69EemhjDxJ4ktNskUtc"]: CoinLogoIcons.pbaas.SWITCH, ["iGBs4DWztRNvNEJBt4mqHszLxfKTNHTkhM"]: CoinLogoIcons.web3.DAI, // DAI on Verus ["iCkKJuJScy4Z6NSDK7Mt42ZAB2NEnAE1o4"]: CoinLogoIcons.web3.MKR, // MKR on Verus ["i9nwxtKuVYX4MSbeULLiK2ttVi6rUEhh4X"]: CoinLogoIcons.web3.ETH, // ETH on Verus diff --git a/src/utils/CoinData/CoinsList.js b/src/utils/CoinData/CoinsList.js index b5bec549..81193b8a 100644 --- a/src/utils/CoinData/CoinsList.js +++ b/src/utils/CoinData/CoinsList.js @@ -273,7 +273,7 @@ export const coinsList = { mapped_to: '0xE6052Dcc60573561ECef2D9A4C0FEA6d3aC5B9A2' }, ["iHax5qYQGbcMGqJKKrPorpzUBX2oFFXGnY"]: { - pbaas_options: 41, + pbaas_options: 33, system_options: 264, id: "iHax5qYQGbcMGqJKKrPorpzUBX2oFFXGnY", currency_id: "iHax5qYQGbcMGqJKKrPorpzUBX2oFFXGnY", @@ -294,6 +294,28 @@ export const coinsList = { apps: VERUS_APPS, website: 'https://verus.io' }, + ["i4Xr5TAMrDTD99H69EemhjDxJ4ktNskUtc"]: { + pbaas_options: 33, + system_options: 264, + id: "i4Xr5TAMrDTD99H69EemhjDxJ4ktNskUtc", + currency_id: "i4Xr5TAMrDTD99H69EemhjDxJ4ktNskUtc", + system_id: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + launch_system_id: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + bitgojs_network_key: "verus", + display_ticker: "Switch", + display_name: "Switch", + alt_names: [], + theme_color: "#132618", + compatible_channels: [VERUSID, VRPC], + tags: [IS_VERUS, IS_ZCASH, IS_PBAAS], + proto: "vrsc", + vrpc_endpoints: ["https://api.verus.services"], + decimals: 8, + seconds_per_block: 60, + default_app: "wallet", + apps: VERUS_APPS, + website: 'https://verus.io' + }, KMD: { id: 'KMD', display_name: 'Komodo', From 248b4046fbfc67b565bea2c9d9752678cbf4a228 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Mon, 25 Mar 2024 17:30:51 +0100 Subject: [PATCH 06/10] Add network display to receive screen --- .../Coin/ReceiveCoin/ReceiveCoin.js | 9 ++++++ .../Coin/ReceiveCoin/ReceiveCoin.render.js | 28 +++++++++++++++++++ src/selectors/networkName.js | 19 +++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 src/selectors/networkName.js diff --git a/src/containers/Coin/ReceiveCoin/ReceiveCoin.js b/src/containers/Coin/ReceiveCoin/ReceiveCoin.js index 6559839c..7dbe94c6 100644 --- a/src/containers/Coin/ReceiveCoin/ReceiveCoin.js +++ b/src/containers/Coin/ReceiveCoin/ReceiveCoin.js @@ -28,6 +28,7 @@ import { primitives } from "verusid-ts-client" import { I_ADDRESS_VERSION, R_ADDRESS_VERSION } from "../../../utils/constants/constants" import { coinsList } from "../../../utils/CoinData/CoinsList" import { fromBase58Check } from "verus-typescript-primitives" +import selectNetworkName from "../../../selectors/networkName" class ReceiveCoin extends Component { constructor(props) { @@ -317,6 +318,13 @@ class ReceiveCoin extends Component { } } + networksInfoAlert = () => { + createAlert( + "Supported Blockchain Networks", + "VerusPay invoices can support payment on more than one blockchain network. The QR invoice generated with this form will support payments on any networks listed here." + ) + } + validateFormData = (addressIndex) => { this.setState({ errors: {selectedCoin: null, amount: null, addresses: null, memo: null }, @@ -408,6 +416,7 @@ const mapStateToProps = (state) => { displayCurrency: state.settings.generalWalletSettings.displayCurrency || USD, addresses: selectAddresses(state), subWallet: state.coinMenus.activeSubWallets[chainTicker], + networkName: selectNetworkName(state), generalWalletSettings: state.settings.generalWalletSettings } }; diff --git a/src/containers/Coin/ReceiveCoin/ReceiveCoin.render.js b/src/containers/Coin/ReceiveCoin/ReceiveCoin.render.js index e096fdb5..141a3902 100644 --- a/src/containers/Coin/ReceiveCoin/ReceiveCoin.render.js +++ b/src/containers/Coin/ReceiveCoin/ReceiveCoin.render.js @@ -14,6 +14,7 @@ import TextInputModal from "../../../components/TextInputModal/TextInputModal" import NumberPadModal from "../../../components/NumberPadModal/NumberPadModal" import ListSelectionModal from "../../../components/ListSelectionModal/ListSelectionModal"; import AnimatedActivityIndicatorBox from "../../../components/AnimatedActivityIndicatorBox"; +import { coinsList } from "../../../utils/CoinData/CoinsList"; export const RenderReceiveCoin = function() { const _price = this.getPrice(); @@ -110,6 +111,33 @@ export const RenderReceiveCoin = function() { /> )} + {this.props.networkName != null && + ( + + this.networksInfoAlert()} + style={{ ...Styles.flex }}> + + + + ) + } {addresses.map((address) => { const addressInfo = this.props.subWallet.address_info[this.state.infoIndexes[address]]; diff --git a/src/selectors/networkName.js b/src/selectors/networkName.js new file mode 100644 index 00000000..9bdb8383 --- /dev/null +++ b/src/selectors/networkName.js @@ -0,0 +1,19 @@ +import { createSelector } from 'reselect'; +import { CoinDirectory } from '../utils/CoinData/CoinDirectory'; + +const selectSubWallet = (state) => state.coinMenus.activeSubWallets[state.coins.activeCoin.id]; + +export const selectNetworkName = createSelector( + [selectSubWallet], + (subwallet) => { + try { + return subwallet.network + ? CoinDirectory.getBasicCoinObj(subwallet.network).display_ticker + : null; + } catch (e) { + return null; + } + } +); + +export default selectNetworkName; From dd0dd8e6cc03610cf59aea08d410e0d432163c1b Mon Sep 17 00:00:00 2001 From: michaeltout Date: Thu, 28 Mar 2024 15:32:47 +0100 Subject: [PATCH 07/10] Add vARRR and Bridge.vARRR to coinsList --- src/images/cryptologo/default/pbaas/index.js | 5 ++- .../default/pbaas/varrr/varrr_dark.svg | 14 ++++++ .../default/pbaas/varrr/varrr_light.svg | 14 ++++++ src/utils/CoinData/CoinData.js | 5 ++- src/utils/CoinData/CoinsList.js | 44 +++++++++++++++++++ 5 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 src/images/cryptologo/default/pbaas/varrr/varrr_dark.svg create mode 100644 src/images/cryptologo/default/pbaas/varrr/varrr_light.svg diff --git a/src/images/cryptologo/default/pbaas/index.js b/src/images/cryptologo/default/pbaas/index.js index 72e8afb7..1281cefa 100644 --- a/src/images/cryptologo/default/pbaas/index.js +++ b/src/images/cryptologo/default/pbaas/index.js @@ -7,6 +7,8 @@ import BRIDGE_VETH_DARK from './bridge-veth/bridge-veth_dark.svg' import BRIDGE_VETH_LIGHT from './bridge-veth/bridge-veth_light.svg' import SWITCH_DARK from './switch/switch_dark.svg' import SWITCH_LIGHT from './switch/switch_light.svg' +import VARRR_LIGHT from './varrr/varrr_light.svg' +import VARRR_DARK from './varrr/varrr_dark.svg' const RenderPbaasCurrencyLogo = (iAddr) => { function hashCode(str) { @@ -75,5 +77,6 @@ export default { RenderPbaasCurrencyLogo, PURE: { light: PURE_LIGHT, dark: PURE_DARK }, BRIDGE_VETH: { light: BRIDGE_VETH_LIGHT, dark: BRIDGE_VETH_DARK }, - SWITCH: { light: SWITCH_LIGHT, dark: SWITCH_DARK } + SWITCH: { light: SWITCH_LIGHT, dark: SWITCH_DARK }, + VARRR: { light: VARRR_LIGHT, dark: VARRR_DARK } } \ No newline at end of file diff --git a/src/images/cryptologo/default/pbaas/varrr/varrr_dark.svg b/src/images/cryptologo/default/pbaas/varrr/varrr_dark.svg new file mode 100644 index 00000000..9b01b6e9 --- /dev/null +++ b/src/images/cryptologo/default/pbaas/varrr/varrr_dark.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/images/cryptologo/default/pbaas/varrr/varrr_light.svg b/src/images/cryptologo/default/pbaas/varrr/varrr_light.svg new file mode 100644 index 00000000..9b01b6e9 --- /dev/null +++ b/src/images/cryptologo/default/pbaas/varrr/varrr_light.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/utils/CoinData/CoinData.js b/src/utils/CoinData/CoinData.js index 5c672102..e406d56c 100644 --- a/src/utils/CoinData/CoinData.js +++ b/src/utils/CoinData/CoinData.js @@ -152,8 +152,9 @@ export const CoinLogos = { ["iCkKJuJScy4Z6NSDK7Mt42ZAB2NEnAE1o4"]: CoinLogoIcons.web3.MKR, // MKR on Verus ["i9nwxtKuVYX4MSbeULLiK2ttVi6rUEhh4X"]: CoinLogoIcons.web3.ETH, // ETH on Verus ["iS8TfRPfVpKo5FVfSUzfHBQxo9KuzpnqLU"]: CoinLogoIcons.web3.TBTC, // TBTC on Verus - ["i61cV2uicKSi1rSMQCBNQeSYC3UAi9GVzd"]: CoinLogoIcons.web3.USDC, // TBTC on Verus - ["iC5TQFrFXSYLQGkiZ8FYmZHFJzaRF5CYgE"]: CoinLogoIcons.web3.EURC, // TBTC on Verus + ["i61cV2uicKSi1rSMQCBNQeSYC3UAi9GVzd"]: CoinLogoIcons.web3.USDC, // USDC on Verus + ["iC5TQFrFXSYLQGkiZ8FYmZHFJzaRF5CYgE"]: CoinLogoIcons.web3.EURC, // EURC on Verus + ["iExBJfZYK7KREDpuhj6PzZBzqMAKaFg7d2"]: CoinLogoIcons.pbaas.VARRR, // web3 protocol BAT: CoinLogoIcons.web3.BAT, diff --git a/src/utils/CoinData/CoinsList.js b/src/utils/CoinData/CoinsList.js index 81193b8a..792b6e09 100644 --- a/src/utils/CoinData/CoinsList.js +++ b/src/utils/CoinData/CoinsList.js @@ -316,6 +316,50 @@ export const coinsList = { apps: VERUS_APPS, website: 'https://verus.io' }, + ["iExBJfZYK7KREDpuhj6PzZBzqMAKaFg7d2"]: { + pbaas_options: 268, + system_options: 268, + id: "iExBJfZYK7KREDpuhj6PzZBzqMAKaFg7d2", + currency_id: "iExBJfZYK7KREDpuhj6PzZBzqMAKaFg7d2", + system_id: "iExBJfZYK7KREDpuhj6PzZBzqMAKaFg7d2", + launch_system_id: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + bitgojs_network_key: "verus", + display_ticker: "vARRR", + display_name: "Pirate Chain (PBaaS)", + alt_names: [], + theme_color: "#1d1d2c", + compatible_channels: [VERUSID, VRPC], + tags: [IS_VERUS, IS_ZCASH, IS_PBAAS], + proto: "vrsc", + vrpc_endpoints: ["https://vapi.piratechain.com/"], + decimals: 8, + seconds_per_block: 60, + default_app: "wallet", + apps: VERUS_APPS, + website: 'https://piratechain.com/' + }, + ["iD5WRg7jdQM1uuoVHsBCAEKfJCKGs1U3TB"]: { + pbaas_options: 545, + system_options: 268, + id: "iD5WRg7jdQM1uuoVHsBCAEKfJCKGs1U3TB", + currency_id: "iD5WRg7jdQM1uuoVHsBCAEKfJCKGs1U3TB", + system_id: "iExBJfZYK7KREDpuhj6PzZBzqMAKaFg7d2", + launch_system_id: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + bitgojs_network_key: "verus", + display_ticker: "Bridge.vARRR", + display_name: "Bridge.vARRR", + alt_names: [], + theme_color: "#1d1d2c", + compatible_channels: [VERUSID, VRPC], + tags: [IS_VERUS, IS_ZCASH, IS_PBAAS], + proto: "vrsc", + vrpc_endpoints: ["https://vapi.piratechain.com/"], + decimals: 8, + seconds_per_block: 60, + default_app: "wallet", + apps: VERUS_APPS, + website: 'https://piratechain.com/' + }, KMD: { id: 'KMD', display_name: 'Komodo', From d0482655a9c2d7ef52c1301cff37b6df55cec841 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Thu, 28 Mar 2024 16:06:05 +0100 Subject: [PATCH 08/10] Fix getCoinLogo for VRSC and VRSCTEST if using currencyid --- src/utils/CoinData/CoinData.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/CoinData/CoinData.js b/src/utils/CoinData/CoinData.js index e406d56c..29e77568 100644 --- a/src/utils/CoinData/CoinData.js +++ b/src/utils/CoinData/CoinData.js @@ -301,10 +301,12 @@ export const getCoinObj = (coinList, coinId) => { }) } -export const getCoinLogo = (id, proto, theme = 'light') => { - if (CoinLogos[id]) return CoinLogos[id][theme] +export const getCoinLogo = (id, proto, theme = 'light') => { + const _id = id === coinsList.VRSC.currency_id ? "VRSC" : id === coinsList.VRSCTEST.currency_id ? "VRSCTEST" : id; + + if (CoinLogos[_id]) return CoinLogos[_id][theme] else if (proto === 'erc20') return CoinLogos.ETH[theme] - else return CoinLogoIcons.pbaas.RenderPbaasCurrencyLogo(id)[theme] + else return CoinLogoIcons.pbaas.RenderPbaasCurrencyLogo(_id)[theme] } export const getNetworkTxVersion = (networkId) => { From 5d2d2cfb91c449e5fb9352aa1fd13308072ee81b Mon Sep 17 00:00:00 2001 From: Asher Dawes Date: Thu, 28 Mar 2024 22:20:12 -0700 Subject: [PATCH 09/10] Update version --- android/app/build.gradle | 2 +- env/main.android.json | 2 +- env/main.ios.json | 2 +- ios/assets/env/main.json | 2 +- package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 07793783..d39022ef 100755 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -4,7 +4,7 @@ import com.android.build.OutputFile def versionMajor = 1 def versionMinor = 0 -def versionRevision = 8 +def versionRevision = 9 def versionBuild = 0 def keystorePropertiesFile = rootProject.file("keystore.properties"); diff --git a/env/main.android.json b/env/main.android.json index 9a53213b..b02c238e 100644 --- a/env/main.android.json +++ b/env/main.android.json @@ -1,5 +1,5 @@ { - "APP_VERSION": "1.0.8", + "APP_VERSION": "1.0.9", "ELECTRUM_PROTOCOL_CHANGE": 1.4, "KEY_DERIVATION_VERSION": 1, diff --git a/env/main.ios.json b/env/main.ios.json index a716e568..0a4d906c 100644 --- a/env/main.ios.json +++ b/env/main.ios.json @@ -1,5 +1,5 @@ { - "APP_VERSION": "1.0.8", + "APP_VERSION": "1.0.9", "ELECTRUM_PROTOCOL_CHANGE": 1.4, "KEY_DERIVATION_VERSION": 1, diff --git a/ios/assets/env/main.json b/ios/assets/env/main.json index a716e568..0a4d906c 100644 --- a/ios/assets/env/main.json +++ b/ios/assets/env/main.json @@ -1,5 +1,5 @@ { - "APP_VERSION": "1.0.8", + "APP_VERSION": "1.0.9", "ELECTRUM_PROTOCOL_CHANGE": 1.4, "KEY_DERIVATION_VERSION": 1, diff --git a/package.json b/package.json index cc50faf0..6acd410a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "verusmobile", - "version": "1.0.8", + "version": "1.0.9", "private": true, "scripts": { "postinstall": "./node_modules/.bin/rn-nodeify --hack --install --yarn && npx jetify", From c09e91acb9b9a6debf0ad124700ae397cbfea20d Mon Sep 17 00:00:00 2001 From: Asher Dawes Date: Fri, 29 Mar 2024 11:35:39 -0700 Subject: [PATCH 10/10] Update version --- ios/verusMobile.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/verusMobile.xcodeproj/project.pbxproj b/ios/verusMobile.xcodeproj/project.pbxproj index b28b776b..b39c83ed 100644 --- a/ios/verusMobile.xcodeproj/project.pbxproj +++ b/ios/verusMobile.xcodeproj/project.pbxproj @@ -721,7 +721,7 @@ "\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-webview\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/rn-fetch-blob\"", ); - MARKETING_VERSION = 1.0.8; + MARKETING_VERSION = 1.0.9; PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.verusmobile; PRODUCT_NAME = verusmobile; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -792,7 +792,7 @@ "\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-webview\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/rn-fetch-blob\"", ); - MARKETING_VERSION = 1.0.8; + MARKETING_VERSION = 1.0.9; PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.verusmobile; PRODUCT_NAME = verusmobile; PROVISIONING_PROFILE_SPECIFIER = "";