Skip to content

feat/update-tc-abacus-protos#635

Closed
0xA1337 wants to merge 2 commits intodevfrom
feat/update-tc-abacus-protos
Closed

feat/update-tc-abacus-protos#635
0xA1337 wants to merge 2 commits intodevfrom
feat/update-tc-abacus-protos

Conversation

@0xA1337
Copy link
Copy Markdown
Contributor

@0xA1337 0xA1337 commented Apr 6, 2026

Summary by CodeRabbit

  • New Features

    • Referrer program: check eligibility, create referrer codes, and list/manage codes with pagination.
    • Epoch data extended to include points distribution timestamp.
  • Chores

    • Updated dependency versions and build externals (minor package updates and bundling config).

@0xA1337 0xA1337 self-assigned this Apr 6, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 357eb195-4c3f-40b6-88da-593e99389d06

📥 Commits

Reviewing files that changed from the base of the PR and between 2cb1332 and a800623.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • packages/utils/tsdown.config.ts

📝 Walkthrough

Walkthrough

Updated tc-abacus protobuf dependency and added referrer management: three new TcAbacusGrpcApi methods, corresponding gRPC->SDK transformers, and new TypeScript referrer-related types; also extended CurrentEpochResponse and marked bignumber.js as external in tsdown config.

Changes

Cohort / File(s) Summary
Dependency Update
packages/sdk-ts/package.json
Bumped @injectivelabs/tc-abacus-proto-ts-v2 from 1.18.2 to 1.18.4.
API methods
packages/sdk-ts/src/client/tcAbacus/grpc/TcAbacusGrpcApi.ts
Added three public async methods: fetchReferrerEligibility(address), createReferrerCode(address, code), and fetchReferrerCodes(address, cursor?, limit?) that build gRPC requests and apply transformers.
Transformers & Types
packages/sdk-ts/src/client/tcAbacus/grpc/transformers/index.ts, packages/sdk-ts/src/client/tcAbacus/types/tcAbacus.ts
Added transformer functions grpcReferrerEligibilityToReferrerEligibility, grpcReferrerCodeToReferrerCode, grpcListReferrerCodesToListReferrerCodes; added types ReferrerEligibilityResponse, ReferrerCode, ListReferrerCodesResponse; extended CurrentEpochResponse with epochPointsDistributedAt.
Build config
packages/utils/tsdown.config.ts
Added 'bignumber.js' to the external list so it is not bundled.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Api as TcAbacusGrpcApi
  participant GRPC as TcAbacus gRPC Service
  participant Tx as Transformer

  Client->>Api: fetchReferrerCodes(address, cursor?, limit?)
  Api->>GRPC: ListReferrerCodesRequest{address, cursor, limit}
  GRPC-->>Api: ListReferrerCodesResponse
  Api->>Tx: grpcListReferrerCodesToListReferrerCodes(response)
  Tx-->>Api: ListReferrerCodesResponse (SDK types)
  Api-->>Client: ListReferrerCodesResponse

  Client->>Api: createReferrerCode(address, code)
  Api->>GRPC: CreateReferrerCodeRequest{address, code}
  GRPC-->>Api: CreateReferrerCodeResponse / OK
  Api-->>Client: void

  Client->>Api: fetchReferrerEligibility(address)
  Api->>GRPC: GetReferrerElegibilityRequest{address}
  GRPC-->>Api: GetReferrerElegibilityResponse
  Api->>Tx: grpcReferrerEligibilityToReferrerEligibility(response)
  Tx-->>Api: ReferrerEligibilityResponse
  Api-->>Client: ReferrerEligibilityResponse
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through code with eager paws,
New referrer paths and protobufs I saw,
Three methods planted, transformers sing,
Types aligned — a joyous spring,
The SDK hops onward, bright and raw.

🚥 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 accurately summarizes the main changes: updating tc-abacus proto dependencies and adding referrer-related API methods based on the new proto definitions.
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
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/update-tc-abacus-protos
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/update-tc-abacus-protos

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.

@socket-security
Copy link
Copy Markdown

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedglob@​11.0.3998510050100
Addedprotoc@​32.1.0951006895100
Updated@​injectivelabs/​tc-abacus-proto-ts-v2@​1.18.2 ⏵ 1.18.474 -510074 +195 +1100
Added@​protobuf-ts/​plugin@​2.11.11001008583100
Addedtsup@​8.5.0981009483100
Addedgoogle-protobuf@​4.0.010010010084100
Addedgrpc-web@​1.5.010010010085100

View full report

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/tcAbacus/grpc/TcAbacusGrpcApi.ts (1)

110-120: Return the response from createReferrerCode to maintain consistency with other API methods.

This method awaits the gRPC response but doesn't return it, deviating from the pattern used by all other methods in this class (e.g., fetchCurrentEpoch, fetchAccountStats, fetchReferrerCodes), which store and return transformed responses. If CreateReferrerCodeResponse contains meaningful data, it should be captured and returned to the caller.

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

In `@packages/sdk-ts/src/client/tcAbacus/grpc/TcAbacusGrpcApi.ts` around lines 110
- 120, The createReferrerCode method currently awaits executeGrpcCall but
doesn't return its result; modify createReferrerCode to capture the response
from executeGrpcCall (which returns a TcAbacusPb.CreateReferrerCodeResponse) and
return it to the caller to match the pattern used by other methods (e.g.,
fetchCurrentEpoch, fetchAccountStats, fetchReferrerCodes); locate the method
named createReferrerCode, the request creation using
TcAbacusPb.CreateReferrerCodeRequest, and the call to this.executeGrpcCall to
store its result and return that value (or a transformed version if other
methods map responses).
🤖 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/tcAbacus/grpc/TcAbacusGrpcApi.ts`:
- Around line 110-120: The createReferrerCode method currently awaits
executeGrpcCall but doesn't return its result; modify createReferrerCode to
capture the response from executeGrpcCall (which returns a
TcAbacusPb.CreateReferrerCodeResponse) and return it to the caller to match the
pattern used by other methods (e.g., fetchCurrentEpoch, fetchAccountStats,
fetchReferrerCodes); locate the method named createReferrerCode, the request
creation using TcAbacusPb.CreateReferrerCodeRequest, and the call to
this.executeGrpcCall to store its result and return that value (or a transformed
version if other methods map responses).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 153db388-3173-4bbc-8689-4d3e477a2791

📥 Commits

Reviewing files that changed from the base of the PR and between 104c85d and 2cb1332.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • packages/sdk-ts/package.json
  • packages/sdk-ts/src/client/tcAbacus/grpc/TcAbacusGrpcApi.ts
  • packages/sdk-ts/src/client/tcAbacus/grpc/transformers/index.ts
  • packages/sdk-ts/src/client/tcAbacus/types/tcAbacus.ts

@0xA1337 0xA1337 closed this Apr 7, 2026
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.

4 participants