PHPackages                             onchainpay/php-api - 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. onchainpay/php-api

ActiveLibrary

onchainpay/php-api
==================

0.3.0(1y ago)06MITPHPPHP ^8.1

Since Apr 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/onchainpay/php-api)[ Packagist](https://packagist.org/packages/onchainpay/php-api)[ Docs](https://onchainpay.io/)[ RSS](/packages/onchainpay-php-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

OnChainPay PHP-API
==================

[](#onchainpay-php-api)

This package makes it easy [OnChainPay Api](https://docs.onchainpay.io/).

Installation
------------

[](#installation)

`composer require onchainpay/php-api`

Use
---

[](#use)

Go to your personal account and get api-keys.

*Substitute keys in class call:*

```
include_once ('php-api/vendor/autoload.php');

$onChainPayApi = new OnChainPay\Api('__PUBLIC_KEY__', '__PRIVATE_KEY__');
```

### Check signature

[](#check-signature)

You can test your signature within this method.

```
$checkSignature = false;
try {
    $checkSignature = $onChainPayApi->verifySignature();
} catch (OnChainPay\Exception $err) {
    echo $err;
}

echo $checkSignature ? 'Signature correct' : 'Signature incorrect';
```

### Fetch available currencies

[](#fetch-available-currencies)

Get list of available currencies for depositing/withdrawing

```
$avalableCurrencies = [];
try {
    $avalableCurrencies = $onChainPayApi->getAvailableCurrenciesList();
} catch (OnChainPay\Exception $err) {
    echo $err;
}

foreach ($avalableCurrencies as $coin) {
    echo sprintf("%s (%s) = %0.2f$\n",
                $coin['currency'], $coin['alias'], $coin['priceUSD']);
    if($coin['networks']) {
        echo "\t networks:\n";
        foreach ($coin['networks'] as $network)
            echo sprintf("\t\t%s (%s)\n", $network['name'], $network['alias']);
    }
}
```

### Get currencies price-rate

[](#get-currencies-price-rate)

Get price rate from one currency to another

```
$price = $onChainPayApi->priceRate('ETH', 'USDT');
```

### Get advanced balances info

[](#get-advanced-balances-info)

Get info about advanced balance by its id

```
$balance = null;
try {
    $balance = $onChainPayApi->account->getAdvancedBalanceInfo($balanceId);
} catch (OnChainPay\Exception $err) {
    echo $err;
}

echo sprintf(
    "[%s] (%s)\n\tAvalable for deposit: %s\n",
    $balance['advancedBalanceId'],
    $balance['currency'],
    implode(', ', $balance['availableCurrenciesForDeposit'])
);
```

Or get list of advanced balances of user

```
$balances = [];
try {
    $balances = $onChainPayApi->account->getAdvancedBalancesList();
} catch (OnChainPay\Exception $err) {
    echo $err;
}

foreach ($balances as $balance) {
    echo sprintf(
        "[%s] (%s)\n\tAvalable for deposit: %s\n",
        $balance['advancedBalanceId'],
        $balance['currency'],
        implode(', ', $balance['availableCurrenciesForDeposit'])
    );
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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 ~402 days

Total

2

Last Release

725d ago

PHP version history (2 changes)v0.2.0PHP ^7.4|^8.0

0.3.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf8a5eff0436e62f0e0b36d540af792bca6ad72af982f6941735ea46f5f05923?d=identicon)[Onchainpay Support](/maintainers/Onchainpay%20Support)

---

Top Contributors

[![onchainpay](https://avatars.githubusercontent.com/u/125957790?v=4)](https://github.com/onchainpay "onchainpay (1 commits)")

---

Tags

onchainpay

### Embed Badge

![Health badge](/badges/onchainpay-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/onchainpay-php-api/health.svg)](https://phpackages.com/packages/onchainpay-php-api)
```

PHPackages © 2026

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