承接 openclerk/cryptocurrencies 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

openclerk/cryptocurrencies

最新稳定版本:0.1.2

Composer 安装命令:

composer require openclerk/cryptocurrencies

包简介

Definitions and implementations of cryptocurrencies in Openclerk

README 文档

README

A library for accessing balances, block counts and difficulties of common cryptocurrencies, used by Openclerk and live on CryptFolio.

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

Installing

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

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

PHP 5.4.6+ is required because some APIs require cURL 7.24+ due to the POODLE SSL bug.

Using

Get the balance for a certain address:

use \Monolog\Logger;

$logger = new Logger("log");

$currency = new \Cryptocurrencies\Dogecoin();
$balance = $currency->getBalance("D64vbPp9TvqQ67xc6we5GnEtcKqiTXfp1S", $logger);

Get the balance for a certain address with a number of confirmations:

$currency = new \Cryptocurrencies\Bitcoin();
$balance = $currency->getBalanceWithConfirmations("17eTMdqaFRSttfBYB9chKEzHubECZPTS6p", 6, $logger);

Get the current difficulty of a given cryptocurrency:

$currency = new \Cryptocurrencies\Litecoin();
$balance = $currency->getDifficulty($logger);

Check whether a given address is valid:

$currency = new \Cryptocurrencies\Bitcoin();
return $currency->isValid("17eTMdqaFRSttfBYB9chKEzHubECZPTS6p");

Tests

Each cryptocurrency comes with a suite of tests to check each associated service.

composer install
vendor/bin/phpunit

To run the tests for a single currency:

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

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

Assets

Assets for each cryptocurrency, for example icons associated with the currency and associated services, are provided in css/ and images/.

These can be included into your project with asset-discovery and mixins are provided, for example:

@each $code in $currency-codes {
  .currency_name.currency_#{$code}, .currency_name_#{$code} {
    padding-left: 20px;
    @include currency-label-background($code);
    background-position: 0 0;
    background-repeat: no-repeat;
    background-size: 16px 16px;
  }
}

Donate

Donations are appreciated.

Contributing

Pull requests that contribute new currencies, services or APIs 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. Provide 32x32 icons for each cryptocurrency
  3. Link to live APIs on CryptFolio
  4. CI build server and link to test results

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-12-29