Adding React
This commit is contained in:
parent
11f8cdb625
commit
34e4d562e3
|
@ -2,10 +2,9 @@
|
|||
<head>
|
||||
<title>Embark</title>
|
||||
<link rel="stylesheet" href="css/app.css">
|
||||
<script src="js/app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Welcome to Embark!</h3>
|
||||
<p>See the <a href="http://embark.readthedocs.io/en/latest/index.html" target="_blank">Embark's documentation</a> to see what you can do with Embark!</p>
|
||||
<div id="app"></div>
|
||||
<script src="js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,6 +1,19 @@
|
|||
import React, { Fragment } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import EmbarkJS from 'Embark/EmbarkJS';
|
||||
|
||||
// import your contracts
|
||||
// e.g if you have a contract named SimpleStorage:
|
||||
import web3 from 'Embark/web3'
|
||||
//import SimpleStorage from 'Embark/contracts/SimpleStorage';
|
||||
class App extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render(){
|
||||
return <h1>Hello World</h1>
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ReactDOM.render(<App></App>, document.getElementById('app'));
|
||||
|
|
19
package.json
19
package.json
|
@ -10,7 +10,17 @@
|
|||
"license": "ISC",
|
||||
"homepage": "",
|
||||
"devDependencies": {
|
||||
"nodemon": "^1.18.4"
|
||||
"nodemon": "^1.18.4",
|
||||
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
||||
"@babel/plugin-proposal-decorators": "^7.0.0",
|
||||
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
|
||||
"@babel/plugin-proposal-function-sent": "^7.0.0",
|
||||
"@babel/plugin-proposal-json-strings": "^7.0.0",
|
||||
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
|
||||
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
||||
"@babel/plugin-syntax-import-meta": "^7.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"crypto": "^1.0.1",
|
||||
|
@ -19,6 +29,11 @@
|
|||
"ipfs-api": "^24.0.2",
|
||||
"merkle-tree-solidity": "^1.0.8",
|
||||
"orbit-db": "^0.19.9",
|
||||
"web3": "^1.0.0-beta.34"
|
||||
"web3": "^1.0.0-beta.34",
|
||||
"@material-ui/core": "^3.0.0",
|
||||
"@material-ui/icons": "^3.0.0",
|
||||
"@material-ui/lab": "^1.0.0-alpha.12",
|
||||
"react": "^16.4.2",
|
||||
"react-dom": "^16.4.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ const EventEmitter = require('events');
|
|||
|
||||
const contractAddress = "0xA49e638dD086E38Dac737C9346909f62DDf7d387";
|
||||
const connectionURL = `ws://localhost:8546`;
|
||||
const abiDefinition = [{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"codeUsed","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x39c6fe16"},{"constant":false,"inputs":[{"name":"_newController","type":"address"}],"name":"changeController","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x3cebb823"},{"constant":false,"inputs":[{"name":"_proof","type":"bytes32[]"},{"name":"code","type":"bytes32"},{"name":"_leaf","type":"bytes32"},{"name":"_dest","type":"address"}],"name":"send","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x6c1101c9"},{"constant":true,"inputs":[],"name":"sntAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x7f58fa14"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"sentToAddress","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x81e8706d"},{"constant":false,"inputs":[],"name":"boom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xa169ce09"},{"constant":false,"inputs":[{"name":"_ethAmount","type":"uint256"},{"name":"_sntAmount","type":"uint256"},{"name":"_root","type":"bytes32"}],"name":"updateSettings","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xa4438334"},{"constant":true,"inputs":[],"name":"SNT","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xc55a02a0"},{"constant":true,"inputs":[],"name":"ethAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xc98166c0"},{"constant":true,"inputs":[],"name":"root","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xebf0c717"},{"constant":true,"inputs":[],"name":"controller","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf77c4791"},{"inputs":[{"name":"_tokenAddress","type":"address"},{"name":"_ethAmount","type":"uint256"},{"name":"_sntAmount","type":"uint256"},{"name":"_root","type":"bytes32"}],"payable":true,"stateMutability":"payable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"dest","type":"address"},{"indexed":false,"name":"leaf","type":"bytes32"},{"indexed":false,"name":"ethAmount","type":"uint256"},{"indexed":false,"name":"sntAmount","type":"uint256"}],"name":"AddressFunded","type":"event","signature":"0xd692fa6f47b47bb192b78e1ec163f648fc83f1f87f1caf3dd4640106e052a3f2"}];
|
||||
const abiDefinition = [ { "constant": false, "inputs": [ { "name": "_newController", "type": "address" } ], "name": "changeController", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function", "signature": "0x3cebb823" }, { "constant": true, "inputs": [ { "name": "", "type": "bytes5" } ], "name": "codeUsed", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x723de5cd" }, { "constant": false, "inputs": [ { "name": "_proof", "type": "bytes32[]" }, { "name": "_code", "type": "bytes5" }, { "name": "_dest", "type": "address" } ], "name": "processRequest", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function", "signature": "0x72d209f5" }, { "constant": true, "inputs": [], "name": "sntAmount", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x7f58fa14" }, { "constant": true, "inputs": [ { "name": "", "type": "address" } ], "name": "sentToAddress", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x81e8706d" }, { "constant": false, "inputs": [], "name": "boom", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function", "signature": "0xa169ce09" }, { "constant": false, "inputs": [ { "name": "_ethAmount", "type": "uint256" }, { "name": "_sntAmount", "type": "uint256" }, { "name": "_root", "type": "bytes32" } ], "name": "updateSettings", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function", "signature": "0xa4438334" }, { "constant": true, "inputs": [ { "name": "_proof", "type": "bytes32[]" }, { "name": "_code", "type": "bytes5" }, { "name": "_dest", "type": "address" } ], "name": "validRequest", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0xadb187bb" }, { "constant": true, "inputs": [], "name": "SNT", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0xc55a02a0" }, { "constant": true, "inputs": [], "name": "ethAmount", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0xc98166c0" }, { "constant": true, "inputs": [], "name": "root", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0xebf0c717" }, { "constant": true, "inputs": [], "name": "controller", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0xf77c4791" }, { "inputs": [ { "name": "_sntAddress", "type": "address" }, { "name": "_ethAmount", "type": "uint256" }, { "name": "_sntAmount", "type": "uint256" }, { "name": "_root", "type": "bytes32" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor", "signature": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "dest", "type": "address" }, { "indexed": false, "name": "code", "type": "bytes5" }, { "indexed": false, "name": "ethAmount", "type": "uint256" }, { "indexed": false, "name": "sntAmount", "type": "uint256" } ], "name": "AddressFunded", "type": "event", "signature": "0x0aa7ecfdc9fd3f39ab380a0b6413557f94ed0dfd05ed31c925521736fa750eac" } ] ;
|
||||
|
||||
const events = new EventEmitter();
|
||||
const ipfs = new IPFS({
|
||||
|
|
Loading…
Reference in New Issue