mirror of https://github.com/BTCPrivate/copay.git
Refactor Glidera Authorization process
This commit is contained in:
parent
fc52a8cf87
commit
fcae682954
|
@ -1,72 +1,37 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('glideraController',
|
||||
function($scope, $timeout, $ionicModal, $log, storageService, glideraService, ongoingProcess, platformInfo, externalLinkService, popupService, gettextCatalog) {
|
||||
|
||||
$scope.network = glideraService.getEnvironment();
|
||||
function($scope, $timeout, $ionicModal, $log, storageService, glideraService, ongoingProcess, platformInfo, externalLinkService, popupService, lodash) {
|
||||
|
||||
$scope.openExternalLink = function(url) {
|
||||
externalLinkService.open(url);
|
||||
};
|
||||
|
||||
var initGlidera = function(accessToken) {
|
||||
$scope.token = accessToken;
|
||||
$scope.permissions = null;
|
||||
$scope.email = null;
|
||||
$scope.personalInfo = null;
|
||||
$scope.txs = null;
|
||||
$scope.status = null;
|
||||
$scope.limits = null;
|
||||
var init = function() {
|
||||
glideraService.init(function(err, data) {
|
||||
if (err || lodash.isEmpty(data)) return;
|
||||
|
||||
$scope.connectingGlidera = true;
|
||||
ongoingProcess.set('connectingGlidera', true);
|
||||
glideraService.init($scope.token, function(err, glidera) {
|
||||
ongoingProcess.set('connectingGlidera');
|
||||
$scope.connectingGlidera = false;
|
||||
if (err || !glidera) {
|
||||
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||
return;
|
||||
}
|
||||
$scope.token = glidera.token;
|
||||
$scope.permissions = glidera.permissions;
|
||||
$scope.update({
|
||||
fullUpdate: true
|
||||
$scope.account['token'] = data.token;
|
||||
$scope.account['status'] = data.status;
|
||||
$scope.account['price'] = {};
|
||||
|
||||
glideraService.buyPrice($scope.account.token, {qty: 1}, function(err, buy) {
|
||||
$scope.account.price['buy'] = buy.price;
|
||||
});
|
||||
glideraService.sellPrice($scope.account.token, {qty: 1}, function(err, sell) {
|
||||
$scope.account.price['sell'] = sell.price;
|
||||
});
|
||||
|
||||
$timeout(function() {
|
||||
$scope.$digest();
|
||||
$scope.update();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.update = function(opts) {
|
||||
if (!$scope.token || !$scope.permissions) return;
|
||||
$log.debug('Updating Glidera Account...');
|
||||
var accessToken = $scope.token;
|
||||
var permissions = $scope.permissions;
|
||||
|
||||
opts = opts || {};
|
||||
|
||||
glideraService.getStatus(accessToken, function(err, data) {
|
||||
$scope.status = data;
|
||||
});
|
||||
|
||||
glideraService.getLimits(accessToken, function(err, limits) {
|
||||
$scope.limits = limits;
|
||||
});
|
||||
|
||||
if (permissions.transaction_history) {
|
||||
glideraService.getTransactions(accessToken, function(err, data) {
|
||||
$scope.txs = data;
|
||||
});
|
||||
}
|
||||
|
||||
if (permissions.view_email_address && opts.fullUpdate) {
|
||||
glideraService.getEmail(accessToken, function(err, data) {
|
||||
$scope.email = data.email;
|
||||
});
|
||||
}
|
||||
if (permissions.personal_info && opts.fullUpdate) {
|
||||
glideraService.getPersonalInfo(accessToken, function(err, data) {
|
||||
$scope.personalInfo = data;
|
||||
});
|
||||
}
|
||||
$log.debug('Updating Glidera...');
|
||||
glideraService.updateStatus($scope.account);
|
||||
};
|
||||
|
||||
$scope.getAuthenticateUrl = function() {
|
||||
|
@ -75,29 +40,22 @@ angular.module('copayApp.controllers').controller('glideraController',
|
|||
|
||||
$scope.submitOauthCode = function(code) {
|
||||
ongoingProcess.set('connectingGlidera', true);
|
||||
$timeout(function() {
|
||||
glideraService.getToken(code, function(err, data) {
|
||||
glideraService.authorize(code, function(err, data) {
|
||||
ongoingProcess.set('connectingGlidera', false);
|
||||
if (err) {
|
||||
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||
} else if (data && data.access_token) {
|
||||
storageService.setGlideraToken($scope.network, data.access_token, function() {
|
||||
initGlidera(data.access_token);
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 100);
|
||||
});
|
||||
popupService.showAlert('Authorisation error', err);
|
||||
return;
|
||||
}
|
||||
init();
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
|
||||
$scope.openTxModal = function(token, tx) {
|
||||
$scope.openTxModal = function(tx) {
|
||||
$scope.tx = tx;
|
||||
|
||||
glideraService.getTransaction(token, tx.transactionUuid, function(err, tx) {
|
||||
glideraService.getTransaction($scope.account.token, tx.transactionUuid, function(err, tx) {
|
||||
if (err) {
|
||||
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Could not get transactions'));
|
||||
popupService.showAlert('Error getting transaction', 'Could not get transactions');
|
||||
return;
|
||||
}
|
||||
$scope.tx = tx;
|
||||
|
@ -127,10 +85,10 @@ angular.module('copayApp.controllers').controller('glideraController',
|
|||
$scope.openSupportWindow = function() {
|
||||
var url = glideraService.getSupportUrl();
|
||||
var optIn = true;
|
||||
var title = gettextCatalog.getString('Glidera Support');
|
||||
var message = gettextCatalog.getString('You can email glidera at support@glidera.io for direct support, or you can contact Glidera on Twitter.');
|
||||
var okText = gettextCatalog.getString('Tweet @GlideraInc');
|
||||
var cancelText = gettextCatalog.getString('Go Back');
|
||||
var title = 'Glidera Support';
|
||||
var message = 'You can email glidera at support@glidera.io for direct support, or you can contact Glidera on Twitter.';
|
||||
var okText = 'Tweet @GlideraInc';
|
||||
var cancelText = 'Go Back';
|
||||
externalLinkService.open(url, optIn, title, message, okText, cancelText);
|
||||
}
|
||||
|
||||
|
@ -147,8 +105,10 @@ angular.module('copayApp.controllers').controller('glideraController',
|
|||
}
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$scope.network = glideraService.getNetwork();
|
||||
$scope.showOauthForm = false;
|
||||
initGlidera();
|
||||
$scope.account = {};
|
||||
init();
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -1,46 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesGlideraController',
|
||||
function($scope, $log, $timeout, $state, $ionicHistory, ongoingProcess, glideraService, popupService, gettextCatalog) {
|
||||
|
||||
$scope.update = function(opts) {
|
||||
if (!$scope.token || !$scope.permissions) return;
|
||||
$log.debug('Updating Glidera Account...');
|
||||
var accessToken = $scope.token;
|
||||
var permissions = $scope.permissions;
|
||||
|
||||
opts = opts || {};
|
||||
|
||||
glideraService.getStatus(accessToken, function(err, data) {
|
||||
$scope.status = data;
|
||||
});
|
||||
|
||||
glideraService.getLimits(accessToken, function(err, limits) {
|
||||
$scope.limits = limits;
|
||||
});
|
||||
|
||||
if (permissions.transaction_history) {
|
||||
glideraService.getTransactions(accessToken, function(err, data) {
|
||||
$scope.txs = data;
|
||||
});
|
||||
}
|
||||
|
||||
if (permissions.view_email_address && opts.fullUpdate) {
|
||||
glideraService.getEmail(accessToken, function(err, data) {
|
||||
$scope.email = data;
|
||||
});
|
||||
}
|
||||
if (permissions.personal_info && opts.fullUpdate) {
|
||||
glideraService.getPersonalInfo(accessToken, function(err, data) {
|
||||
$scope.personalInfo = data;
|
||||
});
|
||||
}
|
||||
};
|
||||
function($scope, $timeout, $state, $ionicHistory, glideraService, popupService) {
|
||||
|
||||
$scope.revokeToken = function() {
|
||||
popupService.showConfirm('Glidera', 'Are you sure you would like to log out of your Glidera account?', null, null, function(res) {
|
||||
if (res) {
|
||||
glideraService.removeToken(function() {
|
||||
glideraService.remove(function() {
|
||||
$ionicHistory.clearHistory();
|
||||
$timeout(function() {
|
||||
$state.go('tabs.home');
|
||||
|
@ -50,21 +16,20 @@ angular.module('copayApp.controllers').controller('preferencesGlideraController'
|
|||
});
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data){
|
||||
$scope.network = glideraService.getEnvironment();
|
||||
$scope.$on("$ionicView.afterEnter", function(event, data){
|
||||
glideraService.updateStatus($scope.account);
|
||||
});
|
||||
|
||||
ongoingProcess.set('connectingGlidera', true);
|
||||
glideraService.init($scope.token, function(err, glidera) {
|
||||
ongoingProcess.set('connectingGlidera');
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data){
|
||||
$scope.account = {};
|
||||
glideraService.init(function(err, glidera) {
|
||||
if (err || !glidera) {
|
||||
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||
if (err) popupService.showAlert('Error connecting Glidera', err);
|
||||
return;
|
||||
}
|
||||
$scope.token = glidera.token;
|
||||
$scope.permissions = glidera.permissions;
|
||||
$scope.update({
|
||||
fullUpdate: true
|
||||
});
|
||||
$scope.account['token'] = glidera.token;
|
||||
$scope.account['permissions'] = glidera.permissions;
|
||||
$scope.account['status'] = glidera.status;
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').factory('glideraService', function($http, $log, $window, platformInfo, storageService, buyAndSellService) {
|
||||
angular.module('copayApp.services').factory('glideraService', function($http, $log, $window, platformInfo, storageService, buyAndSellService, lodash) {
|
||||
var root = {};
|
||||
var credentials = {};
|
||||
var isCordova = platformInfo.isCordova;
|
||||
|
@ -45,7 +45,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
|||
};
|
||||
};
|
||||
|
||||
root.getEnvironment = function() {
|
||||
root.getNetwork = function() {
|
||||
return credentials.NETWORK;
|
||||
};
|
||||
|
||||
|
@ -61,11 +61,15 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
|||
return credentials.HOST + '/oauth2/auth?response_type=code&client_id=' + credentials.CLIENT_ID + '&redirect_uri=' + credentials.REDIRECT_URI;
|
||||
};
|
||||
|
||||
root.removeToken = function(cb) {
|
||||
root.remove = function(cb) {
|
||||
storageService.removeGlideraToken(credentials.NETWORK, function() {
|
||||
storageService.removeGlideraPermissions(credentials.NETWORK, function() {
|
||||
storageService.removeGlideraStatus(credentials.NETWORK, function() {
|
||||
buyAndSellService.updateLink('glidera', false);
|
||||
return cb();
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
root.getToken = function(code, cb) {
|
||||
|
@ -87,8 +91,6 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
|||
|
||||
$http(req).then(function(data) {
|
||||
$log.info('Glidera Authorization Access Token: SUCCESS');
|
||||
// Show pending task from the UI
|
||||
storageService.setNextStep('BuyAndSell', 'true', function(err) {});
|
||||
return cb(null, data.data);
|
||||
}, function(data) {
|
||||
$log.error('Glidera Authorization Access Token: ERROR ' + data.statusText);
|
||||
|
@ -96,6 +98,31 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
|||
});
|
||||
};
|
||||
|
||||
root.authorize = function(code, cb) {
|
||||
root.getToken(code, function(err, data) {
|
||||
if (err) return cb(err);
|
||||
if (data && !data.access_token) return cb('No access token');
|
||||
var accessToken = data.access_token;
|
||||
root.getAccessTokenPermissions(accessToken, function(err, p) {
|
||||
if (err) return cb(err);
|
||||
root.getStatus(accessToken, function(err, status) {
|
||||
if (err) $log.error(err);
|
||||
storageService.setGlideraToken(credentials.NETWORK, accessToken, function() {
|
||||
storageService.setGlideraPermissions(credentials.NETWORK, JSON.stringify(p), function() {
|
||||
storageService.setGlideraStatus(credentials.NETWORK, JSON.stringify(status), function() {
|
||||
return cb(null, {
|
||||
token: accessToken,
|
||||
permissions: p,
|
||||
status: status
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _get = function(endpoint, token) {
|
||||
return {
|
||||
method: 'GET',
|
||||
|
@ -289,40 +316,65 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
|||
});
|
||||
};
|
||||
|
||||
root.init = function(accessToken, cb) {
|
||||
$log.debug('Init Glidera...');
|
||||
|
||||
var glidera = {
|
||||
token: null,
|
||||
permissions: null
|
||||
root.init = function(cb) {
|
||||
if (lodash.isEmpty(credentials.CLIENT_ID)) {
|
||||
return cb('Glidera is Disabled');
|
||||
}
|
||||
$log.debug('Trying to initialise Glidera...');
|
||||
|
||||
var getToken = function(cb) {
|
||||
if (accessToken) {
|
||||
cb(null, accessToken);
|
||||
} else {
|
||||
storageService.getGlideraToken(credentials.NETWORK, cb);
|
||||
}
|
||||
};
|
||||
storageService.getGlideraToken(credentials.NETWORK, function(err, accessToken) {
|
||||
if (err || lodash.isEmpty(accessToken)) return cb();
|
||||
|
||||
getToken(function(err, accessToken) {
|
||||
if (err || !accessToken) return cb();
|
||||
else {
|
||||
storageService.getGlideraPermissions(credentials.NETWORK, function(err, permissions) {
|
||||
if (lodash.isString(permissions)) permissions = JSON.parse(permissions);
|
||||
storageService.getGlideraStatus(credentials.NETWORK, function(err, status) {
|
||||
if (lodash.isString(status)) status = JSON.parse(status);
|
||||
buyAndSellService.updateLink('glidera', true);
|
||||
|
||||
root.getAccessTokenPermissions(accessToken, function(err, p) {
|
||||
if (err) {
|
||||
return cb(err);
|
||||
} else {
|
||||
glidera.token = accessToken;
|
||||
glidera.permissions = p;
|
||||
return cb(null, glidera);
|
||||
}
|
||||
return cb(null, {
|
||||
token: accessToken,
|
||||
permissions: permissions,
|
||||
status: status
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
root.updateStatus = function(data) {
|
||||
storageService.getGlideraToken(credentials.NETWORK, function(err, accessToken) {
|
||||
if (err) return;
|
||||
root.getAccessTokenPermissions(accessToken, function(err, permissions) {
|
||||
if (err) return;
|
||||
storageService.setGlideraPermissions(credentials.NETWORK, JSON.stringify(permissions), function() {});
|
||||
data.permissions = permissions;
|
||||
root.getStatus(accessToken, function(err, status) {
|
||||
data.status = status;
|
||||
storageService.setGlideraStatus(credentials.NETWORK, JSON.stringify(status), function() {});
|
||||
|
||||
root.getLimits(accessToken, function(err, limits) {
|
||||
data.limits = limits;
|
||||
|
||||
if (permissions.transaction_history) {
|
||||
root.getTransactions(accessToken, function(err, txs) {
|
||||
data.txs = txs;
|
||||
});
|
||||
}
|
||||
|
||||
if (permissions.view_email_address) {
|
||||
root.getEmail(accessToken, function(err, email) {
|
||||
data.email = email;
|
||||
});
|
||||
}
|
||||
if (permissions.personal_info) {
|
||||
root.getPersonalInfo(accessToken, function(err, info) {
|
||||
data.personalInfo = info;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var register = function() {
|
||||
if (isWindowsPhoneApp) return;
|
||||
|
|
|
@ -247,6 +247,30 @@ angular.module('copayApp.services')
|
|||
storage.remove('glideraToken-' + network, cb);
|
||||
};
|
||||
|
||||
root.setGlideraPermissions = function(network, p, cb) {
|
||||
storage.set('glideraPermissions-' + network, p, cb);
|
||||
};
|
||||
|
||||
root.getGlideraPermissions = function(network, cb) {
|
||||
storage.get('glideraPermissions-' + network, cb);
|
||||
};
|
||||
|
||||
root.removeGlideraPermissions = function(network, cb) {
|
||||
storage.remove('glideraPermissions-' + network, cb);
|
||||
};
|
||||
|
||||
root.setGlideraStatus = function(network, status, cb) {
|
||||
storage.set('glideraStatus-' + network, status, cb);
|
||||
};
|
||||
|
||||
root.getGlideraStatus = function(network, cb) {
|
||||
storage.get('glideraStatus-' + network, cb);
|
||||
};
|
||||
|
||||
root.removeGlideraStatus = function(network, cb) {
|
||||
storage.remove('glideraStatus-' + network, cb);
|
||||
};
|
||||
|
||||
root.setCoinbaseRefreshToken = function(network, token, cb) {
|
||||
storage.set('coinbaseRefreshToken-' + network, token, cb);
|
||||
};
|
||||
|
|
|
@ -4,30 +4,24 @@
|
|||
</ion-nav-back-button>
|
||||
<ion-nav-title>Glidera</ion-nav-title>
|
||||
<ion-nav-buttons side="secondary">
|
||||
<button class="button button-clear button-small ng-hide" ng-show="!token && !connectingGlidera" ng-click="toggleOauthForm()">
|
||||
<span ng-hide="showOauthForm" translate>Enter Code</span>
|
||||
<span ng-show="showOauthForm" translate>Restart</span>
|
||||
<button class="button button-clear button-small ng-hide" ng-show="!account.token" ng-click="toggleOauthForm()">
|
||||
<span ng-hide="showOauthForm">Enter Code</span>
|
||||
<span ng-show="showOauthForm">Restart</span>
|
||||
</button>
|
||||
<button class="button button-clear button-small ng-hide" ng-show="token && !connectingGlidera && status && !status.userCanTransact" ng-click="retry()" translate>
|
||||
<button class="button button-clear button-small ng-hide" ng-show="account.token && account.status && !account.status.userCanTransact" ng-click="retry()">
|
||||
Refresh
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
<ion-content scroll="false" class="ng-hide" ng-show="!token && !connectingGlidera">
|
||||
<div class="box-notification error m0" ng-show="!network">
|
||||
The Glidera integration is currently disabled.
|
||||
</div>
|
||||
<div class="box-notification warning m0" ng-show="network == 'testnet'">
|
||||
Testnet wallets only work with Glidera Sandbox Accounts.
|
||||
</div>
|
||||
<ion-content scroll="false" class="ng-hide" ng-show="!account.token">
|
||||
<div class="integration-onboarding">
|
||||
<div class="integration-onboarding-logo">
|
||||
<img src="img/glidera-logo.png">
|
||||
</div>
|
||||
<div class="integration-onboarding-description" ng-hide="showOauthForm" translate>Glidera's exchange service is available in the United States, and can take 1-2 weeks to buy or sell bitcoin.</div>
|
||||
<div class="integration-onboarding-description" ng-show="showOauthForm" translate>If you have trouble, contact Glidera support for direct assistance.</div>
|
||||
<div class="integration-onboarding-description" ng-hide="showOauthForm">Glidera's exchange service is available in the United States, and can take 1-2 weeks to buy or sell bitcoin.</div>
|
||||
<div class="integration-onboarding-description" ng-show="showOauthForm">If you have trouble, contact Glidera support for direct assistance.</div>
|
||||
<div class="integration-onboarding-cta" ng-show="!showOauthForm">
|
||||
<button class="button button-standard button-primary" ng-click="openAuthenticateWindow()" translate>Connect to Glidera</button>
|
||||
<button type="button" class="button button-standard button-secondary" ng-click="openSupportWindow()" translate>Glidera Support →</button>
|
||||
<button class="button button-standard button-primary" ng-click="openAuthenticateWindow()">Connect to Glidera</button>
|
||||
<button type="button" class="button button-standard button-secondary" ng-click="openSupportWindow()">Glidera Support →</button>
|
||||
</div>
|
||||
|
||||
<div ng-show="showOauthForm" class="integration-onboarding-oauthform">
|
||||
|
@ -43,13 +37,13 @@
|
|||
<input
|
||||
class="button button-standard button-primary"
|
||||
type="submit" value="Connect Glidera Account" ng-disabled="oauthCodeForm.$invalid">
|
||||
<button type="button" class="button button-standard button-secondary" ng-click="openSupportWindow()" translate>Glidera Support →</button>
|
||||
<button type="button" class="button button-standard button-secondary" ng-click="openSupportWindow()">Glidera Support →</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
<ion-content scroll="false" class="ng-hide" ng-show="token && !connectingGlidera && status && !status.userCanTransact">
|
||||
<ion-content scroll="false" class="ng-hide" ng-show="account.token && account.status && !account.status.userCanTransact">
|
||||
<div class="integration-onboarding">
|
||||
<div class="integration-onboarding-logo">
|
||||
<img src="img/glidera-logo.png">
|
||||
|
@ -62,35 +56,41 @@
|
|||
</div>
|
||||
</ion-content>
|
||||
|
||||
<ion-content class="ng-hide" ng-show="token && !connectingGlidera && status && status.userCanTransact">
|
||||
<ion-content class="ng-hide" ng-show="account.token && account.status && account.status.userCanTransact">
|
||||
<div class="text-center m20v">
|
||||
<img src="img/glidera-logo.png" width="170">
|
||||
</div>
|
||||
|
||||
<div class="list card"
|
||||
ng-show="status && status.userCanTransact">
|
||||
<a ng-show="status.userCanBuy"
|
||||
<div class="list card">
|
||||
<a ng-show="account.status.userCanBuy"
|
||||
class="item item-icon-right"
|
||||
href ui-sref="tabs.buyandsell.glidera.amount({isGlidera: 'buy', glideraAccessToken: token})">
|
||||
<img src="img/buy-bitcoin.svg" alt="buy bitcoin" width="45" class="item-img-buy">
|
||||
href ui-sref="tabs.buyandsell.glidera.amount({isGlidera: 'buy', glideraAccessToken: account.token})">
|
||||
<img src="img/buy-bitcoin.svg" alt="buy bitcoin" width="25" class="item-img-buy">
|
||||
Buy Bitcoin
|
||||
<span class="item-note" ng-show="account.price.buy">
|
||||
${{account.price.buy}}/BTC
|
||||
</span>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
<a class="item item-icon-right"
|
||||
ng-show="status.userCanSell"
|
||||
href ui-sref="tabs.buyandsell.glidera.amount({isGlidera: 'sell', glideraAccessToken: token})">
|
||||
<img src="img/sell-bitcoin.svg" alt="buy bitcoin" width="45" class="item-img-sell">
|
||||
ng-show="account.status.userCanSell"
|
||||
href ui-sref="tabs.buyandsell.glidera.amount({isGlidera: 'sell', glideraAccessToken: account.token})">
|
||||
<img src="img/sell-bitcoin.svg" alt="buy bitcoin" width="25" class="item-img-sell">
|
||||
Sell Bitcoin
|
||||
<span class="item-note" ng-show="account.price.sell">
|
||||
${{account.price.sell}}/BTC
|
||||
</span>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="list card" ng-show="permissions && permissions.transaction_history && txs.length > 0">
|
||||
<div class="list card">
|
||||
<div class="item item-heading">
|
||||
Activity
|
||||
</div>
|
||||
<a ng-repeat="tx in txs"
|
||||
ng-click="openTxModal(token, tx)"
|
||||
<a ng-repeat="tx in account.txs"
|
||||
ng-click="openTxModal(tx)"
|
||||
ng-show="account.txs && account.txs.length > 0"
|
||||
class="item">
|
||||
|
||||
<span class="item-note">
|
||||
|
|
|
@ -8,55 +8,55 @@
|
|||
<ion-content>
|
||||
|
||||
<ul class="list">
|
||||
<div ng-if="token">
|
||||
<div ng-if="account.token">
|
||||
<div class="item item-divider">
|
||||
Permissions
|
||||
</div>
|
||||
<li class="item">
|
||||
<span>Email</span>
|
||||
<span class="item-note">
|
||||
{{permissions.view_email_address}}
|
||||
{{account.permissions.view_email_address}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Personal Information</span>
|
||||
<span class="item-note">
|
||||
{{permissions.personal_info}}
|
||||
{{account.permissions.personal_info}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Buy/Sell</span>
|
||||
<span class="item-note">
|
||||
{{permissions.transact}}
|
||||
{{account.permissions.transact}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Transaction History</span>
|
||||
<span class="item-note">
|
||||
{{permissions.transaction_history}}
|
||||
{{account.permissions.transaction_history}}
|
||||
</span>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<div ng-if="permissions.view_email_address">
|
||||
<div ng-if="account.permissions.view_email_address">
|
||||
<div class="item item-divider">
|
||||
Email
|
||||
</div>
|
||||
<li class="item">
|
||||
<span>Email</span>
|
||||
<span class="item-note">
|
||||
{{email.email}}
|
||||
{{account.email.email}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Active</span>
|
||||
<span class="item-note">
|
||||
{{email.userEmailIsSetup}}
|
||||
{{account.email.userEmailIsSetup}}
|
||||
</span>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<div ng-if="permissions.personal_info">
|
||||
<div ng-if="account.permissions.personal_info">
|
||||
<div class="item item-divider">
|
||||
Personal Information
|
||||
</div>
|
||||
|
@ -64,73 +64,73 @@
|
|||
<li class="item">
|
||||
<span>First Name</span>
|
||||
<span class="item-note">
|
||||
{{personalInfo.firstName}}
|
||||
{{account.personalInfo.firstName}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Middle Name</span>
|
||||
<span class="item-note">
|
||||
{{personalInfo.middleName}}
|
||||
{{account.personalInfo.middleName}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Last Name</span>
|
||||
<span class="item-note">
|
||||
{{personalInfo.lastName}}
|
||||
{{account.personalInfo.lastName}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Birth Date</span>
|
||||
<span class="item-note">
|
||||
{{personalInfo.birthDate}}
|
||||
{{account.personalInfo.birthDate}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Address 1</span>
|
||||
<span class="item-note">
|
||||
{{personalInfo.address1}}
|
||||
{{account.personalInfo.address1}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Address 2</span>
|
||||
<span class="item-note">
|
||||
{{personalInfo.address2}}
|
||||
{{account.personalInfo.address2}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>City</span>
|
||||
<span class="item-note">
|
||||
{{personalInfo.city}}
|
||||
{{account.personalInfo.city}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>State</span>
|
||||
<span class="item-note">
|
||||
{{personalInfo.state}}
|
||||
{{account.personalInfo.state}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>ZIP Code</span>
|
||||
<span class="item-note">
|
||||
{{personalInfo.zipCode}}
|
||||
{{account.personalInfo.zipCode}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Country</span>
|
||||
<span class="item-note">
|
||||
{{personalInfo.countryCode}}
|
||||
{{account.personalInfo.countryCode}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Occupation</span>
|
||||
<span class="item-note">
|
||||
{{personalInfo.occupation}}
|
||||
{{account.personalInfo.occupation}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Basic Information State</span>
|
||||
<span class="item-note">
|
||||
{{personalInfo.basicInfoState}}
|
||||
{{account.personalInfo.basicInfoState}}
|
||||
</span>
|
||||
</li>
|
||||
</div>
|
||||
|
@ -143,56 +143,56 @@
|
|||
<li class="item">
|
||||
<span>Buy/Sell</span>
|
||||
<span class="item-note">
|
||||
{{status.userCanTransact}}
|
||||
{{account.status.userCanTransact}}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="item">
|
||||
<span>Buy</span>
|
||||
<span class="item-note">
|
||||
{{status.userCanBuy}}
|
||||
{{account.status.userCanBuy}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Sell</span>
|
||||
<span class="item-note">
|
||||
{{status.userCanSell}}
|
||||
{{account.status.userCanSell}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Email Is Setup</span>
|
||||
<span class="item-note">
|
||||
{{status.userEmailIsSetup}}
|
||||
{{account.status.userEmailIsSetup}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Phone Is Setup</span>
|
||||
<span class="item-note">
|
||||
{{status.userPhoneIsSetup}}
|
||||
{{account.status.userPhoneIsSetup}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Bank Account Is Setup</span>
|
||||
<span class="item-note">
|
||||
{{status.userBankAccountIsSetup}}
|
||||
{{account.status.userBankAccountIsSetup}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Personal Information State</span>
|
||||
<span class="item-note">
|
||||
{{status.personalInfoState}}
|
||||
{{account.status.personalInfoState}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Bank Account State</span>
|
||||
<span class="item-note">
|
||||
{{status.bankAccountState}}
|
||||
{{account.status.bankAccountState}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Country</span>
|
||||
<span class="item-note">
|
||||
{{status.country}}
|
||||
{{account.status.country}}
|
||||
</span>
|
||||
</li>
|
||||
</div>
|
||||
|
@ -205,55 +205,55 @@
|
|||
<li class="item">
|
||||
<span>Daily Buy</span>
|
||||
<span class="item-note">
|
||||
{{limits.dailyBuy|currency:'':2}} {{limits.currency}}
|
||||
{{account.limits.dailyBuy|currency:'':2}} {{limits.currency}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Daily Sell</span>
|
||||
<span class="item-note">
|
||||
{{limits.dailySell|currency:'':2}} {{limits.currency}}
|
||||
{{account.limits.dailySell|currency:'':2}} {{limits.currency}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Monthly Buy</span>
|
||||
<span class="item-note">
|
||||
{{limits.monthlyBuy|currency:'':2}} {{limits.currency}}
|
||||
{{account.limits.monthlyBuy|currency:'':2}} {{limits.currency}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Monthly Sell</span>
|
||||
<span class="item-note">
|
||||
{{limits.monthlySell|currency:'':2}} {{limits.currency}}
|
||||
{{account.limits.monthlySell|currency:'':2}} {{limits.currency}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Daily Buy Remaining</span>
|
||||
<span class="item-note">
|
||||
{{limits.dailyBuyRemaining|currency:'':2}} {{limits.currency}}
|
||||
{{account.limits.dailyBuyRemaining|currency:'':2}} {{limits.currency}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Daily Sell Remaining</span>
|
||||
<span class="item-note">
|
||||
{{limits.dailySellRemaining|currency:'':2}} {{limits.currency}}
|
||||
{{account.limits.dailySellRemaining|currency:'':2}} {{limits.currency}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Monthly Buy Remaining</span>
|
||||
<span class="item-note">
|
||||
{{limits.monthlyBuyRemaining|currency:'':2}} {{limits.currency}}
|
||||
{{account.limits.monthlyBuyRemaining|currency:'':2}} {{limits.currency}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Monthly Sell Remaining</span>
|
||||
<span class="item-note">
|
||||
{{limits.monthlySellRemaining|currency:'':2}} {{limits.currency}}
|
||||
{{account.limits.monthlySellRemaining|currency:'':2}} {{limits.currency}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Buy/Sell Disabled (pending first transaction)</span>
|
||||
<span class="item-note">
|
||||
{{limits.transactDisabledPendingFirstTransaction}}
|
||||
{{account.limits.transactDisabledPendingFirstTransaction}}
|
||||
</span>
|
||||
</li>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue