PHP code example of codenix-sv / kuna-api

1. Go to this page and download the library: Download codenix-sv/kuna-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

codenix-sv / kuna-api example snippets


use Codenixsv\KunaApi\KunaClient;

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

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

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

$market = 'btcuah';

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

$market = 'btcuah';

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

$market = 'btcuah';

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

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

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

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

$id = 32555;

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

$market = 'btcuah';

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

$market = 'btcuah';

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