mirror of https://github.com/BTCPrivate/copay.git
Glidera
This commit is contained in:
parent
ea3ea2686f
commit
ecdc3d2057
|
@ -1,24 +0,0 @@
|
||||||
<ion-view>
|
|
||||||
<ion-nav-bar class="bar-stable">
|
|
||||||
<ion-nav-buttons side="primary">
|
|
||||||
<button class="button no-border" ui-sref="tabs.home">
|
|
||||||
Close
|
|
||||||
</button>
|
|
||||||
</ion-nav-buttons>
|
|
||||||
<ion-nav-title translate>Buy and sell</ion-nav-title>
|
|
||||||
</ion-nav-bar>
|
|
||||||
<ion-content>
|
|
||||||
<ion-list>
|
|
||||||
<ion-item class="item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="glidera">
|
|
||||||
<img src="img/glidera-logo.png" width="100">
|
|
||||||
<i class="icon ion-chevron-right icon-accessory"></i>
|
|
||||||
</ion-item>
|
|
||||||
<ion-item class="item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="coinbase">
|
|
||||||
<img src="img/coinbase-logo.png" width="100">
|
|
||||||
<i class="icon ion-chevron-right icon-accessory"></i>
|
|
||||||
</ion-item>
|
|
||||||
|
|
||||||
|
|
||||||
</ion-list>
|
|
||||||
</ion-content>
|
|
||||||
</ion-view>
|
|
|
@ -1,28 +1,31 @@
|
||||||
<div
|
<ion-view>
|
||||||
class="topbar-container"
|
<ion-nav-bar class="bar-stable">
|
||||||
ng-include="'views/includes/topbar.html'"
|
<ion-nav-buttons side="primary">
|
||||||
ng-init="titleSection='Buy'; goBackToState = 'glidera'; noColor = true">
|
<button class="button no-border" ui-sref="glidera.main">
|
||||||
</div>
|
<i class="icon ion-chevron-left"></i> Back
|
||||||
|
</button>
|
||||||
|
</ion-nav-buttons>
|
||||||
|
<ion-nav-title>Buy</ion-nav-title>
|
||||||
|
</ion-nav-bar>
|
||||||
|
|
||||||
|
<ion-content ng-controller="buyGlideraController as buy" ng-init="init()">
|
||||||
|
|
||||||
<div class="content glidera" ng-controller="buyGlideraController as buy">
|
<div class="box-notification text-center size-12 text-warning" ng-show="network == 'testnet'">
|
||||||
|
<i class="fi-info"></i>
|
||||||
<div ng-show="index.glideraLimits && !buy.show2faCodeInput && !buy.success">
|
Testnet wallets only work with Glidera Sandbox Accounts
|
||||||
<h4 class="title m0 text-left">
|
|
||||||
<span class="text-light">Daily buy limit</span>:
|
|
||||||
{{index.glideraLimits.dailyBuy|currency:'':2}} {{index.glideraLimits.currency}}
|
|
||||||
(remaining {{index.glideraLimits.dailyBuyRemaining|currency:'':2}} {{index.glideraLimits.currency}})
|
|
||||||
<br>
|
|
||||||
<span class="text-light">Monthly buy limit</span>:
|
|
||||||
{{index.glideraLimits.monthlyBuy|currency:'':2}} {{index.glideraLimits.currency}}
|
|
||||||
(remaining {{index.glideraLimits.monthlyBuyRemaining|currency:'':2}} {{index.glideraLimits.currency}})
|
|
||||||
</h4>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row m20t">
|
<h5 class="padding" ng-show="limits && !buy.show2faCodeInput && !buy.success">
|
||||||
<div class="columns">
|
<span class="text-light">Daily buy limit</span>:
|
||||||
|
{{limits.dailyBuy|currency:'':2}} {{limits.currency}}
|
||||||
|
(remaining {{limits.dailyBuyRemaining|currency:'':2}} {{limits.currency}})
|
||||||
|
<br>
|
||||||
|
<span class="text-light">Monthly buy limit</span>:
|
||||||
|
{{limits.monthlyBuy|currency:'':2}} {{limits.currency}}
|
||||||
|
(remaining {{limits.monthlyBuyRemaining|currency:'':2}} {{limits.currency}})
|
||||||
|
</h5>
|
||||||
|
|
||||||
<div class="box-notification m20b" ng-show="index.glideraLimits.transactDisabledPendingFirstTransaction && !buy.success">
|
<div class="box-notification m20b" ng-show="limits.transactDisabledPendingFirstTransaction && !buy.success">
|
||||||
<span class="text-warning">
|
<span class="text-warning">
|
||||||
This operation was disabled because you have a pending first transaction
|
This operation was disabled because you have a pending first transaction
|
||||||
</span>
|
</span>
|
||||||
|
@ -30,38 +33,55 @@
|
||||||
|
|
||||||
<div ng-show="!buy.show2faCodeInput && !buy.success">
|
<div ng-show="!buy.show2faCodeInput && !buy.success">
|
||||||
|
|
||||||
<form name="buyPriceForm"
|
<form name="buyPriceForm" ng-if="token"
|
||||||
ng-submit="buy.get2faCode(index.glideraToken)" novalidate>
|
ng-submit="buy.get2faCode(token)" novalidate>
|
||||||
|
|
||||||
<div ng-if="index.glideraToken"
|
<div class="list">
|
||||||
ng-init="buy.init(index.glideraTestnet)"
|
|
||||||
ng-click="openWalletsModal(buy.allWallets)">
|
<label class="item item-input item-stacked-label">
|
||||||
<label>Wallet</label>
|
<span class="input-label">Wallet</span>
|
||||||
<div class="input">
|
<input type="text"
|
||||||
<input type="text" id="address" name="address" ng-disabled="buy.selectedWalletId"
|
id="address"
|
||||||
|
name="address"
|
||||||
|
ng-disabled="buy.selectedWalletId"
|
||||||
ng-attr-placeholder="{{'Choose your destination wallet'}}"
|
ng-attr-placeholder="{{'Choose your destination wallet'}}"
|
||||||
ng-model="buy.selectedWalletName" required>
|
ng-model="buy.selectedWalletName" required>
|
||||||
<a class="postfix size-12 m0 text-gray">
|
<a on-tap="openWalletsModal(buy.allWallets)">
|
||||||
<i class="icon-wallet size-18"></i>
|
<i class="icon ion-briefcase size-18"></i>
|
||||||
</a>
|
</a>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
|
<label class="item item-input item-stacked-label">
|
||||||
|
<span class="input-label">Amount in {{showAlternative ? 'USD' : 'BTC'}}</span>
|
||||||
|
<input ng-show="!showAlternative"
|
||||||
|
type="number"
|
||||||
|
id="qty" ignore-mouse-wheel
|
||||||
|
name="qty"
|
||||||
|
ng-attr-placeholder="{{'Amount'}}"
|
||||||
|
ng-minlength="0.00000001"
|
||||||
|
ng-maxlength="10000000000"
|
||||||
|
ng-model="qty"
|
||||||
|
autocomplete="off"
|
||||||
|
ng-change="buy.getBuyPrice(token, {'qty': qty})">
|
||||||
|
|
||||||
|
<input ng-show="showAlternative"
|
||||||
|
type="number"
|
||||||
|
id="fiat" ignore-mouse-wheel
|
||||||
|
name="fiat"
|
||||||
|
ng-attr-placeholder="{{'Amount'}}"
|
||||||
|
ng-model="fiat"
|
||||||
|
autocomplete="off"
|
||||||
|
ng-change="buy.getBuyPrice(token, {'fiat': fiat})">
|
||||||
|
|
||||||
|
<a ng-show="!showAlternative"
|
||||||
|
class="postfix"
|
||||||
|
on-tap="showAlternative = true; qty = null; buy.buyPrice = null">BTC</a>
|
||||||
|
<a ng-show="showAlternative"
|
||||||
|
class="postfix"
|
||||||
|
on-tap="showAlternative = false; fiat = null; buy.buyPrice = null">USD</a>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<label>Amount in {{showAlternative ? 'USD' : 'BTC'}}</label>
|
|
||||||
<div class="input">
|
|
||||||
<input ng-show="!showAlternative" type="number" id="qty" ignore-mouse-wheel
|
|
||||||
name="qty" ng-attr-placeholder="{{'Amount'}}"
|
|
||||||
ng-minlength="0.00000001" ng-maxlength="10000000000"
|
|
||||||
ng-model="qty" autocomplete="off" ng-change="buy.getBuyPrice(index.glideraToken, {'qty': qty})">
|
|
||||||
|
|
||||||
<input ng-show="showAlternative" type="number" id="fiat" ignore-mouse-wheel
|
|
||||||
name="fiat" ng-attr-placeholder="{{'Amount'}}"
|
|
||||||
ng-model="fiat" autocomplete="off" ng-change="buy.getBuyPrice(index.glideraToken, {'fiat': fiat})">
|
|
||||||
|
|
||||||
<a ng-show="!showAlternative" class="postfix"
|
|
||||||
ng-click="showAlternative = true; qty = null; buy.buyPrice = null">BTC</a>
|
|
||||||
<a ng-show="showAlternative" class="postfix"
|
|
||||||
ng-click="showAlternative = false; fiat = null; buy.buyPrice = null">USD</a>
|
|
||||||
|
|
||||||
<div class="text-center text-gray size-12 m20b" ng-show="!buy.gettingBuyPrice && buy.buyPrice.qty">
|
<div class="text-center text-gray size-12 m20b" ng-show="!buy.gettingBuyPrice && buy.buyPrice.qty">
|
||||||
Buy
|
Buy
|
||||||
|
@ -77,30 +97,34 @@
|
||||||
...
|
...
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input class="button black expand round"
|
<button class="button button-block"
|
||||||
ng-style="{'background-color':index.backgroundColor}"
|
type="submit"
|
||||||
type="submit" value="{{'Continue'}}"
|
ng-disabled="limits.transactDisabledPendingFirstTransaction || !buy.buyPrice.qty || !buy.selectedWalletId || buy.loading">
|
||||||
ng-disabled="index.glideraLimits.transactDisabledPendingFirstTransaction || !buy.buyPrice.qty ||
|
Continue
|
||||||
!buy.selectedWalletId || buy.loading">
|
</button>
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="buy.show2faCodeInput && !buy.success">
|
<div ng-show="buy.show2faCodeInput && !buy.success">
|
||||||
<div class="m10t text-center">
|
<div class="m10t text-center">
|
||||||
{{buy.buyPrice.subtotal|currency:'':2}} {{buy.buyPrice.currency}} → {{buy.buyPrice.qty}} BTC
|
{{buy.buyPrice.subtotal|currency:'':2}} {{buy.buyPrice.currency}} → {{buy.buyPrice.qty}} BTC
|
||||||
<p class="m20t">
|
<p class="m20t">
|
||||||
A SMS containing a confirmation code was sent to your phone. <br>
|
A SMS containing a confirmation code was sent to your phone. <br>
|
||||||
Please, enter the code below
|
Please, enter the code below
|
||||||
</p>
|
</p>
|
||||||
<form name="buyForm"
|
<form name="buyForm"
|
||||||
ng-submit="buy.sendRequest(index.glideraToken, index.glideraPermissions, twoFaCode)" novalidate>
|
ng-submit="buy.sendRequest(token, permissions, twoFaCode)" novalidate>
|
||||||
<input type="number" ng-model="twoFaCode" required ignore-mouse-wheel>
|
<div class="list">
|
||||||
<input class="button black expand round"
|
<label class="item item-input">
|
||||||
ng-style="{'background-color':index.backgroundColor}"
|
<input type="number" ng-model="twoFaCode" placeholder="2FA Code" required ignore-mouse-wheel>
|
||||||
type="submit" value="{{'Buy'}}" ng-disabled="buyForm.$invalid || buy.loading">
|
</label>
|
||||||
|
</div>
|
||||||
|
<button class="button button-block"
|
||||||
|
type="submit" ng-disabled="buyForm.$invalid || buy.loading">
|
||||||
|
Buy
|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<p class="m10t size-12 text-gray">
|
<p class="m10t size-12 text-gray">
|
||||||
Fiat will be immediately withdrawn from your bank account. The bitcoins will be purchased and deposited to your wallet ({{index.walletName}}) in 2-4 business days.
|
Fiat will be immediately withdrawn from your bank account. The bitcoins will be purchased and deposited to your wallet in 2-4 business days.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -115,9 +139,7 @@
|
||||||
A transfer has been initiated from your bank account. Your bitcoins should arrive to your wallet in 2-4 business days.
|
A transfer has been initiated from your bank account. Your bitcoins should arrive to your wallet in 2-4 business days.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<button class="outline dark-gray round expand" href ui-sref="glidera">OK</button>
|
<button class="button button-block" ui-sref="glidera.main">OK</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</ion-content>
|
||||||
</div>
|
</ion-view>
|
||||||
</div>
|
|
||||||
<div class="extra-margin-bottom"></div>
|
|
||||||
|
|
|
@ -1,53 +1,53 @@
|
||||||
|
<ion-view>
|
||||||
<div
|
<ion-nav-bar class="bar-stable">
|
||||||
class="topbar-container"
|
<ion-nav-buttons side="primary">
|
||||||
ng-include="'views/includes/topbar.html'"
|
<button class="button no-border" ui-sref="tabs.home">
|
||||||
ng-init="titleSection='Buy & Sell Bitcoin'; closeToHome = true; noColor = true">
|
Close
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="content glidera p20b" ng-controller="glideraController as glidera">
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="m20b box-notification" ng-if="index.glideraError">
|
|
||||||
<div class="text-warning">
|
|
||||||
<span>{{index.glideraError}}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="m10t text-center" ng-show="index.glideraError">
|
|
||||||
<button
|
|
||||||
class="dark-gray outline round tiny"
|
|
||||||
ng-show="index.glideraError.indexOf('Forbidden') == 40"
|
|
||||||
ng-click="index.glideraToken = null; index.glideraError = null">
|
|
||||||
Request a new token
|
|
||||||
</button>
|
</button>
|
||||||
<div ng-show="index.glideraError.indexOf('Forbidden') != 40">
|
</ion-nav-buttons>
|
||||||
<button
|
<ion-nav-title>Glidera</ion-nav-title>
|
||||||
class="dark-gray outline round tiny"
|
</ion-nav-bar>
|
||||||
ng-click="index.initGlidera(index.glideraToken)">
|
|
||||||
Retry
|
|
||||||
</button>
|
|
||||||
<div class="m20t size-12">
|
|
||||||
<a class="text-gray" href ui-sref="preferencesGlidera">Preferences</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-if="!index.glideraToken && !index.glideraError"
|
<ion-content ng-controller="glideraController as glidera" ng-init="init()">
|
||||||
class="row">
|
|
||||||
<div class="box-notification text-center size-12 text-warning" ng-show="index.glideraTestnet">
|
<div class="box-notification text-center size-12 text-warning" ng-show="network == 'testnet'">
|
||||||
<i class="fi-info"></i>
|
<i class="fi-info"></i>
|
||||||
Testnet wallets only work with Glidera Sandbox Accounts
|
Testnet wallets only work with Glidera Sandbox Accounts
|
||||||
</div>
|
</div>
|
||||||
<div class="columns" ng-init="showOauthForm = false">
|
<div class="m20b box-notification" ng-if="error">
|
||||||
<div class="text-center m20v">
|
<div class="text-warning">
|
||||||
<img src="img/glidera-logo.png" ng-click="index.updateGlidera(index.glideraToken, index.glideraPermissions)" width="200">
|
<span>{{error}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="m10t text-center" ng-show="error">
|
||||||
|
<button
|
||||||
|
class="button"
|
||||||
|
ng-show="error.indexOf('Forbidden') == 40"
|
||||||
|
ng-click="token = null; error = null">
|
||||||
|
Request a new token
|
||||||
|
</button>
|
||||||
|
<div ng-show="error.indexOf('Forbidden') != 40">
|
||||||
|
<button
|
||||||
|
class="button"
|
||||||
|
ng-click="init(token)">
|
||||||
|
Retry
|
||||||
|
</button>
|
||||||
|
<div class="m20t size-12">
|
||||||
|
<a class="text-gray" href ui-sref="glidera.preferences">Preferences</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-if="!token && !error">
|
||||||
|
|
||||||
|
<div ng-init="showOauthForm = false">
|
||||||
|
<div class="text-center m20b">
|
||||||
|
<img src="img/glidera-logo.png" ng-click="update(token, permissions)" width="200">
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center small-10 small-centered columns" ng-show="!showOauthForm">
|
<div class="text-center small-10 small-centered columns" ng-show="!showOauthForm">
|
||||||
<p class="m10b">You can buy and sell Bitcoin with a US bank account directly in Copay.</p>
|
<p class="m10b">You can buy and sell Bitcoin with a US bank account directly in Copay.</p>
|
||||||
|
|
||||||
<p class="m20t text-gray size-12 text-left">
|
<p class="m20t padding text-gray size-12 text-left">
|
||||||
DISCLOSURE.<br>
|
DISCLOSURE.<br>
|
||||||
Glidera Inc. (Glidera) is providing the service of buying or selling bitcoins to Copay users. To enable this
|
Glidera Inc. (Glidera) is providing the service of buying or selling bitcoins to Copay users. To enable this
|
||||||
service, Glidera has registered with US Treasury Department’s FinCEN as a Money Service Business
|
service, Glidera has registered with US Treasury Department’s FinCEN as a Money Service Business
|
||||||
|
@ -59,128 +59,117 @@
|
||||||
|
|
||||||
<p class="m20t text-gray size-12">Connect your Glidera account to get started</p>
|
<p class="m20t text-gray size-12">Connect your Glidera account to get started</p>
|
||||||
|
|
||||||
<a class="button light-gray outline round small"
|
<button class="button"
|
||||||
ng-click="$root.openExternalLink(glidera.getAuthenticateUrl(), '_system'); showOauthForm = true">
|
ng-click="openExternalLink(glidera.getAuthenticateUrl(), '_system'); showOauthForm = true">
|
||||||
Connect to Glidera
|
Connect to Glidera
|
||||||
</a>
|
</button>
|
||||||
<div>
|
<div class="m10t">
|
||||||
<a href ng-click="showOauthForm = true" class="text-gray size-12">
|
<a href ng-click="showOauthForm = true" class="text-gray size-12">
|
||||||
Do you already have the Oauth Code?
|
Do you already have the Oauth Code?
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center" ng-show="showOauthForm">
|
<div ng-show="showOauthForm">
|
||||||
<div class="text-left box-notification size-12 text-warning" ng-show="glidera.error">
|
<div class="text-left box-notification size-12 text-warning" ng-show="error">
|
||||||
{{glidera.error}}
|
{{error}}
|
||||||
</div>
|
</div>
|
||||||
<form name="oauthCodeForm" ng-submit="glidera.submitOauthCode(code)" novalidate>
|
<form name="oauthCodeForm" ng-submit="glidera.submitOauthCode(code)" novalidate>
|
||||||
<label>OAuth Code</label>
|
<div class="list">
|
||||||
<input type="text" ng-model="code" ng-disabled="glidera.loading"
|
<label class="item item-input item-stacked-label">
|
||||||
|
<span class="input-label">OAuth Code</span>
|
||||||
|
<input type="text"
|
||||||
|
ng-model="code"
|
||||||
ng-attr-placeholder="{{'Paste the authorization code here'}}" required>
|
ng-attr-placeholder="{{'Paste the authorization code here'}}" required>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<input type="button"
|
||||||
|
value="Cancel"
|
||||||
|
class="button button-block"
|
||||||
|
ng-click="showOauthForm = false; error = null">
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
<input
|
<input
|
||||||
class="button expand round"
|
class="button button-block"
|
||||||
ng-style="{'background-color':index.backgroundColor}"
|
type="submit"
|
||||||
type="submit" value="Get started" ng-disabled="oauthCodeForm.$invalid || glidera.loading">
|
value="Get started"
|
||||||
|
ng-disabled="oauthCodeForm.$invalid">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<button class="button light-gray expand outline round"
|
|
||||||
ng-click="showOauthForm = false; index.glideraError = null; glidera.error = null">
|
|
||||||
<i class="fi-arrow-left"></i> <span class="tu">Back</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-if="index.glideraToken && index.glideraPermissions">
|
<div ng-if="token && permissions">
|
||||||
<div class="p20v text-center white">
|
<div class="p20v text-center">
|
||||||
<img src="img/glidera-logo.png" ng-click="index.updateGlidera(index.glideraToken, index.glideraPermissions)" width="100">
|
<img src="img/glidera-logo.png" ng-click="update(token, permissions)" width="100">
|
||||||
</div>
|
</div>
|
||||||
<div class="sub-header" href ui-sref="preferencesGlidera">
|
<div class="list">
|
||||||
<div class="left">
|
<a class="item item-icon-left" href ui-sref="glidera.preferences">
|
||||||
<div ng-show="!index.glideraPersonalInfo && !index.glideraEmail">
|
<i class="icon ion-gear-a"></i>
|
||||||
Preferences
|
<span ng-show="personalInfo">{{personalInfo.firstName}} {{personalInfo.lastName}}</span>
|
||||||
</div>
|
<span class="item-note" ng-show="email">
|
||||||
<div ng-show="index.glideraPersonalInfo" class="size-12">
|
{{email}}
|
||||||
<b>
|
|
||||||
{{index.glideraPersonalInfo.firstName}} {{index.glideraPersonalInfo.lastName}}
|
|
||||||
</b>
|
|
||||||
</div>
|
|
||||||
<div class="size-12" ng-show="index.glideraEmail">
|
|
||||||
{{index.glideraEmail}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="right">
|
|
||||||
<div class="pointer m5t">
|
|
||||||
<i class="fi-widget size-16 text-gray"></i>
|
|
||||||
<span class="right text-gray">
|
|
||||||
<i class="icon-arrow-right3 size-24 right"></i>
|
|
||||||
</span>
|
</span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="padding">
|
||||||
</div>
|
<div class="text-center m30v size-12"
|
||||||
<div class="row">
|
ng-show="status && !status.userCanTransact">
|
||||||
<div class="text-center columns small-8 small-centered m30v size-12"
|
|
||||||
ng-show="index.glideraStatus && !index.glideraStatus.userCanTransact">
|
|
||||||
<h4 class="text-bold"> Complete Setup</h4>
|
<h4 class="text-bold"> Complete Setup</h4>
|
||||||
<div>Your Glidera account is not ready to transact. Please, verify it at <b>Glidera.io</b></div>
|
<div>Your Glidera account is not ready to transact. Please, verify it at <b>Glidera.io</b></div>
|
||||||
<a class="button m20t light-gray outline round tiny"
|
<a class="button"
|
||||||
ng-init="glideraUrl = index.glideraTestnet ? 'https://sandbox.glidera.io/login' :
|
ng-init="glideraUrl = network == 'testnet' ? 'https://sandbox.glidera.io/login' :
|
||||||
'https://glidera.io/login'"
|
'https://glidera.io/login'"
|
||||||
ng-click="$root.openExternalLink(glideraUrl)">
|
ng-click="openExternalLink(glideraUrl)">
|
||||||
Go to Glidera
|
Go to Glidera
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="no-bullet m0 size-14"
|
<div class="list"
|
||||||
ng-show="index.glideraStatus && index.glideraStatus.userCanTransact">
|
ng-show="status && status.userCanTransact">
|
||||||
<li ng-show="index.glideraStatus.userCanBuy"
|
<a ng-show="status.userCanBuy"
|
||||||
class="line-b line-t p20 pointer"
|
class="item item-avatar"
|
||||||
href ui-sref="buyGlidera">
|
href ui-sref="glidera.buy">
|
||||||
<img src="img/buy-bitcoin.svg" alt="buy bitcoin" width="40">
|
<img src="img/buy-bitcoin.svg" alt="buy bitcoin" width="40">
|
||||||
<span class="m10 text-normal text-bold">Buy Bitcoin</span>
|
Buy Bitcoin
|
||||||
<span class="right text-gray">
|
</a>
|
||||||
<i class="icon-arrow-right3 size-24 right"></i>
|
<a class="item item-avatar"
|
||||||
</span>
|
ng-show="status.userCanSell"
|
||||||
</li>
|
href ui-sref="glidera.sell">
|
||||||
<li class="line-b p20 pointer"
|
|
||||||
ng-show="index.glideraStatus.userCanSell"
|
|
||||||
href ui-sref="sellGlidera">
|
|
||||||
<img src="img/sell-bitcoin.svg" alt="buy bitcoin" width="40">
|
<img src="img/sell-bitcoin.svg" alt="buy bitcoin" width="40">
|
||||||
<span class="m10 text-normal text-bold">Sell Bitcoin</span>
|
Sell Bitcoin
|
||||||
<span class="right text-gray">
|
</a>
|
||||||
<i class="icon-arrow-right3 size-24 right"></i>
|
</div>
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div ng-show="index.glideraPermissions.transaction_history">
|
<div ng-show="permissions.transaction_history">
|
||||||
<h4>Activity</h4>
|
<h4>Activity</h4>
|
||||||
<div ng-show="index.glideraTxs.length == 0 "
|
<div ng-show="txs.length == 0 "
|
||||||
class="size-12 p10 text-center text-gray">
|
class="size-12 p10 text-center text-gray">
|
||||||
No activity in your account
|
No activity in your account
|
||||||
</div>
|
</div>
|
||||||
<div ng-repeat="tx in index.glideraTxs"
|
<div class="list">
|
||||||
ng-click="glidera.openTxModal(index.glideraToken, tx)"
|
<a ng-repeat="tx in txs"
|
||||||
class="row collapse last-transactions-content">
|
ng-click="glidera.openTxModal(token, tx)"
|
||||||
<div class="large-3 medium-3 small-3 columns">
|
class="item item-avatar">
|
||||||
<img src="img/bought.svg" alt="bought" width="39" ng-show="tx.type == 'BUY' && tx.status == 'COMPLETE'">
|
<img src="img/bought.svg" alt="bought" width="39" ng-show="tx.type == 'BUY' && tx.status == 'COMPLETE'">
|
||||||
<img src="img/bought-pending.svg" alt="bought" width="33" ng-show="tx.type == 'BUY' && tx.status == 'PROCESSING'">
|
<img src="img/bought-pending.svg" alt="bought" width="33" ng-show="tx.type == 'BUY' && tx.status == 'PROCESSING'">
|
||||||
<img src="img/sold.svg" alt="bought" width="39" ng-show="tx.type == 'SELL' && tx.status == 'COMPLETE'">
|
<img src="img/sold.svg" alt="bought" width="39" ng-show="tx.type == 'SELL' && tx.status == 'COMPLETE'">
|
||||||
<img src="img/sold-pending.svg" alt="bought" width="33" ng-show="tx.type == 'SELL' && tx.status == 'PROCESSING'">
|
<img src="img/sold-pending.svg" alt="bought" width="33" ng-show="tx.type == 'SELL' && tx.status == 'PROCESSING'">
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="large-4 medium-4 small-4 columns">
|
<h2>
|
||||||
<div class="size-14">
|
|
||||||
<span ng-show="tx.type == 'BUY'">Bought</span>
|
<span ng-show="tx.type == 'BUY'">Bought</span>
|
||||||
<span ng-show="tx.type == 'SELL'">Sold</span>
|
<span ng-show="tx.type == 'SELL'">Sold</span>
|
||||||
<b>{{tx.qty}}</b> BTC
|
<b>{{tx.qty}}</b> BTC
|
||||||
</div>
|
</h2>
|
||||||
<span class="size-14 text-bold">
|
<p>
|
||||||
{{tx.subtotal|currency:'':2}} {{tx.currency}}
|
{{tx.subtotal|currency:'':2}} {{tx.currency}}
|
||||||
</span>
|
</p>
|
||||||
</div>
|
<div class="right">
|
||||||
<div class="large-4 medium-4 small-4 columns text-right">
|
|
||||||
<div class="m5t size-12 text-gray">
|
<div class="m5t size-12 text-gray">
|
||||||
<div ng-show="tx.status == 'COMPLETE'">
|
<div ng-show="tx.status == 'COMPLETE'">
|
||||||
<time ng-if="tx.transactionDate">{{tx.transactionDate | amTimeAgo}}</time>
|
<time ng-if="tx.transactionDate">{{tx.transactionDate | amTimeAgo}}</time>
|
||||||
|
@ -190,12 +179,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-1 medium-1 small-1 columns text-right">
|
</a>
|
||||||
<i class="icon-arrow-right3 size-18"></i>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</ion-content>
|
||||||
</div>
|
</ion-view>
|
||||||
</div>
|
|
||||||
<div class="extra-margin-bottom"></div>
|
|
||||||
|
|
|
@ -1,18 +1,14 @@
|
||||||
<ion-modal-view ng-controller="glideraConfirmationController">
|
<ion-modal-view>
|
||||||
<div class="m20tp text-center">
|
<ion-content ng-controller="glideraConfirmationController">
|
||||||
<div class="row">
|
<div class="text-center">
|
||||||
<h1 class="text-center m20b p20h">Are you sure you would like to log out of your Glidera account?</h1>
|
<h1 class="text-center m20b p20h">Are you sure you would like to log out of your Glidera account?</h1>
|
||||||
<p class="text-gray p20h">You will need to log back in to buy or sell bitcoin in Copay.</p>
|
<p class="text-gray p20h">You will need to log back in to buy or sell bitcoin in Copay.</p>
|
||||||
<div class="large-6 medium-6 small-6 columns">
|
<button class="button" ng-click="cancel()">
|
||||||
<button class="button light-gray expand outline round" ng-click="cancel()">
|
Cancel
|
||||||
<i class="fi-arrow-left"></i> <span class="tu">Back</span>
|
</button>
|
||||||
|
<button class="button" ng-click="ok()">
|
||||||
|
Log out
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-6 medium-6 small-6 columns">
|
</ion-content>
|
||||||
<button class="button warning expand round" ng-click="ok()">
|
|
||||||
<span>Log out</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ion-modal-view>
|
</ion-modal-view>
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
<ion-modal-view ng-controller="glideraTxDetailsController">
|
<ion-modal-view ng-controller="glideraTxDetailsController">
|
||||||
<ion-header-bar align-title="center" class="tab-bar">
|
<ion-header-bar align-title="center" class="tab-bar">
|
||||||
<div class="left-small">
|
<button class="button button-clear button-positive"
|
||||||
<a ng-click="cancel()">
|
ng-click="cancel()">
|
||||||
<i class="icon-arrow-left3 icon-back"></i>
|
Close
|
||||||
<span class="text-back">Back</span>
|
</button>
|
||||||
</a>
|
<h1 class="title" translate>Details</h1>
|
||||||
</div>
|
|
||||||
<h1 class="title ellipsis" translate>Details</h1>
|
|
||||||
</ion-header-bar>
|
</ion-header-bar>
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
|
|
|
@ -1,266 +1,278 @@
|
||||||
<div
|
<ion-view>
|
||||||
class="topbar-container"
|
<ion-nav-bar class="bar-stable">
|
||||||
ng-include="'views/includes/topbar.html'"
|
<ion-nav-buttons side="primary">
|
||||||
ng-init="titleSection='Preferences'; goBackToState = 'glidera'; noColor = true">
|
<button class="button no-border" ui-sref="glidera.main">
|
||||||
</div>
|
<i class="icon ion-chevron-left"></i> Back
|
||||||
|
</button>
|
||||||
|
</ion-nav-buttons>
|
||||||
|
<ion-nav-title>Preferences</ion-nav-title>
|
||||||
|
</ion-nav-bar>
|
||||||
|
|
||||||
<div class="content preferences" ng-controller="preferencesGlideraController as glidera">
|
<ion-content ng-controller="preferencesGlideraController" ng-init="init()">
|
||||||
|
|
||||||
<ul ng-if="index.glideraToken" class="no-bullet m0">
|
<ul ng-if="token" class="list">
|
||||||
<h4 class="title m0">Permissions</h4>
|
<div class="item item-divider">
|
||||||
<li>
|
Permissions
|
||||||
|
</div>
|
||||||
|
<li class="item">
|
||||||
<span>Email</span>
|
<span>Email</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{index.glideraPermissions.view_email_address}}
|
{{permissions.view_email_address}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Personal Information</span>
|
<span>Personal Information</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{index.glideraPermissions.personal_info}}
|
{{permissions.personal_info}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Buy/Sell</span>
|
<span>Buy/Sell</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{index.glideraPermissions.transact}}
|
{{permissions.transact}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Transaction History</span>
|
<span>Transaction History</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{index.glideraPermissions.transaction_history}}
|
{{permissions.transaction_history}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul ng-if="index.glideraPermissions.view_email_address"
|
<ul ng-if="permissions.view_email_address"
|
||||||
ng-init="glidera.getEmail(index.glideraToken)"
|
class="list">
|
||||||
class="no-bullet m0">
|
<div class="item item-divider">
|
||||||
<h4 class="title m0">Email</h4>
|
Email
|
||||||
<li>
|
</div>
|
||||||
|
<li class="item">
|
||||||
<span>Email</span>
|
<span>Email</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.email.email}}
|
{{email.email}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Active</span>
|
<span>Active</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.email.userEmailIsSetup}}
|
{{email.userEmailIsSetup}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul ng-if="index.glideraPermissions.personal_info"
|
<ul ng-if="permissions.personal_info"
|
||||||
ng-init="glidera.getPersonalInfo(index.glideraToken)"
|
class="list">
|
||||||
class="no-bullet m0">
|
<div class="item item-divider">
|
||||||
<h4 class="title m0">Personal Information</h4>
|
Personal Information
|
||||||
|
</div>
|
||||||
|
|
||||||
<li>
|
<li class="item">
|
||||||
<span>First Name</span>
|
<span>First Name</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.personalInfo.firstName}}
|
{{personalInfo.firstName}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Middle Name</span>
|
<span>Middle Name</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.personalInfo.middleName}}
|
{{personalInfo.middleName}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Last Name</span>
|
<span>Last Name</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.personalInfo.lastName}}
|
{{personalInfo.lastName}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Birth Date</span>
|
<span>Birth Date</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.personalInfo.birthDate}}
|
{{personalInfo.birthDate}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Address 1</span>
|
<span>Address 1</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.personalInfo.address1}}
|
{{personalInfo.address1}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Address 2</span>
|
<span>Address 2</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.personalInfo.address2}}
|
{{personalInfo.address2}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>City</span>
|
<span>City</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.personalInfo.city}}
|
{{personalInfo.city}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>State</span>
|
<span>State</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.personalInfo.state}}
|
{{personalInfo.state}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>ZIP Code</span>
|
<span>ZIP Code</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.personalInfo.zipCode}}
|
{{personalInfo.zipCode}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Country</span>
|
<span>Country</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.personalInfo.countryCode}}
|
{{personalInfo.countryCode}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Occupation</span>
|
<span>Occupation</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.personalInfo.occupation}}
|
{{personalInfo.occupation}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Basic Information State</span>
|
<span>Basic Information State</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.personalInfo.basicInfoState}}
|
{{personalInfo.basicInfoState}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul ng-if="index.glideraToken" ng-init="glidera.getStatus(index.glideraToken)"
|
<ul ng-if="token"
|
||||||
class="no-bullet m0">
|
class="list">
|
||||||
<h4 class="title m0">Status</h4>
|
<div class="item item-divider">
|
||||||
|
Status
|
||||||
|
</div>
|
||||||
|
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Buy/Sell</span>
|
<span>Buy/Sell</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.status.userCanTransact}}
|
{{status.userCanTransact}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Buy</span>
|
<span>Buy</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.status.userCanBuy}}
|
{{status.userCanBuy}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Sell</span>
|
<span>Sell</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.status.userCanSell}}
|
{{status.userCanSell}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Email Is Setup</span>
|
<span>Email Is Setup</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.status.userEmailIsSetup}}
|
{{status.userEmailIsSetup}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Phone Is Setup</span>
|
<span>Phone Is Setup</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.status.userPhoneIsSetup}}
|
{{status.userPhoneIsSetup}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Bank Account Is Setup</span>
|
<span>Bank Account Is Setup</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.status.userBankAccountIsSetup}}
|
{{status.userBankAccountIsSetup}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Personal Information State</span>
|
<span>Personal Information State</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.status.personalInfoState}}
|
{{status.personalInfoState}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Bank Account State</span>
|
<span>Bank Account State</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.status.bankAccountState}}
|
{{status.bankAccountState}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Country</span>
|
<span>Country</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.status.country}}
|
{{status.country}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul ng-if="index.glideraToken" ng-init="glidera.getLimits(index.glideraToken)"
|
<ul ng-if="token"
|
||||||
class="no-bullet m0">
|
class="list">
|
||||||
<h4 class="title m0">Limits</h4>
|
<div class="item item-divider">
|
||||||
|
Limits
|
||||||
|
</div>
|
||||||
|
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Daily Buy</span>
|
<span>Daily Buy</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.limits.dailyBuy|currency:'':2}} {{glidera.limits.currency}}
|
{{limits.dailyBuy|currency:'':2}} {{limits.currency}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Daily Sell</span>
|
<span>Daily Sell</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.limits.dailySell|currency:'':2}} {{glidera.limits.currency}}
|
{{limits.dailySell|currency:'':2}} {{limits.currency}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Monthly Buy</span>
|
<span>Monthly Buy</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.limits.monthlyBuy|currency:'':2}} {{glidera.limits.currency}}
|
{{limits.monthlyBuy|currency:'':2}} {{limits.currency}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Monthly Sell</span>
|
<span>Monthly Sell</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.limits.monthlySell|currency:'':2}} {{glidera.limits.currency}}
|
{{limits.monthlySell|currency:'':2}} {{limits.currency}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Daily Buy Remaining</span>
|
<span>Daily Buy Remaining</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.limits.dailyBuyRemaining|currency:'':2}} {{glidera.limits.currency}}
|
{{limits.dailyBuyRemaining|currency:'':2}} {{limits.currency}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Daily Sell Remaining</span>
|
<span>Daily Sell Remaining</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.limits.dailySellRemaining|currency:'':2}} {{glidera.limits.currency}}
|
{{limits.dailySellRemaining|currency:'':2}} {{limits.currency}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Monthly Buy Remaining</span>
|
<span>Monthly Buy Remaining</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.limits.monthlyBuyRemaining|currency:'':2}} {{glidera.limits.currency}}
|
{{limits.monthlyBuyRemaining|currency:'':2}} {{limits.currency}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Monthly Sell Remaining</span>
|
<span>Monthly Sell Remaining</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.limits.monthlySellRemaining|currency:'':2}} {{glidera.limits.currency}}
|
{{limits.monthlySellRemaining|currency:'':2}} {{limits.currency}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="item">
|
||||||
<span>Buy/Sell Disabled (pending first transaction)</span>
|
<span>Buy/Sell Disabled (pending first transaction)</span>
|
||||||
<span class="right text-gray">
|
<span class="item-note">
|
||||||
{{glidera.limits.transactDisabledPendingFirstTransaction}}
|
{{limits.transactDisabledPendingFirstTransaction}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul class="no-bullet m0">
|
<ul class="list">
|
||||||
<h4 class="title m0">Account</h4>
|
<div class="item item-divider">
|
||||||
|
Account
|
||||||
|
</div>
|
||||||
|
|
||||||
<li ng-click="glidera.revokeToken(index.glideraTestnet)">
|
<li class="item" ng-click="revokeToken()">
|
||||||
<i class="icon-arrow-right3 size-24 right text-gray"></i>
|
<span class="assertive">Log out</span>
|
||||||
<span class="text-warning">Log out</span>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h4></h4>
|
</ion-content>
|
||||||
|
</ion-view>
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="extra-margin-bottom"></div>
|
|
||||||
|
|
|
@ -1,66 +1,79 @@
|
||||||
<div
|
<ion-view>
|
||||||
class="topbar-container"
|
<ion-nav-bar class="bar-stable">
|
||||||
ng-include="'views/includes/topbar.html'"
|
<ion-nav-buttons side="primary">
|
||||||
ng-init="titleSection='Sell'; goBackToState = 'glidera'; noColor = true">
|
<button class="button no-border" ui-sref="glidera.main">
|
||||||
</div>
|
<i class="icon ion-chevron-left"></i> Back
|
||||||
|
</button>
|
||||||
|
</ion-nav-buttons>
|
||||||
|
<ion-nav-title>Sell</ion-nav-title>
|
||||||
|
</ion-nav-bar>
|
||||||
|
|
||||||
|
<ion-content ng-controller="sellGlideraController as sell" ng-init="init()">
|
||||||
|
|
||||||
<div class="content glidera" ng-controller="sellGlideraController as sell">
|
<h4 class="padding" ng-show="limits && !sell.show2faCodeInput && !sell.success">
|
||||||
|
|
||||||
<div ng-show="index.glideraLimits && !sell.show2faCodeInput && !sell.success">
|
|
||||||
<h4 class="title m0 text-left">
|
|
||||||
<span class="text-light">Daily sell limit</span>:
|
<span class="text-light">Daily sell limit</span>:
|
||||||
{{index.glideraLimits.dailySell|currency:'':2}} {{index.glideraLimits.currency}}
|
{{limits.dailySell|currency:'':2}} {{limits.currency}}
|
||||||
(remaining {{index.glideraLimits.dailySellRemaining|currency:'':2}} {{index.glideraLimits.currency}})
|
(remaining {{limits.dailySellRemaining|currency:'':2}} {{limits.currency}})
|
||||||
<br>
|
<br>
|
||||||
<span class="text-light">Monthly sell limit</span>:
|
<span class="text-light">Monthly sell limit</span>:
|
||||||
{{index.glideraLimits.monthlySell|currency:'':2}} {{index.glideraLimits.currency}}
|
{{limits.monthlySell|currency:'':2}} {{limits.currency}}
|
||||||
(remaining {{index.glideraLimits.monthlySellRemaining|currency:'':2}} {{index.glideraLimits.currency}})
|
(remaining {{limits.monthlySellRemaining|currency:'':2}} {{limits.currency}})
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row m20t">
|
<div class="box-notification m20b" ng-show="limits.transactDisabledPendingFirstTransaction">
|
||||||
<div class="columns">
|
|
||||||
|
|
||||||
<div class="box-notification m20b" ng-show="index.glideraLimits.transactDisabledPendingFirstTransaction">
|
|
||||||
<span class="text-warning">
|
<span class="text-warning">
|
||||||
This operation was disabled because you have a pending first transaction
|
This operation was disabled because you have a pending first transaction
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-show="!sell.show2faCodeInput && !sell.success">
|
<div ng-show="!sell.show2faCodeInput && !sell.success">
|
||||||
<form name="sellPriceForm"
|
<form name="sellPriceForm" ng-if="token"
|
||||||
ng-submit="sell.get2faCode(index.glideraToken)" novalidate>
|
ng-submit="sell.get2faCode(token)" novalidate>
|
||||||
|
|
||||||
<div ng-if="index.glideraToken"
|
<div class="list">
|
||||||
ng-init="sell.init(index.glideraTestnet)"
|
<label class="item item-input item-stacked-label">
|
||||||
ng-click="openWalletsModal(sell.allWallets)">
|
<span class="input-label">Wallet</span>
|
||||||
<label>Wallet</label>
|
<input type="text"
|
||||||
<div class="input">
|
id="address"
|
||||||
<input type="text" id="address" name="address" ng-disabled="sell.selectedWalletId"
|
name="address"
|
||||||
|
ng-disabled="sell.selectedWalletId"
|
||||||
ng-attr-placeholder="{{'Choose your source wallet'}}"
|
ng-attr-placeholder="{{'Choose your source wallet'}}"
|
||||||
ng-model="sell.selectedWalletName" required>
|
ng-model="sell.selectedWalletName" required>
|
||||||
<a class="postfix size-12 m0 text-gray">
|
<a on-tap="openWalletsModal(sell.allWallets)">
|
||||||
<i class="icon-wallet size-18"></i>
|
<i class="icon ion-briefcase size-18"></i>
|
||||||
</a>
|
</a>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="item item-input item-stacked-label">
|
||||||
|
<span class="input-label"><span>Amount in</span> {{showAlternative ? 'USD' : 'BTC'}}</span>
|
||||||
|
<input ng-show="!showAlternative"
|
||||||
|
type="number"
|
||||||
|
id="qty" ignore-mouse-wheel
|
||||||
|
name="qty"
|
||||||
|
ng-attr-placeholder="{{'Amount'}}"
|
||||||
|
ng-minlength="0.00000001"
|
||||||
|
ng-maxlength="10000000000"
|
||||||
|
ng-model="qty"
|
||||||
|
autocomplete="off"
|
||||||
|
ng-change="sell.getSellPrice(token, {'qty': qty})">
|
||||||
|
|
||||||
|
<input ng-show="showAlternative"
|
||||||
|
type="number"
|
||||||
|
id="fiat" ignore-mouse-wheel
|
||||||
|
name="fiat"
|
||||||
|
ng-attr-placeholder="{{'Amount'}}"
|
||||||
|
ng-model="fiat"
|
||||||
|
autocomplete="off"
|
||||||
|
ng-change="sell.getSellPrice(token, {'fiat': fiat})">
|
||||||
|
|
||||||
|
<a ng-show="!showAlternative"
|
||||||
|
class="postfix"
|
||||||
|
on-tap="showAlternative = true; qty = null; sell.sellPrice = null">BTC</a>
|
||||||
|
<a ng-show="showAlternative"
|
||||||
|
class="postfix"
|
||||||
|
on-tap="showAlternative = false; fiat = null; sell.sellPrice = null">USD</a>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<label><span>Amount in</span> {{showAlternative ? 'USD' : 'BTC'}}</label>
|
|
||||||
<div class="input">
|
|
||||||
<input ng-show="!showAlternative" type="number" id="qty" ignore-mouse-wheel
|
|
||||||
name="qty" ng-attr-placeholder="{{'Amount'}}"
|
|
||||||
ng-minlength="0.00000001" ng-maxlength="10000000000"
|
|
||||||
ng-model="qty" autocomplete="off" ng-change="sell.getSellPrice(index.glideraToken, {'qty': qty})">
|
|
||||||
|
|
||||||
<input ng-show="showAlternative" type="number" id="fiat" ignore-mouse-wheel
|
|
||||||
name="fiat" ng-attr-placeholder="{{'Amount'}}"
|
|
||||||
ng-model="fiat" autocomplete="off" ng-change="sell.getSellPrice(index.glideraToken, {'fiat': fiat})">
|
|
||||||
|
|
||||||
<a ng-show="!showAlternative" class="postfix"
|
|
||||||
ng-click="showAlternative = true; qty = null; sell.sellPrice = null">BTC</a>
|
|
||||||
<a ng-show="showAlternative" class="postfix"
|
|
||||||
ng-click="showAlternative = false; fiat = null; sell.sellPrice = null">USD</a>
|
|
||||||
|
|
||||||
<div class="text-center text-gray size-12 m20b" ng-show="!sell.gettingSellPrice && sell.sellPrice.qty">
|
<div class="text-center text-gray size-12 m20b" ng-show="!sell.gettingSellPrice && sell.sellPrice.qty">
|
||||||
Sell
|
Sell
|
||||||
|
@ -77,12 +90,11 @@
|
||||||
...
|
...
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input class="button black expand round"
|
<button class="button button-block"
|
||||||
ng-style="{'background-color':index.backgroundColor}"
|
type="submit"
|
||||||
type="submit" value="{{'Continue'}}"
|
ng-disabled="limits.transactDisabledPendingFirstTransaction || !sell.sellPrice.qty || !sell.selectedWalletId ">
|
||||||
ng-disabled="index.glideraLimits.transactDisabledPendingFirstTransaction || !sell.sellPrice.qty ||
|
Continue
|
||||||
!sell.selectedWalletId ">
|
</button>
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="sell.show2faCodeInput && !sell.success">
|
<div ng-show="sell.show2faCodeInput && !sell.success">
|
||||||
|
@ -93,11 +105,17 @@
|
||||||
Please, enter the code below
|
Please, enter the code below
|
||||||
</p>
|
</p>
|
||||||
<form name="sellForm"
|
<form name="sellForm"
|
||||||
ng-submit="sell.createTx(index.glideraToken, index.glideraPermissions, twoFaCode)" novalidate>
|
ng-submit="sell.createTx(token, permissions, twoFaCode)" novalidate>
|
||||||
<input type="number" ng-model="twoFaCode" required ignore-mouse-wheel>
|
<div class="list">
|
||||||
<input class="button black expand round"
|
<label class="item item-input">
|
||||||
ng-style="{'background-color':index.backgroundColor}"
|
<input type="number" ng-model="twoFaCode" placeholder="2FA Code" required ignore-mouse-wheel>
|
||||||
type="submit" value="{{'Sell'}}" ng-disabled="sellForm.$invalid ">
|
</label>
|
||||||
|
</div>
|
||||||
|
<button class="button button-block"
|
||||||
|
type="submit"
|
||||||
|
ng-disabled="sellForm.$invalid ">
|
||||||
|
Sell
|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<p class="m10t size-12 text-gray">
|
<p class="m10t size-12 text-gray">
|
||||||
Bitcoins will be immediately sent from your wallet to Glidera. Fiat will be deposited in your bank account in 4-6 business days.
|
Bitcoins will be immediately sent from your wallet to Glidera. Fiat will be deposited in your bank account in 4-6 business days.
|
||||||
|
@ -115,9 +133,8 @@
|
||||||
A transfer has been initiated to your bank account and should arrive in 4-6 business days.
|
A transfer has been initiated to your bank account and should arrive in 4-6 business days.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<button class="outline dark-gray round expand"
|
<button class="button button-block" ui-sref="glidera.main">OK</button>
|
||||||
ng-click="$root.go('glidera')">OK</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</ion-content>
|
||||||
</div>
|
</ion-view>
|
||||||
<div class="extra-margin-bottom"></div>
|
|
||||||
|
|
|
@ -75,6 +75,18 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div ng-show="glideraEnabled || coinbaseEnabled">
|
||||||
|
<h3>Buy & Sell Bitcoin</h3>
|
||||||
|
<div class="card">
|
||||||
|
<div ng-show="glideraEnabled" ui-sref="glidera.main" class="item">
|
||||||
|
<img src="img/glidera-logo.png" width="90">
|
||||||
|
</div>
|
||||||
|
<div ng-show="coinbaseEnabled" ui-sref="exchange.coinbase" class="item">
|
||||||
|
<img src="img/coinbase-logo.png" width="90">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h3>Next steps </h3>
|
<h3>Next steps </h3>
|
||||||
<div class="list card">
|
<div class="list card">
|
||||||
<ul class="pr">
|
<ul class="pr">
|
||||||
|
@ -82,10 +94,6 @@
|
||||||
<i class="icon ion-card"></i>
|
<i class="icon ion-card"></i>
|
||||||
BitPay Card
|
BitPay Card
|
||||||
</li>
|
</li>
|
||||||
<li ng-show="buyAndSellEnabled" ui-sref="buyandsell" class="item item-icon-left">
|
|
||||||
<i class="icon ion-cash"></i>
|
|
||||||
Buy and Sell
|
|
||||||
</li>
|
|
||||||
<li ui-sref="amazon.main" class="item item-icon-left">
|
<li ui-sref="amazon.main" class="item item-icon-left">
|
||||||
<i class="icon ion-ios-cart"></i>
|
<i class="icon ion-ios-cart"></i>
|
||||||
Gift Cards
|
Gift Cards
|
||||||
|
|
|
@ -1,26 +1,89 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('buyGlideraController',
|
angular.module('copayApp.controllers').controller('buyGlideraController',
|
||||||
function($scope, $timeout, $ionicModal, profileService, addressService, glideraService, bwcError, lodash, ongoingProcess) {
|
function($scope, $timeout, $log, $ionicModal, profileService, walletService, glideraService, bwcError, lodash, ongoingProcess) {
|
||||||
|
|
||||||
|
var wallet;
|
||||||
var self = this;
|
var self = this;
|
||||||
this.show2faCodeInput = null;
|
this.show2faCodeInput = null;
|
||||||
this.error = null;
|
this.error = null;
|
||||||
this.success = null;
|
this.success = null;
|
||||||
|
|
||||||
this.init = function(testnet) {
|
$scope.init = function(accessToken) {
|
||||||
self.allWallets = profileService.getWallets(testnet ? 'testnet' : 'livenet');
|
$scope.network = glideraService.getEnvironment();
|
||||||
|
|
||||||
var client = profileService.focusedClient;
|
$scope.token = accessToken;
|
||||||
if (client) {
|
$scope.error = null;
|
||||||
|
$scope.permissions = null;
|
||||||
|
$scope.email = null;
|
||||||
|
$scope.personalInfo = null;
|
||||||
|
$scope.txs = null;
|
||||||
|
$scope.status = null;
|
||||||
|
$scope.limits = null;
|
||||||
|
|
||||||
|
ongoingProcess.set('connectingGlidera', true);
|
||||||
|
glideraService.init($scope.token, function(err, glidera) {
|
||||||
|
ongoingProcess.set('connectingGlidera');
|
||||||
|
if (err || !glidera) {
|
||||||
|
$scope.error = err;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$scope.token = glidera.token;
|
||||||
|
$scope.permissions = glidera.permissions;
|
||||||
|
$scope.update({fullUpdate: true});
|
||||||
|
});
|
||||||
|
|
||||||
|
self.allWallets = profileService.getWallets({
|
||||||
|
network: $scope.network,
|
||||||
|
n: 1,
|
||||||
|
onlyComplete: true
|
||||||
|
});
|
||||||
|
if (lodash.isEmpty(self.allWallets)) return;
|
||||||
|
|
||||||
|
wallet = self.allWallets[0];
|
||||||
|
if (wallet) {
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
self.selectedWalletId = client.credentials.walletId;
|
self.selectedWalletId = wallet.credentials.walletId;
|
||||||
self.selectedWalletName = client.credentials.walletName;
|
self.selectedWalletName = wallet.credentials.walletName;
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$scope.openWalletsModal = function(wallets) {
|
$scope.openWalletsModal = function(wallets) {
|
||||||
self.error = null;
|
self.error = null;
|
||||||
|
|
||||||
|
@ -39,9 +102,9 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
|
||||||
|
|
||||||
$scope.$on('walletSelected', function(ev, walletId) {
|
$scope.$on('walletSelected', function(ev, walletId) {
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
var client = profileService.getClient(walletId);
|
wallet = profileService.getClient(walletId);
|
||||||
self.selectedWalletId = walletId;
|
self.selectedWalletId = walletId;
|
||||||
self.selectedWalletName = client.credentials.walletName;
|
self.selectedWalletName = wallet.credentials.walletName;
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 100);
|
}, 100);
|
||||||
$scope.walletsModal.hide();
|
$scope.walletsModal.hide();
|
||||||
|
@ -87,7 +150,7 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
|
||||||
self.error = null;
|
self.error = null;
|
||||||
ongoingProcess.set('Buying Bitcoin...', true);
|
ongoingProcess.set('Buying Bitcoin...', true);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
addressService.getAddress(self.selectedWalletId, false, function(err, walletAddr) {
|
walletService.getAddress(wallet, false, function(err, walletAddr) {
|
||||||
if (err) {
|
if (err) {
|
||||||
ongoingProcess.set('Buying Bitcoin...', false);
|
ongoingProcess.set('Buying Bitcoin...', false);
|
||||||
self.error = bwcError.cb(err, 'Could not create address');
|
self.error = bwcError.cb(err, 'Could not create address');
|
||||||
|
|
|
@ -1,33 +1,98 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('glideraController',
|
angular.module('copayApp.controllers').controller('glideraController',
|
||||||
function($rootScope, $scope, $timeout, $ionicModal, profileService, configService, storageService, glideraService, lodash, ongoingProcess, platformInfo) {
|
function($rootScope, $scope, $timeout, $ionicModal, $log, profileService, storageService, glideraService, lodash, ongoingProcess, platformInfo, nodeWebkit) {
|
||||||
|
|
||||||
if (platformInfo.isCordova && StatusBar.isVisible) {
|
if (platformInfo.isCordova && StatusBar.isVisible) {
|
||||||
StatusBar.backgroundColorByHexString("#4B6178");
|
StatusBar.backgroundColorByHexString("#4B6178");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.openExternalLink = function(url, target) {
|
||||||
|
if (platformInfo.isNW) {
|
||||||
|
nodeWebkit.openExternalLink(url);
|
||||||
|
} else {
|
||||||
|
target = target || '_blank';
|
||||||
|
var ref = window.open(url, target, 'location=no');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.init = function(accessToken) {
|
||||||
|
$scope.network = glideraService.getEnvironment();
|
||||||
|
|
||||||
|
$scope.token = null;
|
||||||
|
$scope.error = null;
|
||||||
|
$scope.permissions = null;
|
||||||
|
$scope.email = null;
|
||||||
|
$scope.personalInfo = null;
|
||||||
|
$scope.txs = null;
|
||||||
|
$scope.status = null;
|
||||||
|
$scope.limits = null;
|
||||||
|
|
||||||
|
ongoingProcess.set('connectingGlidera', true);
|
||||||
|
glideraService.init($scope.token, function(err, glidera) {
|
||||||
|
ongoingProcess.set('connectingGlidera');
|
||||||
|
if (err || !glidera) {
|
||||||
|
$scope.error = err;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$scope.token = glidera.token;
|
||||||
|
$scope.permissions = glidera.permissions;
|
||||||
|
$scope.update({fullUpdate: true});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
this.getAuthenticateUrl = function() {
|
this.getAuthenticateUrl = function() {
|
||||||
return glideraService.getOauthCodeUrl();
|
return glideraService.getOauthCodeUrl();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.submitOauthCode = function(code) {
|
this.submitOauthCode = function(code) {
|
||||||
var self = this;
|
|
||||||
var glideraTestnet = configService.getSync().glidera.testnet;
|
|
||||||
var network = glideraTestnet ? 'testnet' : 'livenet';
|
|
||||||
ongoingProcess.set('connectingGlidera', true);
|
ongoingProcess.set('connectingGlidera', true);
|
||||||
this.error = null;
|
$scope.error = null;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
glideraService.getToken(code, function(err, data) {
|
glideraService.getToken(code, function(err, data) {
|
||||||
ongoingProcess.set('connectingGlidera', false);
|
ongoingProcess.set('connectingGlidera', false);
|
||||||
if (err) {
|
if (err) {
|
||||||
self.error = err;
|
$scope.error = err;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 100);
|
}, 100);
|
||||||
} else if (data && data.access_token) {
|
} else if (data && data.access_token) {
|
||||||
storageService.setGlideraToken(network, data.access_token, function() {
|
storageService.setGlideraToken($scope.network, data.access_token, function() {
|
||||||
$scope.$emit('Local/GlideraUpdated', data.access_token);
|
$scope.init(data.access_token);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('glideraConfirmationController', function($scope, $timeout, storageService, applicationService) {
|
angular.module('copayApp.controllers').controller('glideraConfirmationController', function($scope, $timeout, $state, glideraService) {
|
||||||
|
|
||||||
$scope.ok = function() {
|
$scope.ok = function() {
|
||||||
storageService.removeGlideraToken($scope.network, function() {
|
glideraService.removeToken(function() {
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
applicationService.restart();
|
$state.go('glidera.main');
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
});
|
||||||
$scope.cancel();
|
$scope.cancel();
|
||||||
|
|
|
@ -1,43 +1,70 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesGlideraController',
|
angular.module('copayApp.controllers').controller('preferencesGlideraController',
|
||||||
function($scope, $timeout, $ionicModal, profileService, applicationService, glideraService, storageService) {
|
function($scope, $log, $ionicModal, ongoingProcess, glideraService) {
|
||||||
|
|
||||||
this.getEmail = function(token) {
|
$scope.init = function(accessToken) {
|
||||||
var self = this;
|
$scope.network = glideraService.getEnvironment();
|
||||||
glideraService.getEmail(token, function(error, data) {
|
|
||||||
self.email = data;
|
$scope.token = accessToken;
|
||||||
|
$scope.error = null;
|
||||||
|
$scope.permissions = null;
|
||||||
|
$scope.email = null;
|
||||||
|
$scope.personalInfo = null;
|
||||||
|
$scope.txs = null;
|
||||||
|
$scope.status = null;
|
||||||
|
$scope.limits = null;
|
||||||
|
|
||||||
|
ongoingProcess.set('connectingGlidera', true);
|
||||||
|
glideraService.init($scope.token, function(err, glidera) {
|
||||||
|
ongoingProcess.set('connectingGlidera');
|
||||||
|
if (err || !glidera) {
|
||||||
|
$scope.error = err;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$scope.token = glidera.token;
|
||||||
|
$scope.permissions = glidera.permissions;
|
||||||
|
$scope.update({fullUpdate: true});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getPersonalInfo = function(token) {
|
$scope.update = function(opts) {
|
||||||
var self = this;
|
if (!$scope.token || !$scope.permissions) return;
|
||||||
glideraService.getPersonalInfo(token, function(error, info) {
|
$log.debug('Updating Glidera Account...');
|
||||||
self.personalInfo = info;
|
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;
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getStatus = function(token) {
|
$scope.revokeToken = function() {
|
||||||
var self = this;
|
|
||||||
glideraService.getStatus(token, function(error, data) {
|
|
||||||
self.status = data;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getLimits = function(token) {
|
|
||||||
var self = this;
|
|
||||||
glideraService.getLimits(token, function(error, limits) {
|
|
||||||
self.limits = limits;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.revokeToken = function(testnet) {
|
|
||||||
$scope.network = testnet ? 'testnet' : 'livenet';
|
|
||||||
$scope.loading = false;
|
|
||||||
|
|
||||||
$ionicModal.fromTemplateUrl('views/modals/glidera-confirmation.html', {
|
$ionicModal.fromTemplateUrl('views/modals/glidera-confirmation.html', {
|
||||||
scope: $scope,
|
scope: $scope
|
||||||
animation: 'slide-in-up'
|
|
||||||
}).then(function(modal) {
|
}).then(function(modal) {
|
||||||
$scope.glideraConfirmationModal = modal;
|
$scope.glideraConfirmationModal = modal;
|
||||||
$scope.glideraConfirmationModal.show();
|
$scope.glideraConfirmationModal.show();
|
||||||
|
|
|
@ -1,38 +1,97 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('sellGlideraController',
|
angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
function($rootScope, $scope, $timeout, $ionicModal, $log, configService, profileService, addressService, feeService, glideraService, bwcError, lodash, walletService, fingerprintService, ongoingProcess, go) {
|
function($rootScope, $scope, $timeout, $ionicModal, $log, profileService, glideraService, bwcError, lodash, walletService, fingerprintService, configService, ongoingProcess) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var config = configService.getSync();
|
|
||||||
this.data = {};
|
this.data = {};
|
||||||
this.show2faCodeInput = null;
|
this.show2faCodeInput = null;
|
||||||
this.success = null;
|
this.success = null;
|
||||||
this.error = null;
|
this.error = null;
|
||||||
var client;
|
var wallet;
|
||||||
|
|
||||||
var handleEncryptedWallet = function(client, cb) {
|
var handleEncryptedWallet = function(wallet, cb) {
|
||||||
if (!walletService.isEncrypted(client)) return cb();
|
if (!walletService.isEncrypted(wallet)) return cb();
|
||||||
$rootScope.$emit('Local/NeedsPassword', false, function(err, password) {
|
$rootScope.$emit('Local/NeedsPassword', false, function(err, password) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
return cb(walletService.unlock(client, password));
|
return cb(walletService.unlock(wallet, password));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.init = function(testnet) {
|
$scope.init = function(accessToken) {
|
||||||
self.allWallets = profileService.getWallets(testnet ? 'testnet' : 'livenet', 1);
|
$scope.network = glideraService.getEnvironment();
|
||||||
|
|
||||||
client = profileService.focusedClient;
|
$scope.token = accessToken;
|
||||||
if (client && client.credentials.m == 1) {
|
$scope.error = null;
|
||||||
|
$scope.permissions = null;
|
||||||
|
$scope.email = null;
|
||||||
|
$scope.personalInfo = null;
|
||||||
|
$scope.txs = null;
|
||||||
|
$scope.status = null;
|
||||||
|
$scope.limits = null;
|
||||||
|
|
||||||
|
ongoingProcess.set('connectingGlidera', true);
|
||||||
|
glideraService.init($scope.token, function(err, glidera) {
|
||||||
|
ongoingProcess.set('connectingGlidera');
|
||||||
|
if (err || !glidera) {
|
||||||
|
$scope.error = err;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$scope.token = glidera.token;
|
||||||
|
$scope.permissions = glidera.permissions;
|
||||||
|
$scope.update({fullUpdate: true});
|
||||||
|
});
|
||||||
|
|
||||||
|
self.allWallets = profileService.getWallets({
|
||||||
|
network: $scope.network,
|
||||||
|
n: 1,
|
||||||
|
onlyComplete: true
|
||||||
|
});
|
||||||
|
if (lodash.isEmpty(self.allWallets)) return;
|
||||||
|
|
||||||
|
wallet = self.allWallets[0];
|
||||||
|
if (wallet) {
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
self.selectedWalletId = client.credentials.walletId;
|
self.selectedWalletId = wallet.credentials.walletId;
|
||||||
self.selectedWalletName = client.credentials.walletName;
|
self.selectedWalletName = wallet.credentials.walletName;
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$scope.openWalletsModal = function(wallets) {
|
$scope.openWalletsModal = function(wallets) {
|
||||||
self.error = null;
|
self.error = null;
|
||||||
|
@ -52,9 +111,9 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
|
|
||||||
$scope.$on('walletSelected', function(ev, walletId) {
|
$scope.$on('walletSelected', function(ev, walletId) {
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
client = profileService.getClient(walletId);
|
wallet = profileService.getClient(walletId);
|
||||||
self.selectedWalletId = walletId;
|
self.selectedWalletId = walletId;
|
||||||
self.selectedWalletName = client.credentials.walletName;
|
self.selectedWalletName = wallet.credentials.walletName;
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 100);
|
}, 100);
|
||||||
$scope.walletsModal.hide();
|
$scope.walletsModal.hide();
|
||||||
|
@ -98,16 +157,17 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
var self = this;
|
var self = this;
|
||||||
self.error = null;
|
self.error = null;
|
||||||
var outputs = [];
|
var outputs = [];
|
||||||
|
var config = configService.getSync();
|
||||||
var configWallet = config.wallet;
|
var configWallet = config.wallet;
|
||||||
var walletSettings = configWallet.settings;
|
var walletSettings = configWallet.settings;
|
||||||
|
|
||||||
if (!client) {
|
if (!wallet) {
|
||||||
self.error = 'No wallet selected';
|
self.error = 'No wallet selected';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ongoingProcess.set('creatingTx', true);
|
ongoingProcess.set('creatingTx', true);
|
||||||
addressService.getAddress(client.credentials.walletId, null, function(err, refundAddress) {
|
walletService.getAddress(wallet, null, function(err, refundAddress) {
|
||||||
if (!refundAddress) {
|
if (!refundAddress) {
|
||||||
|
|
||||||
ongoingProcess.clear();
|
ongoingProcess.clear();
|
||||||
|
@ -142,36 +202,34 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
walletService.createTx(client, txp, function(err, createdTxp) {
|
walletService.createTx(wallet, txp, function(err, createdTxp) {
|
||||||
ongoingProcess.clear();
|
ongoingProcess.clear();
|
||||||
if (err) {
|
if (err) {
|
||||||
self.error = err.message || bwcError.msg(err);
|
self.error = err.message || bwcError.msg(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$scope.$emit('Local/NeedsConfirmation', createdTxp, function(accept) {
|
fingerprintService.check(wallet, function(err) {
|
||||||
if (accept) {
|
|
||||||
fingerprintService.check(client, function(err) {
|
|
||||||
if (err) {
|
if (err) {
|
||||||
self.error = err.message || bwcError.msg(err);
|
self.error = err.message || bwcError.msg(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
handleEncryptedWallet(client, function(err) {
|
handleEncryptedWallet(wallet, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
self.error = err.message || bwcError.msg(err);
|
self.error = err.message || bwcError.msg(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ongoingProcess.set('signingTx', true);
|
ongoingProcess.set('signingTx', true);
|
||||||
walletService.publishTx(client, createdTxp, function(err, publishedTxp) {
|
walletService.publishTx(wallet, createdTxp, function(err, publishedTxp) {
|
||||||
if (err) {
|
if (err) {
|
||||||
ongoingProcess.clear();
|
ongoingProcess.clear();
|
||||||
self.error = err.message || bwcError.msg(err);
|
self.error = err.message || bwcError.msg(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
walletService.signTx(client, publishedTxp, function(err, signedTxp) {
|
walletService.signTx(wallet, publishedTxp, function(err, signedTxp) {
|
||||||
walletService.lock(client);
|
walletService.lock(wallet);
|
||||||
walletService.removeTx(client, signedTxp, function(err) {
|
walletService.removeTx(wallet, signedTxp, function(err) {
|
||||||
if (err) $log.debug(err);
|
if (err) $log.debug(err);
|
||||||
});
|
});
|
||||||
ongoingProcess.clear();
|
ongoingProcess.clear();
|
||||||
|
@ -192,22 +250,15 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
ongoingProcess.clear();
|
ongoingProcess.clear();
|
||||||
if (err) {
|
if (err) {
|
||||||
self.error = err.message || bwcError.msg(err);
|
self.error = err.message || bwcError.msg(err);
|
||||||
$timeout(function() {
|
|
||||||
$scope.$emit('Local/GlideraError');
|
|
||||||
}, 100);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.success = data;
|
self.success = data;
|
||||||
$scope.$emit('Local/GlideraTx');
|
$scope.update();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
go.path('glidera');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -162,10 +162,9 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
|
|
||||||
configService.whenAvailable(function() {
|
configService.whenAvailable(function() {
|
||||||
var config = configService.getSync();
|
var config = configService.getSync();
|
||||||
var glideraEnabled = config.glidera.enabled;
|
|
||||||
var coinbaseEnabled = config.coinbase.enabled;
|
|
||||||
var isWindowsPhoneApp = platformInfo.isWP && isCordova;
|
var isWindowsPhoneApp = platformInfo.isWP && isCordova;
|
||||||
$scope.buyAndSellEnabled = !isWindowsPhoneApp && (glideraEnabled || coinbaseEnabled);
|
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
|
||||||
|
$scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp;
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
172
src/js/routes.js
172
src/js/routes.js
|
@ -104,24 +104,20 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
|
|
||||||
.state('uri', {
|
.state('uri', {
|
||||||
url: '/uri/:url',
|
url: '/uri/:url',
|
||||||
needProfile: true,
|
|
||||||
views: {
|
|
||||||
'main': {
|
|
||||||
templateUrl: 'views/uri.html'
|
templateUrl: 'views/uri.html'
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.state('uripayment', {
|
.state('uripayment', {
|
||||||
url: '/uri-payment/:url',
|
url: '/uri-payment/:url',
|
||||||
templateUrl: 'views/paymentUri.html',
|
templateUrl: 'views/paymentUri.html'
|
||||||
views: {
|
})
|
||||||
'main': {
|
.state('uriglidera', {
|
||||||
templateUrl: 'views/paymentUri.html',
|
url: '/uri-glidera/:url',
|
||||||
},
|
templateUrl: 'views/glideraUri.html'
|
||||||
},
|
})
|
||||||
needProfile: true
|
.state('uricoinbase', {
|
||||||
|
url: '/uri-coinbase/:url',
|
||||||
|
templateUrl: 'views/coinbaseUri.html'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
@ -528,27 +524,97 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
*
|
*
|
||||||
* Glidera
|
* Glidera
|
||||||
*
|
*
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.state('uriglidera', {
|
|
||||||
url: '/uri-glidera/:url',
|
|
||||||
templateUrl: 'views/glideraUri.html'
|
|
||||||
})
|
|
||||||
.state('glidera', {
|
.state('glidera', {
|
||||||
url: '/glidera',
|
url: '/glidera',
|
||||||
|
abstract: true,
|
||||||
|
template: '<ion-nav-view name="glidera"></ion-nav-view>'
|
||||||
|
})
|
||||||
|
.state('glidera.main', {
|
||||||
|
url: '/main',
|
||||||
|
views: {
|
||||||
|
'glidera': {
|
||||||
templateUrl: 'views/glidera.html'
|
templateUrl: 'views/glidera.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.state('buyGlidera', {
|
.state('glidera.buy', {
|
||||||
url: '/buy',
|
url: '/buy',
|
||||||
|
views: {
|
||||||
|
'glidera': {
|
||||||
templateUrl: 'views/buyGlidera.html'
|
templateUrl: 'views/buyGlidera.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.state('sellGlidera', {
|
.state('glidera.sell', {
|
||||||
url: '/sell',
|
url: '/sell',
|
||||||
|
views: {
|
||||||
|
'glidera': {
|
||||||
templateUrl: 'views/sellGlidera.html'
|
templateUrl: 'views/sellGlidera.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.state('preferencesGlidera', {
|
.state('glidera.preferences', {
|
||||||
url: '/preferencesGlidera',
|
url: '/preferences',
|
||||||
|
views: {
|
||||||
|
'glidera': {
|
||||||
templateUrl: 'views/preferencesGlidera.html'
|
templateUrl: 'views/preferencesGlidera.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* Coinbase
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
.state('coinbase', {
|
||||||
|
url: '/coinbase',
|
||||||
|
templateUrl: 'views/coinbase.html'
|
||||||
|
})
|
||||||
|
.state('preferencesCoinbase', {
|
||||||
|
url: '/preferencesCoinbase',
|
||||||
|
templateUrl: 'views/preferencesCoinbase.html'
|
||||||
|
})
|
||||||
|
.state('buyCoinbase', {
|
||||||
|
url: '/buycoinbase',
|
||||||
|
templateUrl: 'views/buyCoinbase.html'
|
||||||
|
})
|
||||||
|
.state('sellCoinbase', {
|
||||||
|
url: '/sellcoinbase',
|
||||||
|
templateUrl: 'views/sellCoinbase.html'
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* Amazon Gift Card
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
.state('amazon', {
|
||||||
|
url: '/amazon',
|
||||||
|
abstract: true,
|
||||||
|
template: '<ion-nav-view name="amazon"></ion-nav-view>'
|
||||||
|
})
|
||||||
|
.state('amazon.main', {
|
||||||
|
url: '/main',
|
||||||
|
views: {
|
||||||
|
'amazon': {
|
||||||
|
templateUrl: 'views/amazon.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('amazon.buy', {
|
||||||
|
url: '/buy',
|
||||||
|
views: {
|
||||||
|
'amazon': {
|
||||||
|
templateUrl: 'views/buyAmazon.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -577,70 +643,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
templateUrl: 'views/preferencesBitpayCard.html'
|
templateUrl: 'views/preferencesBitpayCard.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Coinbase
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
.state('coinbase', {
|
|
||||||
url: '/coinbase',
|
|
||||||
templateUrl: 'views/coinbase.html'
|
|
||||||
})
|
|
||||||
.state('preferencesCoinbase', {
|
|
||||||
url: '/preferencesCoinbase',
|
|
||||||
templateUrl: 'views/preferencesCoinbase.html'
|
|
||||||
})
|
|
||||||
.state('uricoinbase', {
|
|
||||||
url: '/uri-coinbase/:url',
|
|
||||||
templateUrl: 'views/coinbaseUri.html'
|
|
||||||
})
|
|
||||||
.state('buyCoinbase', {
|
|
||||||
url: '/buycoinbase',
|
|
||||||
templateUrl: 'views/buyCoinbase.html'
|
|
||||||
})
|
|
||||||
.state('sellCoinbase', {
|
|
||||||
url: '/sellcoinbase',
|
|
||||||
templateUrl: 'views/sellCoinbase.html'
|
|
||||||
})
|
|
||||||
.state('buyandsell', {
|
|
||||||
url: '/buyandsell',
|
|
||||||
templateUrl: 'views/buyAndSell.html',
|
|
||||||
controller: function(platformInfo) {
|
|
||||||
if (platformInfo.isCordova && StatusBar.isVisible) {
|
|
||||||
StatusBar.backgroundColorByHexString("#4B6178");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Amazon Gift Card
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
.state('amazon', {
|
|
||||||
url: '/amazon',
|
|
||||||
abstract: true,
|
|
||||||
template: '<ion-nav-view name="amazon"></ion-nav-view>'
|
|
||||||
})
|
|
||||||
.state('amazon.main', {
|
|
||||||
url: '/main',
|
|
||||||
views: {
|
|
||||||
'amazon': {
|
|
||||||
templateUrl: 'views/amazon.html'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.state('amazon.buy', {
|
|
||||||
url: '/buy',
|
|
||||||
views: {
|
|
||||||
'amazon': {
|
|
||||||
templateUrl: 'views/buyAmazon.html'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog) {
|
.run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog) {
|
||||||
|
|
|
@ -123,11 +123,6 @@ angular.module('copayApp.services').factory('configService', function(storageSer
|
||||||
configCache.colorFor = configCache.colorFor || {};
|
configCache.colorFor = configCache.colorFor || {};
|
||||||
configCache.aliasFor = configCache.aliasFor || {};
|
configCache.aliasFor = configCache.aliasFor || {};
|
||||||
|
|
||||||
|
|
||||||
// Glidera
|
|
||||||
// Disabled for testnet
|
|
||||||
configCache.glidera.testnet = false;
|
|
||||||
|
|
||||||
// Coinbase
|
// Coinbase
|
||||||
// Disabled for testnet
|
// Disabled for testnet
|
||||||
configCache.coinbase.testnet = false;
|
configCache.coinbase.testnet = false;
|
||||||
|
|
|
@ -4,11 +4,15 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
||||||
var root = {};
|
var root = {};
|
||||||
var credentials = {};
|
var credentials = {};
|
||||||
var isCordova = platformInfo.isCordova;
|
var isCordova = platformInfo.isCordova;
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
root.setCredentials = function(network) {
|
var _setCredentials = function() {
|
||||||
if (network == 'testnet') {
|
/*
|
||||||
|
* Development: 'testnet'
|
||||||
|
* Production: 'livenet'
|
||||||
|
*/
|
||||||
|
credentials.NETWORK = 'livenet';
|
||||||
|
|
||||||
|
if (credentials.NETWORK == 'testnet') {
|
||||||
credentials.HOST = 'https://sandbox.glidera.io';
|
credentials.HOST = 'https://sandbox.glidera.io';
|
||||||
if (isCordova) {
|
if (isCordova) {
|
||||||
credentials.REDIRECT_URI = 'copay://glidera';
|
credentials.REDIRECT_URI = 'copay://glidera';
|
||||||
|
@ -33,11 +37,25 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
root.getEnvironment = function() {
|
||||||
|
_setCredentials();
|
||||||
|
return credentials.NETWORK;
|
||||||
|
};
|
||||||
|
|
||||||
root.getOauthCodeUrl = function() {
|
root.getOauthCodeUrl = function() {
|
||||||
|
_setCredentials();
|
||||||
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) {
|
||||||
|
_setCredentials();
|
||||||
|
storageService.removeGlideraToken(credentials.NETWORK, function() {
|
||||||
|
return cb();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
root.getToken = function(code, cb) {
|
root.getToken = function(code, cb) {
|
||||||
|
_setCredentials();
|
||||||
var req = {
|
var req = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: credentials.HOST + '/api/v1/oauth/token',
|
url: credentials.HOST + '/api/v1/oauth/token',
|
||||||
|
@ -64,6 +82,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
||||||
};
|
};
|
||||||
|
|
||||||
var _get = function(endpoint, token) {
|
var _get = function(endpoint, token) {
|
||||||
|
_setCredentials();
|
||||||
return {
|
return {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: credentials.HOST + '/api/v1' + endpoint,
|
url: credentials.HOST + '/api/v1' + endpoint,
|
||||||
|
@ -176,6 +195,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
||||||
};
|
};
|
||||||
|
|
||||||
var _post = function(endpoint, token, twoFaCode, data) {
|
var _post = function(endpoint, token, twoFaCode, data) {
|
||||||
|
_setCredentials();
|
||||||
return {
|
return {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: credentials.HOST + '/api/v1' + endpoint,
|
url: credentials.HOST + '/api/v1' + endpoint,
|
||||||
|
@ -251,91 +271,39 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.init = function(accessToken) {
|
root.init = function(accessToken, cb) {
|
||||||
root.glideraEnabled = configService.getSync().glidera.enabled;
|
_setCredentials();
|
||||||
root.glideraTestnet = configService.getSync().glidera.testnet;
|
$log.debug('Init Glidera...');
|
||||||
var network = root.glideraTestnet ? 'testnet' : 'livenet';
|
|
||||||
|
|
||||||
root.glideraToken = null;
|
var glidera = {
|
||||||
root.glideraError = null;
|
token: null,
|
||||||
root.glideraPermissions = null;
|
permissions: null
|
||||||
root.glideraEmail = null;
|
}
|
||||||
root.glideraPersonalInfo = null;
|
|
||||||
root.glideraTxs = null;
|
|
||||||
root.glideraStatus = null;
|
|
||||||
|
|
||||||
if (!root.glideraEnabled) return;
|
|
||||||
|
|
||||||
root.setCredentials(network);
|
|
||||||
|
|
||||||
var getToken = function(cb) {
|
var getToken = function(cb) {
|
||||||
if (accessToken) {
|
if (accessToken) {
|
||||||
cb(null, accessToken);
|
cb(null, accessToken);
|
||||||
} else {
|
} else {
|
||||||
storageService.getGlideraToken(network, cb);
|
storageService.getGlideraToken(credentials.NETWORK, cb);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
getToken(function(err, accessToken) {
|
getToken(function(err, accessToken) {
|
||||||
if (err || !accessToken) return;
|
if (err || !accessToken) return cb();
|
||||||
else {
|
else {
|
||||||
root.getAccessTokenPermissions(accessToken, function(err, p) {
|
root.getAccessTokenPermissions(accessToken, function(err, p) {
|
||||||
if (err) {
|
if (err) {
|
||||||
root.glideraError = err;
|
return cb(err);
|
||||||
} else {
|
} else {
|
||||||
root.glideraToken = accessToken;
|
glidera.token = accessToken;
|
||||||
root.glideraPermissions = p;
|
glidera.permissions = p;
|
||||||
root.update({
|
return cb(null, glidera);
|
||||||
fullUpdate: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.update = function(opts) {
|
|
||||||
if (!root.glideraToken || !root.glideraPermissions) return;
|
|
||||||
var accessToken = root.glideraToken;
|
|
||||||
var permissions = root.glideraPermissions;
|
|
||||||
|
|
||||||
opts = opts || {};
|
|
||||||
|
|
||||||
root.getStatus(accessToken, function(err, data) {
|
|
||||||
root.glideraStatus = data;
|
|
||||||
});
|
|
||||||
|
|
||||||
root.getLimits(accessToken, function(err, limits) {
|
|
||||||
root.glideraLimits = limits;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (permissions.transaction_history) {
|
|
||||||
root.getTransactions(accessToken, function(err, data) {
|
|
||||||
root.glideraTxs = data;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (permissions.view_email_address && opts.fullUpdate) {
|
|
||||||
root.getEmail(accessToken, function(err, data) {
|
|
||||||
root.glideraEmail = data.email;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (permissions.personal_info && opts.fullUpdate) {
|
|
||||||
root.getPersonalInfo(accessToken, function(err, data) {
|
|
||||||
root.glideraPersonalInfo = data;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
configService.whenAvailable(function() {
|
|
||||||
$log.debug('Init Glidera Service...');
|
|
||||||
root.init();
|
|
||||||
});
|
|
||||||
|
|
||||||
$rootScope.$on('NewBlock', function() {
|
|
||||||
root.update();
|
|
||||||
});
|
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -67,7 +67,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
|
||||||
window.plugins.spinnerDialog.show(null, showName, true);
|
window.plugins.spinnerDialog.show(null, showName, true);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
var tmpl = '<ion-spinner class="spinner-stable" icon="lines"></ion-spinner>' + showName;
|
var tmpl = '<div class="item-icon-left">' + showName + '<ion-spinner class="spinner-stable" icon="lines"></ion-spinner></div>';
|
||||||
$ionicLoading.show({
|
$ionicLoading.show({
|
||||||
template: tmpl
|
template: tmpl
|
||||||
});
|
});
|
||||||
|
|
|
@ -1055,3 +1055,14 @@ input[type=number] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Spinner */
|
||||||
|
|
||||||
|
.item-icon-left ion-spinner {
|
||||||
|
float: left;
|
||||||
|
margin-left: -3.2em;
|
||||||
|
margin-right: 1em;
|
||||||
|
margin-top: -0.2em;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue