node-steam-user
node-steam-user copied to clipboard
Pending balance in the "wallet" event
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.