2017 © Pedro Peláez
 

library yobitapi

Yobit Api

image

olegstyle/yobitapi

Yobit Api

  • Sunday, February 11, 2018
  • by olegstyle
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Yobit Api implementation

This is a implementation of Yobit Api on PHP., (*1)

Api documentation: https://yobit.net/en/api, (*2)

Installation

1. Append to composer package requires

composer require olegstyle/yobitapi
If it not available then try this:
1.1 Add it to composer repositories:
"repositories": [
    # ...
    {
        "type": "vcs",
        "url": "https://git@bitbucket.org/dreamteam_ov/yobit-api.git"
    }
    # ...
],
1.2 Add it to composer require:
"require: {
    "olegstyle/yobitapi": "dev-master"
}
1.3 Make:
composer install
or
composer update

2. Install PhantomJS.

It needs for get around Cloudflare. PhantomJS installation guide for ubuntu on down of readme, (*3)

3. Make sure that you are not using php in safe mode

Another way PhantomJS will not be working, (*4)

4. Use it ^_^

How to use?

Like a original api package have public api (\OlegStyle\YobitApi\YobitPublicApi) and trade api (\OlegStyle\YobitApi\YobitTradeApi), (*5)

Public Api usage

$pairs = [
   new \OlegStyle\YobitApi\Models\CurrencyPair('btc', 'eth'),
   new \OlegStyle\YobitApi\Models\CurrencyPair('bch, 'btc'),
];
$publicApi = new \OlegStyle\YobitApi\YobitPublicApi();
$publicApi->getInfo(); // get info about all pairs
$publicApi->getTickers($pairs); // limit - 50 pairs
$publicApi->getTicker('btc', 'eth');
$publicApi->getDepths($pairs); // limit - 50 pairs
$publicApi->getDepth('btc', 'eth');
$publicApi->getTrades($pairs); // limit - 50 pairs
$publicApi->getTrade('btc', 'eth');

Trade Api usage

Make sure that you are using different public/secret keys in development and production, (*6)

$publicKey = 'YOR_PUBLIC_KEY'; 
$privateKey = 'YOR_PRIVATE_KEY'; // or secret key

$tradeApi = new \OlegStyle\YobitApi\YobitTradeApi($publicKey, $privateKey);
$tradeApi->getInfo(); // Method returns information about user's balances and priviledges of API-key as well as server time.
$tradeApi->trade( // Method that allows creating new orders for stock exchange trading
  new \OlegStyle\YobitApi\CurrencyPair('bch, 'btc'), // pair
  \OlegStyle\YobitApi\Enums\TransactionTypeEnum::BUY, // type of trade. can be: TransactionTypeEnum::BUY or TransactionTypeEnum::SELL
  0.023, // rate
  0.1 // amount 
);
$tradeApi->getActiveOrders( // Method returns list of user's active orders (trades)
  new \OlegStyle\YobitApi\CurrencyPair('bch, 'btc') // pair
);
$tradeApi->getOrderInfo($orderId); // Method returns detailed information about the chosen order (trade)
$tradeApi->cancelOrder($orderId); // Method cancells the chosen order

Thanks to

PhantomJS Installing

Before installing PhantomJS, you will need to install some required packages on your system. You can install all of them with the following command:, (*7)

sudo apt-get install build-essential chrpath libssl-dev libxft-dev libfreetype6-dev libfreetype6 libfontconfig1-dev libfontconfig1 -y

Next, you will need to download the PhantomJS. You can download the latest stable version of the PhantomJS from their official website. Run the following command to download PhantomJS:, (*8)

sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2

Once the download is complete, extract the downloaded archive file to desired system location:, (*9)

sudo tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2 -C /usr/local/share/

Next, create a symlink of PhantomJS binary file to systems bin dirctory:, (*10)

sudo ln -s /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/

PhantomJS is now installed on your system. You can now verify the installed version of PhantomJS with the following command:, (*11)

phantomjs --version

The Versions

11/02 2018

dev-master

9999999-dev http://bodev.pro/

Yobit Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleh Borysenko

11/02 2018

dev-CAPI-95-test

dev-CAPI-95-test http://bodev.pro/

Yobit Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleh Borysenko

04/02 2018

v1.1.0

1.1.0.0 http://bodev.pro/

Yobit Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleh Borysenko

23/01 2018

v1.0.6

1.0.6.0 http://bodev.pro/

Yobit Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleh Borysenko

22/01 2018

v1.0.3

1.0.3.0 http://bodev.pro/

Yobit Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleh Borysenko

22/01 2018

v1.0.5

1.0.5.0 http://bodev.pro/

Yobit Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleh Borysenko

22/01 2018

dev-3-handle-error-and-empty-response-from-yobit-api

dev-3-handle-error-and-empty-response-from-yobit-api http://bodev.pro/

Yobit Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleh Borysenko

22/01 2018

v1.0.4

1.0.4.0 http://bodev.pro/

Yobit Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleh Borysenko

21/01 2018

v1.0.2

1.0.2.0 http://bodev.pro/

Yobit Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleh Borysenko

20/01 2018

v1.0.1

1.0.1.0 http://bodev.pro/

Yobit Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleh Borysenko

20/01 2018

v1.0.0

1.0.0.0

Yobit Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oleh Borysenko