Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnhandledPromiseRejectionWarning: Error: Unable to query by blockTag: provider is not archive node #1

Open
natonnelier opened this issue Jan 17, 2022 · 0 comments

Comments

@natonnelier
Copy link

I'm trying to get token balances from Arbitrum One with a specific date. This is the code I'm using:

  const date = sdk.date.formatDate(new Date())
  const swprAddress = SWPR[ChainId.ARBITRUM_ONE].address;
  const tokenContract = sdk.ethers.getERC20Contract(swprAddress, 'arbitrum-one')

  const [daoBalance, swaprWalletSchemeBalance, unconvertedBalance] = await Promise.all([
    tokenContract.balanceOf("addressOne", { blockTag: date }),
    tokenContract.balanceOf("addressTwo",   { blockTag: date }),
    tokenContract.balanceOf(SWPR_CONVERTER_ADDRESS[ChainId.ARBITRUM_ONE], { blockTag: date }),
  ])

But it throws the following Error:
UnhandledPromiseRejectionWarning: Error: Unable to query by blockTag: provider is not archive node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant