2017 © Pedro Peláez
 

library php-exchange-sdk

A public PHP SDK for accessing the CFX Markets exchange

image

cfxmarkets/php-exchange-sdk

A public PHP SDK for accessing the CFX Markets exchange

  • Tuesday, July 24, 2018
  • by kael-shipman
  • Repository
  • 6 Watchers
  • 0 Stars
  • 148 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 16 Versions
  • 252 % Grown

The README.md

CFX Markets Exchange SDK for PHP

A public PHP SDK library to access the CFX Markets exchange., (*1)

This library helps to facilitate interactions with the CFX Exchange through CFX's exchange REST api., (*2)

Usage

Instantiation

The CFX Exchange requires the use of an authenticated API key for all interactions. You should provide your API key and secret to the constructor, along with the API url you'd like to target (usually https://sandbox.apis.cfxtrading.com/exchange for testing and https://apis.cfxtrading.com/exchange for production)., (*3)

// In your code, where you're planning on using the SDK...
$cfx = new \CFX\SDK\Exchange\Client('https://sandbox.apis.cfxtrading.com/exchange', $apiKey, $secret, $httpClient);

Manipulating Objects

You'll probably primarily be interested in fetching, creating, updating, or deleting data objects. To do this, you'll use the peripheral object classes provided by this library, then send instructions to the server via the Client you instantiated along with (optionally) one of the resource objects you've created., (*4)

For example, here's how to get a list of assets from the server. This returns a ResourceCollection that contains Asset resources:, (*5)

// Get a list of assets from the server

$assets = $cfx->assets->get();
$asset = $assets[0];
echo $asset->getName();

// ...

Here's an example of how you might create an order:, (*6)

// First, create some peripherals

$asset = $cfx->assets->create(['id' => $_POST['assetSymbol']]);
$qty = $_POST['qty'];

// Then create the order locally (assume that $user is a valid user in your system)
$order = $cfx->orders->create()
    ->setType('sell')
    ->setOwnerToken($user->getToken())
    ->setAsset($asset)
    ->setQuantity($qty);

// Now, send the order to the server, catching any errors thrown
try {
    $order->save();
    $response = ....
} catch (\CFX\BadInputException $e) {
    // Means there were data input errors
} catch (.....) {
    // etc...
}

The Versions

24/07 2018

v1.4.x-dev

1.4.9999999.9999999-dev

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

24/07 2018

v1.4.1

1.4.1.0

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

21/06 2018

dev-master

9999999-dev

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

21/06 2018

v1.4.0

1.4.0.0

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

12/01 2018

v1.3.x-dev

1.3.9999999.9999999-dev

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

12/01 2018

v1.3.0

1.3.0.0

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

02/12 2017

v1.2.x-dev

1.2.9999999.9999999-dev

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

02/12 2017

v1.2.0

1.2.0.0

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

22/11 2017

v1.1.0

1.1.0.0

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

22/11 2017

v1.1.x-dev

1.1.9999999.9999999-dev

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

13/11 2017

v1.0.0

1.0.0.0

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

11/10 2017

v0.2.1

0.2.1.0

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

11/10 2017

v0.2.0

0.2.0.0

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

11/10 2017

v0.1.1

0.1.1.0

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

11/10 2017

v0.1

0.1.0.0

A public PHP SDK for accessing the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api sdk client exchange cfx cfxmarkets

28/07 2017

v0.0

0.0.0.0

A public PHP api library to access the CFX Markets exchange

  Sources   Download

MIT

The Requires

 

The Development Requires

api client exchange cfx cfxmarkets