eth_protocolVersion
https://api.triport.io/v1/polygonReturns the current EVM protocol version of the Polygon node as a hex string constant.
eth_protocolVersion returns the protocol version advertised by the Polygon
execution layer. On Polygon mainnet (chain ID 0x89 / 137) the underlying
client is Bor, which reports a small hex constant — typically 0x42 (66) or
0x41 (65).
The value is effectively static: it only changes across a node software upgrade, so clients may cache it indefinitely after the first successful response. It is most often used as a lightweight capability/identity check during connection setup, not on a hot path.
This is a free-tier read method (polygon_read_rpc) and takes no parameters.
One quirk worth knowing: this method is noticeably slower than its sibling
network-state reads (eth_chainId, net_version) — the backend recomputes the
value rather than serving it from cache — so prefer to call it once and reuse
the result.
Parameters
eth_protocolVersion takes no parameters. Pass an empty params array.
——optionalResponse
Response fields
| Field | Type | Description |
|---|---|---|
jsonrpc | string | JSON-RPC version, always "2.0". |
id | number | string | Echoes the id from the request. |
result | string | EVM protocol version as a hex-encoded integer (e.g. 0x42). |
Errors
Errors use the standard JSON-RPC envelope; see errors.md for the full shape and handling guidance.
| Code | Meaning | When it happens |
|---|---|---|
-32001 | trial_expired | The trial window for the API key has ended. |
-32002 | tier_insufficient | The key's tier is below what this method requires. |
-32003 | rate_limited | The tier's RPS limit (with burst) was exceeded. |
-32004 | subscription_expired | The key's paid subscription has lapsed. |
-32005 | unauthorized | Missing or invalid Authorization bearer token. |
-32601 | method_unknown | Method not found / not enabled for this key. |
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/polygon", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "eth_protocolVersion",
params: [],
}),
});
const { result } = await res.json();
console.log(result); // "0x42"TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const version = await client.polygon.rpc<string>("eth_protocolVersion");
console.log(version); // "0x42"Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
version = client.polygon.rpc("eth_protocolVersion")
print(version) # "0x42"Notes
- Cache indefinitely. The value only changes on a node upgrade. Fetch it once per connection and reuse it; avoid calling it in a loop.
- Slower than peers. Expect higher tail latency (p95) than other network-state reads — the backend does not serve this from cache.
- Related methods:
eth_chainId(0x89for Polygon mainnet) andnet_version("137"as a decimal string) are the better choices for chain-identity checks. - Decoding: parse with
parseInt(result, 16)in JS orint(result, 16)in Python.