diff --git a/admin/images/lbc.png b/admin/images/lbc.png new file mode 100644 index 0000000..86dcb8a Binary files /dev/null and b/admin/images/lbc.png differ diff --git a/classes/LBRY_Daemon.php b/classes/LBRY_Daemon.php index 84ccd44..94c0a26 100644 --- a/classes/LBRY_Daemon.php +++ b/classes/LBRY_Daemon.php @@ -69,18 +69,19 @@ class LBRY_Daemon /** * Returns the available balance of a current LBRY account - * https://lbry.tech/api/sdk#account_balance - * @param string $address Wallet Address - * @return float Wallet Balance + * https://lbry.tech/api/sdk#wallet_balance + * @param string $address Wallet Address + * @return array $wallet_balance Wallet Balance + * */ public function wallet_balance() { - try { - $result = $this->request('account_balance'); - return $result->result->available; + try { // Convert JSON string to an object + $result = $this->request('wallet_balance'); + return $result; } catch (LBRYDaemonException $e) { - $this->logger->log('account_balance error', $e->getMessage() . ' | Code: ' . $e->getCode()); - LBRY()->notice->set_notice('error', 'Issue getting account balance.'); + $this->logger->log('wallet_balance error', $e->getMessage() . ' | Code: ' . $e->getCode()); + LBRY()->notice->set_notice('error', 'Issue getting wallet balance.'); return; } } diff --git a/templates/options_page.php b/templates/options_page.php index 320f2ea..a8cf308 100644 --- a/templates/options_page.php +++ b/templates/options_page.php @@ -1,13 +1,14 @@ daemon->wallet_balance(); +$available_balance = $wallet_balance->result->available; $channel_list = $LBRY->daemon->channel_list(); // TODO: Make this page look cleaner ?>

Your wallet amount:

- +