mvaessen/kraken-future-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mvaessen/kraken-future-api

Composer 安装命令:

composer require mvaessen/kraken-future-api

包简介

Simple Kraken Futures API Wrapper, written in PHP. Includes the basics and assumes you know your way around.

README 文档

README

Simple Kraken Futures API Wrapper, written in PHP. Includes some basic methods to work with the API and assumes you know your way around. Check out the Kraken Futures API Documentation for more information about the available endpoints. Will throw an exception when errors are encountered.

Please note:

  • Does NOT include mechanism to intercept rate limit.
  • Comes without any support.
  • Use at your own risk.

Getting started

composer require mvaessen/binance-api

require 'vendor/autoload.php';
$api = new Mvaessen\KrakenFutureApi\Client('<api key>','<secret>');
Public endpoint call
$result = $api->queryPublic('<method>', '<endpoint>', '<request>');
Private endpoint call
$result = $api->queryPrivate('<method>', '<endpoint>', '<request>');

Testing

Make sure to populate the .env file, run composer install and set your testing API keys in the .env file, in the root of the project. Afterwards run ./vendor/bin/phpunit tests/BasicApiTest.php to test your API keys. The test runs against the https://conformance.cryptofacilities.com/derivatives environment.

Extending & custom error reporting

You can choose to overwrite the processErrorCode and processException methods to report the errors to your favorite bugreporting software.

<?php
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());
   }
}

统计信息

  • 总下载量: 32
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固