2017 © Pedro Peláez
 

library exchanges

Definitions and implementations of exchanges in Openclerk

image

openclerk/exchanges

Definitions and implementations of exchanges in Openclerk

  • Monday, September 11, 2017
  • by soundasleep
  • Repository
  • 1 Watchers
  • 1 Stars
  • 137 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

openclerk/exchanges Build Status

A library for accessing live exchange market data for many different exchanges, used by Openclerk and live on CryptFolio., (*1)

This extends on the abstract currency definitions provided by openclerk/currencies., (*2)

Installing

Include openclerk/exchanges as a requirement in your project composer.json, and run composer update to install it into your project:, (*3)

{
  "require": {
    "openclerk/exchanges": "dev-master"
  }
}

Using

Get the markets supported by an exchanges:, (*4)

use \Monolog\Logger;

$logger = new Logger("log");

$exchange = new \Exchange\BTCe();
print_r($exchange->fetchMarkets($logger));

Get the current trade values for an exchange market, which will always include at least last_trade, and may include bid, ask, high, low, volume, avg and/or vwap:, (*5)

$exchange = new \Exchange\BitNZ();
print_r($exchange->fetchRates('nzd', 'btc', $logger));

Tests

Each exchange comes with a suite of tests to check each associated service., (*6)

composer install
vendor/bin/phpunit

To run the tests for a single exchange:, (*7)

vendor/bin/phpunit --bootstrap "vendor/autoload.php" test/CoinbaseTest

To get debug output for the tests (such as CURL requests and decoded output), add the --debug switch to your vendor/bin/phpunit command., (*8)

Donations are appreciated., (*9)

Contributing

Pull requests that contribute new exchanges are welcome., (*10)

For new currencies, make sure that you also provide an associated CurrencyTest so that the currency is automatically testable., (*11)

TODO

  1. Generate README list of currencies/services automatically
  2. Link to live APIs on CryptFolio
  3. CI build server and link to test results

The Versions

11/09 2017

dev-master

9999999-dev

Definitions and implementations of exchanges in Openclerk

  Sources   Download

The Requires

 

The Development Requires

11/09 2017

0.1.0

0.1.0.0

Definitions and implementations of exchanges in Openclerk

  Sources   Download

The Requires

 

The Development Requires