Skip to content

Add get-orders-by-address endpoint with DotrainRegistry integration#3

Draft
findolor wants to merge 2 commits intomainfrom
findolor/get-orders-by-address
Draft

Add get-orders-by-address endpoint with DotrainRegistry integration#3
findolor wants to merge 2 commits intomainfrom
findolor/get-orders-by-address

Conversation

@findolor
Copy link
Collaborator

Motivation

Build out the REST API with full route handlers, request/response types, error handling, Swagger UI, and CORS support. Implement the first functional endpoint (get_orders_by_address) that queries orders from the orderbook subgraph via DotrainRegistry.

Solution

  • Replace the hello-world main.rs with a full Rocket web server setup including CORS, Swagger UI, and route mounting
  • Add typed request/response structs for all API domains: orders, trades, swap, tokens, health
  • Add ApiError type with Rocket responder for structured error responses
  • Add validated path parameter types (ValidatedAddress, ValidatedFixedBytes) with alloy primitives
  • Implement get_orders_by_address using DotrainRegistry loaded from REGISTRY_URL env var, querying the raindex client for orders by owner address with pagination
  • Wrap non-Send DotrainRegistry futures in spawn_blocking + LocalSet to satisfy Rocket's Send requirement
  • Stub remaining endpoints with todo!()

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Load registry at startup via DotrainRegistry::new(), pass as Rocket
state. Orders route uses registry.get_raindex_client() to query
active orders per address.
@findolor findolor self-assigned this Feb 11, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch findolor/get-orders-by-address

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

1 participant