Skip to content

feat: read any wallet's order-book history by address#1391

Merged
MicBun merged 1 commit into
mainfrom
feat/order-event-getter
Jun 8, 2026
Merged

feat: read any wallet's order-book history by address#1391
MicBun merged 1 commit into
mainfrom
feat/order-event-getter

Conversation

@MicBun

@MicBun MicBun commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

resolves: https://github.com/truflation/website/issues/4039

Summary by CodeRabbit

Release Notes

  • New Features
    • Order event history is now queryable by wallet address with detailed event information including price, amount, and timestamp
    • Pagination controls enable browsing large result sets efficiently
    • Optional market filtering to scope results to specific markets

@MicBun MicBun requested a review from pr-time-tracker June 8, 2026 12:08
@MicBun MicBun self-assigned this Jun 8, 2026
@MicBun MicBun added the type: feat New feature or request label Jun 8, 2026
@holdex

holdex Bot commented Jun 8, 2026

Copy link
Copy Markdown

Time Submission Status

Member # Time Running Total Status Last Update
MicBun 4h ✅ Submitted Jun 10, 2026, 5:04 PM

Submit or update total time with:

@holdex pr submit-time 2h

Add time on top of previous submission with:

@holdex pr add-time 1h30m

See available commands to help comply with our Guidelines.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This migration introduces a new public read-only SQL action, get_order_events_by_wallet, that exposes order-book event history from ob_order_events for a given wallet address. The action normalizes wallet input, resolves the participant identity, queries events with optional filtering and pagination, and returns event records with formatted addresses.

Changes

Order Book Event Queries

Layer / File(s) Summary
get_order_events_by_wallet Action
internal/migrations/050-order-book-event-queries.sql
Public read-only action that validates and normalizes a wallet address (lowercasing, stripping optional 0x, confirming 40 hex characters), resolves the participant id from ob_participants, queries ob_order_events joined to acting and counterparty participant rows, formats both addresses as 0x-prefixed hex strings, filters by participant and optional query_id, orders by event id, applies pagination, and returns event records.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • trufnetwork/node#1343: Creates and populates the ob_order_events table that this new action queries for wallet-specific order-book event history.

Suggested reviewers

  • pr-time-tracker

Poem

🐰 A rabbit hops through order books with glee,
Validating addresses, hex by hex decree,
Wallet events now flow with pagination,
The query_id provides fine filtration,
Participants dance in 0x notation!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding functionality to read any wallet's order-book history by address, which matches the migration's new get_order_events_by_wallet action.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/order-event-getter

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.

@MicBun MicBun merged commit 86126a4 into main Jun 8, 2026
7 of 8 checks passed
@MicBun MicBun deleted the feat/order-event-getter branch June 8, 2026 12:10
@MicBun

MicBun commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@holdex pr submit-time 4h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feat New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant