Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10,300 changes: 0 additions & 10,300 deletions package-lock.json

This file was deleted.

15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "crypto20-withdraw",
"version": "0.1.0",
"version": "2.1.0",
"private": true,
"dependencies": {
"autoprefixer": "7.1.6",
"babel-core": "6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "7.2.3",
"babel-jest": "20.0.3",
"babel-loader": "7.1.2",
Expand All @@ -14,6 +14,7 @@
"chalk": "1.1.3",
"create-react-class": "^15.6.2",
"css-loader": "0.28.7",
"domkit": "0.0.1",
"dotenv": "4.0.0",
"eslint": "4.10.0",
"eslint-config-react-app": "^2.0.1",
Expand Down Expand Up @@ -43,10 +44,9 @@
"redux-thunk": "^2.2.0",
"style-loader": "0.19.0",
"sw-precache-webpack-plugin": "0.11.4",
"truffle-contract": "^3.0.6",
"url-loader": "0.6.2",
"web3": "^0.20.1",
"webpack": "3.8.1",
"webpack-dev-server": "2.9.4",
"web3": "^0.20.7",
"webpack-manifest-plugin": "1.3.2",
"whatwg-fetch": "2.0.3",
"yup": "^0.23.0"
Expand Down Expand Up @@ -97,5 +97,10 @@
},
"eslintConfig": {
"extends": "react-app"
},
"devDependencies": {
"@webpack-cli/init": "^0.1.2",
"webpack": "^3.12.0",
"webpack-dev-server": "^2.9.4"
}
}
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link rel="shortcut icon" href=https://cdn.crypto20.com/images/favicons/favicon.ico>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand All @@ -19,7 +19,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Crypto20 DApp</title>
</head>
<body>
<noscript>
Expand Down
6 changes: 3 additions & 3 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Crypto20 DApp",
"name": "Crypto20 DApp",
"icons": [
{
"src": "favicon.ico",
"src": "https://cdn.crypto20.com/images/favicons/favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
Expand Down
6 changes: 3 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ const TopBar = ({price}) =>{
<div className="row">
<div className="col-xs-4">
<h4 className="name">CRYPTO20</h4>
<img alt="C20 Icon" className="c20-icon" src="https://static.crypto20.com/images/icons/c20-alt-2-darkblue.png" />
<img alt="C20 Icon" className="c20-icon" src="https://cdn.crypto20.com/images/icons/c20-alt-2-darkblue.png" />
</div>
<div className="col-xs-8 text-right">
<div className="updated">updated {updatedTime} minutes ago..</div>
<div className="price-big crypto20"></div>
<div className="crypto20"><img alt="C20 Icon" className="ccc" src="https://static.crypto20.com/images/icons/c20-alt-2-darkblue.png" />{totalSupply}<small> IN CIRCULATION</small></div>
<div className="crypto20"><img alt="C20 Icon" className="ccc" src="https://cdn.crypto20.com/images/icons/c20-alt-2-darkblue.png" />{totalSupply}<small> IN CIRCULATION</small></div>
<div className="crypto20">${marketCap}<small> MARKET CAP</small></div>
</div>
</div>
Expand Down Expand Up @@ -103,7 +103,7 @@ const Body = ({usersType, address, price}) => {
</div>
<div className="row">
<div className="col-xxs-6 col-xxs-push-3 col-xs-4 col-xs-push-0">
<img alt="C20 Icon" className="img-responsive" src="https://static.crypto20.com/images/logos/metamask.png" />
<img alt="C20 Icon" className="img-responsive" src="https://cdn.crypto20.com/images/logos/metamask.png" />
</div>
<PriceTable price={price}/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Containers/RequestWithdraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const MyInnerForm = props => {
</tr>
<tr>
<td>
<img alt="C20 Icon" className="ccc" src="https://static.crypto20.com/images/icons/c20-alt-2-darkblue.png" />
<img alt="C20 Icon" className="ccc" src="https://cdn.crypto20.com/images/icons/c20-alt-2-darkblue.png" />
{tokenDisplayAmount}
</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion src/Containers/Send.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
// </tr>
// <tr>
// <td>
// <img alt="C20 Icon" className="ccc" src="https://static.crypto20.com/images/icons/c20-alt-2-darkblue.png" />
// <img alt="C20 Icon" className="ccc" src="https://cdn.crypto20.com/images/icons/c20-alt-2-darkblue.png" />
// {tokenDisplayAmount}
// </td>
// <td>
Expand Down
4 changes: 2 additions & 2 deletions src/Containers/Withdraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const MyInnerForm = props => {
</tr>
<tr>
<td>
<img alt="C20 Icon" className="ccc" src="https://static.crypto20.com/images/icons/c20-alt-2-darkblue.png" />
<img alt="C20 Icon" className="ccc" src="https://cdn.crypto20.com/images/icons/c20-alt-2-darkblue.png" />
{tokenDisplayAmount}
</td>
<td>
Expand Down Expand Up @@ -121,7 +121,7 @@ class Withdraw extends Component {
</tr>
<tr>
<td>
<img alt="C20 Icon" className="ccc" src="https://static.crypto20.com/images/icons/c20-alt-2-darkblue.png" />
<img alt="C20 Icon" className="ccc" src="https://cdn.crypto20.com/images/icons/c20-alt-2-darkblue.png" />
</td>
<td>
<i className="cc ETH" /></td><td><i className="fa fa-dollar" />
Expand Down
12 changes: 8 additions & 4 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ export const loadUserBalance = (c20Instance, account) => dispatch =>

// get the price of Ether in USD
export const getEtherPrice = displayCurrency => dispatch =>
request('https://api.coinmarketcap.com/v1/ticker/ethereum/?convert=USD', (err, response, priceData) => {
//request('https://api.coinmarketcap.com/v1/ticker/ethereum/?convert=USD', (err, response, priceData) => {
request('https://api.coinmarketcap.com/v2/ticker/1027/?limit=10&structure=array&convert=BTC', (err, response, priceData) => {
if (err) dispatch ({
type: actions.SAVE_ETHER_PRICE,
wasError: true,
Expand All @@ -143,9 +144,12 @@ export const getEtherPrice = displayCurrency => dispatch =>
dispatch ({
type: actions.SAVE_ETHER_PRICE,
wasError: false,
price: priceObj[0]['price_usd'],
price_btc: priceObj[0].price_btc,
last_updated: priceObj[0].last_updated,
//price: priceObj[0]['price_usd'],
//price: priceObj[0][0]['quotes']['USD']['price'],
price: priceObj.data[0].quotes.USD.price,
//price_btc: priceObj[0].price_btc,
price_btc: priceObj.data[0].quotes.BTC.price,
last_updated: priceObj.data[0].last_updated,
})
})

Expand Down
2 changes: 1 addition & 1 deletion src/components/PriceTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const PriceTable = ({price}) => {
<tr>
<td>C20 Total:</td>
<td style={{display: 'flex', flexDirection: 'row'}}>
<img alt="C20 Icon" className="ccc" src="https://static.crypto20.com/images/icons/c20-alt-2-darkblue.png" />
<img alt="C20 Icon" className="ccc" src="https://cdn.crypto20.com/images/icons/c20-alt-2-darkblue.png" />
{c20Balance}
</td>
</tr>
Expand Down
17 changes: 16 additions & 1 deletion src/utils/getC20Instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@ import getTransactionReceiptMined from '../utils/getTransactionReceiptMined.js'

const getC20Instance = () => new Promise((resolve, reject) => {
// Wait for loading completion to avoid race conditions with web3 injection timing.
window.addEventListener('load', function() {
window.addEventListener('load', async() => {

let result
let web3 = window.web3
let provider

if (window.ethereum)
{
window.web3 = new Web3(window.ethereum);
try {
// Request account access if needed
await window.ethereum.enable();
// Acccounts now exposed
console.log(window.ethereum);
} catch (error) {
//alert('access denied');
console.log('access denied');
}
}

// Checking if Web3 has been injected by the browser (Mist/MetaMask)
if (typeof web3 !== 'undefined') {
// Use Mist/MetaMask's provider.
Expand Down