BUY/SELL bitcoin

This commit is contained in:
Gustavo Maximiliano Cortez 2015-09-01 18:53:47 -03:00
commit 1a0a7eb5ad
7 changed files with 299 additions and 47 deletions

View file

@ -11,18 +11,41 @@
<h1>Buy Bitcoin</h1>
<form name="form" ng-submit="buy.getSellPrice(index.glideraToken, {'qty': qty})" novalidate>
<label>Price
<input type="number" ng-model="qty">
<input type="number" ng-model="fiat">
</label>
<input type="submit" value="Buy">
<form name="form" ng-submit="buy.getBuyPrice(index.glideraToken, {'qty': qty, 'fiat': fiat})" novalidate>
<label>Amount BTC</label>
<input type="number" ng-model="qty">
<label>Amount USD</label>
<input type="number" ng-model="fiat">
<input class="button" type="submit" value="Get Buy Price">
</form>
<div ng-show="buyPrice">
{{buyPrice}} --
<h2>Buy Price</h2>
<ul>
<li>qty: {{buy.buyPrice.qty}}
<li>price: {{buy.buyPrice.price}}
<li>subtotal: {{buy.buyPrice.subtotal}}
<li>fees: {{buy.buyPrice.fees}}
<li>total: {{buy.buyPrice.total}}
<li>currency: {{buy.buyPrice.currency}}
<li>expires: {{buy.buyPrice.expires}}
<li>priceUuid: {{buy.buyPrice.priceUuid}}
</ul>
<div class="m10b">
destinationAddress: {{buy.addr[index.walletId]}}<br>
</div>
<h2>Send 2FA Code</h2>
<button ng-click="buy.get2faCode(index.glideraToken)">Send 2FA Code</button>
<h2>Buy</h2>
<form name="form2" ng-submit="buy.send(index.glideraToken, twoFaCode)" novalidate>
<label>2FA Code
<input type="number" ng-model="twoFaCode">
</label>
<input class="button" type="submit" value="Buy">
</form>
</div>
</div>
</div>

View file

@ -24,18 +24,18 @@
<h2>Transactions</h2>
<ul>
<li ng-repeat="tx in txs">
{{tx.transactionUuid}} --
{{tx.transactionDate}} --
{{tx.type}} --
{{tx.price}} --
{{tx.subtotal}} --
{{tx.fees}} --
{{tx.total}} --
{{tx.currency}} --
{{tx.estimatedDeliveryDate}} --
{{tx.transactionHash}} --
{{tx.status}}<br><br>
<li ng-repeat="tx in glidera.txs">
transactionUuid: {{tx.transactionUuid}} <br>
transactionDate: {{tx.transactionDate}} <br>
type: {{tx.type}} <br>
price: {{tx.price}} <br>
subtotal: {{tx.subtotal}} <br>
fees: {{tx.fees}} <br>
total: {{tx.total}} <br>
currency: {{tx.currency}} <br>
estimatedDeliveryDate: {{tx.estimatedDeliveryDate}} <br>
transactionHash: {{tx.transactionHash}} <br>
status: {{tx.status}}<br>
</li>
</ul>

View file

@ -5,24 +5,58 @@
</div>
<div class="content glidera" ng-controller="sellGlideraController as sell">
<div class="content glidera"
ng-controller="sellGlideraController as sell">
<div class="row">
<div class="large-12 columns">
<h1>Sell Bitcoin</h1>
<form name="form" ng-submit="sell.getSellPrice(index.glideraToken, {'qty': qty, 'fiat': fiat})" novalidate>
<label>Price
<input type="number" ng-model="qty">
<input type="number" ng-model="fiat">
</label>
<input type="submit" value="Sell">
<label>Amount BTC</label>
<input type="number" ng-model="qty">
<label>Amount USD</label>
<input type="number" ng-model="fiat">
<input class="button" type="submit" value="Get Sell Price">
</form>
<div ng-show="sellPrice">
{{sellPrice}} --
<h2>Sell Price</h2>
<ul>
<li>qty: {{sell.sellPrice.qty}}
<li>price: {{sell.sellPrice.price}}
<li>subtotal: {{sell.sellPrice.subtotal}}
<li>fees: {{sell.sellPrice.fees}}
<li>total: {{sell.sellPrice.total}}
<li>currency: {{sell.sellPrice.currency}}
<li>expires: {{sell.sellPrice.expires}}
<li>priceUuid: {{sell.sellPrice.priceUuid}}
</ul>
<h2>Create Tx</h2>
<div class="m10b">
refundAddress: {{sell.addr[index.walletId]}}<br>
sellAddress: {{sell.sellAddress}}
</div>
<button
ng-click="raw = sell.createTx()">
Create
</button>
<div class="m10b" ng-show="sell.raw">{{sell.raw}}</div>
<h2>Send 2FA Code</h2>
<button ng-click="sell.get2faCode(index.glideraToken)">Send 2FA Code</button>
<h2>Send TX to Glider</h2>
<form name="form2" ng-submit="sell.sendTx(index.glideraToken, twoFaCode)" novalidate>
<label>2FA Code
<input type="number" ng-model="twoFaCode">
</label>
<input class="button" type="submit" value="Sell">
</form>
</div>
</div>