Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: [ master, rc-* ]

jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0', '8.1']
php-versions: ['8.1', '8.2']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Install dependencies
run: composer install --prefer-dist --no-progress
run: composer install --prefer-dist --no-progress --ignore-platform-req=php
- name: php lint
run: vendor/bin/php-cs-fixer fix --stop-on-violation .
run: composer lint-check
- name: php unit test
run: vendor/bin/phpunit
14 changes: 14 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__)
;

$config = new PhpCsFixer\Config();
return $config->setRules([
'@PSR12' => true,
'constant_case' => false
])
->setFinder($finder)
;
50 changes: 49 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,57 @@
# CHANGELOG

## 1.5.0 - 2023-07-03

### Update
- Update `guzzlehttp/guzzle` to latest version
- Drop support of PHP 7.* or 8.0

## 1.4.0 - 2022-12-20

### Added
- Support RSA signature

## 1.3.0 - 2022-09-14

### Added

- New endpoints for Portfolio Margin:
- `GET /sapi/v1/portfolio/pmLoan` to query Portfolio Margin Bankruptcy Loan Record.
- `POST /sapi/v1/portfolio/repay` to repay Portfolio Margin Bankruptcy Loan.
- `GET /sapi/v1/portfolio/collateralRate` to get Portfolio Margin Collateral Rate.

## 1.2.0 - 2022-07-19

### Added

- New endpoint `POST /sapi/v3/asset/getUserAsset`
- New endpoint `GET /sapi/v1/margin/dribblet`

### Update

- Updated endpoint `GET /sapi/v1/convert/tradeFlow` weight

## 1.1.0 - 2022-07-07

### Add

- New endpoint `GET /api/v3/ticker`
- New endpoint `POST /api/v3/order/cancelReplace`
- New websocket stream `<symbol>@ticker_<window_size>`
- New websocket stream `!ticker_<window-size>@arr`

### Update

- Pump `guzzlehttp/guzzle` to latest version
- Apply lint fix

## 1.0.2 - 2022-06-14
- Pump `guzzlehttp/guzzle` to latest version

## 1.0.1 - 2022-06-04
- Update `psr/log` to support latest version
- Fix issue in examples file
- Lint fix

## 1.0.0 - 2022-05-19
- First release
- First release
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,35 @@ echo json_encode($response);

Please find `examples` folder for more endpoints

### RSA Signature
RSA signature is supported.

```php

# RSA Key(Unencrypted) Authentication
$key = ''; # api key is also required
$privateKey = 'file:///path/to/rsa/private/key.pem';

$client = new \Binance\Spot([
'key' => $key,
'privateKey' => $privateKey, # pass the key file directly
'baseURL' => 'https://testnet.binance.vision'
]);

# RSA key(Encrypted) Authentication
$key = '';
$encryptedPrivateKey = 'file:///path/to/rsa/private/key.pem';
$privateKey = openssl_pkey_get_private($encryptedPrivateKey, 'password');

$client = new \Binance\Spot([
'key' => $key,
'privateKey' => $privateKey,
'baseURL' => 'https://testnet.binance.vision'
]);

```


### Testnet

The [spot testnet](https://testnet.binance.vision/) is available. In order to test on testnet:
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"require": {
"php": ">=7.4.0",
"psr/log": "^1|^2|^3",
"guzzlehttp/guzzle": "^7.4",
"guzzlehttp/guzzle": "^7.7",
"ratchet/pawl": "^0.4"
},
"require-dev": {
Expand All @@ -36,7 +36,8 @@
"scripts": {
"test": "phpunit",
"test-coverage": "XDEBUG_MODE=coverage phpunit --coverage-html=build/artifacts/coverage",
"lint-fix": "php-cs-fixer fix --using-cache=no src/",
"lint-check": "php-cs-fixer fix --using-cache=no --stop-on-violation --config=.php-cs-fixer.php -v .",
"lint-fix": "php-cs-fixer fix --using-cache=no --config=.php-cs-fixer.php -v .",
"analyze": "phan --allow-polyfill-parser"
}

Expand Down
Loading