Skip to content

enhancement: estimated cost of gas for transaction #64

Open

Description

@perryascott

The user should be able to create a new Transaction object and estimate how much gas it will cost to execute the transaction.

Ideally, less information is required to retrieve this information. I'm ill-informed on the variables that go into gas cost. If it's possible, maybe the user only needs to provide the following to a function:

  • number of orders
  • whether it's an offer/cancel
  • pair

To receive an estimate of the gas cost.

Activity

  1. adamamsmith commented on Jul 17, 2023

    @adamamsmith
    Contributor

    Hi @perryascott

    We pushed an update to the repo recently whereby if gas is not passed in the Transaction object then when placing the transaction the gas cost is automatically estimated.

    This has the additional benefit of verifying that the transaction would occur successfully on chain.

    The update in question is here: #56

    As such if you are currently passing gas values to transactions you should be able to remove this.

    I'm not sure but this may solve what you are talking about above.

    However I can also look at exposing the estimate_gas call on a transaction. However, I would need to look into how to do this. Let me know if you want me to look into this

  2. self-assigned this
    on Jul 17, 2023
  3. denverbaumgartner commented on Jul 17, 2023

    @denverbaumgartner
    Contributor

    Hi @perryascott

    We pushed an update to the repo recently whereby if gas is not passed in the Transaction object then when placing the transaction the gas cost is automatically estimated.

    This has the additional benefit of verifying that the transaction would occur successfully on chain.

    The update in question is here: #56

    As such if you are currently passing gas values to transactions you should be able to remove this.

    I'm not sure but this may solve what you are talking about above.

    However I can also look at exposing the estimate_gas call on a transaction. However, I would need to look into how to do this. Let me know if you want me to look into this

    @adamamsmith from my understanding, the goal here would be to expose the estimated gas cost to the user before the transaction is actually executed. that way, they can build more responsive systems that are more gas conscious, correct me if i am wrong @perryascott. today, we ship the transaction before giving the user the chance to check the estimated gas cost.

  4. perryascott commented on Jul 19, 2023

    @perryascott
    Author

    Hey @adamamsmith,

    Thanks for the well thought out answer. That's exactly what I need. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions