PHPackages                             olakunlevpn/bitcoin\_ng - 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. olakunlevpn/bitcoin\_ng

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

olakunlevpn/bitcoin\_ng
=======================

A lightweight bitcoin to Nigerian (NGN) converter and vice versa based on current exchange rates from your chosen provider: Coinbase, Coindesk, Bitpay and etc.

0.012(6y ago)04MITPHPPHP &gt;=7.0CI failing

Since Nov 15Pushed 6y agoCompare

[ Source](https://github.com/olakunlevpn/bitcoin_ng)[ Packagist](https://packagist.org/packages/olakunlevpn/bitcoin_ng)[ RSS](/packages/olakunlevpn-bitcoin-ng/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Bitcoin Naira Currency Converter
================================

[](#bitcoin-naira-currency-converter)

Simple bitcoin converter from Nigerian (NGN) currency to bitcoin and also support USD to bitcoin conversion only.

Features
--------

[](#features)

It is simple, lightweight, extensible, framework agnostic and fast.

- You can convert Bitcoin to any currency Naira (NGN) and USD only
- You can convert Nigerian (NGN) currency (ISO 4217 fiat or another cryptocurrency) to Bitcoin
- It supports different exchange rates providers: Coinbase, Coindesk, Bitpay
- It has baked-in caching (PSR16 compliant, swappable with your own or your framework's)

Install
-------

[](#install)

Lets begin by installing the library by Composer:

```
$ composer require olakunlevpn/bitcoin_ng
```

Usage
-----

[](#usage)

#### You can then convert Bitcoin to any currency (ISO 4217 fiat or crypto) by:

[](#you-can-then-convert-bitcoin-to-any-currency-iso-4217-fiat-or-crypto-by)

```
use olakunlevpn\BitcoinNairaConverter\Converter;

$convert = new Converter;              // uses Coinbase as default provider
echo $convert->toCurrency('NGN', 0.5); // 2,250,50.00
echo $convert->toCurrency('LTC', 0.5); // 10.12345678
```

or you can use the helper function for convenience:

```
// uses Coinbase as default provider
echo to_currency('NGN', 0.5); // 2,250,50.00
echo to_currency('LTC', 0.5); // 10.12345678
```

#### You can also convert any currency (ISO 4217 fiat or crypto) to Bitcoin:

[](#you-can-also-convert-any-currency-iso-4217-fiat-or-crypto-to-bitcoin)

```
use olakunlevpn\BitcoinNairaConverter\Converter;

$convert = new Converter;         // uses Coinbase as default provider
echo $convert->toBtc(10000, 'NGN'); // 0.0036664
echo $convert->toBtc(20, 'LTC');  // 1.12345678
```

and it also has its helper function for convenience:

```
// uses Coinbase as default provider
echo to_btc(10000, 'NGN'); // 0.0036664
echo to_btc(20, 'LTC');  // 2.12345678
```

#### You can use different exchange rates from providers:

[](#you-can-use-different-exchange-rates-from-providers)

```
use olakunlevpn\BitcoinNairaConverter\Converter;
use olakunlevpn\BitcoinNairaConverter\Provider\CoinbaseProvider;
use olakunlevpn\BitcoinNairaConverter\Provider\CoindeskProvider;
use olakunlevpn\BitcoinNairaConverter\Provider\BitpayProvider;

$convert = new Converter(new CoinbaseProvider);
$convert = new Converter(new CoindeskProvider);
$convert = new Converter(new BitpayProvider);
```

or if you prefer to use the helper functions:

```
echo to_currency('NGN', 0.5, new CoindeskProvider); // 2,250,50.00
echo to_currency('LTC', 0.5, new BitpayProvider);   // 10.12345678
echo to_btc(10000, 'NGN', new CoindeskProvider);      // 0.00045678
echo to_btc(20, 'LTC', new BitpayProvider);         // 2.12345678
```

#### You can specify cache expire time (ttl) on provider by:

[](#you-can-specify-cache-expire-time-ttl-on-provider-by)

```
new CoinbaseProvider($httpClient, $psr16CacheImplementation, 5); // cache expires in 5mins, defaults to 60mins
```

Change log
----------

[](#change-log)

Initial release

Testing
-------

[](#testing)

```
$ phpunit
```

#### Show full specs and features:

[](#show-full-specs-and-features)

```
$ phpunit --testdox
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

2368d ago

### Community

Maintainers

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

---

Top Contributors

[![sevengpt](https://avatars.githubusercontent.com/u/94269135?v=4)](https://github.com/sevengpt "sevengpt (8 commits)")

---

Tags

currencyconverterbitcoincryptocurrencybitpaycoinbasenairacoindesk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/olakunlevpn-bitcoin-ng/health.svg)

```
[![Health](https://phpackages.com/badges/olakunlevpn-bitcoin-ng/health.svg)](https://phpackages.com/packages/olakunlevpn-bitcoin-ng)
```

###  Alternatives

[jimmerioles/bitcoin-currency-converter-php

A simple and lightweight bitcoin to currency converter and vice versa based on current exchange rates from your chosen provider: Coinbase, Coindesk, Bitpay and etc.

132.7k](/packages/jimmerioles-bitcoin-currency-converter-php)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[ashallendesign/favicon-fetcher

A Laravel package for fetching website's favicons.

190272.4k3](/packages/ashallendesign-favicon-fetcher)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[cartalyst/converter

A framework agnostic measurement conversion and formatting package featuring multiple types of measurements and currency conversion.

88434.4k7](/packages/cartalyst-converter)[ujjwal/currency-converter

Currency Converter Class with features of caching and identifying currency from country Code

49225.4k](/packages/ujjwal-currency-converter)

PHPackages © 2026

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