Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions coin.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var CoinWidgetCom = {
}
, validate: function(config) {
var $accepted = [];
$accepted['currencies'] = ['bitcoin','litecoin'];
$accepted['currencies'] = ['bitcoin','litecoin','dash','ethereum'];
$accepted['counters'] = ['count','amount','hide'];
$accepted['alignment'] = ['al','ac','ar','bl','bc','br'];
if (!config.currency || !CoinWidgetCom.in_array(config.currency,$accepted['currencies']))
Expand Down Expand Up @@ -230,6 +230,7 @@ var CoinWidgetCom = {
}
$lrg.attr({
src: CoinWidgetCom.source +'qr/?address='+$config.wallet_address
// src: "https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl="+$config.currency+":"+$config.wallet_address
}).show();
}).bind('mouseleave',function(){
$lrg = $(this).parent().find('.COINWIDGETCOM_QRCODE_LARGE');
Expand Down Expand Up @@ -329,4 +330,4 @@ var CoinWidgetCom = {
CoinWidgetCom.init();
}
}
};
};
Binary file added icon_dash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon_ethereum.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions lookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
case 'litecoin':
$response = get_litecoin($address);
break;
case 'dash':
$response = get_dash($address);
break;
case 'ethereum':
$response = get_ethereum($address);
break;
}
$responses[$instance] = $response;
}
Expand Down Expand Up @@ -83,6 +89,32 @@ function get_litecoin($address) {
return $return;
}
}

function get_dash($address) {
$return = array();
$data = get_request('https://prohashing.com/explorerJson/getAddress?coin_id=42&address='.$address);
if (!empty($data)) {
$data = json_decode($data);
$return += array(
'count' => (int) $data->transactionCount,
'amount' => (float) $data->balance
);
return $return;
}
}

function get_ethereum($address) {
$return = array();
$data = get_request('https://api.ethplorer.io/getAddressInfo/'.$address.'?apiKey=freekey');
if (!empty($data)) {
$data = json_decode($data);
$return += array(
'count' => (int) $data->countTxs,
'amount' => (float) $data->ETH->balance
);
return $return;
}
}

function get_request($url,$timeout=4) {
if (function_exists('curl_version')) {
Expand All @@ -92,6 +124,7 @@ function get_request($url,$timeout=4) {
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$return = curl_exec($curl);
curl_close($curl);
return $return;
Expand Down