mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 18:55:01 +02:00
return balance in satoshis
This commit is contained in:
parent
b3279e03ca
commit
939f8c49de
3 changed files with 9 additions and 7 deletions
|
@ -24,9 +24,9 @@ AccountScriptingInterface* AccountScriptingInterface::getInstance() {
|
|||
return &sharedInstance;
|
||||
}
|
||||
|
||||
qint64 AccountScriptingInterface::getBalance() {
|
||||
float AccountScriptingInterface::getBalance() {
|
||||
AccountManager& accountManager = AccountManager::getInstance();
|
||||
return accountManager.getAccountInfo().getBalance();
|
||||
return accountManager.getAccountInfo().getBalanceInSatoshis();
|
||||
}
|
||||
|
||||
bool AccountScriptingInterface::isLoggedIn() {
|
||||
|
@ -34,6 +34,7 @@ bool AccountScriptingInterface::isLoggedIn() {
|
|||
return accountManager.isLoggedIn();
|
||||
}
|
||||
|
||||
void AccountScriptingInterface::updateBalance(qint16 newBalance) {
|
||||
emit balanceChanged(newBalance);
|
||||
void AccountScriptingInterface::updateBalance(qint64 newBalance) {
|
||||
AccountManager& accountManager = AccountManager::getInstance();
|
||||
emit balanceChanged(accountManager.getAccountInfo().getBalanceInSatoshis());
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@ class AccountScriptingInterface : public QObject {
|
|||
AccountScriptingInterface();
|
||||
|
||||
signals:
|
||||
void balanceChanged(qint64 newBalance);
|
||||
void balanceChanged(float newBalance);
|
||||
|
||||
public slots:
|
||||
static AccountScriptingInterface* getInstance();
|
||||
qint64 getBalance();
|
||||
float getBalance();
|
||||
bool isLoggedIn();
|
||||
void updateBalance(qint16 newBalance);
|
||||
void updateBalance(qint64 newBalance);
|
||||
};
|
||||
|
||||
#endif // hifi_AccountScriptingInterface_h
|
||||
|
|
|
@ -38,6 +38,7 @@ public:
|
|||
void setDiscourseApiKey(const QString& discourseApiKey);
|
||||
|
||||
qint64 getBalance() const { return _balance; }
|
||||
float getBalanceInSatoshis() const { return _balance / SATOSHIS_PER_CREDIT; }
|
||||
void setBalance(qint64 balance);
|
||||
bool hasBalance() const { return _hasBalance; }
|
||||
void setHasBalance(bool hasBalance) { _hasBalance = hasBalance; }
|
||||
|
|
Loading…
Reference in a new issue