question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot use 'in' operator to search for 'isDustTrade' in < at binance.parseTrade

See original GitHub issue

When trying to use the fetchMyTrades method I get this error back. Any way of dealing with this?

TypeError: Cannot use ‘in’ operator to search for ‘isDustTrade’ in < at binance.parseTrade (C:\Users\thehe\Documents\workspace\work\crypto-trade-api\node_modules\ccxt\js\binance.js:2225:27)

` if (market) {
            const tempTrades = await this.exchange.fetchMyTrades(symbol, fromDate, 10)
            
            if (tempTrades) {
              trades = [...trades, ...tempTrades]
            }
          }`

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
csidi90commented, Feb 1, 2022

You are right. I missed the .valueOf() which I even had before but there I was messing up something else lol. All good now, thanks a bunch mate.

0reactions
kroitorcommented, Feb 1, 2022

if (!this.exchange.has[“fetchMyTrades”]) return; try { const balances = []; let trades = []; let fromDate = moment().subtract(7, “days”);

@csidi90 your fromDate is wrong, the since argument must be an integer in milliseconds throughout CCXT.

Check your value of fromDate:

if (!this.exchange.has["fetchMyTrades"]) return;
try {
  const balances = [];
  let trades = [];
  let fromDate = moment().subtract(7, "days");
  console.log(fromDate, typeof fromDate) // must be an integer Number, not an object, nor a string
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: cannot use 'in' operator to search for 'x' in 'y'
The in operator can only be used to check if a property is in an object. You can't search in strings, or in...
Read more >
Uncaught TypeError: Cannot use 'in' operator to search for '' in ...
You need to parse the string in your populateValue variable to an object: prePopulate: $.parseJSON(populateValue). Or alternatively, in plain JS:
Read more >
JavaScript TypeError - Cannot use 'in' operator to search for 'X ...
This JavaScript exception Cannot use 'in' operator to search for 'X' in 'Y' occurs if in operator is used to search in strings,...
Read more >
TypeError: cannot use 'in' operator to search for 'x' in 'y'
The in operator can only be used to check if a property is in an object. You can't search in strings, or in...
Read more >
Uncaught TypeError: Cannot use 'in' operator to ... - GitHub
Uncaught TypeError: Cannot use 'in' operator to search for 'value' in at propertyDefaultsForClass (element-mixin.html:206) #4968.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found