r3bers/bittrex-api

PHP client for Bittrex API

v1.3.2 2021-05-22 02:16 UTC

README

Build Status Scrutinizer Code Quality Test Coverage Maintainability GitHub license Packagist codecov

A simple PHP wrapper for Bittrex API v3. Bittrex is the next generation crypto trading platform.

Requirements

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require r3bers/bittrex-api

or add

"r3bers/bittrex-api" : "^1.3"

to require the section of your application's composer.json file.

Basic usage

Example

use R3bers\BittrexApi\BittrexClient;

$client = new BittrexClient();
$client->setCredential('API_KEY', 'API_SECRET');

$data = $client->public()->getMarkets();

Available methods

Public API

Get the open and available trading markets

$data = $client->public()->getMarkets();

Get all supported currencies

$data = $client->public()->getCurrencies();

Get the current tick values for a market

$data = $client->public()->getTickers();
$data = $client->public()->getTicker('LTC-BTC');

Get the last 24-hour summary of all active exchanges

$data = $client->public()->getMarketSummaries();

Get the last 24-hour summary of all active exchanges for a market

$data = $client->public()->getMarketSummary('LTC-BTC');

Get the orderbook for a given market

$data = $client->public()->getOrderBook('LTC-BTC');

Get the latest trades that have occurred for a specific market

$data = $client->public()->getMarketHistory('LTC-BTC');

Ping Bittrex

$data = $client->public()->ping();

Market API

Place a buy order in a specific market

$data = $client->market()->buyLimit('LTC-BTC', 1.2, 1.3);

Place a sell order in a specific market

$data = $client->market()->sellLimit('LTC-BTC', 1.2, 1.3);

Cancel a buy or sell order

$data = $client->market()->cancel('251c48e7-95d4-d53f-ad76-a7c6547b74ca9');

Get all orders that you currently have opened

$data = $client->market()->getOpenOrders('LTC-BTC');

Account API

Get all balances from your account

$data = $client->account()->getBalances();

Get balance from your account for a specific currency

$data = $client->account()->getBalance('BTC');

Get or generate an address for a specific currency

$data = $client->account()->getDepositAddress('BTC');
$data = $client->account()->setDepositAddress('BTC');

Withdraw funds from your account

$data = $client->account()->withdraw('BTC', 20.40, 'EAC_ADDRESS');

Get a single order by uuid

$data = $client->account()->getOrder('251c48e7-95d4-d53f-ad76-a7c6547b74ca9');

Get order history

$data = $client->account()->getOrderHistory('LTC-BTC');

Get withdrawal history

$data = $client->account()->getWithdrawalHistory('BTC');

Get deposit history

$data = $client->account()->getDepositHistory('BTC');

Further Information

Please, check the Bittrex site documentation for further information about API.

License

r3bers/bittrex-api is released under the MIT License. See the bundled LICENSE for details.