Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit 4e7296f

Browse files
author
Jon Eyrick
authored
Various improvements by dmzoneill, mojpoj added fromId to orders and trades
2 parents f359563 + f93f435 commit 4e7296f

File tree

11 files changed

+500
-7
lines changed

11 files changed

+500
-7
lines changed

.coveralls.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src_dir: .

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tests/composer.lock
2+
tests/LICENCE
3+
tests/vendor**

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: php
2+
3+
php:
4+
- 7.0
5+
6+
before_script:
7+
- cd tests
8+
- bash prep.sh
9+
10+
script:
11+
- mkdir -p build/logs
12+
- bash run.sh

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[![GitHub last commit](https://img.shields.io/github/last-commit/jaggedsoft/php-binance-api.svg)](#)
2-
[![Packagist Downloads](https://img.shields.io/packagist/dt/jaggedsoft/php-binance-api.svg)](https://packagist.org/packages/jaggedsoft/php-binance-api)
2+
[![Packagist Downloads](https://img.shields.io/packagist/dt/jaggedsoft/php-binance-api.svg)](https://packagist.org/packages/jaggedsoft/php-binance-api) [![Build Status](https://travis-ci.org/jaggedsoft/php-binance-api.svg?branch=master)](https://travis-ci.org/jaggedsoft/php-binance-api) [![Coverage Status](https://coveralls.io/repos/github/jaggedsoft/php-binance-api/badge.svg?branch=master)](https://coveralls.io/github/jaggedsoft/php-binance-api)
33

44
# PHP Binance API
55
This project is designed to help you make your own projects that interact with the [Binance API](https://github.com/binance-exchange/binance-official-api-docs). You can stream candlestick chart data, market depth, or use other advanced features such as setting stop losses and iceberg orders. This project seeks to have complete API coverage including WebSockets.
66

7-
> *This package needs help from the community*! Maintaining [node-binance-api](https://github.com/jaggedsoft/node-binance-api) is taking up the majority of my time. Improvements contributed to this project are more than welcome, and you will be given full credit for changes. All pull requests are welcome.
7+
> Special thank you to all contributors: **dmzoneill, dxjones,** and others!! *This package needs help from the community.* Maintaining [node-binance-api](https://github.com/jaggedsoft/node-binance-api) is taking up the majority of my time. Improvements contributed to this project are encouraged, and you will be given full credit for changes. All pull requests welcome.
88
99
#### Installation
1010
```

examples/get_account_info.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
require '../php-binance-api.php';
4+
5+
// @see home_directory_config.php
6+
// use config from ~/.confg/jaggedsoft/php-binance-api.json
7+
$api = new Binance\API();
8+
9+
$account = $api->account();
10+
print_r($account);

examples/get_exchange_info.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
require '../php-binance-api.php';
4+
5+
// @see home_directory_config.php
6+
// use config from ~/.confg/jaggedsoft/php-binance-api.json
7+
$api = new Binance\API();
8+
9+
$exchangeInfo = $api->exchangeInfo();
10+
print_r($exchangeInfo);

php-binance-api.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ public function orderStatus($symbol, $orderid) {
8181
public function openOrders($symbol) {
8282
return $this->httpRequest("v3/openOrders","GET", ["symbol"=>$symbol], true);
8383
}
84-
public function orders($symbol, $limit = 500) {
85-
return $this->httpRequest("v3/allOrders", "GET", ["symbol"=>$symbol, "limit"=>$limit], true);
84+
public function orders($symbol, $limit = 500, $fromOrderId = 1) {
85+
return $this->httpRequest("v3/allOrders", "GET", ["symbol"=>$symbol, "limit"=>$limit, "orderId"=>$fromOrderId], true);
8686
}
87-
public function history($symbol, $limit = 500) {
88-
return $this->httpRequest("v3/myTrades", "GET", ["symbol"=>$symbol, "limit"=>$limit], true);
87+
public function history($symbol, $limit = 500, $fromTradeId = 1) {
88+
return $this->httpRequest("v3/myTrades", "GET", ["symbol"=>$symbol, "limit"=>$limit, "fromId"=>$fromTradeId], true);
8989
}
9090
public function useServerTime() {
9191
$serverTime = $this->httpRequest("v1/time")['serverTime'];
@@ -123,7 +123,7 @@ public function bookPrices() {
123123
return $this->bookPriceData($this->httpRequest("v3/ticker/bookTicker"));
124124
}
125125
public function account() {
126-
return $this->httpRequest("v3/account", true);
126+
return $this->httpRequest("v3/account", "GET", [], true);
127127
}
128128
public function prevDay($symbol) {
129129
return $this->httpRequest("v1/ticker/24hr", "GET", ["symbol"=>$symbol]);

0 commit comments

Comments
 (0)