removed blockr.io links as its closed down
This commit is contained in:
parent
6c480a1102
commit
2e0422656d
2 changed files with 14 additions and 133 deletions
|
@ -1064,7 +1064,6 @@
|
||||||
<p class="text-muted">Select which network you'd like to use for key pair generation.</p>
|
<p class="text-muted">Select which network you'd like to use for key pair generation.</p>
|
||||||
<select class="form-control" id="coinjs_coin">
|
<select class="form-control" id="coinjs_coin">
|
||||||
<option value="bitcoin_mainnet" rel="0x00;0x80;0x05;0x488b21e;0x488ade4;coinb.in;coinb.in">Bitcoin (mainnet)</option>
|
<option value="bitcoin_mainnet" rel="0x00;0x80;0x05;0x488b21e;0x488ade4;coinb.in;coinb.in">Bitcoin (mainnet)</option>
|
||||||
<option value="litecoin_mainnet" rel="0x30;0xb0;0x05;0x019da462;0x019d9cfe;blockr.io_litecoin;chain.so_litecoin">Litecoin (mainnet)</option>
|
|
||||||
<option value="dogecoin_mainnet" rel="0x1e;0x9e;0x16;0x0827421e;0x089944e4;chain.so_dogecoin;chain.so_dogecoin">Dogecoin (mainnet)</option>
|
<option value="dogecoin_mainnet" rel="0x1e;0x9e;0x16;0x0827421e;0x089944e4;chain.so_dogecoin;chain.so_dogecoin">Dogecoin (mainnet)</option>
|
||||||
<option value="carboncoin_mainnet" rel="0x2f;0xaf;0x05;0x488b21e;0x488ade4;cryptoid.info_carboncoin;cryptoid.info_carboncoin">Carboncoin (mainnet)</option>
|
<option value="carboncoin_mainnet" rel="0x2f;0xaf;0x05;0x488b21e;0x488ade4;cryptoid.info_carboncoin;cryptoid.info_carboncoin">Carboncoin (mainnet)</option>
|
||||||
<option value="shadowcash_mainnet" rel="0x3f;0xbf;0x7d;0xee80286a;0xee8031e8;false;false">ShadowCash (mainnet)</option>
|
<option value="shadowcash_mainnet" rel="0x3f;0xbf;0x7d;0xee80286a;0xee8031e8;false;false">ShadowCash (mainnet)</option>
|
||||||
|
@ -1122,13 +1121,10 @@
|
||||||
<p class="text-muted">Select the network you wish to broadcast the transaction via</p>
|
<p class="text-muted">Select the network you wish to broadcast the transaction via</p>
|
||||||
<select class="form-control" id="coinjs_broadcast">
|
<select class="form-control" id="coinjs_broadcast">
|
||||||
<option value="coinb.in">coinb.in (Bitcoin mainnet)</option>
|
<option value="coinb.in">coinb.in (Bitcoin mainnet)</option>
|
||||||
<option value="blockr.io_bitcoinmainnet"> Blockr.io (Bitcoin mainnet)</option>
|
|
||||||
<option value="chain.so_bitcoinmainnet"> Chain.so (Bitcoin mainnet)</option>
|
<option value="chain.so_bitcoinmainnet"> Chain.so (Bitcoin mainnet)</option>
|
||||||
<option value="blockcypher_bitcoinmainnet"> Blockcypher.com (Bitcoin mainnet)</option>
|
<option value="blockcypher_bitcoinmainnet"> Blockcypher.com (Bitcoin mainnet)</option>
|
||||||
<option value="blockr.io_litecoin"> Blockr.io (Litecoin)</option>
|
|
||||||
<option value="chain.so_dogecoin"> Chain.so (Dogecoin)</option>
|
<option value="chain.so_dogecoin"> Chain.so (Dogecoin)</option>
|
||||||
<option value="cryptoid.info_carboncoin"> Cryptoid.info (Carboncoin)</option>
|
<option value="cryptoid.info_carboncoin"> Cryptoid.info (Carboncoin)</option>
|
||||||
<!-- <option value="blockr.io_bitcointestnet"> Blockr.io (Bitcoin testnet)</option> -->
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1141,7 +1137,6 @@
|
||||||
<p class="text-muted">Select the network you wish to retreive your unspent inputs from</p>
|
<p class="text-muted">Select the network you wish to retreive your unspent inputs from</p>
|
||||||
<select class="form-control" id="coinjs_utxo">
|
<select class="form-control" id="coinjs_utxo">
|
||||||
<option value="coinb.in">coinb.in (Bitcoin mainnet)</option>
|
<option value="coinb.in">coinb.in (Bitcoin mainnet)</option>
|
||||||
<option value="blockr.io_bitcoinmainnet"> Blockr.io (Bitcoin mainnet)</option>
|
|
||||||
<option value="chain.so_litecoin"> Chain.so (Litecoin)</option>
|
<option value="chain.so_litecoin"> Chain.so (Litecoin)</option>
|
||||||
<option value="chain.so_dogecoin"> Chain.so (Dogecoin)</option>
|
<option value="chain.so_dogecoin"> Chain.so (Dogecoin)</option>
|
||||||
<option value="cryptoid.info_carboncoin"> Cryptoid.info (Carboncoin)</option>
|
<option value="cryptoid.info_carboncoin"> Cryptoid.info (Carboncoin)</option>
|
||||||
|
|
142
js/coinbin.js
142
js/coinbin.js
|
@ -2,6 +2,10 @@ $(document).ready(function() {
|
||||||
|
|
||||||
/* open wallet code */
|
/* open wallet code */
|
||||||
|
|
||||||
|
var explorer_tx = "https://coinb.in/tx/"
|
||||||
|
var explorer_addr = "https://coinb.in/addr/"
|
||||||
|
var explorer_block = "https://coinb.in/block/"
|
||||||
|
|
||||||
$("#openBtn").click(function(){
|
$("#openBtn").click(function(){
|
||||||
var email = $("#openEmail").val().toLowerCase();
|
var email = $("#openEmail").val().toLowerCase();
|
||||||
if(email.match(/[\s\w\d]+@[\s\w\d]+/g)){
|
if(email.match(/[\s\w\d]+@[\s\w\d]+/g)){
|
||||||
|
@ -26,7 +30,7 @@ $(document).ready(function() {
|
||||||
var keys = coinjs.newKeys(s);
|
var keys = coinjs.newKeys(s);
|
||||||
|
|
||||||
$("#walletAddress").html(keys.address);
|
$("#walletAddress").html(keys.address);
|
||||||
$("#walletHistory").attr('href','https://btc.blockr.io/address/info/'+keys.address);
|
$("#walletHistory").attr('href',explorer_addr+keys.address);
|
||||||
|
|
||||||
$("#walletQrCode").html("");
|
$("#walletQrCode").html("");
|
||||||
var qrcode = new QRCode("walletQrCode");
|
var qrcode = new QRCode("walletQrCode");
|
||||||
|
@ -63,7 +67,7 @@ $(document).ready(function() {
|
||||||
$("#openWallet").addClass("hidden").show();
|
$("#openWallet").addClass("hidden").show();
|
||||||
|
|
||||||
$("#walletAddress").html("");
|
$("#walletAddress").html("");
|
||||||
$("#walletHistory").attr('href','https://btc.blockr.io/address/info/');
|
$("#walletHistory").attr('href',explorer_addr);
|
||||||
|
|
||||||
$("#walletQrCode").html("");
|
$("#walletQrCode").html("");
|
||||||
var qrcode = new QRCode("walletQrCode");
|
var qrcode = new QRCode("walletQrCode");
|
||||||
|
@ -729,9 +733,7 @@ $(document).ready(function() {
|
||||||
var host = $(this).attr('rel');
|
var host = $(this).attr('rel');
|
||||||
|
|
||||||
|
|
||||||
if(host=='blockr.io_bitcoinmainnet'){
|
if(host=='chain.so_litecoin'){
|
||||||
listUnspentBlockrio_BitcoinMainnet(redeem);
|
|
||||||
} else if(host=='chain.so_litecoin'){
|
|
||||||
listUnspentChainso_Litecoin(redeem);
|
listUnspentChainso_Litecoin(redeem);
|
||||||
} else if(host=='chain.so_dogecoin'){
|
} else if(host=='chain.so_dogecoin'){
|
||||||
listUnspentChainso_Dogecoin(redeem);
|
listUnspentChainso_Dogecoin(redeem);
|
||||||
|
@ -851,7 +853,7 @@ $(document).ready(function() {
|
||||||
var tx = coinjs.transaction();
|
var tx = coinjs.transaction();
|
||||||
tx.listUnspent(redeem.addr, function(data){
|
tx.listUnspent(redeem.addr, function(data){
|
||||||
if(redeem.addr) {
|
if(redeem.addr) {
|
||||||
$("#redeemFromAddress").removeClass('hidden').html('<span class="glyphicon glyphicon-info-sign"></span> Retrieved unspent inputs from address <a href="https://btc.blockr.io/address/info/'+redeem.addr+'" target="_blank">'+redeem.addr+'</a>');
|
$("#redeemFromAddress").removeClass('hidden').html('<span class="glyphicon glyphicon-info-sign"></span> Retrieved unspent inputs from address <a href="'+explorer_addr+redeem.addr+'" target="_blank">'+redeem.addr+'</a>');
|
||||||
|
|
||||||
$.each($(data).find("unspent").children(), function(i,o){
|
$.each($(data).find("unspent").children(), function(i,o){
|
||||||
var tx = $(o).find("tx_hash").text();
|
var tx = $(o).find("tx_hash").text();
|
||||||
|
@ -870,38 +872,8 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* retrieve unspent data from blockrio for mainnet */
|
|
||||||
function listUnspentBlockrio_BitcoinMainnet(redeem){
|
|
||||||
$.ajax ({
|
|
||||||
type: "POST",
|
|
||||||
url: "https://btc.blockr.io/api/v1/address/unspent/"+redeem.addr+"?unconfirmed=1",
|
|
||||||
dataType: "json",
|
|
||||||
error: function(data) {
|
|
||||||
$("#redeemFromStatus").removeClass('hidden').html('<span class="glyphicon glyphicon-exclamation-sign"></span> Unexpected error, unable to retrieve unspent outputs!');
|
|
||||||
},
|
|
||||||
success: function(data) {
|
|
||||||
if((data.status && data.data) && data.status=='success'){
|
|
||||||
$("#redeemFromAddress").removeClass('hidden').html('<span class="glyphicon glyphicon-info-sign"></span> Retrieved unspent inputs from address <a href="https://btc.blockr.io/address/info/'+redeem.addr+'" target="_blank">'+redeem.addr+'</a>');
|
|
||||||
for(var i in data.data.unspent){
|
|
||||||
var o = data.data.unspent[i];
|
|
||||||
var tx = o.tx;
|
|
||||||
var n = o.n;
|
|
||||||
var script = (redeem.isMultisig==true) ? $("#redeemFrom").val() : o.script;
|
|
||||||
var amount = o.amount;
|
|
||||||
addOutput(tx, n, script, amount);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$("#redeemFromStatus").removeClass('hidden').html('<span class="glyphicon glyphicon-exclamation-sign"></span> Unexpected error, unable to retrieve unspent outputs.');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
complete: function(data, status) {
|
|
||||||
$("#redeemFromBtn").html("Load").attr('disabled',false);
|
|
||||||
totalInputAmount();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/* retrieve unspent data from blockrio for litecoin */
|
/* retrieve unspent data from chainso for litecoin */
|
||||||
function listUnspentChainso_Litecoin(redeem){
|
function listUnspentChainso_Litecoin(redeem){
|
||||||
$.ajax ({
|
$.ajax ({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
|
@ -912,7 +884,7 @@ $(document).ready(function() {
|
||||||
},
|
},
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if((data.status && data.data) && data.status=='success'){
|
if((data.status && data.data) && data.status=='success'){
|
||||||
$("#redeemFromAddress").removeClass('hidden').html('<span class="glyphicon glyphicon-info-sign"></span> Retrieved unspent inputs from address <a href="https://btc.blockr.io/address/info/'+redeem.addr+'" target="_blank">'+redeem.addr+'</a>');
|
$("#redeemFromAddress").removeClass('hidden').html('<span class="glyphicon glyphicon-info-sign"></span> Retrieved unspent inputs from address <a href="'+explorer_addr+redeem.addr+'" target="_blank">'+redeem.addr+'</a>');
|
||||||
for(var i in data.data.txs){
|
for(var i in data.data.txs){
|
||||||
var o = data.data.txs[i];
|
var o = data.data.txs[i];
|
||||||
var tx = ((o.txid).match(/.{1,2}/g).reverse()).join("")+'';
|
var tx = ((o.txid).match(/.{1,2}/g).reverse()).join("")+'';
|
||||||
|
@ -946,7 +918,7 @@ $(document).ready(function() {
|
||||||
},
|
},
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if($(data).find("result").text()==1){
|
if($(data).find("result").text()==1){
|
||||||
$("#redeemFromAddress").removeClass('hidden').html('<span class="glyphicon glyphicon-info-sign"></span> Retrieved unspent inputs from address <a href="https://btc.blockr.io/address/info/'+redeem.addr+'" target="_blank">'+redeem.addr+'</a>');
|
$("#redeemFromAddress").removeClass('hidden').html('<span class="glyphicon glyphicon-info-sign"></span> Retrieved unspent inputs from address <a href="'+explorer_addr+redeem.addr+'" target="_blank">'+redeem.addr+'</a>');
|
||||||
$.each($(data).find("unspent").children(), function(i,o){
|
$.each($(data).find("unspent").children(), function(i,o){
|
||||||
var tx = $(o).find("tx_hash").text();
|
var tx = $(o).find("tx_hash").text();
|
||||||
var n = $(o).find("tx_output_n").text();
|
var n = $(o).find("tx_output_n").text();
|
||||||
|
@ -964,23 +936,6 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/* $.ajax ({
|
|
||||||
type: "POST",
|
|
||||||
url: 'https://coinb.in/api/',
|
|
||||||
dataType: 'xml',
|
|
||||||
error: function(data) {
|
|
||||||
},
|
|
||||||
success: function(data) {
|
|
||||||
},
|
|
||||||
complete: function(data, status) {
|
|
||||||
$("#redeemFromBtn").html("Load").attr('disabled',false);
|
|
||||||
totalInputAmount();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* retrieve unspent data from chain.so for dogecoin */
|
/* retrieve unspent data from chain.so for dogecoin */
|
||||||
|
@ -995,8 +950,7 @@ $(document).ready(function() {
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if((data.status && data.data) && data.status=='success'){
|
if((data.status && data.data) && data.status=='success'){
|
||||||
$("#redeemFromAddress").removeClass('hidden').html(
|
$("#redeemFromAddress").removeClass('hidden').html(
|
||||||
'<span class="glyphicon glyphicon-info-sign"></span> Retrieved unspent inputs from address <a href="https://btc.blockr.io/address/info/'+
|
'<span class="glyphicon glyphicon-info-sign"></span> Retrieved unspent inputs from address <a href="'+explorer_addr+redeem.addr+'" target="_blank">'+redeem.addr+'</a>');
|
||||||
redeem.addr+'" target="_blank">'+redeem.addr+'</a>');
|
|
||||||
for(var i in data.data.txs){
|
for(var i in data.data.txs){
|
||||||
var o = data.data.txs[i];
|
var o = data.data.txs[i];
|
||||||
var tx = ((""+o.txid).match(/.{1,2}/g).reverse()).join("")+'';
|
var tx = ((""+o.txid).match(/.{1,2}/g).reverse()).join("")+'';
|
||||||
|
@ -1132,37 +1086,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// broadcast transaction via blockr.io (mainnet)
|
// broadcast transaction via chain.so (mainnet)
|
||||||
function rawSubmitBlockrio_BitcoinMainnet(thisbtn){
|
|
||||||
$(thisbtn).val('Please wait, loading...').attr('disabled',true);
|
|
||||||
$.ajax ({
|
|
||||||
type: "POST",
|
|
||||||
url: "https://btc.blockr.io/api/v1/tx/push",
|
|
||||||
data: {"hex":$("#rawTransaction").val()},
|
|
||||||
dataType: "json",
|
|
||||||
error: function(data) {
|
|
||||||
var obj = $.parseJSON(data.responseText);
|
|
||||||
var r = ' ';
|
|
||||||
r += (obj.data) ? obj.data : '';
|
|
||||||
r += (obj.message) ? ' '+obj.message : '';
|
|
||||||
r = (r!='') ? r : ' Failed to broadcast'; // build response
|
|
||||||
$("#rawTransactionStatus").addClass('alert-danger').removeClass('alert-success').removeClass("hidden").html(r).prepend('<span class="glyphicon glyphicon-exclamation-sign"></span>');
|
|
||||||
},
|
|
||||||
success: function(data) {
|
|
||||||
if((data.status && data.data) && data.status=='success'){
|
|
||||||
$("#rawTransactionStatus").addClass('alert-success').removeClass('alert-danger').removeClass("hidden").html(' Txid: '+data.data);
|
|
||||||
} else {
|
|
||||||
$("#rawTransactionStatus").addClass('alert-danger').removeClass('alert-success').removeClass("hidden").html(' Unexpected error, please try again').prepend('<span class="glyphicon glyphicon-exclamation-sign"></span>');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
complete: function(data, status) {
|
|
||||||
$("#rawTransactionStatus").fadeOut().fadeIn();
|
|
||||||
$(thisbtn).val('Submit').attr('disabled',false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// broadcast transaction via blockr.io (mainnet)
|
|
||||||
function rawSubmitChainso_BitcoinMainnet(thisbtn){
|
function rawSubmitChainso_BitcoinMainnet(thisbtn){
|
||||||
$(thisbtn).val('Please wait, loading...').attr('disabled',true);
|
$(thisbtn).val('Please wait, loading...').attr('disabled',true);
|
||||||
$.ajax ({
|
$.ajax ({
|
||||||
|
@ -1219,36 +1143,6 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// broadcast transaction via blockr.io for litecoin
|
|
||||||
function rawSubmitBlockrio_litecoin(thisbtn){
|
|
||||||
$(thisbtn).val('Please wait, loading...').attr('disabled',true);
|
|
||||||
$.ajax ({
|
|
||||||
type: "POST",
|
|
||||||
url: "https://ltc.blockr.io/api/v1/tx/push",
|
|
||||||
data: {"hex":$("#rawTransaction").val()},
|
|
||||||
dataType: "json",
|
|
||||||
error: function(data) {
|
|
||||||
var obj = $.parseJSON(data.responseText);
|
|
||||||
var r = ' ';
|
|
||||||
r += (obj.data) ? obj.data : '';
|
|
||||||
r += (obj.message) ? ' '+obj.message : '';
|
|
||||||
r = (r!='') ? r : ' Failed to broadcast'; // build response
|
|
||||||
$("#rawTransactionStatus").addClass('alert-danger').removeClass('alert-success').removeClass("hidden").html(r).prepend('<span class="glyphicon glyphicon-exclamation-sign"></span>');
|
|
||||||
},
|
|
||||||
success: function(data) {
|
|
||||||
if((data.status && data.data) && data.status=='success'){
|
|
||||||
$("#rawTransactionStatus").addClass('alert-success').removeClass('alert-danger').removeClass("hidden").html(' Txid: '+data.data);
|
|
||||||
} else {
|
|
||||||
$("#rawTransactionStatus").addClass('alert-danger').removeClass('alert-success').removeClass("hidden").html(' Unexpected error, please try again').prepend('<span class="glyphicon glyphicon-exclamation-sign"></span>');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
complete: function(data, status) {
|
|
||||||
$("#rawTransactionStatus").fadeOut().fadeIn();
|
|
||||||
$(thisbtn).val('Submit').attr('disabled',false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// broadcast transaction via chain.so for dogecoin
|
// broadcast transaction via chain.so for dogecoin
|
||||||
function rawSubmitchainso_dogecoin(thisbtn){
|
function rawSubmitchainso_dogecoin(thisbtn){
|
||||||
|
@ -1756,15 +1650,7 @@ $(document).ready(function() {
|
||||||
function configureBroadcast(){
|
function configureBroadcast(){
|
||||||
var host = $("#coinjs_broadcast option:selected").val();
|
var host = $("#coinjs_broadcast option:selected").val();
|
||||||
$("#rawSubmitBtn").unbind("");
|
$("#rawSubmitBtn").unbind("");
|
||||||
if(host=="blockr.io_litecoin"){
|
if(host=="chain.so_bitcoinmainnet"){
|
||||||
$("#rawSubmitBtn").click(function(){
|
|
||||||
rawSubmitBlockrio_litecoin(this)
|
|
||||||
});
|
|
||||||
} else if(host=="blockr.io_bitcoinmainnet"){
|
|
||||||
$("#rawSubmitBtn").click(function(){
|
|
||||||
rawSubmitBlockrio_BitcoinMainnet(this);
|
|
||||||
});
|
|
||||||
} else if(host=="chain.so_bitcoinmainnet"){
|
|
||||||
$("#rawSubmitBtn").click(function(){
|
$("#rawSubmitBtn").click(function(){
|
||||||
rawSubmitChainso_BitcoinMainnet(this);
|
rawSubmitChainso_BitcoinMainnet(this);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue