added full carboncoin support

This commit is contained in:
OutCast3k 2016-09-11 18:40:18 +00:00
parent 3c1e957519
commit 21ecedaa48
3 changed files with 69 additions and 5 deletions

View file

@ -971,7 +971,7 @@
<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="carboncoin_mainnet" rel="0x2f;0xaf;0x05;0x488b21e;0x488ade4;false;false">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="bitcoin_testnet" rel="0x6f;0xef;0xc4;0x043587cf;0x04358394;false;false">Bitcoin (testnet)</option>
@ -1032,6 +1032,7 @@
<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="cryptoid.info_carboncoin"> Cryptoid.info (Carboncoin)</option>
<!-- <option value="blockr.io_bitcointestnet"> Blockr.io (Bitcoin testnet)</option> -->
</select>
</div>
@ -1048,6 +1049,7 @@
<option value="blockr.io_bitcoinmainnet"> Blockr.io (Bitcoin mainnet)</option>
<option value="chain.so_litecoin"> Chain.so (Litecoin)</option>
<option value="chain.so_dogecoin"> Chain.so (Dogecoin)</option>
<option value="cryptoid.info_carboncoin"> Cryptoid.info (Carboncoin)</option>
</select>
</div>
</div>

View file

@ -679,12 +679,16 @@ $(document).ready(function() {
$("#redeemFromBtn").html("Please wait, loading...").attr('disabled',true);
var host = $(this).attr('rel');
if(host=='blockr.io_bitcoinmainnet'){
listUnspentBlockrio_BitcoinMainnet(redeem);
} else if(host=='chain.so_litecoin'){
listUnspentChainso_Litecoin(redeem);
} else if(host=='chain.so_dogecoin'){
listUnspentChainso_Dogecoin(redeem);
} else if(host=='cryptoid.info_carboncoin'){
listUnspentCryptoidinfo_Carboncoin(redeem);
} else {
listUnspentDefault(redeem);
}
@ -872,6 +876,56 @@ $(document).ready(function() {
}
/* retrieve unspent data from chain.so for carboncoin */
function listUnspentCryptoidinfo_Carboncoin(redeem) {
$.ajax ({
type: "POST",
url: "https://coinb.in/api/",
data: 'uid='+coinjs.uid+'&key='+coinjs.key+'&setmodule=carboncoin&request=listunspent&address='+redeem.addr,
dataType: "xml",
error: function() {
$("#redeemFromStatus").removeClass('hidden').html('<span class="glyphicon glyphicon-exclamation-sign"></span> Unexpected error, unable to retrieve unspent outputs!');
},
success: function(data) {
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>');
$.each($(data).find("unspent").children(), function(i,o){
var tx = $(o).find("tx_hash").text();
var n = $(o).find("tx_output_n").text();
var script = (redeem.isMultisig==true) ? $("#redeemFrom").val() : o.script_hex;
var amount = (($(o).find("value").text()*1)/100000000).toFixed(8);
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();
}
});
/* $.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 */
function listUnspentChainso_Dogecoin(redeem){
$.ajax ({
@ -969,10 +1023,14 @@ $(document).ready(function() {
// broadcast transaction vai coinbin (default)
function rawSubmitDefault(btn){
var thisbtn = btn;
}
// broadcast transaction via cryptoid
function rawSubmitcryptoid_Carboncoin(thisbtn) {
$(thisbtn).val('Please wait, loading...').attr('disabled',true);
$.ajax ({
type: "POST",
url: coinjs.host+'?uid='+coinjs.uid+'&key='+coinjs.key+'&setmodule=bitcoin&request=sendrawtransaction',
url: coinjs.host+'?uid='+coinjs.uid+'&key='+coinjs.key+'&setmodule=carboncoin&request=sendrawtransaction',
data: {'rawtx':$("#rawTransaction").val()},
dataType: "xml",
error: function(data) {
@ -1612,6 +1670,10 @@ $(document).ready(function() {
$("#rawSubmitBtn").click(function(){
rawSubmitblockcypher_BitcoinMainnet(this);
});
} else if(host=="cryptoid.info_carboncoin"){
$("#rawSubmitBtn").click(function(){
rawSubmitcryptoid_Carboncoin(this);
});
} else {
$("#rawSubmitBtn").click(function(){
rawSubmitDefault(this); // revert to default

View file

@ -1,8 +1,8 @@
---- Version 1.2 2016.09.06 ----
---- Version 1.2 2016.09.11 ----
77e4519962e2f6a9fc93342137dbb31c33b76b04 ./js/aes.js
3a09a8fc0cfe828b57fc798d668234d0490ee1a6 ./js/bootstrap-datetimepicker.min.js
253711c6d825de55a8360552573be950da180614 ./js/bootstrap.min.js
4d5125c65432bfebfd1fa2d0dca0af1d037bc7e9 ./js/coinbin.js
b4389c2eed22172cbe762a44fa0081d1a7bb2da8 ./js/coinbin.js
b9af8c7b34429b0513972107d9b22b84e9d4fc8a ./js/coin.js
988565bc2cb402d63ed5c5fd7ff47c4278efc2c5 ./js/collapse.js
9ba5ede3d7f9d4c8fd623395f196adfdcf7e970f ./js/crypto-min.js
@ -30,4 +30,4 @@ de51a8494180a6db074af2dee2383f0a363c5b08 ./fonts/glyphicons-halflings-regular.s
278e49a86e634da6f2a02f3b47dd9d2a8f26210f ./fonts/glyphicons-halflings-regular.woff
44bc1850f570972267b169ae18f1cb06b611ffa2 ./fonts/glyphicons-halflings-regular.ttf
b4d3a33913a0877684909f7edf8b79bf9192b0a7 ./README.md
e4dd0465f6b4de21d0ac6f81deaa7872479ef705 ./index.html
e4f5289b5d3d626405bb071560e58d53622208b5 ./index.html