Skip to content

Commit

Permalink
Merge pull request #2 from austintgriffith/master
Browse files Browse the repository at this point in the history
master
  • Loading branch information
pedrouid authored Nov 26, 2018
2 parents b55f697 + c6ddc8a commit 5661e1c
Show file tree
Hide file tree
Showing 22 changed files with 6,640 additions and 3,210 deletions.
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": ["react-app"],
"rules": {
"quotes": ["error", "single"],
"jsx-a11y/href-no-hash": "off",
"array-callback-return": "off"
},
"globals": {
"document": true,
"window": true
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build
node_modules
.DS_Store
package-lock.json
21 changes: 21 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Issue

What the issue is, in broad strokes.

## Steps to Reproduce

Please provide the shortest amount of steps to reproduce your issue.

## Expected Behavior

What you expected to happen.

## Actual Results

What actually happened. Please give examples and support it with screenshots, copied output or error messages.

## Environment

* Operating System:
* node version (`node --version`):
* npm version (`npm --version`):
41 changes: 27 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ const WEB3_PROVIDER = 'http://0.0.0.0:8545'
config={{
DEBUG:false,
requiredNetwork:['Unknown','Rinkeby'],
hide:false
}}
replaceName={replaceName}
metatx={METATX}
fallbackWeb3Provider={new Web3.providers.HttpProvider(WEB3_PROVIDER)}
onUpdate={(state)=>{
Expand All @@ -52,15 +52,15 @@ const WEB3_PROVIDER = 'http://0.0.0.0:8545'
}}
/>
```


### Metamask

Looks for injected web3 and provides an interface to the rest of the components. Also displays a nice HUD for users to see what account is logged in, what network they are on, and how much Ethereum they have.
Looks for injected web3 and provides an interface to the rest of the components. Also displays a nice HUD for users to see what account is logged in, what network they are on, and how much Ethereum they have.

```javascript
<Metamask
/*config={{requiredNetwork:['Ropsten']}}*/
/*config={{DEBUG: false, requiredNetwork:['Ropsten'], hide:false}}*/
onUpdate={(state)=>{
console.log("metamask state update:",state)
if(state.web3Provider) {
Expand Down Expand Up @@ -111,17 +111,31 @@ Displays transactions and blocks as progress bars and provides a **tx** function

Loads your contracts published from [Clevis](https://github.com/austintgriffith/clevis) into **this.state.contracts**.

Note: Contracts must first be injected into the /src folder by running `clevis test publish` or `clevis test full`.

```javascript
<ContractLoader
web3={web3}
require={path => {return require(`${__dirname}/${path}`)}}
onReady={(contracts)=>{
console.log("contracts loaded",contracts)
this.setState({contracts:contracts})
}}
key="ContractLoader"
config={{DEBUG:true}}
web3={web3}
require={path => {return require(`${__dirname}/${path}`)}}
onReady={(contracts,customLoader)=>{
console.log("contracts loaded",contracts)
this.setState({
customLoader: customLoader,
contracts:contracts,
},()=>{
console.log("Contracts Are Ready:",this.state.contracts)
})
}}
/>
```

You can then use the customLoader to load dynamic contracts using the ABI from current contracts:
```javascript
let lootTokenContract = this.state.customLoader("LootToken",lootTokenAddress)
```

### Events

Listens for events and parses down the chain. Use an **id** field for unique keys so it will only fire the **onUpdate** function when a new event is detected. Provide a **filter** object to filter indexed fields.
Expand All @@ -143,7 +157,7 @@ Listens for events and parses down the chain. Use an **id** field for unique key

### Address

Renders an address with the blockie (identicon) and the current balance in Eth.
Renders an address with the blockie (identicon) and the current balance in Eth.

```javascript
<Address
Expand Down Expand Up @@ -172,8 +186,8 @@ Renders a button
Renders an identicon for an address

```javascript
<Blockie
address={someEthereumAddress.toLowerCase()}
<Blockie
address={someEthereumAddress}
config={{size:3}}
/>
```
Expand All @@ -195,4 +209,3 @@ Scales components based on a target screen width vs actual screen width. Get you
Ether Jam Jam is a demo app I built that uses Dapparatus for meta transactions:

[![etherjamjam](https://user-images.githubusercontent.com/2653167/46258946-4e6e0280-c48f-11e8-854d-261b9fd7d152.png)](https://youtu.be/cNcSXovVPdg)

Loading

0 comments on commit 5661e1c

Please sign in to comment.