cryptomkt/cryptomkt-httplug-php 问题修复 & 功能扩展

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

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

cryptomkt/cryptomkt-httplug-php

Composer 安装命令:

composer require cryptomkt/cryptomkt-httplug-php

包简介

PHP Client to integrate CryptoMarket into your PHP Projects

README 文档

README

Official Client library CryptoMarket API v1 to integrate CryptoMarket into your PHP project, using HTTPlug client abstraction HTTPlug.

Installation

This library could be installed using Composer. Please read the Composer Documentation.

"require": {
    "cryptomkt/cryptomkt-httplug-php": "dev-master"
}

Authentication

API Key

Use an API key and secret to access your own Crypto Market account.

use Cryptomkt\Exchange\Client;
use Cryptomkt\Exchange\Configuration;

$configuration = Configuration::apiKey($apiKey, $apiSecret);
$client = Client::create($configuration);

Warnings

This library will log all warnings to a standard PSR-3 logger if one is configured.

use Cryptomkt\Exchange\Client;
use Cryptomkt\Exchange\Configuration;

$configuration = Configuration::apiKey($apiKey, $apiSecret);
$configuration->setLogger($logger);
$client = Client::create($configuration);

Responses

Each resource object has a getRawData() method which you can use to access any field that are not mapped to the object properties.

$data = $markets->getRawData();

Raw data from the last HTTP response is also available on the client object.

$data = $client->decodeLastResponse();

Usage

For more references, go to the official documentation.

Market Data

List markets

$markets = $client->getMarkets();

Get ticker

$arguments = array('market' => 'ETHARS');
$ticker = $client->getTicker($arguments); 

Get trades

$arguments = array('market' => 'ETHCLP','start' => '2017-05-20', 'end' => '2017-05-30', 'page' => 1);
$trades = $client->getTrades($arguments);

Orders

Get orders

$arguments = array('market' => 'ETHARS','type' => 'buy', 'page' => 1);
$orders = $client->getOrders($arguments); 

Get order

$arguments = array('id' => 'M107435');
$order = $client->getOrder($arguments);  

Get active orders

$arguments = array('market' => 'ETHCLP', 'page' => 0);
$active_orders = $client->getActiveOrders($arguments); 

Get executed orders

$arguments = array('market' => 'ETHCLP', 'page' => 0);
var_dump($client->getExecutedOrders($arguments)); 

Create order

$arguments = array(
        'amount' => '0.3',
        'market' => 'ethclp',
        'price' => '200000',
        'type' => 'sell'
    );
$response = $client->createOrder($arguments); 

Cancel order

$arguments = array('id' => 'M107441');
$response = $client->cancelOrder($arguments); 

Balance

Get balance

$response = $client->getBalance(); 

Create pay order

$arguments = array(
    'to_receive' => '3000',
    'to_receive_currency' => 'CLP',
    'payment_receiver' => 'receiver@email.com',
    'external_id' => '123456CM',
    'callback_url' => '',
    'error_url' => '',
    'success_url' => '',
    'refund_email' => 'refund@email.com'
);

$response = $client->createPayOrder($arguments);  

Pay orders

Get pay order

$arguments = array('id' => 'P13565');
$response = $client->getPayOrder($arguments);  

Get pay orders

$arguments = array('start_date' => '1/05/2018','end_date' => '31/05/2018');
$response = $client->getPayOrders($arguments);  

Contributing and testing

The test suite is built using PHPUnit. Run the suite of unit tests by running the phpunit command.

phpunit

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固