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

Commit f359563

Browse files
author
Jon Eyrick
authored
Fix order cancellation with cURL (Thank you dmzoneill!)
2 parents 3bc8bb0 + a8804eb commit f359563

20 files changed

+239
-11
lines changed
File renamed without changes.

examples/agg_trades.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
// Aggregate Trades List
10+
$trades = $api->aggTrades("BNBBTC");
11+
print_r($trades);

examples/balances.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
// Get all of your positions, including estimated BTC value
10+
$balances = $api->balances();
11+
print_r($balances);

examples/book_prices.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
// Get all bid/ask prices
10+
$bookPrices = $api->bookPrices();
11+
print_r($bookPrices);

examples/candles.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
// Get Kline/candlestick data for a symbol
10+
// Periods: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M
11+
$ticks = $api->candlesticks("BNBBTC", "5m");
12+
print_r($ticks);

examples/depth.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
// Get Market Depth
10+
$depth = $api->depth("ETHBTC");
11+
print_r($depth);

examples/get_balance.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/get_prices.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
// Get latest price of a symbol
10+
$ticker = $api->prices();
11+
print_r($ticker); // List prices of all symbols
12+
echo "Price of BNB: {$ticker['BNBBTC']} BTC.\n";

examples/homedirectoryconfig.php renamed to examples/home_directory_config.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
require '../php-binance-api.php';
44

5+
/*
6+
mkdir -vp ~/.config/jaggedsoft/
7+
cat > ~/.config/jaggedsoft/php-binance-api.json << EOF
8+
{
9+
"api-key": "<api key>",
10+
"api-secret": "<secret>"
11+
}
12+
*/
13+
514
$api = new Binance\API();
615

716
$ticker = $api->prices();

examples/open_orders.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
// Get Open Orders
10+
$openorders = $api->openOrders("BNBBTC");
11+
print_r($openorders);

0 commit comments

Comments
 (0)