getERC20 doesn't return all tokens

When I call Moralis.Web3.getERC20( {chain: 'bsc' });
It’s missing a cake swap that was made several hours ago.

After looking in Jobs, I see a job called bscSyncAddress. I assume this was created by a plugin. It hasn’t run in about 24 hours and manually running returns an error that it’s missing a JSON object presumably the address that it is to sync, but I see no place to add it.

Edit: Here is the URL to the server

You could try to schedule a new job if you would know how to send it the address as parameter.
I get a similar error when I try to run it now: Address is required. It looks like it is not running very often and it looks like it receives as parameter the objectId from BscBalance table.
Also there is a is_syncing checkbox if you double click on the objectId in BscBalance table. don’t know exactly what it does, but it was disabled in my case.

1 Like

which address are you trying to lookup?
You can DM me on Discord if you dont wanna share it here

Thank you, I sent it to you.

Hey @CryptoCoder

I’ve checked balance of provided address on:

  • Web3 API,
  • Bscscan,
  • Moralis.Web3.getAllERC20({ chain: "bsc"}),
  • Moralis.Web3.getERC20({ chain: “bsc”, tokenAddress: “0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82” })`.

And the results are simillar, all have Cake Token.

There is no need to manually start job bscSyncAddress - it will have no effect. Moralis syncs data automatically.

1 Like

Hey @Yomoo

Thanks for looking into it. I appreciate your time.

I’ll provide my code and output from it. I reattempted after you said that you successfully tried it, it’s still having the same results.

const getBSCTokenBalances = async () => {
    const options = { chain: 'bsc', address: ethereum.selectedAddress }
    return await Moralis.Web3.getAllERC20(options);

Raw output result (no filter) (everything below index 3 is a scam token except 11 & 15

Also no Cake in the BscTokenBalance table

I didn’t check it using the Web3 API. That may be an alternative.

I hope this illustrates my issue.

Hey @CryptoCoder

You have transfered cakes today, so I can’t send you a screenshot. Has your database synchronized all these transfers?

I’ve used moralis web3 api historical balance.

Your balance before block 10243932 had pancake swap tokens

Which version of Moralis do you use?

Yes, it appears after getting rid of that cake that I was holding, it showed up on the balances table. I’m not entirely sure if that was what caused it to sync but it just happened within the last hour or two.

It looks like I’m using v0.0.30 of Moralis.

@Yomoo Would you mind editing that image out of your previous post? It has my address on there.

In the future, I may move that particular part of the codebase to use the Web3 API to fetch balances.

Thanks again for your continued guidance.

1 Like

@Yomoo Would you mind editing that image out of your previous post? It has my address on there.

I just woke up, I was sleepy and forgot that the url also contains the wallet address :sweat_smile:

1 Like