Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

coin/burstcoin

  • Loading branch information...
Stoyvo committed Mar 9, 2015
1 parent beb9044 commit 82e6e8b00aa0d9a0f3b836a8af4fdf48d25929bd
Binary file not shown.
@@ -11,14 +11,15 @@ class Wallets extends Config_Wallets {
protected $_currencies = array(
'bitcoin' => 'BTC',
'burstcoin' => 'BURST',
'darkcoin' => 'DRK',
'dogecoin' => 'DOGE',
'dogecoindark' => 'DOGED',
'litecoin' => 'LTC',
'neoscoin' => 'NEOS',
'paycoin' => 'XPY',
'reddcoin' => 'RDD',
// 'vertcoin' => 'VTC', // Disabled until blockchain works
// 'vertcoin' => 'VTC', // Disabled until blockchain explorer works
);
protected $_fiat = array(
@@ -0,0 +1,31 @@
<?php
require_once('abstract.php');
/*
* @author Stoyvo
*/
class Wallets_Burstcoin extends Wallets_Abstract {
public function __construct($label, $address) {
parent::__construct($label, $address);
$this->_apiURL = 'http://api.burstcoin.eu/account/balance';
$this->_fileHandler = new FileHandler('wallets/burstcoin/' . $this->_address . '.json');
}
public function update() {
if ($GLOBALS['cached'] == false || $this->_fileHandler->lastTimeModified() >= 3600) { // updates every 60 minutes. How much are you being paid out that this must change? We take donations :)
$data = curlCall($this->_apiURL, http_build_query(array('account' => $this->_address)));
$data = array (
'label' => $this->_label,
'address' => $this->_address,
'balance' => (float) $data['balanceNQT']/100000000
);
$this->_fileHandler->write(json_encode($data));
return $data;
}
return json_decode($this->_fileHandler->read(), true);
}
}
@@ -9,10 +9,15 @@ function curlCall($url, $params = null, $key = null, $sig = null) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSLVERSION, 4);
if (!is_null($params) && !is_null($key) && !is_null($sig)) {
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'key: '.$key, 'sig: '.$sig));
} else if (!is_null($params)) {
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
} else {
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
}

0 comments on commit 82e6e8b

Please sign in to comment.
You can’t perform that action at this time.