PHPackages                             matmar10/campbx - 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. [API Development](/categories/api)
4. /
5. matmar10/campbx

ActiveLibrary[API Development](/categories/api)

matmar10/campbx
===============

REST API Client for CampBX Bitcoin exchange using Guzzle library

0.0.2(11y ago)06Apache License Version 2.0PHP

Since Oct 13Pushed 11y ago1 watchersCompare

[ Source](https://github.com/matmar10/campbx)[ Packagist](https://packagist.org/packages/matmar10/campbx)[ RSS](/packages/matmar10-campbx/feed)WikiDiscussions master Synced today

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

campbx
======

[](#campbx)

A REST API Client for CampBX Bitcoin exchange using Guzzle library and sophisticated integer math under the hood

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

[](#installation)

This library uses composer and psr-0 autloading standard.

Add the following to your composer.json file:

```
{
    "require": {
        "matmar10/campbox": "dev-master"
    }
}
```

Reload your dependencies using `php composer.phar update`

Be sure to include the generated autoloader in your implementation:

```
include __DIR__.'/vendor/autoload.php';
```

General Usage
-------------

[](#general-usage)

### REST Client

[](#rest-client)

Include the Client object to create and execute commands.

Use the factory method to create a new client instance:

```
use Matmar10\CampBX\CampBXClient;

$client = CampBXClient::factory();
```

API methods requiring authentication must use the auth client which requires username and password as required arguments:

```
use Matmar10\CampBX\CampBXAuthClient;

$client = CampBXAuthClient::factory(array(
    'username' => 'your username',
    'password' => 'your password'
));
```

### Commands

[](#commands)

This library uses Guzzle PHP, which implements the command pattern.

Available commands are described in `src/Matmar10/CampBX/client-service-description.json`

When a response is returned, root level properties of the response can be retrieved via the `->get()` method:

```
$command = $client->getCommand('GetTicker');
$response = $client->execute($command);

// returns an instance of Matmar10\Money\Entity\CurrencyPair
$askPrice = $response->get('ask');
```

Available parameters of the response object are described in the `models` section of the `client-service-description.json` file. For example:

```
...
{

// ...
    "models": {
        "GetTicker": {
            "type": "object":,
            "properties": {
                "lastTrade": {
                    "location": "json",
                    "sentAs": "Last Trade",
                    "type": "object",
                    "filters": [{
                        "method": "Matmar10\\CampBX\\Filter\\Response::asCurrencyPairFromFloat",
                        "args": [ "@value", "BTC", 8, 8, "USD", 2, 2, "B⃦", "$"]
                    }]
                },
                "bid": {
                    "location": "json",
                    "sentAs": "Best Bid",
                    "type": "object",
                    "filters": [{
                        "method": "Matmar10\\CampBX\\Filter\\Response::asCurrencyPairFromFloat",
                        "args": [ "@value", "BTC", 8, 8, "USD", 2, 2, "B⃦", "$"]
                    }]
                },
                "ask": {
                    "location": "json",
                    "sentAs": "Best Ask",
                    "type": "object",
                    "filters": [{
                        "method": "Matmar10\\CampBX\\Filter\\Response::asCurrencyPairFromFloat",
                        "args": [ "@value", "BTC", 8, 8, "USD", 2, 2, "B⃦", "$"]
                    }]
                }
            }
        }
    }

// ...
```

Market Data
-----------

[](#market-data)

### Market Depth

[](#market-depth)

See `examples/market-data/market-depth.php` for a more complete example.

```
$command = $client->getCommand('GetMarketDepth');
$response = $client->execute($command);

foreach($response->get('ask') as $marketDepthPrice) {
    echo $marketDepthPrice->getPrice()->getamountDisplay() . ": ";
    echo $marketDepthPrice->getAmount()->getamountDisplay() . "\n";
}
```

### Ticker

[](#ticker)

See `examples/market-data/ticker.php` for a more complete example.

```
$command = $client->getCommand('GetTicker');
$response = $client->execute($command);

echo "BUY: " . $response->get('bid')->getMultiplier() . "\n";
echo "SELL: " . $response->get('ask')->getMultiplier() . "\n";
```

Account Data
------------

[](#account-data)

### Get Account Balances

[](#get-account-balances)

- Requires Authentication \*

See also: `examples/account-data/balance.php`

```
$client = CampBXAuthClient::factory(array(
    'username' => 'your-campbx-username',
    'password' => 'changeme',
));

$command = $client->getCommand('GetAccountBalances');
$response = $client->execute($command);
echo "Total BTC: " . $response->get('totalBTC')->getAmountFloat() . "\n";
echo "Total USD: " . $response->get('totalUSD')->getAmountFloat() . "\n";
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Total

2

Last Release

4374d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9dede0530c32ff7421ef5cc42a19b9be4b8926111ae0bc3111993429a73c6b9b?d=identicon)[matmar10](/maintainers/matmar10)

---

Top Contributors

[![matmar10](https://avatars.githubusercontent.com/u/19975?v=4)](https://github.com/matmar10 "matmar10 (22 commits)")

### Embed Badge

![Health badge](/badges/matmar10-campbx/health.svg)

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

###  Alternatives

[rackspace/php-opencloud

PHP SDK for Rackspace/OpenStack APIs

4566.0M38](/packages/rackspace-php-opencloud)[cdaguerre/php-trello-api

Trello API v2 client

256677.1k3](/packages/cdaguerre-php-trello-api)[dchesterton/marketo-rest-api

A PHP client for the Marketo.com REST API

39844.4k1](/packages/dchesterton-marketo-rest-api)[carlosio/geckoboard

A PHP library for dealing with Geckoboard API (http://www.geckoboard.com)

40172.9k](/packages/carlosio-geckoboard)[teepluss/api

Laravel 4 Internal Request (HMVC)

7034.1k](/packages/teepluss-api)[jlinn/mandrill-api-php

A PHP client library for Mandrill's REST API

24120.2k](/packages/jlinn-mandrill-api-php)

PHPackages © 2026

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