Kuna API wrapper
Install:
composer require mfiyalka/kuna "*"
...
"require": {
"mfiyalka/kuna": "*"
}
...
<?php
use Mfiyalka\API\Kuna\ApiKuna;
$kuna = new ApiKuna();
$timestamp = $kuna->getTimestamp();
echo $timestamp; //1512632791
<?php
use Mfiyalka\API\Kuna\ApiKuna;
use Mfiyalka\API\Kuna\Market;
$kuna = new ApiKuna();
$data = $kuna->getTickers(Market::BTC_UAH);
$data->all();
$data->at;
$data->buy;
$data->sell;
...
<?php
use Mfiyalka\API\Kuna\ApiKuna;
use Mfiyalka\API\Kuna\Market;
$kuna = new ApiKuna();
$data = $kuna->getOrderBook(Market::BTC_UAH);
$all = $data->all();
$asks = $data->asks;
$bids = $data->bids;
<?php
use Mfiyalka\API\Kuna\ApiKuna;
use Mfiyalka\API\Kuna\Market;
$kuna = new ApiKuna();
$data = $kuna->getTrades(Market::BTC_UAH);
$trades = $data->trades;
<?php
use Mfiyalka\API\Kuna\ApiKuna;
$kuna = new ApiKuna();
$kuna->setPublicKey('***');
$kuna->setPrivateKey('***');
$me = $kuna->getMe();
$email = $me->email;
$btc = $me->btc;
...
$accounts = $me->getAccounts();
<?php
use Mfiyalka\API\Kuna\ApiKuna;
use Mfiyalka\API\Kuna\Market;
$kuna = new ApiKuna();
$kuna->setPublicKey('***');
$kuna->setPrivateKey('***');
$result = $kuna->createOrder(
'buy',
'0.05',
Market::BTC_UAH,
'400000'
);
$id = $result->id;
$side = $result->side;
$ord_type = $result->ord_type;
...
<?php
use Mfiyalka\API\Kuna\ApiKuna;
$kuna = new ApiKuna();
$kuna->setPublicKey('***');
$kuna->setPrivateKey('***');
$result = $kuna->deleteOrder('1340811');
$id = $result->id;
$side = $result->side;
$ord_type = $result->ord_type;
<?php
use Mfiyalka\API\Kuna\ApiKuna;
use Mfiyalka\API\Kuna\Market;
$kuna = new ApiKuna();
$kuna->setPublicKey('***');
$kuna->setPrivateKey('***');
$result = $kuna->getMyOrders(Market::BTC_UAH);
$all = $result->all();
<?php
use Mfiyalka\API\Kuna\ApiKuna;
use Mfiyalka\API\Kuna\Market;
$kuna = new ApiKuna();
$kuna->setPublicKey('***');
$kuna->setPrivateKey('***');
$result = $kuna->getMyTrades(Market::BTC_UAH);
$trades = $result->trades;
- Version 1.0