Merge pull request #5334 from cmgustavo/feat/coinbase-integration
Re-enable Coinbase integration
This commit is contained in:
commit
6bbb1fd442
30 changed files with 1632 additions and 1241 deletions
|
|
@ -21,12 +21,9 @@
|
|||
<span class="toggle-label" translate>Enable Glidera Service</span>
|
||||
</ion-toggle>
|
||||
|
||||
<!-- disable coinbase for this release -->
|
||||
|
||||
<!-- <ion-toggle ng-show="!isWP" ng-model="coinbaseEnabled" toggle-class="toggle-balanced" ng-change="coinbaseChange()">
|
||||
<ion-toggle ng-show="!isWP" ng-model="coinbaseEnabled.value" toggle-class="toggle-balanced" ng-change="coinbaseChange()">
|
||||
<span class="toggle-label" translate>Enable Coinbase Service</span>
|
||||
</ion-toggle> -->
|
||||
|
||||
</ion-toggle>
|
||||
|
||||
<div class="item item-divider" translate>Wallet Operation</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -14,14 +14,14 @@
|
|||
|
||||
<ion-content scroll="false">
|
||||
|
||||
<div ng-if="!customAmount && !isGlidera">
|
||||
<div ng-if="!customAmount && !isGlidera && !nextStep">
|
||||
<div class="item item-no-bottom-border recipient-label" translate>Recipient</div>
|
||||
|
||||
<div class="item item-text-wrap item-icon-left bitcoin-address" ng-class="{'item-big-icon-left':cardId}">
|
||||
<i class="icon big-icon-svg" ng-if="isWallet">
|
||||
<img src="img/icon-wallet.svg" ng-style="{'background-color': toColor}" class="bg"/>
|
||||
</i>
|
||||
<span ng-if="!isWallet && !isGiftCard && !isGlidera">
|
||||
<span ng-if="!isWallet && !isGiftCard">
|
||||
<i class="icon big-icon-svg" ng-if="isChromeApp">
|
||||
<img src="img/contact-placeholder.svg" class="bg"/>
|
||||
</i>
|
||||
|
|
@ -39,7 +39,8 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-class="{'amount-pane-recipient': !customAmount && !isGlidera, 'amount-pane-no-recipient': customAmount || isGlidera}">
|
||||
<div ng-class="{'amount-pane-recipient': !customAmount && !isGlidera && !nextStep,
|
||||
'amount-pane-no-recipient': customAmount || isGlidera || nextStep}">
|
||||
|
||||
<div class="amount-bar oh">
|
||||
<div class="title">
|
||||
|
|
|
|||
|
|
@ -1,169 +1,113 @@
|
|||
<div
|
||||
class="topbar-container"
|
||||
ng-include="'views/includes/topbar.html'"
|
||||
ng-init="titleSection='Buy'; goBackToState = 'coinbase'; noColor = true">
|
||||
</div>
|
||||
<ion-view id="coinbase" hide-tabs>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>Buy bitcoin</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content class="add-bottom-for-cta">
|
||||
<!-- BUY -->
|
||||
<div class="list" ng-if="buyRequestInfo">
|
||||
|
||||
<div class="content coinbase" ng-controller="buyCoinbaseController as buy">
|
||||
|
||||
<div class="row m20t" ng-show="buy.error || index.coinbaseError" ng-click="buy.error = null">
|
||||
<div class="columns">
|
||||
<div class="box-notification">
|
||||
<ul class="no-bullet m0 size-12 text-warning">
|
||||
<li ng-repeat="err in (buy.error.errors || index.coinbaseError.errors)" ng-bind-html="err.message"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m20ti"
|
||||
ng-show="index.coinbaseAccount && !buy.buyInfo && !buy.receiveInfo">
|
||||
<div class="columns">
|
||||
|
||||
<form name="buyCoinbaseForm"
|
||||
ng-submit="buy.buyRequest(index.coinbaseToken, index.coinbaseAccount)" novalidate>
|
||||
|
||||
<div ng-if="index.coinbaseToken" ng-init="buy.getPaymentMethods(index.coinbaseToken)">
|
||||
<label>Payment method</label>
|
||||
<select
|
||||
ng-model="selectedPaymentMethod.id"
|
||||
ng-options="item.id as item.name for item in buy.paymentMethods">
|
||||
</select>
|
||||
<div class="item head">
|
||||
<div class="sending-label">
|
||||
<img src="img/buy-bitcoin.svg" alt="buy bitcoin" width="35" class="item-img-buy">
|
||||
<span>Buying</span>
|
||||
</div>
|
||||
<div class="amount-label">
|
||||
<div class="amount">{{amountUnitStr}}</div>
|
||||
<div class="alternative" ng-if="buyPrice">
|
||||
<span ng-show="isFiat">{{buyRequestInfo.amount.amount}} {{buyRequestInfo.amount.currency}}</span>
|
||||
@ ${{buyPrice.amount}} per BTC
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>Amount
|
||||
<span
|
||||
ng-if="index.coinbaseToken"
|
||||
ng-init="buy.getPrice(index.coinbaseToken)"
|
||||
ng-show="buy.buyPrice"
|
||||
class="size-11 text-light right">
|
||||
1 BTC <i class="icon-arrow-right"></i> {{buy.buyPrice.amount}} {{buy.buyPrice.currency}}
|
||||
</span>
|
||||
<div class="info">
|
||||
<label class="item item-input item-select">
|
||||
<div class="input-label">
|
||||
Payment Method
|
||||
</div>
|
||||
<select ng-model="selectedPaymentMethodId.value"
|
||||
ng-options="item.id as item.name for item in paymentMethods"
|
||||
ng-change="buyRequest()">
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<div class="input">
|
||||
<input ng-show="!showAlternative" type="number" id="amount" ignore-mouse-wheel
|
||||
name="amount" ng-attr-placeholder="{{'Amount in ' + (showAlternative ? 'USD' : 'BTC')}}"
|
||||
ng-minlength="0.00000001" ng-maxlength="10000000000"
|
||||
ng-model="amount" autocomplete="off" ng-disabled="buy.loading">
|
||||
|
||||
<input ng-show="showAlternative" type="number" id="fiat" ignore-mouse-wheel
|
||||
name="fiat" ng-attr-placeholder="{{'Amount in ' + (showAlternative ? 'USD' : 'BTC')}}"
|
||||
ng-model="fiat" autocomplete="off" ng-disabled="buy.loading">
|
||||
|
||||
<a ng-show="!showAlternative" class="postfix button"
|
||||
ng-click="showAlternative = true; amount = null">BTC</a>
|
||||
<a ng-show="showAlternative" class="postfix button black"
|
||||
ng-click="showAlternative = false; fiat = null">USD</a>
|
||||
</div>
|
||||
|
||||
<div class="text-center text-gray size-12 m10b">
|
||||
<span ng-show="!(amount || fiat)">
|
||||
Enter the amount to get the exchange rate
|
||||
</span>
|
||||
<span ng-show="!buy.buyPrice && (amount || fiat)">
|
||||
Not available
|
||||
</span>
|
||||
<span ng-show="buy.buyPrice && amount && !fiat">
|
||||
~ {{buy.buyPrice.amount * amount | currency : 'USD ' : 2}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<i class="db fi-arrow-down size-24 m10v"></i>
|
||||
</div>
|
||||
|
||||
<div
|
||||
ng-if="index.coinbaseToken"
|
||||
ng-init="buy.init(index.coinbaseTestnet)"
|
||||
ng-click="openWalletsModal(buy.allWallets)">
|
||||
<label>Copay Wallet</label>
|
||||
<div class="input">
|
||||
<input type="text" id="address" name="address" ng-disabled="buy.selectedWalletId"
|
||||
ng-attr-placeholder="{{'Choose a wallet to receive bitcoin'}}" ng-model="buy.selectedWalletName" required>
|
||||
<a class="postfix size-12 m0 text-gray">
|
||||
<i class="icon-wallet size-18"></i>
|
||||
</a>
|
||||
<div class="item item-icon-right" ng-click="showWalletSelector()">
|
||||
<div class="label">Receive in</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/icon-wallet.svg" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</div>
|
||||
|
||||
<div class="input m20t">
|
||||
<input class="button black expand round"
|
||||
ng-disabled="buy.loading || (!amount && !fiat) || !selectedPaymentMethod"
|
||||
ng-style="{'background-color': '#2b71b1'}"
|
||||
type="submit" value="{{'Continue'}}">
|
||||
<div class="item item-divider">
|
||||
Transaction details
|
||||
</div>
|
||||
<div class="item">
|
||||
Amount
|
||||
<span class="item-note">
|
||||
{{buyRequestInfo.subtotal.amount}} {{buyRequestInfo.subtotal.currency}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item" ng-repeat="fee in buyRequestInfo.fees">
|
||||
<span class="capitalized">
|
||||
{{fee.type}} fee
|
||||
</span>
|
||||
<span class="item-note">
|
||||
{{fee.amount.amount}} {{fee.amount.currency}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
Total to pay
|
||||
<span class="item-note total-amount">
|
||||
{{buyRequestInfo.total.amount}} {{buyRequestInfo.total.currency}}
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="m20ti row" ng-show="buy.receiveInfo && !buy.sellInfo && !buy.success">
|
||||
<div class="columns">
|
||||
<h1>Funds sent to Copay Wallet</h1>
|
||||
<p class="size-12 text-gray">
|
||||
Buy confirmed. Funds will be send soon to your selected Copay Wallet
|
||||
</p>
|
||||
<button class="m20t outline black round expand"
|
||||
ng-style="{'background-color': '#2b71b1'}"
|
||||
href ui-sref="coinbase">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="buy.buyInfo && !buy.receiveInfo && !buy.success">
|
||||
<h4 class="title">Confirm transaction</h4>
|
||||
|
||||
<ul class="no-bullet m10t size-12 white">
|
||||
<li class="line-b line-t p15">
|
||||
<span class="m10 text-normal text-bold">Amount</span>
|
||||
<span class="right text-gray">{{buy.buyInfo.amount.amount}} {{buy.buyInfo.amount.currency}}</span>
|
||||
</li>
|
||||
<li class="line-b oh p15">
|
||||
<span class="m10 text-normal text-bold">Fees</span>
|
||||
<span class="right text-gray">
|
||||
<div ng-repeat="fee in buy.buyInfo.fees">
|
||||
<b>{{fee.type}}</b> {{fee.amount.amount}} {{fee.amount.currency}}
|
||||
</div>
|
||||
</span>
|
||||
</li>
|
||||
<li class="line-b p15">
|
||||
<span class="m10 text-normal text-bold">Subtotal</span>
|
||||
<span class="right text-gray">{{buy.buyInfo.subtotal.amount}} {{buy.buyInfo.subtotal.currency}}</span>
|
||||
</li>
|
||||
<li class="line-b p15">
|
||||
<span class="m10 text-normal text-bold">Total</span>
|
||||
<span class="right text-gray">{{buy.buyInfo.total.amount}} {{buy.buyInfo.total.currency}}</span>
|
||||
</li>
|
||||
<li class="line-b p15">
|
||||
<span class="m10 text-normal text-bold">Payout at</span>
|
||||
<span class="right text-gray">{{buy.buyInfo.payout_at | amCalendar}}</span>
|
||||
</li>
|
||||
<li class="line-b p15">
|
||||
<span class="m10 text-normal text-bold">Deposit into Copay Wallet</span>
|
||||
<span class="right text-gray">{{buy.selectedWalletName}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="row">
|
||||
<div class="columns">
|
||||
<button class="button black round expand"
|
||||
ng-style="{'background-color': '#2b71b1'}"
|
||||
ng-click="buy.confirmBuy(index.coinbaseToken, index.coinbaseAccount, buy.buyInfo)"
|
||||
ng-disabled="buy.loading">
|
||||
Buy
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m20t row text-center" ng-show="buy.success">
|
||||
<div class="columns">
|
||||
<h1>Purchase initiated</h1>
|
||||
<p class="text-gray">
|
||||
Bitcoin purchase completed. Coinbase has queued the transfer to your selected Copay wallet.
|
||||
</p>
|
||||
|
||||
<button class="outline dark-gray round expand" href ui-sref="coinbase">OK</button>
|
||||
</ion-content>
|
||||
|
||||
<click-to-accept
|
||||
ng-disabled="!selectedPaymentMethodId.value || !buyRequestInfo || !wallet"
|
||||
ng-click="buyConfirm()"
|
||||
ng-if="!isCordova && buyRequestInfo"
|
||||
click-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="!selectedPaymentMethodId.value"
|
||||
no-matching-wallet="!buyRequestInfo">
|
||||
Confirm purchase
|
||||
</click-to-accept>
|
||||
<slide-to-accept
|
||||
ng-disabled="!selectedPaymentMethodId.value || !buyRequestInfo || !wallet"
|
||||
ng-if="isCordova && buyRequestInfo"
|
||||
slide-on-confirm="buyConfirm()"
|
||||
slide-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="!selectedPaymentMethodId.value"
|
||||
no-matching-wallet="!buyRequestInfo">
|
||||
Slide to buy
|
||||
</slide-to-accept>
|
||||
<slide-to-accept-success
|
||||
slide-success-show="sendStatus === 'success'"
|
||||
slide-success-on-confirm="goBackHome()"
|
||||
slide-success-hide-on-confirm="true">
|
||||
<span>Bought</span>
|
||||
<div class="m10 size-14">
|
||||
Bitcoin purchase completed. Coinbase has queued the transfer to your selected wallet
|
||||
</div>
|
||||
</div>
|
||||
</slide-to-accept-success>
|
||||
|
||||
</div>
|
||||
<div class="extra-margin-bottom"></div>
|
||||
<wallet-selector
|
||||
wallet-selector-title="walletSelectorTitle"
|
||||
wallet-selector-wallets="wallets"
|
||||
wallet-selector-selected-wallet="wallet"
|
||||
wallet-selector-show="showWallets"
|
||||
wallet-selector-on-select="onWalletSelect">
|
||||
</wallet-selector>
|
||||
</ion-view>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@
|
|||
</ion-nav-bar>
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-item class="item item-icon-right" ui-sref="tabs.buyandsell.coinbase">
|
||||
<img src="img/coinbase-logo.png" width="90">
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</ion-item>
|
||||
<ion-item class="item item-icon-right" ui-sref="tabs.buyandsell.glidera">
|
||||
<img src="img/glidera-logo.png" width="90">
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
|
|
|
|||
|
|
@ -1,59 +1,19 @@
|
|||
<ion-view id="coinbase">
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>Coinbase</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<div class="topbar-container">
|
||||
<nav ng-controller="topbarController as topbar"
|
||||
class="tab-bar"
|
||||
ng-style="{'background-color': '#2b71b1'}">
|
||||
<section class="left-small">
|
||||
<a class="p10"
|
||||
ng-click="topbar.goHome()">
|
||||
<span class="text-close">Close</span>
|
||||
</a>
|
||||
</section>
|
||||
<ion-content>
|
||||
|
||||
<section class="right-small" ng-show="index.coinbaseAccount">
|
||||
<a class="p10" href ui-sref="preferencesCoinbase">
|
||||
<i class="fi-widget size-24"></i>
|
||||
</a>
|
||||
</section>
|
||||
|
||||
<section class="middle tab-bar-section">
|
||||
<h1 class="title ellipsis">
|
||||
Buy & Sell Bitcoin
|
||||
</h1>
|
||||
</section>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content coinbase p20b" ng-controller="coinbaseController as coinbase">
|
||||
<div class="row" ng-show="index.coinbaseError || (index.coinbaseToken && !index.coinbaseAccount)">
|
||||
<div class="m20b box-notification" ng-show="index.coinbaseError">
|
||||
<ul class="no-bullet m0 text-warning size-12">
|
||||
<li ng-repeat="err in index.coinbaseError.errors" ng-bind-html="err.message"></li>
|
||||
<div class="box-notification error" ng-show="error">
|
||||
<ul class="no-bullet m0 size-12">
|
||||
<li ng-repeat="err in error.errors" ng-bind-html="err.message"></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="m20b box-notification" ng-show="index.coinbaseToken && !index.coinbaseAccount">
|
||||
<div class="text-warning">
|
||||
<span>Your primary account should be a WALLET. Set your wallet account as primary and try again.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m10t text-center">
|
||||
<button
|
||||
class="dark-gray outline round tiny"
|
||||
ng-click="index.initCoinbase(index.coinbaseToken)">
|
||||
Reconnect
|
||||
</button>
|
||||
<div class="m20t size-12">
|
||||
Or go to <a class="text-gray" href ui-sref="preferencesCoinbase">Preferences</a> and log out manually.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-if="!index.coinbaseToken && !index.coinbaseError" class="row">
|
||||
<div class="box-notification text-center size-12 text-warning" ng-show="index.coinbaseTestnet">
|
||||
<i class="fi-info"></i>
|
||||
Testnet wallets only work with Coinbase Sandbox Accounts
|
||||
</div>
|
||||
<div class="columns" ng-init="showOauthForm = false">
|
||||
<div ng-if="!accessToken && !error" ng-init="showOauthForm = false">
|
||||
<div class="text-center m20v">
|
||||
<img src="img/coinbase-logo.png" width="200">
|
||||
</div>
|
||||
|
|
@ -61,111 +21,112 @@
|
|||
|
||||
<p class="m20t text-gray size-12">Connect your Coinbase account to get started</p>
|
||||
|
||||
<a class="button light-gray outline round small"
|
||||
ng-click="coinbase.openAuthenticateWindow(); showOauthForm = true">
|
||||
<button class="button button-standard button-primary"
|
||||
ng-click="coinbase.openAuthenticateWindow()">
|
||||
Connect to Coinbase
|
||||
</a>
|
||||
<div>
|
||||
</button>
|
||||
<div class="m20t">
|
||||
<a href ng-click="showOauthForm = true" class="text-gray size-12">
|
||||
Do you already have the Oauth Code?
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center" ng-show="showOauthForm">
|
||||
<div ng-show="showOauthForm">
|
||||
<div class="text-left box-notification" ng-show="coinbase.error">
|
||||
<ul class="no-bullet m0 text-warning size-12">
|
||||
<li ng-repeat="err in coinbase.error.errors" ng-bind-html="err.message"></li>
|
||||
</ul>
|
||||
</div>
|
||||
<form name="oauthCodeForm" ng-submit="coinbase.submitOauthCode(code)" novalidate>
|
||||
<label>OAuth Code</label>
|
||||
<input type="text" ng-model="code" ng-disabled="coinbase.loading"
|
||||
ng-attr-placeholder="{{'Paste the authorization code here'}}" required>
|
||||
<input
|
||||
class="button expand round"
|
||||
ng-style="{'background-color': '#2b71b1'}"
|
||||
type="submit" value="Get started" ng-disabled="oauthCodeForm.$invalid || coinbase.loading">
|
||||
</form>
|
||||
<button class="button light-gray expand outline round"
|
||||
ng-click="showOauthForm = false; index.coinbaseError = null; coinbase.error = null">
|
||||
<i class="fi-arrow-left"></i> <span class="tu">Back</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-if="index.coinbaseToken && index.coinbaseAccount && !index.coinbaseError">
|
||||
|
||||
<div class="p20v text-center" ng-show="index.coinbaseAccount" ng-click="index.updateCoinbase({updateAccount: true})">
|
||||
<img src="img/coinbase-logo.png" width="100">
|
||||
</div>
|
||||
|
||||
<ul ng-show="index.coinbaseAccount" class="no-bullet m0 size-12">
|
||||
<li class="line-b line-t p15 coinbase-pointer"
|
||||
href ui-sref="buyCoinbase">
|
||||
<img src="img/buy-bitcoin.svg" alt="buy bitcoin" width="30">
|
||||
<span class="m10 text-normal text-bold">Buy Bitcoin</span>
|
||||
<span class="right text-gray">
|
||||
<i class="icon-arrow-right3 size-24 right"></i>
|
||||
</span>
|
||||
</li>
|
||||
<li class="line-b p15 coinbase-pointer"
|
||||
href ui-sref="sellCoinbase">
|
||||
<img src="img/sell-bitcoin.svg" alt="sell bitcoin" width="30">
|
||||
<span class="m10 text-normal text-bold">Sell Bitcoin</span>
|
||||
<span class="right text-gray">
|
||||
<i class="icon-arrow-right3 size-24 right"></i>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div ng-show="index.coinbasePendingTransactions && !index.coinbaseError">
|
||||
<h4 class="title">Activity</h4>
|
||||
<div class="m20b box-notification" ng-show="index.coinbasePendingError">
|
||||
<ul class="no-bullet m0 text-warning size-12">
|
||||
<li ng-repeat="err in index.coinbasePendingError.errors" ng-bind-html="err.message"></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div ng-repeat="(id, tx) in index.coinbasePendingTransactions | orderObjectBy:'updated_at':true track by $index"
|
||||
ng-click="coinbase.openTxModal(tx)"
|
||||
class="row collapse coinbase-last-transactions-content">
|
||||
<div class="large-2 medium-2 small-2 columns">
|
||||
<img src="img/bought-pending.svg" alt="bought" width="24" ng-show="(tx.type == 'buy' || (tx.to && tx.type == 'send')) && tx.status != 'completed'">
|
||||
<img src="img/bought.svg" alt="bought" width="30" ng-show="(tx.type == 'buy' || (tx.to && tx.type == 'send')) && tx.status == 'completed'">
|
||||
<img src="img/sold-pending.svg" alt="sold" width="24" ng-show="tx.from && tx.type == 'send'">
|
||||
<img src="img/sold.svg" alt="sold" width="30" ng-show="!tx.from && tx.type == 'sell' && tx.status == 'completed'">
|
||||
</div>
|
||||
|
||||
<div class="large-5 medium-5 small-5 columns">
|
||||
<div class="size-12 m5t">
|
||||
<span ng-show="tx.type == 'sell' && tx.status == 'completed'">Sold</span>
|
||||
<span ng-show="tx.type == 'buy' && tx.status == 'completed'">Bought</span>
|
||||
<span class="text-bold">
|
||||
<span ng-if="tx.type == 'sell' || (tx.type == 'send' && tx.from)">-</span>{{tx.amount.amount.replace('-','')}}
|
||||
{{tx.amount.currency}}
|
||||
</span>
|
||||
<div class="list settings-input-group">
|
||||
<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>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="large-4 medium-4 small-4 columns text-right">
|
||||
<div ng-show="tx.error" class="m5t size-12 text-warning">
|
||||
<input
|
||||
class="button button-standard button-primary"
|
||||
type="submit" value="Connect Coinbase Account" ng-disabled="oauthCodeForm.$invalid">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-if="accessToken && !error">
|
||||
|
||||
<div class="m20t text-center" ng-click="updateTransactions()">
|
||||
<img src="img/coinbase-logo.png" width="200">
|
||||
</div>
|
||||
|
||||
<div class="m10t size-12 text-center text-gray">
|
||||
<span ng-show="!buyPrice || !sellPrice">...</span>
|
||||
<span ng-show="buyPrice && sellPrice">
|
||||
{{buyPrice.amount}} {{buyPrice.currency}}
|
||||
|
|
||||
{{sellPrice.amount}} {{sellPrice.currency}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="list card">
|
||||
<a class="item item-icon-right"
|
||||
href ui-sref="tabs.buyandsell.coinbase.amount({nextStep: 'tabs.buyandsell.coinbase.buy', currency: currency})">
|
||||
<img src="img/buy-bitcoin.svg" alt="buy bitcoin" width="30" class="item-img-buy" style="vertical-align:
|
||||
text-bottom;">
|
||||
Buy Bitcoin
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
<a class="item item-icon-right"
|
||||
href ui-sref="tabs.buyandsell.coinbase.amount({nextStep: 'tabs.buyandsell.coinbase.sell', currency: currency})">
|
||||
<img src="img/sell-bitcoin.svg" alt="sell bitcoin" width="30" class="item-img-sell" style="vertical-align:
|
||||
text-bottom;">
|
||||
Sell Bitcoin
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="list card">
|
||||
<div class="item item-heading" ng-click="updateTransactions()">
|
||||
Activity
|
||||
</div>
|
||||
<a class="item"
|
||||
ng-if="pendingTransactions.data && !error"
|
||||
ng-repeat="(id, tx) in pendingTransactions.data | orderObjectBy:'updated_at':true track by $index"
|
||||
ng-click="coinbase.openTxModal(tx)">
|
||||
|
||||
<span class="item-note">
|
||||
<div class="assertive" ng-show="tx.error || tx.status == 'error'">
|
||||
Error
|
||||
</div>
|
||||
<div ng-show="!tx.error" class="m5t size-12 text-gray">
|
||||
<div ng-show="!tx.error">
|
||||
<div ng-show="tx.status == 'completed'">
|
||||
<time ng-if="tx.created_at">{{tx.created_at | amTimeAgo}}</time>
|
||||
</div>
|
||||
<div ng-show="tx.status == 'pending'">
|
||||
<span class="label outline gray radius text-gray text-info" ng-if="tx.status == 'pending'">Pending</span>
|
||||
<span ng-if="tx.status == 'pending'">Pending</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="large-1 medium-1 small-1 columns text-right">
|
||||
<i class="icon-arrow-right3 size-18"></i>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<img class="left m10r" src="img/bought-pending.svg" alt="bought" width="24" ng-show="(tx.type == 'buy' || (tx.to && tx.type == 'send')) && tx.status != 'completed'">
|
||||
<img class="left m10r" src="img/bought.svg" alt="bought" width="30" ng-show="(tx.type == 'buy' || (tx.to && tx.type == 'send')) && tx.status == 'completed'">
|
||||
<img class="left m10r" src="img/sold-pending.svg" alt="sold" width="24" ng-show="tx.from && tx.type == 'send'">
|
||||
<img class="left m10r" src="img/sold.svg" alt="sold" width="30" ng-show="!tx.from && tx.type == 'sell' && tx.status == 'completed'">
|
||||
|
||||
<h2>
|
||||
<span ng-show="tx.type == 'sell' && tx.status == 'completed'">Sold</span>
|
||||
<span ng-show="tx.type == 'send' && tx.to && tx.status == 'completed'">Bought</span>
|
||||
</h2>
|
||||
<p>
|
||||
<span ng-if="tx.type == 'sell' || (tx.type == 'send' && tx.from)">-</span>{{tx.amount.amount.replace('-','')}}
|
||||
{{tx.amount.currency}}
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
<div class="m10t text-center" ng-if="loading">
|
||||
<ion-spinner class="spinner-dark" icon="lines"></ion-spinner>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="extra-margin-bottom"></div>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-view>
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
<div
|
||||
class="topbar-container"
|
||||
ng-include="'views/includes/topbar.html'"
|
||||
ng-init="titleSection='Coinbase'; closeToHome = true">
|
||||
</div>
|
||||
|
||||
<div class="content coinbase" ng-controller="coinbaseUriController as coinbase" ng-init="coinbase.checkCode()">
|
||||
|
||||
<div class="row m20t">
|
||||
<div class="large-12 columns">
|
||||
<div class="text-center">
|
||||
<img src="img/coinbase-logo.png"
|
||||
ng-click="index.updateCoinbase()" width="100">
|
||||
</div>
|
||||
|
||||
<div class="m10t text-center" ng-show="coinbase.error">
|
||||
<div class="notification m10b size-12 text-warning">{{coinbase.error}}</div>
|
||||
<button class="outline dark-gray tiny round" ng-click="coinbase.submitOauthCode(coinbase.code)">Try again</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -29,6 +29,7 @@
|
|||
<span class="item-note" ng-if="!paymentExpired.value">{{remainingTimeStr.value}}</span>
|
||||
<span class="item-note" ng-if="paymentExpired.value" ng-style="{'color': 'red'}" translate>Expired</span>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="label" ng-if="!isGlidera" translate>To</span>
|
||||
<span class="label" ng-if="isGlidera == 'buy'">From</span>
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
<ion-modal-view ng-controller="coinbaseConfirmationController">
|
||||
<div class="m20tp text-center">
|
||||
<div class="row">
|
||||
<h1 class="text-center m20b p20h">Are you sure you would like to log out of your Coinbase account?</h1>
|
||||
<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 light-gray expand outline round" ng-click="cancel()">
|
||||
<i class="fi-arrow-left"></i> <span class="tu">Back</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="large-6 medium-6 small-6 columns">
|
||||
<button class="button warning expand round" ng-click="ok()">
|
||||
<span>Log out</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-modal-view>
|
||||
|
|
@ -1,104 +1,88 @@
|
|||
<ion-modal-view ng-controller="coinbaseTxDetailsController">
|
||||
<ion-header-bar align-title="center" class="tab-bar" ng-style="{'background-color': '#2b71b1'}">
|
||||
<div class="left-small">
|
||||
<a ng-click="cancel()">
|
||||
<i class="icon-arrow-left3 icon-back"></i>
|
||||
<span class="text-back">Back</span>
|
||||
</a>
|
||||
<ion-header-bar align-title="center" class="bar-royal">
|
||||
<button class="button button-clear" ng-click="close()">
|
||||
Close
|
||||
</button>
|
||||
<div class="title">
|
||||
Details
|
||||
</div>
|
||||
<h1 class="title ellipsis" translate>Details</h1>
|
||||
</ion-header-bar>
|
||||
|
||||
<ion-content>
|
||||
<div class="fix-modals-touch">
|
||||
<div class="header-modal bg-gray text-center">
|
||||
<div class="p20">
|
||||
<img src="img/bought.svg" alt="bought" width="65" ng-show="(tx.type == 'buy' || (tx.type == 'send' && tx.to)) && tx.status == 'completed'">
|
||||
<img src="img/bought-pending.svg" alt="bought" width="65"
|
||||
ng-show="(tx.type == 'buy' || (tx.type == 'send' && tx.to)) && tx.status != 'completed'">
|
||||
<img src="img/sold.svg" alt="bought" width="65" ng-show="tx.type == 'sell' && tx.status == 'completed'">
|
||||
<img src="img/sold-pending.svg" alt="bought" width="65"
|
||||
ng-show="(tx.type == 'sell' || (tx.type == 'send' && tx.from)) && tx.status != 'completed'">
|
||||
</div>
|
||||
<div ng-show="tx.status == 'completed'">
|
||||
<span ng-show="tx.type == 'buy' || tx.type == 'send'">Bought</span>
|
||||
<span ng-show="tx.type == 'sell'">Sold</span>
|
||||
</div>
|
||||
<div ng-show="tx.type == 'send' && (tx.to || tx.from) && tx.status != 'completed'">
|
||||
<span ng-show="tx.to">Receiving purchased bitcoin</span>
|
||||
<span ng-show="tx.from">Sending bitcoin to sell</span>
|
||||
</div>
|
||||
<div ng-show="(tx.type == 'sell' || tx.type == 'buy') && tx.status != 'completed'">
|
||||
<span ng-show="tx.type == 'buy'">Buying bitcoin</span>
|
||||
<span ng-show="tx.type == 'sell'">Selling bitcoin</span>
|
||||
</div>
|
||||
<div class="size-24 text-bold">
|
||||
<span ng-if="tx.type == 'sell' || (tx.type == 'send' && tx.from)">-</span>{{tx.amount.amount.replace('-','')}}
|
||||
{{tx.amount.currency}}
|
||||
</div>
|
||||
<div class="label gray radius m10b">
|
||||
<span ng-if="tx.type == 'sell' || (tx.type == 'send' && tx.from)">-</span>{{tx.native_amount.amount.replace('-','')}}
|
||||
{{tx.native_amount.currency}}
|
||||
</div>
|
||||
<div class="text-center m20v">
|
||||
<div>
|
||||
<img src="img/bought.svg" alt="bought" width="65" ng-show="(tx.type == 'buy' || (tx.type == 'send' && tx.to)) && tx.status == 'completed'">
|
||||
<img src="img/bought-pending.svg" alt="bought" width="65"
|
||||
ng-show="(tx.type == 'buy' || (tx.type == 'send' && tx.to)) && tx.status != 'completed'">
|
||||
<img src="img/sold.svg" alt="bought" width="65" ng-show="tx.type == 'sell' && tx.status == 'completed'">
|
||||
<img src="img/sold-pending.svg" alt="bought" width="65"
|
||||
ng-show="(tx.type == 'sell' || (tx.type == 'send' && tx.from)) && tx.status != 'completed'">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="m20b box-notification" ng-show="tx.error">
|
||||
<ul class="no-bullet m0 text-warning size-12">
|
||||
<li ng-repeat="err in tx.error.errors" ng-bind-html="err.message"></li>
|
||||
</ul>
|
||||
<div ng-show="tx.status == 'completed'">
|
||||
<span ng-show="tx.type == 'buy' || tx.type == 'send'">Bought</span>
|
||||
<span ng-show="tx.type == 'sell'">Sold</span>
|
||||
</div>
|
||||
|
||||
<ul class="no-bullet size-14">
|
||||
|
||||
<li ng-show="tx.details && tx.status != 'pending'" class="line-b p10 oh">
|
||||
<span class="text-gray">{{tx.details.title}}</span>
|
||||
<span class="right">{{tx.details.subtitle}}</span>
|
||||
</li>
|
||||
|
||||
<li class="line-b p10 oh">
|
||||
<span class="text-gray">Status</span>
|
||||
<span class="text-success right" ng-if="tx.status == 'completed'">Completed</span>
|
||||
<span class="text-info right" ng-if="tx.status == 'pending'">Pending</span>
|
||||
<span class="text-warning right" ng-if="tx.status == 'error'">Error</span>
|
||||
</li>
|
||||
|
||||
<li ng-show="tx.created_at" class="line-b p10 oh">
|
||||
<span class="text-gray">Date</span>
|
||||
<span class="right">{{tx.created_at | amCalendar}}</span>
|
||||
</li>
|
||||
|
||||
<li ng-show="tx.price_sensitivity" class="line-b p10 oh">
|
||||
<span class="text-gray">Price Sensitivity</span>
|
||||
<span class="right">{{tx.price_sensitivity.name}}</span>
|
||||
</li>
|
||||
|
||||
<li ng-show="tx.sell_price_amount" class="line-b p10 oh">
|
||||
<span class="text-gray">Sell Price</span>
|
||||
<span class="right">{{tx.sell_price_amount}} {{tx.sell_price_currency}}</span>
|
||||
</li>
|
||||
|
||||
<li ng-show="tx.description" class="line-b p10 oh">
|
||||
<span class="text-gray" ng-show="tx.from && tx.type == 'send'">Sent bitcoin from</span>
|
||||
<span class="text-gray" ng-show="tx.to && tx.type == 'send'">Receive bitcoin in</span>
|
||||
<span class="right text-bold">{{tx.description}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="row m20t" ng-show="tx.status == 'error'">
|
||||
<div class="columns">
|
||||
<p class="text-center size-12 text-gray">
|
||||
This action will remove the transaction.
|
||||
</p>
|
||||
<button class="button outline round dark-gray expand tiny"
|
||||
ng-click="remove()">
|
||||
<i class="fi-x"></i>
|
||||
Remove
|
||||
</button>
|
||||
</div>
|
||||
<div ng-show="tx.type == 'send' && (tx.to || tx.from) && tx.status != 'completed'">
|
||||
<span ng-show="tx.to">Receiving purchased bitcoin</span>
|
||||
<span ng-show="tx.from">Sending bitcoin to sell</span>
|
||||
</div>
|
||||
<div ng-show="(tx.type == 'sell' || tx.type == 'buy') && tx.status != 'completed'">
|
||||
<span ng-show="tx.type == 'buy'">Buying bitcoin</span>
|
||||
<span ng-show="tx.type == 'sell'">Selling bitcoin</span>
|
||||
</div>
|
||||
<div class="size-24 text-bold">
|
||||
<span ng-if="tx.type == 'sell' || (tx.type == 'send' && tx.from)">-</span>{{tx.amount.amount.replace('-','')}}
|
||||
{{tx.amount.currency}}
|
||||
</div>
|
||||
<div class="size-12">
|
||||
<span ng-if="tx.type == 'sell' || (tx.type == 'send' && tx.from)">-</span>{{tx.native_amount.amount.replace('-','')}}
|
||||
{{tx.native_amount.currency}}
|
||||
</div>
|
||||
|
||||
<div class="extra-margin-bottom"></div>
|
||||
</div>
|
||||
|
||||
<ul class="card list" ng-show="tx.error">
|
||||
<li class="item" ng-repeat="err in tx.error.errors" ng-bind-html="err.message"></li>
|
||||
</ul>
|
||||
|
||||
<ul class="list">
|
||||
<li ng-show="tx.details && tx.status != 'pending'" class="item">
|
||||
{{tx.details.title}}
|
||||
<span class="item-note">{{tx.details.subtitle}}</span>
|
||||
</li>
|
||||
|
||||
<li class="item">
|
||||
Status
|
||||
<span class="item-note">
|
||||
<span class="balanced" ng-if="tx.status == 'completed'">Completed</span>
|
||||
<span class="dark" ng-if="tx.status == 'pending'">Pending</span>
|
||||
<span class="assertive" ng-if="tx.status == 'error'">Error</span>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li ng-show="tx.created_at" class="item">
|
||||
Date
|
||||
<span class="item-note">{{tx.created_at | amCalendar}}</span>
|
||||
</li>
|
||||
|
||||
<li ng-show="tx.price_sensitivity" class="item">
|
||||
Price Sensitivity
|
||||
<span class="item-note">{{tx.price_sensitivity.name}}</span>
|
||||
</li>
|
||||
|
||||
<li ng-show="tx.sell_price_amount" class="item">
|
||||
Sell Price
|
||||
<span class="item-note">{{tx.sell_price_amount}} {{tx.sell_price_currency}}</span>
|
||||
</li>
|
||||
|
||||
<li ng-show="tx.description" class="item">
|
||||
<span ng-show="tx.from && tx.type == 'send'">Sent bitcoin from</span>
|
||||
<span ng-show="tx.to && tx.type == 'send'">Receive bitcoin in</span>
|
||||
<span class="item-note">{{tx.description}}</span>
|
||||
</li>
|
||||
<div ng-show="tx.status == 'error'" class="item item-divider"></div>
|
||||
<div ng-show="tx.status == 'error'" class="item assertive" ng-click="remove()">
|
||||
Remove transaction
|
||||
</div>
|
||||
</ul>
|
||||
</ion-content>
|
||||
</ion-modal-view>
|
||||
|
|
|
|||
|
|
@ -1,60 +1,62 @@
|
|||
<div
|
||||
class="topbar-container"
|
||||
ng-include="'views/includes/topbar.html'"
|
||||
ng-init="titleSection='Preferences'; goBackToState = 'coinbase'; noColor = true">
|
||||
</div>
|
||||
<ion-view>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>Preferences</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<div class="content coinbase-preferences" ng-controller="preferencesCoinbaseController as coinbase">
|
||||
<ion-content>
|
||||
|
||||
<ul ng-if="index.coinbaseAccount && !index.coinbaseError" class="no-bullet m0">
|
||||
<h4 class="title m0">Account</h4>
|
||||
<li>
|
||||
<span>ID</span>
|
||||
<span class="right text-gray enable_text_select">
|
||||
{{index.coinbaseAccount.id}}
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>Name</span>
|
||||
<span class="right text-gray">
|
||||
{{index.coinbaseAccount.name}}
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>Balance</span>
|
||||
<span class="right text-gray">
|
||||
{{index.coinbaseAccount.balance.amount}} {{index.coinbaseAccount.balance.currency}}
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>Native Balance</span>
|
||||
<span class="right text-gray">
|
||||
{{index.coinbaseAccount.native_balance.amount}} {{index.coinbaseAccount.native_balance.currency}}
|
||||
</span>
|
||||
</li>
|
||||
<ul ng-if="coinbaseAccount && !error" class="list">
|
||||
<div class="item item-divider">
|
||||
Account
|
||||
</div>
|
||||
<li class="item">
|
||||
<span>ID</span>
|
||||
<span class="item-note">
|
||||
{{coinbaseAccount.id}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Name</span>
|
||||
<span class="item-note">
|
||||
{{coinbaseAccount.name}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Balance</span>
|
||||
<span class="item-note">
|
||||
{{coinbaseAccount.balance.amount}} {{coinbaseAccount.balance.currency}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Native Balance</span>
|
||||
<span class="item-note">
|
||||
{{coinbaseAccount.native_balance.amount}} {{coinbaseAccount.native_balance.currency}}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<h4 class="title m0">User Information</h4>
|
||||
<li>
|
||||
<span>ID</span>
|
||||
<span class="right text-gray enable_text_select">
|
||||
{{index.coinbaseUser.id}}
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>Email</span>
|
||||
<span class="right text-gray">
|
||||
{{index.coinbaseUser.email}}
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="no-bullet m0">
|
||||
<h4></h4>
|
||||
<li ng-click="coinbase.revokeToken(index.coinbaseTestnet)">
|
||||
<i class="icon-arrow-right3 size-24 right text-gray"></i>
|
||||
<span class="text-warning">Log out</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h4></h4>
|
||||
<div class="item item-divider">
|
||||
User Information
|
||||
</div>
|
||||
<li class="item">
|
||||
<span>ID</span>
|
||||
<span class="item-note">
|
||||
{{coinbaseUser.id}}
|
||||
</span>
|
||||
</li>
|
||||
<li class="item">
|
||||
<span>Email</span>
|
||||
<span class="item-note">
|
||||
{{coinbaseUser.email}}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
</div>
|
||||
<div class="extra-margin-bottom"></div>
|
||||
<div class="item item-divider"></div>
|
||||
<li class="item" ng-click="revokeToken()">
|
||||
<span class="assertive">Log out</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</ion-content>
|
||||
</ion-view>
|
||||
|
|
|
|||
|
|
@ -1,202 +1,146 @@
|
|||
<div
|
||||
class="topbar-container"
|
||||
ng-include="'views/includes/topbar.html'"
|
||||
ng-init="titleSection='Sell'; goBackToState = 'coinbase'; noColor = true">
|
||||
</div>
|
||||
<ion-view id="coinbase" hide-tabs>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>Sell bitcoin</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content class="add-bottom-for-cta">
|
||||
<!-- SELL -->
|
||||
<div class="list" ng-if="sellRequestInfo">
|
||||
|
||||
<div class="content coinbase" ng-controller="sellCoinbaseController as sell">
|
||||
|
||||
<div class="row m20t" ng-show="sell.error || index.coinbaseError" ng-click="sell.error = null">
|
||||
<div class="columns">
|
||||
<div class="box-notification">
|
||||
<ul class="no-bullet m0 size-12 text-warning">
|
||||
<li ng-repeat="err in (sell.error.errors || index.coinbaseError.errors)" ng-bind-html="err.message"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m20ti"
|
||||
ng-show="index.coinbaseAccount && !sell.sellInfo && !sell.sendInfo">
|
||||
<div class="columns">
|
||||
<form
|
||||
name="sellCoinbaseForm"
|
||||
ng-submit="sell.depositFunds(index.coinbaseToken, index.coinbaseAccount)"
|
||||
novalidate>
|
||||
|
||||
|
||||
<div ng-show="!showPriceSensitivity">
|
||||
|
||||
<div
|
||||
ng-if="index.coinbaseToken"
|
||||
ng-init="sell.init(index.coinbaseTestnet)"
|
||||
ng-click="openWalletsModal(sell.allWallets)">
|
||||
<label>Copay Wallet</label>
|
||||
<div class="input">
|
||||
<input type="text" id="address" name="address" ng-disabled="sell.selectedWalletId"
|
||||
ng-attr-placeholder="{{'Choose your source wallet'}}"
|
||||
ng-model="sell.selectedWalletName" required>
|
||||
<a class="postfix size-12 m0 text-gray">
|
||||
<i class="icon-wallet size-18"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>
|
||||
Amount
|
||||
<span
|
||||
ng-if="index.coinbaseToken"
|
||||
ng-init="sell.getPrice(index.coinbaseToken)"
|
||||
ng-show="sell.sellPrice"
|
||||
class="size-11 text-light right">
|
||||
1 BTC <i class="icon-arrow-right"></i> {{sell.sellPrice.amount}} {{sell.sellPrice.currency}}
|
||||
</span>
|
||||
</label>
|
||||
<div class="input">
|
||||
<input ng-show="!showAlternative" type="number" id="amount" ignore-mouse-wheel
|
||||
name="amount" ng-attr-placeholder="{{'Amount in ' + (showAlternative ? 'USD' : 'BTC')}}"
|
||||
ng-minlength="0.00000001" ng-maxlength="10000000000"
|
||||
ng-model="amount" autocomplete="off">
|
||||
|
||||
<input ng-show="showAlternative" type="number" id="fiat" ignore-mouse-wheel
|
||||
name="fiat" ng-attr-placeholder="{{'Amount in ' + (showAlternative ? 'USD' : 'BTC')}}"
|
||||
ng-model="fiat" autocomplete="off">
|
||||
|
||||
<a ng-show="!showAlternative" class="postfix button"
|
||||
ng-click="showAlternative = true; amount = null">BTC</a>
|
||||
<a ng-show="showAlternative" class="postfix button black"
|
||||
ng-click="showAlternative = false; fiat = null">USD</a>
|
||||
</div>
|
||||
|
||||
<div class="text-center text-gray size-12 m10b">
|
||||
<span ng-show="!(amount || fiat)">
|
||||
Enter the amount to get the exchange rate
|
||||
</span>
|
||||
<span ng-show="!sell.sellPrice && (amount || fiat)">
|
||||
Not available
|
||||
</span>
|
||||
<span ng-show="sell.sellPrice && amount && !fiat">
|
||||
~ {{sell.sellPrice.amount * amount | currency : 'USD ' : 2}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<i class="db fi-arrow-down size-24 m10v"></i>
|
||||
</div>
|
||||
|
||||
<div ng-if="index.coinbaseToken" ng-init="sell.getPaymentMethods(index.coinbaseToken)">
|
||||
<label>Deposit into</label>
|
||||
<select
|
||||
ng-model="selectedPaymentMethod.id"
|
||||
ng-options="item.id as item.name for item in sell.paymentMethods">
|
||||
</select>
|
||||
</div>
|
||||
<div class="input m20t">
|
||||
<a href class="button black expand round"
|
||||
ng-disabled=" (!amount && !fiat) || !sell.sellPrice.amount"
|
||||
ng-style="{'background-color': '#2b71b1'}"
|
||||
ng-click="showPriceSensitivity = true">Continue</a>
|
||||
<div class="item head">
|
||||
<div class="sending-label">
|
||||
<img src="img/sell-bitcoin.svg" alt="sell bitcoin" width="35" class="item-img-sell">
|
||||
<span>Selling</span>
|
||||
</div>
|
||||
<div class="amount-label">
|
||||
<div class="amount">{{amountUnitStr}}</div>
|
||||
<div class="alternative" ng-if="sellPrice">
|
||||
<span ng-show="isFiat">{{sellRequestInfo.amount.amount}} {{sellRequestInfo.amount.currency}}</span>
|
||||
@ ${{sellPrice.amount}} per BTC
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="showPriceSensitivity">
|
||||
<h1>Price Sensitivity</h1>
|
||||
<p class="size-14 text-gray">
|
||||
<div class="info">
|
||||
|
||||
<div class="item item-icon-right" ng-click="showWalletSelector()">
|
||||
<div class="label">From</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/icon-wallet.svg" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</div>
|
||||
|
||||
<label class="item item-input item-select">
|
||||
<div class="input-label">
|
||||
Deposit into
|
||||
</div>
|
||||
<select ng-model="selectedPaymentMethodId.value"
|
||||
ng-options="item.id as item.name for item in paymentMethods"
|
||||
ng-change="sellRequest()">
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<div class="item item-divider">
|
||||
At what percentage lower price would you accept to sell?
|
||||
</div>
|
||||
<label class="item item-input item-select" ng-if="priceSensitivity">
|
||||
<div class="input-label">Price Sensitivity</div>
|
||||
<select
|
||||
ng-model="selectedPriceSensitivity.data"
|
||||
ng-options="item as item.name for item in priceSensitivity track by item.value">
|
||||
</select>
|
||||
</label>
|
||||
<div class="item size-12" ng-if="selectedPriceSensitivity">
|
||||
<div class="m10b">
|
||||
Coinbase has not yet implemented an immediate method to sell bitcoin from a wallet. To make this sale, funds
|
||||
will be sent to your Coinbase account, and sold when Coinbase accepts the transaction (usually one
|
||||
hour).
|
||||
</p>
|
||||
<label>At what percentage lower price would you accept to sell?</label>
|
||||
<select
|
||||
ng-model="selectedPriceSensitivity"
|
||||
ng-options="item as item.name for item in priceSensitivity track by item.value">
|
||||
</select>
|
||||
<p class="size-12 text-gray">
|
||||
Estimated sale value: {{sell.sellPrice.amount * amount | currency : 'USD ' : 2}} <br>
|
||||
Still sell if price fall until:
|
||||
{{(sell.sellPrice.amount - (selectedPriceSensitivity.value / 100) * sell.sellPrice.amount) * amount | currency : 'USD ' : 2}}
|
||||
</p>
|
||||
|
||||
<div class="input m20t row">
|
||||
<div class="columns large-6 medium-6 small-6">
|
||||
<a href class="button outline dark-gray expand round" ng-click="showPriceSensitivity = false">Back</a>
|
||||
</div>
|
||||
<div class="columns large-6 medium-6 small-6">
|
||||
<input class="button black expand round"
|
||||
ng-disabled="(!amount && !fiat) || !sell.sellPrice.amount"
|
||||
ng-style="{'background-color': '#2b71b1'}"
|
||||
type="submit" value="Confirm">
|
||||
</div>
|
||||
</div>
|
||||
<div class="label" ng-if="sellRequestInfo">Estimated sale value:
|
||||
<strong>
|
||||
{{sellRequestInfo.total.amount | currency : '' : 2}}
|
||||
{{sellRequestInfo.total.currency}}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="label" ng-if="sellRequestInfo">Still sell if price fall until:
|
||||
<strong>
|
||||
{{(sellRequestInfo.total.amount -
|
||||
(selectedPriceSensitivity.data.value / 100) * sellRequestInfo.total.amount) | currency : '' : 2}}
|
||||
{{sellRequestInfo.total.currency}}
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="m20ti row" ng-show="sell.sendInfo && !sell.sellInfo && !sell.success">
|
||||
<div class="columns">
|
||||
<h1>Funds sent to Coinbase Account</h1>
|
||||
<p class="size-12 text-gray">
|
||||
The transaction is not yet confirmed, and will show as "Processing" in your Activity. The bitcoin sale will be completed automatically once it is confirmed by Coinbase.
|
||||
</p>
|
||||
<button class="m20t outline black round expand"
|
||||
ng-style="{'background-color': '#2b71b1'}"
|
||||
ng-click="$root.go('coinbase')">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="sell.sellInfo && !sell.sendInfo && !sell.success">
|
||||
<h4 class="title">Confirm transaction</h4>
|
||||
|
||||
<ul class="no-bullet m10t size-12 white">
|
||||
<li class="line-b line-t p15">
|
||||
<span class="m10 text-normal text-bold">Amount</span>
|
||||
<span class="right text-gray">{{sell.sellInfo.amount.amount}} {{sell.sellInfo.amount.currency}}</span>
|
||||
</li>
|
||||
<li class="line-b oh p15">
|
||||
<span class="m10 text-normal text-bold">Fees</span>
|
||||
<span class="right text-gray">
|
||||
<div ng-repeat="fee in sell.sellInfo.fees">
|
||||
<b>{{fee.type}}</b> {{fee.amount.amount}} {{fee.amount.currency}}
|
||||
</div>
|
||||
</span>
|
||||
</li>
|
||||
<li class="line-b p15">
|
||||
<span class="m10 text-normal text-bold">Subtotal</span>
|
||||
<span class="right text-gray">{{sell.sellInfo.subtotal.amount}} {{sell.sellInfo.subtotal.currency}}</span>
|
||||
</li>
|
||||
<li class="line-b p15">
|
||||
<span class="m10 text-normal text-bold">Total</span>
|
||||
<span class="right text-gray">{{sell.sellInfo.total.amount}} {{sell.sellInfo.total.currency}}</span>
|
||||
</li>
|
||||
<li class="line-b p15">
|
||||
<span class="m10 text-normal text-bold">Payout at</span>
|
||||
<span class="right text-gray">{{sell.sellInfo.payout_at | amCalendar}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="row">
|
||||
<div class="columns">
|
||||
<button class="button black round expand"
|
||||
ng-style="{'background-color': '#2b71b1'}"
|
||||
ng-click="sell.confirmSell(index.coinbaseToken, index.coinbaseAccount, sell.sellInfo)"
|
||||
>
|
||||
Sell
|
||||
</button>
|
||||
<div class="item item-divider">
|
||||
Transaction details
|
||||
</div>
|
||||
<div class="item">
|
||||
Amount
|
||||
<span class="item-note">
|
||||
{{sellRequestInfo.subtotal.amount}} {{sellRequestInfo.subtotal.currency}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item" ng-repeat="fee in sellRequestInfo.fees">
|
||||
<span class="capitalized">
|
||||
{{fee.type}} fee
|
||||
</span>
|
||||
<span class="item-note">
|
||||
<span ng-if="fee.amount.amount != '0.00'">-</span>
|
||||
{{fee.amount.amount}} {{fee.amount.currency}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
Total to receive
|
||||
<span class="item-note total-amount">
|
||||
{{sellRequestInfo.total.amount}} {{sellRequestInfo.total.currency}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m20t row text-center" ng-show="sell.success">
|
||||
<div class="columns">
|
||||
<h1>Sale initiated</h1>
|
||||
<p class="text-gray">
|
||||
A transfer has been initiated to your bank account and should arrive at {{sell.success.payout_at | amCalendar}}.
|
||||
</p>
|
||||
|
||||
<button class="outline dark-gray round expand"
|
||||
ng-click="$root.go('coinbase')">OK</button>
|
||||
</ion-content>
|
||||
|
||||
<click-to-accept
|
||||
ng-disabled="!selectedPaymentMethodId.value || !sellRequestInfo || !wallet"
|
||||
ng-click="sellConfirm()"
|
||||
ng-if="!isCordova && sellRequestInfo"
|
||||
click-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="!selectedPaymentMethodId.value"
|
||||
no-matching-wallet="!sellRequestInfo">
|
||||
Confirm sale
|
||||
</click-to-accept>
|
||||
<slide-to-accept
|
||||
ng-disabled="!selectedPaymentMethodId.value || !sellRequestInfo || !wallet"
|
||||
ng-if="isCordova && sellRequestInfo"
|
||||
slide-on-confirm="sellConfirm()"
|
||||
slide-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="!selectedPaymentMethodId.value"
|
||||
no-matching-wallet="!sellRequestInfo">
|
||||
Slide to sell
|
||||
</slide-to-accept>
|
||||
<slide-to-accept-success
|
||||
slide-success-show="sendStatus === 'success'"
|
||||
slide-success-on-confirm="goBackHome()"
|
||||
slide-success-hide-on-confirm="true">
|
||||
<span>Funds sent to Coinbase Account</span>
|
||||
<div class="m10 size-14">
|
||||
The transaction is not yet confirmed, and will show as "Pending" in your Activity. The bitcoin sale will be completed automatically once it is confirmed by Coinbase.
|
||||
</div>
|
||||
</div>
|
||||
</slide-to-accept-success>
|
||||
|
||||
</div>
|
||||
<div class="extra-margin-bottom"></div>
|
||||
<wallet-selector
|
||||
wallet-selector-title="walletSelectorTitle"
|
||||
wallet-selector-wallets="wallets"
|
||||
wallet-selector-selected-wallet="wallet"
|
||||
wallet-selector-show="showWallets"
|
||||
wallet-selector-on-select="onWalletSelect">
|
||||
</wallet-selector>
|
||||
</ion-view>
|
||||
|
|
|
|||
|
|
@ -124,10 +124,10 @@
|
|||
<img src="img/glidera-logo.png" width="90"/>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
<!-- disable coinbase for this release -->
|
||||
<!-- <a ng-if="coinbaseEnabled" ui-sref="exchange.coinbase" class="item">
|
||||
<img src="img/coinbase-logo.png" width="90"> TODO
|
||||
</a> -->
|
||||
<a ng-if="coinbaseEnabled" ui-sref="tabs.buyandsell.coinbase" class="item item-extra-padding item-sub item-icon-right">
|
||||
<img src="img/coinbase-logo.png" width="90">
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -156,7 +156,7 @@
|
|||
<span translate>Add BitPay Visa® Card</span>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
<a ng-if="!externalServices.BuyAndSell && (coinbaseEnabled || glideraEnabled)" ui-sref="tabs.buyandsell.glidera" class="item item-sub item-icon-left item-big-icon-left item-icon-right next-step">
|
||||
<a ng-if="!externalServices.BuyAndSell && (coinbaseEnabled || glideraEnabled)" ui-sref="tabs.buyandsell" class="item item-sub item-icon-left item-big-icon-left item-icon-right next-step">
|
||||
<i class="icon big-icon-svg">
|
||||
<div class="bg icon-buy-bitcoin"></div>
|
||||
</i>
|
||||
|
|
|
|||
|
|
@ -133,6 +133,13 @@
|
|||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
|
||||
<a class="item item-icon-right"
|
||||
ng-if="coinbaseEnabled && coinbaseToken"
|
||||
ui-sref="tabs.preferences.coinbase">
|
||||
<img src="img/coinbase-logo.png" width="90"/>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
|
||||
<div class="item item-divider"></div>
|
||||
|
||||
<a class="item item-icon-right item-icon-left" href ui-sref="tabs.advanced">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue