Skip to content

Commit

Permalink
Merge pull request #173 from VerusCoin/dev
Browse files Browse the repository at this point in the history
v1.0.13
  • Loading branch information
Asherda authored May 27, 2024
2 parents 4bd9403 + a8eeaa6 commit 63f248d
Show file tree
Hide file tree
Showing 31 changed files with 866 additions and 117 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.android.build.OutputFile

def versionMajor = 1
def versionMinor = 0
def versionRevision = 12
def versionRevision = 13
def versionBuild = 0

def keystorePropertiesFile = rootProject.file("keystore.properties");
Expand Down
6 changes: 4 additions & 2 deletions env/main.android.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APP_VERSION": "1.0.12",
"APP_VERSION": "1.0.13",
"ELECTRUM_PROTOCOL_CHANGE": 1.4,

"KEY_DERIVATION_VERSION": 1,
Expand Down Expand Up @@ -49,5 +49,7 @@
"CURRENCY_DEFINITION_STORAGE_INTERNAL_KEY": "currencyDefinitions",
"CONTRACT_DEFINITION_STORAGE_INTERNAL_KEY": "ethereumContractDefinitions",

"WYRE_ACCESSIBLE": true
"WYRE_ACCESSIBLE": true,

"CONVERSION_DISABLED": false
}
6 changes: 4 additions & 2 deletions env/main.ios.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APP_VERSION": "1.0.12",
"APP_VERSION": "1.0.13",
"ELECTRUM_PROTOCOL_CHANGE": 1.4,

"KEY_DERIVATION_VERSION": 1,
Expand Down Expand Up @@ -49,5 +49,7 @@
"CURRENCY_DEFINITION_STORAGE_INTERNAL_KEY": "currencyDefinitions",
"CONTRACT_DEFINITION_STORAGE_INTERNAL_KEY": "ethereumContractDefinitions",

"WYRE_ACCESSIBLE": true
"WYRE_ACCESSIBLE": true,

"CONVERSION_DISABLED": false
}
6 changes: 4 additions & 2 deletions ios/assets/env/main.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APP_VERSION": "1.0.12",
"APP_VERSION": "1.0.13",
"ELECTRUM_PROTOCOL_CHANGE": 1.4,

"KEY_DERIVATION_VERSION": 1,
Expand Down Expand Up @@ -49,5 +49,7 @@
"CURRENCY_DEFINITION_STORAGE_INTERNAL_KEY": "currencyDefinitions",
"CONTRACT_DEFINITION_STORAGE_INTERNAL_KEY": "ethereumContractDefinitions",

"WYRE_ACCESSIBLE": true
"WYRE_ACCESSIBLE": true,

"CONVERSION_DISABLED": false
}
4 changes: 2 additions & 2 deletions ios/verusMobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-webview\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/rn-fetch-blob\"",
);
MARKETING_VERSION = 1.0.12;
MARKETING_VERSION = 1.0.13;
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.verusmobile;
PRODUCT_NAME = verusmobile;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -792,7 +792,7 @@
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-webview\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/rn-fetch-blob\"",
);
MARKETING_VERSION = 1.0.12;
MARKETING_VERSION = 1.0.13;
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.verusmobile;
PRODUCT_NAME = verusmobile;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "verusmobile",
"version": "1.0.12",
"version": "1.0.13",
"private": true,
"scripts": {
"postinstall": "./node_modules/.bin/rn-nodeify --hack --install --yarn && npx jetify",
Expand All @@ -14,7 +14,7 @@
"lint": "eslint ."
},
"dependencies": {
"@bitgo/utxo-lib": "git+https://github.com/VerusCoin/BitGoJS.git#7c754d4a5920198d9fe6827d3e23bd5cf431f264",
"@bitgo/utxo-lib": "git+https://github.com/VerusCoin/BitGoJS.git#utxo-lib-verus",
"@ethersproject/signing-key": "5.0.5",
"@react-native-async-storage/async-storage": "1.17.10",
"@react-native-camera-roll/camera-roll": "5.0.4",
Expand Down
6 changes: 5 additions & 1 deletion src/VerusMobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ class VerusMobile extends React.Component {
//version)
clearCachedVersions()
.then(async () => {
const settingsAction = await initSettings();
this.props.dispatch(settingsAction);

CoinDirectory.setVrpcOverrides(settingsAction.settings.generalWalletSettings ? settingsAction.settings.generalWalletSettings.vrpcOverrides : {});

await clearCachedVrpcResponses()

const usedCoins = await purgeUnusedCoins()
Expand All @@ -126,7 +131,6 @@ class VerusMobile extends React.Component {

let promiseArr = [
fetchUsers(),
initSettings(),
initNotifications(),
fetchActiveCoins(),
];
Expand Down
34 changes: 15 additions & 19 deletions src/actions/actions/account/dispatchers/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,24 @@ export const initializeAccountData = async (
store.dispatch(settingsAction);

try {
const { addressBlocklistDefinition, addressBlocklist } = store.getState().settings.generalWalletSettings;

if (addressBlocklistDefinition.type === ADDRESS_BLOCKLIST_FROM_WEBSERVER) {
const fetchedBlocklist = await getAddressBlocklistFromServer();
const currentBlocklist = [...addressBlocklist];

for (const address of fetchedBlocklist) {
if (currentBlocklist.find(x => x.address === address) == null) {
currentBlocklist.unshift({
address,
details: '',
lastModified: Math.floor(Date.now() / 1000)
});
}
}
const { addressBlocklist } = store.getState().settings.generalWalletSettings;

const saveGeneralSettingsAction = await saveGeneralSettings({
addressBlocklist: currentBlocklist
});
const fetchedBlocklist = await getAddressBlocklistFromServer();
const currentBlocklist = [];

store.dispatch(saveGeneralSettingsAction);
for (const address of fetchedBlocklist) {
currentBlocklist.unshift({
address,
details: '',
lastModified: Math.floor(Date.now() / 1000)
});
}

const saveGeneralSettingsAction = await saveGeneralSettings({
addressBlocklist: currentBlocklist
});

store.dispatch(saveGeneralSettingsAction);
} catch(e) {
console.warn("Failed to fetch address blocklist");
console.warn(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { ETH_CONTRACT_ADDRESS, VETH } from "../../../../utils/constants/web3Cons
import { preflightConvertOrCrossChain } from "../../../../utils/api/routers/preflightConvertOrCrossChain";
import { getIdentity } from "../../../../utils/api/routers/getIdentity";
import { addressIsBlocked } from "../../../../utils/addressBlocklist";
import selectAddressBlocklist from "../../../../selectors/settings";
import { selectAddressBlocklist } from "../../../../selectors/settings";
import { I_ADDRESS_VERSION, R_ADDRESS_VERSION } from "../../../../utils/constants/constants";
import { getWeb3ProviderForNetwork } from "../../../../utils/web3/provider";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Colors from "../../../../globals/colors";
import Styles from "../../../../styles";
import { useEffect } from "react";
import { CoinDirectory } from "../../../../utils/CoinData/CoinDirectory";
import selectAddressBlocklist from "../../../../selectors/settings";
import { selectAddressBlocklist } from "../../../../selectors/settings";
import { addressIsBlocked } from "../../../../utils/addressBlocklist";

const TraditionalCryptoSendForm = ({ setLoading, setModalHeight, updateSendFormData, navigation }) => {
Expand Down
55 changes: 53 additions & 2 deletions src/containers/Coin/SendCoin/SendCoin.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import {
import { saveGeneralSettings } from "../../../actions/actionCreators";
import { openUrl } from "../../../utils/linking";
import { createAlert, resolveAlert } from "../../../actions/actions/alert/dispatchers/alert";
import {
CONVERSION_DISABLED
} from '../../../../env/index';

const SendCoin = ({ navigation }) => {
const activeCoin = useSelector(state => state.coins.activeCoin);
Expand All @@ -41,7 +44,55 @@ const SendCoin = ({ navigation }) => {
);
const dispatch = useDispatch()

const CONVERT_OR_CROSS_CHAIN_OPTIONS = [
const CONVERT_OR_CROSS_CHAIN_OPTIONS = CONVERSION_DISABLED ? [
{
key: 'export',
title: 'Send off-chain',
description: `Send ${activeCoin.display_ticker} to an address on a different blockchain network without converting it`,
data: {
[SEND_MODAL_TO_ADDRESS_FIELD]: '',
[SEND_MODAL_AMOUNT_FIELD]: '',
[SEND_MODAL_MEMO_FIELD]: '',
[SEND_MODAL_CONVERTTO_FIELD]: '',
[SEND_MODAL_EXPORTTO_FIELD]: '',
[SEND_MODAL_VIA_FIELD]: '',
[SEND_MODAL_MAPPING_FIELD]: '',
[SEND_MODAL_PRICE_ESTIMATE]: null,
[SEND_MODAL_IS_PRECONVERT]: false,
[SEND_MODAL_SHOW_CONVERTTO_FIELD]: false,
[SEND_MODAL_SHOW_EXPORTTO_FIELD]: true,
[SEND_MODAL_SHOW_MAPPING_FIELD]: true,
[SEND_MODAL_SHOW_VIA_FIELD]: false,
[SEND_MODAL_ADVANCED_FORM]: false,
[SEND_MODAL_DISABLED_INPUTS]: {
[SEND_MODAL_MAPPING_FIELD]: activeCoin.proto === 'vrsc'
}
},
},
{
key: 'advanced',
title: 'Advanced',
description: 'Send off-chain using an unguided form',
data: {
[SEND_MODAL_TO_ADDRESS_FIELD]: '',
[SEND_MODAL_AMOUNT_FIELD]: '',
[SEND_MODAL_MEMO_FIELD]: '',
[SEND_MODAL_CONVERTTO_FIELD]: '',
[SEND_MODAL_EXPORTTO_FIELD]: '',
[SEND_MODAL_VIA_FIELD]: '',
[SEND_MODAL_MAPPING_FIELD]: '',
[SEND_MODAL_PRICE_ESTIMATE]: null,
[SEND_MODAL_IS_PRECONVERT]: false,
[SEND_MODAL_SHOW_CONVERTTO_FIELD]: false,
[SEND_MODAL_SHOW_EXPORTTO_FIELD]: true,
[SEND_MODAL_SHOW_MAPPING_FIELD]: (activeCoin.proto === 'erc20' || activeCoin.proto === 'eth'),
[SEND_MODAL_SHOW_VIA_FIELD]: false,
[SEND_MODAL_ADVANCED_FORM]: true,
[SEND_MODAL_SHOW_IS_PRECONVERT]: false,
[SEND_MODAL_DISABLED_INPUTS]: {}
},
}
] : [
{
key: 'convert',
title: 'Convert currency',
Expand Down Expand Up @@ -245,7 +296,7 @@ By proceeding, you confirm that you've read, understood, and agreed to this. Ens
marginBottom: 8,
}}
>
{"Convert or cross-chain"}
{CONVERSION_DISABLED ? "Send cross-chain" : "Convert or cross-chain"}
</Button>
)}
</View>
Expand Down
3 changes: 1 addition & 2 deletions src/containers/FundSourceSelect/FundSourceSelectList.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ const FundSourceSelectList = (props) => {
amount,
via,
network,
wallet,
conversion
wallet
} = sourceOptions[networkId][optionId];

const balanceLoaded = cryptoBalances[coinObj.id] && cryptoBalances[coinObj.id][wallet.id];
Expand Down
9 changes: 9 additions & 0 deletions src/containers/RootStack/MainStackScreens/MainStackScreens.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import DeleteProfile from '../../Settings/ProfileSettings/DeleteProfile/DeletePr
import SecureLoading from '../../SecureLoading/SecureLoading'
import HomeTabScreens from '../HomeTabScreens/HomeTabScreens';
import AddressBlocklist from '../../Settings/WalletSettings/AddressBlocklist/AddressBlocklist';
import VrpcOverrides from '../../Settings/WalletSettings/VrpcOverrides/VrpcOverrides';

const MainStack = createStackNavigator();

Expand Down Expand Up @@ -99,6 +100,14 @@ const MainStackScreens = props => {
}}
/>

<MainStack.Screen
name="VrpcOverrides"
component={VrpcOverrides}
options={{
title: "Custom RPC Servers",
}}
/>

<MainStack.Screen
name="CoinSettings"
component={CoinSettings}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Settings/AppInfo/AppInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { APP_VERSION } from '../../../../env/index'
import { CoinLogos } from "../../../utils/CoinData/CoinData";
import { openUrl } from "../../../utils/linking";

const DISCORD_URL = "https://discord.gg/VRKMP2S"
const DISCORD_URL = "https://www.verus.io/discord"
const REDDIT_URL = "https://www.reddit.com/r/VerusCoin/"
const TWITTER_URL = "https://twitter.com/VerusCoin"
const PRIVACY_URL = "https://github.com/VerusCoin/Verus-Mobile/blob/master/PRIVACY.txt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ const WalletSettings = props => {
: settings.addressBlocklistDefinition,
addressBlocklist:
settings.addressBlocklist == null ? [] : settings.addressBlocklist,
vrpcOverrides: settings.vrpcOverrides == null ? {} : settings.vrpcOverrides,
};
const res = await saveGeneralSettings(stateToSave);
dispatch(res);
Expand Down
Loading

0 comments on commit 63f248d

Please sign in to comment.