Skip to content

Commit

Permalink
Merge pull request #1 from Time02/master
Browse files Browse the repository at this point in the history
fix conex to coinex
  • Loading branch information
zhouaini528 authored Jul 17, 2021
2 parents 43bb82e + b38fd98 commit 5b77afa
Show file tree
Hide file tree
Showing 10 changed files with 709 additions and 120 deletions.
589 changes: 589 additions & 0 deletions Find Results

Large diffs are not rendered by default.

80 changes: 40 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ Most of the interface is now complete, and the user can continue to extend it ba

[Kraken](https://github.com/zhouaini528/kraken-php)

[Gate](https://github.com/zhouaini528/gate-php)
[Gate](https://github.com/zhouaini528/gate-php)

[Bigone](https://github.com/zhouaini528/bigone-php)
[Bigone](https://github.com/zhouaini528/bigone-php)

[Crex24](https://github.com/zhouaini528/crex24-php)
[Crex24](https://github.com/zhouaini528/crex24-php)

[Bybit](https://github.com/zhouaini528/bybit-php)
[Bybit](https://github.com/zhouaini528/bybit-php)

[Coinbene](https://github.com/zhouaini528/coinbene-php)
[Coinbene](https://github.com/zhouaini528/coinbene-php)

[Bitget](https://github.com/zhouaini528/bitget-php)
[Bitget](https://github.com/zhouaini528/bitget-php)

[Poloniex](https://github.com/zhouaini528/poloniex-php)

Expand All @@ -73,7 +73,7 @@ $coinex=new CoinexPerpetual();
$coinex->setOptions([
//Set the request timeout to 60 seconds by default
'timeout'=>10,

//https://github.com/guzzle/guzzle
'proxy'=>[],

Expand All @@ -87,17 +87,17 @@ $coinex->setOptions([
Market API [More](https://github.com/zhouaini528/coinex-php/tree/master/src/Api/Exchange/Market.php)

```php
$conex=new CoinexExchange();
$coinex=new CoinexExchange();

try {
$result=$conex->market()->getMarketList();
$result=$coinex->market()->getMarketList();
print_r($result);
}catch (\Exception $e){
print_r(json_decode($e->getMessage(),true));
}

try {
$result=$conex->market()->getMarketTicker([
$result=$coinex->market()->getMarketTicker([
'market'=>'BCHBTC'
]);
print_r($result);
Expand All @@ -106,7 +106,7 @@ try {
}

try {
$result=$conex->market()->getMarketDepth([
$result=$coinex->market()->getMarketDepth([
'market'=>'BCHBTC',
'merge'=>'0.1'
]);
Expand All @@ -116,7 +116,7 @@ try {
}

try {
$result=$conex->market()->getMarketKline([
$result=$coinex->market()->getMarketKline([
'market'=>'BCHBTC',
'type'=>'4hour'
]);
Expand All @@ -129,32 +129,32 @@ try {
Account API [More](https://github.com/zhouaini528/coinex-php/tree/master/src/Api/Exchange/Account.php)

```php
$conex=new CoinexExchange($key,$secret);
$coinex=new CoinexExchange($key,$secret);

try {
$result=$conex->account()->getBalanceInfo([
$result=$coinex->account()->getBalanceInfo([
//You can 'access_id' and 'tonxe' leave it blank
'access_id'=>$key,
'tonce'=>time().'000',
]);

//You can 'access_id' and 'tonxe' leave it blank
$result=$conex->account()->getBalanceInfo();
$result=$coinex->account()->getBalanceInfo();
print_r($result);
}catch (\Exception $e){
print_r(json_decode($e->getMessage(),true));
}

try {
//You can 'access_id' and 'tonxe' leave it blank
$result=$conex->account()->getBalanceCoinWithdraw();
$result=$coinex->account()->getBalanceCoinWithdraw();
print_r($result);
}catch (\Exception $e){
print_r(json_decode($e->getMessage(),true));
}

try {
$result=$conex->account()->getCreditInfo();
$result=$coinex->account()->getCreditInfo();
print_r($result);
}catch (\Exception $e){
print_r(json_decode($e->getMessage(),true));
Expand All @@ -165,11 +165,11 @@ try {
Trading API [More](https://github.com/zhouaini528/coinex-php/tree/master/src/Api/Exchange/Trading.php)

```php
$conex=new CoinexExchange($key,$secret);
$coinex=new CoinexExchange($key,$secret);

try {
//You can 'access_id' and 'tonxe' leave it blank
$result=$conex->trading()->postMarket([
$result=$coinex->trading()->postMarket([
//'access_id'=>'xxxxx',
//'tonce'=>time().'000',
'market'=>'BCHBTC',
Expand All @@ -184,7 +184,7 @@ try {

try {
//You can 'access_id' and 'tonxe' leave it blank
$result=$conex->trading()->getStatus([
$result=$coinex->trading()->getStatus([
//'access_id'=>'xxxxx',
//'tonce'=>time().'000',
'id'=>'99999999',
Expand All @@ -197,7 +197,7 @@ try {

try {
//You can 'access_id' and 'tonxe' leave it blank
$result=$conex->trading()->deletePending([
$result=$coinex->trading()->deletePending([
'id'=>'9999999',
'market'=>'BCHBTC',
'type'=>'0'
Expand All @@ -212,11 +212,11 @@ try {
Margin API [More](https://github.com/zhouaini528/coinex-php/tree/master/src/Api/Exchange/Margin.php)

```php
$conex=new CoinexExchange($key,$secret);
$coinex=new CoinexExchange($key,$secret);

try {
//You can 'access_id' and 'tonxe' leave it blank
$result=$conex->margin()->getAccount([
$result=$coinex->margin()->getAccount([
'market'=>'BCHBTC'
]);
print_r($result);
Expand All @@ -225,7 +225,7 @@ try {
}

try {
$result=$conex->margin()->getMarket();
$result=$coinex->margin()->getMarket();
print_r($result);
}catch (\Exception $e){
print_r(json_decode($e->getMessage(),true));
Expand All @@ -240,24 +240,24 @@ More Test [more](https://github.com/zhouaini528/coinex-php/blob/master/tests/exc
Market API [More](https://github.com/zhouaini528/coinex-php/tree/master/src/Api/Perpetual/Market.php)

```php
$conex=new CoinexPerpetual();
$coinex=new CoinexPerpetual();

try {
$result=$conex->market()->getList();
$result=$coinex->market()->getList();
print_r($result);
}catch (\Exception $e){
print_r($e->getMessage());
}

try {
$result=$conex->market()->getLimitConfig();
$result=$coinex->market()->getLimitConfig();
print_r($result);
}catch (\Exception $e){
print_r($e->getMessage());
}

try {
$result=$conex->market()->getTicker([
$result=$coinex->market()->getTicker([
'market'=>'BTCUSD'
]);
print_r($result);
Expand All @@ -266,14 +266,14 @@ try {
}

try {
$result=$conex->market()->getTickerAll();
$result=$coinex->market()->getTickerAll();
print_r($result);
}catch (\Exception $e){
print_r($e->getMessage());
}

try {
$result=$conex->market()->getDepth([
$result=$coinex->market()->getDepth([
'market'=>'BTCUSD',
'merge'=>'0.1',
'limit'=>'10'
Expand All @@ -284,7 +284,7 @@ try {
}

try {
$result=$conex->market()->getDeals([
$result=$coinex->market()->getDeals([
'market'=>'BTCUSD',
]);
print_r($result);
Expand All @@ -296,10 +296,10 @@ try {
Order API [More](https://github.com/zhouaini528/coinex-php/tree/master/src/Api/Perpetual/Order.php)

```php
$conex=new CoinexPerpetual($key,$secret);
$coinex=new CoinexPerpetual($key,$secret);

try {
$result=$conex->order()->postPutMarket([
$result=$coinex->order()->postPutMarket([
'market'=>'BTCUSD',
'side'=>'2',
'amount'=>'10',
Expand All @@ -311,7 +311,7 @@ try {
}

try {
$result=$conex->order()->postPutStopLimit([
$result=$coinex->order()->postPutStopLimit([
'market'=>'BTCUSD',
'side'=>'2',
'amount'=>'10',
Expand All @@ -327,7 +327,7 @@ try {
}

try {
$result=$conex->order()->getStatus([
$result=$coinex->order()->getStatus([
'market'=>'BTCUSD',
'order_id'=>'9999999',
]);
Expand All @@ -337,7 +337,7 @@ try {
}

try {
$result=$conex->order()->postCancel([
$result=$coinex->order()->postCancel([
'market'=>'BTCUSD',
'order_id'=>'9999999',
]);
Expand All @@ -350,10 +350,10 @@ try {
Position API [More](https://github.com/zhouaini528/coinex-php/tree/master/src/Api/Perpetual/Position.php)

```php
$conex=new CoinexPerpetual($key,$secret);
$coinex=new CoinexPerpetual($key,$secret);

try {
$result=$conex->position()->getPending([
$result=$coinex->position()->getPending([
'market'=>'BTCUSD',
]);
print_r($result);
Expand All @@ -362,7 +362,7 @@ try {
}

try {
$result=$conex->position()->getFunding([
$result=$coinex->position()->getFunding([
'market'=>'BTCUSD',
'offset'=>'10',
'limit'=>'10'
Expand All @@ -373,7 +373,7 @@ try {
}

try {
$result=$conex->position()->postAdjustMargin([
$result=$coinex->position()->postAdjustMargin([
'market'=>'BTCUSD',
'amount'=>'1',
'type'=>'1',
Expand Down
Loading

0 comments on commit 5b77afa

Please sign in to comment.