Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Updates for new turtlecoin-wallet-backend API
Browse files Browse the repository at this point in the history
  • Loading branch information
zpalmtree authored and davehlong committed Jul 11, 2019
1 parent 0a004e3 commit d8cb2bd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ buck-out/
*.jsbundle
.externalNativeBuild
index.android.bundle

android/app/src/main/res/drawable-*
2 changes: 1 addition & 1 deletion src/ImportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
8 changes: 4 additions & 4 deletions src/MainScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
});
}
Expand Down Expand Up @@ -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)}
</OneLineText>;

const lockedBalance = <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
Expand All @@ -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)}
</OneLineText>
</View>;

Expand All @@ -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)}
</OneLineText>
</View>;

Expand Down
2 changes: 1 addition & 1 deletion src/Recipients.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/TransactionsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ export class TransactionDetailsScreen extends React.Component {

<ItemDescription
title='Amount'
item={prettyPrintAmount(this.state.amount)}
item={prettyPrintAmount(this.state.amount, Config)}
{...this.props}
/>

{this.state.transaction.totalAmount() < 0 && <ItemDescription
title='Fee'
item={prettyPrintAmount(this.state.transaction.fee)}
item={prettyPrintAmount(this.state.transaction.fee, Config)}
{...this.props}
/>}

Expand Down Expand Up @@ -401,7 +401,7 @@ class TransactionList extends React.Component {
keyExtractor={item => item.hash}
renderItem={({item}) => (
<ListItem
title={prettyPrintAmount(Math.abs(item.totalAmount()) - (item.totalAmount() > 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={
<View style={{width: 30, alignItems: 'center', justifyContent: 'center', marginRight: 10}}>
Expand Down
18 changes: 9 additions & 9 deletions src/TransferScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -801,7 +801,7 @@ export class ConfirmScreen extends React.Component {
}}>
<Text style={{ fontSize: 13, color: this.props.screenProps.theme.slightlyMoreVisibleColour }}>
<Text style={{ color: this.props.screenProps.theme.primaryColour, fontWeight: 'bold' }}>
{prettyPrintAmount(this.props.navigation.state.params.amount.remainingAtomic)}{' '}
{prettyPrintAmount(this.props.navigation.state.params.amount.remainingAtomic, Config)}{' '}
</Text>
will reach{' '}
<Text style={{ color: this.props.screenProps.theme.primaryColour, fontWeight: 'bold' }}>
Expand Down Expand Up @@ -955,23 +955,23 @@ export class ConfirmScreen extends React.Component {
</Text>

<Text style={{ color: this.props.screenProps.theme.primaryColour, fontSize: 16 }}>
{prettyPrintAmount(this.props.navigation.state.params.amount.originalAtomic)}
{prettyPrintAmount(this.props.navigation.state.params.amount.originalAtomic, Config)}
</Text>

<Text style={{ marginBottom: 5, marginTop: 20, color: this.props.screenProps.theme.slightlyMoreVisibleColour }}>
{this.props.navigation.state.params.payee.nickname} gets
</Text>

<Text style={{ color: this.props.screenProps.theme.primaryColour, fontSize: 16 }}>
{prettyPrintAmount(this.props.navigation.state.params.amount.remainingAtomic)}
{prettyPrintAmount(this.props.navigation.state.params.amount.remainingAtomic, Config)}
</Text>

<Text style={{ marginBottom: 5, marginTop: 20, color: this.props.screenProps.theme.slightlyMoreVisibleColour }}>
Network fee
</Text>

<Text style={{ color: this.props.screenProps.theme.primaryColour, fontSize: 16 }}>
{prettyPrintAmount(this.props.navigation.state.params.amount.networkFeeAtomic)}
{prettyPrintAmount(this.props.navigation.state.params.amount.networkFeeAtomic, Config)}
</Text>

{this.props.navigation.state.params.amount.devFeeAtomic > 0 &&
Expand All @@ -981,7 +981,7 @@ export class ConfirmScreen extends React.Component {
</Text>

<Text style={{ color: this.props.screenProps.theme.primaryColour, fontSize: 16 }}>
{prettyPrintAmount(this.props.navigation.state.params.amount.devFeeAtomic)}
{prettyPrintAmount(this.props.navigation.state.params.amount.devFeeAtomic, Config)}
</Text>
</View>}

Expand All @@ -992,7 +992,7 @@ export class ConfirmScreen extends React.Component {
</Text>

<Text style={{ color: this.props.screenProps.theme.primaryColour, fontSize: 16 }}>
{prettyPrintAmount(this.props.navigation.state.params.amount.nodeFeeAtomic)}
{prettyPrintAmount(this.props.navigation.state.params.amount.nodeFeeAtomic, Config)}
</Text>
</View>}

Expand All @@ -1003,7 +1003,7 @@ export class ConfirmScreen extends React.Component {
</Text>

<Text style={{ color: this.props.screenProps.theme.primaryColour, fontSize: 16 }}>
{prettyPrintAmount(this.props.navigation.state.params.amount.totalFeeAtomic)}
{prettyPrintAmount(this.props.navigation.state.params.amount.totalFeeAtomic, Config)}
</Text>
</View>}

Expand Down Expand Up @@ -1261,7 +1261,7 @@ export class SendTransactionScreen extends React.Component {

<Text style={{ fontSize: 13, color: this.props.screenProps.theme.slightlyMoreVisibleColour }}>
<Text style={{ color: this.props.screenProps.theme.primaryColour, fontWeight: 'bold' }}>
{prettyPrintAmount(this.state.amount.remainingAtomic)}{' '}
{prettyPrintAmount(this.state.amount.remainingAtomic, Config)}{' '}
</Text>
was sent to{' '}
<Text style={{ color: this.props.screenProps.theme.primaryColour, fontWeight: 'bold' }}>
Expand Down

0 comments on commit d8cb2bd

Please sign in to comment.