Skip to content

Commit

Permalink
add contract v2
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Nov 20, 2023
1 parent 2e7f197 commit 0478acf
Show file tree
Hide file tree
Showing 13 changed files with 813 additions and 71 deletions.
111 changes: 111 additions & 0 deletions src/Api/ContractV2/Account.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?php
/**
* @author lin <[email protected]>
* */

namespace Lin\Bitget\Api\ContractV2;

use Lin\Bitget\Request;

class Account extends Request
{

/**
*GET /api/v2/mix/account/account
* */
public function getAccount(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/account/account';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/account/accounts
* */
public function getAccounts(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/account/accounts';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/account/sub-account-assets
* */
public function getSubAccountAssets(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/account/sub-account-assets';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/account/open-count
* */
public function getOpenCount(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/account/open-count';

$this->data=$data;
return $this->exec();
}

/**
*POST /api/v2/mix/account/set-leverage
* */
public function postAetLeverage(array $data=[]){
$this->type='POST';
$this->path='/api/v2/mix/account/set-leverage';

$this->data=$data;
return $this->exec();
}

/**
*POST /api/v2/mix/account/set-margin
* */
public function postSetMargin(array $data=[]){
$this->type='POST';
$this->path='/api/v2/mix/account/set-margin';

$this->data=$data;
return $this->exec();
}

/**
*POST /api/v2/mix/account/set-margin-mode
* */
public function postSetMarginMode(array $data=[]){
$this->type='POST';
$this->path='/api/v2/mix/account/set-margin-mode';

$this->data=$data;
return $this->exec();
}

/**
*POST /api/v2/mix/account/set-position-mode
* */
public function postSetPositionMode(array $data=[]){
$this->type='POST';
$this->path='/api/v2/mix/account/set-position-mode';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/account/bill
* */
public function getBill(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/account/bill';

$this->data=$data;
return $this->exec();
}
}
199 changes: 199 additions & 0 deletions src/Api/ContractV2/Market.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
<?php
/**
* @author lin <[email protected]>
* */

namespace Lin\Bitget\Api\ContractV2;

use Lin\Bitget\Request;

class Market extends Request
{

/**
*GET /api/v2/mix/market/vip-fee-rate
* */
public function getVipFeeRate(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/vip-fee-rate';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/merge-depth
* */
public function getMergeDepth(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/merge-depth';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/ticker
* */
public function getTicker(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/ticker';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/tickers
* */
public function getTickers(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/tickers';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/fills
* */
public function getFills(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/fills';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/fills-history
* */
public function getFillsHistory(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/fills-history';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/candles
* */
public function getCandles(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/candles';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/history-candles
* */
public function getHistoryCandles(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/history-candles';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/history-index-candles
* */
public function getHistoryIndexCandles(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/history-index-candles';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/history-mark-candles
* */
public function getHistoryMarkCandles(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/history-mark-candles';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/open-interest
* */
public function getOpenInterest(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/open-interest';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/funding-time
* */
public function getFundingTime(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/funding-time';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/symbol-price
* */
public function getSymbolPrice(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/symbol-price';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/history-fund-rate
* */
public function getHistoryFundRate(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/history-fund-rate';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/current-fund-rate
* */
public function getCurrentFundRate(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/current-fund-rate';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/contracts
* */
public function getContracts(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/contracts';

$this->data=$data;
return $this->exec();
}

/**
*GET /api/v2/mix/market/query-position-lever
* */
public function getQueryPositionLever(array $data=[]){
$this->type='GET';
$this->path='/api/v2/mix/market/query-position-lever';

$this->data=$data;
return $this->exec();
}
}
Loading

0 comments on commit 0478acf

Please sign in to comment.