Add grpcToken option for authenticated gRPC endpoints - #99
Conversation
|
operate.md review — head of Small, well-shaped change:
Non-blocking notes
Sequencing (the reason this one matters first)
CI green (build / lint / test). Not a contract PR. No open threads. Approving. |
jangid
left a comment
There was a problem hiding this comment.
operate.md: clean — CI green (build/lint/test), change is additive and optional at every layer, x-token agrees with the deployment contract in alphafi-aws#27. Non-blocking note only: the token now lives inside a plain options object, so redact grpcToken if construction ever gets debug logging. Sequencing: this is the unblocker — alphafi-admin#34 fails typecheck specifically on the surface this PR adds, so it should merge ahead of the two frontends. Approvals: 1/2 — needs 1 more before merge.
|
operate.md review — head ✅ Blocking finding resolvedRe-derived against the current diff rather than taken on the reply:
The live A/B against BlockPI ( 🟢 Non-blocking — not reasons to withhold approval
CI green (build / lint / test). Not a contract PR. Approving. Standing note: the earlier approval on this PR was dismissed by the push (the repo's ruleset sets Prior findings on this PR are resolved; nothing from either earlier pass remains open. |
|
@Zorag44 Confirmed and fixed in b5c9ae5. Reproduced your finding exactly before changing anything: read the installed The fix is your suggested shape: explicit Same fix landed across the whole scope you flagged: alphalend-sdk-js#176 (+ your devnet-narrowing fix) and #174 (coinHelpers), alphafi-admin#34, alphafi-fe#334 — verified by sweep that no client-level |
Zorag44
left a comment
There was a problem hiding this comment.
operate.md: clean — blocking gRPC metadata finding resolved (explicit transport at src/models/blockchain.ts:43-56, dependency declared, and the new test confirmed running in CI). Non-blocking notes in the summary comment. Approvals: 1/2 — needs 1 more before merge.
jangid
left a comment
There was a problem hiding this comment.
operate.md: clean — CI green (lint / test / build), head b5c9ae5. Not a contract PR. Zero review threads open.
My earlier approval on this PR was dismissed by the push that fixed the meta-drop finding, so this is a re-approval against the new head, re-derived rather than reinstated. Verified at b5c9ae5: src/models/blockchain.ts builds an explicit GrpcWebFetchTransport with baseUrl on the transport and a conditional meta, @protobuf-ts/grpcweb-transport is declared at ^2.11.1 with a single hoisted lockfile resolution, and src/__tests__/blockchain-grpc-transport.test.ts pins defaultOptions.meta with and without a token. Nothing new to raise.
This is the unblocker for two red consumers. Confirmed against the current failing runs rather than assumed: alphafi-admin#34 typecheck fails with TS2353: 'grpcToken' does not exist in type 'AlphaFiSDKConfig' (plus two arity errors), and alphafi-fe#334 build fails with the same TS2353 in networkUtils.ts. Both resolve this SDK as a file:../ sibling at main, so both stay red until this merges.
One 🟢 carried, non-blocking and already noted on the PR: blockchain.ts still narrows options.network to testnet | mainnet, which the sibling alphalend-sdk-js#176 just fixed and documented on the identical line. The two SDKs now disagree on devnet — cheap follow-up, not a reason to hold this.
Approvals: 2/2 — merge is a maintainer call.
Adds
grpcTokentoAlphaFiSDKConfig,StrategyContext(5th param), andBlockchainOptions, attached asx-tokengRPC metadata on the SDK'sSuiGrpcClient. Needed so alphafi-fe/alphafi-admin can point the SDK's gRPC reads at BlockPI, which authenticates by key (their keys are domain-whitelisted). No behavior change when the option is omitted.