This repository has been archived by the owner on Oct 13, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
coin/burstcoin
- Loading branch information
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters