Skip to content

chore/align-with-latest-rfq-changes#624

Merged
ThomasRalee merged 3 commits intodevfrom
chore/align-latest-rfq-updates
Mar 10, 2026
Merged

chore/align-with-latest-rfq-changes#624
ThomasRalee merged 3 commits intodevfrom
chore/align-latest-rfq-updates

Conversation

@Frederick-88
Copy link
Copy Markdown
Collaborator

@Frederick-88 Frederick-88 commented Mar 3, 2026

note = aligning RFQ proto changes + consensusKey addition from team

Summary by CodeRabbit

  • New Features

    • Added support for RFQ processed quotes in maker stream events, including processing results, pricing, margins, and execution details
    • Extended settlement information with additional identification fields
    • Enhanced validator data with consensus public key information
  • Chores

    • Updated indexer protocol dependencies

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 3, 2026

📝 Walkthrough

Walkthrough

This pull request bumps the indexer-proto-ts-v2 dependency, adds a consensus public key field to validator objects, and introduces RFQ processed quote and settlement support through new transformers, types, and WebSocket message handlers.

Changes

Cohort / File(s) Summary
Dependency Update
packages/sdk-ts/package.json
Bumped @injectivelabs/indexer-proto-ts-v2 from 1.18.4 to 1.18.6.
Staking Validator Enhancement
packages/sdk-ts/src/client/chain/transformers/ChainGrpcStakingTransformer.ts
Added consensusPubKey field to Validator object, computed as base64-encoded consensus public key with fallback to empty Uint8Array.
RFQ Processed Quote Infrastructure
packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcRfqTransformer.ts, packages/sdk-ts/src/client/indexer/types/rfq.ts, packages/sdk-ts/src/client/indexer/ws/rfq/IndexerWsMakerStream.ts
Added new transformer method for RFQ processed quotes, new type definitions (RFQProcessedQuoteType, GrpcRFQProcessedQuote), extended RFQSettlementType with cid field, and added WebSocket message handlers for processed_quote and settlement events.

Sequence Diagram

sequenceDiagram
    participant Remote as Remote Server
    participant WS as IndexerWsMakerStream
    participant Transformer as IndexerGrpcRfqTransformer
    participant Client as Client/Consumer
    
    Remote->>WS: Send RFQ processed_quote message
    WS->>WS: Detect processed_quote in response
    WS->>Transformer: grpcRfqProcessedQuoteToRfqProcessedQuote()
    Transformer->>Transformer: Transform GrpcRFQProcessedQuote to RFQProcessedQuoteType
    Transformer-->>WS: Return transformed quote
    WS->>Client: Emit processed_quote event
    
    Remote->>WS: Send RFQ settlement message
    WS->>WS: Detect settlement in response
    WS->>Transformer: grpcRfqSettlementToRfqSettlement()
    Transformer->>Transformer: Transform with new cid field
    Transformer-->>WS: Return transformed settlement
    WS->>Client: Emit settlement event
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Through proto streams the quotes now flow,
With processed tales and settlements' glow,
A pubKey dances in base64 bright,
While RFQ handlers catch the light,
Transformers hop through types with care,
New features blooming everywhere! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore/align-with-latest-rfq-changes' accurately reflects the main changes: adding RFQ processed quote support, extending RFQ settlement mapping, and updating types to align with the latest RFQ protocol changes.
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.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/align-latest-rfq-updates

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

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 3, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​injectivelabs/​indexer-proto-ts-v2@​1.18.4 ⏵ 1.18.687 +110077 +199 +1100

View full report

@Frederick-88 Frederick-88 marked this pull request as ready for review March 9, 2026 19:42
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/sdk-ts/src/client/indexer/ws/rfq/IndexerWsMakerStream.ts (1)

179-201: Type assertions (response as any) bypass type safety and create inconsistency.

The code inconsistently handles response fields: request, quoteAck, and error are accessed directly (with type safety), while processedQuote and settlement require unsafe (response as any) casts. This pattern indicates the proto-generated MakerStreamResponse type doesn't include these fields, forcing TypeScript around its type system.

Update the proto type definition (or use type augmentation) to include processedQuote and settlement fields on MakerStreamResponse, ensuring all message cases are handled with consistent type safety.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/sdk-ts/src/client/indexer/ws/rfq/IndexerWsMakerStream.ts` around
lines 179 - 201, The code uses unsafe casts for response.processedQuote and
response.settlement in IndexerWsMakerStream; update the MakerStreamResponse type
(or add a module augmentation) to include processedQuote and settlement so the
cases can access response.processedQuote and response.settlement with proper
types, then remove the (response as any) casts and call
IndexerGrpcRfqTransformer.grpcRfqProcessedQuoteToRfqProcessedQuote and
grpcRfqSettlementToRfqSettlement directly; ensure the augmented types match the
proto shapes used by those transformer methods so the compiler enforces type
safety.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/sdk-ts/src/client/indexer/ws/rfq/IndexerWsMakerStream.ts`:
- Around line 179-201: The code uses unsafe casts for response.processedQuote
and response.settlement in IndexerWsMakerStream; update the MakerStreamResponse
type (or add a module augmentation) to include processedQuote and settlement so
the cases can access response.processedQuote and response.settlement with proper
types, then remove the (response as any) casts and call
IndexerGrpcRfqTransformer.grpcRfqProcessedQuoteToRfqProcessedQuote and
grpcRfqSettlementToRfqSettlement directly; ensure the augmented types match the
proto shapes used by those transformer methods so the compiler enforces type
safety.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1938999e-7173-4c7d-ab6a-d334088b141a

📥 Commits

Reviewing files that changed from the base of the PR and between b7523ec and c0838ff.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • packages/sdk-ts/package.json
  • packages/sdk-ts/src/client/chain/transformers/ChainGrpcStakingTransformer.ts
  • packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcRfqTransformer.ts
  • packages/sdk-ts/src/client/indexer/types/rfq.ts
  • packages/sdk-ts/src/client/indexer/ws/rfq/IndexerWsMakerStream.ts

@ThomasRalee ThomasRalee merged commit 1357066 into dev Mar 10, 2026
5 checks passed
@ThomasRalee ThomasRalee deleted the chore/align-latest-rfq-updates branch March 10, 2026 10:33
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