elective-stereophonic
elective-stereophonic
MS coins on cryptocoincharts.info
singapore
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Stable Nxt Client: Nxt 1.12.2

Author Topic: MS coins on cryptocoincharts.info  (Read 1754 times)

xchrix

  • Guest
MS coins on cryptocoincharts.info
« on: February 06, 2015, 12:16:41 pm »

hello
i really want to have monetary system coins, trade history and orderbooks on www.cryptocoincharts.info
unfortunately i dont have free time left in the next weeks :( is anybody here able to help me with the integration?
i just need a simple cronjob which gives me
1. all available coins / tradingpairs
2. last x trades of each coin
3. bid/ask orders of each coin
in a php array. then its easy for me to get this data into my database and show the charts.
i think this will help ms coins and NXT as whole to get more attention. i will also pay a little bounty!
Logged

Tosch110

  • Hero Member
  • *****
  • Karma: +211/-18
  • Offline Offline
  • Posts: 2365
    • View Profile
Re: MS coins on cryptocoincharts.info
« Reply #1 on: February 06, 2015, 02:13:22 pm »

Hello xcrhix, this script should contain all the information you need:

Code: [Select]
<?php
//get all currencies
$allCoins file_get_contents('http://localhost:7876/nxt?requestType=getAllCurrencies');
$coinsObj json_decode($allCoins)->{'currencies'};

//Browse through all currencies
foreach($coinsObj as $coins) {


echo '<h1>Currency Details</h1>';
echo 'creationHeight: ' .$coins->{'creationHeight'} .'<br>';
echo 'issuanceHeight: ' .$coins->{'issuanceHeight'} .'<br>';
echo 'initialSupply: ' .$coins->{'initialSupply'} .'<br>';
echo 'minReservePerUnitNQT: ' .$coins->{'minReservePerUnitNQT'} .'<br>';
echo 'maxDifficulty: ' .$coins->{'maxDifficulty'} .'<br>';
echo 'code: ' .$coins->{'code'} .'<br>';
echo 'type: ' .$coins->{'type'} .'<br>';
echo 'currency: ' .$coins->{'currency'}.'<br>';
echo 'decimals: ' .$coins->{'decimals'} .'<br>';
echo 'numberOfExchanges: ' .$coins->{'numberOfExchanges'} .'<br>';
echo 'description: ' .$coins->{'description'} .'<br>';
echo 'accountRS: ' .$coins->{'accountRS'} .'<br>';
echo 'name: ' .$coins->{'name'} .'<br>';
echo 'currentSupply: ' .$coins->{'currentSupply'} .'<br>'//(add divided by: pow(decimals,10) )
echo 'Types: 'print_r($coins->{'types'}); echo '<br>';
echo 'accountRS: ' .$coins->{'accountRS'} .'<br>';

echo '<h2>Trades</h2>';

//get all trades of this currency
$allTrades file_get_contents('http://localhost:7876/nxt?requestType=getExchanges&currency='.$coins->{'currency'}); //you can add firstIndex= and lastIndex= 
$tradesObj json_decode($allTrades)->{'exchanges'};

//All information about trades
foreach ($tradesObj as $trades) {

echo 'issuanceHeight: '.$trades->{'issuanceHeight'}.'<br>';
echo 'issuerAccountRS: '.$trades->{'issuerAccountRS'}.'<br>';
echo 'buyerRS: '.$trades->{'buyerRS'}.'<br>';
echo 'transaction: '.$trades->{'transaction'}.'<br>';
echo 'rateNQT: '.$trades->{'rateNQT'}.'<br>';
echo 'sellerRS: '.$trades->{'sellerRS'}.'<br>';
echo 'block: '.$trades->{'block'}.'<br>';
echo 'code: '.$trades->{'code'}.'<br>';
echo 'offer: '.$trades->{'offer'}.'<br>';
echo 'type: '.$trades->{'type'}.'<br>';
echo 'units: '.$trades->{'units'}.'<br>';
echo 'currency: '.$trades->{'currency'}.'<br>';
echo 'decimals: '.$trades->{'decimals'}.'<br>';
echo 'timestamp: '.$trades->{'timestamp'}.'<br>';
echo 'height: '.$trades->{'height'}.'<br>';
echo 'name: '.$trades->{'name'}.'<br>';
echo '<hr>';
}


echo '<h2>Buy / Sell order</h2>';
$allBuyOffers file_get_contents('http://localhost:7876/nxt?requestType=getBuyOffers&currency='.$coins->{'currency'}); //you can add firstIndex= and lastIndex= 
$buyOfferObj json_decode($allBuyOffers)->{'offers'};

echo '<table><tr><td>';
echo '<h2>Buy Offers</h2>';

foreach ($buyOfferObj as $buyOffer) {

echo 'limit: '$buyOffer->{'limit'} .'<br>';
echo 'expirationHeight: '$buyOffer->{'expirationHeight'} .'<br>';
echo 'height: '$buyOffer->{'height'} .'<br>';
echo 'rateNQT: '$buyOffer->{'rateNQT'} .'<br>';
echo 'accountRS: '$buyOffer->{'accountRS'} .'<br>';
echo 'supply: '$buyOffer->{'supply'} .'<br>';
echo 'offer: '$buyOffer->{'offer'} .'<br>';
echo 'currency: '$buyOffer->{'currency'} .'<br>';
echo '<hr>';
}

echo '</td><td>';

$allSellOffers file_get_contents('http://localhost:7876/nxt?requestType=getSellOffers&currency='.$coins->{'currency'}); //you can add firstIndex= and lastIndex= 
$sellOfferObj json_decode($allSellOffers)->{'offers'};

echo '<h2>Sell Offers</h2>';

foreach ($sellOfferObj as $sellOffer) {

echo 'limit: '$sellOffer->{'limit'} .'<br>';
echo 'expirationHeight: '$sellOffer->{'expirationHeight'} .'<br>';
echo 'height: '$sellOffer->{'height'} .'<br>';
echo 'rateNQT: '$sellOffer->{'rateNQT'} .'<br>';
echo 'accountRS: '$sellOffer->{'accountRS'} .'<br>';
echo 'supply: '$sellOffer->{'supply'} .'<br>';
echo 'offer: '$sellOffer->{'offer'} .'<br>';
echo 'currency: '$sellOffer->{'currency'} .'<br>';
echo '<hr>';
}
echo '</td></tr></table>';
echo '<hr>';
echo '<hr>';

}

?>


cr7yp

  • Full Member
  • ***
  • Karma: +14/-5
  • Offline Offline
  • Posts: 219
    • View Profile
Re: MS coins on cryptocoincharts.info
« Reply #2 on: February 07, 2015, 11:39:15 am »

Thanks Tosch! Your script saved me some time.
Logged

xchrix

  • Guest
Re: MS coins on cryptocoincharts.info
« Reply #3 on: February 07, 2015, 03:59:03 pm »

thx tosch, point me to the right direction!
the first cronjob is already running and i am importing all the currencies now... looks like it will take ages :(

http://www.cryptocoincharts.info/markets/show/nxt-ms
Logged

Tosch110

  • Hero Member
  • *****
  • Karma: +211/-18
  • Offline Offline
  • Posts: 2365
    • View Profile
Re: MS coins on cryptocoincharts.info
« Reply #4 on: February 07, 2015, 04:01:39 pm »

thx tosch, point me to the right direction!
the first cronjob is already running and i am importing all the currencies now... looks like it will take ages :(

http://www.cryptocoincharts.info/markets/show/nxt-ms

What is taking ages?

xchrix

  • Guest
Re: MS coins on cryptocoincharts.info
« Reply #5 on: February 07, 2015, 04:13:43 pm »

imorting all the currencies and trades
i am using nodes with open APIs on the web. and every call is needing some time. thousands of coins to check if there were trades.
also my database is very slow. i guess i have to redesign it a little bit. i just started with 3 character coinnames some years ago (ltc, btc, ppc, nmc...) and unfortunately based alot data on the name varchar(3)  8) very bad decision
Logged
 

elective-stereophonic
elective-stereophonic
assembly
assembly