Go-Ethereum – How to Specify Priority Fee and Max Fee per Gas in Geth’s JSON-RPC API?

eip-1559go-ethereumjson-rpcsendtransactiontransactions

A legacy transaction can be created with the following parameters through the eth_sendTransaction API:

params: [{
  "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
  "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
  "gas": "0x76c0",
  "gasPrice": "0x9184e72a000",
  "value": "0x9184e72a",
  "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
}]

But what parameters are expected for an EIP-1559, specifically for the priority fee and max fee per gas?

Best Answer

I think you can either use max_gas_fee or maxGasFee.

The following works for me:

"params": [{
  "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
  "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
  "gas_limit": "0x76c0",
  "priority_fee": "0x0",
  "max_gas_fee": "0x9184e72a000",
  "value": "0x9184e72a",
  "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
}]
Related Topic