Author

Topic: Bittrex API for phpmpos (script pool) (Read 1314 times)

newbie
Activity: 16
Merit: 0
July 14, 2014, 08:19:31 AM
#1
In this post shows how to connect to the API Bitrex in phpmpos.

Open the file: include/classes/tools.class.php
Find:
Code:
else if (preg_match('/mintpal.com/', $url)) {
      return 'mintpal';
    }
   
   Behind paste this code:
   
 
Code:
  else if (preg_match('/bittrex.com/', $url)) {
      return 'bittrex';
    }

 Find:
 
Code:
case 'mintpal':
        return @$aData['0']['last_price'];
        break;

  Behind paste this code:
 
Code:
  case 'bittrex':
      $aData_2 = number_format($aData['result'][0]['Price'],8);
        return @$aData_2;
        break;
 
Save changes.        
          
Open the file: include/config/global.inc.php
 
Find:
Code:
$config['price']['enabled']

Set to true

The rest of the settings should look like this:

Code:
$config['price']['url'] = 'https://bittrex.com';
$config['price']['target'] = '/api/v1/public/getmarkethistory?market=BTC-SFR&count=1';
$config['price']['currency'] = 'BTC';


market=BTC-SFR ==> this parameter change on the coin you want to retrieve the data from the API Bittrex

Save the changes. From now on you have enabled the download of data from bittrex.
I hope that someone is useful.

Donation BTC: 1DsqeqapMoGAhPmNaiL5HqxnBYiFDR7coo
Jump to: