Skip to content

Additional data needed in contract events endpoint #2331

Description

@crypt0jan

Is your feature request related to a problem? Please describe.
Because there is no total key, no block number, no timestamp whatsoever, and no way to sort the output (desc/asc), we have to query all the contract events instead of just the data for the last five cycles (all we need).

If we put offset 0, we see the most recent records instead of the oldest records. But to only query the records up until five cycles ago, we don't need ALL contract events (until our loop returns less than the 'limit'), but just until block number or timestamp is 'less than' X.

Describe the solution you'd like
I'd like total, blocknumber, and timestamp per event in the output and maybe even a sort as query parameter. That way, we can do: total - total db records = records to retrieve.

Endpoint: https://docs.hiro.so/apis/stacks-blockchain-api/reference/smart-contracts/events
Link to point in source code: https://github.com/hirosystems/stacks-blockchain-api/blob/develop/src/api/routes/contract.ts#L100

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