PHPackages                             openclerk/cryptocurrencies - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. openclerk/cryptocurrencies

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

openclerk/cryptocurrencies
==========================

Definitions and implementations of cryptocurrencies in Openclerk

0.1.2(8y ago)425043PHPPHP &gt;=5.4.6

Since Sep 11Pushed 8y ago4 watchersCompare

[ Source](https://github.com/openclerk/cryptocurrencies)[ Packagist](https://packagist.org/packages/openclerk/cryptocurrencies)[ RSS](/packages/openclerk-cryptocurrencies/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (4)Used By (3)

openclerk/cryptocurrencies
==========================

[](#openclerkcryptocurrencies)

A library for accessing balances, block counts and difficulties of common cryptocurrencies, used by [Openclerk](http://openclerk.org)and live on [CryptFolio](https://cryptfolio.com).

This extends on the abstract currency definitions provided by [openclerk/currencies](https://github.com/openclerk/currencies).

Installing
----------

[](#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.

- [Currencies supported](https://github.com/openclerk/cryptocurrencies/tree/master/src)
- [Services supported](https://github.com/openclerk/cryptocurrencies/tree/master/src/Services)

Using
-----

[](#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
-----

[](#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)

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](https://github.com/soundasleep/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
------

[](#donate)

[Donations are appreciated](https://code.google.com/p/openclerk/wiki/Donating).

Contributing
------------

[](#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
----

[](#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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3171d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ebbec5ccc867054461adebb7c5b6312f8256f989ef96b124892e6e89724afdb?d=identicon)[soundasleep](/maintainers/soundasleep)

---

Top Contributors

[![soundasleep](https://avatars.githubusercontent.com/u/3889656?v=4)](https://github.com/soundasleep "soundasleep (80 commits)")

### Embed Badge

![Health badge](/badges/openclerk-cryptocurrencies/health.svg)

```
[![Health](https://phpackages.com/badges/openclerk-cryptocurrencies/health.svg)](https://phpackages.com/packages/openclerk-cryptocurrencies)
```

###  Alternatives

[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M79](/packages/google-cloud-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
