0

I'm developing a web application (both frontend and backend) that executes swaps through the 1Inch APIs.

When executing a transaction, it looks like it's using the legacy gas. However, I would like to use EIP-1559 gas instead. Is it possible? Anybody can help me with this?

I'm using the swap call described here: https://docs.1inch.io/docs/aggregation-protocol/api/swagger

1 Answer 1

0

The developer is required to edit the transaction object returned by the API to include the parameters maxPriorityFeePerGas and maxFeePerGas and remove the gasPrice key from the object.

So instead of having

  "tx": {
    "from": "string",
    "to": "string",
    "data": "string",
    "value": "string",
    "gasPrice": "string",
    "gas": "string"
  }

you would have

  "tx": {
    "from": "string",
    "to": "string",
    "data": "string",
    "value": "string",
    "gas": "string",
    "maxPriorityFeePerGas": "string",
    "maxFeePerGas": "string",
  }

An example of sending an EIP-1559 transaction can be found here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.