node-steam-user icon indicating copy to clipboard operation
node-steam-user copied to clipboard

Pending balance in the "wallet" event

Open aboyobam opened this issue 1 year ago • 0 comments

Problem

There is no option to get an accounts pending balance.

Suggested solution

Emit a pending flag with the "wallet" event. Example:

user.on("wallet", (hasWallet: boolean, currency: SteamUser.ECurrencyCode, balance: number, pending: boolean) => {
    ...
});

Additionally there could be pending: number on the SteamUser.wallet like

const user = new SteamUser();
// login and stuff
user.once("wallet", () => {
   const total = user.wallet.balance + user.wallet.pending;
});

Other Ideas

Because the pending balance and normal balance never change with a single transaction, it would also be an option to add a new event for "pendingWallet" which gets emmited once the pending balance changes.

aboyobam avatar Nov 24 '23 09:11 aboyobam