diff --git a/README.md b/README.md index 57b0faf..976ec0d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,3 @@ -# DISCORD -```shell -wilianmaique -``` - # MEXC-API PHP lib mexc api simple, for detail account, balance spot, withdraw info token, etc... diff --git a/examples/index.php b/examples/index.php index 31a52d7..a06e408 100644 --- a/examples/index.php +++ b/examples/index.php @@ -1,19 +1,21 @@ 'https://api.mexc.com/api/v3', - 'MEXC_API_ACCESS_KEY' => 'mx0vglDTfAPSDCof1m', - 'MEXC_API_SECRET' => '7cf68dd323074ba3b21554091290b607' + 'MEXC_URL_API' => 'https://api.mexc.com/api/v3', + 'MEXC_API_ACCESS_KEY' => 'mx0vgleBCS3z3msSyq', + 'MEXC_API_SECRET' => 'f7d42e5beb7948e083b3d44d2beb4876' ]; require __DIR__ . '/../vendor/autoload.php'; use WilianMaique\Mexc\Mexc\Account; +use WilianMaique\Mexc\Mexc\ExchangeInfo; use WilianMaique\Mexc\Mexc\InfoToken; use WilianMaique\Mexc\Mexc\PriceTicker; dd([ - 'InfoToken' => InfoToken::get('WEMIX'), - 'Account' => Account::get(), - 'PriceTicker' => PriceTicker::get(), -]); \ No newline at end of file + 'ExchangeInfo' => ExchangeInfo::get(['MXUSDT', 'BTCUSDT']), + 'InfoToken' => InfoToken::get('WEMIX'), + 'Account' => Account::get(), + 'PriceTicker' => PriceTicker::get('WEMIXUSDT'), +]); diff --git a/src/Mexc/ExchangeInfo.php b/src/Mexc/ExchangeInfo.php new file mode 100644 index 0000000..81353c9 --- /dev/null +++ b/src/Mexc/ExchangeInfo.php @@ -0,0 +1,39 @@ + 'GET', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_SSL_VERIFYPEER => true, + ]); + + $res = curl_exec($ch); + + if (!$res) { + curl_close($ch); + return false; + } + + curl_close($ch); + + return json_decode($res, true); + } +}