Use gRPC client in ts sdk docs and examples (BFP-4993) - #295
Merged
NidaKarim merged 1 commit intoAug 31, 2026
Merged
Conversation
Sui's JSON-RPC interface is deprecated. The SDK internals were already transport-agnostic (BluefinProSdk takes a ClientWithCoreApi, and library-sui v3 only calls .core methods), but the README, example, and batch-claim guide all told users to construct a SuiJsonRpcClient. Switch those to SuiGrpcClient, and drop the misleading SuiClient type alias from IBluefinSigner in favour of ClientWithCoreApi -- it resolves to the same type, so this is not a breaking change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
NidaKarim
requested review from
a team,
alawrenc and
lucasfronza
as code owners
August 29, 2026 17:14
kevin-ip
approved these changes
Aug 31, 2026
There was a problem hiding this comment.
Pull request overview
Updates the TypeScript SDK’s public-facing docs/examples to use Sui’s gRPC client (instead of the deprecated JSON-RPC client) and aligns exposed signer/client typings to the transport-agnostic Core API used by the SDK internals.
Changes:
- Swaps
SuiJsonRpcClient→SuiGrpcClientin the README, example, and batch-claim rewards guide. - Updates
IBluefinSigner/BluefinRequestSignermethod parameter types toClientWithCoreApi. - Removes an unnecessary
as anycast when creatingRewardsDistributorInteractor.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ts/sdk/src/sdk.ts | Removes an any cast when passing the Sui client into the rewards interactor. |
| ts/sdk/src/request-signer.ts | Replaces SuiClient typing with ClientWithCoreApi to reflect transport-agnostic usage. |
| ts/sdk/README.md | Updates quickstart snippet to construct a SuiGrpcClient and adds a deprecation note for JSON-RPC. |
| ts/sdk/example.ts | Updates the runnable example to use SuiGrpcClient. |
| ts/sdk/docs/batch-claim-rewards-guide.md | Updates guide snippets to use SuiGrpcClient. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+24
to
25
| import { SuiGrpcClient } from "@mysten/sui/grpc"; | ||
| import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519"; |
NidaKarim
deleted the
nida/bfp-4993-typescript-sdk-is-using-deprecated-json-rpc
branch
August 31, 2026 16:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #293 · BFP-4993
Context
The reported issue was half right. The SDK's runtime code was already transport-agnostic —
BluefinProSdktakes aClientWithCoreApi, andlibrary-suiv3 only calls.coremethods (executeTransaction,simulateTransaction,listCoins). There were no deprecated JSON-RPC calls in the SDK internals.What was actually wrong is what users see: every doc and the example told them to construct a
SuiJsonRpcClientagainst the deprecated endpoints.Changes
SuiJsonRpcClient→SuiGrpcClientinREADME.md,example.ts, anddocs/batch-claim-rewards-guide.md, plus a README note that JSON-RPC is deprecated and swapping the client is the only migration step users need.request-signer.tstyped its client params asSuiClientimported fromlibrary-sui. That is just an alias forClientWithCoreApi, so it was misleading rather than broken, but it made the publicIBluefinSignerinterface look JSON-RPC-bound. Now importsClientWithCoreApifrom@mysten/sui/clientdirectly. Structurally identical → not a breaking change.as anyonthis.suiClientatsdk.ts:905—RewardsDistributorInteractoralready acceptsClientWithCoreApi, so the cast was hiding nothing.No new dependency: the gRPC transport (
@protobuf-ts/grpcweb-transport) ships inside@mysten/sui, and the./grpcexport has existed since 1.42, so the existing^2.13.0peer range already covers it.Verification
yarn build:typesandyarn build:example(the two CI jobs) both pass.Beyond typechecking, I ran a live gRPC call against testnet to confirm the migration works at runtime and not just at the type level:
core.listCoinsis the exact call the deposit path makes viaCoinUtils.getCoins.Note on versioning
No version bump here — #BFP-4644 already takes
2.0.0→2.1.0and bumping in both places would collide. This change has no runtime behavior change, so it can fold into whichever release tag goes out next.🤖 Generated with Claude Code