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