Update docs for Entropy v2#748
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
nidhi-singh02
left a comment
There was a problem hiding this comment.
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. |
|
|
||
| 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.
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.
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. |
| 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.
Shouldn't we mention that getFeeV2() will use DefaultProvider?
Description
Update docs for Entropy v2
Type of Change
Checklist
pre-commit run --all-filesto check for linting errors