Browse Source

dashboard getting balance from smart contract. newtx view performing transaction to smart contract

master
arnaucode 6 years ago
parent
commit
ede0384dd4
18 changed files with 603 additions and 326 deletions
  1. +0
    -0
      .gitignore
  2. +5
    -3
      README.md
  3. BIN
      doc/r1.png
  4. BIN
      doc/r2.png
  5. BIN
      doc/reciproka-diagram01.png
  6. +1
    -0
      doc/reciproka-diagram01.xml
  7. BIN
      r1.png
  8. BIN
      r2.png
  9. +348
    -299
      wallet/package-lock.json
  10. +1
    -1
      wallet/package.json
  11. +17
    -4
      wallet/src/App.js
  12. +62
    -0
      wallet/src/eth/accountsContractABI.js
  13. +45
    -8
      wallet/src/eth/eth.js
  14. +11
    -0
      wallet/src/mem/mem.js
  15. +10
    -3
      wallet/src/views/dashboard/dashboard.js
  16. +61
    -6
      wallet/src/views/newtx/newtx.js
  17. +32
    -0
      wallet/src/views/notyet/notyet.js
  18. +10
    -2
      wallet/src/views/sidemenu/sidemenu.js

+ 0
- 0
.gitignore


+ 5
- 3
README.md

@ -3,8 +3,8 @@ Decentralized mutual credit system based on Ethereum smart contracts.
**For the moment this is an implementation of a Proof of Concept.** **For the moment this is an implementation of a Proof of Concept.**
![reciprokaWallet](https://raw.githubusercontent.com/arnaucode/reciproka/master/r1.png "reciprokaWallet")
![reciprokaWallet](https://raw.githubusercontent.com/arnaucode/reciproka/master/r2.png "reciprokaWallet")
![reciprokaWallet](https://raw.githubusercontent.com/arnaucode/reciproka/master/doc/r1.png "reciprokaWallet")
![reciprokaWallet](https://raw.githubusercontent.com/arnaucode/reciproka/master/doc/r2.png "reciprokaWallet")
## Components ## Components
- Smart contracts - Smart contracts
@ -16,7 +16,7 @@ Decentralized mutual credit system based on Ethereum smart contracts.
## Documentation ## Documentation
Each user connects to `reciproka` throught the frontend wallet app. Once the app is opened, it creates a new ethereum private key (if the user already have one, loads it).
Each user connects to `reciproka` throught the frontend wallet app. The app can be loaded from `IPFS`. Once the app is opened, it creates a new ethereum private key (if the user already have one, loads it).
### Transaction action: ### Transaction action:
@ -30,6 +30,8 @@ Each user connects to `reciproka` throught the frontend wallet app. Once the app
- u2: 10 - u2: 10
![reciproka-diagram01](https://raw.githubusercontent.com/arnaucode/reciproka/master/doc/reciproka-diagram01.png "reciproka-diagram01")
### Account ### Account
Account data structure: Account data structure:
```solidity ```solidity

BIN
doc/r1.png

Before After
Width: 1255  |  Height: 895  |  Size: 94 KiB

BIN
doc/r2.png

Before After
Width: 1056  |  Height: 506  |  Size: 30 KiB

BIN
doc/reciproka-diagram01.png

Before After
Width: 461  |  Height: 512  |  Size: 32 KiB

+ 1
- 0
doc/reciproka-diagram01.xml

@ -0,0 +1 @@
<mxfile userAgent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/68.0.3440.75 Chrome/68.0.3440.75 Safari/537.36" version="9.0.2" editor="www.draw.io" type="device"><diagram id="7d5f1886-6454-31f4-e67d-bcfe02f59c1d" name="Page-1">7Vldj9o4FP01SLsPgxybAPMIdGgfui3SPOxj5Uk8iXecOHKcAfrre02cBGxgUDd01WFHYrCvr6/jc+5XxIAsss1HRYv0LxkzMcAo3gzIhwHGwQiP4ctItrVkEoa1IFE8tkqd4JF/Z1aIrLTiMSsPFLWUQvPiUBjJPGeRPpBRpeT6UO1ZisNTC5owT/AYUeFL/+axTmvpNESd/BPjSdqcHCC78kSjl0TJKrfnDTB53v3VyxltbFn9MqWxXO+JyMOALJSUuh5lmwUTBtsGtnrf8sRq+9yK5fqiDc1z6G1zdxYDFHaayxy+5rsLMbMFwSzVmYBhAMNSU6VnBvBOeSdbciGs+j9M662lmFZagkgqncpE5lR8lrKwtuoHMaefvIsVlbJSkdXC1juoSpjVClscwT+ZzJhWW1BRTFDNXw+tU+soSavXgQUDi9dx7OzRr1RU1uhMcHguF1DguDDDKhOzSEsFd31lSnNwt8/0iYmVLLnmMgeVJ6m1zEBBmIV560wLKcy+D507dTbg0MTs1QbJfXJkpQXP2aKNEdSibPayzXmcfQTthsZ3bWxP7XTdBQqxonQvRsbo3yNOPMTn8und4z0K/zPAA/ybp4fQTw/kF6WH0HPWr+scBA86ZYpVGQy/ML2W6mVgyiUJDBp/rCD3Q7FAu3+zCoBQXG//3FM56e8821W1Kzo7LYvas5/5xvA93x05a6SokcA41drU6pmBCy+rQkgaD9f8hWcs5nQoVQJiMy/MHMaRzDKZlzDSaZVBVC+J+QAMyxVe3eU1VMPy1WwMMELF5s5ZGBZ50k/IBePwIOSwH3LBZOTHXDDtIegmnuPcDOXIfAD6ZRMk3wQkgm8YBSPLPA7HQPzx5f74x2Q8fNMDSOA7QNhH0j1S5qiguclpAC7yWza4qHYzr5IvrKHZpt5nyLqOiFqyIwCGqSNekPE4NsfM1ynX7LGgu8y6hrbfS/wnfMye1EchRA4locfJ5EghxH1wMvqfk6OckHs3TvxAuRopfon125U8dhqQPUYu7Sn82+/dLjxyu0Z2cVNhT1hJDgefcviw6SkaC3WnYzftv+WdtxNMHDt1e+TZ2eHfXvoySsbvnRKnMwgJ+klOHENty3EFUvyOogQSQGJe/1GkoB7r8hxPkaBlyaPfiyrntQmHPxs9Y8fQ9HpMTc+XmTvL2W3WGieNEezX/+m1Ss39eWJulxRy/zYrTb3pm5XGhp/Y8DvOa6Nwcoi4m48uTWxOghy57UV/ea255Lm8Nr3VCHLSWtsY/IIOuunOTvFys5y4rzVHSeknq8G0+72njq3uRzXy8AM=</diagram></mxfile>

BIN
r1.png

Before After
Width: 1096  |  Height: 783  |  Size: 78 KiB

BIN
r2.png

Before After
Width: 942  |  Height: 501  |  Size: 18 KiB

+ 348
- 299
wallet/package-lock.json

@ -4,6 +4,14 @@
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@sambego/storybook-state": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@sambego/storybook-state/-/storybook-state-1.0.7.tgz",
"integrity": "sha512-DxNt+qVttXhYIbZ7tOT+zIuCDg/ePfhYI2CNCYFyXO/gO183xNX5i+cs0UgAO7xLfqAo165zTY33rn45QoQNBw==",
"requires": {
"uuid": "3.3.2"
}
},
"abab": { "abab": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz",
@ -1891,6 +1899,11 @@
} }
} }
}, },
"change-emitter": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/change-emitter/-/change-emitter-0.1.6.tgz",
"integrity": "sha1-6LL+PX8at9aaMhma/5HqaTFAlRU="
},
"chardet": { "chardet": {
"version": "0.4.2", "version": "0.4.2",
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
@ -2318,11 +2331,6 @@
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
}, },
"cookiejar": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz",
"integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA=="
},
"copy-descriptor": { "copy-descriptor": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
@ -7751,6 +7759,17 @@
"resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz",
"integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==" "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg=="
}, },
"oce-components": {
"version": "git+https://github.com/opencooperativeecosystem/kit.git#9a2ec552c68974865a7d2554c369bf25ac8d4c86",
"requires": {
"@sambego/storybook-state": "1.0.7",
"moment": "2.22.1",
"rc-progress": "2.2.5",
"react-datepicker": "1.5.0",
"react-timeout": "1.1.1",
"recompose": "0.27.1"
}
},
"omit.js": { "omit.js": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/omit.js/-/omit.js-1.0.0.tgz", "resolved": "https://registry.npmjs.org/omit.js/-/omit.js-1.0.0.tgz",
@ -8097,6 +8116,11 @@
"resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz",
"integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==" "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow=="
}, },
"popper.js": {
"version": "1.14.4",
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.14.4.tgz",
"integrity": "sha1-juwdj/AqWjoVLdQ0FKFce3n9abY="
},
"portfinder": { "portfinder": {
"version": "1.0.15", "version": "1.0.15",
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.15.tgz", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.15.tgz",
@ -10105,6 +10129,17 @@
"prop-types": "15.6.2" "prop-types": "15.6.2"
} }
}, },
"react-datepicker": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/react-datepicker/-/react-datepicker-1.5.0.tgz",
"integrity": "sha512-Neh1rz0d1QeR7KuoTiYeR6oj73DJkqt0vuNSgfMuxXEwGmz/4sPynouYGo6gdKiQbxIXBJJ/FLDLHJEr5XNThw==",
"requires": {
"classnames": "2.2.6",
"prop-types": "15.6.2",
"react-onclickoutside": "6.7.1",
"react-popper": "0.9.5"
}
},
"react-dev-utils": { "react-dev-utils": {
"version": "5.0.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-5.0.1.tgz", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-5.0.1.tgz",
@ -10162,6 +10197,20 @@
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
"integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
}, },
"react-onclickoutside": {
"version": "6.7.1",
"resolved": "https://registry.npmjs.org/react-onclickoutside/-/react-onclickoutside-6.7.1.tgz",
"integrity": "sha512-p84kBqGaMoa7VYT0vZ/aOYRfJB+gw34yjpda1Z5KeLflg70HipZOT+MXQenEhdkPAABuE2Astq4zEPdMqUQxcg=="
},
"react-popper": {
"version": "0.9.5",
"resolved": "https://registry.npmjs.org/react-popper/-/react-popper-0.9.5.tgz",
"integrity": "sha1-AqJO8+7DOvnlToNYq3DrDjMe3QU=",
"requires": {
"popper.js": "1.14.4",
"prop-types": "15.6.2"
}
},
"react-router": { "react-router": {
"version": "4.3.1", "version": "4.3.1",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-4.3.1.tgz", "resolved": "https://registry.npmjs.org/react-router/-/react-router-4.3.1.tgz",
@ -10262,6 +10311,16 @@
"resize-observer-polyfill": "1.5.0" "resize-observer-polyfill": "1.5.0"
} }
}, },
"react-timeout": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/react-timeout/-/react-timeout-1.1.1.tgz",
"integrity": "sha512-zEJYHb3WvVq0/RdAOw5KHaOjTrN5Sm4fssJMPhqcu3efunecgQLfLfrKG5tfRM4IdjNJ3FCPI5hEKv62IHyZTw==",
"requires": {
"create-react-class": "15.6.3",
"hoist-non-react-statics": "2.5.5",
"object-assign": "4.1.1"
}
},
"read-pkg": { "read-pkg": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
@ -10325,6 +10384,19 @@
"set-immediate-shim": "1.0.1" "set-immediate-shim": "1.0.1"
} }
}, },
"recompose": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/recompose/-/recompose-0.27.1.tgz",
"integrity": "sha512-p7xsyi/rfNjHfdP7vPU02uSFa+Q1eHhjKrvO+3+kRP4Ortj+MxEmpmd+UQtBGM2D2iNAjzNI5rCyBKp9Ob5McA==",
"requires": {
"babel-runtime": "6.26.0",
"change-emitter": "0.1.6",
"fbjs": "0.8.17",
"hoist-non-react-statics": "2.5.5",
"react-lifecycles-compat": "3.0.4",
"symbol-observable": "1.2.0"
}
},
"recursive-readdir": { "recursive-readdir": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.1.tgz", "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.1.tgz",
@ -11597,6 +11669,11 @@
} }
} }
}, },
"symbol-observable": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz",
"integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ=="
},
"symbol-tree": { "symbol-tree": {
"version": "3.2.2", "version": "3.2.2",
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz",
@ -12358,29 +12435,29 @@
} }
}, },
"web3": { "web3": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.35.tgz",
"integrity": "sha512-xwDmUhvTcHQvvNnOPcPZZgCxKUsI2e+GbHy7JkTK3/Rmnutazy8x7fsAXT9myw7V1qpi3GgLoZ3fkglSUbg1Mg==",
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.33.tgz",
"integrity": "sha1-xgIbV2mSdyY3HBhLhoRFMRsTkpU=",
"requires": { "requires": {
"web3-bzz": "1.0.0-beta.35",
"web3-core": "1.0.0-beta.35",
"web3-eth": "1.0.0-beta.35",
"web3-eth-personal": "1.0.0-beta.35",
"web3-net": "1.0.0-beta.35",
"web3-shh": "1.0.0-beta.35",
"web3-utils": "1.0.0-beta.35"
}
},
"web3-bzz": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.35.tgz",
"integrity": "sha512-BhAU0qhlr8zltm4gs/+P1gki2VkxHJaM2Rrh4DGesDW0lzwufRoNvWFlwx1bKHoFPWNbSmm9PRkHOYOINL/Tgw==",
"requires": {
"got": "7.1.0",
"swarm-js": "0.1.37",
"underscore": "1.8.3"
"web3-bzz": "1.0.0-beta.33",
"web3-core": "1.0.0-beta.33",
"web3-eth": "1.0.0-beta.33",
"web3-eth-personal": "1.0.0-beta.33",
"web3-net": "1.0.0-beta.33",
"web3-shh": "1.0.0-beta.33",
"web3-utils": "1.0.0-beta.33"
}, },
"dependencies": { "dependencies": {
"bn.js": {
"version": "4.11.6",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz",
"integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU="
},
"eventemitter3": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.1.1.tgz",
"integrity": "sha1-R3hr2qCHyvext15zq8XH1UAVjNA="
},
"got": { "got": {
"version": "7.1.0", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz",
@ -12401,269 +12478,253 @@
"url-parse-lax": "1.0.0", "url-parse-lax": "1.0.0",
"url-to-options": "1.0.1" "url-to-options": "1.0.1"
} }
}
}
},
"web3-core": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.35.tgz",
"integrity": "sha512-ayGavbgVk4KL9Y88Uv411fBJ0SVgVfKhKEBweKYzmP0zOqneMzWt6YsyD1n6kRvjAbqA0AfUPEOKyMNjcx2tjw==",
"requires": {
"web3-core-helpers": "1.0.0-beta.35",
"web3-core-method": "1.0.0-beta.35",
"web3-core-requestmanager": "1.0.0-beta.35",
"web3-utils": "1.0.0-beta.35"
}
},
"web3-core-helpers": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.35.tgz",
"integrity": "sha512-APOu3sEsamyqWt//8o4yq9KF25/uqGm+pQShson/sC4gKzmfJB07fLo2ond0X30E8fIqAPeVCotPXQxGciGUmA==",
"requires": {
"underscore": "1.8.3",
"web3-eth-iban": "1.0.0-beta.35",
"web3-utils": "1.0.0-beta.35"
}
},
"web3-core-method": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.35.tgz",
"integrity": "sha512-jidImCide8q0GpfsO4L73qoHrbkeWgwU3uOH5DKtJtv0ccmG086knNMRgryb/o9ZgetDWLmDEsJnHjBSoIwcbA==",
"requires": {
"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.35",
"web3-core-promievent": "1.0.0-beta.35",
"web3-core-subscriptions": "1.0.0-beta.35",
"web3-utils": "1.0.0-beta.35"
}
},
"web3-core-promievent": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.35.tgz",
"integrity": "sha512-GvqXqKq07OmHuVi5uNRg6k79a1/CI0ViCC+EtNv4CORHtDRmYEt5Bvdv6z6FJEiaaQkD0lKbFwNhLxutx7HItw==",
"requires": {
"any-promise": "1.3.0",
"eventemitter3": "1.1.1"
},
"dependencies": {
"eventemitter3": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.1.1.tgz",
"integrity": "sha1-R3hr2qCHyvext15zq8XH1UAVjNA="
}
}
},
"web3-core-requestmanager": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.35.tgz",
"integrity": "sha512-S+zW2h17ZZQU9oe3yaCJE0E7aJS4C3Kf4kGPDv+nXjW0gKhQQhgVhw1Doq/aYQGqNSWJp7f1VHkz5gQWwg6RRg==",
"requires": {
"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.35",
"web3-providers-http": "1.0.0-beta.35",
"web3-providers-ipc": "1.0.0-beta.35",
"web3-providers-ws": "1.0.0-beta.35"
}
},
"web3-core-subscriptions": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.35.tgz",
"integrity": "sha512-gXzLrWvcGkGiWq1y33Z4Y80XI8XMrwowiQJkrPSjQ81K5PBKquOGwcMffLaKcwdmEy/NpsOXDeFo3eLE1Ghvvw==",
"requires": {
"eventemitter3": "1.1.1",
"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.35"
},
"dependencies": {
"eventemitter3": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.1.1.tgz",
"integrity": "sha1-R3hr2qCHyvext15zq8XH1UAVjNA="
}
}
},
"web3-eth": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.35.tgz",
"integrity": "sha512-04mcb2nGPXThawuuYICPOxv0xOHofvQKsjZeIq+89nyOC8DQMGTAErDkGyMHQYtjpth5XDhic0wuEsA80AmFZA==",
"requires": {
"underscore": "1.8.3",
"web3-core": "1.0.0-beta.35",
"web3-core-helpers": "1.0.0-beta.35",
"web3-core-method": "1.0.0-beta.35",
"web3-core-subscriptions": "1.0.0-beta.35",
"web3-eth-abi": "1.0.0-beta.35",
"web3-eth-accounts": "1.0.0-beta.35",
"web3-eth-contract": "1.0.0-beta.35",
"web3-eth-iban": "1.0.0-beta.35",
"web3-eth-personal": "1.0.0-beta.35",
"web3-net": "1.0.0-beta.35",
"web3-utils": "1.0.0-beta.35"
}
},
"web3-eth-abi": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.35.tgz",
"integrity": "sha512-KUDC+EtFFYG8z01ZleKrASdjj327/rtWHzEt6RWsEj7bBa0bGp9nEh+nqdZx/Sdgz1O8tnfFzJlrRcXpfr1vGg==",
"requires": {
"bn.js": "4.11.6",
"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.35",
"web3-utils": "1.0.0-beta.35"
},
"dependencies": {
"bn.js": {
"version": "4.11.6",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz",
"integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU="
}
}
},
"web3-eth-accounts": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.35.tgz",
"integrity": "sha512-duIgRsfht/0kAW/eQ0X9lKtVIykbETrnM2H7EnvplCzPHtQLodpib4o9JXfh9n6ZDgdDC7cuJoiVB9QJg089ew==",
"requires": {
"any-promise": "1.3.0",
"crypto-browserify": "3.12.0",
"eth-lib": "0.2.7",
"scrypt.js": "0.2.0",
"underscore": "1.8.3",
"uuid": "2.0.1",
"web3-core": "1.0.0-beta.35",
"web3-core-helpers": "1.0.0-beta.35",
"web3-core-method": "1.0.0-beta.35",
"web3-utils": "1.0.0-beta.35"
},
"dependencies": {
"eth-lib": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz",
"integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=",
"requires": {
"bn.js": "4.11.8",
"elliptic": "6.4.0",
"xhr-request-promise": "0.1.2"
}
}, },
"uuid": { "uuid": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz",
"integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w="
}
}
},
"web3-eth-contract": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.35.tgz",
"integrity": "sha512-foPohOg5O1UCGKGZOIs+kQK5IZdV2QQ7pAWwNxH8WHplUA+fre1MurXNpoxknUmH6mYplFhXjqgYq2MsrBpHrA==",
"requires": {
"underscore": "1.8.3",
"web3-core": "1.0.0-beta.35",
"web3-core-helpers": "1.0.0-beta.35",
"web3-core-method": "1.0.0-beta.35",
"web3-core-promievent": "1.0.0-beta.35",
"web3-core-subscriptions": "1.0.0-beta.35",
"web3-eth-abi": "1.0.0-beta.35",
"web3-utils": "1.0.0-beta.35"
}
},
"web3-eth-iban": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.35.tgz",
"integrity": "sha512-H5wkcNcAIc+h/WoDIKv7ZYmrM2Xqu3O7jBQl1IWo73EDVQji+AoB2i3J8tuwI1yZRInRwrfpI3Zuwuf54hXHmQ==",
"requires": {
"bn.js": "4.11.6",
"web3-utils": "1.0.0-beta.35"
},
"dependencies": {
"bn.js": {
"version": "4.11.6",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz",
"integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU="
}
}
},
"web3-eth-personal": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.35.tgz",
"integrity": "sha512-AcM9nnlxu7ZRRxPvkrFB9eLxMM4A2cPfj2aCg21Wb2EpMnhR+b/O1cT33k7ApRowoMpM+T9M8vx2oPNwXfaCOQ==",
"requires": {
"web3-core": "1.0.0-beta.35",
"web3-core-helpers": "1.0.0-beta.35",
"web3-core-method": "1.0.0-beta.35",
"web3-net": "1.0.0-beta.35",
"web3-utils": "1.0.0-beta.35"
}
},
"web3-net": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.35.tgz",
"integrity": "sha512-bbwaQ/KohGjIJ6HAKbZ6KrklCAaG6/B7hIbAbVLSFLxF+Yz9lmAgQYaDInpidpC/NLb3WOmcbRF+P77J4qMVIA==",
"requires": {
"web3-core": "1.0.0-beta.35",
"web3-core-method": "1.0.0-beta.35",
"web3-utils": "1.0.0-beta.35"
}
},
"web3-providers-http": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.0.0-beta.35.tgz",
"integrity": "sha512-DcIMFq52Fb08UpWyZ3ZlES6NsNqJnco4hBS/Ej6eOcASfuUayPI+GLkYVZsnF3cBYqlH+DOKuArcKSuIxK7jIA==",
"requires": {
"web3-core-helpers": "1.0.0-beta.35",
"xhr2-cookies": "1.1.0"
}
},
"web3-providers-ipc": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.35.tgz",
"integrity": "sha512-iB0FG0HcpUnayfa8pn4guqEQ4Y1nrroi/jffdtQgFkrNt0sD3fMSwwC0AbmECqj3tDLl0e1slBR0RENll+ZF0g==",
"requires": {
"oboe": "2.1.3",
"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.35"
}
},
"web3-providers-ws": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.35.tgz",
"integrity": "sha512-Cx64NgDStynKaUGDIIOfaCd0fZusL8h5avKTkdTjUu2aHhFJhZoVBGVLhoDtUaqZGWIZGcBJOoVf2JkGUOjDRQ==",
"requires": {
"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.35",
"websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2"
}
},
"web3-shh": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.35.tgz",
"integrity": "sha512-8qSonk/x0xabERS9Sr6AIADN/Ty+5KwARkkGIfSYHKqFpdMDz+76F7cUCxtoCZoS8K04xgZlDKYe0TJXLYA0Fw==",
"requires": {
"web3-core": "1.0.0-beta.35",
"web3-core-method": "1.0.0-beta.35",
"web3-core-subscriptions": "1.0.0-beta.35",
"web3-net": "1.0.0-beta.35"
}
},
"web3-utils": {
"version": "1.0.0-beta.35",
"resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.35.tgz",
"integrity": "sha512-Dq6f0SOKj3BDFRgOPnE6ALbzBDCKVIW8mKWVf7tGVhTDHf+wQaWwQSC3aArFSqdExB75BPBPyDpuMTNszhljpA==",
"requires": {
"bn.js": "4.11.6",
"eth-lib": "0.1.27",
"ethjs-unit": "0.1.6",
"number-to-bn": "1.7.0",
"randomhex": "0.1.5",
"underscore": "1.8.3",
"utf8": "2.1.1"
},
"dependencies": {
"bn.js": {
"version": "4.11.6",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz",
"integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU="
},
"web3-bzz": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.33.tgz",
"integrity": "sha1-MVAPaZt+cO31FJDFXv+0J7+7OwE=",
"requires": {
"got": "7.1.0",
"swarm-js": "0.1.37",
"underscore": "1.8.3"
}
},
"web3-core": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.33.tgz",
"integrity": "sha1-+C7VJfW2auzale7O08rSvWlfeDk=",
"requires": {
"web3-core-helpers": "1.0.0-beta.33",
"web3-core-method": "1.0.0-beta.33",
"web3-core-requestmanager": "1.0.0-beta.33",
"web3-utils": "1.0.0-beta.33"
}
},
"web3-core-helpers": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.33.tgz",
"integrity": "sha1-Kvcz5QTbBefDZIwdrPV3sOwV3EM=",
"requires": {
"underscore": "1.8.3",
"web3-eth-iban": "1.0.0-beta.33",
"web3-utils": "1.0.0-beta.33"
}
},
"web3-core-method": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.33.tgz",
"integrity": "sha1-7Y7ExK+rIdwJid41g2hEZlIrboY=",
"requires": {
"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.33",
"web3-core-promievent": "1.0.0-beta.33",
"web3-core-subscriptions": "1.0.0-beta.33",
"web3-utils": "1.0.0-beta.33"
}
},
"web3-core-promievent": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.33.tgz",
"integrity": "sha1-0fXrtgFSfdSWViw2IXblWNly01g=",
"requires": {
"any-promise": "1.3.0",
"eventemitter3": "1.1.1"
}
},
"web3-core-requestmanager": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.33.tgz",
"integrity": "sha1-ejbEA1QALfsXnKLb22pgEsn3Ges=",
"requires": {
"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.33",
"web3-providers-http": "1.0.0-beta.33",
"web3-providers-ipc": "1.0.0-beta.33",
"web3-providers-ws": "1.0.0-beta.33"
}
},
"web3-core-subscriptions": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.33.tgz",
"integrity": "sha1-YCh1yfTV9NDhYhRitfwewZs1veM=",
"requires": {
"eventemitter3": "1.1.1",
"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.33"
}
},
"web3-eth": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.33.tgz",
"integrity": "sha1-hKn5TallUnyS2DitTlcN8CWJhJ8=",
"requires": {
"underscore": "1.8.3",
"web3-core": "1.0.0-beta.33",
"web3-core-helpers": "1.0.0-beta.33",
"web3-core-method": "1.0.0-beta.33",
"web3-core-subscriptions": "1.0.0-beta.33",
"web3-eth-abi": "1.0.0-beta.33",
"web3-eth-accounts": "1.0.0-beta.33",
"web3-eth-contract": "1.0.0-beta.33",
"web3-eth-iban": "1.0.0-beta.33",
"web3-eth-personal": "1.0.0-beta.33",
"web3-net": "1.0.0-beta.33",
"web3-utils": "1.0.0-beta.33"
}
},
"web3-eth-abi": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.33.tgz",
"integrity": "sha1-IiH3FRZDZgAypN80D2EjSRaMgko=",
"requires": {
"bn.js": "4.11.6",
"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.33",
"web3-utils": "1.0.0-beta.33"
}
},
"web3-eth-accounts": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.33.tgz",
"integrity": "sha1-JajX9OWOHpk7kvBpVILMzckhL5E=",
"requires": {
"any-promise": "1.3.0",
"crypto-browserify": "3.12.0",
"eth-lib": "0.2.7",
"scrypt.js": "0.2.0",
"underscore": "1.8.3",
"uuid": "2.0.1",
"web3-core": "1.0.0-beta.33",
"web3-core-helpers": "1.0.0-beta.33",
"web3-core-method": "1.0.0-beta.33",
"web3-utils": "1.0.0-beta.33"
},
"dependencies": {
"eth-lib": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz",
"integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=",
"requires": {
"bn.js": "4.11.6",
"elliptic": "6.4.0",
"xhr-request-promise": "0.1.2"
}
}
}
},
"web3-eth-contract": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.33.tgz",
"integrity": "sha1-nlkZ8pF6PGe0+2Vp1JxeMDiSW84=",
"requires": {
"underscore": "1.8.3",
"web3-core": "1.0.0-beta.33",
"web3-core-helpers": "1.0.0-beta.33",
"web3-core-method": "1.0.0-beta.33",
"web3-core-promievent": "1.0.0-beta.33",
"web3-core-subscriptions": "1.0.0-beta.33",
"web3-eth-abi": "1.0.0-beta.33",
"web3-utils": "1.0.0-beta.33"
}
},
"web3-eth-iban": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.33.tgz",
"integrity": "sha1-HXPQxSiKRWWxdUp1tfs+oLd6Uy8=",
"requires": {
"bn.js": "4.11.6",
"web3-utils": "1.0.0-beta.33"
}
},
"web3-eth-personal": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.33.tgz",
"integrity": "sha1-tOSFh8xOfrAY2ib947Tzul+bmO8=",
"requires": {
"web3-core": "1.0.0-beta.33",
"web3-core-helpers": "1.0.0-beta.33",
"web3-core-method": "1.0.0-beta.33",
"web3-net": "1.0.0-beta.33",
"web3-utils": "1.0.0-beta.33"
}
},
"web3-net": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.33.tgz",
"integrity": "sha1-tskNGg4WJuquiz2SKsFTZy/VZEU=",
"requires": {
"web3-core": "1.0.0-beta.33",
"web3-core-method": "1.0.0-beta.33",
"web3-utils": "1.0.0-beta.33"
}
},
"web3-providers-http": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.0.0-beta.33.tgz",
"integrity": "sha1-OzWuAO599blrSTSWKtSobypVmcE=",
"requires": {
"web3-core-helpers": "1.0.0-beta.33",
"xhr2": "0.1.4"
}
},
"web3-providers-ipc": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.33.tgz",
"integrity": "sha1-Twrcmv6dEsBm5L5cPFNvUHPLB8Y=",
"requires": {
"oboe": "2.1.3",
"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.33"
}
},
"web3-providers-ws": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.33.tgz",
"integrity": "sha1-j93qQuGbvyUh7IeVRkV6Yjqdye8=",
"requires": {
"underscore": "1.8.3",
"web3-core-helpers": "1.0.0-beta.33",
"websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2"
}
},
"web3-shh": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.33.tgz",
"integrity": "sha1-+Z4mVz9uCZMhrw2fK/z+Pe01UKE=",
"requires": {
"web3-core": "1.0.0-beta.33",
"web3-core-method": "1.0.0-beta.33",
"web3-core-subscriptions": "1.0.0-beta.33",
"web3-net": "1.0.0-beta.33"
}
},
"web3-utils": {
"version": "1.0.0-beta.33",
"resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.33.tgz",
"integrity": "sha1-4JG3mU8JtxSwGYpAV9OtLrjL4jg=",
"requires": {
"bn.js": "4.11.6",
"eth-lib": "0.1.27",
"ethjs-unit": "0.1.6",
"number-to-bn": "1.7.0",
"randomhex": "0.1.5",
"underscore": "1.8.3",
"utf8": "2.1.1"
}
},
"websocket": {
"version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",
"requires": {
"debug": "2.6.9",
"nan": "2.10.0",
"typedarray-to-buffer": "3.1.5",
"yaeti": "0.0.6"
}
} }
} }
}, },
@ -13070,15 +13131,6 @@
"source-map": "0.6.1" "source-map": "0.6.1"
} }
}, },
"websocket": {
"version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",
"requires": {
"debug": "2.6.9",
"nan": "2.10.0",
"typedarray-to-buffer": "3.1.5",
"yaeti": "0.0.6"
}
},
"websocket-driver": { "websocket-driver": {
"version": "0.7.0", "version": "0.7.0",
"resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz",
@ -13285,13 +13337,10 @@
"xhr-request": "1.1.0" "xhr-request": "1.1.0"
} }
}, },
"xhr2-cookies": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz",
"integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=",
"requires": {
"cookiejar": "2.1.2"
}
"xhr2": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.1.4.tgz",
"integrity": "sha1-f4dliEdxbbUCYyOBL4GMras4el8="
}, },
"xml-name-validator": { "xml-name-validator": {
"version": "2.0.1", "version": "2.0.1",

+ 1
- 1
wallet/package.json

@ -12,7 +12,7 @@
"react-router": "^4.2.0", "react-router": "^4.2.0",
"react-router-dom": "^4.2.2", "react-router-dom": "^4.2.2",
"react-scripts": "1.1.4", "react-scripts": "1.1.4",
"web3": "^1.0.0-beta.35"
"web3": "1.0.0-beta.33"
}, },
"scripts": { "scripts": {
"start": "react-scripts start", "start": "react-scripts start",

+ 17
- 4
wallet/src/App.js

@ -5,14 +5,23 @@ import './App.css';
import { Row, Col } from 'antd'; import { Row, Col } from 'antd';
import mem from './mem/mem';
import DashboardView from './views/dashboard/dashboard'; import DashboardView from './views/dashboard/dashboard';
import NewTxView from './views/newtx/newtx'; import NewTxView from './views/newtx/newtx';
import NotYet from './views/notyet/notyet';
import SidemenuView from './views/sidemenu/sidemenu'; import SidemenuView from './views/sidemenu/sidemenu';
import './eth/eth.js';
import './eth/eth';
class App extends Component { class App extends Component {
constructor(props) {
super(props);
this.state = {
account: mem.account
}
}
render() { render() {
return ( return (
<BrowserRouter> <BrowserRouter>
@ -21,10 +30,13 @@ class App extends Component {
<nav className="navbar navbar-light bg-light"> <nav className="navbar navbar-light bg-light">
{/* <span className="emptyHorizontal40"></span> */} {/* <span className="emptyHorizontal40"></span> */}
<a className="navbar-brand" href=""> <a className="navbar-brand" href="">
<img src={require('./img/app-icon.png')} width="30" height="30" className="d-inline-block align-top" />
<img src={require('./img/app-icon.png')} width="30" height="30" className="d-inline-block align-top"
style={{marginRight:10}} />
reciproka wallet reciproka wallet
</a> </a>
<b>0xa</b>
<div>
Account: <b>{this.state.account.address}</b>
</div>
</nav> </nav>
{/* <SideMenu/> */} {/* <SideMenu/> */}
@ -35,8 +47,9 @@ class App extends Component {
<Col span={20}> <Col span={20}>
<br/> <br/>
<Switch> <Switch>
<Route exact="exact" path="/" component={DashboardView}></Route>
<Route exact={true} path="/" component={DashboardView}></Route>
<Route path="/newtx" component={NewTxView}></Route> <Route path="/newtx" component={NewTxView}></Route>
<Route path="/notyet" component={NotYet}></Route>
</Switch> </Switch>
</Col> </Col>
</Row> </Row>

+ 62
- 0
wallet/src/eth/accountsContractABI.js

@ -0,0 +1,62 @@
var accountsContractABI = [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "sender",
"type": "address"
},
{
"indexed": false,
"name": "receiver",
"type": "address"
},
{
"indexed": false,
"name": "value",
"type": "int64"
}
],
"name": "BalanceUpdated",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "_receiver",
"type": "address"
},
{
"name": "_value",
"type": "int64"
}
],
"name": "updateBalance",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_address",
"type": "address"
}
],
"name": "getBalance",
"outputs": [
{
"name": "",
"type": "int64"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
];
export default accountsContractABI;

+ 45
- 8
wallet/src/eth/eth.js

@ -1,15 +1,52 @@
import mem from '../mem/mem';
import accountsContractABI from './accountsContractABI';
import { message } from 'antd';
import Web3 from 'web3'; import Web3 from 'web3';
const web3 = new Web3("https://ropsten.infura.io/TFnR8BWJlqZOKxHHZNcs");
mem.web3 = new Web3("https://ropsten.infura.io/TFnR8BWJlqZOKxHHZNcs");
console.log(mem.web3.version)
var account = web3.eth.accounts.create()
console.log("account", account)
console.log("address", account.address)
web3.eth.getAccounts(function(error, result){
// localStorage.removeItem("privK");
console.log(localStorage.getItem("privK"));
if (localStorage.getItem("privK")!==null) {
var privK = JSON.parse(localStorage.getItem("privK"));
console.log("privK found in localStorage", privK);
mem.account = mem.web3.eth.accounts.privateKeyToAccount(privK);
message.success('PrivateKey found in the local storage. Account imported.');
} else {
console.log("privK not found in localStorage");
mem.account = mem.web3.eth.accounts.create()
localStorage.setItem("privK", JSON.stringify(mem.account.privateKey));
var privK = JSON.parse(localStorage.getItem("privK"));
console.log("saved privK", privK);
message.info('PrivateKey not found in the local storage. Account created and saved.');
}
console.log("account", mem.account)
console.log("address", mem.account.address)
mem.web3.eth.getAccounts(function(error, result){
console.log(result) console.log(result)
}) })
web3.eth.getBalance(account.address)
.then(balance => {
mem.web3.eth.getBalance(mem.account.address)
.then(ethBalance => {
console.log("balance", balance)
console.log("eth balance", ethBalance)
mem.ethBalance = ethBalance;
console.log("eth balance", mem.ethBalance)
}) })
mem.accountsContract = new mem.web3.eth.Contract(accountsContractABI, mem.accountsContractAddr);
console.log("accountsContract: ", mem.accountsContract)
function getBalance(addr) {
return mem.accountsContract.methods.getBalance(addr).call();
}
function sendCredits(receiver, value) {
mem.accountsContract.methods.updateBalance(receiver, value).call();
return;
}
getBalance(mem.account.address).then(function(cr_balance){
console.log("credit balance", cr_balance);
mem.balance=cr_balance;
})

+ 11
- 0
wallet/src/mem/mem.js

@ -0,0 +1,11 @@
// Mem, Memory
let Mem = {
account: {},
accountsContractAddr: "0xf0febc77136cf5d6e8f5c091c20bccffed71227a",
accountsContract: {},
privK: "",
ethBalance: "",
balance: "",
web3: {}
};
export default Mem;

+ 10
- 3
wallet/src/views/dashboard/dashboard.js

@ -1,5 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import mem from '../../mem/mem';
// import {card, tx} from '../../kit/lib' // import {card, tx} from '../../kit/lib'
import { Card, Button, Timeline, Row, Col, List, Icon } from 'antd'; import { Card, Button, Timeline, Row, Col, List, Icon } from 'antd';
import 'antd/dist/antd.css'; import 'antd/dist/antd.css';
@ -46,6 +48,8 @@ class dashboard extends Component {
<div> <div>
<Row gutter={16}> <Row gutter={16}>
<Col span={8}> <Col span={8}>
<p>Current Credit balance: <b>{mem.balance}</b></p>
<p style={{fontSize: 10}}>Current ETH balance: {mem.ethBalance}</p>
<Line <Line
height={200} height={200}
data={chartLineData} data={chartLineData}
@ -69,6 +73,9 @@ class dashboard extends Component {
</List> </List>
</Card> </Card>
</Col> </Col>
<Col span={8}>
</Col>
</Row> </Row>
<br/> <br/>
<Row gutter={16}> <Row gutter={16}>
@ -81,12 +88,12 @@ class dashboard extends Component {
<Timeline.Item color="red"> <Timeline.Item color="red">
Sended 20 credits · <i>2018-08-06</i> Sended 20 credits · <i>2018-08-06</i>
</Timeline.Item> </Timeline.Item>
<Timeline.Item color="green">
Received 15 credits · <i>2018-08-05</i>
</Timeline.Item>
<Timeline.Item color="red"> <Timeline.Item color="red">
Sended 20 credits · <i>2018-08-05</i> Sended 20 credits · <i>2018-08-05</i>
</Timeline.Item> </Timeline.Item>
<Timeline.Item color="green">
Received 15 credits · <i>2018-08-05</i>
</Timeline.Item>
<Timeline.Item color="green"> <Timeline.Item color="green">
Received 15 credits · <i>2018-08-04</i> Received 15 credits · <i>2018-08-04</i>
</Timeline.Item> </Timeline.Item>

+ 61
- 6
wallet/src/views/newtx/newtx.js

@ -1,8 +1,11 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import mem from '../../mem/mem';
// import {card, tx} from '../../kit/lib' // import {card, tx} from '../../kit/lib'
import { Card, Button, Timeline, Row, Col, List, Icon, import { Card, Button, Timeline, Row, Col, List, Icon,
Form, Input, InputNumber, Checkbox } from 'antd';
Form, Input, InputNumber, Checkbox, message,
Progress } from 'antd';
import 'antd/dist/antd.css'; import 'antd/dist/antd.css';
const FormItem = Form.Item; const FormItem = Form.Item;
@ -13,29 +16,81 @@ class newtx extends Component {
super(props); super(props);
this.state = { this.state = {
receiver: '', receiver: '',
value: 0
value: 0,
percent: 0
}; };
this.handleReceiverInputChange = this.handleReceiverInputChange.bind(this);
this.handleValueInputChange = this.handleValueInputChange.bind(this);
this.sendTx = this.sendTx.bind(this);
console.log("addr", mem.account.address);
}
handleReceiverInputChange(event) {
this.setState({receiver: event.target.value})
}
handleValueInputChange(value) {
this.setState({value: value})
}
sendTx(event) {
var receiver = this.state.receiver
console.log("receiver: ", receiver)
var value = this.state.value
console.log("value: ", value)
console.log(mem.accountsContractAddr)
console.log(mem.accountsContract)
console.log("options", mem.accountsContract.options)
mem.accountsContract.options.from = mem.account.address
mem.accountsContract.options.gas = 4000000
console.log("options", mem.accountsContract.options)
this.setState({ percent: this.state.percent + 20})
mem.accountsContract.methods.updateBalance(receiver, value)
.send(
function(error, result) {
if(!error) {
console.log("result: ", result)
this.setState({ percent: 100 })
} else {
console.log("error: ", error)
message.error("Error on sending credits");
this.setState({ percent: 0 })
}
}
);
}
updateProgress(val) {
this.setState({ percent: val })
} }
render() { render() {
const { receiver, value } = this.state; const { receiver, value } = this.state;
return ( return (
<div> <div>
<Row gutter={16}> <Row gutter={16}>
<Col span={12}>
<Col span={14}>
<Card title="New transaction"> <Card title="New transaction">
<Input <Input
placeholder="address" placeholder="address"
prefix={<Icon type="qrcode" style={{ color: 'rgba(0,0,0,.25)' }} />} prefix={<Icon type="qrcode" style={{ color: 'rgba(0,0,0,.25)' }} />}
style={{ width: 200 }}
style={{ width: 400 }}
onChange={this.handleReceiverInputChange}
/> />
<br/><br/> <br/><br/>
<InputNumber <InputNumber
min={0} min={0}
defaultValue={0} defaultValue={0}
style={{marginRight: 10}} />
style={{marginRight: 10}}
onChange={this.handleValueInputChange} />
<Button type="primary" icon="check">Send</Button>
<Button
type="primary"
icon="check"
onClick={this.sendTx}
>
Send
</Button>
<br/><br/>
<Progress percent={this.state.percent} />
</Card> </Card>
</Col> </Col>
</Row> </Row>

+ 32
- 0
wallet/src/views/notyet/notyet.js

@ -0,0 +1,32 @@
import React, { Component } from 'react';
import mem from '../../mem/mem';
// import {card, tx} from '../../kit/lib'
import { Card, Button, Timeline, Row, Col, List, Icon,
Form, Input, InputNumber, Checkbox, message,
Progress } from 'antd';
import 'antd/dist/antd.css';
const FormItem = Form.Item;
class notyet extends Component {
constructor(props) {
super(props);
this.state = {
};
}
render() {
return (
<div>
<Card>
Not yet, but meanwhile, here is a penguin <b style={{fontSize:20}}>🐧</b>
</Card>
</div>
);
}
}
export default notyet;

+ 10
- 2
wallet/src/views/sidemenu/sidemenu.js

@ -34,8 +34,16 @@ class dashboard extends Component {
<Icon type="plus" />New transaction <Icon type="plus" />New transaction
</NavLink> </NavLink>
</Menu.Item> </Menu.Item>
<Menu.Item key="3"><Icon type="calendar" />History</Menu.Item>
<Menu.Item key="4"><Icon type="pie-chart" />Stats</Menu.Item>
<Menu.Item key="3">
<NavLink to="/notyet">
<Icon type="calendar" />History
</NavLink>
</Menu.Item>
<Menu.Item key="4">
<NavLink to="/notyet">
<Icon type="pie-chart" />Stats
</NavLink>
</Menu.Item>
</Menu> </Menu>
); );
} }

Loading…
Cancel
Save