WIP: lnd tx list fix

This commit is contained in:
Overtorment 2018-09-04 23:18:24 +01:00
parent 146905e8a4
commit 48335cd11e
3 changed files with 59 additions and 0 deletions

View File

@ -630,6 +630,48 @@ export class BlueTransactionOnchainIcon extends Component {
}
}
export class BlueTransactionOffchainIcon extends Component {
render() {
return (
<View {...this.props} style={stylesBlueIcon.container}>
<View style={stylesBlueIcon.boxIncomming}>
<View style={stylesBlueIcon.ballOutgoing}>
<Icon
{...this.props}
name="bolt"
size={16}
type="font-awesome"
color="#d0021b"
iconStyle={{ left: 0, top: 7, transform: [{ rotate: '135deg' }] }}
/>
</View>
</View>
</View>
);
}
}
export class BlueTransactionOffchainIncomingIcon extends Component {
render() {
return (
<View {...this.props} style={stylesBlueIcon.container}>
<View style={stylesBlueIcon.boxIncomming}>
<View style={stylesBlueIcon.ballIncomming}>
<Icon
{...this.props}
name="bolt"
size={16}
type="font-awesome"
color="#37c0a1"
iconStyle={{ left: 0, top: 7, transform: [{ rotate: '45deg' }] }}
/>
</View>
</View>
</View>
);
}
}
export class BlueTransactionOutgoingIcon extends Component {
render() {
return (

View File

@ -299,6 +299,13 @@ export class LightningCustodianWallet extends LegacyWallet {
tx.value = tx.amount * 100000000;
tx.received = new Date(tx.time * 1000).toString();
tx.memo = 'Refill';
if (typeof tx.totalamt !== 'undefined' && typeof tx.totalfees !== 'undefined') {
// lnd tx outgoing
tx.value = (tx.totalamt * 1 + tx.totalfees * 1) * -1;
tx.memo = 'Lightning payment'; // TODO once api is ready
tx.received = new Date().toString(); // TODO once api is ready
}
}
return txs;
}

View File

@ -10,6 +10,7 @@ import {
BlueTransactionIncommingIcon,
BlueTransactionOutgoingIcon,
BlueTransactionPendingIcon,
BlueTransactionOffchainIcon,
BlueSendButtonIcon,
BlueReceiveButtonIcon,
BlueRefreshIcon,
@ -406,6 +407,15 @@ export default class WalletsList extends Component {
);
}
}
if (rowData.preimage) {
// is it lightning offchain payment?
return (
<View style={{ width: 25 }}>
<BlueTransactionOffchainIcon />
</View>
);
}
if (!rowData.confirmations) {
return (
<View style={{ width: 25 }}>