starknet.js icon indicating copy to clipboard operation
starknet.js copied to clipboard

To have a method : provider.getGasprice()

Open PhilippeR26 opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. Improvement : Rpc specification v0.5.0 will add :

 "l1_gas_price": {
                        "title": "L1 gas price",
                        "descritpion": "The price of l1 gas in the block",
                        "$ref": "#/components/schemas/RESOURCE_PRICE"
                    },

It could be helpful to DAPP devs to have an easy access to this value.

Describe the solution you'd like Something like this :

const GasPrice = provider.getGasPrice();

Describe alternatives you've considered "alternative facts" ?

Additional context To consider when PR for rpc 0.5.0 will be merged. I can easily propose a PR on this subject. Probably a subject that will have to be handled and to be customizable in starknet-devnet-rs. Same thing can be applied for these new rpc 0.5.0 points : provider.getStarknetSpecVersion() and provider.getStarknetVersion() These 3 methods could be specific of a RpcProvider v0.5.0 (see #760 )

PhilippeR26 avatar Sep 16 '23 15:09 PhilippeR26

If I understand correctly you are proposing a new RPC endpoint here? If so this should be an Issue on the RPC-Spec repo and we can close it here until the actual endpoint becomes part of the spec?

tabaktoni avatar Oct 27 '23 13:10 tabaktoni

No, it's just an helper to extract the gasPrice info from RPC get_block

PhilippeR26 avatar Oct 27 '23 13:10 PhilippeR26

If this is still open, I would like to try it out @tabaktoni

0xibs avatar Mar 05 '24 17:03 0xibs

@princeibs hi! any progress please?

ivpavici avatar Mar 28 '24 16:03 ivpavici

Hi @ivpavici, I got caught up with some ODH task last week. But I'll jump right right back and complete this task ASAP

0xibs avatar Mar 28 '24 18:03 0xibs

ok please try to do it as soon as possible, we have more and more users requesting this feature!

ivpavici avatar Mar 28 '24 18:03 ivpavici

@ivpavici

0xibs avatar Apr 02 '24 18:04 0xibs

:tada: This issue has been resolved in version 6.8.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Apr 23 '24 17:04 github-actions[bot]

:tada: This issue has been resolved in version 7.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Jul 03 '24 10:07 github-actions[bot]