added blockcypher.com to list of broadcast providers

This commit is contained in:
OutCast3k 2016-03-21 13:34:19 +00:00
parent 1ea47f6ff5
commit 1e8773c195
3 changed files with 36 additions and 2 deletions

View file

@ -1006,6 +1006,7 @@
<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="blockcypher_bitcoinmainnet"> Blockcypher.com (Bitcoin mainnet)</option>
<option value="blockr.io_litecoin"> Blockr.io (Litecoin)</option>
<!-- <option value="blockr.io_bitcointestnet"> Blockr.io (Bitcoin testnet)</option> -->
</select>

View file

@ -966,6 +966,35 @@ $(document).ready(function() {
});
}
// broadcast transaction via blockcypher.com (mainnet)
function rawSubmitblockcypher_BitcoinMainnet(thisbtn){
$(thisbtn).val('Please wait, loading...').attr('disabled',true);
$.ajax ({
type: "POST",
url: "https://api.blockcypher.com/v1/btc/main/txs/push",
data: JSON.stringify({"tx":$("#rawTransaction").val()}),
error: function(data) {
var obj = $.parseJSON(data.responseText);
var r = ' ';
r += (obj.error) ? obj.error : '';
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) {
var obj = $.parseJSON(data.responseText);
if(obj.hash){
$("#rawTransactionStatus").addClass('alert-success').removeClass('alert-danger').removeClass("hidden").html(' Txid: '+obj.hash);
} 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 for litecoin
function rawSubmitBlockrio_litecoin(thisbtn){
$(thisbtn).val('Please wait, loading...').attr('disabled',true);
@ -1451,6 +1480,10 @@ $(document).ready(function() {
$("#rawSubmitBtn").click(function(){
rawSubmitChainso_BitcoinMainnet(this);
});
} else if(host=="blockcypher_bitcoinmainnet"){
$("#rawSubmitBtn").click(function(){
rawSubmitblockcypher_BitcoinMainnet(this);
});
} else {
$("#rawSubmitBtn").click(function(){
rawSubmitDefault(this); // revert to default

View file

@ -3,7 +3,7 @@
3a09a8fc0cfe828b57fc798d668234d0490ee1a6 ./js/bootstrap-datetimepicker.min.js
253711c6d825de55a8360552573be950da180614 ./js/bootstrap.min.js
ca3f654f247fef67de2cf6e01c3aa80db1812e5d ./js/coin.js
664ee79f35a73b754725c52c14257cc781a9ef50 ./js/coinbin.js
d109119cae40e0fb7d1c95d01069ce81d19b45ec ./coinbin.js
988565bc2cb402d63ed5c5fd7ff47c4278efc2c5 ./js/collapse.js
9ba5ede3d7f9d4c8fd623395f196adfdcf7e970f ./js/crypto-min.js
f7c09f2f5a721371e7d478050119f7e2d58e3ef9 ./js/crypto-sha256-hmac.js
@ -30,4 +30,4 @@ de51a8494180a6db074af2dee2383f0a363c5b08 ./fonts/glyphicons-halflings-regular.s
278e49a86e634da6f2a02f3b47dd9d2a8f26210f ./fonts/glyphicons-halflings-regular.woff
44bc1850f570972267b169ae18f1cb06b611ffa2 ./fonts/glyphicons-halflings-regular.ttf
48ff08f459ff55ae54e594b4ae307d1d8e6f74b3 ./README.md
000c945b6fae0e7450a9bad857094374eb4e2db2 ./index.html
05bc991db2105acda4333792582f5350012a0129 ./index.html