Skip to content

Commit

Permalink
fix(binance): object is not array
Browse files Browse the repository at this point in the history
  • Loading branch information
iam4x committed Dec 20, 2023
1 parent 224b382 commit ecb1909
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/exchanges/binance/binance.exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ export class BinanceExchange extends BaseExchange {
ENDPOINTS.BALANCE
);

// TOFIX: refactor this without loop
const usdt = data.find(({ asset }) => asset === 'USDT')!;
const balances = usdt.map((margin: Record<string, string>) => {
const balances = [usdt].map((margin: Record<string, string>) => {
const free = parseFloat(margin.availableBalance);
const total = parseFloat(margin.balance);
const upnl = parseFloat(margin.crossUnPnl);
Expand Down

0 comments on commit ecb1909

Please sign in to comment.