PHP code example of mvaessen / kraken-future-api

1. Go to this page and download the library: Download mvaessen/kraken-future-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/ */

    

mvaessen / kraken-future-api example snippets



$api = new Mvaessen\KrakenFutureApi\Client('<api key>','<secret>');

$result = $api->queryPublic('<method>', '<endpoint>', '<request>');

$result = $api->queryPrivate('<method>', '<endpoint>', '<request>');


namespace App;

use Mvaessen\KrakenFutureApi\KrakenFutureApiException;
use Mvaessen\KrakenFutureApi\Client;

class KrakenFutureApi extends Client
{
   public function accounts()
   {
        return $this->api->queryPrivate('get', 'accounts');
   }

   protected function processErrorCode($response, $method, $url, $request)
   {
       //todo report to bugtracking software

       throw new KrakenFutureApiException($response['msg']);
   }
   
   protected function processException($e, $method, $url, $request)
   {
       //todo report to bugtracking software

       throw new KrakenFutureApiException($e->getMessage());
   }
}