Skip to content

Commit

Permalink
updated backend links
Browse files Browse the repository at this point in the history
  • Loading branch information
adangert committed Jan 12, 2019
1 parent 4d9cdaf commit b915ad9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
29 changes: 16 additions & 13 deletions data/js/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@
// Check blockchain.info for the current balance
//https://bitcoincash.blockexplorer.com/api/addr/
//https://bch-insight.bitpay.com/api/addr/
util.get('https://bitcoincash.blockexplorer.com/api/addr/' + address + '?nocache=' + new Date().getTime()).then(function (response) {
//https://bitcoincash.blockexplorer.com/api/addr/
util.get('https://rest.bitcoin.com/v1/address/details/' + address + '?nocache=' + new Date().getTime()).then(function (response) {
var json = JSON.parse(response);
//bitpay, only balanceSat, blockdozer and blockexplorer use both

Expand Down Expand Up @@ -358,7 +359,8 @@
// Get all unspent outputs from blockchain.info to generate our inputs
//https://bch-insight.bitpay.com/api/addr/
//https://blockdozer.com/insight-api/addr/
util.getJSON('https://bitcoincash.blockexplorer.com/api/addr/' + address+'/utxo?nocache='+ new Date().getTime()).then(function (json) {
//?nocache='+ new Date().getTime()
util.getJSON('https://rest.bitcoin.com/v1/address/utxo/' + address).then(function (json) {
var inputs = json,
selectedOuts = [];
//eckey = new Bitcoin.ECKey(decryptedPrivateKey),
Expand Down Expand Up @@ -392,15 +394,15 @@
availableValue = availableValue.add(new bigInt('' + inputs[i].satoshis, 10));

// If we ever need to switch to the new address
var new_address = '';
if (inputs[i].address.indexOf("bitcoincash:") == -1){
new_address = 'bitcoincash:'+inputs[i].address;
}else{
new_address = inputs[i].address;
}

legacy_utxo_address = bch.Address.fromString(new_address,'livenet','pubkeyhash',bch.Address.CashAddrFormat).toString();

// var new_address = '';
// if (inputs[i].address.indexOf("bitcoincash:") == -1){
// new_address = 'bitcoincash:'+inputs[i].address;
// }else{
// new_address = inputs[i].address;
// }

// legacy_utxo_address = bch.Address.fromString(new_address,'livenet','pubkeyhash',bch.Address.CashAddrFormat).toString();
legacy_utxo_address = inputs[i].legacyAddress
//inputs[i].address

var utxo = {
Expand Down Expand Up @@ -517,14 +519,15 @@

}else {

var data = JSON.stringify({'rawtx': transaction.toString()});
//var data = JSON.stringify({'rawtx': transaction.toString()});
//var data = 'rawtx='+ transaction.toString();
//var insight = new explorer.Insight('https://bch-insight.bitpay.com');
console.log(transaction.toString());
console.log(data);
headers = {'Content-type': 'application/json'};
//https://blockdozer.com/insight-api/tx/send
util.postHeaders('https://bitcoincash.blockexplorer.com/api/tx/send', data, headers).then(function () {
//https://bitcoincash.blockexplorer.com/api/tx/send
util.post('https://rest.bitcoin.com/v1/rawtransactions/sendRawTransaction/'+transaction.toString(), headers).then(function () {
// Notify the balance listener of the changed amount immediately,
// but don't set the balance since the transaction will be processed by the websocket
//if (balanceListener) balanceListener(balance - amount - fee);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Telescope BitcoinCash WebWallet",
"author": "Aaron Angert",
"description": "A Bitcoin Cash wallet in the browser. Send and receive instantly on any web page.",
"version": "2.8",
"version": "2.9",

"icons": {
"16": "data/bitcoin16.png",
Expand Down

0 comments on commit b915ad9

Please sign in to comment.