You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 27, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Drizzle is a collection of front-end libraries that make writing dapp frontends
38
38
39
39
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).
40
40
41
-
**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.
41
+
**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.
42
42
```javascript
43
43
// Assuming we're observing the store for changes.
44
44
var state =drizzle.store.getState()
@@ -63,7 +63,7 @@ Drizzle is a collection of front-end libraries that make writing dapp frontends
63
63
64
64
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).
65
65
66
-
**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.
66
+
**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.
67
67
```javascript
68
68
// Assuming we're observing the store for changes.
69
69
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
162
162
status
163
163
}
164
164
},
165
-
transactionStack
165
+
transactionStack,
166
166
drizzleStatus: {
167
167
initialized
168
-
}
168
+
},
169
169
web3: {
170
170
status
171
171
}
@@ -181,13 +181,15 @@ A series of contract state objects, indexed by the contract name as declared in
181
181
#### `contractName` (object)
182
182
183
183
`initialized` (boolean): `true` once contract is fully instantiated.
184
+
184
185
`synced` (boolean): `false` if contract state changes have occurred in a block and Drizzle is re-running its calls.
185
186
186
187
`events` (array): An array of event objects. Drizzle will only listen for the events we declared in options.
187
188
188
189
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.
189
190
190
191
`args` (array): Arguments passed to function call.
192
+
191
193
`value` (mixed): Value returned from function call.
192
194
193
195
### `transactions` (object)
@@ -196,7 +198,9 @@ A series of transaction objects, indexed by transaction hash.
196
198
#### `txHash` (object)
197
199
198
200
`confirmations` (array): After the initial receipt, further confirmation receipts (up to the 24th).
201
+
199
202
`error` (object): contains the returned error if any.
203
+
200
204
`receipt` (object): contains the first transaction receipt received from a transaction's `success` event.
201
205
202
206
`status` (string): `true` or `false` depending on transaction status
0 commit comments