Skip to content

codenix-sv/kuna-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kuna.io PHP API V2 Client

Build Status Scrutinizer Code Quality Test Coverage Maintainability License: MIT

A simple PHP API client, written with PHP for kuna.io.

Kuna.io API documentation.

Requirements

  • PHP >= 7.2
  • ext-json

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require codenix-sv/kuna-api

or add

"codenix-sv/kuna-api": "^0.1"

Basic usage

Example

use Codenixsv\KunaApi\KunaClient;

$client = new KunaClient('publicKey', 'secretKey');

$data = $client->publicApi()->getTimestamp();

Public Methods

getTimestamp

Server time.

$data = $client->publicApi()->getTimestamp();

getTickers

Recent market data.

$market = 'btcuah';

$data = $client->publicApi()->getTickers($market);

getDept

Order book.

$market = 'btcuah';

$data = $client->publicApi()->getDepth($market);

getTrades

Trades history.

$market = 'btcuah';

$data = $client->publicApi()->getTrades($market);

User Methods

getMe

Information about the user and assets.

$data = $client->privateApi()->getMe();

createOrder

Order placing.

$side = 'buy';
$volume = 1.00;
$market = 'btcuah';
$price = 2000.00;

$data = $client->privateApi()->createOrder($side, $volume, $market, $price);

deleteOrder

Order cancel.

$id = 32555;

$data = $client->privateApi()->deleteOrder($id);

getOrders

Active user orders.

$market = 'btcuah';

$data = $client->privateApi()->getOrders($market);

getMyTrades

User trade history.

$market = 'btcuah';

$data = $client->privateApi()->getMyTrades($market);

License

codenix-sv/kuna-api is released under the MIT License. See the bundled LICENSE for details.