Skip to content

Conversation

@Frederick-88
Copy link
Collaborator

@Frederick-88 Frederick-88 commented Dec 26, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Added ability to fetch account auction status with address and round parameters.
  • Tests

    • Added test coverage for the new account auction status fetching functionality.
  • Chores

    • Updated indexer protocol dependency to latest version.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 26, 2025

📝 Walkthrough

Walkthrough

New account auction status fetching capability added to the SDK. A public method fetchAccountAuctionStatus is introduced to the IndexerGrpcAuctionApi, along with supporting type definitions, a transformer for response conversion, and a test case validating the new functionality.

Changes

Cohort / File(s) Summary
Type Definition & Transformation
packages/sdk-ts/src/client/indexer/types/auction.ts, packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcAuctionTransformer.ts
New AccountAuctionStatus interface added with status string property. Corresponding transformer method auctionAccountStatusResponseToAuctionAccountStatus created to map gRPC response to the new type.
API Method
packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcAuctionApi.ts
Public method fetchAccountAuctionStatus added, accepting address and optional round parameters, constructs gRPC request, executes call, and returns transformed response.
Test Coverage
packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcAuctionApi.spec.ts
Test case fetchAccountAuctionStatus added verifying method invocation with address parameter, response definition, and correct return type matching transformer output.
Dependency Update
packages/sdk-ts/package.json
Version bump for @injectivelabs/indexer-proto-ts-v2 from 1.17.5 to 1.17.6.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant IndexerGrpcAuctionApi
    participant gRPC Service
    participant Transformer

    Client->>IndexerGrpcAuctionApi: fetchAccountAuctionStatus(address, round)
    IndexerGrpcAuctionApi->>IndexerGrpcAuctionApi: Create AuctionAccountStatusRequest
    IndexerGrpcAuctionApi->>gRPC Service: auctionAccountStatus(request)
    gRPC Service-->>IndexerGrpcAuctionApi: AuctionAccountStatusResponse
    IndexerGrpcAuctionApi->>Transformer: auctionAccountStatusResponseToAuctionAccountStatus(response)
    Transformer-->>IndexerGrpcAuctionApi: AccountAuctionStatus
    IndexerGrpcAuctionApi-->>Client: AccountAuctionStatus
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰✨ Hops with glee, the auction quest,
New status fetched, now SDK's blessed,
Address and round, the method knows,
Transform and test, the feature grows! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'chore/auction-whitelist-new-endpoint' is vague and does not clearly describe the main changes being made to the codebase. Consider using a more descriptive title that clearly explains what is being added or changed, such as 'Add fetchAccountAuctionStatus method to IndexerGrpcAuctionApi' or 'Implement new auction account status endpoint'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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

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

@Frederick-88 Frederick-88 marked this pull request as ready for review January 12, 2026 16:15
Copy link

@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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcAuctionApi.spec.ts (1)

142-162: Test will pass even when the API call fails.

The test swallows exceptions with console.error, so it will always pass regardless of whether the API call succeeds. This is consistent with other tests in this file, but consider:

  1. At minimum, adding throw e after logging to ensure failures are caught
  2. Adding a test case that exercises the optional round parameter
♻️ Suggested improvement
   test('fetchAccountAuctionStatus', async () => {
     try {
       const response = await indexerGrpcAuctionApi.fetchAccountAuctionStatus({
         address: 'inj17gkuet8f6pssxd8nycm3qr9d9y699rupv6397z',
       })

       expect(response).toBeDefined()
       expect(response).toEqual(
         expect.objectContaining<
           ReturnType<
             typeof IndexerGrpcAuctionTransformer.auctionAccountStatusResponseToAuctionAccountStatus
           >
         >(response),
       )
     } catch (e) {
       console.error(
         'IndexerGrpcAuctionApi.fetchAccountAuctionStatus => ' +
           (e as any).message,
       )
+      throw e
     }
   })
packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcAuctionApi.ts (1)

162-164: Redundant check: address is a required parameter.

Since address is defined as a required parameter in the function signature (address: string), the if (address) check is unnecessary. TypeScript already ensures it will be provided.

♻️ Suggested simplification
-    if (address) {
-      request.address = address
-    }
+    request.address = address
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5825feb and c978566.

📒 Files selected for processing (5)
  • packages/sdk-ts/package.json
  • packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcAuctionApi.spec.ts
  • packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcAuctionApi.ts
  • packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcAuctionTransformer.ts
  • packages/sdk-ts/src/client/indexer/types/auction.ts
🧰 Additional context used
🧬 Code graph analysis (3)
packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcAuctionApi.spec.ts (1)
packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcAuctionTransformer.ts (1)
  • IndexerGrpcAuctionTransformer (22-166)
packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcAuctionTransformer.ts (1)
packages/sdk-ts/src/client/indexer/types/auction.ts (1)
  • AccountAuctionStatus (71-73)
packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcAuctionApi.ts (1)
packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcAuctionTransformer.ts (1)
  • IndexerGrpcAuctionTransformer (22-166)
🔇 Additional comments (5)
packages/sdk-ts/package.json (1)

331-331: LGTM!

The dependency bump to @injectivelabs/[email protected] is required to support the new AuctionAccountStatusRequest and AuctionAccountStatusResponse types used by the new fetchAccountAuctionStatus API method.

packages/sdk-ts/src/client/indexer/types/auction.ts (1)

71-73: LGTM!

The new AccountAuctionStatus interface is well-defined and correctly exported for use by the transformer and API method.

packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcAuctionApi.ts (1)

149-174: LGTM!

The new fetchAccountAuctionStatus method follows the established patterns in this class. The gRPC call is properly typed, and the response is correctly transformed using the dedicated transformer method.

packages/sdk-ts/src/client/indexer/transformers/IndexerGrpcAuctionTransformer.ts (2)

14-14: LGTM!

The AccountAuctionStatus type is correctly imported alongside related auction types.


159-165: LGTM!

The transformer method follows the established pattern in this class, providing a clean transformation from the gRPC response to the domain model.

@ThomasRalee ThomasRalee merged commit be1c7ca into dev Jan 12, 2026
13 checks passed
@ThomasRalee ThomasRalee deleted the chore/auction-whitelist-new-endpoint branch January 12, 2026 16:50
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.

3 participants