-
Notifications
You must be signed in to change notification settings - Fork 35
Update docs for Entropy v2 #748
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
nit: Prettier is failing in the build. Can we ensure it passes.
Fixed the prettier in c9a4feb, unrelated to this PR though. I like to see build passing. |
@@ -200,3 +161,20 @@ Check the [Current Fees](../current-fees) to find the current fee for each provi | |||
### Best Practices | |||
|
|||
Check out the [Best Practices](../best-practices) guide for tips to limit gas usage, or generate multiple random numbers in a single transaction. | |||
|
|||
<Callout type="info"> |
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.
I think the callout here needs some wordsmithing because you don't always need to select a provider. Probably something like "Some methods on Entropy require selecting..."
who participates in the generation process. Each provider is identified by an address and hosts | ||
a keeper service for fullfilling requests. | ||
|
||
The simplest way to choose a provider is to use the [default provider](../contract-addresses). |
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.
and the best way to get this is to call the getDefaultProvider()
method on the contract. It's much better to use the method than hardcode the address (what if we change the provider??)
|
||
The fees differs for every chain and can be found at the [Current Fees](../current-fees) page. \ | ||
You can use the onchain method [`getFee`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropy.sol#L101) to calculate the fee for the default provider and send it as the value of the `requestWithCallback` call: | ||
The fees differs for every chain and also varies over time depending on the chain's current gas price. |
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.
the fee differs
function requestRandomNumber(bytes32 userRandomNumber) external payable { | ||
uint256 fee = entropy.getFee(entropyProvider); | ||
function requestRandomNumber() external payable { | ||
uint256 fee = entropy.getFeeV2(); |
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.
Shouldn't we mention that getFeeV2()
will use DefaultProvider
?
Description
Update docs for Entropy v2
Type of Change
Checklist
pre-commit run --all-files
to check for linting errors