Visitar URL original
[CON-906] Correct the CLI and SDK references against the live product by 0xsergen · Pull Request #12 · quicknode/agent-plugins · GitHub
Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[CON-906] Close the three free RPC Test: gaps, and one wrong claim
These were the three remaining assertable and free examples in
cli-reference.md. All three now carry a Test: line. Coverage goes from
5 of 33 runnable blocks to 8.

Two live findings, both response-shape defects that fail silently.

`qn rpc call -o json` prints the JSON-RPC result unwrapped. There is no
jsonrpc, id, or result field. Code that reads `.result` on it gets
undefined.

`qn rpc list-networks -o json` returns `{"networks": [...]}`. That is a
sixth distinct CLI response shape and it is not the `data` envelope the
other list commands use, so `.data` is undefined.

Also corrects a claim this branch added in b4640c0. The piped-output
default is not universal. `qn rpc list-networks` prints a bare
newline-separated list even when piped, with no JSON, so a script that
pipes it and parses JSON fails. Verified: endpoint list, chain list and
kv set list all print `{` when piped; rpc list-networks prints `0`. The
Test: line now names all four commands and the exception.

The asserted network count is dated in the line and marked as growing,
because it drifts. The block-object assertion names the key range and
the missing envelope rather than a field count, for the same reason.

Verified live against account 464482. All calls read-only and free. No
resource created.
  • Loading branch information
0xsergen committed Sep 4, 2026
commit 5cdecbf9efcde6175ebf315bbeaf981b35d61cf3
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ Set output with `--format` or `-o`.

With `--format` unset the CLI reads `[output] format` from the config file, then defaults to `table` on a TTY and `json` when stdout is piped. `--wide`/`-w` affects only `table` and `md`.

**The piped default is not universal.** `qn rpc list-networks` prints a bare
newline-separated list of slugs even when piped, with no JSON. A script that
pipes it and parses JSON fails. Pass `-o json` explicitly for that command.

```bash
qn endpoint list --format json
qn usage summary --from 7d -o yaml
qn endpoint list --wide
```

**Test:** `qn endpoint list | head -c 1` — prints `{`. Piped output defaults to `json`, not `table`, so a script never has to pass `-o json`
**Test:** `qn endpoint list | head -c 1`, `qn chain list | head -c 1`, and `qn kv set list | head -c 1` all print `{`; `qn rpc list-networks | head -c 1` prints `0`, the first character of `0g-galileo`. The piped default holds for three of these four commands and not for the fourth

## Exit Codes

Expand Down Expand Up @@ -122,6 +126,11 @@ qn auth login
qn rpc call eth_getBlockByNumber '["latest", false]' --network base-mainnet
```

With `-o json` the CLI prints the JSON-RPC `result` **unwrapped**. There is no
`jsonrpc`, `id`, or `result` field to read past.

**Test:** `base-mainnet` · block `latest` — `-o json` prints the block object itself at the top level, keyed `baseFeePerGas` through `withdrawalsRoot`, with no `jsonrpc`, `id`, or `result` wrapper; `transactions` holds hashes, not objects, because the second parameter is `false`

Params: positional (JSON array), by name (JSON object), from a file, or from stdin.

```bash
Expand All @@ -142,6 +151,8 @@ qn rpc list-networks
qn rpc list-networks -o json
```

**Test:** `qn rpc list-networks` — one network key per line, sorted, `0g-galileo` first and `zora-mainnet` last (132 keys on 2026-09-04; the count grows, so do not gate on it). With `-o json` the payload is `{"networks": [...]}`. It is **not** the `data` envelope the other list commands use, so `.data` is `undefined`

`--endpoint-url <URL>` sends the call to a self-authenticating URL instead of the Tooling Access endpoint, overriding `[rpc] endpoint_url` in `~/.config/qn/config.toml`. Mutually exclusive with `--network`.

First-run `qn rpc call` prompts `[y/N]` to enable Tooling Access if it isn't provisioned yet. Pass `-y`/`--yes` to auto-confirm non-interactively.
Expand All @@ -150,6 +161,8 @@ First-run `qn rpc call` prompts `[y/N]` to enable Tooling Access if it isn't pro
qn rpc call eth_blockNumber --network base-mainnet -y
```

**Test:** `base-mainnet` · block `latest` — returns a bare JSON string such as `"0x308471d"`, not an object. `-y` exits `0` and prompts nothing when Tooling Access is already enabled, so it is safe to pass unconditionally in a script

### Paid RPC (x402 and MPP)

Requires CLI v0.6.0+. `qn rpc call` can pay for a call with stablecoins through the x402 or MPP gateway instead of using the account's API key. This lane requires no Quicknode account, API key, login, Tooling Access, or provisioned endpoint — only a funded local wallet.
Expand Down