diff --git a/README.md b/README.md index 291d70d..09ba12e 100644 --- a/README.md +++ b/README.md @@ -64,22 +64,17 @@ $mexc=new MxcSpot($key,$secret); $mexc->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'=>[], - //If you are developing locally and need an agent, you can set this - //'proxy'=>true, - //More flexible Settings - /* 'proxy'=>[ - 'http' => 'http://127.0.0.1:12333', - 'https' => 'http://127.0.0.1:12333', - 'no' => ['.cn'] - ], */ - - //Close the certificate - //'verify'=>false, + //Set Demo Trading + 'headers'=>['x-simulated-trading'=>1] ]); ``` -### Mxc Spot API +### Mxc Spot API,[Support Spot V3](https://github.com/zhouaini528/mxc-php/blob/master/tests/spot_v3) Order Book [More](https://github.com/zhouaini528/mxc-php/blob/master/tests/spot/market.php) diff --git a/README_CN.md b/README_CN.md index 17d7edc..26b5c21 100644 --- a/README_CN.md +++ b/README_CN.md @@ -65,22 +65,17 @@ $mexc=new MxcSpot($key,$secret); $mexc->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'=>[], - //If you are developing locally and need an agent, you can set this - //'proxy'=>true, - //More flexible Settings - /* 'proxy'=>[ - 'http' => 'http://127.0.0.1:12333', - 'https' => 'http://127.0.0.1:12333', - 'no' => ['.cn'] - ], */ - - //Close the certificate - //'verify'=>false, + //Set Demo Trading + 'headers'=>['x-simulated-trading'=>1] ]); ``` -### Mxc 现货交易 API +### Mxc 现货交易 API,[支持现货V3接口](https://github.com/zhouaini528/mxc-php/blob/master/tests/spot_v3) 行情数据 [More](https://github.com/zhouaini528/mxc-php/blob/master/tests/spot/market.php) diff --git a/tests/spot_v3/accounts.php b/tests/spot_v3/accounts.php new file mode 100644 index 0000000..27e2385 --- /dev/null +++ b/tests/spot_v3/accounts.php @@ -0,0 +1,36 @@ + + * + * 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/Mxc-php.git + * */ +use Lin\Mxc\MxcSpotV3; + +require __DIR__ .'../../../vendor/autoload.php'; + +include 'key_secret.php'; + +$mexc=new MxcSpotV3($key,$secret); + +//You can set special needs +$mexc->setOptions([ + //Set the request timeout to 60 seconds by default + 'timeout'=>10, + +]); + +try { + $result=$mexc->privates()->getAccount(); + print_r($result); +}catch (\Exception $e){ + print_r(json_decode($e->getMessage(),true)); +} + + + + diff --git a/tests/spot_v3/market.php b/tests/spot_v3/market.php new file mode 100644 index 0000000..09f78b7 --- /dev/null +++ b/tests/spot_v3/market.php @@ -0,0 +1,70 @@ + + * + * 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/Mxc-php.git + * */ +use Lin\Mxc\MxcSpotV3; + +require __DIR__ .'../../../vendor/autoload.php'; + +include 'key_secret.php'; + +$mexc=new MxcSpotV3(); + +//You can set special needs +$mexc->setOptions([ + //Set the request timeout to 60 seconds by default + 'timeout'=>10, + +]); +/* +try { + $result=$mexc->publics()->getTime(); + print_r($result); +}catch (\Exception $e){ + print_r($e->getMessage()); +} + +//try { +// $result=$mexc->publics()->getExchangeInfo(); +// print_r($result); +//}catch (\Exception $e){ +// print_r($e->getMessage()); +//} + +try { + $result=$mexc->publics()->getDepth([ + 'symbol'=>'BTCUSDT', + 'limit'=>10 + ]); + print_r($result); +}catch (\Exception $e){ + print_r($e->getMessage()); +} + +try { + $result=$mexc->publics()->getTrades([ + 'symbol'=>'BTCUSDT', + 'limit'=>10 + ]); + print_r($result); +}catch (\Exception $e){ + print_r($e->getMessage()); +} +*/ +try { + $result=$mexc->publics()->getKline([ + 'symbol'=>'BTCUSDT', + 'interval'=>'60m' + ]); + print_r($result); +}catch (\Exception $e){ + print_r($e->getMessage()); +} +