Revert "Use API getAccountBalance"

This reverts commit aca6e0145b.
This commit is contained in:
Robert Dyer
2024-08-24 14:48:55 -05:00
parent a1310abe21
commit afb3df018e
6 changed files with 23 additions and 10 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
const { closeBudget, openBudget, getTransactions, getAccountNote, ensurePayee } = require('./utils');
const { closeBudget, openBudget, getTransactions, getAccountNote, getAccountBalance, ensurePayee } = require('./utils');
const api = require('@actual-app/api');
function getValueAtPath(obj, path) {
@@ -53,7 +53,7 @@ async function getBitcoinPrice() {
continue;
}
const btc_amount = note.split('BTC:')[1].split(' ')[0];
const currentBalance = await api.getAccountBalance(account);
const currentBalance = await getAccountBalance(account);
const targetBalance = Math.round(bitcoinPrice * btc_amount * 100);
const diff = currentBalance - targetBalance;
if (diff != 0) {