From d74c73b4a192ac3c687dfbb19a99f8c1a8b656f2 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Tue, 24 Oct 2023 13:56:39 +0200 Subject: [PATCH 1/4] Set estimated price on conversion form to be relative to source currency --- .../ConvertOrCrossChainSendForm.js | 39 +++---------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/src/components/SendModal/ConvertOrCrossChainSend/ConvertOrCrossChainSendForm/ConvertOrCrossChainSendForm.js b/src/components/SendModal/ConvertOrCrossChainSend/ConvertOrCrossChainSendForm/ConvertOrCrossChainSendForm.js index 05071726..dd69ebcb 100644 --- a/src/components/SendModal/ConvertOrCrossChainSend/ConvertOrCrossChainSendForm/ConvertOrCrossChainSendForm.js +++ b/src/components/SendModal/ConvertOrCrossChainSend/ConvertOrCrossChainSendForm/ConvertOrCrossChainSendForm.js @@ -209,8 +209,6 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor return !x.mapping && x.prelaunch } else return !x.mapping && !x.prelaunch }).map((path, index) => { - const priceFixed = Number(path.price.toFixed(2)) - return { title: path.destination.fullyqualifiedname, logoid: path.destination.currencyid, @@ -236,13 +234,7 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor : '', [SEND_MODAL_PRICE_ESTIMATE]: { price: path.price, name: path.destination.fullyqualifiedname } }, - right: `${ - priceFixed === 0 - ? '<0.01' - : priceFixed === path.price - ? priceFixed - : `~${priceFixed}` - }`, + right: `${Number(BigNumber(1).dividedBy(BigNumber(path.price)).toFixed(8))}`, keywords: [path.destination.currencyid, path.destination.fullyqualifiedname] }; }); @@ -251,7 +243,6 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor return flatPaths.filter(x => { return !x.mapping }).map((path, index) => { - const priceFixed = Number(path.price.toFixed(2)) const addr = path.ethdest ? path.destination.address : null; const name = path.ethdest @@ -286,13 +277,7 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor : '', [SEND_MODAL_PRICE_ESTIMATE]: { price: path.price, name: name } }, - right: `${ - priceFixed === 0 - ? '<0.01' - : priceFixed === path.price - ? priceFixed - : `~${priceFixed}` - }`, + right: `${Number(BigNumber(1).dividedBy(BigNumber(path.price)).toFixed(8))}`, keywords: path.ethdest ? [path.destination.address, path.destination.symbol, path.destination.name] : [path.destination.currencyid, path.destination.fullyqualifiedname] @@ -317,8 +302,6 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor ); } else return x.via != null; }).map((path, index) => { - const priceFixed = Number(path.price.toFixed(2)) - return { title: path.via.fullyqualifiedname, logoid: path.via.currencyid, @@ -338,13 +321,7 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor : '', [SEND_MODAL_PRICE_ESTIMATE]: { price: path.price, name: path.destination.fullyqualifiedname } }, - right: `${ - priceFixed === 0 - ? '<0.01' - : priceFixed === path.price - ? priceFixed - : `~${priceFixed}` - }`, + right: `${Number(BigNumber(1).dividedBy(BigNumber(path.price)).toFixed(8))}`, keywords: [path.via.currencyid, path.via.fullyqualifiedname] }; }) @@ -392,13 +369,7 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor : '', [SEND_MODAL_PRICE_ESTIMATE]: { price: path.price, name: destname } }, - right: `${ - priceFixed === 0 - ? '<0.01' - : priceFixed === path.price - ? priceFixed - : `~${priceFixed}` - }`, + right: `${Number(BigNumber(1).dividedBy(BigNumber(path.price)).toFixed(8))}`, keywords: [path.via.currencyid, path.via.fullyqualifiedname] }; }) @@ -1026,7 +997,7 @@ const ConvertOrCrossChainSendForm = ({ setLoading, setModalHeight, updateSendFor right={() => selectedField !== SEND_MODAL_EXPORTTO_FIELD && selectedField !== SEND_MODAL_MAPPING_FIELD ? ( - {sendModal.coinObj.display_ticker + ' price estimate'} + {'est. price in ' + sendModal.coinObj.display_ticker} ) : null } From 9a9cb86d192b1c17fa962b92380cb70b8e4a5e7f Mon Sep 17 00:00:00 2001 From: michaeltout Date: Tue, 24 Oct 2023 13:58:00 +0200 Subject: [PATCH 2/4] Show conversion destinations that exist on other system without exportto (and with exportto) --- .../channels/vrpc/requests/getCurrencyConversionPaths.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/utils/api/channels/vrpc/requests/getCurrencyConversionPaths.js b/src/utils/api/channels/vrpc/requests/getCurrencyConversionPaths.js index 8b4b4d3a..1dc90326 100644 --- a/src/utils/api/channels/vrpc/requests/getCurrencyConversionPaths.js +++ b/src/utils/api/channels/vrpc/requests/getCurrencyConversionPaths.js @@ -224,11 +224,7 @@ export const getCurrencyConversionPaths = async (systemId, src, ethNetwork) => { : null; for (const destinationid in paths) { - paths[destinationid] = paths[destinationid].filter(x => { - const offSystem = (x.destination.systemid != systemId) || (x.via != null && x.via.systemid != systemId); - - return !(offSystem && x.exportto == null); - }).map(x => { + paths[destinationid] = paths[destinationid].map(x => { if (prelaunchCurrencyIds != null && prelaunchCurrencyIds.includes(x.destination.currencyid)) { return { ...x, From cd88d05d16ccfbe56eb766e834af290e45f188c9 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Wed, 25 Oct 2023 22:58:04 +0200 Subject: [PATCH 3/4] Prevent BigNumber from rounding up on toFixed --- App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App.js b/App.js index 1a678a7b..0ee59986 100644 --- a/App.js +++ b/App.js @@ -15,7 +15,7 @@ import BigNumber from 'bignumber.js'; import Colors from './src/globals/colors'; import {GestureHandlerRootView} from 'react-native-gesture-handler'; -BigNumber.set({EXPONENTIAL_AT: 1000000}); +BigNumber.set({ EXPONENTIAL_AT: 1000000, ROUNDING_MODE: BigNumber.ROUND_FLOOR }); const fontConfig = { default: { From 4f63c764cd34ef2d0089fd851d34e62e92d7acc7 Mon Sep 17 00:00:00 2001 From: Asher Dawes Date: Wed, 25 Oct 2023 14:27:31 -0700 Subject: [PATCH 4/4] update version --- android/app/build.gradle | 2 +- env/main.android.json | 2 +- env/main.ios.json | 2 +- ios/assets/env/main.json | 2 +- ios/verusMobile.xcodeproj/project.pbxproj | 4 ++-- package.json | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 9affc2b2..aa2e55da 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 = 2 +def versionRevision = 3 def versionBuild = 0 def keystorePropertiesFile = rootProject.file("keystore.properties"); diff --git a/env/main.android.json b/env/main.android.json index ed85c8f8..54e5eb63 100644 --- a/env/main.android.json +++ b/env/main.android.json @@ -1,5 +1,5 @@ { - "APP_VERSION": "1.0.2", + "APP_VERSION": "1.0.3", "ELECTRUM_PROTOCOL_CHANGE": 1.4, "KEY_DERIVATION_VERSION": 1, diff --git a/env/main.ios.json b/env/main.ios.json index 61bc3e5e..b23b1895 100644 --- a/env/main.ios.json +++ b/env/main.ios.json @@ -1,5 +1,5 @@ { - "APP_VERSION": "1.0.2", + "APP_VERSION": "1.0.3", "ELECTRUM_PROTOCOL_CHANGE": 1.4, "KEY_DERIVATION_VERSION": 1, diff --git a/ios/assets/env/main.json b/ios/assets/env/main.json index 61bc3e5e..b23b1895 100644 --- a/ios/assets/env/main.json +++ b/ios/assets/env/main.json @@ -1,5 +1,5 @@ { - "APP_VERSION": "1.0.2", + "APP_VERSION": "1.0.3", "ELECTRUM_PROTOCOL_CHANGE": 1.4, "KEY_DERIVATION_VERSION": 1, diff --git a/ios/verusMobile.xcodeproj/project.pbxproj b/ios/verusMobile.xcodeproj/project.pbxproj index c82f4b76..c82642ae 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.2; + MARKETING_VERSION = 1.0.3; 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.2; + MARKETING_VERSION = 1.0.3; PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.verusmobile; PRODUCT_NAME = verusmobile; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/package.json b/package.json index 7a8e8c84..70809ffe 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "verusmobile", - "version": "1.0.2", + "version": "1.0.3", "private": true, "scripts": { "postinstall": "./node_modules/.bin/rn-nodeify --hack --install --yarn && npx jetify",