Bug fixes and UI improvements
This commit is contained in:
parent
928d9d2ee3
commit
7625943c1e
@ -94,7 +94,7 @@
|
|||||||
<sm-form id="login_form">
|
<sm-form id="login_form">
|
||||||
<div class="grid gap-0-5">
|
<div class="grid gap-0-5">
|
||||||
<h2>Login</h2>
|
<h2>Login</h2>
|
||||||
<p>Enter your FLO private key to login</p>
|
<p>Enter your FLO/BTC private key to login</p>
|
||||||
</div>
|
</div>
|
||||||
<sm-input type="password" id="login_form__priv_key" placeholder="Private key"
|
<sm-input type="password" id="login_form__priv_key" placeholder="Private key"
|
||||||
error-text="Invalid private key" data-private-key autofocus animate required>
|
error-text="Invalid private key" data-private-key autofocus animate required>
|
||||||
@ -294,7 +294,7 @@
|
|||||||
</sm-chips>
|
</sm-chips>
|
||||||
</div>
|
</div>
|
||||||
<div id="orders_section__header--secondary" class="flex w-100 align-center space-between hidden">
|
<div id="orders_section__header--secondary" class="flex w-100 align-center space-between hidden">
|
||||||
<button class="" onclick="clearSelection()" title="Clear all selection">
|
<button class="button" onclick="clearSelection()" title="Clear all selection">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon margin-right-0-5" height="24px"
|
<svg xmlns="http://www.w3.org/2000/svg" class="icon margin-right-0-5" height="24px"
|
||||||
viewBox="0 0 24 24" width="24px">
|
viewBox="0 0 24 24" width="24px">
|
||||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||||
@ -304,8 +304,8 @@
|
|||||||
<span id="selected_orders"></span>
|
<span id="selected_orders"></span>
|
||||||
</button>
|
</button>
|
||||||
<div class="options">
|
<div class="options">
|
||||||
<button class="button" title="Cancel selected orders" onclick="cancelAll()">
|
<button class="button" title="Cancel all selected orders" onclick="cancelAll()">
|
||||||
Cancel all
|
Cancel selected
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -505,7 +505,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="portfolio_asset_page" class="hidden grid gap-1-5">
|
<div id="portfolio_asset_page" class="hidden grid gap-1-5">
|
||||||
<div class="flex align-center sticky top-0">
|
<div class="flex align-center sticky top-0 gap-0-5">
|
||||||
<a href="#/portfolio" class="button icon-only">
|
<a href="#/portfolio" class="button icon-only">
|
||||||
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24"
|
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24"
|
||||||
width="24px" fill="#000000">
|
width="24px" fill="#000000">
|
||||||
@ -538,7 +538,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="history" class="mobile-page hidden">
|
<div id="history" class="mobile-page hidden">
|
||||||
<div class="flex align-center sticky top-0">
|
<div class="flex align-center sticky top-0 gap-0-5">
|
||||||
<a href="#/portfolio" class="button icon-only">
|
<a href="#/portfolio" class="button icon-only">
|
||||||
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24"
|
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24"
|
||||||
width="24px" fill="#000000">
|
width="24px" fill="#000000">
|
||||||
@ -1744,13 +1744,14 @@
|
|||||||
return card
|
return card
|
||||||
},
|
},
|
||||||
marketOrderCard(orderDetails = {}) {
|
marketOrderCard(orderDetails = {}) {
|
||||||
const { floID, asset, quantity, price, time_placed, type } = orderDetails
|
const { floID, asset, quantity, maxPrice, time_placed, type } = orderDetails
|
||||||
|
console.log(orderDetails)
|
||||||
const card = getRef('market_order_template').content.cloneNode(true).firstElementChild
|
const card = getRef('market_order_template').content.cloneNode(true).firstElementChild
|
||||||
card.dataset.type = type
|
card.dataset.type = type
|
||||||
card.classList.add(`transaction-card--${type}`)
|
card.classList.add(`transaction-card--${type}`)
|
||||||
card.querySelector('.transaction-card__quantity').textContent = `${quantity} ${asset}`
|
card.querySelector('.transaction-card__quantity').textContent = `${quantity} ${asset}`
|
||||||
card.querySelector('.transaction-card__price').textContent = formatAmount(price)
|
card.querySelector('.transaction-card__price').textContent = formatAmount(maxPrice)
|
||||||
card.querySelector('.transaction-card__total').textContent = formatAmount(parseFloat(price * quantity))
|
card.querySelector('.transaction-card__total').textContent = formatAmount(parseFloat(maxPrice * quantity))
|
||||||
card.querySelector('.more-info').dataset.time = time_placed
|
card.querySelector('.more-info').dataset.time = time_placed
|
||||||
card.querySelector('.more-info').dataset.buyer = type === 'buy' ? floID : undefined
|
card.querySelector('.more-info').dataset.buyer = type === 'buy' ? floID : undefined
|
||||||
card.querySelector('.more-info').dataset.seller = type === 'sell' ? floID : undefined
|
card.querySelector('.more-info').dataset.seller = type === 'sell' ? floID : undefined
|
||||||
@ -2222,20 +2223,22 @@
|
|||||||
const quantity = parseFloat(getRef('get_user_amount').value)
|
const quantity = parseFloat(getRef('get_user_amount').value)
|
||||||
try {
|
try {
|
||||||
buttonLoader('portfolio_popup__cta', true)
|
buttonLoader('portfolio_popup__cta', true)
|
||||||
const proxySecret = await proxy.secret;
|
const [proxySecret, sinkID] = await Promise.all([proxy.secret, floTradeAPI.getSink()])
|
||||||
let response
|
let response
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'deposit':
|
case 'deposit':
|
||||||
const privKey = getRef('get_private_key').value;
|
const privKey = getRef('get_private_key').value;
|
||||||
switch (asset) {
|
switch (asset) {
|
||||||
case 'FLO':
|
case 'FLO':
|
||||||
response = await floTradeAPI.depositFLO(quantity, proxy.userID, await proxy.sinkID, privKey, proxySecret)
|
response = await floTradeAPI.depositFLO(quantity, proxy.userID, sinkID, privKey, proxySecret)
|
||||||
break;
|
break;
|
||||||
case 'BTC':
|
case 'BTC':
|
||||||
response = await floTradeAPI.depositBTC(quantity, proxy.userID, await proxy.sinkID, privKey, proxySecret)
|
if (quantity <= 0.00000546)
|
||||||
|
return notify('Quantity should be greater than 0.00000550', 'error')
|
||||||
|
response = await floTradeAPI.depositBTC(quantity, proxy.userID, sinkID, privKey, proxySecret)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
response = await floTradeAPI.depositToken(asset, quantity, proxy.userID, await proxy.sinkID, privKey, proxySecret)
|
response = await floTradeAPI.depositToken(asset, quantity, proxy.userID, sinkID, privKey, proxySecret)
|
||||||
}
|
}
|
||||||
console.log(response)
|
console.log(response)
|
||||||
showWalletResult('success', `Sent ${asset} deposit request`, 'This may take upto 30 mins to reflect in your portfolio.')
|
showWalletResult('success', `Sent ${asset} deposit request`, 'This may take upto 30 mins to reflect in your portfolio.')
|
||||||
@ -2496,7 +2499,7 @@
|
|||||||
case 'confirm_trade_popup':
|
case 'confirm_trade_popup':
|
||||||
const asset = pagesData.params.asset;
|
const asset = pagesData.params.asset;
|
||||||
const quantity = parseFloat(getRef('get_quantity').value)
|
const quantity = parseFloat(getRef('get_quantity').value)
|
||||||
const setPrice = formatAmount(parseFloat(getRef('get_price').value))
|
const setPrice = parseFloat(getRef('get_price').value)
|
||||||
getRef('confirm_trade__title').textContent = `${tradeType} ${asset}`
|
getRef('confirm_trade__title').textContent = `${tradeType} ${asset}`
|
||||||
getRef('confirm_trade__details').innerHTML = `
|
getRef('confirm_trade__details').innerHTML = `
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
@ -2505,7 +2508,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<p>At price</p>
|
<p>At price</p>
|
||||||
<b>${setPrice}</b>
|
<b>${formatAmount(setPrice)}</b>
|
||||||
|
</div>
|
||||||
|
<div class="grid">
|
||||||
|
<p>Total amount</p>
|
||||||
|
<b>${formatAmount(quantity * setPrice)}</b>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
break;
|
break;
|
||||||
@ -2617,8 +2624,8 @@
|
|||||||
if (acc.subAdmin)
|
if (acc.subAdmin)
|
||||||
console.info("logged in as subAdmin");
|
console.info("logged in as subAdmin");
|
||||||
|
|
||||||
// FLO balance init
|
// BTC balance init
|
||||||
allTokens[floGlobals.currency] = {
|
allTokens[floGlobals.currency] = allTokens['FLO'] = {
|
||||||
total: 0,
|
total: 0,
|
||||||
locked: 0,
|
locked: 0,
|
||||||
net: 0
|
net: 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user