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

feat: network fees from gas station #292

Merged
merged 4 commits into from
Nov 15, 2023
Merged

feat: network fees from gas station #292

merged 4 commits into from
Nov 15, 2023

Conversation

superical
Copy link
Contributor

@superical superical commented Nov 14, 2023

Summary

This PR adds the Polygon gas station for the calculation of fees. The implementation can be extended to other networks that wish to rely on a gas station for their gas fees too. This should also resolve an issue with the current CLI implementation when sending transactions on the Polygon mainnet.

Changes

  • Add gas station option in configuration
  • Fetch gas station for fees if available

@superical
Copy link
Contributor Author

@Open-Attestation/maintainers For review.

}
};

const safeParseUnits = (_value: number | string, decimals: number): BigNumber => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw in line 39 which states to Pad the fraction to 9 decimal places, would it be better to set the param decimals to a default value of 9?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking would it be better if we default the decimals in gasStation function instead? Like this: a16021b#diff-609663441672651e69555c0a1ae9ed0a7ec39717d6a59f38c05484b904018362R8-R9

Then the safeParseUnits (which I modified from ethersjs btw) can remain generic.

@superical superical merged commit 67c6a13 into master Nov 15, 2023
6 checks passed
Copy link
Contributor

🎉 This PR is included in version 2.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants