openclerk/exchanges 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

openclerk/exchanges

最新稳定版本:0.1.0

Composer 安装命令:

composer require openclerk/exchanges

包简介

Definitions and implementations of exchanges in Openclerk

README 文档

README

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

This extends on the abstract currency definitions provided by openclerk/currencies.

Installing

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

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

Using

Get the markets supported by an exchanges:

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:

$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.

composer install
vendor/bin/phpunit

To run the tests for a single exchange:

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.

Donate

Donations are appreciated.

Contributing

Pull requests that contribute new exchanges are welcome.

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

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

统计信息

  • 总下载量: 169
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-01-21