diff --git a/js/src/3rdparty/email-verification/index.js b/js/src/3rdparty/email-verification/index.js
new file mode 100644
index 000000000..5b81f3f95
--- /dev/null
+++ b/js/src/3rdparty/email-verification/index.js
@@ -0,0 +1,33 @@
+// Copyright 2015, 2016 Ethcore (UK) Ltd.
+// This file is part of Parity.
+
+// Parity is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Parity is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Parity. If not, see .
+
+import { stringify } from 'querystring';
+
+export const postToServer = (query, isTestnet = false) => {
+ const port = isTestnet ? 28443 : 18443;
+ query = stringify(query);
+ return fetch(`https://email-verification.parity.io:${port}/?` + query, {
+ method: 'POST', mode: 'cors', cache: 'no-store'
+ })
+ .then((res) => {
+ return res.json().then((data) => {
+ if (res.ok) {
+ return data.message;
+ }
+ throw new Error(data.message || 'unknown error');
+ });
+ });
+};
diff --git a/js/src/3rdparty/email-verification/terms-of-service.js b/js/src/3rdparty/email-verification/terms-of-service.js
new file mode 100644
index 000000000..263b7e8f0
--- /dev/null
+++ b/js/src/3rdparty/email-verification/terms-of-service.js
@@ -0,0 +1,23 @@
+// Copyright 2015, 2016 Ethcore (UK) Ltd.
+// This file is part of Parity.
+
+// Parity is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Parity is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Parity. If not, see .
+
+import React from 'react';
+
+export default (
+
+);
diff --git a/js/src/3rdparty/sms-verification/index.js b/js/src/3rdparty/sms-verification/index.js
index c50b2331a..65761223b 100644
--- a/js/src/3rdparty/sms-verification/index.js
+++ b/js/src/3rdparty/sms-verification/index.js
@@ -15,17 +15,6 @@
// along with Parity. If not, see .
import { stringify } from 'querystring';
-import React from 'react';
-
-export const termsOfService = (
-
- - This privacy notice relates to your use of the Parity SMS verification service. We take your privacy seriously and deal in an honest, direct and transparent way when it comes to your data.
- - We collect your phone number when you use this service. This is temporarily kept in memory, and then encrypted and stored in our EU servers. We only retain the cryptographic hash of the number to prevent duplicated accounts. You consent to this use.
- - You pay a fee for the cost of this service using the account you want to verify.
- - Your phone number is transmitted to a third party US SMS verification service Twilio for the sole purpose of the SMS verification. You consent to this use. Twilio’s privacy policy is here: https://www.twilio.com/legal/privacy/developer.
- - Parity Technology Limited is registered in England and Wales under company number
09760015
and complies with the Data Protection Act 1998 (UK). You may contact us via email at admin@parity.io. Our general privacy policy can be found here: https://ethcore.io/legal.html.
-
-);
export const postToServer = (query, isTestnet = false) => {
const port = isTestnet ? 8443 : 443;
diff --git a/js/src/3rdparty/sms-verification/terms-of-service.js b/js/src/3rdparty/sms-verification/terms-of-service.js
new file mode 100644
index 000000000..f61b3c97d
--- /dev/null
+++ b/js/src/3rdparty/sms-verification/terms-of-service.js
@@ -0,0 +1,27 @@
+// Copyright 2015, 2016 Ethcore (UK) Ltd.
+// This file is part of Parity.
+
+// Parity is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Parity is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Parity. If not, see .
+
+import React from 'react';
+
+export default (
+
+ - This privacy notice relates to your use of the Parity SMS verification service. We take your privacy seriously and deal in an honest, direct and transparent way when it comes to your data.
+ - We collect your phone number when you use this service. This is temporarily kept in memory, and then encrypted and stored in our EU servers. We only retain the cryptographic hash of the number to prevent duplicated accounts. You consent to this use.
+ - You pay a fee for the cost of this service using the account you want to verify.
+ - Your phone number is transmitted to a third party US SMS verification service Twilio for the sole purpose of the SMS verification. You consent to this use. Twilio’s privacy policy is here: https://www.twilio.com/legal/privacy/developer.
+ - Parity Technology Limited is registered in England and Wales under company number
09760015
and complies with the Data Protection Act 1998 (UK). You may contact us via email at admin@parity.io. Our general privacy policy can be found here: https://ethcore.io/legal.html.
+
+);
diff --git a/js/src/contracts/abi/email-verification.json b/js/src/contracts/abi/email-verification.json
new file mode 100644
index 000000000..6a7f5a6d0
--- /dev/null
+++ b/js/src/contracts/abi/email-verification.json
@@ -0,0 +1 @@
+[{"constant":false,"inputs":[{"name":"_new","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"reverse","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_who","type":"address"},{"name":"_puzzle","type":"bytes32"},{"name":"_emailHash","type":"bytes32"}],"name":"puzzle","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_who","type":"address"},{"name":"_field","type":"string"}],"name":"getAddress","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_emailHash","type":"bytes32"}],"name":"request","outputs":[],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"_new","type":"uint256"}],"name":"setFee","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_code","type":"bytes32"}],"name":"confirm","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"drain","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_who","type":"address"},{"name":"_field","type":"string"}],"name":"getUint","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_who","type":"address"}],"name":"certified","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"fee","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_who","type":"address"},{"name":"_field","type":"string"}],"name":"get","outputs":[{"name":"","type":"bytes32"}],"payable":false,"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"who","type":"address"},{"indexed":false,"name":"emailHash","type":"bytes32"}],"name":"Requested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"who","type":"address"},{"indexed":true,"name":"emailHash","type":"bytes32"},{"indexed":false,"name":"puzzle","type":"bytes32"}],"name":"Puzzled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"who","type":"address"}],"name":"Confirmed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"who","type":"address"}],"name":"Revoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"old","type":"address"},{"indexed":true,"name":"current","type":"address"}],"name":"NewOwner","type":"event"}]
\ No newline at end of file
diff --git a/js/src/contracts/abi/index.js b/js/src/contracts/abi/index.js
index 35f96b924..ec5b49383 100644
--- a/js/src/contracts/abi/index.js
+++ b/js/src/contracts/abi/index.js
@@ -19,6 +19,7 @@ import basiccoin from './basiccoin.json';
import basiccoinmanager from './basiccoinmanager.json';
import dappreg from './dappreg.json';
import eip20 from './eip20.json';
+import emailverification from './email-verification.json';
import gavcoin from './gavcoin.json';
import githubhint from './githubhint.json';
import owned from './owned.json';
@@ -34,6 +35,7 @@ export {
basiccoinmanager,
dappreg,
eip20,
+ emailverification,
gavcoin,
githubhint,
owned,
diff --git a/js/src/contracts/contracts.js b/js/src/contracts/contracts.js
index 8cab3252d..a1a81a8ee 100644
--- a/js/src/contracts/contracts.js
+++ b/js/src/contracts/contracts.js
@@ -19,7 +19,7 @@ import Registry from './registry';
import SignatureReg from './signaturereg';
import TokenReg from './tokenreg';
import GithubHint from './githubhint';
-import * as smsVerification from './sms-verification';
+import * as verification from './verification';
import BadgeReg from './badgereg';
let instance = null;
@@ -58,7 +58,11 @@ export default class Contracts {
}
get smsVerification () {
- return smsVerification;
+ return verification;
+ }
+
+ get emailVerification () {
+ return verification;
}
static create (api) {
diff --git a/js/src/contracts/sms-verification.js b/js/src/contracts/verification.js
similarity index 100%
rename from js/src/contracts/sms-verification.js
rename to js/src/contracts/verification.js
diff --git a/js/src/modals/SMSVerification/Done/done.css b/js/src/modals/Verification/Done/done.css
similarity index 100%
rename from js/src/modals/SMSVerification/Done/done.css
rename to js/src/modals/Verification/Done/done.css
diff --git a/js/src/modals/SMSVerification/Done/done.js b/js/src/modals/Verification/Done/done.js
similarity index 100%
rename from js/src/modals/SMSVerification/Done/done.js
rename to js/src/modals/Verification/Done/done.js
diff --git a/js/src/modals/SMSVerification/Done/index.js b/js/src/modals/Verification/Done/index.js
similarity index 100%
rename from js/src/modals/SMSVerification/Done/index.js
rename to js/src/modals/Verification/Done/index.js
diff --git a/js/src/modals/SMSVerification/GatherData/gatherData.css b/js/src/modals/Verification/GatherData/gatherData.css
similarity index 96%
rename from js/src/modals/SMSVerification/GatherData/gatherData.css
rename to js/src/modals/Verification/GatherData/gatherData.css
index 680986981..13563b6a5 100644
--- a/js/src/modals/SMSVerification/GatherData/gatherData.css
+++ b/js/src/modals/Verification/GatherData/gatherData.css
@@ -15,10 +15,6 @@
/* along with Parity. If not, see .
*/
-.list li {
- padding: .1em 0;
-}
-
.spacing {
margin-top: 1.5em;
}
diff --git a/js/src/modals/SMSVerification/GatherData/gatherData.js b/js/src/modals/Verification/GatherData/gatherData.js
similarity index 77%
rename from js/src/modals/SMSVerification/GatherData/gatherData.js
rename to js/src/modals/Verification/GatherData/gatherData.js
index 289374846..57386ed20 100644
--- a/js/src/modals/SMSVerification/GatherData/gatherData.js
+++ b/js/src/modals/Verification/GatherData/gatherData.js
@@ -25,41 +25,33 @@ import { fromWei } from '~/api/util/wei';
import { Form, Input } from '~/ui';
import { nullableProptype } from '~/util/proptypes';
-import { termsOfService } from '../../../3rdparty/sms-verification';
+import smsTermsOfService from '~/3rdparty/sms-verification/terms-of-service';
+import emailTermsOfService from '~/3rdparty/email-verification/terms-of-service';
+import { howSMSVerificationWorks, howEmailVerificationWorks } from '../how-it-works';
import styles from './gatherData.css';
export default class GatherData extends Component {
static propTypes = {
fee: React.PropTypes.instanceOf(BigNumber),
- isNumberValid: PropTypes.bool.isRequired,
+ method: PropTypes.string.isRequired,
+ fields: PropTypes.array.isRequired,
isVerified: nullableProptype(PropTypes.bool.isRequired),
hasRequested: nullableProptype(PropTypes.bool.isRequired),
- setNumber: PropTypes.func.isRequired,
setConsentGiven: PropTypes.func.isRequired
}
render () {
- const { isNumberValid, isVerified } = this.props;
+ const { method, isVerified } = this.props;
+ const termsOfService = method === 'email' ? emailTermsOfService : smsTermsOfService;
+ const howItWorks = method === 'email' ? howEmailVerificationWorks : howSMSVerificationWorks;
return (