Fixed wallet balance call

This commit is contained in:
Paul Kirby 2018-10-04 18:47:32 -05:00
parent 7149a65402
commit 3179b7ac5d
3 changed files with 4 additions and 11 deletions

View file

@ -33,17 +33,9 @@ class LBRY_Daemon
* @param string $address Wallet Address * @param string $address Wallet Address
* @return float Wallet Balance * @return float Wallet Balance
*/ */
public function wallet_balance($address = '') public function wallet_balance()
{ {
$address = $address ?: get_option(LBRY_SETTINGS)[LBRY_WALLET]; $result = $this->request('wallet_balance');
error_log('Address: ' . $address);
$result = $this->request('wallet_balance', array(
'address' => $address,
'include_unconfirmed' => true
));
error_log($result);
return json_decode($result)->result; return json_decode($result)->result;
} }

View file

@ -152,6 +152,7 @@ class LBRYPress
// Add options to the options table we need // Add options to the options table we need
if (! get_option(LBRY_SETTINGS)) { if (! get_option(LBRY_SETTINGS)) {
// Get a wallet address // Get a wallet address
// TODO: May have to rethink this based on how wallet address are linked to daemon
$wallet_address = $this->daemon->wallet_unused_address(); $wallet_address = $this->daemon->wallet_unused_address();
// Default options // Default options

View file

@ -8,7 +8,7 @@ $channel_list = $LBRY->daemon->channel_list();
<h1><?= esc_html(get_admin_page_title()); ?></h1> <h1><?= esc_html(get_admin_page_title()); ?></h1>
<h2>Your wallet amount:</h2> <h2>Your wallet amount:</h2>
<code><?= number_format($wallet_balance, 6, '.', ','); ?></code> <code><?= number_format($wallet_balance, 2, '.', ','); ?></code>
<form action="options.php" method="post"> <form action="options.php" method="post">
<?php <?php