Wallet/www/views/sellCoinbase.html
Gustavo Maximiliano Cortez 021e9301d3
Refactor selling bitcoin
2017-01-16 20:09:00 -03:00

137 lines
4.8 KiB
HTML

<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">
<div class="item item-divider">
Sale Info
</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({quote: true})">
</select>
</label>
<div ng-if="sellRequestInfo">
<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).
</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>
<div class="item item-divider">
Sell from
</div>
<div class="item" ng-click="showWalletSelector()">
<span>Wallet</span>
<span class="item-note">{{wallet ? wallet.name : '...'}}</span>
</div>
<div class="item">
Amount
<span class="item-note">
{{sellRequestInfo.amount.amount}} {{sellRequestInfo.amount.currency}}
</span>
</div>
<div class="item item-divider">
Fees
</div>
<div class="item" ng-repeat="fee in sellRequestInfo.fees">
{{fee.type}}
<span class="item-note">
{{fee.amount.amount}} {{fee.amount.currency}}
</span>
</div>
<div class="item item-divider">
Total
</div>
<div class="item">
Subtotal
<span class="item-note">
{{sellRequestInfo.subtotal.amount}} {{sellRequestInfo.subtotal.currency}}
</span>
</div>
<div class="item">
Total
<span class="item-note">
{{sellRequestInfo.total.amount}} {{sellRequestInfo.total.currency}}
</span>
</div>
</div>
</div>
</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>
</slide-to-accept-success>
<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>