Conversation
📝 WalkthroughWalkthroughThis 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
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
🧹 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, anderrorare accessed directly (with type safety), whileprocessedQuoteandsettlementrequire unsafe(response as any)casts. This pattern indicates the proto-generatedMakerStreamResponsetype doesn't include these fields, forcing TypeScript around its type system.Update the proto type definition (or use type augmentation) to include
processedQuoteandsettlementfields onMakerStreamResponse, 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
packages/sdk-ts/package.jsonpackages/sdk-ts/src/client/chain/transformers/ChainGrpcStakingTransformer.tspackages/sdk-ts/src/client/indexer/transformers/IndexerGrpcRfqTransformer.tspackages/sdk-ts/src/client/indexer/types/rfq.tspackages/sdk-ts/src/client/indexer/ws/rfq/IndexerWsMakerStream.ts
note = aligning RFQ proto changes + consensusKey addition from team
Summary by CodeRabbit
New Features
Chores