diff --git a/README.md b/README.md index 9329f57d..53d7aaf5 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Drizzle is a collection of front-end libraries that make writing dapp frontends 1. Get contract data. Calling the `cacheCall()` function on a contract will execute the desired call and return a corresponding key so the data can be retrieved from the store. When a new block is received, Drizzle will refresh the store automatically _if_ any transactions in the block touched our contract. For more information on how this works, see [How Data Stays Fresh](#how-data-stays-fresh). - **Note:** We have to check that Drizzle is initialized before fetching data. A simple if statement such as below is fine for display a few pieces of data, but a better approach for larger dapps is to use a [loading component](https://github.com/trufflesuite/drizzle-react#recipe-loading-component). We've already built one for you in our [`drizzle-react-components` library](https://github.com/trufflesuite/drizzle-react-components) as well. + **Note:** We have to check that Drizzle is initialized before fetching data. A simple if statement such as below is fine for displaying a few pieces of data, but a better approach for larger dapps is to use a [loading component](https://github.com/trufflesuite/drizzle-react#recipe-loading-component). We've already built one for you in our [`drizzle-react-components` library](https://github.com/trufflesuite/drizzle-react-components) as well. ```javascript // Assuming we're observing the store for changes. var state = drizzle.store.getState() @@ -63,7 +63,7 @@ Drizzle is a collection of front-end libraries that make writing dapp frontends 1. Send a contract transaction. Calling the `cacheSend()` function on a contract will send the desired transaction and return a corresponding transaction hash so the status can be retrieved from the store. The last argument can optionally be an options object with the typical from, gas and gasPrice keys. Drizzle will update the transaction's state in the store (pending, success, error) and store the transaction receipt. For more information on how this works, see [How Data Stays Fresh](#how-data-stays-fresh). - **Note:** We have to check that Drizzle is initialized before fetching data. A simple if statement such as below is fine for display a few pieces of data, but a better approach for larger dapps is to use a [loading component](https://github.com/trufflesuite/drizzle-react#recipe-loading-component). We've already built one for you in our [`drizzle-react-components` library](https://github.com/trufflesuite/drizzle-react-components) as well. + **Note:** We have to check that Drizzle is initialized before fetching data. A simple if statement such as below is fine for displaying a few pieces of data, but a better approach for larger dapps is to use a [loading component](https://github.com/trufflesuite/drizzle-react#recipe-loading-component). We've already built one for you in our [`drizzle-react-components` library](https://github.com/trufflesuite/drizzle-react-components) as well. ```javascript // Assuming we're observing the store for changes. var state = drizzle.store.getState() @@ -162,10 +162,10 @@ An object consisting of the type and url of a fallback web3 provider. This is us status } }, - transactionStack + transactionStack, drizzleStatus: { initialized - } + }, web3: { status } @@ -181,6 +181,7 @@ A series of contract state objects, indexed by the contract name as declared in #### `contractName` (object) `initialized` (boolean): `true` once contract is fully instantiated. + `synced` (boolean): `false` if contract state changes have occurred in a block and Drizzle is re-running its calls. `events` (array): An array of event objects. Drizzle will only listen for the events we declared in options. @@ -188,6 +189,7 @@ A series of contract state objects, indexed by the contract name as declared in The contract's state also includes the state of each constant function called on the contract (`callerFunctionName`). The functions are indexed by name, and contain the outputs indexed by a hash of the arguments passed during the call (`argsHash`). If no arguments were passed, the hash is `0x0`. Drizzle reads from the store for you, so it should be unnecessary to touch this data cache manually. `args` (array): Arguments passed to function call. + `value` (mixed): Value returned from function call. ### `transactions` (object) @@ -196,7 +198,9 @@ A series of transaction objects, indexed by transaction hash. #### `txHash` (object) `confirmations` (array): After the initial receipt, further confirmation receipts (up to the 24th). + `error` (object): contains the returned error if any. + `receipt` (object): contains the first transaction receipt received from a transaction's `success` event. `status` (string): `true` or `false` depending on transaction status