@pythnetwork/entropy-sdk-solidity
Advanced tools
Comparing version 0.1.1 to 1.0.0
{ | ||
"name": "@pythnetwork/entropy-sdk-solidity", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"description": "Generate secure random numbers with Pyth Entropy", | ||
@@ -32,3 +32,3 @@ "repository": { | ||
}, | ||
"gitHead": "8c35091831b946a0c666345d29aa8506b06cb99c" | ||
"gitHead": "1be8a02b94d2a09e5284da72e57eb0eb3943d3ae" | ||
} |
@@ -27,2 +27,3 @@ # Pyth Entropy Solidity SDK | ||
| eos-evm-testnet | 0xD42c7a708E74AD19401D907a14146F006c851Ee3 | 0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344 | | ||
| arbitrum-goerli | 0xd9eAcfFB8e80b7193042499485EF8369b08E85B6 | 0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344 | | ||
``` | ||
@@ -52,6 +53,9 @@ | ||
Invoke the `request` method of the `IEntropy` contract: | ||
Invoke the `request` method of the `IEntropy` contract. | ||
The `request` method requires paying a fee in native gas tokens which is configured per-provider. | ||
Use the `getFee` method to calculate the fee and send it as the value of the `request` call: | ||
```solidity | ||
uint64 sequenceNumber = entropy.request(provider, commitment, true) | ||
uint fee = entropy.getFee(provider); | ||
uint64 sequenceNumber = entropy.request{value: fee}(provider, commitment, true); | ||
``` | ||
@@ -89,1 +93,6 @@ | ||
This method will combine the user and provider's random numbers, along with the blockhash, to construct the final secure random number. | ||
## Example Application | ||
The [Coin Flip](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ethereum/examples/coin_flip) example demonstrates how to build a smart contract that | ||
interacts with Pyth Entropy as well as a typescript client for that application. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13329
0
96