Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
Merge pull request #83 from trufflesuite/develop
Browse files Browse the repository at this point in the history
Build v1.2.1
  • Loading branch information
OnlyOneJMJQ authored Jun 14, 2018
2 parents 0989444 + e8bcfcc commit c53e711
Show file tree
Hide file tree
Showing 11 changed files with 1,353 additions and 1,274 deletions.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Joshua Quintal

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Drizzle is a collection of front-end libraries that make writing dapp frontends

## Adding contracts dynamically

You can programmatically add contracts to Drizzle using either Drizzle#addContract or the ADD_CONTRACT action.
You can programmatically add contracts to Drizzle using either `drizzle.addContract()` or the `ADD_CONTRACT` action.

```javascript
var contractConfig = {
Expand All @@ -119,13 +119,18 @@ Drizzle has a number of configuration options so it only keeps track of exactly
contracts,
events: {
contractName: [
eventName
eventName,
{
eventName,
eventOptions
}
]
},
polls: {
accounts: interval,
blocks: interval
},
syncAlways,
web3: {
fallback: {
type
Expand All @@ -151,11 +156,14 @@ contracts: [
```

### `events` (object)
An object consisting of contract names each containing an array of strings of the event names we'd like to listen for and sync with the store.
An object consisting of contract names each containing an array of strings of the event names we'd like to listen for and sync with the store. Furthermore, event names may be replaced with an object containing both `eventName` and `eventOptions`, where `eventOptions` field corresponds to the [web3 Contract.events options](https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#contract-events).

### `polls` (object)
An object containing key/value pairs denoting what is being polled and the interval (in ms). Possible polls are accounts and blocks. Accounts will poll for addresses and balances, blocks for new blocks. **Default**: `{ blocks: 3000 }`

### `syncAlways` (boolean)
If `true`, will replay all contract calls at every block. This is useful if your dapp uses a proxy contract which obfuscates your primary contract's address. By default Drizzle checks blocks to see if a transaction interacting with your contracts has occured. If so, it syncs that contract. **Default**: `false`

### `web3` (object)
Options regarding `web3` instantiation.

Expand Down
Loading

0 comments on commit c53e711

Please sign in to comment.