Error getting token balances when using web3.alchemy.getTokenBalances
See original GitHub issueHi there, I have the following code:
const web3 = createAlchemyWeb3(
`https://eth-mainnet.alchemyapi.io/v2/${process.env.NEXT_PUBLIC_ALCHEMY_API_KEY}`
)
const getTokenBalanceWithAlchemy = async (address, tokens) => {
try {
let tokenBalances = await web3.alchemy.getTokenBalances(address, tokens)
return tokenBalances
} catch (error) {
console.error(error)
}
}
getTokenBalanceWithAlchemy("0x87BA155A86Cf63be05445bABB184e327551810F8", ["0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"])
For some reason, the request gives me an error…
index.js?d1cc:41 TypeError: this.decodeParameters is not a function
at ABICoder.decodeParameter (index.js?8fce:273)
at eval (index.js?1558:113)
at Array.map (<anonymous>)
at processTokenBalanceResponse (index.js?1558:111)
at eval (index.js?1558:102)
at step (tslib.es6.js?61e8:102)
at Object.eval [as next] (tslib.es6.js?61e8:83)
at fulfilled (tslib.es6.js?61e8:73)
Can someone help me figure out why this is happening? Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:14 (6 by maintainers)
Top Results From Across the Web
alchemy_getTokenBalances - Alchemy Docs
Returns ERC20 token balances for all tokens the given address has ever transacted in with. Optionally accepts a list of contracts.
Read more >Alchemy API trying to call `getTokenBalances` at a particular ...
The function will then return all of my current token balances but not my token balances as of the specified block height, followed...
Read more >alchemy-web3/README.md at master - GitHub
Returns token balances for a specific address given a list of contracts. Parameters: An object with the following fields: contract : The address...
Read more >Get Token Balance of Address at Particular Block Number with ...
We've released a new and updated version on how to get token balances that specifically includes the block number parameter as well.
Read more >How Do I Get All the Tokens? - Medium
Problem. I make login with metamask on my website. But I want to get all tokens ... https://docs.moralis.io/moralis-dapp/web3-api/account#gettokenbalances ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That is correct. 1.1.3 works, latest throws an error.
Reopening since multiple people have reported this issue.