Skip to content

Commit

Permalink
ui fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterlong committed May 3, 2018
1 parent 3700608 commit ef93b88
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<br><br>
<a href="https://travis-ci.org/coinapp-io/desktop"><img src="https://travis-ci.org/coinapp-io/desktop.svg?branch=master"></a>
</p>

````
# CoinApp - A Simple Cryptocurrency Wallet
A nifty crypto wallet application that lets you send and receive Ethereum, ERC20 Tokens, Bitcoin and Litecoin. CoinApp has a minimal UI for people who just want to move their coins, there's some advanced features for the knowledgable users too. <a href="https://github.com/hunterlong/coinapp/releases/latest">Download Latest</a> and try out this new opensource wallet. This application uses [insight-api](https://github.com/bitpay/insight-api) to fetch up-to-date balances and UTXO's rather than depending on a central server to collect transaction information. For Ethereum, this application uses a normal connect to geth JSON RPC server. You can use [infura.io](https://infura.io/) or connect to your local geth server. CoinApp lets the user modify their connections to fit their own decentralized server.
Expand Down
12 changes: 6 additions & 6 deletions js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ $(".about").html("CoinApp "+store.get('version'));
LoadSettings();

function LoadSettings() {
geth = store.get('geth');
btc = store.get('btc');
ltc = store.get('ltc');
var geth = store.get('geth');
var btc = store.get('btc');
var ltc = store.get('ltc');
$("#setting_geth_server").val(geth);
$("#setting_btc_server").val(btc);
$("#setting_ltc_server").val(ltc);
Expand All @@ -29,12 +29,12 @@ function SaveSettings() {
store.set('geth', gethurl);
store.set('btc', btcurl);
store.set('ltc', ltcurl);
geth = gethurl;
provider = new providers.JsonRpcProvider(gethurl);
configs.provider = new providers.JsonRpcProvider(gethurl);
$("#save_settings_btn").html("Saved");
CheckLTCServer();
CheckETHServer()
CheckETHServer();
CheckBTCServer();
ShowNotification("Settings Saved");
}


Expand Down
5 changes: 3 additions & 2 deletions js/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function RenderTransactions(txs, start, end) {
trueAmount = 0;
}

var txUrl = TransactionURL(out, out.symbol);
var txUrl = TransactionURL(out);

if (out.confirms == 0) {
var btn = "<button onclick=\"OpenURL('" + txUrl + "')\" type=\"button\" class=\"btn view_tx_btn float-left\">Pending</button>";
Expand Down Expand Up @@ -160,7 +160,8 @@ function FadeInTransactions() {


function AddPendingTransaction(hash, amount, coin, isRecieving=false) {
var txUrl = TransactionURL(hash, coin);
var obj = {id: hash, symbol: coin};
var txUrl = TransactionURL(obj);
var design = "row transaction_box_neg pendingFlash";
if (isRecieving) {
var design = "row transaction_box pendingFlash";
Expand Down
5 changes: 5 additions & 0 deletions js/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ function CryptoBalance(address) {
configs.bigBalance = bal;
configs.balance = parseInt(bal) * 0.00000001;

console.log("Balance is: "+configs.balance);

ltcBalance = parseInt(bal) * 0.00000001;
btcBalance = ltcBalance;

var pendingapi = configs.api + "/addr/" + address + "/unconfirmedBalance";
$.get(pendingapi, function (pendBal, status) {

if (pendBal==0) resolve(bal);

configs.pendingBalance = parseInt(pendBal) * 0.00000001;

pendBal = parseInt(pendBal) * 0.00000001;
Expand All @@ -37,6 +41,7 @@ function CryptoBalance(address) {
}

splits = configs.balance.toString().split(".");
if (!splits[1]) splits[1]="0";
$('#ethbal').html(splits[0] + ".<small>" + splits[1].substring(0, 4) + "</small>");

resolve(bal);
Expand Down
16 changes: 14 additions & 2 deletions js/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ function QueryTokenContract(address) {

});

});
}).catch(function (err) {
$("#new_token_decimals").prop('readonly', false);
$("#new_token_symbol").prop('readonly', false);
$("#new_token_address").removeClass("is-valid");
$("#new_token_address").addClass("is-invalid");
$("#new_token_alert").html("Token has no Symbol");
});;

}).catch(function (err) {
$("#new_token_decimals").prop('readonly', false);
Expand Down Expand Up @@ -309,7 +315,8 @@ function OpenMyEtherWallet() {
}

function OpenBlockchainTx(txid, coin) {
var url = TransactionURL(txid, coin);
var obj = {id: txid, symbol: coin};
var url = TransactionURL(obj);
shell.openExternal(url);
}

Expand Down Expand Up @@ -612,7 +619,9 @@ function UnlockPrivateKey() {

if (isBitcoin()) {
UnlockBTC().then(function (r) {
console.log(r);
UpdateBalance().then(function (balance) {
console.log(balance);
LoadBitcoinTransactions().then(function (tsx) {
LoadUTXOs(configs.address).then(function(utxos) {
configs.utxos = utxos;
Expand All @@ -621,6 +630,9 @@ function UnlockPrivateKey() {
RenderTransactions(configs.myTransactions, 0, 12);
// render trnsactions
});
}).catch(function (err) {
$("#unlock_priv_key").html("Unlock");
ShowNotification(err);
});
}).catch(function (err) {
$("#unlock_priv_key").html("Unlock");
Expand Down
5 changes: 2 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ var os = require('os');
const Store = require('electron-store');
const store = new Store();

var alreadySet = store.get('set');
store.set('version', app.getVersion());


//
// import Transport from "@ledgerhq/hw-transport-node-hid";
Expand Down Expand Up @@ -82,6 +79,8 @@ store.set('version', app.getVersion());
//


var alreadySet = store.get('set');
store.set('version', app.getVersion());

if (!alreadySet) {
store.set('set', true);
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 42 additions & 6 deletions test/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ return app.client.waitUntilWindowLoaded()
.should.eventually.equal("https://ltctest.coinapp.io/api")
.getValue("#setting_btc_server")
.should.eventually.equal("https://btctest.coinapp.io/api")
.click('#save_settings_btn')
.click('#save_settings_btn').pause(2000)
});
it('should load settings', () => {
return app.client.waitUntilWindowLoaded()
.click("#setup_panel-tab")
.click("#setup_panel-tab").pause(1000)
.getValue("#setting_geth_server")
.should.eventually.equal("http://localhost:8545")
.getValue("#setting_ltc_server")
Expand Down Expand Up @@ -89,31 +89,67 @@ it('should insert a ETH private key', () => {
.getValue("#privatepass")
.should.eventually.equal(ETH_PRIV)
.click("//select/option[@value=\'eth\']")
.click('#unlock_priv_key')
.click('#unlock_priv_key').pause(7000)
.getText(".myaddress")
.should.eventually.equal(correct_address)
});


it('should insert a BTC private key', () => {
it('should insert a ETH ROPSTEN private key', () => {
return app.client.waitUntilWindowLoaded()
.setValue('#privatepass', ETH_PRIV)
.getValue("#privatepass")
.should.eventually.equal(ETH_PRIV)
.click("//select/option[@value=\'ropsten\']")
.click('#unlock_priv_key').pause(7000)
.getText(".myaddress")
.should.eventually.equal(correct_address)
});


it('should insert a BTC TESTNET private key', () => {
return app.client.waitUntilWindowLoaded()
.setValue('#privatepass', "cVVGgzVgcc5S3owCskoneK8R1BNGkBveiEcGDaxu8RRDvFcaQaSG")
.getValue("#privatepass")
.should.eventually.equal("cVVGgzVgcc5S3owCskoneK8R1BNGkBveiEcGDaxu8RRDvFcaQaSG")
.click("//select/option[@value=\'btctest\']")
.click('#unlock_priv_key')
.click('#unlock_priv_key').pause(7000)
.getText(".myaddress")
.should.eventually.equal("mnJQyeDFmGjNoxyxKQC6MMFdpx77rYV3Bo")
});


it('should insert a BTC private key', () => {
return app.client.waitUntilWindowLoaded()
.setValue('#privatepass', "KzsR1xok4mGjbMXUY8wuYwx3z6nShsGPaxaXPTxH1YZ3csWyPNzz")
.getValue("#privatepass")
.should.eventually.equal("KzsR1xok4mGjbMXUY8wuYwx3z6nShsGPaxaXPTxH1YZ3csWyPNzz")
.click("//select/option[@value=\'btc\']")
.click('#unlock_priv_key').pause(7000)
.getText(".myaddress")
.should.eventually.equal("16JBSn4LBnpnEUoPhDcYnX7VeZizm4iFFj")
});


it('should insert a LTC private key', () => {
return app.client.waitUntilWindowLoaded()
.setValue('#privatepass', "T7JJQrvjiX8Xmd5k8XdwUdFCViy3jLGYSMgymbBMwoA9RESSx25k")
.getValue("#privatepass")
.should.eventually.equal("T7JJQrvjiX8Xmd5k8XdwUdFCViy3jLGYSMgymbBMwoA9RESSx25k")
.click("//select/option[@value=\'ltc\']")
.click('#unlock_priv_key').pause(7000)
.getText(".myaddress")
.should.eventually.equal("LLNWymPhGRHY5pPoMsqjAnjHz3jWqZuwJJ")
});


it('should insert a LTC TESTNET private key', () => {
return app.client.waitUntilWindowLoaded()
.setValue('#privatepass', "cVVGgzVgcc5S3owCskoneK8R1BNGkBveiEcGDaxu8RRDvFcaQaSG")
.getValue("#privatepass")
.should.eventually.equal("cVVGgzVgcc5S3owCskoneK8R1BNGkBveiEcGDaxu8RRDvFcaQaSG")
.click("//select/option[@value=\'ltctest\']")
.click('#unlock_priv_key')
.click('#unlock_priv_key').pause(7000)
.getText(".myaddress")
.should.eventually.equal("mnJQyeDFmGjNoxyxKQC6MMFdpx77rYV3Bo")
});
Expand Down

0 comments on commit ef93b88

Please sign in to comment.