Skip to content

Commit

Permalink
Merge pull request #57 from MyEtherWallet/feature/additional-hw-wallets
Browse files Browse the repository at this point in the history
Feature/additional hw wallets
  • Loading branch information
SteveMieskoski committed Aug 30, 2018
2 parents cf415b6 + 4861706 commit a2424b7
Show file tree
Hide file tree
Showing 88 changed files with 32,128 additions and 946 deletions.
28,287 changes: 28,287 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"dependencies": {
"vue": "^2.5.17",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
"vuex": "^3.0.1",
"websocket": "^1.0.26"
},
"devDependencies": {
"@ledgerhq/hw-app-eth": "^4.21.0",
Expand Down
2 changes: 2 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export default {
const state = {
web3: newWeb3,
network: network,
customPaths:
store.get('customPaths') !== undefined ? store.get('customPaths') : {},
wallet: null,
account: {
balance: 0
Expand Down
18 changes: 9 additions & 9 deletions src/components/FaqContents/HowToBuyEthereumWithUSD.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div>
<h1
id="articleTitleGUIDEHowtobuyEthereumETHwithUSD"
class="page__title"
<h1
id="articleTitleGUIDEHowtobuyEthereumETHwithUSD"
class="page__title"
itemprop="headline">[GUIDE] How to buy Ethereum (ETH) with USD</h1>
<div class="content">
<h3 id="hello-and-welcome-to-ethereum-">Hello and welcome to Ethereum!</h3>
Expand Down Expand Up @@ -118,17 +118,17 @@

<div class="row">
<p class="col">
<a
href="https://github.com/MyEtherWallet/knowledge-base/blob/master/src/content/faq/how-to-buy-ethereum-with-usd.md"
target="_blank"
<a
href="https://github.com/MyEtherWallet/knowledge-base/blob/master/src/content/faq/how-to-buy-ethereum-with-usd.md"
target="_blank"
rel="noopener noreferrer">
Found a typo? Want to improve this article? <br> It's easy!
</a>
</p>
<p class="col">
<a
href="https://kb.myetherwallet.com/diving-deeper/how-to-submit-pull-request.html"
target="_blank"
<a
href="https://kb.myetherwallet.com/diving-deeper/how-to-submit-pull-request.html"
target="_blank"
rel="noopener noreferrer">
Don't know how to submit a pull request? <br> It's also easy!
</a>
Expand Down
13 changes: 9 additions & 4 deletions src/components/Notification/Notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
class="bootstrap-modal-wide nopadding"
@show="countUnread">
<template slot="modal-title">
<h5 class="modal-title"> {{ unreadCount > 1 ? 'Notifications':'Notification' }} <div
v-show="unreadCount > 0"
class="notification-count"><span>{{ unreadCount }}</span></div></h5>
<h5 class="modal-title"> {{ unreadCount > 1 ? 'Notifications':'Notification' }}
<div
v-show="unreadCount > 0"
class="notification-count"><span>{{ unreadCount }}</span>
</div>
</h5>
</template>
<div class="notification-item-container">
<div v-if="sortedNotifications !== undefined && sortedNotifications.length > 0">
Expand Down Expand Up @@ -64,6 +67,9 @@ export default {
}),
sortedNotifications() {
this.countUnread();
if (!this.notifications[this.$store.state.wallet.getAddressString()])
return [];
// eslint-disable-next-line
return this.notifications[this.$store.state.wallet.getAddressString()].sort((a, b) => {
a = new Date(a.timestamp);
Expand Down Expand Up @@ -111,7 +117,6 @@ export default {
this.$refs.notification.show();
},
expand(idx, notif) {
// e.target.nextElementSibling.classList.contains('unexpanded') ? e.target.nextElementSibling.classList.remove('unexpanded') : e.target.nextElementSibling.classList.add('unexpanded')
const updatedNotif = notif;
if (notif.expanded !== true) {
updatedNotif.read = true;
Expand Down
86 changes: 69 additions & 17 deletions src/containers/ConfirmationContainer/ConfirmationContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
<confirm-modal
ref="confirmModal"
:confirm-send-tx="sendTx"
:show-success="showSuccessModal"
:signed-tx="signedTx"
:fee="transactionFee"
:is-hardware-wallet="isHardwareWallet"
:gas-price="$store.state.gasPrice"
:from="fromAddress"
:to="toAddress"
:value="amount"
:gas="gasLimit"
:data="data"
:nonce="nonce + 1"/>
<confirm-modal
ref="offlineGenerateConfirmModal"
:confirm-send-tx="generateTx"
:signed-tx="signedTx"
:fee="transactionFee"
:is-hardware-wallet="isHardwareWallet"
Expand Down Expand Up @@ -41,6 +53,18 @@ export default {
'success-modal': SuccessModal,
'confirm-sign-modal': ConfirmSignModal
},
props: {
active: {
type: Boolean,
default: false
},
rawTx: {
type: Object,
default: function() {
return {};
}
}
},
data() {
return {
isHardwareWallet: false,
Expand All @@ -64,6 +88,7 @@ export default {
messageToSign: '',
signedMessage: '',
successMessage: '',
linkMessage: 'OK',
dismissed: true
};
},
Expand All @@ -75,18 +100,35 @@ export default {
}
},
created() {
this.$eventHub.$on('showSuccessModal', message => {
this.$eventHub.$on('showSuccessModal', (message, linkMessage) => {
if (!message) message = null;
this.showSuccessModal(message);
this.showSuccessModal(message, linkMessage);
});
this.$eventHub.$on(
'showConfirmModal',
(tx, isHardware, signer, resolve) => {
this.parseRawTx(tx);
this.isHardwareWallet = isHardware;
this.responseFunction = resolve;
this.successMessage = 'Sending Transaction';
// this.signer = signer(tx)
signer(tx).then(_response => {
this.signedTxObject = _response;
this.signedTx = this.signedTxObject.rawTransaction;
});
this.confirmationModalOpen();
}
);
this.$eventHub.$on(
'showTxConfirmModal',
(tx, isHardware, signer, resolve) => {
this.parseRawTx(tx);
this.isHardwareWallet = isHardware;
this.responseFunction = resolve;
this.successMessage = 'Sending Transaction';
// this.signer = signer(tx)
signer(tx).then(_response => {
this.signedTxObject = _response;
this.signedTx = this.signedTxObject.rawTransaction;
Expand All @@ -103,52 +145,62 @@ export default {
signer(data).then(_response => {
this.signedMessage = _response;
});
// this.signer = signer(data)
this.signConfirmationModalOpen();
}
);
this.$eventHub.$on('checkConnection', () => {
this.hardwareConnectCheck();
});
this.$on('bv::modal::hide', () => {
},
mounted() {
this.$refs.confirmModal.$refs.confirmation.$on('hidden', () => {
if (this.dismissed) {
this.reset();
}
});
this.$refs.successModal.$refs.success.$on('hide', () => {
this.successMessage = '';
this.linkMessage = 'OK';
});
},
methods: {
hardwareConnectCheck() {},
confirmationModalOpen() {
window.scrollTo(0, 0);
this.$refs.confirmModal.$refs.confirmation.show();
},
confirmationOfflineGenerateModalOpen() {
window.scrollTo(0, 0);
this.$refs.offlineGenerateConfirmModal.$refs.confirmation.show();
},
signConfirmationModalOpen() {
window.scrollTo(0, 0);
this.$refs.signConfirmModal.$refs.signConfirmation.show();
},
showSuccessModal(message) {
this.$refs.successModal.$refs.success.$on('hide', () => {
this.successMessage = '';
});
showSuccessModal(message, linkMessage) {
this.reset();
if (message !== null) this.successMessage = message;
if (linkMessage !== null) this.linkMessage = linkMessage;
this.$refs.successModal.$refs.success.show();
},
parseRawTx(tx) {
this.raw = tx;
this.nonce = tx.nonce;
this.nonce = +tx.nonce;
this.data = tx.data;
this.gasLimit = tx.gas;
this.gasLimit = +tx.gas;
this.toAddress = tx.to;
this.amount = tx.value;
this.amount = +tx.value;
// this.signedTx = this.signedTxObject.rawTransaction
},
messageReturn() {
this.dismissed = false;
this.responseFunction(this.signedMessage);
this.$refs.signConfirmModal.$refs.signConfirmation.hide();
this.showSuccessModal();
},
generateTx() {
this.dismissed = false;
this.responseFunction(this.signedTxObject);
this.$refs.confirmModal.$refs.confirmation.hide();
},
sendTx() {
this.dismissed = false;
this.responseFunction(this.signedTxObject);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class="modal-container">
<b-modal
ref="signConfirmation"
hide-footer
<b-modal
ref="signConfirmation"
hide-footer
centered
class="bootstrap-modal-wide confirmation-modal nopadding"
class="bootstrap-modal-wide confirmation-modal nopadding"
title="Confirmation">
<div class="modal-content qrcode-modal">
<div class="tx-info">
Expand Down Expand Up @@ -33,25 +33,25 @@
<div class="button-with-helper">
<div
ref="ConfirmAndSendButton"
:class="[signedMessage !== ''? '': 'disabled','submit-button large-round-button-green-filled clickable']"
:class="[signedMessage !== ''? '': 'disabled','submit-button large-round-button-green-filled clickable']"
@click="signMessage">
Confirm Signing
</div>
<div class="tooltip-box-2">
<b-btn id="exPopover9">
<img
class="icon"
<img
class="icon"
src="~@/assets/images/icons/qr-code.svg">
</b-btn>
<b-popover
target="exPopover9"
triggers="hover focus"
<b-popover
target="exPopover9"
triggers="hover focus"
placement="top">
<div class="qrcode-contents">
<p class="qrcode-title">Scan QR code to send/swap instantly</p>
<div class="qrcode-block">
<qrcode
:options="{ size: 100 }"
<qrcode
:options="{ size: 100 }"
value="Hello, World!"/>
</div>
<p class="qrcode-helper">What is that?</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export default {
},
methods: {
hideModal() {
if (this.linkTo !== undefined) {
this.$router(this.linkTo);
if (this.linkTo !== '/') {
this.$router.push({ path: this.linkTo });
}
this.$refs.success.hide();
}
Expand Down
30 changes: 15 additions & 15 deletions src/containers/FooterContainer/FooterContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
</p>
</div>
<div class="content-links mobile-hide">
<div
v-for="(content, index) in item.contents"
<div
v-for="(content, index) in item.contents"
:key="content.text+index">
<router-link
v-if="content.to !== undefined"
<router-link
v-if="content.to !== undefined"
:to="content.to"><p>{{ content.text }}</p></router-link>
<a
v-if="content.to === undefined"
:href="content.href"
<a
v-if="content.to === undefined"
:href="content.href"
target="_blank"><p>{{ content.text }}</p></a>
</div>
</div>
Expand All @@ -49,22 +49,22 @@
<div class="content-links">
<p>{{ $t("footer.welcomeDes") }}</p>

<a
href="https://etherscan.io/address/0xDECAF9CD2367cdbb726E904cD6397eDFcAe6068D"
<a
href="https://etherscan.io/address/0xDECAF9CD2367cdbb726E904cD6397eDFcAe6068D"
target="_blank">
<p
class="crypto-link"
<p
class="crypto-link"
data-eth="0xDECAF9CD2367cdbb726E904cD6397eDFcAe6068D">
<img src="~@/assets/images/icons/eth.svg">
&nbsp;Ethereum Donation
</p>
</a>

<a
href="https://blockchain.info/address/1DECAF2uSpFTP4L1fAHR8GCLrPqdwdLse9"
<a
href="https://blockchain.info/address/1DECAF2uSpFTP4L1fAHR8GCLrPqdwdLse9"
target="_blank">
<p
class="crypto-link"
<p
class="crypto-link"
data-btc="1DECAF2uSpFTP4L1fAHR8GCLrPqdwdLse9">
<img src="~@/assets/images/icons/btc.svg">
&nbsp;Bitcoin Donation
Expand Down
10 changes: 4 additions & 6 deletions src/containers/HeaderContainer/HeaderContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ export default {
}
},
mounted() {
const self = this;
if (this.$store.state.online) {
this.online = true;
} else {
Expand All @@ -188,12 +186,12 @@ export default {
)[0].name;
// On load, if page is not on top, apply small menu and show scroll top button
this.onPageScroll();
// this.onPageScroll();
// On scroll, if page is not on top, apply small menu and show scroll top button
window.onscroll = function() {
self.onPageScroll();
};
// window.onscroll = function() {
// self.onPageScroll();
// };
},
methods: {
languageItemClicked(e) {
Expand Down
Loading

1 comment on commit a2424b7

@mew-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.