continuing from the dICOApp 0.6.4-beta2 codebase

This commit is contained in:
satindergrewal 2017-11-17 10:24:39 +13:00
parent 08a4e4cffc
commit 571afc5b88
45 changed files with 5820 additions and 1212 deletions

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 SuperNET
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,4 +1,4 @@
# barterDEX SimpleGUI
# BarterDEX-Simple App
Before starting make sure you have `marketmaker` daemon compiled and running on your machine.
@ -9,20 +9,20 @@ https://github.com/SuperNETorg/komodo/wiki/Setting-up-Liquidity-Provider-(LP)-No
### Setup
Once running, follow these steps:
```shell
git clone https://github.com/SuperNETorg/dexuglygui.git
cd dexuglygui
git checkout v0.4
git clone https://github.com/SuperNETorg/BarterDEX-Simple.git
cd BarterDEX-Simple
git checkout v0.6
npm install
npm start
```
It will download "dexuglygui". Open "dexuglygui", and from there open "index.html" file in your web browser.
It will download "BarterDEX-Simple". Open "BarterDEX-Simple", and from there open "index.html" file in your web browser.
### Update
To update, follow these steps:
```shell
cd dexuglygui
git checkout v0.4
cd BarterDEX-Simple
git checkout v0.6
git pull
```
@ -38,17 +38,30 @@ sudo npm install electron-prebuilt -g
Refer to the original [electron-packager](https://github.com/electron-userland/electron-packager) repository for more detailed information.
##### Linux
Change directory to dexuglygui and execute the following command to build the Linux app
Change directory to BarterDEX-Simple and execute the following command to build the Linux app
```shell
cd dexuglygui
electron-packager . --platform=linux --arch=x64 --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/win64 --ignore=assets/bin/osx --overwrite
cd BarterDEX-Simple
electron-packager . --platform=linux --arch=x64 --icon=assets/icons/monaize/128x128.png --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/win64 --ignore=assets/bin/osx --overwrite
```
change architecture build parameter to ```--arch=x32``` for 32 bit build
##### OSX
Change directory to dexuglygui and execute the following command to build the OSX app
Change directory to BarterDEX-Simple and execute the following command to build the OSX app
```shell
cd dexuglygui
electron-packager . --platform=darwin --arch=x64 --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/win64 --ignore=assets/bin/linux64 --overwrite
cd BarterDEX-Simple
electron-packager . --platform=darwin --arch=x64 --icon=assets/icons/monaize/mnz.icns --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/win64 --ignore=assets/bin/linux64 --overwrite
```
##### Windows
Change directory to iguana and execute the following command to build the Windows app
```shell
dir iguana
electron-packager . --platform=win32 --arch=x64 --icon=assets/icons/monaize/mnz.ico --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/osx --ignore=assets/bin/linux64 --overwrite
# If generating 32bit desktop package
electron-packager . --platform=win32 --arch=ia32 --icon=assets/icons/monaize/mnz.ico --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/osx --ignore=assets/bin/linux64 --overwrite
# To build both x64 and x86 desktop package
electron-packager . --platform=win32 --arch=all --icon=assets/icons/monaize/mnz.ico --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/osx --ignore=assets/bin/linux64 --overwrite
```
change architecture build parameter to ```--arch=x64``` for 64 bit build

Binary file not shown.

Binary file not shown.

Binary file not shown.

1
assets/coins.json Normal file
View File

@ -0,0 +1 @@
[{"coin":"MNZ","asset":"MNZ","active":1,"rpcport":14337},{"coin":"REVS","asset":"REVS","active":1,"rpcport":10196}]

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

View File

@ -19,7 +19,7 @@
/* Sign-in Form CSS */
.form-signin {
max-width: 630px;
max-width: 730px;
padding: 15px;
margin: 0 auto;
}
@ -83,7 +83,7 @@ textarea {
text-align: center;
background-color: #eee;
}
.navbar>.container .navbar-brand-centered,
.navbar>.container .navbar-brand-centered,
.navbar>.container-fluid .navbar-brand-centered {
margin-left: -80px;
}
@ -102,4 +102,220 @@ textarea {
#exchange_coin_asks, #exchange_coin_bids, .exchange_trade_status_body {
overflow: scroll;
height: 285px;
}
.orderbook_asks {
cursor: pointer;
}
.orderbook_asks tr:hover td {
background: #eae7e7;
}
.progress-nomargin {
margin-bottom: 0px !important;
}
.loader {
position: relative;
margin: 0px auto;
width: 100px;
height: 100px;
zoom: 1.7;
}
.circle {
animation: rotate 2s linear infinite;
height: 100px;
position: relative;
width: 100px;
}
.path {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
animation: dash 1.5s ease-in-out infinite;
stroke: #FFB8A2;
stroke-linecap: round;
}
.path2 {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
animation: dash2 1.5s ease-in-out infinite;
stroke: #FF9372;
stroke-linecap: round;
}
.path3 {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
animation: dash3 1.5s ease-in-out infinite;
stroke: #FF7C53;
stroke-linecap: round;
}
.path4 {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
animation: dash4 1.5s ease-in-out infinite;
stroke: #FE450D;
stroke-linecap: round;
}
@keyframes rotate {
100% {
transform: rotate(360deg);
}
}
@keyframes dash {
0% {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 89,200;
stroke-dashoffset: -35;
}
100% {
stroke-dasharray: 89,200;
stroke-dashoffset: -124;
}
}
@keyframes dash2 {
0% {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 89,200;
stroke-dashoffset: -50;
}
100% {
stroke-dasharray: 89,200;
stroke-dashoffset: -124;
}
}
@keyframes dash3 {
0% {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 89,200;
stroke-dashoffset: -75;
}
100% {
stroke-dasharray: 89,200;
stroke-dashoffset: -124;
}
}
@keyframes dash4 {
0% {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 89,200;
stroke-dashoffset: -100;
}
100% {
stroke-dasharray: 89,200;
stroke-dashoffset: -124;
}
}
@keyframes color {
100%, 0% {
stroke: #FF8D6A;
}
40% {
stroke: #FE450D;
}
66% {
stroke: #FF683A;
}
80%, 90% {
stroke: #FF7D56;
}
}
.balance-block {
display: none;
}
.fixed_headers {
display: inline-block;
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
.fixed_headers th,
.fixed_headers td {
padding: 5px;
text-align: left;
flex-basis: 100%;
width: 100px;
}
.fixed_headers thead {
width: 100%;
display: block;
overflow-y: scroll;
}
.fixed_headers thead tr,
.fixed_headers tbody tr {
display: flex;
flex-direction: row;
}
.fixed_headers tbody {
display: block;
overflow-y: scroll;
width: 100%;
height: 247px;
}
#exchange_coin_asks,
.exchange_trade_status_body {
overflow: hidden;
}
table tbody tr:first-child td {
border: none;
}
#orderbook-asks-spinner,
#exchange-swap-status-spinner {
position: absolute;
z-index: 100;
top: 70px;
left: 0;
}
/* debug */
.mainbody {
overflow: hidden;
}
.dexdebug {
position: fixed;
top: 60px;
left: 0;
width: 100%;
height: 100%;
background: #fff;
z-index: 1000;
padding: 20px;
overflow-y: scroll;
height: calc(100% - 60px);
}
#debug-payload {
width: 100%;
padding: 10px;
margin-top: 10px;
margin-bottom: 15px;
height: 200px;
}
#debug-payload-response {
padding: 10px;
width: 100%;
border: solid 1px #ccc;
min-height: 200px;
}

BIN
gui/img/electrumlogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>BarterDEX - Simple GUI - v0.5.0-beta</title>
<title>BarterDEX-Simple - v0.6.4-beta2</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" type="text/css" rel="stylesheet">
@ -18,6 +18,7 @@
<link href="css/bootstrap-slider.min.css" rel="stylesheet">
<link href="css/custom.css" type="text/css" rel="stylesheet">
<link href="css/spinner.css" type="text/css" rel="stylesheet">
<link href="js/fa/css/font-awesome.min.css" type="text/css" rel="stylesheet">
<style type="text/css">
.table-fixed thead {
@ -63,11 +64,19 @@
<div class="loginbody">
<div class="container">
<form class="form-signin">
<h2 class="form-signin-heading" style="text-align: center;">Welcome to BarterDEX</h2>
<h3 class="form-signin-heading" style="text-align: center;">Welcome to BarterDEX</h3>
<h4 style="text-align: center;">Please Login</h4>
<label for="loginPassphrase" class="sr-only">Passphrase</label>
<!--<div class="input-group col-sm-12">
<input type="password" id="loginPassphrase" class="form-control loginPassphrase" placeholder="Passphrase" required>
<span class="input-group-btn">
<button class="btn btn-grey btn_login_show_passphrase" style="height: 44px; margin-bottom: 10px;"><span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span></button>
</span>
</div>-->
<input type="password" id="loginPassphrase" class="form-control loginPassphrase" placeholder="Passphrase" required>
<button class="btn btn-lg btn-primary btn-block login-btn" type="submit">Login</button>
<button class="btn btn-lg btn-default btn-block login-genpass-btn">Generate a New Passphrase</button>
</form>
</div>
</div>
@ -83,7 +92,7 @@
</div>
<!-- LOADING BODY END -->
<!-- MAIN BODY -->
<div class="mainbody" style="display: none;">
@ -112,14 +121,25 @@
<!--<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>-->
<a href="javascript:void(0)" class="btn btn-danger dexlogout-btn" style="margin: 8px 8px 0 0;">Logout</a>
<a href="javascript:void(0)" class="btn btn-danger dexdebug-close-btn" style="margin: 8px 8px 0 0; display: none">Close</a>
<a href="javascript:void(0)" class="btn btn-info dexdebug-btn" style="margin: 8px 8px 0 0;">Debug</a>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<!-- Section: Navigation Menu END -->
<div class="dexdebug" style="display: none">
<h4>Payload</h4>
<textarea cols="50" rows="5" id="debug-payload" placeholder="Provide payload"></textarea>
<button class="btn btn-primary" id="debug-exec">Execute</button>
<hr />
<h4>Response</h4>
<div id="debug-payload-response"></div>
</div>
<div class="screen-portfolio">
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
@ -265,7 +285,7 @@
</div>
<div class="panel-footer" style="display: none;">
</div>
</div>
</div>
@ -274,9 +294,9 @@
<div class="screen-inventory" style="display: none;">
<div class="col-sm-12">
<p>This screen shows you option to manage your coin's inventory. What is coin inventory?</p>
<p>Evey crypto currency wallet is very much like your regular phisical wallet. Just like in your physical wallet if you have different currency notes and coins available, that means they are not spent. You can spend them. If you use the same analogy in crypto currency, these unspent notes and coins can be referred as <b><i>unspent transactions.</i></b> In tiny bit technical term it's called <b>U</b>nspent <b>T</b>ransaction <b>O</b>utput, in short <b>UTXO</b></p>
<p>The decentralised Exchange doesn't run on total balance of your crypto currency wallet. It needs small unspent transctions. So, if you have sent a big transction to your BarterDEX smart address, you can use this screen to split your balance to number of small UTXOs.</p>
<p>By clicking <i>Make Inventory</i> button it will split your smart address balance to number of UTXOs and send them back to your smart address. It will cost regular transaction fee to split your smart address balance.</p>
<p>Every crypto currency wallet is very much like your regular physical wallet. Just like in your physical wallet if you have different currency notes and coins available, that means they are not spent. You can spend them. If you use the same analogy in crypto currency, these unspent notes and coins can be referred as <b><i>unspent transactions.</i></b> In tiny bit technical term it's called <b>U</b>nspent <b>T</b>ransaction <b>O</b>utput, in short <b>UTXO</b>.</p>
<p>The decentralised Exchange doesn't run on total balance of your crypto currency wallet. It needs small unspent transactions. So, if you have sent a big transaction to your BarterDEX smart address, you can use this screen to split your balance to number of small UTXOs.</p>
<p>By clicking <i>Make Inventory</i> button, it will split your smart address balance to number of UTXOs and send them back to your smart address. It will cost regular transaction fee to split your smart address balance.</p>
</div>
<div class="col-sm-12">
@ -299,7 +319,7 @@
<input id="inventory-slider1" type="text" class="col-sm-8 form-control" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="4"/>
</div>
<div class="col-sm-2">
<span id="inventory-slider1CurrentValLabel">No. of UTOXs: <span id="inventory-slider1Val" style="font-weight: bold;">4</span></span>
<span id="inventory-slider1CurrentValLabel">No. of deposit: <span id="inventory-slider1Val" style="font-weight: bold;">4</span></span>
</div>
<div class="col-sm-2">
<span id="inventory-slider1CurrentTotalLabel">Total: <span id="inventory-slider1Total" style="font-weight: bold;"></span></span>
@ -317,7 +337,7 @@
<input id="inventory-slider2" type="text" class="col-sm-8 form-control" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="8"/>
</div>
<div class="col-sm-2">
<span id="inventory-slider2CurrentValLabel">No. of UTOXs: <span id="inventory-slider2Val" style="font-weight: bold;">8</span></span>
<span id="inventory-slider2CurrentValLabel">No. of deposit: <span id="inventory-slider2Val" style="font-weight: bold;">8</span></span>
</div>
<div class="col-sm-2">
<span id="inventory-slider2CurrentTotalLabel">Total: <span id="inventory-slider2Total" style="font-weight: bold;"></span></span>
@ -335,7 +355,7 @@
<input id="inventory-slider3" type="text" class="col-sm-8 form-control" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="4"/>
</div>
<div class="col-sm-2">
<span id="inventory-slider3CurrentValLabel">No. of UTOXs: <span id="inventory-slider3Val" style="font-weight: bold;">4</span></span>
<span id="inventory-slider3CurrentValLabel">No. of deposit: <span id="inventory-slider3Val" style="font-weight: bold;">4</span></span>
</div>
<div class="col-sm-2">
<span id="inventory-slider3CurrentTotalLabel">Total: <span id="inventory-slider3Total" style="font-weight: bold;"></span></span>
@ -355,7 +375,7 @@
</div>
<div class="panel-footer" style="display: none;">
</div>
</div>
@ -406,7 +426,7 @@
<div class="col-sm-12">
<div class="panel with-nav-tabs panel-default">
<div class="panel-heading">
<button class="btn btn-xs btn-exchangeclose coinexchange" data-coin="COIN" style="float: right; margin: 6px 6px 0px 3px;">BACK</button>
<button class="btn btn-xs btn-exchangeclose coinexchange" data-coin="COIN" style="float: right; margin: 6px 6px 0px 3px; display: none;">BACK</button>
<button class="btn btn-xs btn-exchangerefresh coinexchange" data-coin="COIN" style="float: right; margin: 6px 6px 0px 3px;"><span class="glyphicon glyphicon-refresh"></span></button>
<ul class="nav nav-tabs">
<li class="active"><a href="#exchange_coin_asks" data-toggle="tab">ASKS: <span class="orderbook_numasks"></span></a></li>
@ -416,25 +436,34 @@
<div class=""> <!-- panel-body -->
<div class="tab-content">
<div class="tab-pane fade in active" id="exchange_coin_asks">
<table class="table table-striped orderbook_asks" width="100%" style="margin-bottom: 0;">
<table class="table table-striped orderbook_asks fixed_headers" width="100%" style="margin-bottom: 0;">
<thead><th>Price in <span class="orderbook_rel_coin"></span></th>
<th>Min <span class="orderbook_base_coin"></span></th>
<th>Max <span class="orderbook_base_coin"></span></th>
<!--<th>Size(Min-Max <span class="orderbook_base_coin"></span>)</th>
<th>Size(Min-Max <span class="orderbook_rel_coin"></span>)</th>
<th>Sum(<span class="orderbook_rel_coin"></span>)</th>-->
<th>Trader Pubkey</th>
<th>Age</th>
<th>UTXOs</th></thead>
<!--<th>UTXOs</th>-->
</thead>
<tbody></tbody>
</table>
<svg id="orderbook-asks-spinner">
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10"/>
<circle class="path2" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10"/>
<circle class="path3" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10"/>
<circle class="path4" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10"/>
</svg>
</div>
<div class="tab-pane fade" id="exchange_coin_bids">
<table class="table table-striped orderbook_bids" width="100%" style="margin-bottom: 0;">
<thead><th>Price in <span class="orderbook_rel_coin"></span></th>
<th>Min <span class="orderbook_base_coin"></span></th>
<th>Max <span class="orderbook_base_coin"></span></th>
<!--<th>Min <span class="orderbook_rel_coin"></span></th>
<th>Max <span class="orderbook_rel_coin"></span></th>-->
<th>Trader Pubkey</th>
<th>Age</th>
<th>UTXOs</th></thead>
<!--<th>UTXOs</th></thead>-->
<tbody></tbody>
</table>
</div>
@ -443,7 +472,7 @@
</div>
</div>
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
@ -451,7 +480,7 @@
<button class="btn btn-xs btn-swapstatusrefresh coinexchange" data-coin="COIN" style="float: right; margin: -20px -8px 0px 0px"><span class="glyphicon glyphicon-refresh"></span></button>
</div>
<div class="exchange_trade_status_body"> <!-- panel-body -->
<table class="table table-striped exchange_swap_status_tbl" width="100%" style="margin-bottom: 0;">
<table class="table table-striped exchange_swap_status_tbl fixed_headers" width="100%" style="margin-bottom: 0;">
<thead>
<th>Status</th>
<th>Quote ID</th>
@ -459,9 +488,14 @@
<th>Action</th>
</thead>
<tbody>
<th><div style="text-align: center;">Loading...</div></th>
</tbody>
</table>
<svg id="exchange-swap-status-spinner">
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10"/>
<circle class="path2" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10"/>
<circle class="path3" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10"/>
<circle class="path4" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10"/>
</svg>
</div>
</div>
</div>
@ -470,108 +504,151 @@
</div>
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><strong>Trading Pair</strong></h3>
<button class="btn btn-xs btn-refreshtrading_pair coinexchange" data-coin="COIN" style="float: right; margin: -20px -8px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></button>
</div>
<div class="panel-body"> <!-- panel-body -->
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<div class="btn-group btn-group-justified colors" data-toggle="buttons">
<label class="btn btn-lg btn-info active">
<input type="radio" name="trading_pair_options" id="trading_pair_options" value="buying" autocomplete="off" checked> BUYING <span class="coin_ticker"></span></label>
<label class="btn btn-lg btn-info">
<input type="radio" name="trading_pair_options" id="trading_pair_options" value="selling" autocomplete="off"> SELLING <span class="coin_ticker"></span></label>
</div>
</div>
<div class="form-group">
<span style="float: right; font-size: 18px;"><span class="trading_pair_lable_text_one">Max</span> Price to <span class="trading_pair_lable_text_two">Buy</span></span>
</div>
<div class="input-group col-sm-12">
<select class="selectpicker trading_pair_coin" data-live-search="true" data-hide-disabled="true" data-width="30%"></select>
<input type="number" class="form-control trading_pair_coin_price" placeholder="Price e.g. 0.01" style="height: 64px; font-size: 20px;">
<span class="input-group-addon" id="trading_pair_coin_price_max_min" style="font-size: 20px;">Max</span>
</div>
<div class="form-group" style="margin-top: 15px; margin-bottom: 0px;">
<span style="font-size: 18px;"><span>Max</span> Amount to <span class="trading_pair_lable_text_two">Buy</span></span>
</div>
<div class="input-group col-sm-12">
<span class="input-group-addon coin_ticker" id="trading_pair_coin_ticker" style="font-size: 20px;"></span>
<input type="number" class="form-control trading_pair_coin_volume" placeholder="Amount e.g. 12.5" style="height: 64px; font-size: 20px;">
<span class="input-group-btn">
<button class="btn btn-primary btn-bot_action" data-action="buy" style="height: 64px; font-size: 20px;">BUY</button>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><strong>Your Balance</strong></h3>
<button class="btn btn-xs btn-trading_coin_balance_refresh coinexchange" data-coin="COIN" style="float: right; margin: -20px -8px"><span class="glyphicon glyphicon-refresh"></span></button>
</div>
<div class=""> <!-- panel-body -->
<div class="input-group col-sm-12">
<span class="input-group-addon trading_coin_ticker_name" style="font-size: 30px;"></span>
<span class="input-group-addon trading_coin_balance" style="font-size: 55px; font-weight: 100;"></span>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel with-nav-tabs panel-default">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<!--<button class="btn btn-xs btn-exchangeclose coinexchange" data-coin="COIN" style="float: right; margin: 6px 6px 0px 3px;">BACK</button>
<button class="btn btn-xs btn-exchangerefresh coinexchange" data-coin="COIN" style="float: right; margin: 6px 6px 0px 3px;"><span class="glyphicon glyphicon-refresh"></span></button>-->
<ul class="nav nav-tabs">
<li class="active"><a href="#exchange_myorders" data-toggle="tab">My Orders <button class="btn btn-xs btn-myordersrefresh coinexchange" data-coin="COIN"><span class="glyphicon glyphicon-refresh"></span></button></a></li>
<li><a href="#exchange_botlist" data-toggle="tab">Auto Traders List <button class="btn btn-xs btn-botlistrefresh coinexchange" data-coin="COIN"><span class="glyphicon glyphicon-refresh"></span></button></a></li>
</ul>
<h3 class="panel-title"><strong>Trading Pair</strong></h3>
<button class="btn btn-xs btn-refreshtrading_pair coinexchange" data-coin="COIN" style="float: right; margin: -20px -8px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></button>
</div>
<div class=""> <!-- panel-body -->
<div class="tab-content">
<div class="tab-pane fade in active" id="exchange_myorders">
<table class="table table-striped exchange_my_orders_tbl" style="margin-bottom: 0;">
<thead>
<th>Base</th>
<th>Rel</th>
<th>Bid</th>
<th>Ask</th>
</thead>
<tbody>
<th><div style="text-align: center;">Loading...</div></th>
</tbody>
</table>
<div class="panel-body"> <!-- panel-body -->
<div class="row">
<div class="col-sm-12">
<div class="form-group" style="display: none;">
<div class="btn-group btn-group-justified colors" data-toggle="buttons">
<label class="btn btn-lg btn-info active">
<input type="radio" name="trading_pair_options" id="trading_pair_options" value="buying" autocomplete="off" checked> BUYING <span class="coin_ticker"></span></label>
<label class="btn btn-lg btn-info">
<input type="radio" name="trading_pair_options" id="trading_pair_options" value="selling" autocomplete="off"> SELLING <span class="coin_ticker"></span></label>
</div>
<div class="tab-pane fade" id="exchange_botlist">
</div>
<div class="form-group" style="display: none;">
<div class="btn-group btn-group-justified colors" data-toggle="buttons">
<label class="btn btn-lg btn-warning active">
<input type="radio" name="trading_mode_options" id="trading_mode_options_tradebot" value="tradebot" autocomplete="off"> TRADE BOT</label>
<label class="btn btn-lg btn-warning">
<input type="radio" name="trading_mode_options" id="trading_mode_options_trademanual" value="trademanual" autocomplete="off"> MANUAL TRADING</label>
</div>
</div>
<div class="form-group">
<span style="float: left; font-size: 18px;"><span class="trading_pair_lable_text_one">Max</span> Price to <span class="trading_pair_lable_text_two">Buy</span></span>
</div>
<div class="input-group col-sm-12">
<select class="selectpicker trading_pair_coin" data-live-search="true" data-hide-disabled="true" data-width="30%"></select>
<input type="number" class="form-control trading_pair_coin_price" placeholder="Price e.g. 0.01" style="height: 64px; font-size: 20px;">
<span class="input-group-addon" id="trading_pair_coin_price_max_min" style="font-size: 20px;">Max</span>
</div>
<table class="table table-striped exchange_bot_list_tbl" width="100%" style="margin-bottom: 0;">
<thead>
<!--<th>Bot ID</th>-->
<th>Name</th>
<th>Bot Action</th>
<th>Price</th>
<th>Max Volume</th>
<th>Trades Done</th>
<th>Actions</th>
</thead>
<tbody></tbody>
</table>
<div class="form-group trading_selected_trader_label" style="margin-top: 15px; margin-bottom: 0px;">
<span style="font-size: 18px;">Trade with selected trader only (optional)</span>
</div>
<div class="input-group col-sm-12 trading_selected_trader">
<span class="input-group-addon">
<input class="big-checkbox trading_pair_destpubkey_yesno" type="checkbox"> Yes
</span>
<input type="text" class="form-control trading_pair_destpubkey" placeholder="eg. bab6ad2eebe1e666369cab504d4622b22c1f1ef718ef388e88020f30a1573e01" style="height: 64px; font-size: 20px;">
</div>
<div class="form-group" style="margin-top: 15px; margin-bottom: 0px;">
<span style="font-size: 18px;"><span>Max</span> Amount to <span class="trading_pair_lable_text_two">Buy</span></span>
</div>
<div class="input-group col-sm-12">
<span class="input-group-addon coin_ticker" id="trading_pair_coin_ticker" style="font-size: 20px;"></span>
<input type="number" class="form-control trading_pair_coin_volume" placeholder="Amount e.g. 12.5" style="height: 64px; font-size: 20px;">
<span class="input-group-btn">
<button class="btn btn-primary btn-bot_action" data-action="buy" style="height: 64px; font-size: 20px;">BUY</button>
</span>
</div>
<div class="input-group col-sm-12">
<span class="input-group-addon" style="font-size: 30px; font-weight: 200; border: 0; background-color: #fff;">It'll cost you</span>
<span class="input-group-addon" style="font-size: 40px; font-weight: 100; border: 0; background-color: #fff;"><span class="relvol_basevol">0</span> <span class="relvol_basevol_coin" style="font-size: 25px; background-color: #fff; font-weight: 100;"></span></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><strong>Your Balance</strong></h3>
<!--<button class="btn btn-xs btn-info btn-activatecoins portfolio" style="float: right; margin: -20px -8px;">ADD COINS <span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>-->
<button class="btn btn-xs btn-trading_coin_balance_refresh coinexchange" data-coin="COIN" style="float: right; margin: -20px -8px"><span class="glyphicon glyphicon-refresh"></span></button>
</div>
<div> <!-- panel-body -->
<svg id="balance-spinner">
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10"/>
<circle class="path2" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10"/>
<circle class="path3" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10"/>
<circle class="path4" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10"/>
</svg>
<div class="balance-block">
<div class="input-group col-sm-12 your_coins_balance_info">
<span class="input-group-addon trading_sellcoin_ticker_name" style="font-size: 20px; text-align: left; background-color: #fff; border-radius: 0px;"></span>
<span class="input-group-addon trading_sellcoin_balance" style="font-size: 220%; font-weight: 100; text-align: right; background-color: #fff; border-radius: 0px;"></span>
</div>
<div class="input-group col-sm-12 your_coins_balance_info">
<span class="input-group-addon trading_coin_ticker_name" style="font-size: 20px; text-align: left; background-color: #fff; border-radius: 0px;"></span>
<span class="input-group-addon trading_coin_balance" style="font-size: 220%; font-weight: 100; text-align: right; background-color: #fff; border-radius: 0px;"></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="panel with-nav-tabs panel-default">
<div class="panel-heading">
<!--<button class="btn btn-xs btn-exchangeclose coinexchange" data-coin="COIN" style="float: right; margin: 6px 6px 0px 3px;">BACK</button>
<button class="btn btn-xs btn-exchangerefresh coinexchange" data-coin="COIN" style="float: right; margin: 6px 6px 0px 3px;"><span class="glyphicon glyphicon-refresh"></span></button>-->
<ul class="nav nav-tabs">
<li class="active"><a href="#exchange_myorders" data-toggle="tab">My Orders <button class="btn btn-xs btn-myordersrefresh coinexchange" data-coin="COIN"><span class="glyphicon glyphicon-refresh"></span></button></a></li>
<li><a href="#exchange_botlist" data-toggle="tab">Auto Traders List <button class="btn btn-xs btn-botlistrefresh coinexchange" data-coin="COIN"><span class="glyphicon glyphicon-refresh"></span></button></a></li>
</ul>
</div>
<div class=""> <!-- panel-body -->
<div class="tab-content">
<div class="tab-pane fade in active" id="exchange_myorders">
<table class="table table-striped exchange_my_orders_tbl" style="margin-bottom: 0;">
<thead>
<th>Base</th>
<th>Rel</th>
<th>Bid</th>
<th>Ask</th>
</thead>
<tbody>
<th><div style="text-align: center;">Loading...</div></th>
</tbody>
</table>
</div>
<div class="tab-pane fade" id="exchange_botlist">
<table class="table exchange_bot_list_tbl" width="100%" style="margin-bottom: 0;">
<thead>
<!--<th>Bot ID</th>-->
<th>TradeBot Info</th>
<!--<th>Bot Action</th>-->
<!--<th>Price</th>
<th>Max Volume</th>-->
<th>Progress Info</th>
<th>Actions</th>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@ -580,518 +657,10 @@
</div>
<!-- MAIN BODY END-->
<!-- MAIN BODY OLD-->
<div class="mainbody-old" style="display: none;">
<!-- Section: Navigation Menu -->
<nav class="navbar navbar-default navbar-fixed-top navmenu_top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand">BarterDEX</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="dexnav-collapse">
<ul class="nav navbar-nav dexnav_top_l">
<li class="active"><a href="javascript:void(0)" class="dexnav_exchange">Exchange</a></li>
<li><a href="javascript:void(0)" class="dexnav_portfolio">Portfolio</a></li>
<li><a href="javascript:void(0)" class="dexnav_balances">Balances</a></li>
<li><a href="javascript:void(0)" class="dexnav_myprices">My Prices</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<a href="javascript:void(0)" class="btn btn-danger dexlogout-btn" style="margin: 8px 8px 0 0;">Logout</a>
<!--<li><span style="padding: 15px; position: relative; display: block;">BarterDEX - Ugly GUI</span></li>-->
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<!-- Section: Navigation Menu END -->
<h3 style="text-align: center; margin-top: 60px;">BarterDEX - Ugly GUI</h3>
<!-- Section: Exchange -->
<div class="container-fluid section section-exchange">
<div class="row"><h1 style="text-align: center; font-weight: 200">EXCHANGE</h1></div>
<div class="row">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-8">
<div class="panel panel-default">
<div class="panel-heading"><strong>Trading Pair</strong></div>
<div class="panel-body">
<div class="row">
<div class="col-sm-5">
<h3 style="margin-top: 0; text-align: center;">Deposit</h3>
<select class="selectpicker sell_coin" data-live-search="true" data-hide-disabled="true" data-width="100%">
</select>
</div>
<div class="col-sm-2" style="margin-top: 50px; text-align: center;">
<!--<a role="button" class="switch_buy_sell_pairs">-->
<span class="glyphicon glyphicon-transfer" style="font-size: 40px;"></span>
<!--</a>-->
</div>
<div class="col-sm-5">
<h3 style="margin-top: 0; text-align: center;">Receive</h3>
<select class="selectpicker buy_coin" data-live-search="true" data-hide-disabled="true" data-width="100%">
</select>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel panel-default">
<div class="panel-heading"><strong>Esitmate Swap Price Calculation</strong><button class="btn btn-default btn-sm refresh_estimate_price" style="float: right; font-size: 13px; padding: 0 5px;">Refresh</button></div>
<div class="">
<table class="table table-striped" style="margin-bottom: 0;">
<tr><td class="coin_swap_rate_info" style="font-size: 22px; text-align: center;"><div class="coin_swap_rate_info1"></div><div class="coin_swap_rate_info2"></div></td></tr>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">BUY <span class="autotrade_buy_coin"></span><!--<button class="btn btn-sm btn-default">Refresh Coins List</button>--><button class="btn btn-default btn-sm refresh_inv_table" style="float: right; font-size: 13px; padding: 0 5px;" data-coin="COIN" disabled>Refresh Inventory</button> <span style="float: right; font-size: 13px; padding: 0 5px;">Max Amount: <b><span class="autotrade_max_amount"></span> <span class="autotrade_max_amount_coin"></span></b></span></div>
<div class="panel-body">
<div class="form-group">
<label for="buy_amount">Amount</label>
<input type="text" class="form-control" id="buy_amount" placeholder="Amount">
</div>
<div class="form-group">
<label for="buy_price">Price</label>
<input type="text" class="form-control" id="buy_price" placeholder="Price">
</div>
<button class="btn btn-default buy_coin_btn">Submit</button>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">SELL <span class="lp_sell_coin"></span><!--<button class="btn btn-sm btn-default">Refresh Coins List</button>--></div>
<div class="panel-body">
<div class="form-group">
<label for="sell_amount">Amount</label>
<input type="text" class="form-control" id="sell_amount" placeholder="Amount">
</div>
<div class="form-group">
<label for="sell_price">Price</label>
<input type="text" class="form-control" id="sell_price" placeholder="Price">
</div>
<button class="btn btn-default sell_coin_btn">Submit</button>
</div>
<!--<div class="panel-body">
<div class="form-group">
<label for="lp_set_price">Set Price</label>
<input type="text" class="form-control" id="lp_set_price" placeholder="Set Price">
</div>
<button class="btn btn-default lp_set_price_btn">Submit</button>
</div>-->
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="row" style="padding-top: 10px;">
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading"><strong>Sell Orders</strong><span style="float: right;">Total Aks: <span class="orderbook_numasks"></span></span></div>
<div class="">
<table class="table table-fixed orderbook_asks" style="margin-bottom: 0;">
<thead><th class="col-xs-3">Price in <span class="orderbook_rel_coin"></span></th>
<th class="col-xs-3">Min <span class="orderbook_base_coin"></span></th>
<th class="col-xs-3">Max <span class="orderbook_base_coin"></span></th>
<th class="col-xs-3">Age</th></thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading"><strong>Buy Orders</strong><span style="float: right;">Total Bids: <span class="orderbook_numbids"></span></span></div>
<div class="">
<table class="table table-fixed orderbook_bids" style="margin-bottom: 0;">
<thead><th class="col-xs-3">Price in <span class="orderbook_rel_coin"></span></th>
<th class="col-xs-3">Min <span class="orderbook_base_coin"></span></th>
<th class="col-xs-3">Max <span class="orderbook_base_coin"></span></th>
<th class="col-xs-3">Age</th></thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>Show Swap Status</strong></div>
<div class="panel-body">
<div class="col-sm-6">
<p>This section will show you information when coin swap is activated and is in process. Use the refrehs swap list button to get updated information.<br>
You'll need to press this refresh button again to get latest updates.</p>
<button class="btn btn-default refresh_swap_list_btn">Refresh Swap List</button>
<form class="form-inline" style="padding-top: 12px;">
<div class="form-group">
<label for="swap_request_id">Request ID</label>
<input type="text" class="form-control" id="swap_request_id" placeholder="requestid">
</div>
<div class="form-group">
<label for="swap_quote_id">Quote ID</label>
<input type="email" class="form-control" id="swap_quote_id" placeholder="quoteid">
</div>
<button class="btn btn-default check_swap_status_btn">Check Swap Status</button>
</form>
</div>
<div class="col-md-6">
<pre class="checkswaplist-output"></pre>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-top: 12px;">
<div class="col-md-12">
<pre class="initcoinswap-output"></pre>
</div>
</div>
</div>
</div>
</div>
<!-- Section: Exchange END -->
<!-- Section: Portfolio -->
<div class="container-fluid section section-portfolio" style="display: none;">
<div class="row"><h1 style="text-align: center; font-weight: 200">YOUR PORTFOLIO</h1></div>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>Portfolio Charts</strong> <button class="btn btn-default btn-sm refresh_dex_potfolio_charts" style="float: right; font-size: 13px; padding: 0 5px;">Refresh</button></div>
<div class="panel-body">
<div class="col-sm-6" id="portfolio_chart_current" style="height: 300px;"></div>
<div class="col-sm-6" id="portfolio_chart_target" style="height: 300px;"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="panel panel-default">
<div class="panel-heading"><strong>Portfolio Status</strong> <button class="btn btn-default btn-sm refresh_dex_potfolio" style="float: right; font-size: 13px; padding: 0 5px;">Refresh</button></div>
<div class="">
<table class="table table-striped dex_portfolio_tbl" style="margin-bottom: 0;">
<thead>
<tr><th>Key</th><th>Value</th></tr>
</thead>
<tbody>
<tr><td>KMD Equivalent</td><td class="portfolio_kmd_equiv"></td></tr>
<tr><td>Buy Coin</td><td class="portfolio_buycoin"></td></tr>
<tr><td>Buy Force</td><td class="portfolio_buyforce"></td></tr>
<tr><td>Sell Coin</td><td class="portfolio_sellcoin"></td></tr>
<tr><td>Sell Force</td><td class="portfolio_sellforce"></td></tr>
<tr><td>Base</td><td class="portfolio_base"></td></tr>
<tr><td>Rel</td><td class="portfolio_rel"></td></tr>
<tr><td>Rel Volume</td><td class="portfolio_relvolume"></td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="panel panel-default">
<div class="panel-heading"><strong>Trading Pair</strong></div>
<div class="panel-body">
<div class="row">
<div class="col-sm-5">
<h3 style="margin-top: 0; text-align: center;">Deposit</h3>
<select class="selectpicker sell_coin_p" data-live-search="true" data-hide-disabled="true" data-width="100%">
</select>
</div>
<div class="col-sm-2" style="margin-top: 50px; text-align: center;">
<span class="glyphicon glyphicon-transfer" style="font-size: 40px;"></span>
</div>
<div class="col-sm-5">
<h3 style="margin-top: 0; text-align: center;">Receive</h3>
<select class="selectpicker buy_coin_p" data-live-search="true" data-hide-disabled="true" data-width="100%">
</select>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="panel with-nav-tabs panel-default">
<div class="panel-heading">
<ul class="nav nav-tabs">
<li class="active"><a href="#PortfolioSetPriceTab" data-toggle="tab">Set Price Manually</a></li>
<li><a href="#PortfolioAutoPriceTab" data-toggle="tab">Set Auto Price</a></li>
</ul>
</div>
<div class="panel-body">
<div class="tab-content">
<div class="tab-pane fade in active" id="PortfolioSetPriceTab">
<div class="form-group">
<label for="portfolio_set_price">Set Price</label>
<input type="text" class="form-control" id="portfolio_set_price" placeholder="Set Price">
</div>
<button class="btn btn-default portfolio_set_price_btn">Submit</button>
</div>
<div class="tab-pane fade" id="PortfolioAutoPriceTab">
<div class="form-group">
<label for="portfolio_set_autoprice">Margin</label>
<input type="text" class="form-control" id="portfolio_set_autoprice" placeholder="e.g 0.01">
</div>
<button class="btn btn-default portfolio_set_autoprice_btn">Submit</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel with-nav-tabs panel-default">
<div class="panel-heading">
<ul class="nav nav-tabs">
<li class="active"><a href="#PortfolioSetGoalsTab" data-toggle="tab">Set Goals Manually</a></li>
<li><a href="#PortfolioAutoGoalsTab" data-toggle="tab">Set Automatic Goals</a></li>
</ul>
</div>
<div class="panel-body">
<div class="tab-content">
<div class="tab-pane fade in active" id="PortfolioSetGoalsTab">
<div class="form-group">
<label for="portfolio_set_goal">Set Goal for <span class="set_goal_label_portfolio"></span></label>
<input type="text" class="form-control" id="portfolio_set_goal" placeholder="e.g. 48">
</div>
<button class="btn btn-default portfolio_set_goal_btn">Submit</button>
</div>
<div class="tab-pane fade" id="PortfolioAutoGoalsTab">
<div class="form-group">
<label>Push the button to set eqal goal for all active coins</label>
</div>
<button class="btn btn-default portfolio_set_autogoals_btn">Auto Goals</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>Portfolio Coins Info</strong> <button class="btn btn-default btn-sm refresh_dex_potfolio_coins" style="float: right; font-size: 13px; padding: 0 5px;">Refresh</button></div>
<div class="">
<table class="table table-striped dex_portfolio_coins_tbl" style="margin-bottom: 0;">
<thead>
<tr>
<th>Coin</th>
<th>Address</th>
<th>Amount</th>
<th>Price</th>
<th>KMD Equivalent</th>
<th>%</th>
<th>Goal</th>
<th>Goal %</th>
<th>Rel Volume</th>
<th>Force</th>
<th>balanceA</th>
<th>valuesumA</th>
<th>aliceutil</th>
<th>balanceB</th>
<th>valuesumB</th>
<th>balance</th>
<th>bobutil</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Section: Portfolio END -->
<!-- Section: Balances -->
<div class="container-fluid section section-balances" style="display: none;">
<div class="row"><h1 style="text-align: center; font-weight: 200">BALANCES, DEPOSITS &amp; WITHDRAWALS</h1></div>
<div class="row">
<div class="col-sm-12 coins_balance_panel">
<div class="panel panel-default">
<div class="panel-heading"><strong>DEX Coins Status</strong> <button class="btn btn-default btn-sm refresh_dex_balances" style="float: right; font-size: 13px; padding: 0 5px;">Refresh</button></div>
<div class="">
<table class="table table-striped dex_balances_tbl" style="margin-bottom: 0;">
<thead>
<tr><th>Coin</th><!--<th>Name</th><th>Total Balance</th>--><th>Deposit Address</th><th>Status</th><th>txfee</th><th>Electrum</th><th>Actions</th></tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-12 inventory_panel" style="display: none;">
<div class="panel with-nav-tabs panel-default">
<div class="panel-heading">
<button class="btn btn-default btn-sm backto_dex_balances" style="float: right; font-size: 13px; padding: 8px 8px;">Back</button>
<ul class="nav nav-tabs">
<li class="active"><a href="#AliceInventory" data-toggle="tab">Alice Inventory (<span data-inventorycoin="COIN"></span>)</a></li>
<li><a href="#BobInventory" data-toggle="tab">Bob Inventory (<span data-inventorycoin="COIN"></span>)</a></li>
<li><a href="#RawJSONInventory" data-toggle="tab">Raw JSON (<span data-inventorycoin="COIN"></span>)</a></li>
</ul>
</div>
<div class=""> <!-- panel-body -->
<div class="tab-content">
<div class="tab-pane fade in active" id="AliceInventory">
<table class="table table-striped dex_showinv_alice_tbl" style="margin-bottom: 0;">
<tbody>
</tbody>
</table>
</div>
<div class="tab-pane fade" id="BobInventory">
<table class="table table-striped dex_showinv_bob_tbl" style="margin-bottom: 0;">
<tbody>
</tbody>
</table>
</div>
<div class="tab-pane fade" id="RawJSONInventory">
<pre class="RawJSONInventory-output" style="margin: 0px;"></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Section: Balances END -->
<!-- Section: My Prices -->
<div class="container-fluid section section-myprices" style="display: none;">
<div class="row"><h1 style="text-align: center; font-weight: 200">MY PRICES</h1></div>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>My DEX Coins Prices</strong> <button class="btn btn-default btn-sm refresh_dex_myprices" style="float: right; font-size: 13px; padding: 0 5px;">Refresh</button></div>
<div class="">
<table class="table table-striped dex_myprices_tbl" style="margin-bottom: 0;">
<thead>
<tr><th>Base</th><th>Rel</th><th>Bid</th><th>Ask</th></tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Section: My Prices END -->
</div>
<!-- MAIN BODY END -->
<script>
var ipc = require('electron').ipcRenderer;
if (typeof module === 'object') {
@ -1114,6 +683,13 @@
<script src="js/clipboard.min.js" type="text/javascript"></script>
<script src="js/bootstrap-slider.min.js" type="text/javascript"></script>
<script src="js/number-polyfill.min.js" type="text/javascript"></script>
<script src="js/underscore-min.js" type="text/javascript"></script>
<script src="js/moment.min.js" type="text/javascript"></script>
<script src="js/countdown.min.js" type="text/javascript"></script>
<!-- Crypto Dependencies -->
<script src="js/wordlist.js" type="text/javascript"></script>
<script src="js/passphrasegenerator.js" type="text/javascript"></script>
<script src="js/seedrandom.js" type="text/javascript"></script>
<!-- amcharts libs -->
<script src="js/amcharts/amcharts.js" type="text/javascript"></script>
<script src="js/amcharts/pie.js" type="text/javascript"></script>
@ -1124,5 +700,6 @@
<!-- custom dex actions javascript -->
<!--<script src="js/dexactions.js" type="text/javascript"></script>-->
<script src="js/simpledexactions.js" type="text/javascript"></script>
<script src="js/electrum_list.js" type="text/javascript"></script>
</body>
</html>
</html>

View File

@ -2,143 +2,11 @@
var coin_select_options = '';
coin_select_options = `<optgroup label="Crytpo Coins">
<option data-content="<img src='img/cryptologo/btc.png' width='50px;'/> Bitcoin (BTC)" data-tokens="btc bitcoin ">BTC</option>
<option data-content="<img src='img/cryptologo/kmd.png' width='50px;'/> Komodo (KMD)" data-tokens="kmd komodo ">KMD</option>
<option data-content="<img src='img/cryptologo/mnz.png' width='50px;'/> Monaize (MNZ)" data-tokens="mnz monaize ">MNZ</option>
<option data-content="<img src='img/cryptologo/chips.png' width='50px;'/> CHIPS (CHIPS)" data-tokens="CHIPS CHIPS ">CHIPS</option>
<option data-content="<img src='img/cryptologo/888.png' width='50px'/> OctoCoin (888)" data-tokens="OctoCoin 888">888</option>
<option data-content="<img src='img/cryptologo/arc.png' width='50px'/> ArcticCoin (ARC)" data-tokens="ArcticCoin ARC">ARC</option>
<option data-content="<img src='img/cryptologo/ARG.png' width='50px'/> Argentum (ARG)" data-tokens="Argentum ARG">ARG</option>
<option data-content="<img src='img/cryptologo/bta.png' width='50px;'/> Bata (BTA)" data-tokens="Bata BTA">BTA</option>
<option data-content="<img src='img/cryptologo/bdl.png' width='50px;'/> Bitdeal (BDL)" data-tokens="Bitdeal BDL">BDL</option>
<option data-content="<img src='img/cryptologo/btx.png' width='50px'/> Bitcore (BTX)" data-tokens="Bitcore BTX">BTX</option>
<option data-content="<img src='img/cryptologo/btcz.png' width='50px'/> BitcoinZ (BTCZ)" data-tokens="BitcoinZ BTCZ">BTCZ</option>
<option data-content="<img src='img/cryptologo/bsd.png' width='50px'/> BitSend (BSD)" data-tokens="BitSend BSD">BSD</option>
<option data-content="<img src='img/cryptologo/blk.png' width='50px'/> BlackCoin (BLK)" data-tokens="BlackCoin BLK">BLK</option>
<option data-content="<img src='img/cryptologo/block.png' width='50px'/> Blocknet (BLOCK)" data-tokens="Blocknet BLOCK">BLK</option>
<option data-content="<img src='img/cryptologo/crw.png' width='50px'/> Crown (CRW)" data-tokens="crw crown ">CRW</option>
<option data-content="<img src='img/cryptologo/crea.png' width='50px'/> Creativecoin (CREA)" data-tokens="Creativecoin CREA">CREA</option>
<option data-content="<img src='img/cryptologo/dash.png' width='50px'/> Dash (DASH)" data-tokens="dash">DASH</option>
<option data-content="<img src='img/cryptologo/dgb.png' width='50px'/> Digibyte (DGB)" data-tokens="dgb digibyte">DGB</option>
<option data-content="<img src='img/cryptologo/doge.png' width='50px'/> Dogecoin (DOGE)" data-tokens="doge dogecoin">DOGE</option>
<option data-content="<img src='img/cryptologo/emc2.png' width='50px'/> Einsteinium (EMC2)" data-tokens="emc2 einsteinium">EMC2</option>
<option data-content="<img src='img/cryptologo/erc.png' width='50px'/> EuropeCoin (ERC)" data-tokens="EuropeCoin ERC">ERC</option>
<option data-content="<img src='img/cryptologo/fair.png' width='50px'/> Faircoin (FAIR)" data-tokens="FAIR Faircoin">FAIR</option>
<option data-content="<img src='img/cryptologo/flo.png' width='50px'/> Florincoin (FLO)" data-tokens="Florincoin FLO">FLO</option>
<option data-content="<img src='img/cryptologo/game.png' width='50px'/> Gamecredits (GAME)" data-tokens="Gamecredits GAME">GAME</option>
<option data-content="<img src='img/cryptologo/glt.png' width='50px'/> GlobalToken (GLT)" data-tokens="GlobalToken GLT">GLT</option>
<option data-content="<img src='img/cryptologo/huc.png' width='50px'/> Huntercoin (HUC)" data-tokens="Huntercoin HUC">HUC</option>
<option data-content="<img src='img/cryptologo/hush.png' width='50px'/> Hush (HUSH)" data-tokens="Hush HUSH">HUSH</option>
<option data-content="<img src='img/cryptologo/i0c.png' width='50px'/> I0Coin (I0C)" data-tokens="I0Coin I0C">I0C</option>
<option data-content="<img src='img/cryptologo/iop.png' width='50px'/> Internet of People (IOP)" data-tokens="Internet of People IOP">IOP</option>
<option data-content="<img src='img/cryptologo/lbc.png' width='50px'/> LBRY Credits (LBC)" data-tokens="LBRY Credits LBC">LBC</option>
<option data-content="<img src='img/cryptologo/ltc.png' width='50px'/> Litecoin (LTC)" data-tokens="Litecoin LTC">LTC</option>
<option data-content="<img src='img/cryptologo/mac.png' width='50px'/> Machinecoin (MAC)" data-tokens="Machinecoin MAC">MAC</option>
<option data-content="<img src='img/cryptologo/maga.png' width='50px'/> Magacoin (MAGA)" data-tokens="Magacoin MAGA">MAGA</option>
<option data-content="<img src='img/cryptologo/mona.png' width='50px'/> Monacoin (MONA)" data-tokens="Monacoin MONA">MONA</option>
<option data-content="<img src='img/cryptologo/mue.png' width='50px'/> Monetary Unit (MUE)" data-tokens="MonetaryUnit MUE">MUE</option>
<option data-content="<img src='img/cryptologo/moon.png' width='50px'/> Mooncoin (MOON)" data-tokens="Mooncoin MOON">MOON</option>
<option data-content="<img src='img/cryptologo/xmy.png' width='50px'/> Myriad (XMY)" data-tokens="Myriad (XMY)">XMY</option>
<option data-content="<img src='img/cryptologo/nav.png' width='50px'/> Navcoin (NAV)" data-tokens="Navcoin NAV">NAV</option>
<option data-content="<img src='img/cryptologo/nmc.png' width='50px'/> Namecoin (NMC)" data-tokens="Namecoin NMC">NMC</option>
<option data-content="<img src='img/cryptologo/pivx.png' width='50px'/> PIVX (PIVX)" data-tokens="PIVX">PIVX</option>
<option data-content="<img src='img/cryptologo/xre.png' width='50px'/> RevolverCoin (XRE)" data-tokens="RevolverCoin XRE">XRE</option>
<option data-content="<img src='img/cryptologo/sxc.png' width='50px'/> Sexcoin (SXC)" data-tokens="Sexcoin SXC">SXC</option>
<option data-content="<img src='img/cryptologo/sib.png' width='50px'/> Sibcoin (SIB)" data-tokens="Sibcoin SIB">SIB</option>
<option data-content="<img src='img/cryptologo/strat.png' width='50px'/> Stratis (STRAT)" data-tokens="Stratis STRAT">STRAT</option>
<option data-content="<img src='img/cryptologo/smc.png' width='50px'/> SmartCoin (SMC)" data-tokens="SmartCoin SMC">SMC</option>
<option data-content="<img src='img/cryptologo/sys.png' width='50px'/> Syscoin (SYS)" data-tokens="Syscoin SYS">SYS</option>
<option data-content="<img src='img/cryptologo/trc.png' width='50px'/> Terracoin (TRC)" data-tokens="Terracoin TRC">TRC</option>
<option data-content="<img src='img/cryptologo/uis.png' width='50px'/> Unitus (UIS)" data-tokens="Unitus UIS">UIS</option>
<option data-content="<img src='img/cryptologo/vtc.png' width='50px'/> Vertcoin (VTC)" data-tokens="Vertcoin VTC">VTC</option>
<option data-content="<img src='img/cryptologo/via.png' width='50px'/> Viacoin (VIA)" data-tokens="Viacoin VIA">VIA</option>
<option data-content="<img src='img/cryptologo/zcl.png' width='50px'/> ZClassic (ZCL)" data-tokens="ZClassic ZCL">ZCL</option>
<option data-content="<img src='img/cryptologo/zer.png' width='50px'/> Zero (ZER)" data-tokens="Zero ZER">ZER</option>
<option data-content="<img src='img/cryptologo/zet.png' width='50px'/> Zetacoin (ZET)" data-tokens="Zetacoin ZET">ZET</option>
<option data-content="<img src='img/cryptologo/zen.png' width='50px'/> ZenCash (ZEN)" data-tokens="ZenCash ZEN">ZEN</option>
<option data-content="<img src='img/cryptologo/zec.png' width='50px'/> Zcash (ZEC)" data-tokens="Zcash ZEC">ZEC</option>
</optgroup>
<optgroup label="AssetChains">
<option data-content="<img src='img/cryptologo/bet.png' width='50px'/> BET (BET)" data-tokens="BET BET">BET</option>
<option data-content="<img src='img/cryptologo/bots.png' width='50px'/> BOTS (BOTS)" data-tokens="BOTS BOTS">BOTS</option>
<option data-content="<img src='img/cryptologo/ceal.png' width='50px'/> Ceal (CEAL)" data-tokens="Ceal CEAL">CEAL</option>
<option data-content="<img src='img/cryptologo/coqui.png' width='50px;'/> COQUI (COQUI)" data-tokens="COQUI COQUI">COQUI</option>
<option data-content="<img src='img/cryptologo/crypto.png' width='50px'/> Crypto777 (CRYPTO)" data-tokens="Crypto777 CRYPTO">CRYPTO</option>
<option data-content="<img src='img/cryptologo/dex.png' width='50px;'/> InstantDEX (DEX)" data-tokens="InstantDEX DEX">DEX</option>
<option data-content="<img src='img/cryptologo/hodlc.png' width='50px'/> HODLC (HODLC)" data-tokens="HODLC HODLC">HODLC</option>
<option data-content="<img src='img/cryptologo/jumblr.png' width='50px;'/> Jumblr (JUMBLR)" data-tokens="Jumblr JUMBLR">JUMBLR</option>
<option data-content="<img src='img/cryptologo/kv.png' width='50px'/> KeyValue (KV)" data-tokens="KeyValue KV">KV</option>
<option data-content="<img src='img/cryptologo/mesh.png' width='50px'/> SuperMesh (MESH)" data-tokens="SuperMesh MESH">MESH</option>
<option data-content="<img src='img/cryptologo/mgw.png' width='50px'/> MultiGateway (MGW)" data-tokens="MultiGateway MGW">MGW</option>
<option data-content="<img src='img/cryptologo/pangea.png' width='50px'/> Pangea (PANGEA)" data-tokens="Pangea PANGEA">PANGEA</option>
<option data-content="<img src='img/cryptologo/revs.png' width='50px'/> REVS (REVS)" data-tokens="REVS REVS">REVS</option>
<option data-content="<img src='img/cryptologo/shark.png' width='50px'/> SHARK (SHARK)" data-tokens="SHARK SHARK">SHARK</option>
<option data-content="<img src='img/cryptologo/supernet.png' width='50px'/> SUPERNET (SUPERNET)" data-tokens="SUPERNET SUPERNET">SUPERNET</option>
<option data-content="<img src='img/cryptologo/wlc.png' width='50px'/> Wireless (WLC)" data-tokens="Wireless WLC">WLC</option>>
<option data-content="<img src='img/cryptologo/btc.png' width='50px;'/> Bitcoin (BTC)" data-tokens="btc bitcoin ">BTC</option>
</optgroup>`;
/*
<option data-content="<img src='img/cryptologo/ANC.png' width='50px' disabled/> Anoncoin (ANC)" data-tokens="anc anoncoin">ANC</option>
<option data-content="<img src='img/cryptologo/BTM.png' width='50px' disabled/> Bitmark (BTM)" data-tokens="btm bitmark">BTM</option>
<option data-content="<img src='img/cryptologo/CARB.png' width='50px' disabled/> Carboncoin (CARB)" data-tokens="carb carboncoin">CARB</option>
<option data-content="<img src='img/cryptologo/FRK.png' width='50px' disabled/> Franko (FRK)" data-tokens="Franko FRK">FRK</option>
<option data-content="<img src='img/cryptologo/MZC.png' width='50px' disabled/> Mazacoin (MZC)" data-tokens="Mazacoin MZC">MZC</option>
<option data-content="<img src='img/cryptologo/UNO.png' width='50px' disabled/> Unobtanium (UNO)" data-tokens="Unobtanium UNO">UNO</option>
<option data-content="<img src='img/cryptologo/MVP.png' width='50px' disabled/> MVP (MVP)" data-tokens="MVP MVP">MVP</option>
<optgroup label="Komodo Currencies">
<option data-content="<img src='img/cryptologo/aud.png' width='50px;'/> Australian Dollar (AUD)" data-tokens="Australian Dollar AUD">AUD</option>
<option data-content="<img src='img/cryptologo/bgn.png' width='50px;'/> Bulgarian Lev (BGN)" data-tokens="Bulgarian Lev BGN">BGN</option>
<option data-content="<img src='img/cryptologo/cad.png' width='50px;'/> Canadian Dollar (CAD)" data-tokens="Canadian Dollar CAD">CAD</option>
<option data-content="<img src='img/cryptologo/chf.png' width='50px;'/> Swiss Franc (CHF)" data-tokens="Swiss Franc CHF">CHF</option>
<option data-content="<img src='img/cryptologo/cny.png' width='50px;'/> Chinese Yuan (CNY)" data-tokens="Chinese Yuan CNY">CNY</option>
<option data-content="<img src='img/cryptologo/czk.png' width='50px;'/> Czech Koruna (CZK)" data-tokens="Czech Koruna CZK">CZK</option>
<option data-content="<img src='img/cryptologo/dkk.png' width='50px;'/> Danish Krone (DKK)" data-tokens="Danish Krone DKK">DKK</option>
<option data-content="<img src='img/cryptologo/eur.png' width='50px;'/> Euro (EUR)" data-tokens="Euro EUR">EUR</option>
<option data-content="<img src='img/cryptologo/gbp.png' width='50px;'/> Pound Sterling (GBP)" data-tokens="Pound Sterling GBP">GBP</option>
<option data-content="<img src='img/cryptologo/hkd.png' width='50px;'/> Hong Kong Dollar (HKD)" data-tokens="Hong Kong Dollar HKD">HKD</option>
<option data-content="<img src='img/cryptologo/hrk.png' width='50px;'/> Croatian Kuna (HRK)" data-tokens="Croatian Kuna HRK">HRK</option>
<option data-content="<img src='img/cryptologo/huf.png' width='50px;'/> Hungarian Forint (HUF)" data-tokens="Hungarian Forint HUF">HUF</option>
<option data-content="<img src='img/cryptologo/idr.png' width='50px;'/> Indonesian Rupiah (IDR)" data-tokens="Indonesian Rupiah IDR">IDR</option>
<option data-content="<img src='img/cryptologo/ils.png' width='50px;'/> Israeli Shekel (ILS)" data-tokens="Israeli Shekel ILS">ILS</option>
<option data-content="<img src='img/cryptologo/inr.png' width='50px;'/> Indian Rupee (INR)" data-tokens="Indian Rupee INR">INR</option>
<option data-content="<img src='img/cryptologo/jpy.png' width='50px;'/> Japanese Yen (JPY)" data-tokens="Japanese Yen JPY">JPY</option>
<option data-content="<img src='img/cryptologo/krw.png' width='50px;'/> South Korean Won (KRW)" data-tokens="South Korean Won KRW">KRW</option>
<option data-content="<img src='img/cryptologo/mxn.png' width='50px;'/> Mexican Peso (MXN)" data-tokens="Mexican Peso MXN">MXN</option>
<option data-content="<img src='img/cryptologo/myr.png' width='50px;'/> Malaysian Ringgit (MYR)" data-tokens="Malaysian Ringgit MYR">MYR</option>
<option data-content="<img src='img/cryptologo/nok.png' width='50px;'/> Norwegian Krone (NOK)" data-tokens="Norwegian Krone NOK">NOK</option>
<option data-content="<img src='img/cryptologo/nzd.png' width='50px;'/> New Zealand Dollar (NZD)" data-tokens="New Zealand Dollar NZD">NZD</option>
<option data-content="<img src='img/cryptologo/php.png' width='50px;'/> Philippine Peso (PHP)" data-tokens="Philippine Peso PHP">PHP</option>
<option data-content="<img src='img/cryptologo/pln.png' width='50px;'/> Polish Zloty (PLN)" data-tokens="Polish Zloty PLN">PLN</option>
<option data-content="<img src='img/cryptologo/brl.png' width='50px;'/> Brazilian Real (BRL)" data-tokens="Brazilian Real BRL">BRL</option>
<option data-content="<img src='img/cryptologo/ron.png' width='50px;'/> Romanian Leu (RON)" data-tokens="Romanian Leu RON">RON</option>
<option data-content="<img src='img/cryptologo/rub.png' width='50px;'/> Russian Ruble (RUB)" data-tokens="Russian Ruble RUB">RUB</option>
<option data-content="<img src='img/cryptologo/sek.png' width='50px;'/> Swedish Krona (SEK)" data-tokens="Swedish Krona SEK">SEK</option>
<option data-content="<img src='img/cryptologo/sgd.png' width='50px;'/> Singapore Dollar (SGD)" data-tokens="Singapore Dollar SGD">SGD</option>
<option data-content="<img src='img/cryptologo/thb.png' width='50px;'/> Thai Baht (THB)" data-tokens="Thai Baht THB">THB</option>
<option data-content="<img src='img/cryptologo/try.png' width='50px;'/> Turkish Lira (TRY)" data-tokens="Turkish Lira TRY">TRY</option>
<option data-content="<img src='img/cryptologo/usd.png' width='50px;'/> US Dollar (USD)" data-tokens="US Dollar USD">USD</option>
<option data-content="<img src='img/cryptologo/zar.png' width='50px;'/> South African Rand (ZAR)" data-tokens="South African Rand ZAR">ZAR</option>
</optgroup>
*/
$('.trading_pair_coin').html(coin_select_options);
$('.sell_coin').html(coin_select_options);
$('.buy_coin').html(coin_select_options);
$('.sell_coin_p').html(coin_select_options);
$('.buy_coin_p').html(coin_select_options);

20
gui/js/countdown.min.js vendored Normal file
View File

@ -0,0 +1,20 @@
/*
countdown.js v2.6.0 http://countdownjs.org
Copyright (c)2006-2014 Stephen M. McKamey.
Licensed under The MIT License.
*/
var module,countdown=function(v){function A(a,b){var c=a.getTime();a.setMonth(a.getMonth()+b);return Math.round((a.getTime()-c)/864E5)}function w(a){var b=a.getTime(),c=new Date(b);c.setMonth(a.getMonth()+1);return Math.round((c.getTime()-b)/864E5)}function x(a,b){b=b instanceof Date||null!==b&&isFinite(b)?new Date(+b):new Date;if(!a)return b;var c=+a.value||0;if(c)return b.setTime(b.getTime()+c),b;(c=+a.milliseconds||0)&&b.setMilliseconds(b.getMilliseconds()+c);(c=+a.seconds||0)&&b.setSeconds(b.getSeconds()+
c);(c=+a.minutes||0)&&b.setMinutes(b.getMinutes()+c);(c=+a.hours||0)&&b.setHours(b.getHours()+c);(c=+a.weeks||0)&&(c*=7);(c+=+a.days||0)&&b.setDate(b.getDate()+c);(c=+a.months||0)&&b.setMonth(b.getMonth()+c);(c=+a.millennia||0)&&(c*=10);(c+=+a.centuries||0)&&(c*=10);(c+=+a.decades||0)&&(c*=10);(c+=+a.years||0)&&b.setFullYear(b.getFullYear()+c);return b}function D(a,b){return y(a)+(1===a?p[b]:q[b])}function n(){}function k(a,b,c,e,l,d){0<=a[c]&&(b+=a[c],delete a[c]);b/=l;if(1>=b+1)return 0;if(0<=a[e]){a[e]=
+(a[e]+b).toFixed(d);switch(e){case "seconds":if(60!==a.seconds||isNaN(a.minutes))break;a.minutes++;a.seconds=0;case "minutes":if(60!==a.minutes||isNaN(a.hours))break;a.hours++;a.minutes=0;case "hours":if(24!==a.hours||isNaN(a.days))break;a.days++;a.hours=0;case "days":if(7!==a.days||isNaN(a.weeks))break;a.weeks++;a.days=0;case "weeks":if(a.weeks!==w(a.refMonth)/7||isNaN(a.months))break;a.months++;a.weeks=0;case "months":if(12!==a.months||isNaN(a.years))break;a.years++;a.months=0;case "years":if(10!==
a.years||isNaN(a.decades))break;a.decades++;a.years=0;case "decades":if(10!==a.decades||isNaN(a.centuries))break;a.centuries++;a.decades=0;case "centuries":if(10!==a.centuries||isNaN(a.millennia))break;a.millennia++;a.centuries=0}return 0}return b}function B(a,b,c,e,l,d){var f=new Date;a.start=b=b||f;a.end=c=c||f;a.units=e;a.value=c.getTime()-b.getTime();0>a.value&&(f=c,c=b,b=f);a.refMonth=new Date(b.getFullYear(),b.getMonth(),15,12,0,0);try{a.millennia=0;a.centuries=0;a.decades=0;a.years=c.getFullYear()-
b.getFullYear();a.months=c.getMonth()-b.getMonth();a.weeks=0;a.days=c.getDate()-b.getDate();a.hours=c.getHours()-b.getHours();a.minutes=c.getMinutes()-b.getMinutes();a.seconds=c.getSeconds()-b.getSeconds();a.milliseconds=c.getMilliseconds()-b.getMilliseconds();var g;0>a.milliseconds?(g=s(-a.milliseconds/1E3),a.seconds-=g,a.milliseconds+=1E3*g):1E3<=a.milliseconds&&(a.seconds+=m(a.milliseconds/1E3),a.milliseconds%=1E3);0>a.seconds?(g=s(-a.seconds/60),a.minutes-=g,a.seconds+=60*g):60<=a.seconds&&(a.minutes+=
m(a.seconds/60),a.seconds%=60);0>a.minutes?(g=s(-a.minutes/60),a.hours-=g,a.minutes+=60*g):60<=a.minutes&&(a.hours+=m(a.minutes/60),a.minutes%=60);0>a.hours?(g=s(-a.hours/24),a.days-=g,a.hours+=24*g):24<=a.hours&&(a.days+=m(a.hours/24),a.hours%=24);for(;0>a.days;)a.months--,a.days+=A(a.refMonth,1);7<=a.days&&(a.weeks+=m(a.days/7),a.days%=7);0>a.months?(g=s(-a.months/12),a.years-=g,a.months+=12*g):12<=a.months&&(a.years+=m(a.months/12),a.months%=12);10<=a.years&&(a.decades+=m(a.years/10),a.years%=
10,10<=a.decades&&(a.centuries+=m(a.decades/10),a.decades%=10,10<=a.centuries&&(a.millennia+=m(a.centuries/10),a.centuries%=10)));b=0;!(e&1024)||b>=l?(a.centuries+=10*a.millennia,delete a.millennia):a.millennia&&b++;!(e&512)||b>=l?(a.decades+=10*a.centuries,delete a.centuries):a.centuries&&b++;!(e&256)||b>=l?(a.years+=10*a.decades,delete a.decades):a.decades&&b++;!(e&128)||b>=l?(a.months+=12*a.years,delete a.years):a.years&&b++;!(e&64)||b>=l?(a.months&&(a.days+=A(a.refMonth,a.months)),delete a.months,
7<=a.days&&(a.weeks+=m(a.days/7),a.days%=7)):a.months&&b++;!(e&32)||b>=l?(a.days+=7*a.weeks,delete a.weeks):a.weeks&&b++;!(e&16)||b>=l?(a.hours+=24*a.days,delete a.days):a.days&&b++;!(e&8)||b>=l?(a.minutes+=60*a.hours,delete a.hours):a.hours&&b++;!(e&4)||b>=l?(a.seconds+=60*a.minutes,delete a.minutes):a.minutes&&b++;!(e&2)||b>=l?(a.milliseconds+=1E3*a.seconds,delete a.seconds):a.seconds&&b++;if(!(e&1)||b>=l){var h=k(a,0,"milliseconds","seconds",1E3,d);if(h&&(h=k(a,h,"seconds","minutes",60,d))&&(h=
k(a,h,"minutes","hours",60,d))&&(h=k(a,h,"hours","days",24,d))&&(h=k(a,h,"days","weeks",7,d))&&(h=k(a,h,"weeks","months",w(a.refMonth)/7,d))){e=h;var n,p=a.refMonth,q=p.getTime(),r=new Date(q);r.setFullYear(p.getFullYear()+1);n=Math.round((r.getTime()-q)/864E5);if(h=k(a,e,"months","years",n/w(a.refMonth),d))if(h=k(a,h,"years","decades",10,d))if(h=k(a,h,"decades","centuries",10,d))if(h=k(a,h,"centuries","millennia",10,d))throw Error("Fractional unit overflow");}}}finally{delete a.refMonth}return a}
function d(a,b,c,e,d){var f;c=+c||222;e=0<e?e:NaN;d=0<d?20>d?Math.round(d):20:0;var k=null;"function"===typeof a?(f=a,a=null):a instanceof Date||(null!==a&&isFinite(a)?a=new Date(+a):("object"===typeof k&&(k=a),a=null));var g=null;"function"===typeof b?(f=b,b=null):b instanceof Date||(null!==b&&isFinite(b)?b=new Date(+b):("object"===typeof b&&(g=b),b=null));k&&(a=x(k,b));g&&(b=x(g,a));if(!a&&!b)return new n;if(!f)return B(new n,a,b,c,e,d);var k=c&1?1E3/30:c&2?1E3:c&4?6E4:c&8?36E5:c&16?864E5:6048E5,
h,g=function(){f(B(new n,a,b,c,e,d),h)};g();return h=setInterval(g,k)}var s=Math.ceil,m=Math.floor,p,q,r,t,u,f,y,z;n.prototype.toString=function(a){var b=z(this),c=b.length;if(!c)return a?""+a:u;if(1===c)return b[0];a=r+b.pop();return b.join(t)+a};n.prototype.toHTML=function(a,b){a=a||"span";var c=z(this),e=c.length;if(!e)return(b=b||u)?"\x3c"+a+"\x3e"+b+"\x3c/"+a+"\x3e":b;for(var d=0;d<e;d++)c[d]="\x3c"+a+"\x3e"+c[d]+"\x3c/"+a+"\x3e";if(1===e)return c[0];e=r+c.pop();return c.join(t)+e};n.prototype.addTo=
function(a){return x(this,a)};z=function(a){var b=[],c=a.millennia;c&&b.push(f(c,10));(c=a.centuries)&&b.push(f(c,9));(c=a.decades)&&b.push(f(c,8));(c=a.years)&&b.push(f(c,7));(c=a.months)&&b.push(f(c,6));(c=a.weeks)&&b.push(f(c,5));(c=a.days)&&b.push(f(c,4));(c=a.hours)&&b.push(f(c,3));(c=a.minutes)&&b.push(f(c,2));(c=a.seconds)&&b.push(f(c,1));(c=a.milliseconds)&&b.push(f(c,0));return b};d.MILLISECONDS=1;d.SECONDS=2;d.MINUTES=4;d.HOURS=8;d.DAYS=16;d.WEEKS=32;d.MONTHS=64;d.YEARS=128;d.DECADES=256;
d.CENTURIES=512;d.MILLENNIA=1024;d.DEFAULTS=222;d.ALL=2047;var E=d.setFormat=function(a){if(a){if("singular"in a||"plural"in a){var b=a.singular||[];b.split&&(b=b.split("|"));var c=a.plural||[];c.split&&(c=c.split("|"));for(var d=0;10>=d;d++)p[d]=b[d]||p[d],q[d]=c[d]||q[d]}"string"===typeof a.last&&(r=a.last);"string"===typeof a.delim&&(t=a.delim);"string"===typeof a.empty&&(u=a.empty);"function"===typeof a.formatNumber&&(y=a.formatNumber);"function"===typeof a.formatter&&(f=a.formatter)}},C=d.resetFormat=
function(){p=" millisecond; second; minute; hour; day; week; month; year; decade; century; millennium".split(";");q=" milliseconds; seconds; minutes; hours; days; weeks; months; years; decades; centuries; millennia".split(";");r=" and ";t=", ";u="";y=function(a){return a};f=D};d.setLabels=function(a,b,c,d,f,k,m){E({singular:a,plural:b,last:c,delim:d,empty:f,formatNumber:k,formatter:m})};d.resetLabels=C;C();v&&v.exports?v.exports=d:"function"===typeof window.define&&"undefined"!==typeof window.define.amd&&
window.define("countdown",[],function(){return d});return d}(module);

View File

@ -1,6 +1,6 @@
{
var electrum_servers_list = {
"ARG": [{"173.212.225.176": 50081},{"136.243.45.140": 50081}],
"BTC": [{"173.212.225.176": 50001},{"136.243.45.140": 50001}],
"BTC": [{"electrum2.cipig.net":10000},{"electrum1.cipig.net":10000}],
"CHIPS": [{"173.212.225.176": 50076},{"136.243.45.140": 50076}],
"CRW": [{"173.212.225.176": 50041},{"136.243.45.140": 50041}],
"DASH": [{"173.212.225.176": 50098},{"136.243.45.140": 50098}],
@ -9,15 +9,33 @@
"EMC2": [{"173.212.225.176": 50079},{"136.243.45.140": 50079}],
"FAIR": [{"173.212.225.176": 50005},{"136.243.45.140": 50005}],
"HUSH": [{"173.212.225.176": 50013},{"136.243.45.140": 50013}],
"JUMBLR": [{"173.212.225.176": 50051},{"136.243.45.140": 50051}],
"KMD": [{"136.243.45.140": 50011},{"173.212.225.176": 50011}],
"JUMBLR": [{"electrum2.cipig.net": 10004},{"electrum1.cipig.net": 10004}],
"KMD": [{"electrum2.cipig.net":10001},{"electrum1.cipig.net":10001}],
"LTC": [{"173.212.225.176": 50012},{"136.243.45.140": 50012}],
"MNZ": [{"173.212.225.176": 50053},{"136.243.45.140": 50053}],
"MNZ": [{"electrum2.cipig.net":10002},{"electrum1.cipig.net":10002}],
"MONA": [{"173.212.225.176": 50002},{"136.243.45.140": 50002}],
"NMC": [{"173.212.225.176": 50036},{"136.243.45.140": 50036}],
"REVS": [{"173.212.225.176": 50050},{"136.243.45.140": 50050}],
"REVS": [{"electrum2.cipig.net": 10003},{"electrum1.cipig.net": 10003}],
"VIA": [{"173.212.225.176": 50033},{"136.243.45.140": 50033}],
"VTC": [{"173.212.225.176": 50088},{"136.243.45.140": 50088}],
"WLC": [{"173.212.225.176": 50052},{"136.243.45.140": 50052}],
"ZEC": [{"173.212.225.176": 50032},{"136.243.45.140": 50032}]
}
}
Array.prototype.getRandomElectrumServer = function(){
return this[Math.floor(Math.random()*this.length)];
}
//electrum_coin_servers = electrum_servers_list['BTC']
//console.log(electrum_coin_servers);
function get_random_electrum_server(coin) {
var select_random_server = electrum_servers_list[coin][Math.floor(Math.random() * electrum_servers_list[coin].length)];
var return_data = {}
var ipaddr = _.keys(select_random_server);
return_data.ipaddr = ipaddr[0];
return_data.port = select_random_server[ipaddr[0]];
return return_data;
}

4
gui/js/fa/css/font-awesome.min.css vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -3,12 +3,14 @@ var CheckMM_Interval = null;
// In renderer process (web page).
const {ipcRenderer} = require('electron')
const _coin = 'MNZ';
ShepherdIPC = function(data) {
/*ipcRenderer.on('shepherd-reply', (event, arg) => {
console.log(arg) // prints "pong"
})
ipcRenderer.sendSync('shepherd-command', data)*/
// USING SYNCHRONOUS METHOD TO SEND AND RECIVE IPC COMMANDS/REPLIES
//console.log(ipcRenderer.sendSync('shepherd-commandSync', 'ping')) // prints "pong"
let shepherdreply = ipcRenderer.sendSync('shepherd-command', data);
@ -23,11 +25,132 @@ $('.dexlogout-btn').click(function(e) {
$('.mainbody').fadeOut();
$('.loginbody').fadeIn();
//CheckOrderBookFn(false);
CheckPortfolioFn(false);
//CheckPortfolioFn(false);
CheckOrderBookFn(false);
check_swap_status(false);
check_bot_list(false);
check_my_prices(false);
bot_screen_coin_balance(false);
bot_screen_sellcoin_balance(false);
//check_coin_balance(false);
sessionStorage.clear();
});
$('.dexdebug-btn').click(function(e) {
$('.dexdebug').show();
$('.dexlogout-btn').hide();
$('.dexdebug-close-btn').show();
$('.dexdebug-btn').hide();
});
$('.dexdebug-close-btn').click(function(e) {
$('.dexdebug').hide();
$('.dexdebug-btn').show();
$('.dexlogout-btn').show();
$('.dexdebug-close-btn').hide();
});
$('.login-genpass-btn').click(function(e){
e.preventDefault();
var login_gen_pass = bootbox.dialog({
backdrop: true,
onEscape: true,
message: `
<form>
<div class="form-group">
<label>New Passphrase</label>
<div class="input-group">
<input type="text" class="form-control btn_gen_pass_input1">
<span class="input-group-btn">
<button class="btn btn-info btn_gen_pass_regenpass" type="button"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Regen</button>
</span>
</div>
</div>
<div class="form-group">
<label>Verify Passphrase</label>
<input type="text" class="form-control btn_gen_pass_input2" placeholder="Repat the passphrase here as shown in first input field">
</div>
<div class="form-group">
<div class="col-sm-12 input-group"><p>To generate a new passphrase click on "Regen" button.</p>
<p>Make sure to save this new passphrase.<br> To confirm if you have saved it, please type in the passphrase in "Verify Passphrase" field.</p></div></div>
</div>
</form>`,
closeButton: false,
size: 'large',
buttons: {
cancel: {
label: "Close",
className: 'btn-default',
callback: function(){
}
},
ok: {
label: "Login with new passphrase",
className: 'btn-primary btn_gen_pass_regenpass_login',
callback: function(){
var pass_input1 = $('.btn_gen_pass_input1').val();
var pass_input2 = $('.btn_gen_pass_input2').val();
//console.log(pass_input1);
//console.log(pass_input2);
$('.loginPassphrase').val(pass_input2);
$('.login-btn').trigger('click');
}
}
}
});
login_gen_pass.init(function(){
console.log('dialog opened.')
$('.btn_gen_pass_regenpass_login').attr("disabled", "disabled");
$('.btn_gen_pass_input1').val(PassPhraseGenerator.generatePassPhrase(128));
$('.btn_gen_pass_regenpass').click(function(e){
e.preventDefault();
console.log('btn_gen_pass_regenpass clicked');
$('.btn_gen_pass_input1').val(PassPhraseGenerator.generatePassPhrase(128));
})
$('.btn_gen_pass_input1').keyup(function() {
var pass_input1 = $('.btn_gen_pass_input1').val();
var pass_input2 = $('.btn_gen_pass_input2').val();
//console.log(pass_input1);
//console.log(pass_input2);
if (pass_input1 !== pass_input2){
$('.btn_gen_pass_regenpass_login').attr("disabled", "disabled");
} else {
$('.btn_gen_pass_regenpass_login').removeAttr("disabled");
}
});
$('.btn_gen_pass_input2').keyup(function() {
var pass_input1 = $('.btn_gen_pass_input1').val();
var pass_input2 = $('.btn_gen_pass_input2').val();
//console.log(pass_input1);
//console.log(pass_input2);
if (pass_input1 !== pass_input2){
$('.btn_gen_pass_regenpass_login').attr("disabled", "disabled");
} else {
$('.btn_gen_pass_regenpass_login').removeAttr("disabled");
}
});
});
});
$('.login-btn').click(function(e) {
e.preventDefault();
var passphrase = $('.loginPassphrase').val();
@ -56,11 +179,48 @@ CheckMMStatus = function(sig) {
get_myprices();
CheckOrderbook_Interval = setInterval(CheckOrderBookFn,3000);*/
//check_coin_balance_Interval = setInterval(check_coin_balance,3000);
CheckPortfolio_Interval = setInterval(CheckPortfolioFn,60000);
//---- dICO App Settings START ----//
//CheckPortfolio_Interval = setInterval(CheckPortfolioFn,60000);
selected_coin = {}
selected_coin.coin = _coin;
selected_coin.coin_name = return_coin_name(_coin);
console.log(selected_coin);
sessionStorage.setItem('mm_selectedcoin', JSON.stringify(selected_coin));
$('.screen-portfolio').hide();
$('.screen-coindashboard').hide()
$('.screen-exchange').show();
$('.coin_ticker').html(_coin);
$.each($('.coinexchange[data-coin]'), function(index, value) {
$('.coinexchange[data-coin]').data('coin', _coin);
});
check_coin_balance(false);
CheckOrderBookFn();
CheckOrderbook_Interval = setInterval(CheckOrderBookFn,30000);
check_swap_status_Interval = setInterval(check_swap_status,20000);
check_swap_status();
check_bot_list_Interval = setInterval(check_bot_list, 30000);
check_bot_list();
check_my_prices_Interval = setInterval(check_my_prices, 30000);
check_my_prices();
bot_screen_coin_balance_Interval = setInterval(bot_screen_coin_balance, 30000);
bot_screen_coin_balance();
bot_screen_sellcoin_balance_Interval = setInterval(bot_screen_sellcoin_balance, 30000);
bot_screen_sellcoin_balance();
$('#trading_mode_options_trademanual').trigger('click');
$('#trading_mode_options_tradebot').removeAttr("checked");
$('#trading_mode_options_trademanual').attr('checked','checked');
//---- dICO App Settings END ----//
clearInterval(CheckMM_Interval);
} else {
$('.mainbody').fadeOut();
$('.loginbody').fadeout();
$('.loginbody').fadeOut();
$('.loadingbody').fadeIn();
}
}

1
gui/js/moment-countdown.min.js vendored Normal file
View File

@ -0,0 +1 @@
(function(){var countdown,moment,ref,ref1,slice=[].slice;countdown=(ref=typeof require==="function"?require("countdown"):void 0)!=null?ref:this.countdown;moment=(ref1=typeof require==="function"?require("moment"):void 0)!=null?ref1:this.moment;moment.fn.countdown=function(){var args,other;other=arguments[0],args=2<=arguments.length?slice.call(arguments,1):[];return countdown.apply(null,[this.toDate(),moment(other).toDate()].concat(slice.call(args)))}}).call(this);

1
gui/js/moment.min.js vendored Normal file

File diff suppressed because one or more lines are too long

85
gui/js/passphrasegenerator.js Executable file
View File

@ -0,0 +1,85 @@
/******************************************************************************
* Copyright © 2016 The Waves Core Developers. *
* *
* See the LICENSE files at *
* the top-level directory of this distribution for the individual copyright *
* holder information and the developer policies on copyright and licensing. *
* *
* Unless otherwise agreed in a custom licensing agreement, no part of the *
* Waves software, including this file, may be copied, modified, propagated, *
* or distributed except according to the terms contained in the LICENSE.txt *
* file. *
* *
* Removal or modification of this copyright notice is prohibited. *
* *
******************************************************************************/
/**
* @depends {../3rdparty/jquery-2.1.0.js}
*/
var PassPhraseGenerator = {
seeds: 0,
seedLimit: 512,
push: function(seed) {
Math.seedrandom(seed, true);
this.seeds++;
},
isDone: function() {
if (this.seeds == this.seedLimit) {
return true;
}
return false;
},
percentage: function() {
return Math.round((this.seeds / this.seedLimit) * 100)
},
passPhrase: "",
wordCount: 2048,
words: ClientWordList,
generatePassPhrase: function(bitsval) {
var crypto = window.crypto || window.msCrypto;
bits = bitsval;
var random = new Uint32Array(bits / 32);
crypto.getRandomValues(random);
var i = 0,
l = random.length,
n = this.wordCount,
words = [],
x, w1, w2, w3;
for (; i < l; i++) {
x = random[i];
w1 = x % n;
w2 = (((x / n) >> 0) + w1) % n;
w3 = (((((x / n) >> 0) / n) >> 0) + w2) % n;
words.push(this.words[w1]);
words.push(this.words[w2]);
words.push(this.words[w3]);
}
this.passPhrase = words.join(" ");
crypto.getRandomValues(random);
return this.passPhrase;
},
reset: function() {
this.passPhrase = "";
this.seeds = 0;
}
}

342
gui/js/seedrandom.js Executable file
View File

@ -0,0 +1,342 @@
// seedrandom.js version 2.3.3
// Author: David Bau
// Date: 2014 Feb 4
//
// Defines a method Math.seedrandom() that, when called, substitutes
// an explicitly seeded RC4-based algorithm for Math.random(). Also
// supports automatic seeding from local or network sources of entropy.
// Can be used as a node.js or AMD module. Can be called with "new"
// to create a local PRNG without changing Math.random.
//
// Basic usage:
//
// <script src=http://davidbau.com/encode/seedrandom.min.js></script>
//
// Math.seedrandom('yay.'); // Sets Math.random to a function that is
// // initialized using the given explicit seed.
//
// Math.seedrandom(); // Sets Math.random to a function that is
// // seeded using the current time, dom state,
// // and other accumulated local entropy.
// // The generated seed string is returned.
//
// Math.seedrandom('yowza.', true);
// // Seeds using the given explicit seed mixed
// // together with accumulated entropy.
//
// <script src="https://jsonlib.appspot.com/urandom?callback=Math.seedrandom">
// </script> <!-- Seeds using urandom bits from a server. -->
//
// Math.seedrandom("hello."); // Behavior is the same everywhere:
// document.write(Math.random()); // Always 0.9282578795792454
// document.write(Math.random()); // Always 0.3752569768646784
//
// Math.seedrandom can be used as a constructor to return a seeded PRNG
// that is independent of Math.random:
//
// var myrng = new Math.seedrandom('yay.');
// var n = myrng(); // Using "new" creates a local prng without
// // altering Math.random.
//
// When used as a module, seedrandom is a function that returns a seeded
// PRNG instance without altering Math.random:
//
// // With node.js (after "npm install seedrandom"):
// var seedrandom = require('seedrandom');
// var rng = seedrandom('hello.');
// console.log(rng()); // always 0.9282578795792454
//
// // With require.js or other AMD loader:
// require(['seedrandom'], function(seedrandom) {
// var rng = seedrandom('hello.');
// console.log(rng()); // always 0.9282578795792454
// });
//
// More examples:
//
// var seed = Math.seedrandom(); // Use prng with an automatic seed.
// document.write(Math.random()); // Pretty much unpredictable x.
//
// var rng = new Math.seedrandom(seed); // A new prng with the same seed.
// document.write(rng()); // Repeat the 'unpredictable' x.
//
// function reseed(event, count) { // Define a custom entropy collector.
// var t = [];
// function w(e) {
// t.push([e.pageX, e.pageY, +new Date]);
// if (t.length < count) { return; }
// document.removeEventListener(event, w);
// Math.seedrandom(t, true); // Mix in any previous entropy.
// }
// document.addEventListener(event, w);
// }
// reseed('mousemove', 100); // Reseed after 100 mouse moves.
//
// The callback third arg can be used to get both the prng and the seed.
// The following returns both an autoseeded prng and the seed as an object,
// without mutating Math.random:
//
// var obj = Math.seedrandom(null, false, function(prng, seed) {
// return { random: prng, seed: seed };
// });
//
// Version notes:
//
// The random number sequence is the same as version 1.0 for string seeds.
// * Version 2.0 changed the sequence for non-string seeds.
// * Version 2.1 speeds seeding and uses window.crypto to autoseed if present.
// * Version 2.2 alters non-crypto autoseeding to sweep up entropy from plugins.
// * Version 2.3 adds support for "new", module loading, and a null seed arg.
// * Version 2.3.1 adds a build environment, module packaging, and tests.
// * Version 2.3.3 fixes bugs on IE8, and switches to MIT license.
//
// The standard ARC4 key scheduler cycles short keys, which means that
// seedrandom('ab') is equivalent to seedrandom('abab') and 'ababab'.
// Therefore it is a good idea to add a terminator to avoid trivial
// equivalences on short string seeds, e.g., Math.seedrandom(str + '\0').
// Starting with version 2.0, a terminator is added automatically for
// non-string seeds, so seeding with the number 111 is the same as seeding
// with '111\0'.
//
// When seedrandom() is called with zero args or a null seed, it uses a
// seed drawn from the browser crypto object if present. If there is no
// crypto support, seedrandom() uses the current time, the native rng,
// and a walk of several DOM objects to collect a few bits of entropy.
//
// Each time the one- or two-argument forms of seedrandom are called,
// entropy from the passed seed is accumulated in a pool to help generate
// future seeds for the zero- and two-argument forms of seedrandom.
//
// On speed - This javascript implementation of Math.random() is several
// times slower than the built-in Math.random() because it is not native
// code, but that is typically fast enough. Some details (timings on
// Chrome 25 on a 2010 vintage macbook):
//
// seeded Math.random() - avg less than 0.0002 milliseconds per call
// seedrandom('explicit.') - avg less than 0.2 milliseconds per call
// seedrandom('explicit.', true) - avg less than 0.2 milliseconds per call
// seedrandom() with crypto - avg less than 0.2 milliseconds per call
//
// Autoseeding without crypto is somewhat slower, about 20-30 milliseconds on
// a 2012 windows 7 1.5ghz i5 laptop, as seen on Firefox 19, IE 10, and Opera.
// Seeded rng calls themselves are fast across these browsers, with slowest
// numbers on Opera at about 0.0005 ms per seeded Math.random().
//
// LICENSE (BSD):
//
// Copyright 2013 David Bau, all rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of this module nor the names of its contributors may
// be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
/**
* All code is in an anonymous closure to keep the global namespace clean.
*/
(function (
global, pool, math, width, chunks, digits, module, define, rngname) {
//
// The following constants are related to IEEE 754 limits.
//
var startdenom = math.pow(width, chunks),
significance = math.pow(2, digits),
overflow = significance * 2,
mask = width - 1,
//
// seedrandom()
// This is the seedrandom function described above.
//
impl = math['seed' + rngname] = function(seed, use_entropy, callback) {
var key = [];
// Flatten the seed string or build one from local entropy if needed.
var shortseed = mixkey(flatten(
use_entropy ? [seed, tostring(pool)] :
(seed == null) ? autoseed() : seed, 3), key);
// Use the seed to initialize an ARC4 generator.
var arc4 = new ARC4(key);
// Mix the randomness into accumulated entropy.
mixkey(tostring(arc4.S), pool);
// Calling convention: what to return as a function of prng, seed, is_math.
return (callback ||
// If called as a method of Math (Math.seedrandom()), mutate Math.random
// because that is how seedrandom.js has worked since v1.0. Otherwise,
// it is a newer calling convention, so return the prng directly.
function(prng, seed, is_math_call) {
if (is_math_call) { math[rngname] = prng; return seed; }
else return prng;
})(
// This function returns a random double in [0, 1) that contains
// randomness in every bit of the mantissa of the IEEE 754 value.
function() {
var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48
d = startdenom, // and denominator d = 2 ^ 48.
x = 0; // and no 'extra last byte'.
while (n < significance) { // Fill up all significant digits by
n = (n + x) * width; // shifting numerator and
d *= width; // denominator and generating a
x = arc4.g(1); // new least-significant-byte.
}
while (n >= overflow) { // To avoid rounding up, before adding
n /= 2; // last byte, shift everything
d /= 2; // right using integer math until
x >>>= 1; // we have exactly the desired bits.
}
return (n + x) / d; // Form the number within [0, 1).
}, shortseed, this == math);
};
//
// ARC4
//
// An ARC4 implementation. The constructor takes a key in the form of
// an array of at most (width) integers that should be 0 <= x < (width).
//
// The g(count) method returns a pseudorandom integer that concatenates
// the next (count) outputs from ARC4. Its return value is a number x
// that is in the range 0 <= x < (width ^ count).
//
/** @constructor */
function ARC4(key) {
var t, keylen = key.length,
me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];
// The empty key [] is treated as [0].
if (!keylen) { key = [keylen++]; }
// Set up S using the standard key scheduling algorithm.
while (i < width) {
s[i] = i++;
}
for (i = 0; i < width; i++) {
s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];
s[j] = t;
}
// The "g" method returns the next (count) outputs as one number.
(me.g = function(count) {
// Using instance members instead of closure state nearly doubles speed.
var t, r = 0,
i = me.i, j = me.j, s = me.S;
while (count--) {
t = s[i = mask & (i + 1)];
r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];
}
me.i = i; me.j = j;
return r;
// For robust unpredictability discard an initial batch of values.
// See http://www.rsa.com/rsalabs/node.asp?id=2009
})(width);
}
//
// flatten()
// Converts an object tree to nested arrays of strings.
//
function flatten(obj, depth) {
var result = [], typ = (typeof obj), prop;
if (depth && typ == 'object') {
for (prop in obj) {
try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}
}
}
return (result.length ? result : typ == 'string' ? obj : obj + '\0');
}
//
// mixkey()
// Mixes a string seed into a key that is an array of integers, and
// returns a shortened string seed that is equivalent to the result key.
//
function mixkey(seed, key) {
var stringseed = seed + '', smear, j = 0;
while (j < stringseed.length) {
key[mask & j] =
mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));
}
return tostring(key);
}
//
// autoseed()
// Returns an object for autoseeding, using window.crypto if available.
//
/** @param {Uint8Array|Navigator=} seed */
function autoseed(seed) {
try {
global.crypto.getRandomValues(seed = new Uint8Array(width));
return tostring(seed);
} catch (e) {
return [+new Date, global, (seed = global.navigator) && seed.plugins,
global.screen, tostring(pool)];
}
}
//
// tostring()
// Converts an array of charcodes to a string
//
function tostring(a) {
return String.fromCharCode.apply(0, a);
}
//
// When seedrandom.js is loaded, we immediately mix a few bits
// from the built-in RNG into the entropy pool. Because we do
// not want to intefere with determinstic PRNG state later,
// seedrandom will not call math.random on its own again after
// initialization.
//
mixkey(math[rngname](), pool);
//
// Nodejs and AMD support: export the implemenation as a module using
// either convention.
//
if (module && module.exports) {
module.exports = impl;
} else if (define && define.amd) {
define(function() { return impl; });
}
// End anonymous scope, and pass initial values.
})(
this, // global window object
[], // pool: entropy pool starts empty
Math, // math: package containing random, pow, and seedrandom
256, // width: each RC4 output is 0 <= x < 256
6, // chunks: at least six RC4 outputs for each double
52, // digits: there are 52 significant digits in a double
(typeof module) == 'object' && module, // present in node.js
(typeof define) == 'function' && define, // present with an AMD loader
'random'// rngname: name for Math.random and Math.seedrandom
);

File diff suppressed because it is too large Load Diff

6
gui/js/underscore-min.js vendored Normal file

File diff suppressed because one or more lines are too long

2
gui/js/wordlist.js Executable file

File diff suppressed because one or more lines are too long

View File

@ -27,25 +27,25 @@ const killmm = require('./killmm');
// SETTING APP ICON FOR LINUX AND WINDOWS
if (os.platform() === 'darwin') {
fixPath();
var marketmakerBin = path.join(__dirname, '../assets/bin/osx/marketmaker'),
marketmakerDir = `${process.env.HOME}/Library/Application Support/marketmaker`;
var dICOBin = path.join(__dirname, '../assets/bin/osx/marketmaker'),
dICODir = `${process.env.HOME}/Library/Application Support/dICOApp`;
}
if (os.platform() === 'linux') {
var marketmakerBin = path.join(__dirname, '../assets/bin/linux64/marketmaker'),
marketmakerDir = `${process.env.HOME}/.marketmaker`;
var dICOBin = path.join(__dirname, '../assets/bin/linux64/marketmaker'),
dICODir = `${process.env.HOME}/.dICOApp`;
}
if (os.platform() === 'win32') {
var marketmakerBin = path.join(__dirname, '../assets/bin/win64/marketmaker.exe');
marketmakerBin = path.normalize(marketmakerBin);
marketmakerDir = `${process.env.APPDATA}/marketmaker`;
marketmakerDir = path.normalize(marketmakerDir);
marketmakerIcon = path.join(__dirname, '/assets/icons/agama_icons/agama_app_icon.ico');
var dICOBin = path.join(__dirname, '../assets/bin/win64/marketmaker.exe');
dICOBin = path.normalize(dICOBin);
dICODir = `${process.env.APPDATA}/dICOApp`;
dICODir = path.normalize(dICODir);
dICOIcon = path.join(__dirname, '/assets/icons/agama_icons/agama_app_icon.ico');
}
// DEFAULT COINS LIST FOR MARKETMAKER
defaultCoinsListFile = path.join(__dirname, '../assets/coinslist.json');
defaultCoinsListFile = path.join(__dirname, '../assets/coins.json');
const {ipcMain} = require('electron');
@ -62,8 +62,8 @@ ipcMain.on('shepherd-command', (event, arg) => {
event.returnValue = 'pong'
break;
case 'login':
console.log(marketmakerBin);
console.log(marketmakerDir);
console.log(dICOBin);
console.log(dICODir);
//event.sender.send('shepherd-reply', 'Logged In');
event.returnValue = 'Logged In';
//const _passphrase = 'scatter quote stumble confirm extra jacket lens abuse gesture soda rebel seed nature achieve hurt shoot farm middle venture fault mesh crew upset cotton';
@ -83,6 +83,7 @@ ipcMain.on('shepherd-command', (event, arg) => {
}
})
StartMarketMaker = function(data) {
//console.log(data.passphrase);
try {
@ -90,7 +91,7 @@ StartMarketMaker = function(data) {
portscanner.checkPortStatus(7783, '127.0.0.1', function(error, status) {
// Status is 'open' if currently in use or 'closed' if available
if (status === 'closed') {
const _coinsListFile = marketmakerDir+'/coinslist.json'
const _coinsListFile = dICODir+'/coins.json'
fs.pathExists(_coinsListFile, (err, exists) => {
if (exists === true) {
@ -122,7 +123,7 @@ StartMarketMaker = function(data) {
}
}
let mmid;
ExecMarketMaker = function(data) {
//console.log(data);
// start marketmaker via exec
@ -148,18 +149,45 @@ ExecMarketMaker = function(data) {
const _customParam = {
'gui':'simplegui',
'client':1,
'profitmargin': 0.01,
'userhome':`${process.env.HOME}`,
'passphrase': data.passphrase,
'coins': data.coinslist
};
//console.log(JSON.stringify(_customParam))
//console.log(`exec ${dICOBin} ${JSON.stringify(_customParam)}`);
//console.log(`exec ${marketmakerBin} ${JSON.stringify(_customParam)}`);
let params = _customParam;
if (osPlatform !== 'win32') {
params = JSON.stringify(_customParam);
params = `'${params}'`;
} else {
dICOBin = '"'+dICOBin+'"';
params.userhome = process.env.APPDATA;
// console.log('[Decker] dICOBin = '+dICOBin+', dICODir = '+dICODir);
params = JSON.stringify(_customParam);
params = params.replace(/"/g, '\\"');
params = '"' + params +'"';
}
exec(`${marketmakerBin} '${JSON.stringify(_customParam)}'`, {
cwd: marketmakerDir,
maxBuffer: 1024 * 10000 // 10 mb
// console.log(`[Decker] exec ${dICOBin} ${params}`);
/*var out = fs.openSync(`${dICODir}/out.log`, 'a');
var err = fs.openSync(`${dICODir}/out.log`, 'a');
var cp = require('child_process');
console.log(params);
console.log(dICOBin);
var child = cp.spawn(dICOBin, [params], { detached: true, stdio: [ 'ignore', out, err ] });
child.unref();*/
var logStream = fs.createWriteStream(`${dICODir}/logFile.log`, {flags: 'a'});
console.log('mm start');
console.log(`${dICOBin} ${params}`)
mmid = exec(`${dICOBin} ${params}`, {
cwd: dICODir,
maxBuffer: 1024 * 50000 // 50 mb
}, function(error, stdout, stderr) {
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
@ -176,10 +204,12 @@ ExecMarketMaker = function(data) {
}*/
}
});
mmid.stdout.on('data', (data) => {
console.log(`child stdout:\n${data}`);
}).pipe(logStream);
mmid.stderr.on('data', (data) => {
console.error(`child stderr:\n${data}`);
}).pipe(logStream);
}

20
main.js
View File

@ -16,12 +16,11 @@ const electron = require('electron'),
var shepherd = require('./ipc/shepherd-ipc');
const killmm = require('./ipc/killmm');
const appBasicInfo = {
name: 'BarterDEX-Simple',
version: '0.5.0-beta'
version: '0.6.4-beta2'
};
app.setName(appBasicInfo.name);
@ -32,6 +31,16 @@ if (osPlatform === 'linux') {
// console.log(process.env);
}
var MNZdICOIcon;
if (os.platform() === 'linux') {
MNZdICOIcon = path.join(__dirname, '/assets/icons/monaize/128x128.png');
}
if (os.platform() === 'win32') {
MNZdICOIcon = path.join(__dirname, '/assets/icons/monaize/agama_app_icon.ico');
}
let closeAppAfterLoading = false;
// Keep a global reference of the window object, if you don't, the window will
@ -44,10 +53,10 @@ function createWindow (status) {
// initialise window
mainWindow = new BrowserWindow({ // dirty hack to prevent main window flash on quit
width: closeAppAfterLoading ? 1 : 1280,
height: closeAppAfterLoading ? 1 : 800
height: closeAppAfterLoading ? 1 : 800,
//titleBarStyle: 'customButtonsOnHover',
//frame: false
//icon: iguanaIcon
icon: MNZdICOIcon
});
const staticMenu = Menu.buildFromTemplate([ // if static
@ -95,7 +104,6 @@ function createWindow (status) {
mainWindow = null
killmm(true, true);
})
}
// This method will be called when Electron has finished
@ -108,7 +116,7 @@ app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
//if (process.platform !== 'darwin') {
killmm(true, true);
killmm(true, true);
//}
})

4
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "BarterDEX",
"version": "0.4.0",
"name": "BarterDEX-Simple",
"version": "0.6.4-beta2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,12 +1,12 @@
{
"name": "BarterDEX-Simple",
"version": "0.5.0",
"version": "0.6.4-beta2",
"description": "A simple BarterDEX Implimentation with powertools for Traders",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"repository": "https://github.com/SuperNETorg/dexuglygui",
"repository": "https://github.com/SuperNETorg/BarterDEX-Simple.git",
"keywords": [
"barterdex",
"jumblr",