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

rusk: Add a transactions by called contract endpoint #3374

Open
HDauven opened this issue Jan 16, 2025 · 0 comments
Open

rusk: Add a transactions by called contract endpoint #3374

HDauven opened this issue Jan 16, 2025 · 0 comments
Labels
module:rusk Issues related to rusk module type:feature implementing a new feature

Comments

@HDauven
Copy link
Member

HDauven commented Jan 16, 2025

Summary

A third party has requested a feature to display transactions related to their specific contract on the blockchain explorer. To support this, we need to expose a GraphQL query that allows filtering transactions based on the following criteria:

  • Transactions of type contract_call.
  • Contract ID matching a specified value.

This feature will allow clients/SDKs to query for contract interactions.

Possible Solution Design or Implementation

Expose a GraphQL query with parameters for filtering transactions by contract ID. The query should also support pagination to handle large datasets.

Example query:

query GetContractTransactions($contractId: String!, $limit: Int, $offset: Int) {
  transactions(
    filter: {
      contractId: $contractId
    },
    pagination: {
      limit: $limit,
      offset: $offset
    }
  ) {
    hash
    blockHeight
    timestamp
    contractId
    payload
    ...
  }
}

The implementation should filter for transactions of type type "contract_call" and a matching contractId. It should create appropriate indexing for query performance. It should return transaction details such as hash, block height, timestamp, contract ID, and payload.

@HDauven HDauven added module:rusk Issues related to rusk module type:feature implementing a new feature labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:rusk Issues related to rusk module type:feature implementing a new feature
Projects
None yet
Development

No branches or pull requests

1 participant