Merged in wallet-functionality (pull request #1)
Fixed wallet balance call
This commit is contained in:
commit
6cc2bf8800
3 changed files with 4 additions and 11 deletions
|
@ -33,17 +33,9 @@ class LBRY_Daemon
|
|||
* @param string $address Wallet Address
|
||||
* @return float Wallet Balance
|
||||
*/
|
||||
public function wallet_balance($address = '')
|
||||
public function wallet_balance()
|
||||
{
|
||||
$address = $address ?: get_option(LBRY_SETTINGS)[LBRY_WALLET];
|
||||
error_log('Address: ' . $address);
|
||||
$result = $this->request('wallet_balance', array(
|
||||
'address' => $address,
|
||||
'include_unconfirmed' => true
|
||||
));
|
||||
|
||||
error_log($result);
|
||||
|
||||
$result = $this->request('wallet_balance');
|
||||
return json_decode($result)->result;
|
||||
}
|
||||
|
||||
|
|
|
@ -152,6 +152,7 @@ class LBRYPress
|
|||
// Add options to the options table we need
|
||||
if (! get_option(LBRY_SETTINGS)) {
|
||||
// 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();
|
||||
|
||||
// Default options
|
||||
|
|
|
@ -8,7 +8,7 @@ $channel_list = $LBRY->daemon->channel_list();
|
|||
<h1><?= esc_html(get_admin_page_title()); ?></h1>
|
||||
|
||||
<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">
|
||||
<?php
|
||||
|
|
Loading…
Reference in a new issue