added code, icons and css for sign and verify message
This commit is contained in:
parent
4c60ba5c81
commit
ef6a572b87
11 changed files with 271 additions and 1 deletions
|
|
@ -242,6 +242,16 @@ div.onboarding-topic {
|
|||
background-image: url('../img/icon-twitter.svg');
|
||||
}
|
||||
|
||||
.icon-sign-message {
|
||||
background-color: #494949;
|
||||
background-image: url('../img/icon-sign-message.svg');
|
||||
}
|
||||
|
||||
.icon-verify-message {
|
||||
background-color: #494949;
|
||||
background-image: url('../img/icon-verify-message.svg');
|
||||
}
|
||||
|
||||
.icon-share {
|
||||
background-color: #494949;
|
||||
background-image: url('../img/icon-share.svg');
|
||||
|
|
|
|||
27
src/js/controllers/signMessageController.js
Normal file
27
src/js/controllers/signMessageController.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('signMessageController', function($scope, $interval, profileService, walletService, popupService, lodash, $ionicNavBarDelegate, signVerifyMessageService) {
|
||||
|
||||
$scope.message = {};
|
||||
$scope.message.value = "";
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$scope.walletSelectorTitle = 'Wallets';
|
||||
$scope.wallets = profileService.getWallets();
|
||||
$scope.wallet = $scope.wallets[0];
|
||||
$scope.showWallets = false;
|
||||
$scope.singleWallet = $scope.wallets.length > 1;
|
||||
});
|
||||
|
||||
$scope.showWalletSelector = function() {
|
||||
$scope.showWallets = true;
|
||||
}
|
||||
|
||||
$scope.onWalletSelect = function(wallet) {
|
||||
$scope.wallet = wallet;
|
||||
}
|
||||
|
||||
$scope.signMessage = function() {
|
||||
$scope.signedMessage = signVerifyMessageService.signMessage($scope.wallet, $scope.message.value);
|
||||
}
|
||||
});
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('tabHomeController',
|
||||
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $window, gettextCatalog, lodash, popupService, ongoingProcess, externalLinkService, latestReleaseService, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, appConfigService, startupService, addressbookService, feedbackService, bwcError, nextStepsService, buyAndSellService, homeIntegrationsService, bitpayCardService, pushNotificationsService, timeService, bitcoincomService, pricechartService, firebaseEventsService, servicesService, shapeshiftService, $ionicNavBarDelegate) {
|
||||
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $window, gettextCatalog, lodash, popupService, ongoingProcess, externalLinkService, latestReleaseService, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, appConfigService, startupService, addressbookService, feedbackService, bwcError, nextStepsService, buyAndSellService, homeIntegrationsService, bitpayCardService, pushNotificationsService, timeService, bitcoincomService, pricechartService, firebaseEventsService, servicesService, shapeshiftService, $ionicNavBarDelegate, signVerifyMessageService) {
|
||||
var wallet;
|
||||
var listeners = [];
|
||||
var notifications = [];
|
||||
|
|
|
|||
4
src/js/controllers/verifyMessageController.js
Normal file
4
src/js/controllers/verifyMessageController.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('verifyMessageController', function($scope, $interval, profileService, walletService, popupService, lodash, $ionicNavBarDelegate, signVerifyMessageService) {
|
||||
});
|
||||
|
|
@ -1016,6 +1016,26 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
}
|
||||
})
|
||||
|
||||
/* Message Signing and Verification */
|
||||
.state('tabs.signMessage', {
|
||||
url: '/signMessage',
|
||||
views: {
|
||||
'tab-home@tabs': {
|
||||
controller: 'signMessageController',
|
||||
templateUrl: 'views/signMessage.html'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('tabs.verifyMessage', {
|
||||
url: '/verifyMessage',
|
||||
views: {
|
||||
'tab-home@tabs': {
|
||||
controller: 'verifyMessageController',
|
||||
templateUrl: 'views/verifyMessage.html'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
/*
|
||||
*
|
||||
* Mercado Libre Gift Card
|
||||
|
|
|
|||
37
src/js/services/signVerifyMessageService.js
Normal file
37
src/js/services/signVerifyMessageService.js
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
'use strict';
|
||||
angular.module('copayApp.services').factory('signVerifyMessageService', function($http, $log, lodash, moment, storageService, configService, platformInfo, servicesService) {
|
||||
var root = {};
|
||||
var credentials = {};
|
||||
|
||||
var signServicesItem = {
|
||||
name: 'signMessage',
|
||||
title: 'Sign Message',
|
||||
icon: 'icon-sign-message',
|
||||
sref: 'tabs.signMessage',
|
||||
};
|
||||
|
||||
/*var verifyServicesItem = {
|
||||
name: 'verifyMessage',
|
||||
title: 'Verify Message',
|
||||
icon: 'icon-verify-message',
|
||||
sref: 'tabs.verifyMessage',
|
||||
};*/
|
||||
|
||||
var register = function() {
|
||||
servicesService.register(signServicesItem);
|
||||
//servicesService.register(verifyServicesItem);
|
||||
};
|
||||
|
||||
root.signMessage = function(wallet, message) {
|
||||
var privKey = wallet.credentials.walletPrivKey;
|
||||
var coin = wallet.coin;
|
||||
return wallet.signMessage(message, privKey, coin);
|
||||
}
|
||||
|
||||
root.verifyMessage = function(message, signature, pubKey, coin) {
|
||||
return wallet.verifyMessage(message, signature, pubKey, coin);
|
||||
}
|
||||
|
||||
register();
|
||||
return root;
|
||||
});
|
||||
|
|
@ -284,6 +284,16 @@ div.slide-success__background.fill-screen {
|
|||
background-image: url('../img/icon-twitter.svg');
|
||||
}
|
||||
|
||||
.icon-sign-message {
|
||||
background-color: #494949;
|
||||
background-image: url('../img/icon-sign-message.svg');
|
||||
}
|
||||
|
||||
.icon-verify-message {
|
||||
background-color: #494949;
|
||||
background-image: url('../img/icon-verify-message.svg');
|
||||
}
|
||||
|
||||
.icon-share {
|
||||
background-color: #494949;
|
||||
background-image: url('../img/icon-share.svg');
|
||||
|
|
|
|||
61
www/img/icon-sign-message.svg
Normal file
61
www/img/icon-sign-message.svg
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1"
|
||||
id="svg8" inkscape:version="0.92.1 r15371" sodipodi:docname="chart.svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000"
|
||||
style="enable-background:new 0 0 1000 1000;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FCB619;}
|
||||
.st1{fill:#494949;}
|
||||
</style>
|
||||
<sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="500.00002" inkscape:cy="499.99999" inkscape:document-units="mm" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:snap-to-guides="false" inkscape:window-height="1017" inkscape:window-maximized="1" inkscape:window-width="1920" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:zoom="0.83599997" pagecolor="#ffffff" showgrid="false" units="px">
|
||||
</sodipodi:namedview>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<rect x="239.7" y="197" class="st0" width="412.8" height="20.3"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect x="239.7" y="281.1" class="st0" width="412.8" height="20.3"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect x="239.7" y="365.1" class="st0" width="412.8" height="20.3"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect x="239.7" y="449.2" class="st0" width="412.8" height="20.3"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect x="239.7" y="533.2" class="st0" width="412.8" height="20.3"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect x="239.7" y="617.3" class="st0" width="412.8" height="20.3"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect x="239.7" y="701.3" class="st0" width="412.8" height="20.3"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st0" d="M690.1,129.9c11.2,0,20.3,9.1,20.3,20.3v699.5c0,11.2-9.1,20.3-20.3,20.3h-488c-11.2,0-20.3-9.1-20.3-20.3
|
||||
V150.2c0-11.2,9.1-20.3,20.3-20.3H690.1 M690.1,101.4h-488c-26.8,0-48.8,22-48.8,48.8v699.5c0,26.8,22,48.8,48.8,48.8h488
|
||||
c26.8,0,48.8-22,48.8-48.8V150.2C738.9,123.4,716.9,101.4,690.1,101.4L690.1,101.4z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st0" d="M616.6,802.2L616.6,802.2c-16.6-8.6,77.8-223.6,95-256.8l187.7-361.7c17.2-33.2,44.8-53.3,61.4-44.7l0,0
|
||||
c16.6,8.6,16.1,42.8-1.1,75.9L771.8,576.7C754.6,609.8,633.2,810.8,616.6,802.2z"/>
|
||||
<g>
|
||||
|
||||
<rect x="610.1" y="399.6" transform="matrix(0.4604 -0.8877 0.8877 0.4604 94.8719 963.7711)" class="st1" width="460.3" height="8.5"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st0" d="M390.8,819c20.1-7.2,41-10.7,61.9-14.4c9.9-1.8,19.8-3.9,29.6-5.9c9.3-1.9,21.1-4.6,30.6-3.7
|
||||
c-2-2-4.1-4.1-6.1-6.1c-0.4,4.1-4.1,8-5,12.2c-0.6,3,0.9,6.9,4.3,7.5c8.1,1.4,15.8,0.2,23.8-1.5c3-0.7,7.8-0.8,10.5-2.4
|
||||
c0.8-0.2,1.7-0.5,2.5-0.7c0.6-4,0.6-5,0-3c-0.3,1.6-0.5,2.4-0.3,4.2c0.4,2.8,1.7,5,4.5,5.9c3.5,1,6.7,1.4,10.3,0.9
|
||||
c3.3-0.5,7.1-3.5,8.9,0c1.3,2.6,4.3,3.2,6.9,2.8c6.2-0.9,10.3-4.4,16.8-2.7c4.6,1.2,7.7,3.1,12.7,3c7.8-0.2,7.9-12.4,0-12.2
|
||||
c-6,0.1-10.9-4.1-17-4c-5.7,0.1-10.2,3.4-15.7,4.2c2.3,0.9,4.6,1.9,6.9,2.8c-6.9-13.8-15.8-3.3-26.5-6.5c1.5,2,3,3.9,4.5,5.9
|
||||
c-0.5-3.9,1.4-6.1-1.2-9.7c-2.3-3.1-6-4.1-9.7-4c-11.7,0.3-22.5,7.4-34.5,5.2c1.4,2.5,2.8,5,4.3,7.5c1.2-5.7,4.8-9.5,5.5-15.4
|
||||
c0.4-3.5-3.1-5.8-6.1-6.1c-8.9-0.8-18.3,1.7-27.1,3c-11,1.7-21.9,4.4-32.8,6.4c-22.1,4-44.3,7.5-65.5,15.1
|
||||
C380.2,809.9,383.3,821.7,390.8,819L390.8,819z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
28
www/img/icon-verify-message.svg
Normal file
28
www/img/icon-verify-message.svg
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1"
|
||||
id="svg8" inkscape:version="0.92.1 r15371" sodipodi:docname="chart.svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000"
|
||||
style="enable-background:new 0 0 1000 1000;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FCB619;}
|
||||
</style>
|
||||
<sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="500.00002" inkscape:cy="499.99999" inkscape:document-units="mm" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:snap-to-guides="false" inkscape:window-height="1017" inkscape:window-maximized="1" inkscape:window-width="1920" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:zoom="0.83599997" pagecolor="#ffffff" showgrid="false" units="px">
|
||||
</sodipodi:namedview>
|
||||
<g>
|
||||
<path class="st0" d="M491.8,702.2c-46.3,0-90.6-4.1-136.8-18.8c-74.1-23.6-151-73-256.9-165.3l-21.5-18.8l18.3-22.4
|
||||
c1.5-1.8,37.4-45.6,97.5-89.5c35.4-25.9,72-46.5,108.9-61.3c46.6-18.8,93.5-28.3,139.6-28.3c95.3,0,163,1.8,232.2,25.6
|
||||
c68,23.5,134.4,67.4,229.2,151.6l21.4,19L905,516.2c-1.5,1.8-36.7,44-93.9,87.5c-33.7,25.7-68.2,46.6-102.4,62.1
|
||||
c-43.5,19.7-86.8,30.9-128.8,33.1C549.3,700.6,520.2,702.2,491.8,702.2z M154.5,493.3c190.6,160.9,265.6,156.9,422.8,148.5
|
||||
c81.1-4.3,154.7-48.1,202-84c28.5-21.6,51.3-43.1,66.2-58.3C685.8,361.9,617.1,355.1,440.8,355.1c-39.4,0-79.9,8.2-120.2,24.3
|
||||
c-32.7,13.1-65.4,31.5-97.2,54.5C193.4,455.8,169.8,477.7,154.5,493.3z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st0" d="M500,671.7c-94.7,0-171.7-77-171.7-171.7c0-94.7,77-171.7,171.7-171.7c94.7,0,171.7,77,171.7,171.7
|
||||
C671.7,594.7,594.7,671.7,500,671.7z M500,379.1c-66.7,0-120.9,54.2-120.9,120.9c0,66.7,54.2,120.9,120.9,120.9
|
||||
S620.9,566.7,620.9,500C620.9,433.3,566.7,379.1,500,379.1z"/>
|
||||
</g>
|
||||
<g>
|
||||
<circle class="st0" cx="500" cy="500" r="69.3"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
55
www/views/signMessage.html
Normal file
55
www/views/signMessage.html
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<ion-view class="settings" show-tabs>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-title>
|
||||
{{'Sign Message'|translate}}
|
||||
</ion-nav-title>
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
</ion-nav-bar>
|
||||
<ion-content>
|
||||
<div class="list card">
|
||||
<div class="item item-heading">
|
||||
<span translate><strong>Wallet</strong></span>
|
||||
</div>
|
||||
<div class="item wallet-selector" ng-click="showWalletSelector()" ng-if="wallets">
|
||||
<a ng-if="wallet" class="item item-sub item-icon-left item-big-icon-left item-icon-right">
|
||||
<i class="icon big-icon-svg" ng-include="'views/includes/walletIcon.html'"></i>
|
||||
<span>
|
||||
{{wallet.name || wallet.id}}
|
||||
</span>
|
||||
<p>
|
||||
<span ng-if="!wallet.balanceHidden"> {{wallet.status.totalBalanceStr}} </span>
|
||||
|
||||
<span ng-if="wallet.balanceHidden" translate>[Balance Hidden]</span>
|
||||
<span class="tab-home__wallet__multisig-number" ng-if="wallet.n > 1">
|
||||
{{wallet.m}}-of-{{wallet.n}}
|
||||
</span>
|
||||
<span class="assertive" ng-if="wallet.error">{{wallet.error}}</span>
|
||||
|
||||
</p>
|
||||
<i ng-if="!singleWallet" class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item-heading">Message To Sign</span>
|
||||
<input type="text" placeholder="Message" ng-model="message.value"/>
|
||||
</div>
|
||||
<div class="item" copy-to-clipboard="signedMessage">
|
||||
<span class="item-heading">Signed Message</span>
|
||||
{{signedMessage}}
|
||||
</div>
|
||||
<div class="item">
|
||||
<button class="button" ng-click="signMessage()">
|
||||
Sign Message
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
<wallet-selector
|
||||
wallet-selector-title="walletSelectorTitle"
|
||||
wallet-selector-wallets="wallets"
|
||||
wallet-selector-selected-wallet="wallet"
|
||||
wallet-selector-show="showWallets"
|
||||
wallet-selector-on-select="onWalletSelect">
|
||||
</wallet-selector>
|
||||
</ion-view>
|
||||
18
www/views/verifyMessage.html
Normal file
18
www/views/verifyMessage.html
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<ion-view class="settings" show-tabs>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-title>
|
||||
{{'Verify Message'|translate}}
|
||||
</ion-nav-title>
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
</ion-nav-bar>
|
||||
<ion-content>
|
||||
</ion-content>
|
||||
<wallet-selector
|
||||
wallet-selector-title="toWalletSelectorTitle"
|
||||
wallet-selector-wallets="toWallets"
|
||||
wallet-selector-selected-wallet="toWallet"
|
||||
wallet-selector-show="showToWallets"
|
||||
wallet-selector-on-select="onToWalletSelect">
|
||||
</wallet-selector>
|
||||
</ion-view>
|
||||
Loading…
Add table
Add a link
Reference in a new issue