2017 © Pedro Peláez
 

wrapper bittrex

Laravel Bittrex API wrapper / facade

image

messerli90/bittrex

Laravel Bittrex API wrapper / facade

  • Sunday, September 3, 2017
  • by messerli90
  • Repository
  • 1 Watchers
  • 3 Stars
  • 268 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 2 Open issues
  • 1 Versions
  • 9 % Grown

The README.md

Bittrex

Build Status Built For Laravel License Total Downloads, (*1)

Introduction

This packages provides a nice and easy wrapper around the Bittrex API for use in your Laravel application., (*2)

In order to use the Bittrex API, you must have an account and API keys., (*3)

Example

Retrieve your balance statements for all coins, (*4)

use Messerli90\Bittrex\Bittrex;

$bittrex = new Bittrex(config('services.bittrex.key'), config('services.bittrex.secret'));

$balances = $bittrex->getBalances();

return $balances;
{
  "success": true,
  "message": "",
  "result": [
    {
      "Currency": "BTC",
      "Balance": 2.20529678,
      "Available": 2.20529678,
      "Pending": 0,
      "CryptoAddress": null
    },
    {
      "Currency": "LTC",
      "Balance": 12.96782052,
      "Available": 12.96782052,
      "Pending": 0,
      "CryptoAddress": null
    }
  ]
}

Installation

Add messerli90/bittrex to your composer.json., (*5)

"messerli90/bittrex": "~1.0"

or, (*6)

composer require messerli90/bittrex

Run composer update to pull down the latest version of the package., (*7)

Now open up app/config/app.php and add the service provider to your providers array., (*8)

'providers' => array(
    Messerli90\Bittrex\BittrexServiceProvider::class,
)

Optionally, add the facade to your aliases array, (*9)

'Bittrex' => \Messerli90\Bittrex\Facades\Bittrex::class,

Configuration

Add the bittrex to your config/services.php array, (*10)

'bittrex' => [
    'key' => 'YOUR_API_KEY',
    'secret' => 'YOUR_API_SECRET'
]

Usage

use Messerli90\Bittrex\Bittrex;

$bittrex = new Bittrex(config('services.bittrex.key'), config('services.bittrex.secret'));

Public API

// Used to get the open and available trading markets at Bittrex along with other meta data.
$bittrex->getMarkets();

// Used to get all supported currencies at Bittrex along with other meta data.
$bittrex->getCurrencies();

// Used to get the current tick values for a market.
$bittrex->getTicker('BTC-LTC');

// Used to get the last 24 hour summary of all active exchanges
$bittrex->getMarketSummaries();

// Used to get the last 24 hour summary of all active exchanges
$bittrex->getMarketSummary('BTC-LTC');

// Used to get retrieve the orderbook for a given market
$bittrex->getOrderBook('BTC-LTC', 'both');

// Used to retrieve the latest trades that have occured for a specific market.
$bittrex->getMarketHistory('BTC-LTC');

Market

// Used to place a buy order in a specific market. Use buylimit to place limit orders. Make sure you have the proper permissions set on your API keys for this call to work
$bittrex->buyLimit('BTC-LTC', 1.2, 1.3);

// Used to place an sell order in a specific market. Use selllimit to place limit orders.
$bittrex->sellLimit('BTC-LTC', 1.2, 1.3);

// Used to cancel a buy or sell order.
$bittrex->cancel('ORDER_UUID');

// Get all orders that you currently have opened. A specific market can be requested
$bittrex->getOpenOrders('BTC-LTC');

Account

// Used to retrieve all balances from your account
$bittrex->getBalances();

// Used to retrieve the balance from your account for a specific currency.
$bittrex->getBalance('BTC');

// Used to retrieve or generate an address for a specific currency. If one does not exist, the call will fail and return ADDRESS_GENERATING until one is available.
$bittrex->getDepositAddress('BTC');

// Used to withdraw funds from your account. note: please account for txfee.
$bittrex->withdraw('BTC', 1, 'BTC-ADDRESS');

// Used to retrieve all balances from your account
$bittrex->getBalances();

// Used to retrieve a single order by uuid.
$bittrex->getOrder('0cb4c4e4-bdc7-4e13-8c13-430e587d2cc1');

// Used to retrieve your order history.
$bittrex->getOrderHistory('BTC-LTC');

// Used to retrieve your withdrawal history.
$bittrex->getWithdrawalHistory('BTC');

// Used to retrieve your deposit history.
$bittrex->getDepositHistory('BTC');

Format of returned data

The returned JSON data is decoded as a PHP object., (*11)

Run Unit Test

If you have PHPUnit installed in your environment, run:, (*12)

$ phpunit

IGDB API

Contributing

Please see CONTRIBUTING for details., (*13)

Credits

License

The MIT License (MIT). Please see License File for more information., (*14)

The Versions

03/09 2017

dev-master

9999999-dev

Laravel Bittrex API wrapper / facade

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Messerli

laravel crypto bitcoin cryptocurrency bittrex