2017 © Pedro Peláez
 

library gateio

The package for gate.io

image

xutl/gateio

The package for gate.io

  • Wednesday, November 29, 2017
  • by xutl
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

gateio-guzzle

For license information check the LICENSE-file., (*1)

Latest Stable Version Total Downloads, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require --prefer-dist xutl/gateio

or add, (*5)

"xutl/gateio": "~1.0"

to the require section of your composer.json., (*6)

使用

use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use xutl\gateio\Gateio;

$stack = HandlerStack::create();

//跟guzzlephp普通用法唯一的区别就是这里吧中间件加载进来,他会自动帮你签名重新包装请求参数。
$middleware = new Gateio([
    'accessKey' => '123456',
    'accessSecret' => '654321',
]);
$stack->push($middleware);

//这里设置 网关地址,数组参数请参见 https://gate.io/api2 
$client = new Client([
    'base_uri' => 'https://api.gate.io/api2/1',
    'handler' => $stack,
]);

$res = $client->get('private/cancelOrders', [
    'query' => [
        'aaa' => 'bbb',
    ]
]);

$res = $client->post('private/cancelOrders', [
    'form_params' => [
        'orders_json' => 'adafasdf'
     ]
]);

print_r($res->getBody()->getContents());

The Versions

29/11 2017

dev-master

9999999-dev

The package for gate.io

  Sources   Download

MIT

The Requires

 

guzzle guzzlehttp gate gate.io gate.io sdk

29/11 2017

1.0.0

1.0.0.0

The package for gate.io

  Sources   Download

MIT

The Requires

 

guzzle guzzlehttp gate gate.io gate.io sdk