���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/trader/vendor/linwj/binance/tests/delivery/ |
<?php /** * @author lin <[email protected]> * * Fill in your key and secret and pass can be directly run * * Most of them are unfinished and need your help * https://github.com/zhouaini528/huobi-php.git * */ use Lin\Binance\BinanceDelivery; require __DIR__ .'../../../vendor/autoload.php'; include 'key_secret.php'; $binance=new BinanceDelivery($key,$secret); $binance->setOptions([ //Set the request timeout to 60 seconds by default 'timeout'=>10, //https://github.com/guzzle/guzzle 'proxy'=>[], //https://www.php.net/manual/en/book.curl.php 'curl'=>[], //default is v1 //'version'=>'v1', ]); //Send in a new order. try { $result=$binance->trade()->postOrder([ 'symbol'=>'ETHUSD_201225', 'side'=>'BUY', 'type'=>'LIMIT', 'quantity'=>'1', 'price'=>'50', 'timeInForce'=>'GTC', //'newClientOrderId'=>'xxxxxxx' ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); } sleep(1); //Check an order's status. try { $result=$binance->user()->getOrder([ 'symbol'=>'ETHUSD_201225', 'orderId'=>$result['orderId'], //'origClientOrderId'=>$result['clientOrderId'], ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); } sleep(1); //Cancel an active order. try { $result=$binance->trade()->deleteOrder([ 'symbol'=>'ETHUSD_201225', 'orderId'=>$result['orderId'], 'origClientOrderId'=>$result['clientOrderId'], ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); }