feat: consume quicknode-sdk 0.6 for account info and API credits#50
Merged
johnpmitsch merged 1 commit intoJul 7, 2026
Merged
Conversation
Adds two read-only surfaces built on the new admin methods in SDK 0.6: - `qn chain credits <CHAIN>` shows per-method API credit costs for a chain (METHOD/CREDITS table). An unknown slug surfaces as a clean "not found" (exit 2). - `qn auth whoami` now shows the account id, name, and plan. Its liveness probe moves from list_chains to account_info, so one call both validates the key and returns the identity to display; `login` uses the same probe. A failed probe still fails whoami (exit 2). Also fixes `--base-url` being ignored by the auth commands: they built the SDK outside Ctx, so the flag never reached them. Extracts the base resolution into sdk_config_with_base / apply_base_url in context.rs, shared by Ctx::from_global, whoami, and login. This is what makes the auth commands testable against a mock server. Updates the embedded agent guide (context.md) and README to match. Adds 4 integration tests (chain credits happy/404, whoami ok/401). Refs DX-6093, DX-6100
Zlerp
approved these changes
Jul 7, 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.
Summary
qn chain credits <CHAIN>— a per-method API credit cost table (METHOD/CREDITS) for a chain. Unknown slug gives a clean "not found" (exit 2).qn auth whoaminow shows account id, name, and plan. Its liveness probe moves fromlist_chainstoaccount_info, so one call both validates the key and returns the identity;loginuses the same probe.--base-urlbeing ignored by the auth commands (they built the SDK outsideCtx). Base resolution now lives insdk_config_with_base/apply_base_url, shared byCtx::from_global,whoami, andlogin— which is what makes the auth commands testable against a mock server.quicknode-sdkto 0.6; updates the embedded agent guide and README.Refs DX-6093, DX-6100
Test plan
cargo test— 122 lib + 20 integration pass, incl. 4 new (chain_credits,chain_credits_unknown_slug_404,auth_whoami_shows_account,auth_whoami_unauthorized_fails)cargo clippy --all-targets -- -D warningscleancargo fmt --checkcleancargo build --releaseno warningsqn auth whoami(table + json) shows account/plan;qn chain credits ethereumrenders the table; unknown slug exits 2