TriportRPC

eth_maxPriorityFeePerGas

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

Returns a suggested priority fee (miner tip), in wei, for inclusion in the next block under EIP-1559.

Ethereumfree (10 RPS) · basic 20 · pro 100 · business 250

eth_maxPriorityFeePerGas returns a suggested priority fee — the tip paid directly to the validator on top of the protocol base fee — expressed in wei as a hex-encoded quantity. It is the EIP-1559 complement to eth_gasPrice: where eth_gasPrice gives a single legacy gas price, this method isolates just the tip portion so you can build a maxPriorityFeePerGas value for a type-2 (EIP-1559) transaction.

Use it when constructing a transaction's fee fields. A common pattern is to read the pending block's baseFeePerGas, add the value returned here as the tip, and set maxFeePerGas to roughly baseFee * 2 + tip to absorb base-fee swings between blocks.

The returned value is a node-side suggestion derived from recent block history, not a guarantee of inclusion. During periods of volatile demand the suggestion can change block-to-block, so re-query it close to the moment you sign and broadcast.

Parameters

This method takes no parameters. Send an empty params array.

_(none)_optional
No parameters are accepted.

Response

0x3b9aca00 = 1,000,000,000 wei = 1 gwei.

jsonrpcstring
JSON-RPC version, always "2.0".
idnumber | string
Echoes the request id.
resultstring
Suggested priority fee in wei, hex-encoded (0x-prefixed quantity).

Errors

Errors follow the standard JSON-RPC error envelope. See Errors for the full structure and handling guidance.

CodeMeaningWhen it happens
-32001trial_expiredThe API key's trial period has ended; upgrade to a paid tier to continue.
-32003rate_limitedThe tier RPS limit (10 on free) was exceeded; back off and retry.

Examples

JavaScript (fetch)

const res = await fetch("https://api.triport.io/v1/eth", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "eth_maxPriorityFeePerGas",
    params: [],
  }),
});


const { result } = await res.json();
const tipWei = BigInt(result);
console.log(`suggested tip: ${tipWei} wei (${tipWei / 1_000_000_000n} gwei)`);

TypeScript SDK (@triport/sdk)

import { Triport } from "@triport/sdk";


const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });


const tipHex = await triport.eth.maxPriorityFeePerGas();
const tipWei = BigInt(tipHex);
console.log(`suggested tip: ${tipWei} wei`);

Python (triport-sdk)

import os
from triport import Triport


triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])


tip_hex = triport.eth.max_priority_fee_per_gas()
tip_wei = int(tip_hex, 16)
print(f"suggested tip: {tip_wei} wei ({tip_wei // 10**9} gwei)")

Notes

  • Returns only the tip, not the total gas price. To estimate a full EIP-1559 maxFeePerGas, combine this value with the pending block's baseFeePerGas (available from eth_getBlockByNumber with "pending").
  • For a legacy single-value gas price, use eth_gasPrice.
  • The value is hex-encoded wei. Parse it with BigInt(...) in JS/TS or int(x, 16) in Python before doing arithmetic.
  • This is a read method available at the free tier; no scope is required.