Skip to content

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

@natonnelier

Description

@natonnelier

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions