Skip to content

[@0xsequence/indexer] GetBalanceUpdates lastBlockHash is invalid #821

Description

@ddeedev

Description :
Cannot specify LastBlockNumber as argument while query path GetBalanceUpdates but accept only LastBlockNumber = 0.
It return lastBlockHash is invalid, though lastBlockHash is optional parameter

export interface GetBalanceUpdatesArgs {
    contractAddress: string;
    lastBlockNumber: number;
    lastBlockHash?: string;
    page?: Page;
}

Expected behavior :
Return Invalid BlockNumber or Required BlockHash instead. And Return balance info at that block if success.

Example :

import { SequenceIndexer } from "@0xsequence/indexer"; // v2.3.23

const client = new SequenceIndexer(
  "https://mainnet-indexer.sequence.app",
  "**********{APIKEY}******************",
);

const contractAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
const lastBlockNumber = 22965225;

async function main() {
  // Fetch balance change events for any token or collection
  const result = await client.getBalanceUpdates({
    lastBlockNumber: lastBlockNumber,
    contractAddress: contractAddress,
  });
  console.log("Result:", result);
}

main()
  .then((res) => {
    console.log;
  })
  .catch((err: any) => {
    console.error(err);
  });

Error:

InvalidArgument: Invalid argument
   code: 2001,
 status: 400,
  cause: "lastBlockHash is invalid",
    msg: "Invalid argument",

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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