Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Gas Price Calculation in wallets.js #203

Open
BrosG opened this issue May 24, 2023 · 0 comments
Open

Dynamic Gas Price Calculation in wallets.js #203

BrosG opened this issue May 24, 2023 · 0 comments
Assignees

Comments

@BrosG
Copy link
Contributor

BrosG commented May 24, 2023

In the file wallets.js, the gas price for Ethereum transactions in wrapNative and unWrapNative functions is calculated using await credentials.WEB3.eth.getGasPrice(). This retrieves the current average gas price from the Ethereum network, which might not be optimal for all users depending on their priorities between speed and cost.
Suggestion: Implement a feature that allows users to specify a gas price strategy (e.g., average, fast, safe low) or a specific gas price. This can be done by providing an optional parameter in the request, and if not provided, defaulting to the current method.
Code Example:
let gasPrice = req.body.gasPrice || await credentials.WEB3.eth.getGasPrice();

@hichri-louay hichri-louay self-assigned this Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants