Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

aaron/Remove deducting trade amount prematurely #2738

Merged
merged 1 commit into from
May 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions src/botPage/bot/TradeEngine/Balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,8 @@ export default Engine =>
}
// eslint-disable-next-line class-methods-use-this
getBalance(type) {
const { scope } = this.store.getState();
const currency = globalObserver.getState('currency');
let balance = globalObserver.getState('balance');

// Deduct trade `amount` in this scope for correct value in `balance`-block
if (scope === 'BEFORE_PURCHASE') {
balance = roundBalance({
balance: Number(balance) - this.tradeOptions.amount,
currency,
});
}

const balance = globalObserver.getState('balance');
const balanceStr = `${balance}`;

return type === 'STR' ? balanceStr : Number(balance);
}
};
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy