diff --git a/js/page/wallet.js b/js/page/wallet.js index cca61907e..9241f76d0 100644 --- a/js/page/wallet.js +++ b/js/page/wallet.js @@ -117,13 +117,44 @@ var WalletPage = React.createClass({ getInitialState: function() { return { balance: "Checking balance...", + txlog: "Loading transactions...", } }, componentWillMount: function() { lbry.getBalance((results) => { this.setState({ balance: results, - }); + }) + }); + lbry.call('get_transaction_history', {}, (results) => { + var out = 'Transaction history loaded.' + if (results.length == 0) { + out = 'No transactions yet.'; + } else { + var rows = []; + rows.push( + Amount + Time + Date + Transaction + ); + results.forEach(function(tx) { + rows.push( + { (tx["amount"]>0 ? '+' : '' ) + tx["amount"] } + { (new Date(tx["time"])).toLocaleTimeString() } + { (new Date(tx["time"])).toLocaleDateString() } + + + { tx["txid"] } + + + ) + }); + out = {rows}
+ } + this.setState({ + txlog: out, + }) }); }, render: function() { @@ -139,6 +170,10 @@ var WalletPage = React.createClass({

Claim Invite Code

+
+

Transaction History

+ {this.state.txlog} +
); }