TriportRPC

eth_protocolVersion

POSThttps://api.triport.io/v1/polygon

Returns the current EVM protocol version of the Polygon node as a hex string constant.

Polygonpolygon_read_rpcfree — 15 rps · basic — 20 rps · pro — 100 rps · business — 250 rps

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.

optional
This method accepts no parameters.

Response

Response fields

FieldTypeDescription
jsonrpcstringJSON-RPC version, always "2.0".
idnumber | stringEchoes the id from the request.
resultstringEVM 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.

CodeMeaningWhen it happens
-32001trial_expiredThe trial window for the API key has ended.
-32002tier_insufficientThe key's tier is below what this method requires.
-32003rate_limitedThe tier's RPS limit (with burst) was exceeded.
-32004subscription_expiredThe key's paid subscription has lapsed.
-32005unauthorizedMissing or invalid Authorization bearer token.
-32601method_unknownMethod 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 (0x89 for Polygon mainnet) and net_version ("137" as a decimal string) are the better choices for chain-identity checks.
  • Decoding: parse with parseInt(result, 16) in JS or int(result, 16) in Python.