eskrano/bitmex-php
Composer 安装命令:
composer require eskrano/bitmex-php
包简介
Bitmex API Like the official document interface, Support for arbitrary extension.
README 文档
README
It is recommended that you use the test server first
Online interface testinghttps://www.bitmex.com/api/explorer/
Address of the testhttps://testnet.bitmex.com
The official addresshttps://www.bitmex.com
All interface methods are initialized the same as those provided by bitmex. See detailssrc/api
Many interfaces are not yet complete, and users can continue to extend them based on my design. Feel free to iterate with me.
Installation
composer require "eskrano/bitmex-php dev-master"
Book Data More
//Get market data //Book data may be key and secret try { $bitmex=new Bitmex(); $result=$bitmex->orderBook()->get([ 'symbol'=>'ETHUSD', 'depth'=>20 ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); }
Order More
//Test API address default https://www.bitmex.com $key='eLB_l505a_cuZL8Cmu5uo7EP'; $secret='wG3ndMquAPl6c-jHUQNhyBQJKGBwdFenIF2QxcgNKE_g8Kz3'; $host='https://testnet.bitmex.com'; $bitmex=new Bitmex($key,$secret,$host); //bargaining transaction try { $result=$bitmex->order()->post([ 'symbol'=>'XBTUSD', 'price'=>'100', 'side'=>'Buy', 'orderQty'=>'1', 'ordType'=>'Limit', ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); } //track the order try { $result=$bitmex->order()->getOne([ 'symbol'=>'XBTUSD', 'orderID'=>$result['orderID'], ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); } //update the order try { $result=$bitmex->order()->put([ 'symbol'=>'XBTUSD', 'orderID'=>$result['orderID'], 'price'=>'200', 'orderQty'=>'2', ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); } //cancellation of order try { $result=$bitmex->order()->delete([ 'symbol'=>'XBTUSD', 'orderID'=>$result['orderID'], ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); }
Postion More
//bargaining transaction try { $bitmex=new Bitmex($key,$secret,$host); $result=$bitmex->position()->get([ 'symbol'=>'XBTUSD', ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); }
eskrano/bitmex-php 适用场景与选型建议
eskrano/bitmex-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 94 次下载、GitHub Stars 达 2, 最近一次更新时间为 2019 年 04 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 eskrano/bitmex-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eskrano/bitmex-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 94
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-15