santran/livecoin

Livecoin API wrapper for Laravel

dev-master 2017-12-28 15:03 UTC

This package is not auto-updated.

Last update: 2024-11-10 06:01:49 UTC


README

Start trading on Livecoin right away using your favorite PHP framework.

Installation

composer require santran/livecoin:dev-master.

Add the service provider to your config/app.php:

 'providers' => [
    Santran\Livecoin\LivecoinServiceProvider::class,
 ],

...run php artisan vendor:publish to copy the config file.

Edit the config/livecoin.php or add Livecoin api and secret in your .env file

LIVECOIN_KEY={YOUR_API_KEY}
LIVECOIN_SECRET={YOUR_API_SECRET}

Add the alias to your config/app.php:

'aliases' => [
    'Livecoin' => Santran\Livecoin\Livecoin::class,
],

Usage

Please refer to the Api Documentation for more info, or read the docblocks !

$params = array(...);

Public data documentation

Livecoin::exchangeTicker($params);
Livecoin::exchangeLastTrades($params);
Livecoin::exchangeOrderBook($params);
Livecoin::exchangeAllOrderBook($params);
Livecoin::exchangeMaxbidMinask($params);
Livecoin::exchangeRestrictions($params);
Livecoin::infoCoinInfo(); 

Private user data documentation

Livecoin::exchangeTrades($params);
Livecoin::exchangeClientOrders($params);
Livecoin::exchangeOrder($params);
Livecoin::paymentBalances($params);
Livecoin::paymentBalance($params);
Livecoin::paymentHistoryTransactions($params);
Livecoin::paymentHistorySize($params);
Livecoin::exchangeCommissions();
Livecoin::exchangeCommissionCommonInfo();

Open/cancel orders documentation

Livecoin::exchangeBuylimit($params);
Livecoin::exchangeSelllimit($params);
Livecoin::exchangeBuymarket($params);
Livecoin::exchangeSellmarket($params);
Livecoin::exchangeCancellimit($params);

Deposit and withdrawal documentation

Livecoin::paymentGetAddress($params);
Livecoin::paymentOutCoin($params);
Livecoin::paymentOutPayeer($params);
Livecoin::paymentOutCapitalist($params);
Livecoin::paymentOutAdvcah($params);
Livecoin::paymentOutCard($params);
Livecoin::paymentOutOkpay($params);
Livecoin::paymentOutPerfectmoney($params);

Vouchers documentation

Livecoin::paymentVoucherMake($params);
Livecoin::paymentVoucherAmount($params);
Livecoin::paymentVoucherRedeem($params);

Example

To retrieve information on the latest transactions for a specified currency pair.

use Santran\Livecoin\Livecoin;

$data = Livecoin::exchangeLastTrades([
        'currencyPair'  => 'BTC/USD',
        'minutesOrHour' => 'true',
        'type'          => 'BUY',
    ]);
    
dd($data);

This package is provided as-is. Do with it what you want ! PR's will be looked into. I personally believe in freedom and equality, which is one of the reasons I'm in crypto. It's also the reason I'm sharing most of the reusable code I write.