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

Add block height filters to fetchActions and fetchEvents #1992

Open
45930 opened this issue Jan 28, 2025 · 0 comments
Open

Add block height filters to fetchActions and fetchEvents #1992

45930 opened this issue Jan 28, 2025 · 0 comments

Comments

@45930
Copy link
Contributor

45930 commented Jan 28, 2025

The existing filter options for fetchEvents and fetchActions do not include to: and from:, which are required to make an efficient query.

The existing function signatures are:

type ActionsQueryInputs = {
  publicKey: string;
  actionStates: ActionStatesStringified;
  tokenId?: string;
};

async function fetchEvents(
  accountInfo: { publicKey: string; tokenId?: string },
  graphqlEndpoint = networkConfig.archiveEndpoint,
  filterOptions: EventActionFilterOptions = {}
) {

async function fetchActions(
  accountInfo: ActionsQueryInputs,
  graphqlEndpoint = networkConfig.archiveEndpoint
) {

in o1-labs/Archive-Node-API#114 we enforce a block scan limit that is configurable, and defaults to 10,000 blocks at a time. Without specifying a block range, requests will default to the most recent sequence of n blocks.

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