From d8cb2bdff5babccae5494fe8125bcc444656dcbf Mon Sep 17 00:00:00 2001
From: zpalmtree <22151537+zpalmtree@users.noreply.github.com>
Date: Wed, 26 Jun 2019 05:28:15 +0100
Subject: [PATCH] Updates for new turtlecoin-wallet-backend API
---
.gitignore | 2 ++
src/ImportScreen.js | 2 +-
src/MainScreen.js | 8 ++++----
src/Recipients.js | 2 +-
src/TransactionsScreen.js | 6 +++---
src/TransferScreen.js | 18 +++++++++---------
6 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/.gitignore b/.gitignore
index 21ec9d8..49fe0c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,3 +56,5 @@ buck-out/
*.jsbundle
.externalNativeBuild
index.android.bundle
+
+android/app/src/main/res/drawable-*
diff --git a/src/ImportScreen.js b/src/ImportScreen.js
index 289adb0..c5497b1 100644
--- a/src/ImportScreen.js
+++ b/src/ImportScreen.js
@@ -203,7 +203,7 @@ export class ImportSeedScreen extends React.Component {
return false;
}
- const [valid, error] = isValidMnemonic(words.join(' '));
+ const [valid, error] = isValidMnemonic(words.join(' '), Config);
if (!valid) {
this.setState({
diff --git a/src/MainScreen.js b/src/MainScreen.js
index 21355f8..2a8d7d5 100644
--- a/src/MainScreen.js
+++ b/src/MainScreen.js
@@ -96,7 +96,7 @@ function sendNotification(transaction) {
PushNotification.localNotification({
title: 'Incoming transaction received!',
- message: `You were sent ${prettyPrintAmount(transaction.totalAmount())}`,
+ message: `You were sent ${prettyPrintAmount(transaction.totalAmount(), Config)}`,
data: JSON.stringify(transaction.hash),
});
}
@@ -326,7 +326,7 @@ class BalanceComponent extends React.Component {
expandedBalance: !this.state.expandedBalance
})}
>
- {prettyPrintAmount(this.props.unlockedBalance + this.props.lockedBalance)}
+ {prettyPrintAmount(this.props.unlockedBalance + this.props.lockedBalance, Config)}
;
const lockedBalance =
@@ -335,7 +335,7 @@ class BalanceComponent extends React.Component {
onPress={() => this.setState({
expandedBalance: !this.state.expandedBalance
})}>
- {prettyPrintAmount(this.props.lockedBalance)}
+ {prettyPrintAmount(this.props.lockedBalance, Config)}
;
@@ -345,7 +345,7 @@ class BalanceComponent extends React.Component {
onPress={() => this.setState({
expandedBalance: !this.props.expandedBalance
})}>
- {prettyPrintAmount(this.props.unlockedBalance)}
+ {prettyPrintAmount(this.props.unlockedBalance, Config)}
;
diff --git a/src/Recipients.js b/src/Recipients.js
index cfc1d36..cd37e69 100644
--- a/src/Recipients.js
+++ b/src/Recipients.js
@@ -262,7 +262,7 @@ function isAddressValid(address) {
return [false, errorMessage];
}
- const addressError = validateAddresses([address], true);
+ const addressError = validateAddresses([address], true, Config);
if (addressError.errorCode !== WalletErrorCode.SUCCESS) {
errorMessage = addressError.toString();
diff --git a/src/TransactionsScreen.js b/src/TransactionsScreen.js
index 4ec1d32..df66936 100644
--- a/src/TransactionsScreen.js
+++ b/src/TransactionsScreen.js
@@ -129,13 +129,13 @@ export class TransactionDetailsScreen extends React.Component {
{this.state.transaction.totalAmount() < 0 && }
@@ -401,7 +401,7 @@ class TransactionList extends React.Component {
keyExtractor={item => item.hash}
renderItem={({item}) => (
0 ? 0 : item.fee))}
+ title={prettyPrintAmount(Math.abs(item.totalAmount()) - (item.totalAmount() > 0 ? 0 : item.fee), Config)}
subtitle={item.timestamp === 0 ? 'Processing at ' + prettyPrintDate() : 'Completed on ' + prettyPrintUnixTimestamp(item.timestamp)}
leftIcon={
diff --git a/src/TransferScreen.js b/src/TransferScreen.js
index 18640c3..942d5c9 100644
--- a/src/TransferScreen.js
+++ b/src/TransferScreen.js
@@ -490,7 +490,7 @@ export class NewPayeeScreen extends React.Component {
});
}
- const addressError = validateAddresses([address], true);
+ const addressError = validateAddresses([address], true, Config);
if (addressError.errorCode !== WalletErrorCode.SUCCESS) {
errorMessage = addressError.toString();
@@ -801,7 +801,7 @@ export class ConfirmScreen extends React.Component {
}}>
- {prettyPrintAmount(this.props.navigation.state.params.amount.remainingAtomic)}{' '}
+ {prettyPrintAmount(this.props.navigation.state.params.amount.remainingAtomic, Config)}{' '}
will reach{' '}
@@ -955,7 +955,7 @@ export class ConfirmScreen extends React.Component {
- {prettyPrintAmount(this.props.navigation.state.params.amount.originalAtomic)}
+ {prettyPrintAmount(this.props.navigation.state.params.amount.originalAtomic, Config)}
@@ -963,7 +963,7 @@ export class ConfirmScreen extends React.Component {
- {prettyPrintAmount(this.props.navigation.state.params.amount.remainingAtomic)}
+ {prettyPrintAmount(this.props.navigation.state.params.amount.remainingAtomic, Config)}
@@ -971,7 +971,7 @@ export class ConfirmScreen extends React.Component {
- {prettyPrintAmount(this.props.navigation.state.params.amount.networkFeeAtomic)}
+ {prettyPrintAmount(this.props.navigation.state.params.amount.networkFeeAtomic, Config)}
{this.props.navigation.state.params.amount.devFeeAtomic > 0 &&
@@ -981,7 +981,7 @@ export class ConfirmScreen extends React.Component {
- {prettyPrintAmount(this.props.navigation.state.params.amount.devFeeAtomic)}
+ {prettyPrintAmount(this.props.navigation.state.params.amount.devFeeAtomic, Config)}
}
@@ -992,7 +992,7 @@ export class ConfirmScreen extends React.Component {
- {prettyPrintAmount(this.props.navigation.state.params.amount.nodeFeeAtomic)}
+ {prettyPrintAmount(this.props.navigation.state.params.amount.nodeFeeAtomic, Config)}
}
@@ -1003,7 +1003,7 @@ export class ConfirmScreen extends React.Component {
- {prettyPrintAmount(this.props.navigation.state.params.amount.totalFeeAtomic)}
+ {prettyPrintAmount(this.props.navigation.state.params.amount.totalFeeAtomic, Config)}
}
@@ -1261,7 +1261,7 @@ export class SendTransactionScreen extends React.Component {
- {prettyPrintAmount(this.state.amount.remainingAtomic)}{' '}
+ {prettyPrintAmount(this.state.amount.remainingAtomic, Config)}{' '}
was sent to{' '}