Skip to content

Add support to search contract by address#19

Merged
ivpusic merged 2 commits into
mainfrom
contract_search_by_address
Mar 6, 2026
Merged

Add support to search contract by address#19
ivpusic merged 2 commits into
mainfrom
contract_search_by_address

Conversation

@ivpusic
Copy link
Copy Markdown
Member

@ivpusic ivpusic commented Mar 5, 2026

Added SearchDatasetsByContractAddress method.

@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 5, 2026

PR Summary

Medium Risk
Introduces a new public API and modifies the DuneClient interface/model types, which can be breaking for downstream implementations or mocks; behavior change is otherwise additive and localized to dataset search.

Overview
Adds a new SearchDatasetsByContractAddress client method (and DuneClient interface entry) that POSTs to the new /api/v1/datasets/search-by-contract endpoint and returns SearchDatasetsResponse.

Updates dataset search models by introducing SearchDatasetsByContractAddressRequest and adding an optional contract_address field to SearchDatasetsRequest for broader search filtering.

Written by Cursor Bugbot for commit 1abb32f. Configure here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 60957565-1762-49ae-bf3f-c9d1fddd592b

📥 Commits

Reviewing files that changed from the base of the PR and between 1abb32f and 7713727.

📒 Files selected for processing (2)
  • models/query.go
  • models/search_datasets.go

📝 Walkthrough

Walkthrough

Adds support for searching datasets by smart contract address: a new request model, a new client method implementation, and an updated client interface plus URL template for the /datasets/search-by-contract endpoint.

Changes

Cohort / File(s) Summary
Client implementation
dune/dataset.go
Added func (c *duneClient) SearchDatasetsByContractAddress(req models.SearchDatasetsByContractAddressRequest) (*models.SearchDatasetsResponse, error) which builds a POST to the contract-address search endpoint, performs the request, and decodes the response using existing httpRequest/decodeBody patterns.
Interface & constants
dune/dune.go
Added SearchDatasetsByContractAddress(req models.SearchDatasetsByContractAddressRequest) (*models.SearchDatasetsResponse, error) to the DuneClient interface and introduced searchDatasetsByContractAddressURLTemplate constant for /datasets/search-by-contract.
Models — new & modified
models/search_datasets.go
Added SearchDatasetsByContractAddressRequest (fields: ContractAddress, Blockchains, Limit, Offset, IncludeSchema). Reordered fields in SearchDatasetsRequest (no semantic change).
Models — formatting
models/query.go
Whitespace/field alignment changes in GetQueryResponse struct only; no semantic or API changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • norbertdurcansk
  • va3093
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add support to search contract by address' directly and accurately reflects the main change: introducing SearchDatasetsByContractAddress method for searching datasets by contract address.
Description check ✅ Passed The description 'Added SearchDatasetsByContractAddress method' is directly related to the changeset and accurately describes the primary addition across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread models/search_datasets.go Outdated
Limit *int32 `json:"limit,omitempty"`
Offset *int32 `json:"offset,omitempty"`
Query *string `json:"query,omitempty"`
ContractAddress *string `json:"contract_address,omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this correct. I thought we only support this in a seperate api now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, this is leftover

@ivpusic ivpusic merged commit b97288a into main Mar 6, 2026
1 check passed
@ivpusic ivpusic deleted the contract_search_by_address branch March 6, 2026 08:17
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

Successfully merging this pull request may close these issues.

2 participants