extension
extension copied to clipboard
Token balance support on non-Alchemy-supported networks
In order to implement swaps we're going to need to figure out some way to determine what tokens an account has without relying on alchemy_getAssetTransfers.

alchemy_getAssetTransfers does not yet support kovan
We don't rely soley on alchemy_getAssetTransfers now thankfully :) See #309
We do, however, still rely on alchemy_getTokenBalances in its absence. I don't know whether that has support on Kovan.
I wonder how will you consider to track token balances in non-Alchemy-networks.
alchemy_getAssetTransfers
alchemy_getTokenBalances
alchemy_getTokenMetadata
When user select the network which is not supported by Alchemy, are you assuming to get the same output as Alchemy? I'm planning to investigate for RSK network but I'm not sure how to achieve this in your codebase. Does it make sense to obtain the same output by fetching and mapping the data from an external API? It sounds heavy work in the client side or maybe you have something different in your mind.
The plan is to fall back to manual balance checking per-token. It is indeed to a heavy client lift.
Let's start this by:
- [ ] Implementing
getERC20TokenBalance(singular!) using a normal Ethers provider and the ERC20 ABI atlib/erc20.ts.
Then we need a way to do some good batching in ChainService so we can do a fallback version of getTokenBalances even for larger numbers of tokens.
It's probably already not good that there's an Alchemy-specific implementation in lib/erc20.ts, tbh.
Implementing getERC20TokenBalance (singular!)
We have this already ☺️
Ayyyy you right. getBalance!
There goes the easy part 😂
Closed by https://github.com/tallycash/extension/pull/2423