chore(admin): move admin reads to gRPC and drop the JSON-RPC client - #96
Open
11felix wants to merge 1 commit into
Open
chore(admin): move admin reads to gRPC and drop the JSON-RPC client#9611felix wants to merge 1 commit into
11felix wants to merge 1 commit into
Conversation
11felix
requested review from
Zorag44 and
rishikesh-chavan
and removed request for
rishikesh-chavan
August 4, 2026 12:44
Zorag44
approved these changes
Aug 4, 2026
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.
Removes the JSON-RPC client from this SDK. Four admin helpers were the only remaining users; they now read over gRPC, so
pythSuiClientand the@mysten/sui/jsonRpcdependency are gone.Motivation: JSON-RPC is deprecated on Sui public fullnodes, and keeping it meant every consumer had to configure a second endpoint for these four functions alone.
Migrated
getRebalanceCapgetOwnedObjects({filter: {StructType}})core.listOwnedObjects({owner, type})addExternalRewardsWalLockedTxbgetOwnedObjects({filter: {MoveModule}})+ client-side type filtercore.listOwnedObjectson the exactAdminCaptypegetWithdrawRequestsAndUnsuppliedAmountgetObject({showContent})core.getObject({include: {json}})getWalLockedRewardInfogetObject({showContent})core.getObject({include: {json}})The two
getObjectsites needed re-parsing, not just a transport swap: JSON-RPC wraps nested Move structs as{type, fields: {...}}while gRPC renders them flat. Scalars are identical.Verified against mainnet — both parsers run side by side on the live objects, output compared:
The AlphaVault pool had 4 real withdraw requests at the time, so the nested
VecMappath (contents[].key/contents[].value.leftover_amount) is exercised rather than short-circuiting on an empty list — worth stating because the failure mode here is silent: the old?.fields?.contents ?? []against a flat payload yields[]and renders an empty screen with no error.getWalLockedRewardInfoalready had??fallbacks that tolerated both shapes, so it was correct either way; it is now written for the one shape it uses.Also:
grpcUrlis plumbed throughAlphaFiSDKConfig→StrategyContext→Blockchain, so consumers can point object reads at their own endpoint instead of the built-in public-fullnode default. It was previously reachable only by mutatingblockchain.suiGrpcClientafter construction, and not at all throughAlphaFiSDK, whosestrategyContextis private.graphqlUrlis untouched — rpcpool does not serve the Sui GraphQL schema, sogqlClientcannot move with the rest.Breaking:
Blockchain.pythSuiClientandBlockchainOptions.pythSuiClientare removed. alphafi-admin is the only consumer I found; its matching change is in alphafi-admin#33.tsc --noEmit,npm run buildand the pre-commit hooks are clean.npm testreports no tests configured.