whallets upgrade function

This commit is contained in:
NW
2024-12-16 23:43:44 +00:00
parent d51bc9f0b9
commit 21465022b3
4 changed files with 108 additions and 92 deletions

View File

@@ -1,5 +1,5 @@
import db from "../config/database.js";
import WalletService from "../utils/walletService.js";
import WalletUtils from "../utils/walletUtils.js";
export default class Wallet {
static getBaseWalletType(walletType) {
@@ -50,7 +50,7 @@ export default class Wallet {
static async getActiveWalletsBalance(userId) {
const activeWallets = await this.getActiveWallets(userId);
const walletService = new WalletService(
const walletUtilsInstance = new WalletUtils(
activeWallets.btc,
activeWallets.ltc,
activeWallets.tron,
@@ -59,7 +59,7 @@ export default class Wallet {
Date.now() - 30 * 24 * 60 * 60 * 1000
);
const balances = await walletService.getAllBalances();
const balances = await walletUtilsInstance.getAllBalances();
let totalUsdBalance = 0;
@@ -86,7 +86,7 @@ export default class Wallet {
static async getArchivedWalletsBalance(userId) {
const archiveWallets = await this.getArchivedWallets(userId);
const walletService = new WalletService(
const walletUtilsInstance = new WalletUtils(
archiveWallets.btc,
archiveWallets.ltc,
archiveWallets.tron,
@@ -95,7 +95,7 @@ export default class Wallet {
Date.now() - 30 * 24 * 60 * 60 * 1000
);
const balances = await walletService.getAllBalances();
const balances = await walletUtilsInstance.getAllBalances();
let totalUsdBalance = 0;