Skip to content

feat: consume quicknode-sdk 0.6 for account info and API credits#50

Merged
johnpmitsch merged 1 commit into
mainfrom
dx-6093-dx-6100-cli-sdk-0.6-account-info-api-credits
Jul 7, 2026
Merged

feat: consume quicknode-sdk 0.6 for account info and API credits#50
johnpmitsch merged 1 commit into
mainfrom
dx-6093-dx-6100-cli-sdk-0.6-account-info-api-credits

Conversation

@johnpmitsch

Copy link
Copy Markdown
Collaborator

Summary

  • Adds 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 whoami now shows 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; login uses the same probe.
  • Fixes --base-url being ignored by the auth commands (they built the SDK outside Ctx). Base resolution now lives in sdk_config_with_base/apply_base_url, shared by Ctx::from_global, whoami, and login — which is what makes the auth commands testable against a mock server.
  • Bumps quicknode-sdk to 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 warnings clean
  • cargo fmt --check clean
  • cargo build --release no warnings
  • Drove the release binary against a local mock: qn auth whoami (table + json) shows account/plan; qn chain credits ethereum renders the table; unknown slug exits 2

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
@johnpmitsch johnpmitsch merged commit 3738c84 into main Jul 7, 2026
13 checks passed
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.

2 participants