setEIP1559FeeDetails method

void setEIP1559FeeDetails(
  1. BigInt maxFeePerGas,
  2. BigInt maxPriorityFeePerGas
)

Sets the fee details for an EIP-1559 Ethereum transaction.

Throws a MessageException if the transaction type is not EIP-1559.

Implementation

void setEIP1559FeeDetails(BigInt maxFeePerGas, BigInt maxPriorityFeePerGas) {
  if (_type != ETHTransactionType.eip1559) {
    throw const MessageException(
        "Do not specify a maxPriorityFeePerGas and maxFeePerGas for legacy transactions. use setGasPrice");
  }
  _maxFeePerGas = maxFeePerGas;
  _maxPriorityFeePerGas = maxPriorityFeePerGas;
  _replaceTr();
}