-
Notifications
You must be signed in to change notification settings - Fork 805
feat: fees and tip helpers #1434
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
Conversation
src/utils/stark/index.ts
Outdated
@@ -229,6 +235,18 @@ export function estimateFeeToBounds( | |||
return estimateFeeToBoundsRPC07(estimate, overhead as ResourceBoundsOverheadRPC07); // TODO: remove as | |||
} | |||
|
|||
export function setResourceBounds( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now can use toOverheadResourceBounds
As discussed, only item 3 has been kept. |
src/provider/rpc.ts
Outdated
public async getGasPrices( | ||
blockIdentifier: BlockIdentifier = this.channel.blockIdentifier | ||
): Promise<GasPrices> { | ||
if (this.channel instanceof RPC09.RpcChannel) return this.channel.getGasPrices(blockIdentifier); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why dont add implementation also to RPC 0.8 and include it into Provider ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🎉 This PR is included in version 8.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Motivation and Resolution
Usage related changes
Based on what is available in Ethereum SDKs (viem, ethers, web3), some new helpers are added:
These functions are available only for Rpc 0.8 onwards.
1. To get blockchain statistics of the use of Tip:
Note
default values are highly negociable.
2. To customize easily the margins of a ressourceBounds:
3. To get the gas prices:
Development related changes
getGasPrices()
andgetTipStatsFromBlocks()
are located in RPC08.RpcChannel.setResourceBounds()
is located in stark/rpc08.tip.type.ts
file, inprovider/types
.Important
PR to merge in the RPC 0.9 branch.
Note
Checklist: