From 1828b8ebfba1d921020659d3ddadf873f620732a Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Wed, 23 Jun 2021 11:32:27 +0800 Subject: [PATCH 01/17] add order book update ts and cross margin account history --- README.md | 6 +- composer.json | 2 +- composer.lock | 38 +- docs/Api/MarginApi.md | 77 ++++- docs/Model/CrossMarginAccountBook.md | 14 + docs/Model/FuturesOrderBook.md | 2 + docs/Model/MarginAccountBook.md | 1 + docs/Model/OrderBook.md | 2 + src/Api/MarginApi.php | 351 +++++++++++++++++++ src/Configuration.php | 6 +- src/Model/CrossMarginAccountBook.php | 500 +++++++++++++++++++++++++++ src/Model/FuturesOrderBook.php | 60 ++++ src/Model/MarginAccountBook.php | 30 ++ src/Model/OrderBook.php | 60 ++++ 14 files changed, 1123 insertions(+), 26 deletions(-) create mode 100644 docs/Model/CrossMarginAccountBook.md create mode 100644 src/Model/CrossMarginAccountBook.php diff --git a/README.md b/README.md index 5b57072..7c10209 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.21.2 -- Package version: 5.21.2 +- API version: 4.21.4 +- Package version: 5.21.4 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) @@ -181,6 +181,7 @@ Class | Method | HTTP request | Description *MarginApi* | [**listCrossMarginCurrencies**](docs/Api/MarginApi.md#listcrossmargincurrencies) | **GET** /margin/cross/currencies | Currencies supported by cross margin. *MarginApi* | [**getCrossMarginCurrency**](docs/Api/MarginApi.md#getcrossmargincurrency) | **GET** /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin *MarginApi* | [**getCrossMarginAccount**](docs/Api/MarginApi.md#getcrossmarginaccount) | **GET** /margin/cross/accounts | Retrieve cross margin account +*MarginApi* | [**listCrossMarginAccountBook**](docs/Api/MarginApi.md#listcrossmarginaccountbook) | **GET** /margin/cross/account_book | Retrieve cross margin account change history *MarginApi* | [**listCrossMarginLoans**](docs/Api/MarginApi.md#listcrossmarginloans) | **GET** /margin/cross/loans | List cross margin borrow history *MarginApi* | [**createCrossMarginLoan**](docs/Api/MarginApi.md#createcrossmarginloan) | **POST** /margin/cross/loans | Create a cross margin borrow loan *MarginApi* | [**getCrossMarginLoan**](docs/Api/MarginApi.md#getcrossmarginloan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail @@ -232,6 +233,7 @@ Class | Method | HTTP request | Description - [Contract](docs/Model/Contract.md) - [ContractStat](docs/Model/ContractStat.md) - [CrossMarginAccount](docs/Model/CrossMarginAccount.md) + - [CrossMarginAccountBook](docs/Model/CrossMarginAccountBook.md) - [CrossMarginBalance](docs/Model/CrossMarginBalance.md) - [CrossMarginCurrency](docs/Model/CrossMarginCurrency.md) - [CrossMarginLoan](docs/Model/CrossMarginLoan.md) diff --git a/composer.json b/composer.json index cf065ac..1228e11 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.21.2", + "version": "5.21.4", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index fa78f6d..38fe981 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f958b6eba0c444b82e2d03ad96889b48", + "content-hash": "bad83845cc0eb6ceaf672cb67be6d531", "packages": [ { "name": "guzzlehttp/guzzle", @@ -3065,16 +3065,16 @@ }, { "name": "symfony/console", - "version": "v5.3.0", + "version": "v5.3.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "058553870f7809087fa80fa734704a21b9bcaeb2" + "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/058553870f7809087fa80fa734704a21b9bcaeb2", - "reference": "058553870f7809087fa80fa734704a21b9bcaeb2", + "url": "https://api.github.com/repos/symfony/console/zipball/649730483885ff2ca99ca0560ef0e5f6b03f2ac1", + "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1", "shasum": "", "mirrors": [ { @@ -3149,7 +3149,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.0" + "source": "https://github.com/symfony/console/tree/v5.3.2" }, "funding": [ { @@ -3165,7 +3165,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:43:10+00:00" + "time": "2021-06-12T09:42:48+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4134,16 +4134,16 @@ }, { "name": "symfony/process", - "version": "v5.3.0", + "version": "v5.3.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "53e36cb1c160505cdaf1ef201501669c4c317191" + "reference": "714b47f9196de61a196d86c4bad5f09201b307df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/53e36cb1c160505cdaf1ef201501669c4c317191", - "reference": "53e36cb1c160505cdaf1ef201501669c4c317191", + "url": "https://api.github.com/repos/symfony/process/zipball/714b47f9196de61a196d86c4bad5f09201b307df", + "reference": "714b47f9196de61a196d86c4bad5f09201b307df", "shasum": "", "mirrors": [ { @@ -4182,7 +4182,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.3.0" + "source": "https://github.com/symfony/process/tree/v5.3.2" }, "funding": [ { @@ -4198,7 +4198,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T12:52:38+00:00" + "time": "2021-06-12T10:15:01+00:00" }, { "name": "symfony/service-contracts", @@ -4355,16 +4355,16 @@ }, { "name": "symfony/string", - "version": "v5.3.0", + "version": "v5.3.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "a9a0f8b6aafc5d2d1c116dcccd1573a95153515b" + "reference": "0732e97e41c0a590f77e231afc16a327375d50b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a9a0f8b6aafc5d2d1c116dcccd1573a95153515b", - "reference": "a9a0f8b6aafc5d2d1c116dcccd1573a95153515b", + "url": "https://api.github.com/repos/symfony/string/zipball/0732e97e41c0a590f77e231afc16a327375d50b0", + "reference": "0732e97e41c0a590f77e231afc16a327375d50b0", "shasum": "", "mirrors": [ { @@ -4424,7 +4424,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.0" + "source": "https://github.com/symfony/string/tree/v5.3.2" }, "funding": [ { @@ -4440,7 +4440,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:43:10+00:00" + "time": "2021-06-06T09:51:56+00:00" }, { "name": "theseer/tokenizer", diff --git a/docs/Api/MarginApi.md b/docs/Api/MarginApi.md index 0f692ab..a423afd 100644 --- a/docs/Api/MarginApi.md +++ b/docs/Api/MarginApi.md @@ -26,6 +26,7 @@ Method | HTTP request | Description [**listCrossMarginCurrencies**](MarginApi.md#listCrossMarginCurrencies) | **GET** /margin/cross/currencies | Currencies supported by cross margin. [**getCrossMarginCurrency**](MarginApi.md#getCrossMarginCurrency) | **GET** /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin [**getCrossMarginAccount**](MarginApi.md#getCrossMarginAccount) | **GET** /margin/cross/accounts | Retrieve cross margin account +[**listCrossMarginAccountBook**](MarginApi.md#listCrossMarginAccountBook) | **GET** /margin/cross/account_book | Retrieve cross margin account change history [**listCrossMarginLoans**](MarginApi.md#listCrossMarginLoans) | **GET** /margin/cross/loans | List cross margin borrow history [**createCrossMarginLoan**](MarginApi.md#createCrossMarginLoan) | **POST** /margin/cross/loans | Create a cross margin borrow loan [**getCrossMarginLoan**](MarginApi.md#getCrossMarginLoan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail @@ -265,7 +266,7 @@ Name | Type | Description | Notes List margin account balance change history -Only transferring from or to margin account are provided for now. Time range allows 30 days at most +Only transferals from and to margin account are provided for now. Time range allows 30 days at most ### Example @@ -1379,6 +1380,80 @@ This endpoint does not need any parameter. [[Back to README]](../../README.md) +## listCrossMarginAccountBook + +> \GateApi\Model\CrossMarginAccountBook[] listCrossMarginAccountBook($currency, $from, $to, $page, $limit, $type) + +Retrieve cross margin account change history + +Record time range cannot exceed 30 days + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\MarginApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['currency'] = 'currency_example'; // string | Filter by currency +$associate_array['from'] = 56; // int | Time range beginning, default to 7 days before current time +$associate_array['to'] = 56; // int | Time range ending, default to current time +$associate_array['page'] = 1; // int | Page number +$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['type'] = 'borrow'; // string | Filter by account change type. All types are returned if not specified. + +try { + $result = $apiInstance->listCrossMarginAccountBook($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling MarginApi->listCrossMarginAccountBook: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **string**| Filter by currency | [optional] + **from** | **int**| Time range beginning, default to 7 days before current time | [optional] + **to** | **int**| Time range ending, default to current time | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **type** | **string**| Filter by account change type. All types are returned if not specified. | [optional] + +### Return type + +[**\GateApi\Model\CrossMarginAccountBook[]**](../Model/CrossMarginAccountBook.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listCrossMarginLoans > \GateApi\Model\CrossMarginLoan[] listCrossMarginLoans($status, $currency, $limit, $offset, $reverse) diff --git a/docs/Model/CrossMarginAccountBook.md b/docs/Model/CrossMarginAccountBook.md new file mode 100644 index 0000000..95701a3 --- /dev/null +++ b/docs/Model/CrossMarginAccountBook.md @@ -0,0 +1,14 @@ +# # CrossMarginAccountBook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Balance change record ID | [optional] +**time** | **int** | Account changed timestamp in milliseconds | [optional] +**currency** | **string** | Currency changed | [optional] +**change** | **string** | Amount changed. Positive value means transferring in, while negative out | [optional] +**balance** | **string** | Balance after change | [optional] +**type** | **string** | Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesOrderBook.md b/docs/Model/FuturesOrderBook.md index 784ae89..ec2addb 100644 --- a/docs/Model/FuturesOrderBook.md +++ b/docs/Model/FuturesOrderBook.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Order Book ID. Increase by 1 on every order book change. Set `with_id=true` to include this field in response | [optional] +**current** | **double** | Response data generation timestamp | [optional] +**update** | **double** | Order book changed timestamp | [optional] **asks** | [**\GateApi\Model\FuturesOrderBookItem[]**](FuturesOrderBookItem.md) | Asks order depth | **bids** | [**\GateApi\Model\FuturesOrderBookItem[]**](FuturesOrderBookItem.md) | Bids order depth | diff --git a/docs/Model/MarginAccountBook.md b/docs/Model/MarginAccountBook.md index a24b485..dbcde30 100644 --- a/docs/Model/MarginAccountBook.md +++ b/docs/Model/MarginAccountBook.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | Balance change record ID | [optional] **time** | **string** | Balance changed timestamp | [optional] +**time_ms** | **int** | Account changed timestamp in milliseconds | [optional] **currency** | **string** | Currency changed | [optional] **currency_pair** | **string** | Account currency pair | [optional] **change** | **string** | Amount changed. Positive value means transferring in, while negative out | [optional] diff --git a/docs/Model/OrderBook.md b/docs/Model/OrderBook.md index d7ec33a..385c643 100644 --- a/docs/Model/OrderBook.md +++ b/docs/Model/OrderBook.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Order book ID, which is updated whenever the order book is changed. Valid only when `with_id` is set to `true` | [optional] +**current** | **int** | Response data generation timestamp in milliseconds | [optional] +**update** | **int** | Order book changed timestamp in milliseconds | [optional] **asks** | [**string[][]**](array.md) | Asks order depth | **bids** | [**string[][]**](array.md) | Bids order depth | diff --git a/src/Api/MarginApi.php b/src/Api/MarginApi.php index a038b57..7bb8517 100644 --- a/src/Api/MarginApi.php +++ b/src/Api/MarginApi.php @@ -5786,6 +5786,357 @@ protected function getCrossMarginAccountRequest() ); } + /** + * Operation listCrossMarginAccountBook + * + * Retrieve cross margin account change history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Filter by currency (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $page Page number (optional, default to 1) + * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param string $type Filter by account change type. All types are returned if not specified. (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\CrossMarginAccountBook[] + */ + public function listCrossMarginAccountBook($associative_array) + { + list($response) = $this->listCrossMarginAccountBookWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listCrossMarginAccountBookWithHttpInfo + * + * Retrieve cross margin account change history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Filter by currency (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $page Page number (optional, default to 1) + * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param string $type Filter by account change type. All types are returned if not specified. (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\CrossMarginAccountBook[], HTTP status code, HTTP response headers (array of strings) + */ + public function listCrossMarginAccountBookWithHttpInfo($associative_array) + { + $request = $this->listCrossMarginAccountBookRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\CrossMarginAccountBook[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listCrossMarginAccountBookAsync + * + * Retrieve cross margin account change history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Filter by currency (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $page Page number (optional, default to 1) + * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param string $type Filter by account change type. All types are returned if not specified. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listCrossMarginAccountBookAsync($associative_array) + { + return $this->listCrossMarginAccountBookAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listCrossMarginAccountBookAsyncWithHttpInfo + * + * Retrieve cross margin account change history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Filter by currency (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $page Page number (optional, default to 1) + * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param string $type Filter by account change type. All types are returned if not specified. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listCrossMarginAccountBookAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\CrossMarginAccountBook[]'; + $request = $this->listCrossMarginAccountBookRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listCrossMarginAccountBook' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Filter by currency (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $page Page number (optional, default to 1) + * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param string $type Filter by account change type. All types are returned if not specified. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listCrossMarginAccountBookRequest($associative_array) + { + // unbox the parameters from the associative array + $currency = array_key_exists('currency', $associative_array) ? $associative_array['currency'] : null; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + $page = array_key_exists('page', $associative_array) ? $associative_array['page'] : 1; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $type = array_key_exists('type', $associative_array) ? $associative_array['type'] : null; + + if ($page !== null && $page < 1) { + throw new \InvalidArgumentException('invalid value for "$page" when calling MarginApi.listCrossMarginAccountBook, must be bigger than or equal to 1.'); + } + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling MarginApi.listCrossMarginAccountBook, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling MarginApi.listCrossMarginAccountBook, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/margin/cross/account_book'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($currency !== null) { + if('form' === 'form' && is_array($currency)) { + foreach($currency as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency'] = $currency; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // query params + if ($page !== null) { + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($type !== null) { + if('form' === 'form' && is_array($type)) { + foreach($type as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['type'] = $type; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listCrossMarginLoans * diff --git a/src/Configuration.php b/src/Configuration.php index d5a0931..7309a3e 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.21.2/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.21.4/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.21.2' . PHP_EOL; - $report .= ' SDK Package Version: 5.21.2' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.21.4' . PHP_EOL; + $report .= ' SDK Package Version: 5.21.4' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/CrossMarginAccountBook.php b/src/Model/CrossMarginAccountBook.php new file mode 100644 index 0000000..c52011b --- /dev/null +++ b/src/Model/CrossMarginAccountBook.php @@ -0,0 +1,500 @@ + 'string', + 'time' => 'int', + 'currency' => 'string', + 'change' => 'string', + 'balance' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'time' => 'int64', + 'currency' => null, + 'change' => null, + 'balance' => null, + 'type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'time' => 'time', + 'currency' => 'currency', + 'change' => 'change', + 'balance' => 'balance', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'time' => 'setTime', + 'currency' => 'setCurrency', + 'change' => 'setChange', + 'balance' => 'setBalance', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'time' => 'getTime', + 'currency' => 'getCurrency', + 'change' => 'getChange', + 'balance' => 'getBalance', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPE_IN = 'in'; + const TYPE_OUT = 'out'; + const TYPE_REPAY = 'repay'; + const TYPE_BORROW = 'borrow'; + const TYPE_NEW_ORDER = 'new_order'; + const TYPE_ORDER_FILL = 'order_fill'; + const TYPE_REFERRAL_FEE = 'referral_fee'; + const TYPE_ORDER_FEE = 'order_fee'; + const TYPE_UNKNOWN = 'unknown'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_IN, + self::TYPE_OUT, + self::TYPE_REPAY, + self::TYPE_BORROW, + self::TYPE_NEW_ORDER, + self::TYPE_ORDER_FILL, + self::TYPE_REFERRAL_FEE, + self::TYPE_ORDER_FEE, + self::TYPE_UNKNOWN, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['change'] = isset($data['change']) ? $data['change'] : null; + $this->container['balance'] = isset($data['balance']) ? $data['balance'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Balance change record ID + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets time + * + * @return int|null + */ + public function getTime() + { + return $this->container['time']; + } + + /** + * Sets time + * + * @param int|null $time Account changed timestamp in milliseconds + * + * @return $this + */ + public function setTime($time) + { + $this->container['time'] = $time; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency Currency changed + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets change + * + * @return string|null + */ + public function getChange() + { + return $this->container['change']; + } + + /** + * Sets change + * + * @param string|null $change Amount changed. Positive value means transferring in, while negative out + * + * @return $this + */ + public function setChange($change) + { + $this->container['change'] = $change; + + return $this; + } + + /** + * Gets balance + * + * @return string|null + */ + public function getBalance() + { + return $this->container['balance']; + } + + /** + * Sets balance + * + * @param string|null $balance Balance after change + * + * @return $this + */ + public function setBalance($balance) + { + $this->container['balance'] = $balance; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FuturesOrderBook.php b/src/Model/FuturesOrderBook.php index fefc166..5cec089 100644 --- a/src/Model/FuturesOrderBook.php +++ b/src/Model/FuturesOrderBook.php @@ -55,6 +55,8 @@ class FuturesOrderBook implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'id' => 'int', + 'current' => 'double', + 'update' => 'double', 'asks' => '\GateApi\Model\FuturesOrderBookItem[]', 'bids' => '\GateApi\Model\FuturesOrderBookItem[]' ]; @@ -66,6 +68,8 @@ class FuturesOrderBook implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'id' => 'int64', + 'current' => 'double', + 'update' => 'double', 'asks' => null, 'bids' => null ]; @@ -98,6 +102,8 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'id' => 'id', + 'current' => 'current', + 'update' => 'update', 'asks' => 'asks', 'bids' => 'bids' ]; @@ -109,6 +115,8 @@ public static function openAPIFormats() */ protected static $setters = [ 'id' => 'setId', + 'current' => 'setCurrent', + 'update' => 'setUpdate', 'asks' => 'setAsks', 'bids' => 'setBids' ]; @@ -120,6 +128,8 @@ public static function openAPIFormats() */ protected static $getters = [ 'id' => 'getId', + 'current' => 'getCurrent', + 'update' => 'getUpdate', 'asks' => 'getAsks', 'bids' => 'getBids' ]; @@ -185,6 +195,8 @@ public function getModelName() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['current'] = isset($data['current']) ? $data['current'] : null; + $this->container['update'] = isset($data['update']) ? $data['update'] : null; $this->container['asks'] = isset($data['asks']) ? $data['asks'] : null; $this->container['bids'] = isset($data['bids']) ? $data['bids'] : null; } @@ -243,6 +255,54 @@ public function setId($id) return $this; } + /** + * Gets current + * + * @return double|null + */ + public function getCurrent() + { + return $this->container['current']; + } + + /** + * Sets current + * + * @param double|null $current Response data generation timestamp + * + * @return $this + */ + public function setCurrent($current) + { + $this->container['current'] = $current; + + return $this; + } + + /** + * Gets update + * + * @return double|null + */ + public function getUpdate() + { + return $this->container['update']; + } + + /** + * Sets update + * + * @param double|null $update Order book changed timestamp + * + * @return $this + */ + public function setUpdate($update) + { + $this->container['update'] = $update; + + return $this; + } + /** * Gets asks * diff --git a/src/Model/MarginAccountBook.php b/src/Model/MarginAccountBook.php index 702368d..853099a 100644 --- a/src/Model/MarginAccountBook.php +++ b/src/Model/MarginAccountBook.php @@ -56,6 +56,7 @@ class MarginAccountBook implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'id' => 'string', 'time' => 'string', + 'time_ms' => 'int', 'currency' => 'string', 'currency_pair' => 'string', 'change' => 'string', @@ -70,6 +71,7 @@ class MarginAccountBook implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'id' => null, 'time' => null, + 'time_ms' => 'int64', 'currency' => null, 'currency_pair' => null, 'change' => null, @@ -105,6 +107,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'id' => 'id', 'time' => 'time', + 'time_ms' => 'time_ms', 'currency' => 'currency', 'currency_pair' => 'currency_pair', 'change' => 'change', @@ -119,6 +122,7 @@ public static function openAPIFormats() protected static $setters = [ 'id' => 'setId', 'time' => 'setTime', + 'time_ms' => 'setTimeMs', 'currency' => 'setCurrency', 'currency_pair' => 'setCurrencyPair', 'change' => 'setChange', @@ -133,6 +137,7 @@ public static function openAPIFormats() protected static $getters = [ 'id' => 'getId', 'time' => 'getTime', + 'time_ms' => 'getTimeMs', 'currency' => 'getCurrency', 'currency_pair' => 'getCurrencyPair', 'change' => 'getChange', @@ -201,6 +206,7 @@ public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['time_ms'] = isset($data['time_ms']) ? $data['time_ms'] : null; $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; $this->container['currency_pair'] = isset($data['currency_pair']) ? $data['currency_pair'] : null; $this->container['change'] = isset($data['change']) ? $data['change'] : null; @@ -279,6 +285,30 @@ public function setTime($time) return $this; } + /** + * Gets time_ms + * + * @return int|null + */ + public function getTimeMs() + { + return $this->container['time_ms']; + } + + /** + * Sets time_ms + * + * @param int|null $time_ms Account changed timestamp in milliseconds + * + * @return $this + */ + public function setTimeMs($time_ms) + { + $this->container['time_ms'] = $time_ms; + + return $this; + } + /** * Gets currency * diff --git a/src/Model/OrderBook.php b/src/Model/OrderBook.php index 3215832..3e68dfc 100644 --- a/src/Model/OrderBook.php +++ b/src/Model/OrderBook.php @@ -55,6 +55,8 @@ class OrderBook implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'id' => 'int', + 'current' => 'int', + 'update' => 'int', 'asks' => 'string[][]', 'bids' => 'string[][]' ]; @@ -66,6 +68,8 @@ class OrderBook implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'id' => 'int64', + 'current' => 'int64', + 'update' => 'int64', 'asks' => null, 'bids' => null ]; @@ -98,6 +102,8 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'id' => 'id', + 'current' => 'current', + 'update' => 'update', 'asks' => 'asks', 'bids' => 'bids' ]; @@ -109,6 +115,8 @@ public static function openAPIFormats() */ protected static $setters = [ 'id' => 'setId', + 'current' => 'setCurrent', + 'update' => 'setUpdate', 'asks' => 'setAsks', 'bids' => 'setBids' ]; @@ -120,6 +128,8 @@ public static function openAPIFormats() */ protected static $getters = [ 'id' => 'getId', + 'current' => 'getCurrent', + 'update' => 'getUpdate', 'asks' => 'getAsks', 'bids' => 'getBids' ]; @@ -185,6 +195,8 @@ public function getModelName() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['current'] = isset($data['current']) ? $data['current'] : null; + $this->container['update'] = isset($data['update']) ? $data['update'] : null; $this->container['asks'] = isset($data['asks']) ? $data['asks'] : null; $this->container['bids'] = isset($data['bids']) ? $data['bids'] : null; } @@ -243,6 +255,54 @@ public function setId($id) return $this; } + /** + * Gets current + * + * @return int|null + */ + public function getCurrent() + { + return $this->container['current']; + } + + /** + * Sets current + * + * @param int|null $current Response data generation timestamp in milliseconds + * + * @return $this + */ + public function setCurrent($current) + { + $this->container['current'] = $current; + + return $this; + } + + /** + * Gets update + * + * @return int|null + */ + public function getUpdate() + { + return $this->container['update']; + } + + /** + * Sets update + * + * @param int|null $update Order book changed timestamp in milliseconds + * + * @return $this + */ + public function setUpdate($update) + { + $this->container['update'] = $update; + + return $this; + } + /** * Gets asks * From 8980967fa9a273e1b069844c6704fc47ada67b08 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Fri, 2 Jul 2021 15:55:34 +0800 Subject: [PATCH 02/17] release 5.21.5 1. You can set currency_pair as empty string for finished orders or trades query 2. Add margin and cross margin max transferable API support 3. Add futures position closes history query with time range support 4. Add withdraw fees on multiple chains --- README.md | 8 +- composer.json | 2 +- composer.lock | 26 +- docs/Api/FuturesApi.md | 6 +- docs/Api/MarginApi.md | 126 +++++++ docs/Api/SpotApi.md | 12 +- docs/Model/CrossMarginTransferable.md | 10 + docs/Model/MarginTransferable.md | 11 + docs/Model/Trade.md | 1 + docs/Model/WithdrawStatus.md | 1 + src/Api/FuturesApi.php | 36 ++ src/Api/MarginApi.php | 517 ++++++++++++++++++++++++++ src/Api/SpotApi.php | 30 +- src/Configuration.php | 6 +- src/Model/CrossMarginTransferable.php | 334 +++++++++++++++++ src/Model/MarginTransferable.php | 364 ++++++++++++++++++ src/Model/Trade.php | 30 ++ src/Model/WithdrawStatus.php | 40 +- 18 files changed, 1514 insertions(+), 46 deletions(-) create mode 100644 docs/Model/CrossMarginTransferable.md create mode 100644 docs/Model/MarginTransferable.md create mode 100644 src/Model/CrossMarginTransferable.php create mode 100644 src/Model/MarginTransferable.php diff --git a/README.md b/README.md index 7c10209..1a06071 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.21.4 -- Package version: 5.21.4 +- API version: 4.21.5 +- Package version: 5.21.5 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) @@ -178,6 +178,7 @@ Class | Method | HTTP request | Description *MarginApi* | [**updateLoanRecord**](docs/Api/MarginApi.md#updateloanrecord) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record *MarginApi* | [**getAutoRepayStatus**](docs/Api/MarginApi.md#getautorepaystatus) | **GET** /margin/auto_repay | Retrieve user auto repayment setting *MarginApi* | [**setAutoRepay**](docs/Api/MarginApi.md#setautorepay) | **POST** /margin/auto_repay | Update user's auto repayment setting +*MarginApi* | [**getMarginTransferable**](docs/Api/MarginApi.md#getmargintransferable) | **GET** /margin/transferable | Max transferable amount for specified margin currency *MarginApi* | [**listCrossMarginCurrencies**](docs/Api/MarginApi.md#listcrossmargincurrencies) | **GET** /margin/cross/currencies | Currencies supported by cross margin. *MarginApi* | [**getCrossMarginCurrency**](docs/Api/MarginApi.md#getcrossmargincurrency) | **GET** /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin *MarginApi* | [**getCrossMarginAccount**](docs/Api/MarginApi.md#getcrossmarginaccount) | **GET** /margin/cross/accounts | Retrieve cross margin account @@ -187,6 +188,7 @@ Class | Method | HTTP request | Description *MarginApi* | [**getCrossMarginLoan**](docs/Api/MarginApi.md#getcrossmarginloan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail *MarginApi* | [**listCrossMarginRepayments**](docs/Api/MarginApi.md#listcrossmarginrepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments *MarginApi* | [**repayCrossMarginLoan**](docs/Api/MarginApi.md#repaycrossmarginloan) | **POST** /margin/cross/repayments | Repay cross margin loan +*MarginApi* | [**getCrossMarginTransferable**](docs/Api/MarginApi.md#getcrossmargintransferable) | **GET** /margin/cross/transferable | Max transferable amount for specified cross margin currency *SpotApi* | [**listCurrencies**](docs/Api/SpotApi.md#listcurrencies) | **GET** /spot/currencies | List all currencies' detail *SpotApi* | [**getCurrency**](docs/Api/SpotApi.md#getcurrency) | **GET** /spot/currencies/{currency} | Get detail of one particular currency *SpotApi* | [**listCurrencyPairs**](docs/Api/SpotApi.md#listcurrencypairs) | **GET** /spot/currency_pairs | List all currency pairs supported @@ -239,6 +241,7 @@ Class | Method | HTTP request | Description - [CrossMarginLoan](docs/Model/CrossMarginLoan.md) - [CrossMarginRepayRequest](docs/Model/CrossMarginRepayRequest.md) - [CrossMarginRepayment](docs/Model/CrossMarginRepayment.md) + - [CrossMarginTransferable](docs/Model/CrossMarginTransferable.md) - [Currency](docs/Model/Currency.md) - [CurrencyPair](docs/Model/CurrencyPair.md) - [DeliveryContract](docs/Model/DeliveryContract.md) @@ -268,6 +271,7 @@ Class | Method | HTTP request | Description - [MarginAccountBook](docs/Model/MarginAccountBook.md) - [MarginAccountCurrency](docs/Model/MarginAccountCurrency.md) - [MarginCurrencyPair](docs/Model/MarginCurrencyPair.md) + - [MarginTransferable](docs/Model/MarginTransferable.md) - [MultiChainAddressItem](docs/Model/MultiChainAddressItem.md) - [MyFuturesTrade](docs/Model/MyFuturesTrade.md) - [OpenOrders](docs/Model/OpenOrders.md) diff --git a/composer.json b/composer.json index 1228e11..dadd0fb 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.21.4", + "version": "5.21.5", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index 38fe981..35f532f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bad83845cc0eb6ceaf672cb67be6d531", + "content-hash": "824661804b0ffad5b322ed4bf93dcd97", "packages": [ { "name": "guzzlehttp/guzzle", @@ -3418,16 +3418,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.3.0", + "version": "v5.3.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "348116319d7fb7d1faa781d26a48922428013eb2" + "reference": "19b71c8f313b411172dd5f470fd61f24466d79a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/348116319d7fb7d1faa781d26a48922428013eb2", - "reference": "348116319d7fb7d1faa781d26a48922428013eb2", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/19b71c8f313b411172dd5f470fd61f24466d79a9", + "reference": "19b71c8f313b411172dd5f470fd61f24466d79a9", "shasum": "", "mirrors": [ { @@ -3466,7 +3466,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.3.0" + "source": "https://github.com/symfony/filesystem/tree/v5.3.3" }, "funding": [ { @@ -3482,7 +3482,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:43:10+00:00" + "time": "2021-06-30T07:27:52+00:00" }, { "name": "symfony/finder", @@ -4355,16 +4355,16 @@ }, { "name": "symfony/string", - "version": "v5.3.2", + "version": "v5.3.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "0732e97e41c0a590f77e231afc16a327375d50b0" + "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/0732e97e41c0a590f77e231afc16a327375d50b0", - "reference": "0732e97e41c0a590f77e231afc16a327375d50b0", + "url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", "shasum": "", "mirrors": [ { @@ -4424,7 +4424,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.2" + "source": "https://github.com/symfony/string/tree/v5.3.3" }, "funding": [ { @@ -4440,7 +4440,7 @@ "type": "tidelift" } ], - "time": "2021-06-06T09:51:56+00:00" + "time": "2021-06-27T11:44:38+00:00" }, { "name": "theseer/tokenizer", diff --git a/docs/Api/FuturesApi.md b/docs/Api/FuturesApi.md index 12d35e3..68a6d4e 100644 --- a/docs/Api/FuturesApi.md +++ b/docs/Api/FuturesApi.md @@ -1851,7 +1851,7 @@ Name | Type | Description | Notes ## listPositionClose -> \GateApi\Model\PositionClose[] listPositionClose($settle, $contract, $limit, $offset) +> \GateApi\Model\PositionClose[] listPositionClose($settle, $contract, $limit, $offset, $from, $to) List position close history @@ -1875,6 +1875,8 @@ $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract, return related data only if specified $associate_array['limit'] = 100; // int | Maximum number of records returned in one list $associate_array['offset'] = 0; // int | List offset, starting from 0 +$associate_array['from'] = 1547706332; // int | Start timestamp +$associate_array['to'] = 1547706332; // int | End timestamp try { $result = $apiInstance->listPositionClose($associate_array); @@ -1898,6 +1900,8 @@ Name | Type | Description | Notes **contract** | **string**| Futures contract, return related data only if specified | [optional] **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **from** | **int**| Start timestamp | [optional] + **to** | **int**| End timestamp | [optional] ### Return type diff --git a/docs/Api/MarginApi.md b/docs/Api/MarginApi.md index a423afd..e7bc963 100644 --- a/docs/Api/MarginApi.md +++ b/docs/Api/MarginApi.md @@ -23,6 +23,7 @@ Method | HTTP request | Description [**updateLoanRecord**](MarginApi.md#updateLoanRecord) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record [**getAutoRepayStatus**](MarginApi.md#getAutoRepayStatus) | **GET** /margin/auto_repay | Retrieve user auto repayment setting [**setAutoRepay**](MarginApi.md#setAutoRepay) | **POST** /margin/auto_repay | Update user's auto repayment setting +[**getMarginTransferable**](MarginApi.md#getMarginTransferable) | **GET** /margin/transferable | Max transferable amount for specified margin currency [**listCrossMarginCurrencies**](MarginApi.md#listCrossMarginCurrencies) | **GET** /margin/cross/currencies | Currencies supported by cross margin. [**getCrossMarginCurrency**](MarginApi.md#getCrossMarginCurrency) | **GET** /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin [**getCrossMarginAccount**](MarginApi.md#getCrossMarginAccount) | **GET** /margin/cross/accounts | Retrieve cross margin account @@ -32,6 +33,7 @@ Method | HTTP request | Description [**getCrossMarginLoan**](MarginApi.md#getCrossMarginLoan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail [**listCrossMarginRepayments**](MarginApi.md#listCrossMarginRepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments [**repayCrossMarginLoan**](MarginApi.md#repayCrossMarginLoan) | **POST** /margin/cross/repayments | Repay cross margin loan +[**getCrossMarginTransferable**](MarginApi.md#getCrossMarginTransferable) | **GET** /margin/cross/transferable | Max transferable amount for specified cross margin currency ## listMarginCurrencyPairs @@ -1216,6 +1218,70 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## getMarginTransferable + +> \GateApi\Model\MarginTransferable getMarginTransferable($currency, $currency_pair) + +Max transferable amount for specified margin currency + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\MarginApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['currency'] = 'BTC'; // string | Retrieved specified currency related data +$associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair + +try { + $result = $apiInstance->getMarginTransferable($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling MarginApi->getMarginTransferable: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **string**| Retrieved specified currency related data | + **currency_pair** | **string**| Currency pair | [optional] + +### Return type + +[**\GateApi\Model\MarginTransferable**](../Model/MarginTransferable.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listCrossMarginCurrencies > \GateApi\Model\CrossMarginCurrency[] listCrossMarginCurrencies() @@ -1779,3 +1845,63 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +## getCrossMarginTransferable + +> \GateApi\Model\CrossMarginTransferable getCrossMarginTransferable($currency) + +Max transferable amount for specified cross margin currency + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\MarginApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$currency = 'BTC'; // string | Retrieved specified currency related data + +try { + $result = $apiInstance->getCrossMarginTransferable($currency); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling MarginApi->getCrossMarginTransferable: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **string**| Retrieved specified currency related data | + +### Return type + +[**\GateApi\Model\CrossMarginTransferable**](../Model/CrossMarginTransferable.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Api/SpotApi.md b/docs/Api/SpotApi.md index 444cb32..5a8983f 100644 --- a/docs/Api/SpotApi.md +++ b/docs/Api/SpotApi.md @@ -784,7 +784,7 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client(), $config ); -$associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair +$associate_array['currency_pair'] = 'BTC_USDT'; // string | Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. $associate_array['status'] = 'open'; // string | List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled $associate_array['page'] = 1; // int | Page number $associate_array['limit'] = 100; // int | Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 @@ -808,7 +808,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency_pair** | **string**| Currency pair | + **currency_pair** | **string**| Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. | **status** | **string**| List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled | **page** | **int**| Page number | [optional] [default to 1] **limit** | **int**| Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 | [optional] [default to 100] @@ -1178,10 +1178,10 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client(), $config ); -$associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair +$associate_array['currency_pair'] = 'BTC_USDT'; // string | Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. $associate_array['limit'] = 100; // int | Maximum number of records returned in one list $associate_array['page'] = 1; // int | Page number -$associate_array['order_id'] = '12345'; // string | List all trades of specified order +$associate_array['order_id'] = '12345'; // string | Filter trades with specified order ID. `currency_pair` is also required if this field is present $associate_array['account'] = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account try { @@ -1202,10 +1202,10 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency_pair** | **string**| Currency pair | + **currency_pair** | **string**| Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. | **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] **page** | **int**| Page number | [optional] [default to 1] - **order_id** | **string**| List all trades of specified order | [optional] + **order_id** | **string**| Filter trades with specified order ID. `currency_pair` is also required if this field is present | [optional] **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] ### Return type diff --git a/docs/Model/CrossMarginTransferable.md b/docs/Model/CrossMarginTransferable.md new file mode 100644 index 0000000..1bdf40b --- /dev/null +++ b/docs/Model/CrossMarginTransferable.md @@ -0,0 +1,10 @@ +# # CrossMarginTransferable + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **string** | Currency detail | [optional] +**amount** | **string** | Max transferable amount | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MarginTransferable.md b/docs/Model/MarginTransferable.md new file mode 100644 index 0000000..33a3b1e --- /dev/null +++ b/docs/Model/MarginTransferable.md @@ -0,0 +1,11 @@ +# # MarginTransferable + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **string** | Currency detail | [optional] +**currency_pair** | **string** | Currency pair | [optional] +**amount** | **string** | Max transferable amount | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Trade.md b/docs/Model/Trade.md index dfc04c9..3547161 100644 --- a/docs/Model/Trade.md +++ b/docs/Model/Trade.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **id** | **string** | Trade ID | [optional] **create_time** | **string** | Trading time | [optional] **create_time_ms** | **string** | Trading time, with millisecond precision | [optional] +**currency_pair** | **string** | Currency pair | [optional] **side** | **string** | Order side | [optional] **role** | **string** | Trade role | [optional] **amount** | **string** | Trade amount | [optional] diff --git a/docs/Model/WithdrawStatus.md b/docs/Model/WithdrawStatus.md index 67250f0..d9c2fd4 100644 --- a/docs/Model/WithdrawStatus.md +++ b/docs/Model/WithdrawStatus.md @@ -14,5 +14,6 @@ Name | Type | Description | Notes **withdraw_amount_mini** | **string** | Minimum withdrawal amount | [optional] **withdraw_day_limit_remain** | **string** | Daily withdrawal amount left | [optional] **withdraw_eachtime_limit** | **string** | Maximum amount for each withdrawal | [optional] +**withdraw_fix_on_chains** | **map[string,string]** | Fixed withdrawal fee on multiple chains | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/FuturesApi.php b/src/Api/FuturesApi.php index f06c361..d5edf22 100644 --- a/src/Api/FuturesApi.php +++ b/src/Api/FuturesApi.php @@ -8305,6 +8305,8 @@ protected function getMyTradesRequest($associative_array) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $limit Maximum number of records returned in one list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -8327,6 +8329,8 @@ public function listPositionClose($associative_array) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $limit Maximum number of records returned in one list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -8386,6 +8390,8 @@ public function listPositionCloseWithHttpInfo($associative_array) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $limit Maximum number of records returned in one list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -8411,6 +8417,8 @@ function ($response) { * @param string $contract Futures contract, return related data only if specified (optional) * @param int $limit Maximum number of records returned in one list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -8463,6 +8471,8 @@ function ($exception) { * @param string $contract Futures contract, return related data only if specified (optional) * @param int $limit Maximum number of records returned in one list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -8474,6 +8484,8 @@ protected function listPositionCloseRequest($associative_array) $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; // verify the required parameter 'settle' is set if ($settle === null || (is_array($settle) && count($settle) === 0)) { @@ -8536,6 +8548,30 @@ protected function listPositionCloseRequest($associative_array) } } + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + // path params if ($settle !== null) { $resourcePath = str_replace( diff --git a/src/Api/MarginApi.php b/src/Api/MarginApi.php index 7bb8517..7a79aea 100644 --- a/src/Api/MarginApi.php +++ b/src/Api/MarginApi.php @@ -5122,6 +5122,280 @@ protected function setAutoRepayRequest($status) ); } + /** + * Operation getMarginTransferable + * + * Max transferable amount for specified margin currency + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Retrieved specified currency related data (required) + * @param string $currency_pair Currency pair (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\MarginTransferable + */ + public function getMarginTransferable($associative_array) + { + list($response) = $this->getMarginTransferableWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation getMarginTransferableWithHttpInfo + * + * Max transferable amount for specified margin currency + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Retrieved specified currency related data (required) + * @param string $currency_pair Currency pair (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\MarginTransferable, HTTP status code, HTTP response headers (array of strings) + */ + public function getMarginTransferableWithHttpInfo($associative_array) + { + $request = $this->getMarginTransferableRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\MarginTransferable'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getMarginTransferableAsync + * + * Max transferable amount for specified margin currency + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Retrieved specified currency related data (required) + * @param string $currency_pair Currency pair (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMarginTransferableAsync($associative_array) + { + return $this->getMarginTransferableAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMarginTransferableAsyncWithHttpInfo + * + * Max transferable amount for specified margin currency + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Retrieved specified currency related data (required) + * @param string $currency_pair Currency pair (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMarginTransferableAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\MarginTransferable'; + $request = $this->getMarginTransferableRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMarginTransferable' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Retrieved specified currency related data (required) + * @param string $currency_pair Currency pair (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getMarginTransferableRequest($associative_array) + { + // unbox the parameters from the associative array + $currency = array_key_exists('currency', $associative_array) ? $associative_array['currency'] : null; + $currency_pair = array_key_exists('currency_pair', $associative_array) ? $associative_array['currency_pair'] : null; + + // verify the required parameter 'currency' is set + if ($currency === null || (is_array($currency) && count($currency) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $currency when calling getMarginTransferable' + ); + } + + $resourcePath = '/margin/transferable'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($currency !== null) { + if('form' === 'form' && is_array($currency)) { + foreach($currency as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency'] = $currency; + } + } + + // query params + if ($currency_pair !== null) { + if('form' === 'form' && is_array($currency_pair)) { + foreach($currency_pair as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency_pair'] = $currency_pair; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listCrossMarginCurrencies * @@ -7517,6 +7791,249 @@ protected function repayCrossMarginLoanRequest($cross_margin_repay_request) ); } + /** + * Operation getCrossMarginTransferable + * + * Max transferable amount for specified cross margin currency + * + * @param string $currency Retrieved specified currency related data (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\CrossMarginTransferable + */ + public function getCrossMarginTransferable($currency) + { + list($response) = $this->getCrossMarginTransferableWithHttpInfo($currency); + return $response; + } + + /** + * Operation getCrossMarginTransferableWithHttpInfo + * + * Max transferable amount for specified cross margin currency + * + * @param string $currency Retrieved specified currency related data (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\CrossMarginTransferable, HTTP status code, HTTP response headers (array of strings) + */ + public function getCrossMarginTransferableWithHttpInfo($currency) + { + $request = $this->getCrossMarginTransferableRequest($currency); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\CrossMarginTransferable'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getCrossMarginTransferableAsync + * + * Max transferable amount for specified cross margin currency + * + * @param string $currency Retrieved specified currency related data (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCrossMarginTransferableAsync($currency) + { + return $this->getCrossMarginTransferableAsyncWithHttpInfo($currency) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCrossMarginTransferableAsyncWithHttpInfo + * + * Max transferable amount for specified cross margin currency + * + * @param string $currency Retrieved specified currency related data (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCrossMarginTransferableAsyncWithHttpInfo($currency) + { + $returnType = '\GateApi\Model\CrossMarginTransferable'; + $request = $this->getCrossMarginTransferableRequest($currency); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCrossMarginTransferable' + * + * @param string $currency Retrieved specified currency related data (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getCrossMarginTransferableRequest($currency) + { + // verify the required parameter 'currency' is set + if ($currency === null || (is_array($currency) && count($currency) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $currency when calling getCrossMarginTransferable' + ); + } + + $resourcePath = '/margin/cross/transferable'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($currency !== null) { + if('form' === 'form' && is_array($currency)) { + foreach($currency as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency'] = $currency; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create http client option * diff --git a/src/Api/SpotApi.php b/src/Api/SpotApi.php index 4978273..d65273d 100644 --- a/src/Api/SpotApi.php +++ b/src/Api/SpotApi.php @@ -3253,7 +3253,7 @@ protected function listAllOpenOrdersRequest($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Currency pair (required) + * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) @@ -3276,7 +3276,7 @@ public function listOrders($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Currency pair (required) + * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) @@ -3336,7 +3336,7 @@ public function listOrdersWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Currency pair (required) + * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) @@ -3362,7 +3362,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Currency pair (required) + * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) @@ -3415,7 +3415,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Currency pair (required) + * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) @@ -4903,10 +4903,10 @@ protected function cancelOrderRequest($order_id, $currency_pair, $account = null * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Currency pair (required) + * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param int $limit Maximum number of records returned in one list (optional, default to 100) * @param int $page Page number (optional, default to 1) - * @param string $order_id List all trades of specified order (optional) + * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) * * @throws \GateApi\ApiException on non-2xx response @@ -4926,10 +4926,10 @@ public function listMyTrades($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Currency pair (required) + * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param int $limit Maximum number of records returned in one list (optional, default to 100) * @param int $page Page number (optional, default to 1) - * @param string $order_id List all trades of specified order (optional) + * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) * * @throws \GateApi\ApiException on non-2xx response @@ -4986,10 +4986,10 @@ public function listMyTradesWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Currency pair (required) + * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param int $limit Maximum number of records returned in one list (optional, default to 100) * @param int $page Page number (optional, default to 1) - * @param string $order_id List all trades of specified order (optional) + * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) * * @throws \InvalidArgumentException @@ -5012,10 +5012,10 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Currency pair (required) + * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param int $limit Maximum number of records returned in one list (optional, default to 100) * @param int $page Page number (optional, default to 1) - * @param string $order_id List all trades of specified order (optional) + * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) * * @throws \InvalidArgumentException @@ -5065,10 +5065,10 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Currency pair (required) + * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param int $limit Maximum number of records returned in one list (optional, default to 100) * @param int $page Page number (optional, default to 1) - * @param string $order_id List all trades of specified order (optional) + * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) * * @throws \InvalidArgumentException diff --git a/src/Configuration.php b/src/Configuration.php index 7309a3e..f23e331 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.21.4/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.21.5/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.21.4' . PHP_EOL; - $report .= ' SDK Package Version: 5.21.4' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.21.5' . PHP_EOL; + $report .= ' SDK Package Version: 5.21.5' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/CrossMarginTransferable.php b/src/Model/CrossMarginTransferable.php new file mode 100644 index 0000000..a9a616f --- /dev/null +++ b/src/Model/CrossMarginTransferable.php @@ -0,0 +1,334 @@ + 'string', + 'amount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'amount' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency Currency detail + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets amount + * + * @return string|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string|null $amount Max transferable amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/MarginTransferable.php b/src/Model/MarginTransferable.php new file mode 100644 index 0000000..75b6039 --- /dev/null +++ b/src/Model/MarginTransferable.php @@ -0,0 +1,364 @@ + 'string', + 'currency_pair' => 'string', + 'amount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'currency_pair' => null, + 'amount' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'currency_pair' => 'currency_pair', + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'currency_pair' => 'setCurrencyPair', + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'currency_pair' => 'getCurrencyPair', + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['currency_pair'] = isset($data['currency_pair']) ? $data['currency_pair'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency Currency detail + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets currency_pair + * + * @return string|null + */ + public function getCurrencyPair() + { + return $this->container['currency_pair']; + } + + /** + * Sets currency_pair + * + * @param string|null $currency_pair Currency pair + * + * @return $this + */ + public function setCurrencyPair($currency_pair) + { + $this->container['currency_pair'] = $currency_pair; + + return $this; + } + + /** + * Gets amount + * + * @return string|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string|null $amount Max transferable amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Trade.php b/src/Model/Trade.php index 6503a24..d78cefc 100644 --- a/src/Model/Trade.php +++ b/src/Model/Trade.php @@ -57,6 +57,7 @@ class Trade implements ModelInterface, ArrayAccess 'id' => 'string', 'create_time' => 'string', 'create_time_ms' => 'string', + 'currency_pair' => 'string', 'side' => 'string', 'role' => 'string', 'amount' => 'string', @@ -77,6 +78,7 @@ class Trade implements ModelInterface, ArrayAccess 'id' => null, 'create_time' => null, 'create_time_ms' => null, + 'currency_pair' => null, 'side' => null, 'role' => null, 'amount' => null, @@ -118,6 +120,7 @@ public static function openAPIFormats() 'id' => 'id', 'create_time' => 'create_time', 'create_time_ms' => 'create_time_ms', + 'currency_pair' => 'currency_pair', 'side' => 'side', 'role' => 'role', 'amount' => 'amount', @@ -138,6 +141,7 @@ public static function openAPIFormats() 'id' => 'setId', 'create_time' => 'setCreateTime', 'create_time_ms' => 'setCreateTimeMs', + 'currency_pair' => 'setCurrencyPair', 'side' => 'setSide', 'role' => 'setRole', 'amount' => 'setAmount', @@ -158,6 +162,7 @@ public static function openAPIFormats() 'id' => 'getId', 'create_time' => 'getCreateTime', 'create_time_ms' => 'getCreateTimeMs', + 'currency_pair' => 'getCurrencyPair', 'side' => 'getSide', 'role' => 'getRole', 'amount' => 'getAmount', @@ -262,6 +267,7 @@ public function __construct(array $data = null) $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['create_time'] = isset($data['create_time']) ? $data['create_time'] : null; $this->container['create_time_ms'] = isset($data['create_time_ms']) ? $data['create_time_ms'] : null; + $this->container['currency_pair'] = isset($data['currency_pair']) ? $data['currency_pair'] : null; $this->container['side'] = isset($data['side']) ? $data['side'] : null; $this->container['role'] = isset($data['role']) ? $data['role'] : null; $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; @@ -385,6 +391,30 @@ public function setCreateTimeMs($create_time_ms) return $this; } + /** + * Gets currency_pair + * + * @return string|null + */ + public function getCurrencyPair() + { + return $this->container['currency_pair']; + } + + /** + * Sets currency_pair + * + * @param string|null $currency_pair Currency pair + * + * @return $this + */ + public function setCurrencyPair($currency_pair) + { + $this->container['currency_pair'] = $currency_pair; + + return $this; + } + /** * Gets side * diff --git a/src/Model/WithdrawStatus.php b/src/Model/WithdrawStatus.php index bce2d0b..840016e 100644 --- a/src/Model/WithdrawStatus.php +++ b/src/Model/WithdrawStatus.php @@ -63,7 +63,8 @@ class WithdrawStatus implements ModelInterface, ArrayAccess 'withdraw_day_limit' => 'string', 'withdraw_amount_mini' => 'string', 'withdraw_day_limit_remain' => 'string', - 'withdraw_eachtime_limit' => 'string' + 'withdraw_eachtime_limit' => 'string', + 'withdraw_fix_on_chains' => 'map[string,string]' ]; /** @@ -81,7 +82,8 @@ class WithdrawStatus implements ModelInterface, ArrayAccess 'withdraw_day_limit' => null, 'withdraw_amount_mini' => null, 'withdraw_day_limit_remain' => null, - 'withdraw_eachtime_limit' => null + 'withdraw_eachtime_limit' => null, + 'withdraw_fix_on_chains' => null ]; /** @@ -120,7 +122,8 @@ public static function openAPIFormats() 'withdraw_day_limit' => 'withdraw_day_limit', 'withdraw_amount_mini' => 'withdraw_amount_mini', 'withdraw_day_limit_remain' => 'withdraw_day_limit_remain', - 'withdraw_eachtime_limit' => 'withdraw_eachtime_limit' + 'withdraw_eachtime_limit' => 'withdraw_eachtime_limit', + 'withdraw_fix_on_chains' => 'withdraw_fix_on_chains' ]; /** @@ -138,7 +141,8 @@ public static function openAPIFormats() 'withdraw_day_limit' => 'setWithdrawDayLimit', 'withdraw_amount_mini' => 'setWithdrawAmountMini', 'withdraw_day_limit_remain' => 'setWithdrawDayLimitRemain', - 'withdraw_eachtime_limit' => 'setWithdrawEachtimeLimit' + 'withdraw_eachtime_limit' => 'setWithdrawEachtimeLimit', + 'withdraw_fix_on_chains' => 'setWithdrawFixOnChains' ]; /** @@ -156,7 +160,8 @@ public static function openAPIFormats() 'withdraw_day_limit' => 'getWithdrawDayLimit', 'withdraw_amount_mini' => 'getWithdrawAmountMini', 'withdraw_day_limit_remain' => 'getWithdrawDayLimitRemain', - 'withdraw_eachtime_limit' => 'getWithdrawEachtimeLimit' + 'withdraw_eachtime_limit' => 'getWithdrawEachtimeLimit', + 'withdraw_fix_on_chains' => 'getWithdrawFixOnChains' ]; /** @@ -229,6 +234,7 @@ public function __construct(array $data = null) $this->container['withdraw_amount_mini'] = isset($data['withdraw_amount_mini']) ? $data['withdraw_amount_mini'] : null; $this->container['withdraw_day_limit_remain'] = isset($data['withdraw_day_limit_remain']) ? $data['withdraw_day_limit_remain'] : null; $this->container['withdraw_eachtime_limit'] = isset($data['withdraw_eachtime_limit']) ? $data['withdraw_eachtime_limit'] : null; + $this->container['withdraw_fix_on_chains'] = isset($data['withdraw_fix_on_chains']) ? $data['withdraw_fix_on_chains'] : null; } /** @@ -494,6 +500,30 @@ public function setWithdrawEachtimeLimit($withdraw_eachtime_limit) return $this; } + + /** + * Gets withdraw_fix_on_chains + * + * @return map[string,string]|null + */ + public function getWithdrawFixOnChains() + { + return $this->container['withdraw_fix_on_chains']; + } + + /** + * Sets withdraw_fix_on_chains + * + * @param map[string,string]|null $withdraw_fix_on_chains Fixed withdrawal fee on multiple chains + * + * @return $this + */ + public function setWithdrawFixOnChains($withdraw_fix_on_chains) + { + $this->container['withdraw_fix_on_chains'] = $withdraw_fix_on_chains; + + return $this; + } /** * Returns true if offset exists. False otherwise. * From 3cd9224bf6ed26eb2d64690b462613bd837cdec3 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Thu, 12 Aug 2021 16:39:41 +0800 Subject: [PATCH 03/17] fix incorrect withdrawal address field --- README.md | 4 +- composer.json | 2 +- composer.lock | 217 ++++++++++++++++++----------------- docs/Model/DepositAddress.md | 2 +- src/Configuration.php | 6 +- src/Model/DepositAddress.php | 26 ++--- 6 files changed, 130 insertions(+), 127 deletions(-) diff --git a/README.md b/README.md index 1a06071..8182837 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.21.5 -- Package version: 5.21.5 +- API version: 4.21.6 +- Package version: 5.21.6 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) diff --git a/composer.json b/composer.json index dadd0fb..8ff1ae0 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.21.5", + "version": "5.21.6", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index 35f532f..a95bf11 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "824661804b0ffad5b322ed4bf93dcd97", + "content-hash": "19456e8951793c321e56122dfc329c7f", "packages": [ { "name": "guzzlehttp/guzzle", @@ -690,16 +690,16 @@ }, { "name": "composer/xdebug-handler", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496" + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/964adcdd3a28bf9ed5d9ac6450064e0d71ed7496", - "reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", "shasum": "", "mirrors": [ { @@ -710,7 +710,7 @@ }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { "phpstan/phpstan": "^0.12.55", @@ -740,7 +740,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.1" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" }, "funding": [ { @@ -756,20 +756,20 @@ "type": "tidelift" } ], - "time": "2021-05-05T19:37:51+00:00" + "time": "2021-07-31T17:03:58+00:00" }, { "name": "doctrine/annotations", - "version": "1.13.1", + "version": "1.13.2", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "e6e7b7d5b45a2f2abc5460cc6396480b2b1d321f" + "reference": "5b668aef16090008790395c02c893b1ba13f7e08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/e6e7b7d5b45a2f2abc5460cc6396480b2b1d321f", - "reference": "e6e7b7d5b45a2f2abc5460cc6396480b2b1d321f", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08", "shasum": "", "mirrors": [ { @@ -832,9 +832,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.1" + "source": "https://github.com/doctrine/annotations/tree/1.13.2" }, - "time": "2021-05-16T18:07:53+00:00" + "time": "2021-08-05T19:00:23+00:00" }, { "name": "doctrine/instantiator", @@ -999,16 +999,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.19.0", + "version": "v2.19.1", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "d5b8a9d852b292c2f8a035200fa6844b1f82300b" + "reference": "1fa4af92841f67362c053728989b262fba8eb1ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/d5b8a9d852b292c2f8a035200fa6844b1f82300b", - "reference": "d5b8a9d852b292c2f8a035200fa6844b1f82300b", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/1fa4af92841f67362c053728989b262fba8eb1ec", + "reference": "1fa4af92841f67362c053728989b262fba8eb1ec", "shasum": "", "mirrors": [ { @@ -1102,7 +1102,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.0" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.1" }, "funding": [ { @@ -1110,7 +1110,7 @@ "type": "github" } ], - "time": "2021-05-03T21:43:24+00:00" + "time": "2021-08-02T17:52:09+00:00" }, { "name": "myclabs/deep-copy", @@ -1683,16 +1683,16 @@ }, { "name": "phpunit/php-file-iterator", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357" + "reference": "28af674ff175d0768a5a978e6de83f697d4a7f05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/4b49fb70f067272b659ef0174ff9ca40fdaa6357", - "reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/28af674ff175d0768a5a978e6de83f697d4a7f05", + "reference": "28af674ff175d0768a5a978e6de83f697d4a7f05", "shasum": "", "mirrors": [ { @@ -1737,7 +1737,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.3" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.4" }, "funding": [ { @@ -1745,7 +1745,7 @@ "type": "github" } ], - "time": "2020-11-30T08:25:21+00:00" + "time": "2021-07-19T06:46:01+00:00" }, { "name": "phpunit/php-text-template", @@ -1865,16 +1865,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "3.1.2", + "version": "3.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "472b687829041c24b25f475e14c2f38a09edf1c2" + "reference": "9c1da83261628cb24b6a6df371b6e312b3954768" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/472b687829041c24b25f475e14c2f38a09edf1c2", - "reference": "472b687829041c24b25f475e14c2f38a09edf1c2", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768", + "reference": "9c1da83261628cb24b6a6df371b6e312b3954768", "shasum": "", "mirrors": [ { @@ -1918,7 +1918,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.2" + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.3" }, "funding": [ { @@ -1927,7 +1927,7 @@ } ], "abandoned": true, - "time": "2020-11-30T08:38:46+00:00" + "time": "2021-07-26T12:15:06+00:00" }, { "name": "phpunit/phpunit", @@ -3065,16 +3065,16 @@ }, { "name": "symfony/console", - "version": "v5.3.2", + "version": "v5.3.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1" + "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/649730483885ff2ca99ca0560ef0e5f6b03f2ac1", - "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1", + "url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2", + "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2", "shasum": "", "mirrors": [ { @@ -3088,11 +3088,12 @@ "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2", "symfony/string": "^5.1" }, "conflict": { + "psr/log": ">=3", "symfony/dependency-injection": "<4.4", "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", @@ -3100,10 +3101,10 @@ "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2", "symfony/config": "^4.4|^5.0", "symfony/dependency-injection": "^4.4|^5.0", "symfony/event-dispatcher": "^4.4|^5.0", @@ -3149,7 +3150,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.2" + "source": "https://github.com/symfony/console/tree/v5.3.6" }, "funding": [ { @@ -3165,7 +3166,7 @@ "type": "tidelift" } ], - "time": "2021-06-12T09:42:48+00:00" + "time": "2021-07-27T19:10:22+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3242,16 +3243,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.3.0", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "67a5f354afa8e2f231081b3fa11a5912f933c3ce" + "reference": "f2fd2208157553874560f3645d4594303058c4bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/67a5f354afa8e2f231081b3fa11a5912f933c3ce", - "reference": "67a5f354afa8e2f231081b3fa11a5912f933c3ce", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f2fd2208157553874560f3645d4594303058c4bd", + "reference": "f2fd2208157553874560f3645d4594303058c4bd", "shasum": "", "mirrors": [ { @@ -3264,7 +3265,7 @@ "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", "symfony/event-dispatcher-contracts": "^2", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "symfony/dependency-injection": "<4.4" @@ -3274,7 +3275,7 @@ "symfony/event-dispatcher-implementation": "2.0" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2|^3", "symfony/config": "^4.4|^5.0", "symfony/dependency-injection": "^4.4|^5.0", "symfony/error-handler": "^4.4|^5.0", @@ -3313,7 +3314,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.3.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.3.4" }, "funding": [ { @@ -3329,7 +3330,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:43:10+00:00" + "time": "2021-07-23T15:55:36+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -3418,16 +3419,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.3.3", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "19b71c8f313b411172dd5f470fd61f24466d79a9" + "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/19b71c8f313b411172dd5f470fd61f24466d79a9", - "reference": "19b71c8f313b411172dd5f470fd61f24466d79a9", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/343f4fe324383ca46792cae728a3b6e2f708fb32", + "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32", "shasum": "", "mirrors": [ { @@ -3438,7 +3439,8 @@ }, "require": { "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8" + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -3466,7 +3468,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.3.3" + "source": "https://github.com/symfony/filesystem/tree/v5.3.4" }, "funding": [ { @@ -3482,20 +3484,20 @@ "type": "tidelift" } ], - "time": "2021-06-30T07:27:52+00:00" + "time": "2021-07-21T12:40:44+00:00" }, { "name": "symfony/finder", - "version": "v5.3.0", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6" + "reference": "17f50e06018baec41551a71a15731287dbaab186" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6", - "reference": "0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6", + "url": "https://api.github.com/repos/symfony/finder/zipball/17f50e06018baec41551a71a15731287dbaab186", + "reference": "17f50e06018baec41551a71a15731287dbaab186", "shasum": "", "mirrors": [ { @@ -3505,7 +3507,8 @@ ] }, "require": { - "php": ">=7.2.5" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -3533,7 +3536,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.3.0" + "source": "https://github.com/symfony/finder/tree/v5.3.4" }, "funding": [ { @@ -3549,20 +3552,20 @@ "type": "tidelift" } ], - "time": "2021-05-26T12:52:38+00:00" + "time": "2021-07-23T15:54:19+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.3.0", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "162e886ca035869866d233a2bfef70cc28f9bbe5" + "reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/162e886ca035869866d233a2bfef70cc28f9bbe5", - "reference": "162e886ca035869866d233a2bfef70cc28f9bbe5", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a603e5701bd6e305cfc777a8b50bf081ef73105e", + "reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e", "shasum": "", "mirrors": [ { @@ -3575,7 +3578,7 @@ "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -3608,7 +3611,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.3.0" + "source": "https://github.com/symfony/options-resolver/tree/v5.3.4" }, "funding": [ { @@ -3624,7 +3627,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:43:10+00:00" + "time": "2021-07-23T15:55:36+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3713,16 +3716,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab" + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/24b72c6baa32c746a4d0840147c9715e42bb68ab", - "reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", "shasum": "", "mirrors": [ { @@ -3780,7 +3783,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" }, "funding": [ { @@ -3796,20 +3799,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:17:38+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "", "mirrors": [ { @@ -3866,7 +3869,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -3882,7 +3885,7 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:27:20+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-php70", @@ -4045,16 +4048,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "", "mirrors": [ { @@ -4114,7 +4117,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" }, "funding": [ { @@ -4130,20 +4133,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-07-28T13:41:28+00:00" }, { "name": "symfony/process", - "version": "v5.3.2", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "714b47f9196de61a196d86c4bad5f09201b307df" + "reference": "d16634ee55b895bd85ec714dadc58e4428ecf030" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/714b47f9196de61a196d86c4bad5f09201b307df", - "reference": "714b47f9196de61a196d86c4bad5f09201b307df", + "url": "https://api.github.com/repos/symfony/process/zipball/d16634ee55b895bd85ec714dadc58e4428ecf030", + "reference": "d16634ee55b895bd85ec714dadc58e4428ecf030", "shasum": "", "mirrors": [ { @@ -4154,7 +4157,7 @@ }, "require": { "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -4182,7 +4185,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.3.2" + "source": "https://github.com/symfony/process/tree/v5.3.4" }, "funding": [ { @@ -4198,7 +4201,7 @@ "type": "tidelift" } ], - "time": "2021-06-12T10:15:01+00:00" + "time": "2021-07-23T15:54:19+00:00" }, { "name": "symfony/service-contracts", @@ -4287,16 +4290,16 @@ }, { "name": "symfony/stopwatch", - "version": "v5.3.0", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "313d02f59d6543311865007e5ff4ace05b35ee65" + "reference": "b24c6a92c6db316fee69e38c80591e080e41536c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/313d02f59d6543311865007e5ff4ace05b35ee65", - "reference": "313d02f59d6543311865007e5ff4ace05b35ee65", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b24c6a92c6db316fee69e38c80591e080e41536c", + "reference": "b24c6a92c6db316fee69e38c80591e080e41536c", "shasum": "", "mirrors": [ { @@ -4335,7 +4338,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.3.0" + "source": "https://github.com/symfony/stopwatch/tree/v5.3.4" }, "funding": [ { @@ -4351,7 +4354,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:43:10+00:00" + "time": "2021-07-10T08:58:57+00:00" }, { "name": "symfony/string", @@ -4444,16 +4447,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "", "mirrors": [ { @@ -4488,7 +4491,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" }, "funding": [ { @@ -4496,7 +4499,7 @@ "type": "github" } ], - "time": "2020-07-12T23:59:07+00:00" + "time": "2021-07-28T10:34:58+00:00" }, { "name": "webmozart/assert", diff --git a/docs/Model/DepositAddress.md b/docs/Model/DepositAddress.md index 5ca10d3..b193c5a 100644 --- a/docs/Model/DepositAddress.md +++ b/docs/Model/DepositAddress.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **string** | Currency detail | **address** | **string** | Deposit address | -**multichain_address** | [**\GateApi\Model\MultiChainAddressItem[]**](MultiChainAddressItem.md) | | [optional] +**multichain_addresses** | [**\GateApi\Model\MultiChainAddressItem[]**](MultiChainAddressItem.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/src/Configuration.php b/src/Configuration.php index f23e331..60411f0 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.21.5/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.21.6/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.21.5' . PHP_EOL; - $report .= ' SDK Package Version: 5.21.5' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.21.6' . PHP_EOL; + $report .= ' SDK Package Version: 5.21.6' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/DepositAddress.php b/src/Model/DepositAddress.php index 6904aab..d008648 100644 --- a/src/Model/DepositAddress.php +++ b/src/Model/DepositAddress.php @@ -56,7 +56,7 @@ class DepositAddress implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'currency' => 'string', 'address' => 'string', - 'multichain_address' => '\GateApi\Model\MultiChainAddressItem[]' + 'multichain_addresses' => '\GateApi\Model\MultiChainAddressItem[]' ]; /** @@ -67,7 +67,7 @@ class DepositAddress implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'currency' => null, 'address' => null, - 'multichain_address' => null + 'multichain_addresses' => null ]; /** @@ -99,7 +99,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'currency' => 'currency', 'address' => 'address', - 'multichain_address' => 'multichain_address' + 'multichain_addresses' => 'multichain_addresses' ]; /** @@ -110,7 +110,7 @@ public static function openAPIFormats() protected static $setters = [ 'currency' => 'setCurrency', 'address' => 'setAddress', - 'multichain_address' => 'setMultichainAddress' + 'multichain_addresses' => 'setMultichainAddresses' ]; /** @@ -121,7 +121,7 @@ public static function openAPIFormats() protected static $getters = [ 'currency' => 'getCurrency', 'address' => 'getAddress', - 'multichain_address' => 'getMultichainAddress' + 'multichain_addresses' => 'getMultichainAddresses' ]; /** @@ -186,7 +186,7 @@ public function __construct(array $data = null) { $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; $this->container['address'] = isset($data['address']) ? $data['address'] : null; - $this->container['multichain_address'] = isset($data['multichain_address']) ? $data['multichain_address'] : null; + $this->container['multichain_addresses'] = isset($data['multichain_addresses']) ? $data['multichain_addresses'] : null; } /** @@ -268,25 +268,25 @@ public function setAddress($address) } /** - * Gets multichain_address + * Gets multichain_addresses * * @return \GateApi\Model\MultiChainAddressItem[]|null */ - public function getMultichainAddress() + public function getMultichainAddresses() { - return $this->container['multichain_address']; + return $this->container['multichain_addresses']; } /** - * Sets multichain_address + * Sets multichain_addresses * - * @param \GateApi\Model\MultiChainAddressItem[]|null $multichain_address multichain_address + * @param \GateApi\Model\MultiChainAddressItem[]|null $multichain_addresses multichain_addresses * * @return $this */ - public function setMultichainAddress($multichain_address) + public function setMultichainAddresses($multichain_addresses) { - $this->container['multichain_address'] = $multichain_address; + $this->container['multichain_addresses'] = $multichain_addresses; return $this; } From 7a0669874524690237272ebc84b250c3f308b0d9 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Tue, 7 Sep 2021 10:51:22 +0800 Subject: [PATCH 04/17] support total balance API --- README.md | 25 +- composer.json | 2 +- composer.lock | 87 +-- docs/Api/DeliveryApi.md | 84 +-- docs/Api/FuturesApi.md | 80 +-- docs/Api/MarginApi.md | 200 +++++-- docs/Api/SpotApi.md | 80 +-- docs/Api/WalletApi.md | 95 +++- docs/Model/AccountBalance.md | 10 + docs/Model/BatchOrder.md | 18 +- docs/Model/Contract.md | 4 +- docs/Model/CrossMarginAccountBook.md | 2 +- docs/Model/CrossMarginBalance.md | 2 +- docs/Model/CrossMarginBorrowable.md | 10 + docs/Model/CrossMarginLoan.md | 2 +- docs/Model/DeliveryContract.md | 4 +- docs/Model/FundingAccount.md | 2 +- docs/Model/FundingBookItem.md | 2 +- docs/Model/FuturesInitialOrder.md | 2 +- docs/Model/FuturesOrder.md | 6 +- docs/Model/FuturesOrderBook.md | 2 +- docs/Model/FuturesPriceTrigger.md | 4 +- docs/Model/FuturesPriceTriggeredOrder.md | 2 +- docs/Model/FuturesTicker.md | 2 +- docs/Model/LedgerRecord.md | 4 +- docs/Model/Loan.md | 13 +- docs/Model/LoanPatch.md | 2 +- docs/Model/LoanRecord.md | 2 +- docs/Model/MarginAccount.md | 2 + docs/Model/MarginAccountBook.md | 2 +- docs/Model/MarginAccountCurrency.md | 2 +- docs/Model/MarginBorrowable.md | 11 + docs/Model/MultiChainAddressItem.md | 2 +- docs/Model/Order.md | 12 +- docs/Model/OrderBook.md | 4 +- docs/Model/Position.md | 2 +- docs/Model/SpotPriceTrigger.md | 2 +- docs/Model/SpotPriceTriggeredOrder.md | 2 +- docs/Model/TotalBalance.md | 10 + docs/Model/Trade.md | 2 +- docs/Model/TradeFee.md | 2 +- docs/Model/Transfer.md | 4 +- src/Api/DeliveryApi.php | 190 +++---- src/Api/FuturesApi.php | 180 +++--- src/Api/MarginApi.php | 691 ++++++++++++++++++++--- src/Api/SpotApi.php | 227 +++++--- src/Api/WalletApi.php | 351 ++++++++++-- src/Configuration.php | 6 +- src/Model/AccountBalance.php | 371 ++++++++++++ src/Model/BatchOrder.php | 18 +- src/Model/Contract.php | 4 +- src/Model/CrossMarginAccountBook.php | 2 +- src/Model/CrossMarginBalance.php | 2 +- src/Model/CrossMarginBorrowable.php | 334 +++++++++++ src/Model/CrossMarginLoan.php | 2 +- src/Model/DeliveryContract.php | 4 +- src/Model/FundingAccount.php | 2 +- src/Model/FundingBookItem.php | 2 +- src/Model/FuturesInitialOrder.php | 2 +- src/Model/FuturesOrder.php | 6 +- src/Model/FuturesOrderBook.php | 2 +- src/Model/FuturesPriceTrigger.php | 4 +- src/Model/FuturesPriceTriggeredOrder.php | 2 +- src/Model/FuturesTicker.php | 2 +- src/Model/LedgerRecord.php | 4 +- src/Model/Loan.php | 57 +- src/Model/LoanPatch.php | 2 +- src/Model/LoanRecord.php | 2 +- src/Model/MarginAccount.php | 60 ++ src/Model/MarginAccountBook.php | 2 +- src/Model/MarginAccountCurrency.php | 4 +- src/Model/MarginBorrowable.php | 364 ++++++++++++ src/Model/MultiChainAddressItem.php | 2 +- src/Model/Order.php | 12 +- src/Model/OrderBook.php | 4 +- src/Model/Position.php | 2 +- src/Model/SpotPriceTrigger.php | 2 +- src/Model/SpotPriceTriggeredOrder.php | 2 +- src/Model/TotalBalance.php | 335 +++++++++++ src/Model/Trade.php | 2 +- src/Model/TradeFee.php | 2 +- src/Model/Transfer.php | 4 +- 82 files changed, 3355 insertions(+), 718 deletions(-) create mode 100644 docs/Model/AccountBalance.md create mode 100644 docs/Model/CrossMarginBorrowable.md create mode 100644 docs/Model/MarginBorrowable.md create mode 100644 docs/Model/TotalBalance.md create mode 100644 src/Model/AccountBalance.php create mode 100644 src/Model/CrossMarginBorrowable.php create mode 100644 src/Model/MarginBorrowable.php create mode 100644 src/Model/TotalBalance.php diff --git a/README.md b/README.md index 8182837..b9c74b3 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.21.6 -- Package version: 5.21.6 +- API version: 4.22.1 +- Package version: 5.22.1 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) @@ -173,12 +173,13 @@ Class | Method | HTTP request | Description *MarginApi* | [**updateLoan**](docs/Api/MarginApi.md#updateloan) | **PATCH** /margin/loans/{loan_id} | Modify a loan *MarginApi* | [**listLoanRepayments**](docs/Api/MarginApi.md#listloanrepayments) | **GET** /margin/loans/{loan_id}/repayment | List loan repayment records *MarginApi* | [**repayLoan**](docs/Api/MarginApi.md#repayloan) | **POST** /margin/loans/{loan_id}/repayment | Repay a loan -*MarginApi* | [**listLoanRecords**](docs/Api/MarginApi.md#listloanrecords) | **GET** /margin/loan_records | List repayment records of specified loan +*MarginApi* | [**listLoanRecords**](docs/Api/MarginApi.md#listloanrecords) | **GET** /margin/loan_records | List repayment records of a specific loan *MarginApi* | [**getLoanRecord**](docs/Api/MarginApi.md#getloanrecord) | **GET** /margin/loan_records/{loan_record_id} | Get one single loan record *MarginApi* | [**updateLoanRecord**](docs/Api/MarginApi.md#updateloanrecord) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record *MarginApi* | [**getAutoRepayStatus**](docs/Api/MarginApi.md#getautorepaystatus) | **GET** /margin/auto_repay | Retrieve user auto repayment setting *MarginApi* | [**setAutoRepay**](docs/Api/MarginApi.md#setautorepay) | **POST** /margin/auto_repay | Update user's auto repayment setting -*MarginApi* | [**getMarginTransferable**](docs/Api/MarginApi.md#getmargintransferable) | **GET** /margin/transferable | Max transferable amount for specified margin currency +*MarginApi* | [**getMarginTransferable**](docs/Api/MarginApi.md#getmargintransferable) | **GET** /margin/transferable | Get the max transferable amount for a specific margin currency +*MarginApi* | [**getMarginBorrowable**](docs/Api/MarginApi.md#getmarginborrowable) | **GET** /margin/borrowable | Get the max borrowable amount for a specific margin currency *MarginApi* | [**listCrossMarginCurrencies**](docs/Api/MarginApi.md#listcrossmargincurrencies) | **GET** /margin/cross/currencies | Currencies supported by cross margin. *MarginApi* | [**getCrossMarginCurrency**](docs/Api/MarginApi.md#getcrossmargincurrency) | **GET** /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin *MarginApi* | [**getCrossMarginAccount**](docs/Api/MarginApi.md#getcrossmarginaccount) | **GET** /margin/cross/accounts | Retrieve cross margin account @@ -188,11 +189,12 @@ Class | Method | HTTP request | Description *MarginApi* | [**getCrossMarginLoan**](docs/Api/MarginApi.md#getcrossmarginloan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail *MarginApi* | [**listCrossMarginRepayments**](docs/Api/MarginApi.md#listcrossmarginrepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments *MarginApi* | [**repayCrossMarginLoan**](docs/Api/MarginApi.md#repaycrossmarginloan) | **POST** /margin/cross/repayments | Repay cross margin loan -*MarginApi* | [**getCrossMarginTransferable**](docs/Api/MarginApi.md#getcrossmargintransferable) | **GET** /margin/cross/transferable | Max transferable amount for specified cross margin currency -*SpotApi* | [**listCurrencies**](docs/Api/SpotApi.md#listcurrencies) | **GET** /spot/currencies | List all currencies' detail -*SpotApi* | [**getCurrency**](docs/Api/SpotApi.md#getcurrency) | **GET** /spot/currencies/{currency} | Get detail of one particular currency +*MarginApi* | [**getCrossMarginTransferable**](docs/Api/MarginApi.md#getcrossmargintransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency +*MarginApi* | [**getCrossMarginBorrowable**](docs/Api/MarginApi.md#getcrossmarginborrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency +*SpotApi* | [**listCurrencies**](docs/Api/SpotApi.md#listcurrencies) | **GET** /spot/currencies | List all currencies' details +*SpotApi* | [**getCurrency**](docs/Api/SpotApi.md#getcurrency) | **GET** /spot/currencies/{currency} | Get details of a specific currency *SpotApi* | [**listCurrencyPairs**](docs/Api/SpotApi.md#listcurrencypairs) | **GET** /spot/currency_pairs | List all currency pairs supported -*SpotApi* | [**getCurrencyPair**](docs/Api/SpotApi.md#getcurrencypair) | **GET** /spot/currency_pairs/{currency_pair} | Get detail of one single order +*SpotApi* | [**getCurrencyPair**](docs/Api/SpotApi.md#getcurrencypair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc order *SpotApi* | [**listTickers**](docs/Api/SpotApi.md#listtickers) | **GET** /spot/tickers | Retrieve ticker information *SpotApi* | [**listOrderBook**](docs/Api/SpotApi.md#listorderbook) | **GET** /spot/order_book | Retrieve order book *SpotApi* | [**listTrades**](docs/Api/SpotApi.md#listtrades) | **GET** /spot/trades | Retrieve market trades @@ -217,17 +219,19 @@ Class | Method | HTTP request | Description *WalletApi* | [**listWithdrawals**](docs/Api/WalletApi.md#listwithdrawals) | **GET** /wallet/withdrawals | Retrieve withdrawal records *WalletApi* | [**listDeposits**](docs/Api/WalletApi.md#listdeposits) | **GET** /wallet/deposits | Retrieve deposit records *WalletApi* | [**transfer**](docs/Api/WalletApi.md#transfer) | **POST** /wallet/transfers | Transfer between trading accounts -*WalletApi* | [**listSubAccountTransfers**](docs/Api/WalletApi.md#listsubaccounttransfers) | **GET** /wallet/sub_account_transfers | Transfer records between main and sub accounts +*WalletApi* | [**listSubAccountTransfers**](docs/Api/WalletApi.md#listsubaccounttransfers) | **GET** /wallet/sub_account_transfers | Retrieve transfer records between main and sub accounts *WalletApi* | [**transferWithSubAccount**](docs/Api/WalletApi.md#transferwithsubaccount) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts *WalletApi* | [**listWithdrawStatus**](docs/Api/WalletApi.md#listwithdrawstatus) | **GET** /wallet/withdraw_status | Retrieve withdrawal status *WalletApi* | [**listSubAccountBalances**](docs/Api/WalletApi.md#listsubaccountbalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances *WalletApi* | [**getTradeFee**](docs/Api/WalletApi.md#gettradefee) | **GET** /wallet/fee | Retrieve personal trading fee +*WalletApi* | [**getTotalBalance**](docs/Api/WalletApi.md#gettotalbalance) | **GET** /wallet/total_balance | Retrieve user's total balances *WithdrawalApi* | [**withdraw**](docs/Api/WithdrawalApi.md#withdraw) | **POST** /withdrawals | Withdraw *WithdrawalApi* | [**cancelWithdrawal**](docs/Api/WithdrawalApi.md#cancelwithdrawal) | **DELETE** /withdrawals/{withdrawal_id} | Cancel withdrawal with specified ID ## Documentation For Models + - [AccountBalance](docs/Model/AccountBalance.md) - [AutoRepaySetting](docs/Model/AutoRepaySetting.md) - [BatchOrder](docs/Model/BatchOrder.md) - [CancelOrder](docs/Model/CancelOrder.md) @@ -237,6 +241,7 @@ Class | Method | HTTP request | Description - [CrossMarginAccount](docs/Model/CrossMarginAccount.md) - [CrossMarginAccountBook](docs/Model/CrossMarginAccountBook.md) - [CrossMarginBalance](docs/Model/CrossMarginBalance.md) + - [CrossMarginBorrowable](docs/Model/CrossMarginBorrowable.md) - [CrossMarginCurrency](docs/Model/CrossMarginCurrency.md) - [CrossMarginLoan](docs/Model/CrossMarginLoan.md) - [CrossMarginRepayRequest](docs/Model/CrossMarginRepayRequest.md) @@ -270,6 +275,7 @@ Class | Method | HTTP request | Description - [MarginAccount](docs/Model/MarginAccount.md) - [MarginAccountBook](docs/Model/MarginAccountBook.md) - [MarginAccountCurrency](docs/Model/MarginAccountCurrency.md) + - [MarginBorrowable](docs/Model/MarginBorrowable.md) - [MarginCurrencyPair](docs/Model/MarginCurrencyPair.md) - [MarginTransferable](docs/Model/MarginTransferable.md) - [MultiChainAddressItem](docs/Model/MultiChainAddressItem.md) @@ -289,6 +295,7 @@ Class | Method | HTTP request | Description - [SubAccountBalance](docs/Model/SubAccountBalance.md) - [SubAccountTransfer](docs/Model/SubAccountTransfer.md) - [Ticker](docs/Model/Ticker.md) + - [TotalBalance](docs/Model/TotalBalance.md) - [Trade](docs/Model/Trade.md) - [TradeFee](docs/Model/TradeFee.md) - [Transfer](docs/Model/Transfer.md) diff --git a/composer.json b/composer.json index 8ff1ae0..89f66a5 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.21.6", + "version": "5.22.1", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index a95bf11..537ed54 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "19456e8951793c321e56122dfc329c7f", + "content-hash": "b430509cdcbece1a85e100d0a12c5504", "packages": [ { "name": "guzzlehttp/guzzle", @@ -999,16 +999,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.19.1", + "version": "v2.19.2", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "1fa4af92841f67362c053728989b262fba8eb1ec" + "reference": "d5c737c2e18ba502b75b44832b31fe627f82e307" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/1fa4af92841f67362c053728989b262fba8eb1ec", - "reference": "1fa4af92841f67362c053728989b262fba8eb1ec", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/d5c737c2e18ba502b75b44832b31fe627f82e307", + "reference": "d5c737c2e18ba502b75b44832b31fe627f82e307", "shasum": "", "mirrors": [ { @@ -1102,7 +1102,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.1" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.2" }, "funding": [ { @@ -1110,7 +1110,7 @@ "type": "github" } ], - "time": "2021-08-02T17:52:09+00:00" + "time": "2021-08-18T19:55:46+00:00" }, { "name": "myclabs/deep-copy", @@ -2919,6 +2919,7 @@ "type": "github" } ], + "abandoned": true, "time": "2020-11-30T07:30:19+00:00" }, { @@ -3065,16 +3066,16 @@ }, { "name": "symfony/console", - "version": "v5.3.6", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2" + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2", + "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a", + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a", "shasum": "", "mirrors": [ { @@ -3150,7 +3151,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.6" + "source": "https://github.com/symfony/console/tree/v5.3.7" }, "funding": [ { @@ -3166,7 +3167,7 @@ "type": "tidelift" } ], - "time": "2021-07-27T19:10:22+00:00" + "time": "2021-08-25T20:02:16+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3243,16 +3244,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.3.4", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "f2fd2208157553874560f3645d4594303058c4bd" + "reference": "ce7b20d69c66a20939d8952b617506a44d102130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f2fd2208157553874560f3645d4594303058c4bd", - "reference": "f2fd2208157553874560f3645d4594303058c4bd", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ce7b20d69c66a20939d8952b617506a44d102130", + "reference": "ce7b20d69c66a20939d8952b617506a44d102130", "shasum": "", "mirrors": [ { @@ -3314,7 +3315,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.3.4" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.3.7" }, "funding": [ { @@ -3330,7 +3331,7 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:55:36+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -3488,16 +3489,16 @@ }, { "name": "symfony/finder", - "version": "v5.3.4", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "17f50e06018baec41551a71a15731287dbaab186" + "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/17f50e06018baec41551a71a15731287dbaab186", - "reference": "17f50e06018baec41551a71a15731287dbaab186", + "url": "https://api.github.com/repos/symfony/finder/zipball/a10000ada1e600d109a6c7632e9ac42e8bf2fb93", + "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93", "shasum": "", "mirrors": [ { @@ -3536,7 +3537,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.3.4" + "source": "https://github.com/symfony/finder/tree/v5.3.7" }, "funding": [ { @@ -3552,20 +3553,20 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:54:19+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.3.4", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e" + "reference": "4b78e55b179003a42523a362cc0e8327f7a69b5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a603e5701bd6e305cfc777a8b50bf081ef73105e", - "reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4b78e55b179003a42523a362cc0e8327f7a69b5e", + "reference": "4b78e55b179003a42523a362cc0e8327f7a69b5e", "shasum": "", "mirrors": [ { @@ -3611,7 +3612,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.3.4" + "source": "https://github.com/symfony/options-resolver/tree/v5.3.7" }, "funding": [ { @@ -3627,7 +3628,7 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:55:36+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4137,16 +4138,16 @@ }, { "name": "symfony/process", - "version": "v5.3.4", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "d16634ee55b895bd85ec714dadc58e4428ecf030" + "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d16634ee55b895bd85ec714dadc58e4428ecf030", - "reference": "d16634ee55b895bd85ec714dadc58e4428ecf030", + "url": "https://api.github.com/repos/symfony/process/zipball/38f26c7d6ed535217ea393e05634cb0b244a1967", + "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967", "shasum": "", "mirrors": [ { @@ -4185,7 +4186,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.3.4" + "source": "https://github.com/symfony/process/tree/v5.3.7" }, "funding": [ { @@ -4201,7 +4202,7 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:54:19+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/service-contracts", @@ -4358,16 +4359,16 @@ }, { "name": "symfony/string", - "version": "v5.3.3", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1" + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5", + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5", "shasum": "", "mirrors": [ { @@ -4427,7 +4428,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.3" + "source": "https://github.com/symfony/string/tree/v5.3.7" }, "funding": [ { @@ -4443,7 +4444,7 @@ "type": "tidelift" } ], - "time": "2021-06-27T11:44:38+00:00" + "time": "2021-08-26T08:00:08+00:00" }, { "name": "theseer/tokenizer", diff --git a/docs/Api/DeliveryApi.md b/docs/Api/DeliveryApi.md index 737f57b..e0270bb 100644 --- a/docs/Api/DeliveryApi.md +++ b/docs/Api/DeliveryApi.md @@ -172,7 +172,7 @@ $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT_20200814'; // string | Futures contract $associate_array['interval'] = '0'; // string | Order depth. 0 means no aggregation is applied. default to 0 $associate_array['limit'] = 10; // int | Maximum number of order depth data in asks or bids -$associate_array['with_id'] = false; // bool | Whether order book update ID would be returned. This ID increments by 1 on every order book update +$associate_array['with_id'] = false; // bool | Whether the order book update ID will be returned. This ID increases by 1 on every order book update try { $result = $apiInstance->listDeliveryOrderBook($associate_array); @@ -196,7 +196,7 @@ Name | Type | Description | Notes **contract** | **string**| Futures contract | **interval** | **string**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0'] **limit** | **int**| Maximum number of order depth data in asks or bids | [optional] [default to 10] - **with_id** | **bool**| Whether order book update ID would be returned. This ID increments by 1 on every order book update | [optional] [default to false] + **with_id** | **bool**| Whether the order book update ID will be returned. This ID increases by 1 on every order book update | [optional] [default to false] ### Return type @@ -236,8 +236,8 @@ $apiInstance = new GateApi\Api\DeliveryApi( ); $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT_20200814'; // string | Futures contract -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list -$associate_array['last_id'] = '12345'; // string | Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['last_id'] = '12345'; // string | Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range $associate_array['from'] = 1546905600; // int | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. $associate_array['to'] = 1546935600; // int | Specify end time in Unix seconds, default to current time @@ -261,8 +261,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] - **last_id** | **string**| Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range | [optional] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **last_id** | **string**| Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range | [optional] **from** | **int**| Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. | [optional] **to** | **int**| Specify end time in Unix seconds, default to current time | [optional] @@ -308,7 +308,7 @@ $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT_20200814'; // string | Futures contract $associate_array['from'] = 1546905600; // int | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified $associate_array['to'] = 1546935600; // int | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time -$associate_array['limit'] = 100; // int | Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. +$associate_array['limit'] = 100; // int | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. $associate_array['interval'] = '5m'; // string | Interval time between data points try { @@ -333,7 +333,7 @@ Name | Type | Description | Notes **contract** | **string**| Futures contract | **from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] **to** | **int**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] - **limit** | **int**| Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] + **limit** | **int**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] **interval** | **string**| Interval time between data points | [optional] [default to '5m'] ### Return type @@ -433,7 +433,7 @@ $apiInstance = new GateApi\Api\DeliveryApi( new GuzzleHttp\Client() ); $associate_array['settle'] = 'usdt'; // string | Settle currency -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list try { $result = $apiInstance->listDeliveryInsuranceLedger($associate_array); @@ -454,7 +454,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] ### Return type @@ -557,7 +557,7 @@ $apiInstance = new GateApi\Api\DeliveryApi( $config ); $associate_array['settle'] = 'usdt'; // string | Settle currency -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['from'] = 1547706332; // int | Start timestamp $associate_array['to'] = 1547706332; // int | End timestamp $associate_array['type'] = 'dnw'; // string | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate @@ -581,7 +581,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **from** | **int**| Start timestamp | [optional] **to** | **int**| End timestamp | [optional] **type** | **string**| Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] @@ -924,7 +924,7 @@ Name | Type | Description | Notes List futures orders -Zero-fill order cannot be retrieved 60 seconds after cancellation +Zero-fill order cannot be retrieved for 60 seconds after cancellation ### Example @@ -943,9 +943,9 @@ $apiInstance = new GateApi\Api\DeliveryApi( $config ); $associate_array['settle'] = 'usdt'; // string | Settle currency -$associate_array['status'] = 'open'; // string | List orders based on status +$associate_array['status'] = 'open'; // string | Only list the orders with this status $associate_array['contract'] = 'BTC_USDT_20200814'; // string | Futures contract -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['last_id'] = '12345'; // string | Specify list staring point using the `id` of last record in previous list-query results $associate_array['count_total'] = 0; // int | Whether to return total number matched. Default to 0(no return) @@ -969,9 +969,9 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **status** | **string**| List orders based on status | + **status** | **string**| Only list the orders with this status | **contract** | **string**| Futures contract | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **last_id** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] **count_total** | **int**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] @@ -1000,7 +1000,7 @@ Name | Type | Description | Notes Create a futures order -Zero-fill order cannot be retrieved 60 seconds after cancellation +Zero-fill order cannot be retrieved for 60 seconds after cancellation ### Example @@ -1064,7 +1064,7 @@ Name | Type | Description | Notes Cancel all `open` orders matched -Zero-fill order cannot be retrieved 60 seconds after cancellation +Zero-fill order cannot be retrieved for 60 seconds after cancellation ### Example @@ -1084,7 +1084,7 @@ $apiInstance = new GateApi\Api\DeliveryApi( ); $settle = 'usdt'; // string | Settle currency $contract = 'BTC_USDT_20200814'; // string | Futures contract -$side = 'ask'; // string | All bids or asks. Both included in not specified +$side = 'ask'; // string | All bids or asks. Both included if not specified try { $result = $apiInstance->cancelDeliveryOrders($settle, $contract, $side); @@ -1104,7 +1104,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | - **side** | **string**| All bids or asks. Both included in not specified | [optional] + **side** | **string**| All bids or asks. Both included if not specified | [optional] ### Return type @@ -1130,7 +1130,7 @@ Name | Type | Description | Notes Get a single order -Zero-fill order cannot be retrieved 60 seconds after cancellation +Zero-fill order cannot be retrieved for 60 seconds after cancellation ### Example @@ -1149,7 +1149,7 @@ $apiInstance = new GateApi\Api\DeliveryApi( $config ); $settle = 'usdt'; // string | Settle currency -$order_id = '12345'; // string | ID returned on order successfully being created +$order_id = '12345'; // string | Retrieve the data of the order with the specified ID try { $result = $apiInstance->getDeliveryOrder($settle, $order_id); @@ -1168,7 +1168,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **order_id** | **string**| ID returned on order successfully being created | + **order_id** | **string**| Retrieve the data of the order with the specified ID | ### Return type @@ -1211,7 +1211,7 @@ $apiInstance = new GateApi\Api\DeliveryApi( $config ); $settle = 'usdt'; // string | Settle currency -$order_id = '12345'; // string | ID returned on order successfully being created +$order_id = '12345'; // string | Retrieve the data of the order with the specified ID try { $result = $apiInstance->cancelDeliveryOrder($settle, $order_id); @@ -1230,7 +1230,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **order_id** | **string**| ID returned on order successfully being created | + **order_id** | **string**| Retrieve the data of the order with the specified ID | ### Return type @@ -1275,7 +1275,7 @@ $apiInstance = new GateApi\Api\DeliveryApi( $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT_20200814'; // string | Futures contract $associate_array['order'] = 12345; // int | Futures order ID, return related data only if specified -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['last_id'] = '12345'; // string | Specify list staring point using the `id` of last record in previous list-query results $associate_array['count_total'] = 0; // int | Whether to return total number matched. Default to 0(no return) @@ -1301,7 +1301,7 @@ Name | Type | Description | Notes **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | [optional] **order** | **int**| Futures order ID, return related data only if specified | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **last_id** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] **count_total** | **int**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] @@ -1348,7 +1348,7 @@ $apiInstance = new GateApi\Api\DeliveryApi( ); $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT_20200814'; // string | Futures contract -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list try { $result = $apiInstance->listDeliveryPositionClose($associate_array); @@ -1370,7 +1370,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] ### Return type @@ -1414,7 +1414,7 @@ $apiInstance = new GateApi\Api\DeliveryApi( ); $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT_20200814'; // string | Futures contract -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['at'] = 0; // int | Specify a liquidation timestamp try { @@ -1437,7 +1437,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **at** | **int**| Specify a liquidation timestamp | [optional] [default to 0] ### Return type @@ -1482,7 +1482,7 @@ $apiInstance = new GateApi\Api\DeliveryApi( ); $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT_20200814'; // string | Futures contract -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['at'] = 0; // int | Specify a settlement timestamp try { @@ -1505,7 +1505,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **at** | **int**| Specify a settlement timestamp | [optional] [default to 0] ### Return type @@ -1549,9 +1549,9 @@ $apiInstance = new GateApi\Api\DeliveryApi( $config ); $associate_array['settle'] = 'usdt'; // string | Settle currency -$associate_array['status'] = 'status_example'; // string | List orders based on status +$associate_array['status'] = 'status_example'; // string | Only list the orders with this status $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract, return related data only if specified -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 try { @@ -1573,9 +1573,9 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **status** | **string**| List orders based on status | + **status** | **string**| Only list the orders with this status | **contract** | **string**| Futures contract, return related data only if specified | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] ### Return type @@ -1743,7 +1743,7 @@ $apiInstance = new GateApi\Api\DeliveryApi( $config ); $settle = 'usdt'; // string | Settle currency -$order_id = 'order_id_example'; // string | ID returned on order successfully being created +$order_id = 'order_id_example'; // string | Retrieve the data of the order with the specified ID try { $result = $apiInstance->getPriceTriggeredDeliveryOrder($settle, $order_id); @@ -1762,7 +1762,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **order_id** | **string**| ID returned on order successfully being created | + **order_id** | **string**| Retrieve the data of the order with the specified ID | ### Return type @@ -1805,7 +1805,7 @@ $apiInstance = new GateApi\Api\DeliveryApi( $config ); $settle = 'usdt'; // string | Settle currency -$order_id = 'order_id_example'; // string | ID returned on order successfully being created +$order_id = 'order_id_example'; // string | Retrieve the data of the order with the specified ID try { $result = $apiInstance->cancelPriceTriggeredDeliveryOrder($settle, $order_id); @@ -1824,7 +1824,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **order_id** | **string**| ID returned on order successfully being created | + **order_id** | **string**| Retrieve the data of the order with the specified ID | ### Return type diff --git a/docs/Api/FuturesApi.md b/docs/Api/FuturesApi.md index 68a6d4e..f64e953 100644 --- a/docs/Api/FuturesApi.md +++ b/docs/Api/FuturesApi.md @@ -179,7 +179,7 @@ $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract $associate_array['interval'] = '0'; // string | Order depth. 0 means no aggregation is applied. default to 0 $associate_array['limit'] = 10; // int | Maximum number of order depth data in asks or bids -$associate_array['with_id'] = false; // bool | Whether order book update ID would be returned. This ID increments by 1 on every order book update +$associate_array['with_id'] = false; // bool | Whether the order book update ID will be returned. This ID increases by 1 on every order book update try { $result = $apiInstance->listFuturesOrderBook($associate_array); @@ -203,7 +203,7 @@ Name | Type | Description | Notes **contract** | **string**| Futures contract | **interval** | **string**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0'] **limit** | **int**| Maximum number of order depth data in asks or bids | [optional] [default to 10] - **with_id** | **bool**| Whether order book update ID would be returned. This ID increments by 1 on every order book update | [optional] [default to false] + **with_id** | **bool**| Whether the order book update ID will be returned. This ID increases by 1 on every order book update | [optional] [default to false] ### Return type @@ -243,8 +243,8 @@ $apiInstance = new GateApi\Api\FuturesApi( ); $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list -$associate_array['last_id'] = '12345'; // string | Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['last_id'] = '12345'; // string | Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range $associate_array['from'] = 1546905600; // int | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. $associate_array['to'] = 1546935600; // int | Specify end time in Unix seconds, default to current time @@ -268,8 +268,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] - **last_id** | **string**| Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range | [optional] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **last_id** | **string**| Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range | [optional] **from** | **int**| Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. | [optional] **to** | **int**| Specify end time in Unix seconds, default to current time | [optional] @@ -315,7 +315,7 @@ $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract $associate_array['from'] = 1546905600; // int | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified $associate_array['to'] = 1546935600; // int | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time -$associate_array['limit'] = 100; // int | Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. +$associate_array['limit'] = 100; // int | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. $associate_array['interval'] = '5m'; // string | Interval time between data points try { @@ -340,7 +340,7 @@ Name | Type | Description | Notes **contract** | **string**| Futures contract | **from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] **to** | **int**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] - **limit** | **int**| Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] + **limit** | **int**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] **interval** | **string**| Interval time between data points | [optional] [default to '5m'] ### Return type @@ -441,7 +441,7 @@ $apiInstance = new GateApi\Api\FuturesApi( ); $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list try { $result = $apiInstance->listFuturesFundingRateHistory($associate_array); @@ -463,7 +463,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] ### Return type @@ -502,7 +502,7 @@ $apiInstance = new GateApi\Api\FuturesApi( new GuzzleHttp\Client() ); $associate_array['settle'] = 'usdt'; // string | Settle currency -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list try { $result = $apiInstance->listFuturesInsuranceLedger($associate_array); @@ -523,7 +523,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] ### Return type @@ -633,7 +633,7 @@ $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract, return related data only if specified $associate_array['from'] = 1547706332; // int | Start timestamp $associate_array['to'] = 1547706332; // int | End timestamp -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list try { $result = $apiInstance->listLiquidatedOrders($associate_array); @@ -657,7 +657,7 @@ Name | Type | Description | Notes **contract** | **string**| Futures contract, return related data only if specified | [optional] **from** | **int**| Start timestamp | [optional] **to** | **int**| End timestamp | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] ### Return type @@ -760,7 +760,7 @@ $apiInstance = new GateApi\Api\FuturesApi( $config ); $associate_array['settle'] = 'usdt'; // string | Settle currency -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['from'] = 1547706332; // int | Start timestamp $associate_array['to'] = 1547706332; // int | End timestamp $associate_array['type'] = 'dnw'; // string | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate @@ -784,7 +784,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **from** | **int**| Start timestamp | [optional] **to** | **int**| End timestamp | [optional] **type** | **string**| Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] @@ -1449,7 +1449,7 @@ Name | Type | Description | Notes List futures orders -Zero-fill order cannot be retrieved 60 seconds after cancellation +Zero-fill order cannot be retrieved for 60 seconds after cancellation ### Example @@ -1469,8 +1469,8 @@ $apiInstance = new GateApi\Api\FuturesApi( ); $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract -$associate_array['status'] = 'open'; // string | List orders based on status -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['status'] = 'open'; // string | Only list the orders with this status +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['last_id'] = '12345'; // string | Specify list staring point using the `id` of last record in previous list-query results $associate_array['count_total'] = 0; // int | Whether to return total number matched. Default to 0(no return) @@ -1495,8 +1495,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | - **status** | **string**| List orders based on status | - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **status** | **string**| Only list the orders with this status | + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **last_id** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] **count_total** | **int**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] @@ -1525,7 +1525,7 @@ Name | Type | Description | Notes Create a futures order -Zero-fill order cannot be retrieved 60 seconds after cancellation +Zero-fill order cannot be retrieved for 60 seconds after cancellation ### Example @@ -1589,7 +1589,7 @@ Name | Type | Description | Notes Cancel all `open` orders matched -Zero-fill order cannot be retrieved 60 seconds after cancellation +Zero-fill order cannot be retrieved for 60 seconds after cancellation ### Example @@ -1609,7 +1609,7 @@ $apiInstance = new GateApi\Api\FuturesApi( ); $settle = 'usdt'; // string | Settle currency $contract = 'BTC_USDT'; // string | Futures contract -$side = 'ask'; // string | All bids or asks. Both included in not specified +$side = 'ask'; // string | All bids or asks. Both included if not specified try { $result = $apiInstance->cancelFuturesOrders($settle, $contract, $side); @@ -1629,7 +1629,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | - **side** | **string**| All bids or asks. Both included in not specified | [optional] + **side** | **string**| All bids or asks. Both included if not specified | [optional] ### Return type @@ -1655,7 +1655,7 @@ Name | Type | Description | Notes Get a single order -Zero-fill order cannot be retrieved 60 seconds after cancellation +Zero-fill order cannot be retrieved for 60 seconds after cancellation ### Example @@ -1800,7 +1800,7 @@ $apiInstance = new GateApi\Api\FuturesApi( $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract, return related data only if specified $associate_array['order'] = 12345; // int | Futures order ID, return related data only if specified -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['last_id'] = '12345'; // string | Specify list staring point using the `id` of last record in previous list-query results $associate_array['count_total'] = 0; // int | Whether to return total number matched. Default to 0(no return) @@ -1826,7 +1826,7 @@ Name | Type | Description | Notes **settle** | **string**| Settle currency | **contract** | **string**| Futures contract, return related data only if specified | [optional] **order** | **int**| Futures order ID, return related data only if specified | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **last_id** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] **count_total** | **int**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] @@ -1873,7 +1873,7 @@ $apiInstance = new GateApi\Api\FuturesApi( ); $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract, return related data only if specified -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['from'] = 1547706332; // int | Start timestamp $associate_array['to'] = 1547706332; // int | End timestamp @@ -1898,7 +1898,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | **contract** | **string**| Futures contract, return related data only if specified | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **from** | **int**| Start timestamp | [optional] **to** | **int**| End timestamp | [optional] @@ -1945,7 +1945,7 @@ $apiInstance = new GateApi\Api\FuturesApi( ); $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract, return related data only if specified -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['at'] = 0; // int | Specify a liquidation timestamp try { @@ -1968,7 +1968,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | **contract** | **string**| Futures contract, return related data only if specified | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **at** | **int**| Specify a liquidation timestamp | [optional] [default to 0] ### Return type @@ -2012,9 +2012,9 @@ $apiInstance = new GateApi\Api\FuturesApi( $config ); $associate_array['settle'] = 'usdt'; // string | Settle currency -$associate_array['status'] = 'status_example'; // string | List orders based on status +$associate_array['status'] = 'status_example'; // string | Only list the orders with this status $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract, return related data only if specified -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 try { @@ -2036,9 +2036,9 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **status** | **string**| List orders based on status | + **status** | **string**| Only list the orders with this status | **contract** | **string**| Futures contract, return related data only if specified | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] ### Return type @@ -2206,7 +2206,7 @@ $apiInstance = new GateApi\Api\FuturesApi( $config ); $settle = 'usdt'; // string | Settle currency -$order_id = 'order_id_example'; // string | ID returned on order successfully being created +$order_id = 'order_id_example'; // string | Retrieve the data of the order with the specified ID try { $result = $apiInstance->getPriceTriggeredOrder($settle, $order_id); @@ -2225,7 +2225,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **order_id** | **string**| ID returned on order successfully being created | + **order_id** | **string**| Retrieve the data of the order with the specified ID | ### Return type @@ -2268,7 +2268,7 @@ $apiInstance = new GateApi\Api\FuturesApi( $config ); $settle = 'usdt'; // string | Settle currency -$order_id = 'order_id_example'; // string | ID returned on order successfully being created +$order_id = 'order_id_example'; // string | Retrieve the data of the order with the specified ID try { $result = $apiInstance->cancelPriceTriggeredOrder($settle, $order_id); @@ -2287,7 +2287,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **order_id** | **string**| ID returned on order successfully being created | + **order_id** | **string**| Retrieve the data of the order with the specified ID | ### Return type diff --git a/docs/Api/MarginApi.md b/docs/Api/MarginApi.md index e7bc963..b526b26 100644 --- a/docs/Api/MarginApi.md +++ b/docs/Api/MarginApi.md @@ -18,12 +18,13 @@ Method | HTTP request | Description [**updateLoan**](MarginApi.md#updateLoan) | **PATCH** /margin/loans/{loan_id} | Modify a loan [**listLoanRepayments**](MarginApi.md#listLoanRepayments) | **GET** /margin/loans/{loan_id}/repayment | List loan repayment records [**repayLoan**](MarginApi.md#repayLoan) | **POST** /margin/loans/{loan_id}/repayment | Repay a loan -[**listLoanRecords**](MarginApi.md#listLoanRecords) | **GET** /margin/loan_records | List repayment records of specified loan +[**listLoanRecords**](MarginApi.md#listLoanRecords) | **GET** /margin/loan_records | List repayment records of a specific loan [**getLoanRecord**](MarginApi.md#getLoanRecord) | **GET** /margin/loan_records/{loan_record_id} | Get one single loan record [**updateLoanRecord**](MarginApi.md#updateLoanRecord) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record [**getAutoRepayStatus**](MarginApi.md#getAutoRepayStatus) | **GET** /margin/auto_repay | Retrieve user auto repayment setting [**setAutoRepay**](MarginApi.md#setAutoRepay) | **POST** /margin/auto_repay | Update user's auto repayment setting -[**getMarginTransferable**](MarginApi.md#getMarginTransferable) | **GET** /margin/transferable | Max transferable amount for specified margin currency +[**getMarginTransferable**](MarginApi.md#getMarginTransferable) | **GET** /margin/transferable | Get the max transferable amount for a specific margin currency +[**getMarginBorrowable**](MarginApi.md#getMarginBorrowable) | **GET** /margin/borrowable | Get the max borrowable amount for a specific margin currency [**listCrossMarginCurrencies**](MarginApi.md#listCrossMarginCurrencies) | **GET** /margin/cross/currencies | Currencies supported by cross margin. [**getCrossMarginCurrency**](MarginApi.md#getCrossMarginCurrency) | **GET** /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin [**getCrossMarginAccount**](MarginApi.md#getCrossMarginAccount) | **GET** /margin/cross/accounts | Retrieve cross margin account @@ -33,7 +34,8 @@ Method | HTTP request | Description [**getCrossMarginLoan**](MarginApi.md#getCrossMarginLoan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail [**listCrossMarginRepayments**](MarginApi.md#listCrossMarginRepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments [**repayCrossMarginLoan**](MarginApi.md#repayCrossMarginLoan) | **POST** /margin/cross/repayments | Repay cross margin loan -[**getCrossMarginTransferable**](MarginApi.md#getCrossMarginTransferable) | **GET** /margin/cross/transferable | Max transferable amount for specified cross margin currency +[**getCrossMarginTransferable**](MarginApi.md#getCrossMarginTransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency +[**getCrossMarginBorrowable**](MarginApi.md#getCrossMarginBorrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency ## listMarginCurrencyPairs @@ -162,7 +164,7 @@ $apiInstance = new GateApi\Api\MarginApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$currency = 'BTC'; // string | Retrieved specified currency related data +$currency = 'BTC'; // string | Retrieve data of the specified currency try { $result = $apiInstance->listFundingBook($currency); @@ -180,7 +182,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **string**| Retrieved specified currency related data | + **currency** | **string**| Retrieve data of the specified currency | ### Return type @@ -291,7 +293,7 @@ $associate_array['currency_pair'] = 'currency_pair_example'; // string | List re $associate_array['from'] = 56; // int | Time range beginning, default to 7 days before current time $associate_array['to'] = 56; // int | Time range ending, default to current time $associate_array['page'] = 1; // int | Page number -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list try { $result = $apiInstance->listMarginAccountBook($associate_array); @@ -316,7 +318,7 @@ Name | Type | Description | Notes **from** | **int**| Time range beginning, default to 7 days before current time | [optional] **to** | **int**| Time range ending, default to current time | [optional] **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] ### Return type @@ -358,7 +360,7 @@ $apiInstance = new GateApi\Api\MarginApi( new GuzzleHttp\Client(), $config ); -$associate_array['currency'] = 'BTC'; // string | Retrieved specified currency related data +$associate_array['currency'] = 'BTC'; // string | Retrieve data of the specified currency try { $result = $apiInstance->listFundingAccounts($associate_array); @@ -378,7 +380,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **string**| Retrieved specified currency related data | [optional] + **currency** | **string**| Retrieve data of the specified currency | [optional] ### Return type @@ -422,12 +424,12 @@ $apiInstance = new GateApi\Api\MarginApi( ); $associate_array['status'] = 'open'; // string | Loan status $associate_array['side'] = 'lend'; // string | Lend or borrow -$associate_array['currency'] = 'BTC'; // string | Retrieved specified currency related data +$associate_array['currency'] = 'BTC'; // string | Retrieve data of the specified currency $associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair $associate_array['sort_by'] = 'rate'; // string | Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` $associate_array['reverse_sort'] = false; // bool | Whether to sort in descending order. Default to `true` $associate_array['page'] = 1; // int | Page number -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list try { $result = $apiInstance->listLoans($associate_array); @@ -449,12 +451,12 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | **string**| Loan status | **side** | **string**| Lend or borrow | - **currency** | **string**| Retrieved specified currency related data | [optional] + **currency** | **string**| Retrieve data of the specified currency | [optional] **currency_pair** | **string**| Currency pair | [optional] **sort_by** | **string**| Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` | [optional] **reverse_sort** | **bool**| Whether to sort in descending order. Default to `true` | [optional] **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] ### Return type @@ -556,8 +558,8 @@ $apiInstance = new GateApi\Api\MarginApi( new GuzzleHttp\Client(), $config ); -$currency = 'BTC'; // string | Retrieved specified currency related data -$ids = '123,234,345'; // string | Lending loan ID list separated by `,`. Maximum of 20 IDs are allowed in one request +$currency = 'BTC'; // string | Retrieve data of the specified currency +$ids = '123,234,345'; // string | A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request try { $result = $apiInstance->mergeLoans($currency, $ids); @@ -575,8 +577,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **string**| Retrieved specified currency related data | - **ids** | **string**| Lending loan ID list separated by `,`. Maximum of 20 IDs are allowed in one request | + **currency** | **string**| Retrieve data of the specified currency | + **ids** | **string**| A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request | ### Return type @@ -664,7 +666,7 @@ Name | Type | Description | Notes Cancel lending loan -Only lending loans can be cancelled +Only lent loans can be cancelled ### Example @@ -683,7 +685,7 @@ $apiInstance = new GateApi\Api\MarginApi( $config ); $loan_id = '12345'; // string | Loan ID -$currency = 'BTC'; // string | Retrieved specified currency related data +$currency = 'BTC'; // string | Retrieve data of the specified currency try { $result = $apiInstance->cancelLoan($loan_id, $currency); @@ -702,7 +704,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loan_id** | **string**| Loan ID | - **currency** | **string**| Retrieved specified currency related data | + **currency** | **string**| Retrieve data of the specified currency | ### Return type @@ -912,7 +914,7 @@ Name | Type | Description | Notes > \GateApi\Model\LoanRecord[] listLoanRecords($loan_id, $status, $page, $limit) -List repayment records of specified loan +List repayment records of a specific loan ### Example @@ -933,7 +935,7 @@ $apiInstance = new GateApi\Api\MarginApi( $associate_array['loan_id'] = '12345'; // string | Loan ID $associate_array['status'] = 'loaned'; // string | Loan record status $associate_array['page'] = 1; // int | Page number -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list try { $result = $apiInstance->listLoanRecords($associate_array); @@ -956,7 +958,7 @@ Name | Type | Description | Notes **loan_id** | **string**| Loan ID | **status** | **string**| Loan record status | [optional] **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] ### Return type @@ -1222,7 +1224,7 @@ Name | Type | Description | Notes > \GateApi\Model\MarginTransferable getMarginTransferable($currency, $currency_pair) -Max transferable amount for specified margin currency +Get the max transferable amount for a specific margin currency ### Example @@ -1240,7 +1242,7 @@ $apiInstance = new GateApi\Api\MarginApi( new GuzzleHttp\Client(), $config ); -$associate_array['currency'] = 'BTC'; // string | Retrieved specified currency related data +$associate_array['currency'] = 'BTC'; // string | Retrieve data of the specified currency $associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair try { @@ -1261,7 +1263,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **string**| Retrieved specified currency related data | + **currency** | **string**| Retrieve data of the specified currency | **currency_pair** | **string**| Currency pair | [optional] ### Return type @@ -1282,6 +1284,70 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## getMarginBorrowable + +> \GateApi\Model\MarginBorrowable getMarginBorrowable($currency, $currency_pair) + +Get the max borrowable amount for a specific margin currency + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\MarginApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['currency'] = 'BTC'; // string | Retrieve data of the specified currency +$associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair + +try { + $result = $apiInstance->getMarginBorrowable($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling MarginApi->getMarginBorrowable: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **string**| Retrieve data of the specified currency | + **currency_pair** | **string**| Currency pair | [optional] + +### Return type + +[**\GateApi\Model\MarginBorrowable**](../Model/MarginBorrowable.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listCrossMarginCurrencies > \GateApi\Model\CrossMarginCurrency[] listCrossMarginCurrencies() @@ -1474,8 +1540,8 @@ $associate_array['currency'] = 'currency_example'; // string | Filter by currenc $associate_array['from'] = 56; // int | Time range beginning, default to 7 days before current time $associate_array['to'] = 56; // int | Time range ending, default to current time $associate_array['page'] = 1; // int | Page number -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list -$associate_array['type'] = 'borrow'; // string | Filter by account change type. All types are returned if not specified. +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['type'] = 'borrow'; // string | Only retrieve changes of the specified type. All types will be returned if not specified. try { $result = $apiInstance->listCrossMarginAccountBook($associate_array); @@ -1499,8 +1565,8 @@ Name | Type | Description | Notes **from** | **int**| Time range beginning, default to 7 days before current time | [optional] **to** | **int**| Time range ending, default to current time | [optional] **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] - **type** | **string**| Filter by account change type. All types are returned if not specified. | [optional] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **type** | **string**| Only retrieve changes of the specified type. All types will be returned if not specified. | [optional] ### Return type @@ -1546,7 +1612,7 @@ $apiInstance = new GateApi\Api\MarginApi( ); $associate_array['status'] = 56; // int | Filter by status. Supported values are 2 and 3. $associate_array['currency'] = 'currency_example'; // string | Filter by currency -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['reverse'] = true; // bool | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results @@ -1570,7 +1636,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | **int**| Filter by status. Supported values are 2 and 3. | **currency** | **string**| Filter by currency | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **reverse** | **bool**| Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results | [optional] [default to true] @@ -1740,7 +1806,7 @@ $apiInstance = new GateApi\Api\MarginApi( ); $associate_array['currency'] = 'BTC'; // string | $associate_array['loan_id'] = '12345'; // string | -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['reverse'] = true; // bool | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results @@ -1764,7 +1830,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency** | **string**| | [optional] **loan_id** | **string**| | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **reverse** | **bool**| Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results | [optional] [default to true] @@ -1850,7 +1916,7 @@ Name | Type | Description | Notes > \GateApi\Model\CrossMarginTransferable getCrossMarginTransferable($currency) -Max transferable amount for specified cross margin currency +Get the max transferable amount for a specific cross margin currency ### Example @@ -1868,7 +1934,7 @@ $apiInstance = new GateApi\Api\MarginApi( new GuzzleHttp\Client(), $config ); -$currency = 'BTC'; // string | Retrieved specified currency related data +$currency = 'BTC'; // string | Retrieve data of the specified currency try { $result = $apiInstance->getCrossMarginTransferable($currency); @@ -1886,7 +1952,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **string**| Retrieved specified currency related data | + **currency** | **string**| Retrieve data of the specified currency | ### Return type @@ -1905,3 +1971,63 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +## getCrossMarginBorrowable + +> \GateApi\Model\CrossMarginBorrowable getCrossMarginBorrowable($currency) + +Get the max borrowable amount for a specific cross margin currency + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\MarginApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$currency = 'BTC'; // string | Retrieve data of the specified currency + +try { + $result = $apiInstance->getCrossMarginBorrowable($currency); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling MarginApi->getCrossMarginBorrowable: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **string**| Retrieve data of the specified currency | + +### Return type + +[**\GateApi\Model\CrossMarginBorrowable**](../Model/CrossMarginBorrowable.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Api/SpotApi.md b/docs/Api/SpotApi.md index 5a8983f..c40bb95 100644 --- a/docs/Api/SpotApi.md +++ b/docs/Api/SpotApi.md @@ -4,10 +4,10 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**listCurrencies**](SpotApi.md#listCurrencies) | **GET** /spot/currencies | List all currencies' detail -[**getCurrency**](SpotApi.md#getCurrency) | **GET** /spot/currencies/{currency} | Get detail of one particular currency +[**listCurrencies**](SpotApi.md#listCurrencies) | **GET** /spot/currencies | List all currencies' details +[**getCurrency**](SpotApi.md#getCurrency) | **GET** /spot/currencies/{currency} | Get details of a specific currency [**listCurrencyPairs**](SpotApi.md#listCurrencyPairs) | **GET** /spot/currency_pairs | List all currency pairs supported -[**getCurrencyPair**](SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Get detail of one single order +[**getCurrencyPair**](SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc order [**listTickers**](SpotApi.md#listTickers) | **GET** /spot/tickers | Retrieve ticker information [**listOrderBook**](SpotApi.md#listOrderBook) | **GET** /spot/order_book | Retrieve order book [**listTrades**](SpotApi.md#listTrades) | **GET** /spot/trades | Retrieve market trades @@ -34,7 +34,7 @@ Method | HTTP request | Description > \GateApi\Model\Currency[] listCurrencies() -List all currencies' detail +List all currencies' details ### Example @@ -86,7 +86,7 @@ No authorization required > \GateApi\Model\Currency getCurrency($currency) -Get detail of one particular currency +Get details of a specific currency ### Example @@ -194,7 +194,7 @@ No authorization required > \GateApi\Model\CurrencyPair getCurrencyPair($currency_pair) -Get detail of one single order +Get details of a specifc order ### Example @@ -312,7 +312,7 @@ No authorization required Retrieve order book -Order book will be sorted by price from high to low on bids; reversed on asks +Order book will be sorted by price from high to low on bids; low to high on asks ### Example @@ -391,9 +391,9 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client() ); $associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['last_id'] = '12345'; // string | Specify list staring point using the `id` of last record in previous list-query results -$associate_array['reverse'] = false; // bool | Whether to retrieve records whose IDs are smaller than `last_id`'s. Default to larger ones. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. +$associate_array['reverse'] = false; // bool | Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. try { $result = $apiInstance->listTrades($associate_array); @@ -414,9 +414,9 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **string**| Currency pair | - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **last_id** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] - **reverse** | **bool**| Whether to retrieve records whose IDs are smaller than `last_id`'s. Default to larger ones. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. | [optional] [default to false] + **reverse** | **bool**| Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. | [optional] [default to false] ### Return type @@ -442,7 +442,7 @@ No authorization required Market candlesticks -Maximum of 1000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval` +Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval ### Example @@ -457,7 +457,7 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client() ); $associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair -$associate_array['limit'] = 100; // int | Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. +$associate_array['limit'] = 100; // int | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. $associate_array['from'] = 1546905600; // int | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified $associate_array['to'] = 1546935600; // int | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time $associate_array['interval'] = '30m'; // string | Interval time between data points @@ -481,7 +481,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **string**| Currency pair | - **limit** | **int**| Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] + **limit** | **int**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] **from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] **to** | **int**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] **interval** | **string**| Interval time between data points | [optional] [default to '30m'] @@ -590,7 +590,7 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client(), $config ); -$associate_array['currency'] = 'BTC'; // string | Retrieved specified currency related data +$associate_array['currency'] = 'BTC'; // string | Retrieve data of the specified currency try { $result = $apiInstance->listSpotAccounts($associate_array); @@ -610,7 +610,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **string**| Retrieved specified currency related data | [optional] + **currency** | **string**| Retrieve data of the specified currency | [optional] ### Return type @@ -762,11 +762,11 @@ Name | Type | Description | Notes ## listOrders -> \GateApi\Model\Order[] listOrders($currency_pair, $status, $page, $limit, $account) +> \GateApi\Model\Order[] listOrders($currency_pair, $status, $page, $limit, $account, $from, $to, $side) List orders -Spot and margin orders are returned by default. If cross margin orders are needed, `account` must be set to `cross_margin` +Spot and margin orders are returned by default. If cross margin orders are needed, `account` must be set to `cross_margin` When `status` is `open`, i.e., listing open orders, only pagination parameters `page` and `limit` are supported and `limit` cannot be larger than 100. Query by `side` and time range parameters `from` and `to` are not supported. When `status` is `finished`, i.e., listing finished orders, pagination parameters, time range parameters `from` and `to`, and `side` parameters are all supported. ### Example @@ -787,8 +787,11 @@ $apiInstance = new GateApi\Api\SpotApi( $associate_array['currency_pair'] = 'BTC_USDT'; // string | Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. $associate_array['status'] = 'open'; // string | List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled $associate_array['page'] = 1; // int | Page number -$associate_array['limit'] = 100; // int | Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 +$associate_array['limit'] = 100; // int | Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 $associate_array['account'] = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account +$associate_array['from'] = 56; // int | Time range beginning, default to 7 days before current time +$associate_array['to'] = 56; // int | Time range ending, default to current time +$associate_array['side'] = 'sell'; // string | All bids or asks. Both included if not specified try { $result = $apiInstance->listOrders($associate_array); @@ -811,8 +814,11 @@ Name | Type | Description | Notes **currency_pair** | **string**| Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. | **status** | **string**| List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled | **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 | [optional] [default to 100] **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] + **from** | **int**| Time range beginning, default to 7 days before current time | [optional] + **to** | **int**| Time range ending, default to current time | [optional] + **side** | **string**| All bids or asks. Both included if not specified | [optional] ### Return type @@ -838,7 +844,7 @@ Name | Type | Description | Notes Create an order -You can place orders with spot, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders. When margin account is used, i.e., `account` is `margin`, `auto_borrow` field can be set to `true` to enable the server to borrow the amount lacked using `POST /margin/loans` when your account's balance is not enough. Whether margin orders' fill will be used to repay margin loans automatically is determined by the auto repayment setting in your **margin account**, which can be updated or queried using `/margin/auto_repay` API. When cross margin account is used, i.e., `account` is `cross_margin`, `auto_borrow` can also be enabled to achieve borrowing the insufficient amount automatically if cross account's balance is not enough. But it differs from margin account that automatic repayment is determined by order's `auto_repay` field and only current order's fill will be used to repay cross margin loans. Automatic repayment will be triggered when the order is finished, i.e., its status is either `cancelled` or `closed`. **Order status** An order waiting to be filled is `open`, and it stays `open` until it is filled totally. If fully filled, order is finished and its status turns to `closed`.If the order is cancelled before it is totally filled, whether or not partially filled, its status is `cancelled`. **Iceberg order** `iceberg` field can be used to set the amount shown. Set to `-1` to hide totally. Note that the hidden part's fee will be charged using taker's fee rate. +You can place orders with spot, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders. When margin account is used, i.e., `account` is `margin`, `auto_borrow` field can be set to `true` to enable the server to borrow the amount lacked using `POST /margin/loans` when your account's balance is not enough. Whether margin orders' fill will be used to repay margin loans automatically is determined by the auto repayment setting in your **margin account**, which can be updated or queried using `/margin/auto_repay` API. When cross margin account is used, i.e., `account` is `cross_margin`, `auto_borrow` can also be enabled to achieve borrowing the insufficient amount automatically if cross account's balance is not enough. But it differs from margin account that automatic repayment is determined by order's `auto_repay` field and only current order's fill will be used to repay cross margin loans. Automatic repayment will be triggered when the order is finished, i.e., its status is either `cancelled` or `closed`. **Order status** An order waiting to be filled is `open`, and it stays `open` until it is filled totally. If fully filled, order is finished and its status turns to `closed`.If the order is cancelled before it is totally filled, whether or not partially filled, its status is `cancelled`. **Iceberg order** `iceberg` field can be used to set the amount shown. Set to `-1` to hide the order completely. Note that the hidden part's fee will be charged using taker's fee rate. ### Example @@ -919,7 +925,7 @@ $apiInstance = new GateApi\Api\SpotApi( $config ); $currency_pair = 'BTC_USDT'; // string | Currency pair -$side = 'sell'; // string | All bids or asks. Both included in not specified +$side = 'sell'; // string | All bids or asks. Both included if not specified $account = 'spot'; // string | Specify account type. Default to all account types being included try { @@ -939,7 +945,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **string**| Currency pair | - **side** | **string**| All bids or asks. Both included in not specified | [optional] + **side** | **string**| All bids or asks. Both included if not specified | [optional] **account** | **string**| Specify account type. Default to all account types being included | [optional] ### Return type @@ -1156,11 +1162,11 @@ Name | Type | Description | Notes ## listMyTrades -> \GateApi\Model\Trade[] listMyTrades($currency_pair, $limit, $page, $order_id, $account) +> \GateApi\Model\Trade[] listMyTrades($currency_pair, $limit, $page, $order_id, $account, $from, $to) List personal trading history -Spot and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` +Spot and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range ### Example @@ -1179,10 +1185,12 @@ $apiInstance = new GateApi\Api\SpotApi( $config ); $associate_array['currency_pair'] = 'BTC_USDT'; // string | Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['page'] = 1; // int | Page number $associate_array['order_id'] = '12345'; // string | Filter trades with specified order ID. `currency_pair` is also required if this field is present $associate_array['account'] = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account +$associate_array['from'] = 56; // int | Time range beginning, default to 7 days before current time +$associate_array['to'] = 56; // int | Time range ending, default to current time try { $result = $apiInstance->listMyTrades($associate_array); @@ -1203,10 +1211,12 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **string**| Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. | - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **page** | **int**| Page number | [optional] [default to 1] **order_id** | **string**| Filter trades with specified order ID. `currency_pair` is also required if this field is present | [optional] **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] + **from** | **int**| Time range beginning, default to 7 days before current time | [optional] + **to** | **int**| Time range ending, default to current time | [optional] ### Return type @@ -1248,10 +1258,10 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client(), $config ); -$associate_array['status'] = 'status_example'; // string | List orders based on status +$associate_array['status'] = 'status_example'; // string | Only list the orders with this status $associate_array['market'] = 'BTC_USDT'; // string | Currency pair $associate_array['account'] = 'account_example'; // string | Trading account -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 try { @@ -1272,10 +1282,10 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | **string**| List orders based on status | + **status** | **string**| Only list the orders with this status | **market** | **string**| Currency pair | [optional] **account** | **string**| Trading account | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] ### Return type @@ -1440,7 +1450,7 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client(), $config ); -$order_id = 'order_id_example'; // string | ID returned on order successfully being created +$order_id = 'order_id_example'; // string | Retrieve the data of the order with the specified ID try { $result = $apiInstance->getSpotPriceTriggeredOrder($order_id); @@ -1458,7 +1468,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **string**| ID returned on order successfully being created | + **order_id** | **string**| Retrieve the data of the order with the specified ID | ### Return type @@ -1500,7 +1510,7 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client(), $config ); -$order_id = 'order_id_example'; // string | ID returned on order successfully being created +$order_id = 'order_id_example'; // string | Retrieve the data of the order with the specified ID try { $result = $apiInstance->cancelSpotPriceTriggeredOrder($order_id); @@ -1518,7 +1528,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **string**| ID returned on order successfully being created | + **order_id** | **string**| Retrieve the data of the order with the specified ID | ### Return type diff --git a/docs/Api/WalletApi.md b/docs/Api/WalletApi.md index cfa2ab8..b0d29e8 100644 --- a/docs/Api/WalletApi.md +++ b/docs/Api/WalletApi.md @@ -8,11 +8,12 @@ Method | HTTP request | Description [**listWithdrawals**](WalletApi.md#listWithdrawals) | **GET** /wallet/withdrawals | Retrieve withdrawal records [**listDeposits**](WalletApi.md#listDeposits) | **GET** /wallet/deposits | Retrieve deposit records [**transfer**](WalletApi.md#transfer) | **POST** /wallet/transfers | Transfer between trading accounts -[**listSubAccountTransfers**](WalletApi.md#listSubAccountTransfers) | **GET** /wallet/sub_account_transfers | Transfer records between main and sub accounts +[**listSubAccountTransfers**](WalletApi.md#listSubAccountTransfers) | **GET** /wallet/sub_account_transfers | Retrieve transfer records between main and sub accounts [**transferWithSubAccount**](WalletApi.md#transferWithSubAccount) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts [**listWithdrawStatus**](WalletApi.md#listWithdrawStatus) | **GET** /wallet/withdraw_status | Retrieve withdrawal status [**listSubAccountBalances**](WalletApi.md#listSubAccountBalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances [**getTradeFee**](WalletApi.md#getTradeFee) | **GET** /wallet/fee | Retrieve personal trading fee +[**getTotalBalance**](WalletApi.md#getTotalBalance) | **GET** /wallet/total_balance | Retrieve user's total balances ## getDepositAddress @@ -102,7 +103,7 @@ $apiInstance = new GateApi\Api\WalletApi( $associate_array['currency'] = 'BTC'; // string | Filter by currency. Return all currency records if not specified $associate_array['from'] = 1602120000; // int | Time range beginning, default to 7 days before current time $associate_array['to'] = 1602123600; // int | Time range ending, default to current time -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 try { @@ -126,7 +127,7 @@ Name | Type | Description | Notes **currency** | **string**| Filter by currency. Return all currency records if not specified | [optional] **from** | **int**| Time range beginning, default to 7 days before current time | [optional] **to** | **int**| Time range ending, default to current time | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] ### Return type @@ -174,7 +175,7 @@ $apiInstance = new GateApi\Api\WalletApi( $associate_array['currency'] = 'BTC'; // string | Filter by currency. Return all currency records if not specified $associate_array['from'] = 1602120000; // int | Time range beginning, default to 7 days before current time $associate_array['to'] = 1602123600; // int | Time range ending, default to current time -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 try { @@ -198,7 +199,7 @@ Name | Type | Description | Notes **currency** | **string**| Filter by currency. Return all currency records if not specified | [optional] **from** | **int**| Time range beginning, default to 7 days before current time | [optional] **to** | **int**| Time range ending, default to current time | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] ### Return type @@ -284,7 +285,7 @@ void (empty response body) > \GateApi\Model\SubAccountTransfer[] listSubAccountTransfers($sub_uid, $from, $to, $limit, $offset) -Transfer records between main and sub accounts +Retrieve transfer records between main and sub accounts Record time range cannot exceed 30 days > Note: only records after 2020-04-10 can be retrieved @@ -307,7 +308,7 @@ $apiInstance = new GateApi\Api\WalletApi( $associate_array['sub_uid'] = '10003'; // string | Sub account user ID. Return records related to all sub accounts if not specified $associate_array['from'] = 1602120000; // int | Time range beginning, default to 7 days before current time $associate_array['to'] = 1602123600; // int | Time range ending, default to current time -$associate_array['limit'] = 100; // int | Maximum number of records returned in one list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 try { @@ -331,7 +332,7 @@ Name | Type | Description | Notes **sub_uid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] **from** | **int**| Time range beginning, default to 7 days before current time | [optional] **to** | **int**| Time range ending, default to current time | [optional] - **limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] ### Return type @@ -435,7 +436,7 @@ $apiInstance = new GateApi\Api\WalletApi( new GuzzleHttp\Client(), $config ); -$associate_array['currency'] = 'BTC'; // string | Retrieved specified currency related data +$associate_array['currency'] = 'BTC'; // string | Retrieve data of the specified currency try { $result = $apiInstance->listWithdrawStatus($associate_array); @@ -455,7 +456,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **string**| Retrieved specified currency related data | [optional] + **currency** | **string**| Retrieve data of the specified currency | [optional] ### Return type @@ -539,7 +540,7 @@ Name | Type | Description | Notes ## getTradeFee -> \GateApi\Model\TradeFee getTradeFee() +> \GateApi\Model\TradeFee getTradeFee($currency_pair) Retrieve personal trading fee @@ -559,9 +560,10 @@ $apiInstance = new GateApi\Api\WalletApi( new GuzzleHttp\Client(), $config ); +$associate_array['currency_pair'] = 'BTC_USDT'; // string | Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs try { - $result = $apiInstance->getTradeFee(); + $result = $apiInstance->getTradeFee($associate_array); print_r($result); } catch (GateApi\GateApiException $e) { echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; @@ -573,7 +575,12 @@ try { ### Parameters -This endpoint does not need any parameter. +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency_pair** | **string**| Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs | [optional] ### Return type @@ -592,3 +599,65 @@ This endpoint does not need any parameter. [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +## getTotalBalance + +> \GateApi\Model\TotalBalance getTotalBalance($currency) + +Retrieve user's total balances + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\WalletApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['currency'] = 'USDT'; // string | Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. + +try { + $result = $apiInstance->getTotalBalance($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling WalletApi->getTotalBalance: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **string**| Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. | [optional] [default to 'USDT'] + +### Return type + +[**\GateApi\Model\TotalBalance**](../Model/TotalBalance.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Model/AccountBalance.md b/docs/Model/AccountBalance.md new file mode 100644 index 0000000..c541549 --- /dev/null +++ b/docs/Model/AccountBalance.md @@ -0,0 +1,10 @@ +# # AccountBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **string** | Account total balance amount | [optional] +**currency** | **string** | Currency | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BatchOrder.md b/docs/Model/BatchOrder.md index fa4e4b3..a16073a 100644 --- a/docs/Model/BatchOrder.md +++ b/docs/Model/BatchOrder.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text** | **string** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional] -**succeeded** | **bool** | Whether order succeeds | [optional] -**label** | **string** | Error label, empty string if order succeeds | [optional] -**message** | **string** | Detailed error message, empty string if order succeeds | [optional] +**succeeded** | **bool** | Whether the batch of orders succeeded | [optional] +**label** | **string** | Error label, if any, otherwise an empty string | [optional] +**message** | **string** | Detailed error message, if any, otherwise an empty string | [optional] **id** | **string** | Order ID | [optional] [readonly] -**create_time** | **string** | Order creation time | [optional] [readonly] -**update_time** | **string** | Order last modification time | [optional] [readonly] -**create_time_ms** | **int** | Order creation time in milliseconds | [optional] [readonly] -**update_time_ms** | **int** | Order last modification time in milliseconds | [optional] [readonly] +**create_time** | **string** | Creation time of order | [optional] [readonly] +**update_time** | **string** | Last modification time of order | [optional] [readonly] +**create_time_ms** | **int** | Creation time of order (in milliseconds) | [optional] [readonly] +**update_time_ms** | **int** | Last modification time of order (in milliseconds) | [optional] [readonly] **status** | **string** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] **currency_pair** | **string** | Currency pair | [optional] **type** | **string** | Order type. limit - limit order | [optional] [default to 'limit'] @@ -21,7 +21,7 @@ Name | Type | Description | Notes **amount** | **string** | Trade amount | [optional] **price** | **string** | Order price | [optional] **time_in_force** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee | [optional] [default to 'gtc'] -**iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the amount totally | [optional] +**iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional] **auto_borrow** | **bool** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional] **auto_repay** | **bool** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. | [optional] **left** | **string** | Amount left to fill | [optional] [readonly] @@ -29,7 +29,7 @@ Name | Type | Description | Notes **filled_total** | **string** | Total filled in quote currency | [optional] [readonly] **fee** | **string** | Fee deducted | [optional] [readonly] **fee_currency** | **string** | Fee currency unit | [optional] [readonly] -**point_fee** | **string** | Point used to deduct fee | [optional] [readonly] +**point_fee** | **string** | Points used to deduct fee | [optional] [readonly] **gt_fee** | **string** | GT used to deduct fee | [optional] [readonly] **gt_discount** | **bool** | Whether GT fee discount is used | [optional] [readonly] **rebated_fee** | **string** | Rebated fee | [optional] [readonly] diff --git a/docs/Model/Contract.md b/docs/Model/Contract.md index 44e9e0e..13350fe 100644 --- a/docs/Model/Contract.md +++ b/docs/Model/Contract.md @@ -31,9 +31,9 @@ Name | Type | Description | Notes **ref_rebate_rate** | **string** | Referrer commission rate | [optional] **orderbook_id** | **int** | Current orderbook ID | [optional] **trade_id** | **int** | Current trade ID | [optional] -**trade_size** | **int** | Historical accumulation trade size | [optional] +**trade_size** | **int** | Historical accumulated trade size | [optional] **position_size** | **int** | Current total long position size | [optional] -**config_change_time** | **double** | Configuration's last changed time | [optional] +**config_change_time** | **double** | Last changed time of configuration | [optional] **in_delisting** | **bool** | Contract is delisting | [optional] **orders_limit** | **int** | Maximum number of open orders | [optional] diff --git a/docs/Model/CrossMarginAccountBook.md b/docs/Model/CrossMarginAccountBook.md index 95701a3..fa7fb67 100644 --- a/docs/Model/CrossMarginAccountBook.md +++ b/docs/Model/CrossMarginAccountBook.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | Balance change record ID | [optional] -**time** | **int** | Account changed timestamp in milliseconds | [optional] +**time** | **int** | The timestamp of the change (in milliseconds) | [optional] **currency** | **string** | Currency changed | [optional] **change** | **string** | Amount changed. Positive value means transferring in, while negative out | [optional] **balance** | **string** | Balance after change | [optional] diff --git a/docs/Model/CrossMarginBalance.md b/docs/Model/CrossMarginBalance.md index 108f2d8..356c542 100644 --- a/docs/Model/CrossMarginBalance.md +++ b/docs/Model/CrossMarginBalance.md @@ -7,6 +7,6 @@ Name | Type | Description | Notes **available** | **string** | Available amount | [optional] **freeze** | **string** | Locked amount | [optional] **borrowed** | **string** | Borrowed amount | [optional] -**interest** | **string** | Interests unpaid | [optional] +**interest** | **string** | Unpaid interests | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CrossMarginBorrowable.md b/docs/Model/CrossMarginBorrowable.md new file mode 100644 index 0000000..ffd77b3 --- /dev/null +++ b/docs/Model/CrossMarginBorrowable.md @@ -0,0 +1,10 @@ +# # CrossMarginBorrowable + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **string** | Currency detail | [optional] +**amount** | **string** | Max borrowable amount | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CrossMarginLoan.md b/docs/Model/CrossMarginLoan.md index 95cc454..3bf6b80 100644 --- a/docs/Model/CrossMarginLoan.md +++ b/docs/Model/CrossMarginLoan.md @@ -13,6 +13,6 @@ Name | Type | Description | Notes **status** | **int** | Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete | [optional] [readonly] **repaid** | **string** | Repaid amount | [optional] [readonly] **repaid_interest** | **string** | Repaid interest | [optional] [readonly] -**unpaid_interest** | **string** | Interest not repaid | [optional] [readonly] +**unpaid_interest** | **string** | Outstanding interest yet to be paid | [optional] [readonly] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeliveryContract.md b/docs/Model/DeliveryContract.md index 95ca7d1..09c38f4 100644 --- a/docs/Model/DeliveryContract.md +++ b/docs/Model/DeliveryContract.md @@ -37,9 +37,9 @@ Name | Type | Description | Notes **ref_rebate_rate** | **string** | Referrer commission rate | [optional] **orderbook_id** | **int** | Current orderbook ID | [optional] **trade_id** | **int** | Current trade ID | [optional] -**trade_size** | **int** | Historical accumulation trade size | [optional] +**trade_size** | **int** | Historical accumulated trade size | [optional] **position_size** | **int** | Current total long position size | [optional] -**config_change_time** | **double** | Configuration's last changed time | [optional] +**config_change_time** | **double** | Last changed time of configuration | [optional] **in_delisting** | **bool** | Contract is delisting | [optional] **orders_limit** | **int** | Maximum number of open orders | [optional] diff --git a/docs/Model/FundingAccount.md b/docs/Model/FundingAccount.md index df934cf..5da8687 100644 --- a/docs/Model/FundingAccount.md +++ b/docs/Model/FundingAccount.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **currency** | **string** | Currency name | [optional] **available** | **string** | Available assets to lend, which is identical to spot account `available` | [optional] **locked** | **string** | Locked amount. i.e. amount in `open` loans | [optional] -**lent** | **string** | Amount that is loaned but not repaid | [optional] +**lent** | **string** | Outstanding loan amount yet to be repaid | [optional] **total_lent** | **string** | Amount used for lending. total_lent = lent + locked | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FundingBookItem.md b/docs/Model/FundingBookItem.md index 0c6a76b..3932191 100644 --- a/docs/Model/FundingBookItem.md +++ b/docs/Model/FundingBookItem.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **rate** | **string** | Loan rate | [optional] **amount** | **string** | Borrowable amount | [optional] -**days** | **int** | How long the loan should be repaid | [optional] +**days** | **int** | The number of days till the loan repayment's dateline | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesInitialOrder.md b/docs/Model/FuturesInitialOrder.md index 237139a..bf2afb5 100644 --- a/docs/Model/FuturesInitialOrder.md +++ b/docs/Model/FuturesInitialOrder.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **close** | **bool** | Set to true if trying to close the position | [optional] [default to false] **tif** | **string** | Time in force. If using market price, only `ioc` is supported. - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled | [optional] [default to 'gtc'] **text** | **string** | How the order is created. Possible values are: web, api and app | [optional] -**reduce_only** | **bool** | Set to true to create an reduce-only order | [optional] [default to false] +**reduce_only** | **bool** | Set to true to create a reduce-only order | [optional] [default to false] **is_reduce_only** | **bool** | Is the order reduce-only | [optional] [readonly] **is_close** | **bool** | Is the order to close position | [optional] [readonly] diff --git a/docs/Model/FuturesOrder.md b/docs/Model/FuturesOrder.md index e9ca358..c33a35b 100644 --- a/docs/Model/FuturesOrder.md +++ b/docs/Model/FuturesOrder.md @@ -6,13 +6,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Futures order ID | [optional] [readonly] **user** | **int** | User ID | [optional] [readonly] -**create_time** | **double** | Order creation time | [optional] [readonly] +**create_time** | **double** | Creation time of order | [optional] [readonly] **finish_time** | **double** | Order finished time. Not returned if order is open | [optional] [readonly] -**finish_as** | **string** | How the order is finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set- position_closed: cancelled because of position close | [optional] [readonly] +**finish_as** | **string** | How the order was finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set- position_closed: cancelled because of position close | [optional] [readonly] **status** | **string** | Order status - `open`: waiting to be traded - `finished`: finished | [optional] [readonly] **contract** | **string** | Futures contract | **size** | **int** | Order size. Specify positive number to make a bid, and negative number to ask | -**iceberg** | **int** | Display size for iceberg order. 0 for non-iceberg. Note that you would pay the taker fee for the hidden size | [optional] +**iceberg** | **int** | Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size | [optional] **price** | **string** | Order price. 0 for market order with `tif` set as `ioc` | [optional] **close** | **bool** | Set as `true` to close the position, with `size` set to 0 | [optional] [default to false] **is_close** | **bool** | Is the order to close position | [optional] [readonly] diff --git a/docs/Model/FuturesOrderBook.md b/docs/Model/FuturesOrderBook.md index ec2addb..62f4cc6 100644 --- a/docs/Model/FuturesOrderBook.md +++ b/docs/Model/FuturesOrderBook.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | Order Book ID. Increase by 1 on every order book change. Set `with_id=true` to include this field in response | [optional] +**id** | **int** | Order Book ID. Increases by 1 on every order book change. Set `with_id=true` to include this field in response | [optional] **current** | **double** | Response data generation timestamp | [optional] **update** | **double** | Order book changed timestamp | [optional] **asks** | [**\GateApi\Model\FuturesOrderBookItem[]**](FuturesOrderBookItem.md) | Asks order depth | diff --git a/docs/Model/FuturesPriceTrigger.md b/docs/Model/FuturesPriceTrigger.md index 4effb7a..04ec6aa 100644 --- a/docs/Model/FuturesPriceTrigger.md +++ b/docs/Model/FuturesPriceTrigger.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**strategy_type** | **int** | How the order will be triggered - `0`: by price, which means order will be triggered on price condition satisfied - `1`: by price gap, which means order will be triggered on gap of recent two prices of specified `price_type` satisfied. Only `0` is supported currently | [optional] +**strategy_type** | **int** | How the order will be triggered - `0`: by price, which means the order will be triggered if price condition is satisfied - `1`: by price gap, which means the order will be triggered if gap of recent two prices of specified `price_type` are satisfied. Only `0` is supported currently | [optional] **price_type** | **int** | Price type. 0 - latest deal price, 1 - mark price, 2 - index price | [optional] **price** | **string** | Value of price on price triggered, or price gap on price gap triggered | [optional] **rule** | **int** | Trigger condition type - `1`: calculated price based on `strategy_type` and `price_type` >= `price` - `2`: calculated price based on `strategy_type` and `price_type` <= `price` | [optional] -**expiration** | **int** | How many seconds will the order wait for the condition being triggered. Order will be cancelled on timed out | [optional] +**expiration** | **int** | How long (in seconds) to wait for the condition to be triggered before cancelling the order. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesPriceTriggeredOrder.md b/docs/Model/FuturesPriceTriggeredOrder.md index 1164784..f274023 100644 --- a/docs/Model/FuturesPriceTriggeredOrder.md +++ b/docs/Model/FuturesPriceTriggeredOrder.md @@ -13,6 +13,6 @@ Name | Type | Description | Notes **trade_id** | **int** | ID of the newly created order on condition triggered | [optional] [readonly] **status** | **string** | Order status. | [optional] [readonly] **finish_as** | **string** | How order is finished | [optional] [readonly] -**reason** | **string** | Extra messages of how order is finished | [optional] [readonly] +**reason** | **string** | Additional remarks on how the order was finished | [optional] [readonly] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesTicker.md b/docs/Model/FuturesTicker.md index a8e83ae..545a732 100644 --- a/docs/Model/FuturesTicker.md +++ b/docs/Model/FuturesTicker.md @@ -20,6 +20,6 @@ Name | Type | Description | Notes **funding_rate** | **string** | Funding rate | [optional] **funding_rate_indicative** | **string** | Indicative Funding rate in next period | [optional] **index_price** | **string** | Index price | [optional] -**quanto_base_rate** | **string** | Exchange rate of base currency and settlement currency in Quanto contract. Not existed in contract of other types | [optional] +**quanto_base_rate** | **string** | Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LedgerRecord.md b/docs/Model/LedgerRecord.md index 4376cbb..7e48f8e 100644 --- a/docs/Model/LedgerRecord.md +++ b/docs/Model/LedgerRecord.md @@ -10,8 +10,8 @@ Name | Type | Description | Notes **amount** | **string** | Currency amount | **currency** | **string** | Currency name | **address** | **string** | Withdrawal address. Required for withdrawals | [optional] -**memo** | **string** | Extra withdrawal memo | [optional] -**status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: waiting for manual approval - BCODE: GateCode operation | [optional] [readonly] +**memo** | **string** | Additional remarks with regards to the withdrawal | [optional] +**status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation | [optional] [readonly] **chain** | **string** | Name of the chain used in withdrawals | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Loan.md b/docs/Model/Loan.md index d902925..5b6386d 100644 --- a/docs/Model/Loan.md +++ b/docs/Model/Loan.md @@ -12,14 +12,15 @@ Name | Type | Description | Notes **currency** | **string** | Loan currency | **rate** | **string** | Loan rate. Only rates in [0.0002, 0.002] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set | [optional] **amount** | **string** | Loan amount | -**days** | **int** | Loan days | -**auto_renew** | **bool** | Auto renew the loan on expiration | [optional] [default to false] -**currency_pair** | **string** | Currency pair. Required for borrowing side | [optional] -**left** | **string** | Amount not lending out | [optional] [readonly] +**days** | **int** | Loan days. Only 10 is supported for now | [optional] +**auto_renew** | **bool** | Whether to auto renew the loan upon expiration | [optional] [default to false] +**currency_pair** | **string** | Currency pair. Required if borrowing | [optional] +**left** | **string** | Amount not lent out yet | [optional] [readonly] **repaid** | **string** | Repaid amount | [optional] [readonly] **paid_interest** | **string** | Repaid interest | [optional] [readonly] -**unpaid_interest** | **string** | Interest not repaid | [optional] [readonly] +**unpaid_interest** | **string** | Outstanding interest yet to be paid | [optional] [readonly] **fee_rate** | **string** | Loan fee rate | [optional] -**orig_id** | **string** | Original loan ID if the loan is auto-renewed. Equal to `id` if not | [optional] +**orig_id** | **string** | Original loan ID of the loan if auto-renewed, otherwise equals to id | [optional] +**text** | **string** | User defined custom ID | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LoanPatch.md b/docs/Model/LoanPatch.md index 402f893..478e798 100644 --- a/docs/Model/LoanPatch.md +++ b/docs/Model/LoanPatch.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **currency** | **string** | Loan currency | **side** | **string** | Loan side. Possible values are `lend` and `borrow`. For `LoanRecord` patching, only `lend` is supported | **auto_renew** | **bool** | Auto renew | -**currency_pair** | **string** | Currency pair. Required for borrowing side | [optional] +**currency_pair** | **string** | Currency pair. Required if borrowing | [optional] **loan_id** | **string** | Loan ID. Required for `LoanRecord` patching | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LoanRecord.md b/docs/Model/LoanRecord.md index b472692..ba9c6b4 100644 --- a/docs/Model/LoanRecord.md +++ b/docs/Model/LoanRecord.md @@ -17,6 +17,6 @@ Name | Type | Description | Notes **auto_renew** | **bool** | Whether the record will auto renew on expiration | [optional] [default to false] **repaid** | **string** | Repaid amount | [optional] **paid_interest** | **string** | Repaid interest | [optional] [readonly] -**unpaid_interest** | **string** | Interest not repaid | [optional] [readonly] +**unpaid_interest** | **string** | Outstanding interest yet to be paid | [optional] [readonly] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MarginAccount.md b/docs/Model/MarginAccount.md index 20aacb3..dfde663 100644 --- a/docs/Model/MarginAccount.md +++ b/docs/Model/MarginAccount.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency_pair** | **string** | Currency pair | [optional] +**locked** | **bool** | Whether account is locked | [optional] +**risk** | **string** | Current risk rate of margin account | [optional] **base** | [**\GateApi\Model\MarginAccountCurrency**](MarginAccountCurrency.md) | | [optional] **quote** | [**\GateApi\Model\MarginAccountCurrency**](MarginAccountCurrency.md) | | [optional] diff --git a/docs/Model/MarginAccountBook.md b/docs/Model/MarginAccountBook.md index dbcde30..e2260d4 100644 --- a/docs/Model/MarginAccountBook.md +++ b/docs/Model/MarginAccountBook.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | Balance change record ID | [optional] **time** | **string** | Balance changed timestamp | [optional] -**time_ms** | **int** | Account changed timestamp in milliseconds | [optional] +**time_ms** | **int** | The timestamp of the change (in milliseconds) | [optional] **currency** | **string** | Currency changed | [optional] **currency_pair** | **string** | Account currency pair | [optional] **change** | **string** | Amount changed. Positive value means transferring in, while negative out | [optional] diff --git a/docs/Model/MarginAccountCurrency.md b/docs/Model/MarginAccountCurrency.md index 02fc7ac..4c836ea 100644 --- a/docs/Model/MarginAccountCurrency.md +++ b/docs/Model/MarginAccountCurrency.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **available** | **string** | Amount suitable for margin trading. | [optional] **locked** | **string** | Locked amount, used in margin trading | [optional] **borrowed** | **string** | Borrowed amount | [optional] -**interest** | **string** | Interests unpaid | [optional] +**interest** | **string** | Unpaid interests | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MarginBorrowable.md b/docs/Model/MarginBorrowable.md new file mode 100644 index 0000000..919dce1 --- /dev/null +++ b/docs/Model/MarginBorrowable.md @@ -0,0 +1,11 @@ +# # MarginBorrowable + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **string** | Currency detail | [optional] +**currency_pair** | **string** | Currency pair | [optional] +**amount** | **string** | Max borrowable amount | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MultiChainAddressItem.md b/docs/Model/MultiChainAddressItem.md index e6641b1..7939428 100644 --- a/docs/Model/MultiChainAddressItem.md +++ b/docs/Model/MultiChainAddressItem.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **address** | **string** | Deposit address | [optional] **payment_id** | **string** | Notes that some currencies required(e.g., Tag, Memo) when depositing | [optional] **payment_name** | **string** | Note type, `Tag` or `Memo` | [optional] -**obtain_failed** | **int** | Whether address is obtained. 0 means success. 1 is failure, which needs retries | [optional] +**obtain_failed** | **int** | The obtain failed status- 0: address successfully obtained- 1: failed to obtain address | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Order.md b/docs/Model/Order.md index f0ae3e3..ed445c1 100644 --- a/docs/Model/Order.md +++ b/docs/Model/Order.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | Order ID | [optional] [readonly] **text** | **string** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional] -**create_time** | **string** | Order creation time | [optional] [readonly] -**update_time** | **string** | Order last modification time | [optional] [readonly] -**create_time_ms** | **int** | Order creation time in milliseconds | [optional] [readonly] -**update_time_ms** | **int** | Order last modification time in milliseconds | [optional] [readonly] +**create_time** | **string** | Creation time of order | [optional] [readonly] +**update_time** | **string** | Last modification time of order | [optional] [readonly] +**create_time_ms** | **int** | Creation time of order (in milliseconds) | [optional] [readonly] +**update_time_ms** | **int** | Last modification time of order (in milliseconds) | [optional] [readonly] **status** | **string** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] **currency_pair** | **string** | Currency pair | **type** | **string** | Order type. limit - limit order | [optional] [default to 'limit'] @@ -18,7 +18,7 @@ Name | Type | Description | Notes **amount** | **string** | Trade amount | **price** | **string** | Order price | **time_in_force** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee | [optional] [default to 'gtc'] -**iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the amount totally | [optional] +**iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional] **auto_borrow** | **bool** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional] **auto_repay** | **bool** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. | [optional] **left** | **string** | Amount left to fill | [optional] [readonly] @@ -26,7 +26,7 @@ Name | Type | Description | Notes **filled_total** | **string** | Total filled in quote currency | [optional] [readonly] **fee** | **string** | Fee deducted | [optional] [readonly] **fee_currency** | **string** | Fee currency unit | [optional] [readonly] -**point_fee** | **string** | Point used to deduct fee | [optional] [readonly] +**point_fee** | **string** | Points used to deduct fee | [optional] [readonly] **gt_fee** | **string** | GT used to deduct fee | [optional] [readonly] **gt_discount** | **bool** | Whether GT fee discount is used | [optional] [readonly] **rebated_fee** | **string** | Rebated fee | [optional] [readonly] diff --git a/docs/Model/OrderBook.md b/docs/Model/OrderBook.md index 385c643..2469529 100644 --- a/docs/Model/OrderBook.md +++ b/docs/Model/OrderBook.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Order book ID, which is updated whenever the order book is changed. Valid only when `with_id` is set to `true` | [optional] -**current** | **int** | Response data generation timestamp in milliseconds | [optional] -**update** | **int** | Order book changed timestamp in milliseconds | [optional] +**current** | **int** | The timestamp of the response data being generated (in milliseconds) | [optional] +**update** | **int** | The timestamp of when the orderbook last changed (in milliseconds) | [optional] **asks** | [**string[][]**](array.md) | Asks order depth | **bids** | [**string[][]**](array.md) | Bids order depth | diff --git a/docs/Model/Position.md b/docs/Model/Position.md index 56038e0..14fc72f 100644 --- a/docs/Model/Position.md +++ b/docs/Model/Position.md @@ -22,7 +22,7 @@ Name | Type | Description | Notes **last_close_pnl** | **string** | PNL of last position close | [optional] [readonly] **realised_point** | **string** | Realized POINT PNL | [optional] [readonly] **history_point** | **string** | History realized POINT PNL | [optional] [readonly] -**adl_ranking** | **int** | ADL ranking, range from 1 to 5 | [optional] [readonly] +**adl_ranking** | **int** | ADL ranking, ranging from 1 to 5 | [optional] [readonly] **pending_orders** | **int** | Current open orders | [optional] [readonly] **close_order** | [**\GateApi\Model\PositionCloseOrder**](PositionCloseOrder.md) | | [optional] **mode** | **string** | Position mode, including: - `single`: dual mode is not enabled- `dual_long`: long position in dual mode- `dual_short`: short position in dual mode | [optional] diff --git a/docs/Model/SpotPriceTrigger.md b/docs/Model/SpotPriceTrigger.md index a6a50ed..2063c5c 100644 --- a/docs/Model/SpotPriceTrigger.md +++ b/docs/Model/SpotPriceTrigger.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **price** | **string** | Trigger price | **rule** | **string** | Price trigger condition - >=: triggered when market price larger than or equal to `price` field - <=: triggered when market price less than or equal to `price` field | -**expiration** | **int** | How many seconds will the order wait for the condition being triggered. Order will be cancelled on timed out | +**expiration** | **int** | How long (in seconds) to wait for the condition to be triggered before cancelling the order. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpotPriceTriggeredOrder.md b/docs/Model/SpotPriceTriggeredOrder.md index a793d67..5db4d2a 100644 --- a/docs/Model/SpotPriceTriggeredOrder.md +++ b/docs/Model/SpotPriceTriggeredOrder.md @@ -13,6 +13,6 @@ Name | Type | Description | Notes **ftime** | **double** | Finished time | [optional] [readonly] **fired_order_id** | **int** | ID of the newly created order on condition triggered | [optional] [readonly] **status** | **string** | Status - open: open - cancelled: being manually cancelled - finish: successfully executed - failed: failed to execute - expired - expired | [optional] [readonly] -**reason** | **string** | Extra messages of how order is finished | [optional] [readonly] +**reason** | **string** | Additional remarks on how the order was finished | [optional] [readonly] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TotalBalance.md b/docs/Model/TotalBalance.md new file mode 100644 index 0000000..319cc6c --- /dev/null +++ b/docs/Model/TotalBalance.md @@ -0,0 +1,10 @@ +# # TotalBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | [**\GateApi\Model\AccountBalance**](AccountBalance.md) | | [optional] +**details** | [**map[string,\GateApi\Model\AccountBalance]**](AccountBalance.md) | Total balances in different accounts - cross_margin: cross margin account - spot: spot account - finance: finance account - margin: margin account - quant: quant account - futures: futures account - delivery: delivery account - warrant: warrant account - cbbc: cbbc account | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Trade.md b/docs/Model/Trade.md index 3547161..5dcc7fe 100644 --- a/docs/Model/Trade.md +++ b/docs/Model/Trade.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **order_id** | **string** | Related order ID. No value in public endpoints | [optional] **fee** | **string** | Fee deducted. No value in public endpoints | [optional] **fee_currency** | **string** | Fee currency unit. No value in public endpoints | [optional] -**point_fee** | **string** | Point used to deduct fee | [optional] +**point_fee** | **string** | Points used to deduct fee | [optional] **gt_fee** | **string** | GT used to deduct fee | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TradeFee.md b/docs/Model/TradeFee.md index b0a2c73..01ab8de 100644 --- a/docs/Model/TradeFee.md +++ b/docs/Model/TradeFee.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **user_id** | **int** | User ID | [optional] **taker_fee** | **string** | taker fee rate | [optional] **maker_fee** | **string** | maker fee rate | [optional] -**gt_discount** | **bool** | Is GT deduction is enabled | [optional] +**gt_discount** | **bool** | If GT deduction is enabled | [optional] **gt_taker_fee** | **string** | Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional] **gt_maker_fee** | **string** | Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional] **loan_fee** | **string** | Loan fee rate of margin lending | [optional] diff --git a/docs/Model/Transfer.md b/docs/Model/Transfer.md index 97c7b47..9b1d4ad 100644 --- a/docs/Model/Transfer.md +++ b/docs/Model/Transfer.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **string** | Transfer currency. For futures account, `currency` can be set to `POINT` or settle currency | -**from** | **string** | Account transferred from | -**to** | **string** | Account transferred to | +**from** | **string** | Account to transfer from | +**to** | **string** | Account to transfer to | **amount** | **string** | Transfer amount | **currency_pair** | **string** | Margin currency pair. Required if transfer from or to margin account | [optional] **settle** | **string** | Futures settle currency. Required if `currency` is `POINT` | [optional] diff --git a/src/Api/DeliveryApi.php b/src/Api/DeliveryApi.php index d0a213f..a367a80 100644 --- a/src/Api/DeliveryApi.php +++ b/src/Api/DeliveryApi.php @@ -618,7 +618,7 @@ protected function getDeliveryContractRequest($settle, $contract) * @param string $contract Futures contract (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) - * @param bool $with_id Whether order book update ID would be returned. This ID increments by 1 on every order book update (optional, default to false) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -641,7 +641,7 @@ public function listDeliveryOrderBook($associative_array) * @param string $contract Futures contract (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) - * @param bool $with_id Whether order book update ID would be returned. This ID increments by 1 on every order book update (optional, default to false) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -701,7 +701,7 @@ public function listDeliveryOrderBookWithHttpInfo($associative_array) * @param string $contract Futures contract (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) - * @param bool $with_id Whether order book update ID would be returned. This ID increments by 1 on every order book update (optional, default to false) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -727,7 +727,7 @@ function ($response) { * @param string $contract Futures contract (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) - * @param bool $with_id Whether order book update ID would be returned. This ID increments by 1 on every order book update (optional, default to false) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -780,7 +780,7 @@ function ($exception) { * @param string $contract Futures contract (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) - * @param bool $with_id Whether order book update ID would be returned. This ID increments by 1 on every order book update (optional, default to false) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -951,8 +951,8 @@ protected function listDeliveryOrderBookRequest($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $last_id Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) * @@ -975,8 +975,8 @@ public function listDeliveryTrades($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $last_id Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) * @@ -1036,8 +1036,8 @@ public function listDeliveryTradesWithHttpInfo($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $last_id Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) * @@ -1063,8 +1063,8 @@ function ($response) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $last_id Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) * @@ -1117,8 +1117,8 @@ function ($exception) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $last_id Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) * @@ -1306,7 +1306,7 @@ protected function listDeliveryTradesRequest($associative_array) * @param string $contract Futures contract (required) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param string $interval Interval time between data points (optional, default to '5m') * * @throws \GateApi\ApiException on non-2xx response @@ -1330,7 +1330,7 @@ public function listDeliveryCandlesticks($associative_array) * @param string $contract Futures contract (required) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param string $interval Interval time between data points (optional, default to '5m') * * @throws \GateApi\ApiException on non-2xx response @@ -1391,7 +1391,7 @@ public function listDeliveryCandlesticksWithHttpInfo($associative_array) * @param string $contract Futures contract (required) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param string $interval Interval time between data points (optional, default to '5m') * * @throws \InvalidArgumentException @@ -1418,7 +1418,7 @@ function ($response) { * @param string $contract Futures contract (required) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param string $interval Interval time between data points (optional, default to '5m') * * @throws \InvalidArgumentException @@ -1472,7 +1472,7 @@ function ($exception) { * @param string $contract Futures contract (required) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param string $interval Interval time between data points (optional, default to '5m') * * @throws \InvalidArgumentException @@ -1921,7 +1921,7 @@ protected function listDeliveryTickersRequest($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1941,7 +1941,7 @@ public function listDeliveryInsuranceLedger($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1998,7 +1998,7 @@ public function listDeliveryInsuranceLedgerWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2021,7 +2021,7 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2071,7 +2071,7 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2436,7 +2436,7 @@ protected function listDeliveryAccountsRequest($settle) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) * @param string $type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) @@ -2459,7 +2459,7 @@ public function listDeliveryAccountBook($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) * @param string $type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) @@ -2519,7 +2519,7 @@ public function listDeliveryAccountBookWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) * @param string $type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) @@ -2545,7 +2545,7 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) * @param string $type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) @@ -2598,7 +2598,7 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) * @param string $type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) @@ -4117,9 +4117,9 @@ protected function updateDeliveryPositionRiskLimitRequest($settle, $contract, $r * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -4142,9 +4142,9 @@ public function listDeliveryOrders($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -4204,9 +4204,9 @@ public function listDeliveryOrdersWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -4232,9 +4232,9 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -4287,9 +4287,9 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -4748,7 +4748,7 @@ protected function createDeliveryOrderRequest($settle, $futures_order) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -4767,7 +4767,7 @@ public function cancelDeliveryOrders($settle, $contract, $side = null) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -4823,7 +4823,7 @@ public function cancelDeliveryOrdersWithHttpInfo($settle, $contract, $side = nul * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -4845,7 +4845,7 @@ function ($response) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -4894,7 +4894,7 @@ function ($exception) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -5027,7 +5027,7 @@ protected function cancelDeliveryOrdersRequest($settle, $contract, $side = null) * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -5045,7 +5045,7 @@ public function getDeliveryOrder($settle, $order_id) * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -5100,7 +5100,7 @@ public function getDeliveryOrderWithHttpInfo($settle, $order_id) * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -5121,7 +5121,7 @@ function ($response) { * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -5169,7 +5169,7 @@ function ($exception) { * Create request for operation 'getDeliveryOrder' * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -5287,7 +5287,7 @@ protected function getDeliveryOrderRequest($settle, $order_id) * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -5305,7 +5305,7 @@ public function cancelDeliveryOrder($settle, $order_id) * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -5360,7 +5360,7 @@ public function cancelDeliveryOrderWithHttpInfo($settle, $order_id) * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -5381,7 +5381,7 @@ function ($response) { * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -5429,7 +5429,7 @@ function ($exception) { * Create request for operation 'cancelDeliveryOrder' * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -5551,7 +5551,7 @@ protected function cancelDeliveryOrderRequest($settle, $order_id) * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -5576,7 +5576,7 @@ public function getMyDeliveryTrades($associative_array) * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -5638,7 +5638,7 @@ public function getMyDeliveryTradesWithHttpInfo($associative_array) * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -5666,7 +5666,7 @@ function ($response) { * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -5721,7 +5721,7 @@ function ($exception) { * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -5922,7 +5922,7 @@ protected function getMyDeliveryTradesRequest($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -5943,7 +5943,7 @@ public function listDeliveryPositionClose($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -6001,7 +6001,7 @@ public function listDeliveryPositionCloseWithHttpInfo($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -6025,7 +6025,7 @@ function ($response) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -6076,7 +6076,7 @@ function ($exception) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -6218,7 +6218,7 @@ protected function listDeliveryPositionCloseRequest($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a liquidation timestamp (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -6240,7 +6240,7 @@ public function listDeliveryLiquidates($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a liquidation timestamp (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -6299,7 +6299,7 @@ public function listDeliveryLiquidatesWithHttpInfo($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a liquidation timestamp (optional, default to 0) * * @throws \InvalidArgumentException @@ -6324,7 +6324,7 @@ function ($response) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a liquidation timestamp (optional, default to 0) * * @throws \InvalidArgumentException @@ -6376,7 +6376,7 @@ function ($exception) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a liquidation timestamp (optional, default to 0) * * @throws \InvalidArgumentException @@ -6532,7 +6532,7 @@ protected function listDeliveryLiquidatesRequest($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a settlement timestamp (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -6554,7 +6554,7 @@ public function listDeliverySettlements($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a settlement timestamp (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -6613,7 +6613,7 @@ public function listDeliverySettlementsWithHttpInfo($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a settlement timestamp (optional, default to 0) * * @throws \InvalidArgumentException @@ -6638,7 +6638,7 @@ function ($response) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a settlement timestamp (optional, default to 0) * * @throws \InvalidArgumentException @@ -6690,7 +6690,7 @@ function ($exception) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a settlement timestamp (optional, default to 0) * * @throws \InvalidArgumentException @@ -6845,9 +6845,9 @@ protected function listDeliverySettlementsRequest($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -6868,9 +6868,9 @@ public function listPriceTriggeredDeliveryOrders($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -6928,9 +6928,9 @@ public function listPriceTriggeredDeliveryOrdersWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -6954,9 +6954,9 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -7007,9 +7007,9 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -7702,7 +7702,7 @@ protected function cancelPriceTriggeredDeliveryOrderListRequest($settle, $contra * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -7720,7 +7720,7 @@ public function getPriceTriggeredDeliveryOrder($settle, $order_id) * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -7775,7 +7775,7 @@ public function getPriceTriggeredDeliveryOrderWithHttpInfo($settle, $order_id) * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -7796,7 +7796,7 @@ function ($response) { * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -7844,7 +7844,7 @@ function ($exception) { * Create request for operation 'getPriceTriggeredDeliveryOrder' * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -7962,7 +7962,7 @@ protected function getPriceTriggeredDeliveryOrderRequest($settle, $order_id) * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -7980,7 +7980,7 @@ public function cancelPriceTriggeredDeliveryOrder($settle, $order_id) * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -8035,7 +8035,7 @@ public function cancelPriceTriggeredDeliveryOrderWithHttpInfo($settle, $order_id * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -8056,7 +8056,7 @@ function ($response) { * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -8104,7 +8104,7 @@ function ($exception) { * Create request for operation 'cancelPriceTriggeredDeliveryOrder' * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/src/Api/FuturesApi.php b/src/Api/FuturesApi.php index d5edf22..f543b90 100644 --- a/src/Api/FuturesApi.php +++ b/src/Api/FuturesApi.php @@ -618,7 +618,7 @@ protected function getFuturesContractRequest($settle, $contract) * @param string $contract Futures contract (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) - * @param bool $with_id Whether order book update ID would be returned. This ID increments by 1 on every order book update (optional, default to false) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -641,7 +641,7 @@ public function listFuturesOrderBook($associative_array) * @param string $contract Futures contract (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) - * @param bool $with_id Whether order book update ID would be returned. This ID increments by 1 on every order book update (optional, default to false) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -701,7 +701,7 @@ public function listFuturesOrderBookWithHttpInfo($associative_array) * @param string $contract Futures contract (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) - * @param bool $with_id Whether order book update ID would be returned. This ID increments by 1 on every order book update (optional, default to false) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -727,7 +727,7 @@ function ($response) { * @param string $contract Futures contract (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) - * @param bool $with_id Whether order book update ID would be returned. This ID increments by 1 on every order book update (optional, default to false) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -780,7 +780,7 @@ function ($exception) { * @param string $contract Futures contract (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) - * @param bool $with_id Whether order book update ID would be returned. This ID increments by 1 on every order book update (optional, default to false) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -951,8 +951,8 @@ protected function listFuturesOrderBookRequest($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $last_id Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) * @@ -975,8 +975,8 @@ public function listFuturesTrades($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $last_id Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) * @@ -1036,8 +1036,8 @@ public function listFuturesTradesWithHttpInfo($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $last_id Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) * @@ -1063,8 +1063,8 @@ function ($response) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $last_id Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) * @@ -1117,8 +1117,8 @@ function ($exception) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $last_id Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) * @@ -1306,7 +1306,7 @@ protected function listFuturesTradesRequest($associative_array) * @param string $contract Futures contract (required) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param string $interval Interval time between data points (optional, default to '5m') * * @throws \GateApi\ApiException on non-2xx response @@ -1330,7 +1330,7 @@ public function listFuturesCandlesticks($associative_array) * @param string $contract Futures contract (required) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param string $interval Interval time between data points (optional, default to '5m') * * @throws \GateApi\ApiException on non-2xx response @@ -1391,7 +1391,7 @@ public function listFuturesCandlesticksWithHttpInfo($associative_array) * @param string $contract Futures contract (required) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param string $interval Interval time between data points (optional, default to '5m') * * @throws \InvalidArgumentException @@ -1418,7 +1418,7 @@ function ($response) { * @param string $contract Futures contract (required) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param string $interval Interval time between data points (optional, default to '5m') * * @throws \InvalidArgumentException @@ -1472,7 +1472,7 @@ function ($exception) { * @param string $contract Futures contract (required) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param string $interval Interval time between data points (optional, default to '5m') * * @throws \InvalidArgumentException @@ -1922,7 +1922,7 @@ protected function listFuturesTickersRequest($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1943,7 +1943,7 @@ public function listFuturesFundingRateHistory($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2001,7 +2001,7 @@ public function listFuturesFundingRateHistoryWithHttpInfo($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2025,7 +2025,7 @@ function ($response) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2076,7 +2076,7 @@ function ($exception) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2220,7 +2220,7 @@ protected function listFuturesFundingRateHistoryRequest($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2240,7 +2240,7 @@ public function listFuturesInsuranceLedger($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2297,7 +2297,7 @@ public function listFuturesInsuranceLedgerWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2320,7 +2320,7 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2370,7 +2370,7 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2833,7 +2833,7 @@ protected function listContractStatsRequest($associative_array) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2856,7 +2856,7 @@ public function listLiquidatedOrders($associative_array) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2916,7 +2916,7 @@ public function listLiquidatedOrdersWithHttpInfo($associative_array) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2942,7 +2942,7 @@ function ($response) { * @param string $contract Futures contract, return related data only if specified (optional) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2995,7 +2995,7 @@ function ($exception) { * @param string $contract Futures contract, return related data only if specified (optional) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -3399,7 +3399,7 @@ protected function listFuturesAccountsRequest($settle) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) * @param string $type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) @@ -3422,7 +3422,7 @@ public function listFuturesAccountBook($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) * @param string $type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) @@ -3482,7 +3482,7 @@ public function listFuturesAccountBookWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) * @param string $type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) @@ -3508,7 +3508,7 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) * @param string $type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) @@ -3561,7 +3561,7 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) * @param string $type Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) @@ -6493,8 +6493,8 @@ protected function updateDualModePositionRiskLimitRequest($settle, $contract, $r * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $status List orders based on status (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param string $status Only list the orders with this status (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -6518,8 +6518,8 @@ public function listFuturesOrders($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $status List orders based on status (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param string $status Only list the orders with this status (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -6580,8 +6580,8 @@ public function listFuturesOrdersWithHttpInfo($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $status List orders based on status (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param string $status Only list the orders with this status (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -6608,8 +6608,8 @@ function ($response) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $status List orders based on status (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param string $status Only list the orders with this status (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -6663,8 +6663,8 @@ function ($exception) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $status List orders based on status (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param string $status Only list the orders with this status (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -7129,7 +7129,7 @@ protected function createFuturesOrderRequest($settle, $futures_order) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -7148,7 +7148,7 @@ public function cancelFuturesOrders($settle, $contract, $side = null) * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -7204,7 +7204,7 @@ public function cancelFuturesOrdersWithHttpInfo($settle, $contract, $side = null * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -7226,7 +7226,7 @@ function ($response) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -7275,7 +7275,7 @@ function ($exception) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -7932,7 +7932,7 @@ protected function cancelFuturesOrderRequest($settle, $order_id) * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -7957,7 +7957,7 @@ public function getMyTrades($associative_array) * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -8019,7 +8019,7 @@ public function getMyTradesWithHttpInfo($associative_array) * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -8047,7 +8047,7 @@ function ($response) { * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -8102,7 +8102,7 @@ function ($exception) { * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) @@ -8303,7 +8303,7 @@ protected function getMyTradesRequest($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -8327,7 +8327,7 @@ public function listPositionClose($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -8388,7 +8388,7 @@ public function listPositionCloseWithHttpInfo($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -8415,7 +8415,7 @@ function ($response) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -8469,7 +8469,7 @@ function ($exception) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -8657,7 +8657,7 @@ protected function listPositionCloseRequest($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a liquidation timestamp (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -8679,7 +8679,7 @@ public function listLiquidates($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a liquidation timestamp (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -8738,7 +8738,7 @@ public function listLiquidatesWithHttpInfo($associative_array) * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a liquidation timestamp (optional, default to 0) * * @throws \InvalidArgumentException @@ -8763,7 +8763,7 @@ function ($response) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a liquidation timestamp (optional, default to 0) * * @throws \InvalidArgumentException @@ -8815,7 +8815,7 @@ function ($exception) { * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $at Specify a liquidation timestamp (optional, default to 0) * * @throws \InvalidArgumentException @@ -8970,9 +8970,9 @@ protected function listLiquidatesRequest($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -8993,9 +8993,9 @@ public function listPriceTriggeredOrders($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -9053,9 +9053,9 @@ public function listPriceTriggeredOrdersWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -9079,9 +9079,9 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -9132,9 +9132,9 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -9827,7 +9827,7 @@ protected function cancelPriceTriggeredOrderListRequest($settle, $contract) * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -9845,7 +9845,7 @@ public function getPriceTriggeredOrder($settle, $order_id) * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -9900,7 +9900,7 @@ public function getPriceTriggeredOrderWithHttpInfo($settle, $order_id) * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -9921,7 +9921,7 @@ function ($response) { * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -9969,7 +9969,7 @@ function ($exception) { * Create request for operation 'getPriceTriggeredOrder' * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -10087,7 +10087,7 @@ protected function getPriceTriggeredOrderRequest($settle, $order_id) * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -10105,7 +10105,7 @@ public function cancelPriceTriggeredOrder($settle, $order_id) * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -10160,7 +10160,7 @@ public function cancelPriceTriggeredOrderWithHttpInfo($settle, $order_id) * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -10181,7 +10181,7 @@ function ($response) { * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -10229,7 +10229,7 @@ function ($exception) { * Create request for operation 'cancelPriceTriggeredOrder' * * @param string $settle Settle currency (required) - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/src/Api/MarginApi.php b/src/Api/MarginApi.php index 7a79aea..e13fdf6 100644 --- a/src/Api/MarginApi.php +++ b/src/Api/MarginApi.php @@ -567,7 +567,7 @@ protected function getMarginCurrencyPairRequest($currency_pair) * * Order book of lending loans * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -584,7 +584,7 @@ public function listFundingBook($currency) * * Order book of lending loans * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -638,7 +638,7 @@ public function listFundingBookWithHttpInfo($currency) * * Order book of lending loans * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -658,7 +658,7 @@ function ($response) { * * Order book of lending loans * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -705,7 +705,7 @@ function ($exception) { /** * Create request for operation 'listFundingBook' * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1064,7 +1064,7 @@ protected function listMarginAccountsRequest($associative_array) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1088,7 +1088,7 @@ public function listMarginAccountBook($associative_array) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1149,7 +1149,7 @@ public function listMarginAccountBookWithHttpInfo($associative_array) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1176,7 +1176,7 @@ function ($response) { * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1230,7 +1230,7 @@ function ($exception) { * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1410,7 +1410,7 @@ protected function listMarginAccountBookRequest($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1429,7 +1429,7 @@ public function listFundingAccounts($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1485,7 +1485,7 @@ public function listFundingAccountsWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1507,7 +1507,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1556,7 +1556,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1662,12 +1662,12 @@ protected function listFundingAccountsRequest($associative_array) * * @param string $status Loan status (required) * @param string $side Lend or borrow (required) - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * @param string $currency_pair Currency pair (optional) * @param string $sort_by Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` (optional) * @param bool $reverse_sort Whether to sort in descending order. Default to `true` (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1688,12 +1688,12 @@ public function listLoans($associative_array) * * @param string $status Loan status (required) * @param string $side Lend or borrow (required) - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * @param string $currency_pair Currency pair (optional) * @param string $sort_by Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` (optional) * @param bool $reverse_sort Whether to sort in descending order. Default to `true` (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1751,12 +1751,12 @@ public function listLoansWithHttpInfo($associative_array) * * @param string $status Loan status (required) * @param string $side Lend or borrow (required) - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * @param string $currency_pair Currency pair (optional) * @param string $sort_by Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` (optional) * @param bool $reverse_sort Whether to sort in descending order. Default to `true` (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1780,12 +1780,12 @@ function ($response) { * * @param string $status Loan status (required) * @param string $side Lend or borrow (required) - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * @param string $currency_pair Currency pair (optional) * @param string $sort_by Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` (optional) * @param bool $reverse_sort Whether to sort in descending order. Default to `true` (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1836,12 +1836,12 @@ function ($exception) { * * @param string $status Loan status (required) * @param string $side Lend or borrow (required) - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * @param string $currency_pair Currency pair (optional) * @param string $sort_by Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` (optional) * @param bool $reverse_sort Whether to sort in descending order. Default to `true` (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2291,8 +2291,8 @@ protected function createLoanRequest($loan) * * Merge multiple lending loans * - * @param string $currency Retrieved specified currency related data (required) - * @param string $ids Lending loan ID list separated by `,`. Maximum of 20 IDs are allowed in one request (required) + * @param string $currency Retrieve data of the specified currency (required) + * @param string $ids A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2309,8 +2309,8 @@ public function mergeLoans($currency, $ids) * * Merge multiple lending loans * - * @param string $currency Retrieved specified currency related data (required) - * @param string $ids Lending loan ID list separated by `,`. Maximum of 20 IDs are allowed in one request (required) + * @param string $currency Retrieve data of the specified currency (required) + * @param string $ids A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2364,8 +2364,8 @@ public function mergeLoansWithHttpInfo($currency, $ids) * * Merge multiple lending loans * - * @param string $currency Retrieved specified currency related data (required) - * @param string $ids Lending loan ID list separated by `,`. Maximum of 20 IDs are allowed in one request (required) + * @param string $currency Retrieve data of the specified currency (required) + * @param string $ids A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2385,8 +2385,8 @@ function ($response) { * * Merge multiple lending loans * - * @param string $currency Retrieved specified currency related data (required) - * @param string $ids Lending loan ID list separated by `,`. Maximum of 20 IDs are allowed in one request (required) + * @param string $currency Retrieve data of the specified currency (required) + * @param string $ids A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2433,8 +2433,8 @@ function ($exception) { /** * Create request for operation 'mergeLoans' * - * @param string $currency Retrieved specified currency related data (required) - * @param string $ids Lending loan ID list separated by `,`. Maximum of 20 IDs are allowed in one request (required) + * @param string $currency Retrieve data of the specified currency (required) + * @param string $ids A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2821,7 +2821,7 @@ protected function getLoanRequest($loan_id, $side) * Cancel lending loan * * @param string $loan_id Loan ID (required) - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2839,7 +2839,7 @@ public function cancelLoan($loan_id, $currency) * Cancel lending loan * * @param string $loan_id Loan ID (required) - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2894,7 +2894,7 @@ public function cancelLoanWithHttpInfo($loan_id, $currency) * Cancel lending loan * * @param string $loan_id Loan ID (required) - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2915,7 +2915,7 @@ function ($response) { * Cancel lending loan * * @param string $loan_id Loan ID (required) - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2963,7 +2963,7 @@ function ($exception) { * Create request for operation 'cancelLoan' * * @param string $loan_id Loan ID (required) - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -3829,14 +3829,14 @@ protected function repayLoanRequest($loan_id, $repay_request) /** * Operation listLoanRecords * - * List repayment records of specified loan + * List repayment records of a specific loan * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $loan_id Loan ID (required) * @param string $status Loan record status (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3851,14 +3851,14 @@ public function listLoanRecords($associative_array) /** * Operation listLoanRecordsWithHttpInfo * - * List repayment records of specified loan + * List repayment records of a specific loan * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $loan_id Loan ID (required) * @param string $status Loan record status (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3910,14 +3910,14 @@ public function listLoanRecordsWithHttpInfo($associative_array) /** * Operation listLoanRecordsAsync * - * List repayment records of specified loan + * List repayment records of a specific loan * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $loan_id Loan ID (required) * @param string $status Loan record status (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3935,14 +3935,14 @@ function ($response) { /** * Operation listLoanRecordsAsyncWithHttpInfo * - * List repayment records of specified loan + * List repayment records of a specific loan * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $loan_id Loan ID (required) * @param string $status Loan record status (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3994,7 +3994,7 @@ function ($exception) { * @param string $loan_id Loan ID (required) * @param string $status Loan record status (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -5125,11 +5125,11 @@ protected function setAutoRepayRequest($status) /** * Operation getMarginTransferable * - * Max transferable amount for specified margin currency + * Get the max transferable amount for a specific margin currency * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * @param string $currency_pair Currency pair (optional) * * @throws \GateApi\ApiException on non-2xx response @@ -5145,11 +5145,11 @@ public function getMarginTransferable($associative_array) /** * Operation getMarginTransferableWithHttpInfo * - * Max transferable amount for specified margin currency + * Get the max transferable amount for a specific margin currency * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * @param string $currency_pair Currency pair (optional) * * @throws \GateApi\ApiException on non-2xx response @@ -5202,11 +5202,11 @@ public function getMarginTransferableWithHttpInfo($associative_array) /** * Operation getMarginTransferableAsync * - * Max transferable amount for specified margin currency + * Get the max transferable amount for a specific margin currency * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * @param string $currency_pair Currency pair (optional) * * @throws \InvalidArgumentException @@ -5225,11 +5225,11 @@ function ($response) { /** * Operation getMarginTransferableAsyncWithHttpInfo * - * Max transferable amount for specified margin currency + * Get the max transferable amount for a specific margin currency * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * @param string $currency_pair Currency pair (optional) * * @throws \InvalidArgumentException @@ -5279,7 +5279,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * @param string $currency_pair Currency pair (optional) * * @throws \InvalidArgumentException @@ -5396,6 +5396,280 @@ protected function getMarginTransferableRequest($associative_array) ); } + /** + * Operation getMarginBorrowable + * + * Get the max borrowable amount for a specific margin currency + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Retrieve data of the specified currency (required) + * @param string $currency_pair Currency pair (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\MarginBorrowable + */ + public function getMarginBorrowable($associative_array) + { + list($response) = $this->getMarginBorrowableWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation getMarginBorrowableWithHttpInfo + * + * Get the max borrowable amount for a specific margin currency + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Retrieve data of the specified currency (required) + * @param string $currency_pair Currency pair (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\MarginBorrowable, HTTP status code, HTTP response headers (array of strings) + */ + public function getMarginBorrowableWithHttpInfo($associative_array) + { + $request = $this->getMarginBorrowableRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\MarginBorrowable'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getMarginBorrowableAsync + * + * Get the max borrowable amount for a specific margin currency + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Retrieve data of the specified currency (required) + * @param string $currency_pair Currency pair (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMarginBorrowableAsync($associative_array) + { + return $this->getMarginBorrowableAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMarginBorrowableAsyncWithHttpInfo + * + * Get the max borrowable amount for a specific margin currency + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Retrieve data of the specified currency (required) + * @param string $currency_pair Currency pair (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMarginBorrowableAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\MarginBorrowable'; + $request = $this->getMarginBorrowableRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMarginBorrowable' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Retrieve data of the specified currency (required) + * @param string $currency_pair Currency pair (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getMarginBorrowableRequest($associative_array) + { + // unbox the parameters from the associative array + $currency = array_key_exists('currency', $associative_array) ? $associative_array['currency'] : null; + $currency_pair = array_key_exists('currency_pair', $associative_array) ? $associative_array['currency_pair'] : null; + + // verify the required parameter 'currency' is set + if ($currency === null || (is_array($currency) && count($currency) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $currency when calling getMarginBorrowable' + ); + } + + $resourcePath = '/margin/borrowable'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($currency !== null) { + if('form' === 'form' && is_array($currency)) { + foreach($currency as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency'] = $currency; + } + } + + // query params + if ($currency_pair !== null) { + if('form' === 'form' && is_array($currency_pair)) { + foreach($currency_pair as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency_pair'] = $currency_pair; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listCrossMarginCurrencies * @@ -6071,8 +6345,8 @@ protected function getCrossMarginAccountRequest() * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $type Filter by account change type. All types are returned if not specified. (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $type Only retrieve changes of the specified type. All types will be returned if not specified. (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -6095,8 +6369,8 @@ public function listCrossMarginAccountBook($associative_array) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $type Filter by account change type. All types are returned if not specified. (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $type Only retrieve changes of the specified type. All types will be returned if not specified. (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -6156,8 +6430,8 @@ public function listCrossMarginAccountBookWithHttpInfo($associative_array) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $type Filter by account change type. All types are returned if not specified. (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $type Only retrieve changes of the specified type. All types will be returned if not specified. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -6183,8 +6457,8 @@ function ($response) { * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $type Filter by account change type. All types are returned if not specified. (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $type Only retrieve changes of the specified type. All types will be returned if not specified. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -6237,8 +6511,8 @@ function ($exception) { * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) - * @param string $type Filter by account change type. All types are returned if not specified. (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param string $type Only retrieve changes of the specified type. All types will be returned if not specified. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -6420,7 +6694,7 @@ protected function listCrossMarginAccountBookRequest($associative_array) * * @param int $status Filter by status. Supported values are 2 and 3. (required) * @param string $currency Filter by currency (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param bool $reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) * @@ -6443,7 +6717,7 @@ public function listCrossMarginLoans($associative_array) * * @param int $status Filter by status. Supported values are 2 and 3. (required) * @param string $currency Filter by currency (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param bool $reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) * @@ -6503,7 +6777,7 @@ public function listCrossMarginLoansWithHttpInfo($associative_array) * * @param int $status Filter by status. Supported values are 2 and 3. (required) * @param string $currency Filter by currency (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param bool $reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) * @@ -6529,7 +6803,7 @@ function ($response) { * * @param int $status Filter by status. Supported values are 2 and 3. (required) * @param string $currency Filter by currency (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param bool $reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) * @@ -6582,7 +6856,7 @@ function ($exception) { * * @param int $status Filter by status. Supported values are 2 and 3. (required) * @param string $currency Filter by currency (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param bool $reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) * @@ -7233,7 +7507,7 @@ protected function getCrossMarginLoanRequest($loan_id) * * @param string $currency currency (optional) * @param string $loan_id loan_id (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param bool $reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) * @@ -7256,7 +7530,7 @@ public function listCrossMarginRepayments($associative_array) * * @param string $currency (optional) * @param string $loan_id (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param bool $reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) * @@ -7316,7 +7590,7 @@ public function listCrossMarginRepaymentsWithHttpInfo($associative_array) * * @param string $currency (optional) * @param string $loan_id (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param bool $reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) * @@ -7342,7 +7616,7 @@ function ($response) { * * @param string $currency (optional) * @param string $loan_id (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param bool $reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) * @@ -7395,7 +7669,7 @@ function ($exception) { * * @param string $currency (optional) * @param string $loan_id (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param bool $reverse Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional, default to true) * @@ -7794,9 +8068,9 @@ protected function repayCrossMarginLoanRequest($cross_margin_repay_request) /** * Operation getCrossMarginTransferable * - * Max transferable amount for specified cross margin currency + * Get the max transferable amount for a specific cross margin currency * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -7811,9 +8085,9 @@ public function getCrossMarginTransferable($currency) /** * Operation getCrossMarginTransferableWithHttpInfo * - * Max transferable amount for specified cross margin currency + * Get the max transferable amount for a specific cross margin currency * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -7865,9 +8139,9 @@ public function getCrossMarginTransferableWithHttpInfo($currency) /** * Operation getCrossMarginTransferableAsync * - * Max transferable amount for specified cross margin currency + * Get the max transferable amount for a specific cross margin currency * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -7885,9 +8159,9 @@ function ($response) { /** * Operation getCrossMarginTransferableAsyncWithHttpInfo * - * Max transferable amount for specified cross margin currency + * Get the max transferable amount for a specific cross margin currency * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -7934,7 +8208,7 @@ function ($exception) { /** * Create request for operation 'getCrossMarginTransferable' * - * @param string $currency Retrieved specified currency related data (required) + * @param string $currency Retrieve data of the specified currency (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -8034,6 +8308,249 @@ protected function getCrossMarginTransferableRequest($currency) ); } + /** + * Operation getCrossMarginBorrowable + * + * Get the max borrowable amount for a specific cross margin currency + * + * @param string $currency Retrieve data of the specified currency (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\CrossMarginBorrowable + */ + public function getCrossMarginBorrowable($currency) + { + list($response) = $this->getCrossMarginBorrowableWithHttpInfo($currency); + return $response; + } + + /** + * Operation getCrossMarginBorrowableWithHttpInfo + * + * Get the max borrowable amount for a specific cross margin currency + * + * @param string $currency Retrieve data of the specified currency (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\CrossMarginBorrowable, HTTP status code, HTTP response headers (array of strings) + */ + public function getCrossMarginBorrowableWithHttpInfo($currency) + { + $request = $this->getCrossMarginBorrowableRequest($currency); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\CrossMarginBorrowable'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getCrossMarginBorrowableAsync + * + * Get the max borrowable amount for a specific cross margin currency + * + * @param string $currency Retrieve data of the specified currency (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCrossMarginBorrowableAsync($currency) + { + return $this->getCrossMarginBorrowableAsyncWithHttpInfo($currency) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCrossMarginBorrowableAsyncWithHttpInfo + * + * Get the max borrowable amount for a specific cross margin currency + * + * @param string $currency Retrieve data of the specified currency (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCrossMarginBorrowableAsyncWithHttpInfo($currency) + { + $returnType = '\GateApi\Model\CrossMarginBorrowable'; + $request = $this->getCrossMarginBorrowableRequest($currency); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCrossMarginBorrowable' + * + * @param string $currency Retrieve data of the specified currency (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getCrossMarginBorrowableRequest($currency) + { + // verify the required parameter 'currency' is set + if ($currency === null || (is_array($currency) && count($currency) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $currency when calling getCrossMarginBorrowable' + ); + } + + $resourcePath = '/margin/cross/borrowable'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($currency !== null) { + if('form' === 'form' && is_array($currency)) { + foreach($currency as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency'] = $currency; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create http client option * diff --git a/src/Api/SpotApi.php b/src/Api/SpotApi.php index d65273d..e92edca 100644 --- a/src/Api/SpotApi.php +++ b/src/Api/SpotApi.php @@ -116,7 +116,7 @@ public function getConfig() /** * Operation listCurrencies * - * List all currencies' detail + * List all currencies' details * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -131,7 +131,7 @@ public function listCurrencies() /** * Operation listCurrenciesWithHttpInfo * - * List all currencies' detail + * List all currencies' details * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -183,7 +183,7 @@ public function listCurrenciesWithHttpInfo() /** * Operation listCurrenciesAsync * - * List all currencies' detail + * List all currencies' details * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -201,7 +201,7 @@ function ($response) { /** * Operation listCurrenciesAsyncWithHttpInfo * - * List all currencies' detail + * List all currencies' details * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -328,7 +328,7 @@ protected function listCurrenciesRequest() /** * Operation getCurrency * - * Get detail of one particular currency + * Get details of a specific currency * * @param string $currency Currency name (required) * @@ -345,7 +345,7 @@ public function getCurrency($currency) /** * Operation getCurrencyWithHttpInfo * - * Get detail of one particular currency + * Get details of a specific currency * * @param string $currency Currency name (required) * @@ -399,7 +399,7 @@ public function getCurrencyWithHttpInfo($currency) /** * Operation getCurrencyAsync * - * Get detail of one particular currency + * Get details of a specific currency * * @param string $currency Currency name (required) * @@ -419,7 +419,7 @@ function ($response) { /** * Operation getCurrencyAsyncWithHttpInfo * - * Get detail of one particular currency + * Get details of a specific currency * * @param string $currency Currency name (required) * @@ -777,7 +777,7 @@ protected function listCurrencyPairsRequest() /** * Operation getCurrencyPair * - * Get detail of one single order + * Get details of a specifc order * * @param string $currency_pair Currency pair (required) * @@ -794,7 +794,7 @@ public function getCurrencyPair($currency_pair) /** * Operation getCurrencyPairWithHttpInfo * - * Get detail of one single order + * Get details of a specifc order * * @param string $currency_pair Currency pair (required) * @@ -848,7 +848,7 @@ public function getCurrencyPairWithHttpInfo($currency_pair) /** * Operation getCurrencyPairAsync * - * Get detail of one single order + * Get details of a specifc order * * @param string $currency_pair Currency pair (required) * @@ -868,7 +868,7 @@ function ($response) { /** * Operation getCurrencyPairAsyncWithHttpInfo * - * Get detail of one single order + * Get details of a specifc order * * @param string $currency_pair Currency pair (required) * @@ -1445,9 +1445,6 @@ protected function listOrderBookRequest($associative_array) 'Missing the required parameter $currency_pair when calling listOrderBook' ); } - if ($limit !== null && $limit > 100) { - throw new \InvalidArgumentException('invalid value for "$limit" when calling SpotApi.listOrderBook, must be smaller than or equal to 100.'); - } if ($limit !== null && $limit < 1) { throw new \InvalidArgumentException('invalid value for "$limit" when calling SpotApi.listOrderBook, must be bigger than or equal to 1.'); } @@ -1580,9 +1577,9 @@ protected function listOrderBookRequest($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param bool $reverse Whether to retrieve records whose IDs are smaller than `last_id`'s. Default to larger ones. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1602,9 +1599,9 @@ public function listTrades($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param bool $reverse Whether to retrieve records whose IDs are smaller than `last_id`'s. Default to larger ones. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1661,9 +1658,9 @@ public function listTradesWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param bool $reverse Whether to retrieve records whose IDs are smaller than `last_id`'s. Default to larger ones. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1686,9 +1683,9 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param bool $reverse Whether to retrieve records whose IDs are smaller than `last_id`'s. Default to larger ones. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1738,9 +1735,9 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param bool $reverse Whether to retrieve records whose IDs are smaller than `last_id`'s. Default to larger ones. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1894,7 +1891,7 @@ protected function listTradesRequest($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param string $interval Interval time between data points (optional, default to '30m') @@ -1917,7 +1914,7 @@ public function listCandlesticks($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param string $interval Interval time between data points (optional, default to '30m') @@ -1977,7 +1974,7 @@ public function listCandlesticksWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param string $interval Interval time between data points (optional, default to '30m') @@ -2003,7 +2000,7 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param string $interval Interval time between data points (optional, default to '30m') @@ -2056,7 +2053,7 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param string $interval Interval time between data points (optional, default to '30m') @@ -2472,7 +2469,7 @@ protected function getFeeRequest($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2491,7 +2488,7 @@ public function listSpotAccounts($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2547,7 +2544,7 @@ public function listSpotAccountsWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2569,7 +2566,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2618,7 +2615,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -3256,8 +3253,11 @@ protected function listAllOpenOrdersRequest($associative_array) * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) + * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3279,8 +3279,11 @@ public function listOrders($associative_array) * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) + * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3339,8 +3342,11 @@ public function listOrdersWithHttpInfo($associative_array) * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) + * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3365,8 +3371,11 @@ function ($response) { * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) + * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3418,8 +3427,11 @@ function ($exception) { * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) - * @param int $limit Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) + * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -3432,6 +3444,9 @@ protected function listOrdersRequest($associative_array) $page = array_key_exists('page', $associative_array) ? $associative_array['page'] : 1; $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; $account = array_key_exists('account', $associative_array) ? $associative_array['account'] : null; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + $side = array_key_exists('side', $associative_array) ? $associative_array['side'] : null; // verify the required parameter 'currency_pair' is set if ($currency_pair === null || (is_array($currency_pair) && count($currency_pair) === 0)) { @@ -3524,6 +3539,42 @@ protected function listOrdersRequest($associative_array) } } + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // query params + if ($side !== null) { + if('form' === 'form' && is_array($side)) { + foreach($side as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['side'] = $side; + } + } + // body params $_tempBody = null; @@ -3831,7 +3882,7 @@ protected function createOrderRequest($order) * Cancel all `open` orders in specified currency pair * * @param string $currency_pair Currency pair (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * @param string $account Specify account type. Default to all account types being included (optional) * * @throws \GateApi\ApiException on non-2xx response @@ -3850,7 +3901,7 @@ public function cancelOrders($currency_pair, $side = null, $account = null) * Cancel all `open` orders in specified currency pair * * @param string $currency_pair Currency pair (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * @param string $account Specify account type. Default to all account types being included (optional) * * @throws \GateApi\ApiException on non-2xx response @@ -3906,7 +3957,7 @@ public function cancelOrdersWithHttpInfo($currency_pair, $side = null, $account * Cancel all `open` orders in specified currency pair * * @param string $currency_pair Currency pair (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * @param string $account Specify account type. Default to all account types being included (optional) * * @throws \InvalidArgumentException @@ -3928,7 +3979,7 @@ function ($response) { * Cancel all `open` orders in specified currency pair * * @param string $currency_pair Currency pair (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * @param string $account Specify account type. Default to all account types being included (optional) * * @throws \InvalidArgumentException @@ -3977,7 +4028,7 @@ function ($exception) { * Create request for operation 'cancelOrders' * * @param string $currency_pair Currency pair (required) - * @param string $side All bids or asks. Both included in not specified (optional) + * @param string $side All bids or asks. Both included if not specified (optional) * @param string $account Specify account type. Default to all account types being included (optional) * * @throws \InvalidArgumentException @@ -4904,10 +4955,12 @@ protected function cancelOrderRequest($order_id, $currency_pair, $account = null * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -4927,10 +4980,12 @@ public function listMyTrades($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -4987,10 +5042,12 @@ public function listMyTradesWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -5013,10 +5070,12 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -5066,10 +5125,12 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -5082,6 +5143,8 @@ protected function listMyTradesRequest($associative_array) $page = array_key_exists('page', $associative_array) ? $associative_array['page'] : 1; $order_id = array_key_exists('order_id', $associative_array) ? $associative_array['order_id'] : null; $account = array_key_exists('account', $associative_array) ? $associative_array['account'] : null; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; // verify the required parameter 'currency_pair' is set if ($currency_pair === null || (is_array($currency_pair) && count($currency_pair) === 0)) { @@ -5168,6 +5231,30 @@ protected function listMyTradesRequest($associative_array) } } + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + // body params $_tempBody = null; @@ -5242,10 +5329,10 @@ protected function listMyTradesRequest($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $market Currency pair (optional) * @param string $account Trading account (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -5265,10 +5352,10 @@ public function listSpotPriceTriggeredOrders($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $market Currency pair (optional) * @param string $account Trading account (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -5325,10 +5412,10 @@ public function listSpotPriceTriggeredOrdersWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $market Currency pair (optional) * @param string $account Trading account (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -5351,10 +5438,10 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $market Currency pair (optional) * @param string $account Trading account (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -5404,10 +5491,10 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $status List orders based on status (required) + * @param string $status Only list the orders with this status (required) * @param string $market Currency pair (optional) * @param string $account Trading account (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -6067,7 +6154,7 @@ protected function cancelSpotPriceTriggeredOrderListRequest($market = null, $acc * * Get a single order * - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -6084,7 +6171,7 @@ public function getSpotPriceTriggeredOrder($order_id) * * Get a single order * - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -6138,7 +6225,7 @@ public function getSpotPriceTriggeredOrderWithHttpInfo($order_id) * * Get a single order * - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -6158,7 +6245,7 @@ function ($response) { * * Get a single order * - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -6205,7 +6292,7 @@ function ($exception) { /** * Create request for operation 'getSpotPriceTriggeredOrder' * - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -6307,7 +6394,7 @@ protected function getSpotPriceTriggeredOrderRequest($order_id) * * Cancel a single order * - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -6324,7 +6411,7 @@ public function cancelSpotPriceTriggeredOrder($order_id) * * Cancel a single order * - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -6378,7 +6465,7 @@ public function cancelSpotPriceTriggeredOrderWithHttpInfo($order_id) * * Cancel a single order * - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -6398,7 +6485,7 @@ function ($response) { * * Cancel a single order * - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -6445,7 +6532,7 @@ function ($exception) { /** * Create request for operation 'cancelSpotPriceTriggeredOrder' * - * @param string $order_id ID returned on order successfully being created (required) + * @param string $order_id Retrieve the data of the order with the specified ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/src/Api/WalletApi.php b/src/Api/WalletApi.php index 2cb046e..5ce2a48 100644 --- a/src/Api/WalletApi.php +++ b/src/Api/WalletApi.php @@ -366,7 +366,7 @@ protected function getDepositAddressRequest($currency) * @param string $currency Filter by currency. Return all currency records if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -389,7 +389,7 @@ public function listWithdrawals($associative_array) * @param string $currency Filter by currency. Return all currency records if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -449,7 +449,7 @@ public function listWithdrawalsWithHttpInfo($associative_array) * @param string $currency Filter by currency. Return all currency records if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -475,7 +475,7 @@ function ($response) { * @param string $currency Filter by currency. Return all currency records if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -528,7 +528,7 @@ function ($exception) { * @param string $currency Filter by currency. Return all currency records if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -699,7 +699,7 @@ protected function listWithdrawalsRequest($associative_array) * @param string $currency Filter by currency. Return all currency records if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -722,7 +722,7 @@ public function listDeposits($associative_array) * @param string $currency Filter by currency. Return all currency records if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -782,7 +782,7 @@ public function listDepositsWithHttpInfo($associative_array) * @param string $currency Filter by currency. Return all currency records if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -808,7 +808,7 @@ function ($response) { * @param string $currency Filter by currency. Return all currency records if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -861,7 +861,7 @@ function ($exception) { * @param string $currency Filter by currency. Return all currency records if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -1235,14 +1235,14 @@ protected function transferRequest($transfer) /** * Operation listSubAccountTransfers * - * Transfer records between main and sub accounts + * Retrieve transfer records between main and sub accounts * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -1258,14 +1258,14 @@ public function listSubAccountTransfers($associative_array) /** * Operation listSubAccountTransfersWithHttpInfo * - * Transfer records between main and sub accounts + * Retrieve transfer records between main and sub accounts * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response @@ -1318,14 +1318,14 @@ public function listSubAccountTransfersWithHttpInfo($associative_array) /** * Operation listSubAccountTransfersAsync * - * Transfer records between main and sub accounts + * Retrieve transfer records between main and sub accounts * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -1344,14 +1344,14 @@ function ($response) { /** * Operation listSubAccountTransfersAsyncWithHttpInfo * - * Transfer records between main and sub accounts + * Retrieve transfer records between main and sub accounts * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -1404,7 +1404,7 @@ function ($exception) { * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) - * @param int $limit Maximum number of records returned in one list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException @@ -1782,7 +1782,7 @@ protected function transferWithSubAccountRequest($sub_account_transfer) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1801,7 +1801,7 @@ public function listWithdrawStatus($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1857,7 +1857,7 @@ public function listWithdrawStatusWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1879,7 +1879,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1928,7 +1928,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency Retrieved specified currency related data (optional) + * @param string $currency Retrieve data of the specified currency (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2280,13 +2280,17 @@ protected function listSubAccountBalancesRequest($associative_array) * * Retrieve personal trading fee * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency_pair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) + * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \GateApi\Model\TradeFee */ - public function getTradeFee() + public function getTradeFee($associative_array) { - list($response) = $this->getTradeFeeWithHttpInfo(); + list($response) = $this->getTradeFeeWithHttpInfo($associative_array); return $response; } @@ -2295,13 +2299,17 @@ public function getTradeFee() * * Retrieve personal trading fee * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency_pair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) + * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \GateApi\Model\TradeFee, HTTP status code, HTTP response headers (array of strings) */ - public function getTradeFeeWithHttpInfo() + public function getTradeFeeWithHttpInfo($associative_array) { - $request = $this->getTradeFeeRequest(); + $request = $this->getTradeFeeRequest($associative_array); $options = $this->createHttpClientOption(); try { @@ -2347,12 +2355,16 @@ public function getTradeFeeWithHttpInfo() * * Retrieve personal trading fee * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency_pair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTradeFeeAsync() + public function getTradeFeeAsync($associative_array) { - return $this->getTradeFeeAsyncWithHttpInfo() + return $this->getTradeFeeAsyncWithHttpInfo($associative_array) ->then( function ($response) { return $response[0]; @@ -2365,13 +2377,17 @@ function ($response) { * * Retrieve personal trading fee * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency_pair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTradeFeeAsyncWithHttpInfo() + public function getTradeFeeAsyncWithHttpInfo($associative_array) { $returnType = '\GateApi\Model\TradeFee'; - $request = $this->getTradeFeeRequest(); + $request = $this->getTradeFeeRequest($associative_array); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2410,11 +2426,18 @@ function ($exception) { /** * Create request for operation 'getTradeFee' * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency_pair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getTradeFeeRequest() + protected function getTradeFeeRequest($associative_array) { + // unbox the parameters from the associative array + $currency_pair = array_key_exists('currency_pair', $associative_array) ? $associative_array['currency_pair'] : null; + $resourcePath = '/wallet/fee'; $formParams = []; @@ -2423,6 +2446,268 @@ protected function getTradeFeeRequest() $httpBody = ''; $multipart = false; + // query params + if ($currency_pair !== null) { + if('form' === 'form' && is_array($currency_pair)) { + foreach($currency_pair as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency_pair'] = $currency_pair; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTotalBalance + * + * Retrieve user's total balances + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. (optional, default to 'USDT') + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\TotalBalance + */ + public function getTotalBalance($associative_array) + { + list($response) = $this->getTotalBalanceWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation getTotalBalanceWithHttpInfo + * + * Retrieve user's total balances + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. (optional, default to 'USDT') + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\TotalBalance, HTTP status code, HTTP response headers (array of strings) + */ + public function getTotalBalanceWithHttpInfo($associative_array) + { + $request = $this->getTotalBalanceRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\TotalBalance'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getTotalBalanceAsync + * + * Retrieve user's total balances + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. (optional, default to 'USDT') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTotalBalanceAsync($associative_array) + { + return $this->getTotalBalanceAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTotalBalanceAsyncWithHttpInfo + * + * Retrieve user's total balances + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. (optional, default to 'USDT') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTotalBalanceAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\TotalBalance'; + $request = $this->getTotalBalanceRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTotalBalance' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. (optional, default to 'USDT') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getTotalBalanceRequest($associative_array) + { + // unbox the parameters from the associative array + $currency = array_key_exists('currency', $associative_array) ? $associative_array['currency'] : 'USDT'; + + + $resourcePath = '/wallet/total_balance'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($currency !== null) { + if('form' === 'form' && is_array($currency)) { + foreach($currency as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency'] = $currency; + } + } + // body params $_tempBody = null; diff --git a/src/Configuration.php b/src/Configuration.php index 60411f0..14801b9 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.21.6/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.22.1/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.21.6' . PHP_EOL; - $report .= ' SDK Package Version: 5.21.6' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.22.1' . PHP_EOL; + $report .= ' SDK Package Version: 5.22.1' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/AccountBalance.php b/src/Model/AccountBalance.php new file mode 100644 index 0000000..007d1a8 --- /dev/null +++ b/src/Model/AccountBalance.php @@ -0,0 +1,371 @@ + 'string', + 'currency' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'currency' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'currency' => 'currency' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'currency' => 'setCurrency' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'currency' => 'getCurrency' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const CURRENCY_BTC = 'BTC'; + const CURRENCY_CNY = 'CNY'; + const CURRENCY_USD = 'USD'; + const CURRENCY_USDT = 'USDT'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCurrencyAllowableValues() + { + return [ + self::CURRENCY_BTC, + self::CURRENCY_CNY, + self::CURRENCY_USD, + self::CURRENCY_USDT, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getCurrencyAllowableValues(); + if (!is_null($this->container['currency']) && !in_array($this->container['currency'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'currency', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return string|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string|null $amount Account total balance amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency Currency + * + * @return $this + */ + public function setCurrency($currency) + { + $allowedValues = $this->getCurrencyAllowableValues(); + if (!is_null($currency) && !in_array($currency, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'currency', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['currency'] = $currency; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/BatchOrder.php b/src/Model/BatchOrder.php index 93bf1f8..7a5d6e2 100644 --- a/src/Model/BatchOrder.php +++ b/src/Model/BatchOrder.php @@ -532,7 +532,7 @@ public function getSucceeded() /** * Sets succeeded * - * @param bool|null $succeeded Whether order succeeds + * @param bool|null $succeeded Whether the batch of orders succeeded * * @return $this */ @@ -556,7 +556,7 @@ public function getLabel() /** * Sets label * - * @param string|null $label Error label, empty string if order succeeds + * @param string|null $label Error label, if any, otherwise an empty string * * @return $this */ @@ -580,7 +580,7 @@ public function getMessage() /** * Sets message * - * @param string|null $message Detailed error message, empty string if order succeeds + * @param string|null $message Detailed error message, if any, otherwise an empty string * * @return $this */ @@ -628,7 +628,7 @@ public function getCreateTime() /** * Sets create_time * - * @param string|null $create_time Order creation time + * @param string|null $create_time Creation time of order * * @return $this */ @@ -652,7 +652,7 @@ public function getUpdateTime() /** * Sets update_time * - * @param string|null $update_time Order last modification time + * @param string|null $update_time Last modification time of order * * @return $this */ @@ -676,7 +676,7 @@ public function getCreateTimeMs() /** * Sets create_time_ms * - * @param int|null $create_time_ms Order creation time in milliseconds + * @param int|null $create_time_ms Creation time of order (in milliseconds) * * @return $this */ @@ -700,7 +700,7 @@ public function getUpdateTimeMs() /** * Sets update_time_ms * - * @param int|null $update_time_ms Order last modification time in milliseconds + * @param int|null $update_time_ms Last modification time of order (in milliseconds) * * @return $this */ @@ -961,7 +961,7 @@ public function getIceberg() /** * Sets iceberg * - * @param string|null $iceberg Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the amount totally + * @param string|null $iceberg Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely * * @return $this */ @@ -1153,7 +1153,7 @@ public function getPointFee() /** * Sets point_fee * - * @param string|null $point_fee Point used to deduct fee + * @param string|null $point_fee Points used to deduct fee * * @return $this */ diff --git a/src/Model/Contract.php b/src/Model/Contract.php index 69caab8..3f9efbd 100644 --- a/src/Model/Contract.php +++ b/src/Model/Contract.php @@ -1113,7 +1113,7 @@ public function getTradeSize() /** * Sets trade_size * - * @param int|null $trade_size Historical accumulation trade size + * @param int|null $trade_size Historical accumulated trade size * * @return $this */ @@ -1161,7 +1161,7 @@ public function getConfigChangeTime() /** * Sets config_change_time * - * @param double|null $config_change_time Configuration's last changed time + * @param double|null $config_change_time Last changed time of configuration * * @return $this */ diff --git a/src/Model/CrossMarginAccountBook.php b/src/Model/CrossMarginAccountBook.php index c52011b..abe91c7 100644 --- a/src/Model/CrossMarginAccountBook.php +++ b/src/Model/CrossMarginAccountBook.php @@ -305,7 +305,7 @@ public function getTime() /** * Sets time * - * @param int|null $time Account changed timestamp in milliseconds + * @param int|null $time The timestamp of the change (in milliseconds) * * @return $this */ diff --git a/src/Model/CrossMarginBalance.php b/src/Model/CrossMarginBalance.php index 338ddf9..244a4d9 100644 --- a/src/Model/CrossMarginBalance.php +++ b/src/Model/CrossMarginBalance.php @@ -304,7 +304,7 @@ public function getInterest() /** * Sets interest * - * @param string|null $interest Interests unpaid + * @param string|null $interest Unpaid interests * * @return $this */ diff --git a/src/Model/CrossMarginBorrowable.php b/src/Model/CrossMarginBorrowable.php new file mode 100644 index 0000000..4dd6814 --- /dev/null +++ b/src/Model/CrossMarginBorrowable.php @@ -0,0 +1,334 @@ + 'string', + 'amount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'amount' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency Currency detail + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets amount + * + * @return string|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string|null $amount Max borrowable amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CrossMarginLoan.php b/src/Model/CrossMarginLoan.php index 588c0fa..9ee74ae 100644 --- a/src/Model/CrossMarginLoan.php +++ b/src/Model/CrossMarginLoan.php @@ -524,7 +524,7 @@ public function getUnpaidInterest() /** * Sets unpaid_interest * - * @param string|null $unpaid_interest Interest not repaid + * @param string|null $unpaid_interest Outstanding interest yet to be paid * * @return $this */ diff --git a/src/Model/DeliveryContract.php b/src/Model/DeliveryContract.php index e97fd70..7f9d7aa 100644 --- a/src/Model/DeliveryContract.php +++ b/src/Model/DeliveryContract.php @@ -1329,7 +1329,7 @@ public function getTradeSize() /** * Sets trade_size * - * @param int|null $trade_size Historical accumulation trade size + * @param int|null $trade_size Historical accumulated trade size * * @return $this */ @@ -1377,7 +1377,7 @@ public function getConfigChangeTime() /** * Sets config_change_time * - * @param double|null $config_change_time Configuration's last changed time + * @param double|null $config_change_time Last changed time of configuration * * @return $this */ diff --git a/src/Model/FundingAccount.php b/src/Model/FundingAccount.php index dd8cbef..79e4ae3 100644 --- a/src/Model/FundingAccount.php +++ b/src/Model/FundingAccount.php @@ -310,7 +310,7 @@ public function getLent() /** * Sets lent * - * @param string|null $lent Amount that is loaned but not repaid + * @param string|null $lent Outstanding loan amount yet to be repaid * * @return $this */ diff --git a/src/Model/FundingBookItem.php b/src/Model/FundingBookItem.php index 5b4a7ac..5fd0f18 100644 --- a/src/Model/FundingBookItem.php +++ b/src/Model/FundingBookItem.php @@ -274,7 +274,7 @@ public function getDays() /** * Sets days * - * @param int|null $days How long the loan should be repaid + * @param int|null $days The number of days till the loan repayment's dateline * * @return $this */ diff --git a/src/Model/FuturesInitialOrder.php b/src/Model/FuturesInitialOrder.php index b358370..bd854ec 100644 --- a/src/Model/FuturesInitialOrder.php +++ b/src/Model/FuturesInitialOrder.php @@ -444,7 +444,7 @@ public function getReduceOnly() /** * Sets reduce_only * - * @param bool|null $reduce_only Set to true to create an reduce-only order + * @param bool|null $reduce_only Set to true to create a reduce-only order * * @return $this */ diff --git a/src/Model/FuturesOrder.php b/src/Model/FuturesOrder.php index f27b29a..e473b72 100644 --- a/src/Model/FuturesOrder.php +++ b/src/Model/FuturesOrder.php @@ -478,7 +478,7 @@ public function getCreateTime() /** * Sets create_time * - * @param double|null $create_time Order creation time + * @param double|null $create_time Creation time of order * * @return $this */ @@ -526,7 +526,7 @@ public function getFinishAs() /** * Sets finish_as * - * @param string|null $finish_as How the order is finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set- position_closed: cancelled because of position close + * @param string|null $finish_as How the order was finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set- position_closed: cancelled because of position close * * @return $this */ @@ -640,7 +640,7 @@ public function getIceberg() /** * Sets iceberg * - * @param int|null $iceberg Display size for iceberg order. 0 for non-iceberg. Note that you would pay the taker fee for the hidden size + * @param int|null $iceberg Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size * * @return $this */ diff --git a/src/Model/FuturesOrderBook.php b/src/Model/FuturesOrderBook.php index 5cec089..89df464 100644 --- a/src/Model/FuturesOrderBook.php +++ b/src/Model/FuturesOrderBook.php @@ -244,7 +244,7 @@ public function getId() /** * Sets id * - * @param int|null $id Order Book ID. Increase by 1 on every order book change. Set `with_id=true` to include this field in response + * @param int|null $id Order Book ID. Increases by 1 on every order book change. Set `with_id=true` to include this field in response * * @return $this */ diff --git a/src/Model/FuturesPriceTrigger.php b/src/Model/FuturesPriceTrigger.php index be07fb8..3266215 100644 --- a/src/Model/FuturesPriceTrigger.php +++ b/src/Model/FuturesPriceTrigger.php @@ -309,7 +309,7 @@ public function getStrategyType() /** * Sets strategy_type * - * @param int|null $strategy_type How the order will be triggered - `0`: by price, which means order will be triggered on price condition satisfied - `1`: by price gap, which means order will be triggered on gap of recent two prices of specified `price_type` satisfied. Only `0` is supported currently + * @param int|null $strategy_type How the order will be triggered - `0`: by price, which means the order will be triggered if price condition is satisfied - `1`: by price gap, which means the order will be triggered if gap of recent two prices of specified `price_type` are satisfied. Only `0` is supported currently * * @return $this */ @@ -432,7 +432,7 @@ public function getExpiration() /** * Sets expiration * - * @param int|null $expiration How many seconds will the order wait for the condition being triggered. Order will be cancelled on timed out + * @param int|null $expiration How long (in seconds) to wait for the condition to be triggered before cancelling the order. * * @return $this */ diff --git a/src/Model/FuturesPriceTriggeredOrder.php b/src/Model/FuturesPriceTriggeredOrder.php index 0363c9f..e4fe249 100644 --- a/src/Model/FuturesPriceTriggeredOrder.php +++ b/src/Model/FuturesPriceTriggeredOrder.php @@ -559,7 +559,7 @@ public function getReason() /** * Sets reason * - * @param string|null $reason Extra messages of how order is finished + * @param string|null $reason Additional remarks on how the order was finished * * @return $this */ diff --git a/src/Model/FuturesTicker.php b/src/Model/FuturesTicker.php index 03767cd..d5ffd7a 100644 --- a/src/Model/FuturesTicker.php +++ b/src/Model/FuturesTicker.php @@ -694,7 +694,7 @@ public function getQuantoBaseRate() /** * Sets quanto_base_rate * - * @param string|null $quanto_base_rate Exchange rate of base currency and settlement currency in Quanto contract. Not existed in contract of other types + * @param string|null $quanto_base_rate Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types * * @return $this */ diff --git a/src/Model/LedgerRecord.php b/src/Model/LedgerRecord.php index fced5fe..6c78f35 100644 --- a/src/Model/LedgerRecord.php +++ b/src/Model/LedgerRecord.php @@ -441,7 +441,7 @@ public function getMemo() /** * Sets memo * - * @param string|null $memo Extra withdrawal memo + * @param string|null $memo Additional remarks with regards to the withdrawal * * @return $this */ @@ -465,7 +465,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: waiting for manual approval - BCODE: GateCode operation + * @param string|null $status Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation * * @return $this */ diff --git a/src/Model/Loan.php b/src/Model/Loan.php index 98aa880..c094aaf 100644 --- a/src/Model/Loan.php +++ b/src/Model/Loan.php @@ -71,7 +71,8 @@ class Loan implements ModelInterface, ArrayAccess 'paid_interest' => 'string', 'unpaid_interest' => 'string', 'fee_rate' => 'string', - 'orig_id' => 'string' + 'orig_id' => 'string', + 'text' => 'string' ]; /** @@ -96,7 +97,8 @@ class Loan implements ModelInterface, ArrayAccess 'paid_interest' => null, 'unpaid_interest' => null, 'fee_rate' => null, - 'orig_id' => null + 'orig_id' => null, + 'text' => null ]; /** @@ -142,7 +144,8 @@ public static function openAPIFormats() 'paid_interest' => 'paid_interest', 'unpaid_interest' => 'unpaid_interest', 'fee_rate' => 'fee_rate', - 'orig_id' => 'orig_id' + 'orig_id' => 'orig_id', + 'text' => 'text' ]; /** @@ -167,7 +170,8 @@ public static function openAPIFormats() 'paid_interest' => 'setPaidInterest', 'unpaid_interest' => 'setUnpaidInterest', 'fee_rate' => 'setFeeRate', - 'orig_id' => 'setOrigId' + 'orig_id' => 'setOrigId', + 'text' => 'setText' ]; /** @@ -192,7 +196,8 @@ public static function openAPIFormats() 'paid_interest' => 'getPaidInterest', 'unpaid_interest' => 'getUnpaidInterest', 'fee_rate' => 'getFeeRate', - 'orig_id' => 'getOrigId' + 'orig_id' => 'getOrigId', + 'text' => 'getText' ]; /** @@ -306,6 +311,7 @@ public function __construct(array $data = null) $this->container['unpaid_interest'] = isset($data['unpaid_interest']) ? $data['unpaid_interest'] : null; $this->container['fee_rate'] = isset($data['fee_rate']) ? $data['fee_rate'] : null; $this->container['orig_id'] = isset($data['orig_id']) ? $data['orig_id'] : null; + $this->container['text'] = isset($data['text']) ? $data['text'] : null; } /** @@ -342,9 +348,6 @@ public function listInvalidProperties() if ($this->container['amount'] === null) { $invalidProperties[] = "'amount' can't be null"; } - if ($this->container['days'] === null) { - $invalidProperties[] = "'days' can't be null"; - } return $invalidProperties; } @@ -573,7 +576,7 @@ public function setAmount($amount) /** * Gets days * - * @return int + * @return int|null */ public function getDays() { @@ -583,7 +586,7 @@ public function getDays() /** * Sets days * - * @param int $days Loan days + * @param int|null $days Loan days. Only 10 is supported for now * * @return $this */ @@ -607,7 +610,7 @@ public function getAutoRenew() /** * Sets auto_renew * - * @param bool|null $auto_renew Auto renew the loan on expiration + * @param bool|null $auto_renew Whether to auto renew the loan upon expiration * * @return $this */ @@ -631,7 +634,7 @@ public function getCurrencyPair() /** * Sets currency_pair * - * @param string|null $currency_pair Currency pair. Required for borrowing side + * @param string|null $currency_pair Currency pair. Required if borrowing * * @return $this */ @@ -655,7 +658,7 @@ public function getLeft() /** * Sets left * - * @param string|null $left Amount not lending out + * @param string|null $left Amount not lent out yet * * @return $this */ @@ -727,7 +730,7 @@ public function getUnpaidInterest() /** * Sets unpaid_interest * - * @param string|null $unpaid_interest Interest not repaid + * @param string|null $unpaid_interest Outstanding interest yet to be paid * * @return $this */ @@ -775,7 +778,7 @@ public function getOrigId() /** * Sets orig_id * - * @param string|null $orig_id Original loan ID if the loan is auto-renewed. Equal to `id` if not + * @param string|null $orig_id Original loan ID of the loan if auto-renewed, otherwise equals to id * * @return $this */ @@ -785,6 +788,30 @@ public function setOrigId($orig_id) return $this; } + + /** + * Gets text + * + * @return string|null + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string|null $text User defined custom ID + * + * @return $this + */ + public function setText($text) + { + $this->container['text'] = $text; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/LoanPatch.php b/src/Model/LoanPatch.php index 88fd283..3a2d25a 100644 --- a/src/Model/LoanPatch.php +++ b/src/Model/LoanPatch.php @@ -351,7 +351,7 @@ public function getCurrencyPair() /** * Sets currency_pair * - * @param string|null $currency_pair Currency pair. Required for borrowing side + * @param string|null $currency_pair Currency pair. Required if borrowing * * @return $this */ diff --git a/src/Model/LoanRecord.php b/src/Model/LoanRecord.php index 4d072fa..dd35a4b 100644 --- a/src/Model/LoanRecord.php +++ b/src/Model/LoanRecord.php @@ -637,7 +637,7 @@ public function getUnpaidInterest() /** * Sets unpaid_interest * - * @param string|null $unpaid_interest Interest not repaid + * @param string|null $unpaid_interest Outstanding interest yet to be paid * * @return $this */ diff --git a/src/Model/MarginAccount.php b/src/Model/MarginAccount.php index 52095b1..5da1789 100644 --- a/src/Model/MarginAccount.php +++ b/src/Model/MarginAccount.php @@ -56,6 +56,8 @@ class MarginAccount implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'currency_pair' => 'string', + 'locked' => 'bool', + 'risk' => 'string', 'base' => '\GateApi\Model\MarginAccountCurrency', 'quote' => '\GateApi\Model\MarginAccountCurrency' ]; @@ -67,6 +69,8 @@ class MarginAccount implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'currency_pair' => null, + 'locked' => null, + 'risk' => null, 'base' => null, 'quote' => null ]; @@ -99,6 +103,8 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'currency_pair' => 'currency_pair', + 'locked' => 'locked', + 'risk' => 'risk', 'base' => 'base', 'quote' => 'quote' ]; @@ -110,6 +116,8 @@ public static function openAPIFormats() */ protected static $setters = [ 'currency_pair' => 'setCurrencyPair', + 'locked' => 'setLocked', + 'risk' => 'setRisk', 'base' => 'setBase', 'quote' => 'setQuote' ]; @@ -121,6 +129,8 @@ public static function openAPIFormats() */ protected static $getters = [ 'currency_pair' => 'getCurrencyPair', + 'locked' => 'getLocked', + 'risk' => 'getRisk', 'base' => 'getBase', 'quote' => 'getQuote' ]; @@ -186,6 +196,8 @@ public function getModelName() public function __construct(array $data = null) { $this->container['currency_pair'] = isset($data['currency_pair']) ? $data['currency_pair'] : null; + $this->container['locked'] = isset($data['locked']) ? $data['locked'] : null; + $this->container['risk'] = isset($data['risk']) ? $data['risk'] : null; $this->container['base'] = isset($data['base']) ? $data['base'] : null; $this->container['quote'] = isset($data['quote']) ? $data['quote'] : null; } @@ -238,6 +250,54 @@ public function setCurrencyPair($currency_pair) return $this; } + /** + * Gets locked + * + * @return bool|null + */ + public function getLocked() + { + return $this->container['locked']; + } + + /** + * Sets locked + * + * @param bool|null $locked Whether account is locked + * + * @return $this + */ + public function setLocked($locked) + { + $this->container['locked'] = $locked; + + return $this; + } + + /** + * Gets risk + * + * @return string|null + */ + public function getRisk() + { + return $this->container['risk']; + } + + /** + * Sets risk + * + * @param string|null $risk Current risk rate of margin account + * + * @return $this + */ + public function setRisk($risk) + { + $this->container['risk'] = $risk; + + return $this; + } + /** * Gets base * diff --git a/src/Model/MarginAccountBook.php b/src/Model/MarginAccountBook.php index 853099a..4b22c8c 100644 --- a/src/Model/MarginAccountBook.php +++ b/src/Model/MarginAccountBook.php @@ -298,7 +298,7 @@ public function getTimeMs() /** * Sets time_ms * - * @param int|null $time_ms Account changed timestamp in milliseconds + * @param int|null $time_ms The timestamp of the change (in milliseconds) * * @return $this */ diff --git a/src/Model/MarginAccountCurrency.php b/src/Model/MarginAccountCurrency.php index cae2448..e68f194 100644 --- a/src/Model/MarginAccountCurrency.php +++ b/src/Model/MarginAccountCurrency.php @@ -33,7 +33,7 @@ * MarginAccountCurrency Class Doc Comment * * @category Class - * @description Account currency detail + * @description Account currency details * @package GateApi * @author GateIO * @link https://www.gate.io @@ -335,7 +335,7 @@ public function getInterest() /** * Sets interest * - * @param string|null $interest Interests unpaid + * @param string|null $interest Unpaid interests * * @return $this */ diff --git a/src/Model/MarginBorrowable.php b/src/Model/MarginBorrowable.php new file mode 100644 index 0000000..ab3b736 --- /dev/null +++ b/src/Model/MarginBorrowable.php @@ -0,0 +1,364 @@ + 'string', + 'currency_pair' => 'string', + 'amount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'currency_pair' => null, + 'amount' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'currency_pair' => 'currency_pair', + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'currency_pair' => 'setCurrencyPair', + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'currency_pair' => 'getCurrencyPair', + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['currency_pair'] = isset($data['currency_pair']) ? $data['currency_pair'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency Currency detail + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets currency_pair + * + * @return string|null + */ + public function getCurrencyPair() + { + return $this->container['currency_pair']; + } + + /** + * Sets currency_pair + * + * @param string|null $currency_pair Currency pair + * + * @return $this + */ + public function setCurrencyPair($currency_pair) + { + $this->container['currency_pair'] = $currency_pair; + + return $this; + } + + /** + * Gets amount + * + * @return string|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string|null $amount Max borrowable amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/MultiChainAddressItem.php b/src/Model/MultiChainAddressItem.php index 967d8fa..126ed0e 100644 --- a/src/Model/MultiChainAddressItem.php +++ b/src/Model/MultiChainAddressItem.php @@ -334,7 +334,7 @@ public function getObtainFailed() /** * Sets obtain_failed * - * @param int|null $obtain_failed Whether address is obtained. 0 means success. 1 is failure, which needs retries + * @param int|null $obtain_failed The obtain failed status- 0: address successfully obtained- 1: failed to obtain address * * @return $this */ diff --git a/src/Model/Order.php b/src/Model/Order.php index a19fb95..1b1a281 100644 --- a/src/Model/Order.php +++ b/src/Model/Order.php @@ -550,7 +550,7 @@ public function getCreateTime() /** * Sets create_time * - * @param string|null $create_time Order creation time + * @param string|null $create_time Creation time of order * * @return $this */ @@ -574,7 +574,7 @@ public function getUpdateTime() /** * Sets update_time * - * @param string|null $update_time Order last modification time + * @param string|null $update_time Last modification time of order * * @return $this */ @@ -598,7 +598,7 @@ public function getCreateTimeMs() /** * Sets create_time_ms * - * @param int|null $create_time_ms Order creation time in milliseconds + * @param int|null $create_time_ms Creation time of order (in milliseconds) * * @return $this */ @@ -622,7 +622,7 @@ public function getUpdateTimeMs() /** * Sets update_time_ms * - * @param int|null $update_time_ms Order last modification time in milliseconds + * @param int|null $update_time_ms Last modification time of order (in milliseconds) * * @return $this */ @@ -883,7 +883,7 @@ public function getIceberg() /** * Sets iceberg * - * @param string|null $iceberg Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the amount totally + * @param string|null $iceberg Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely * * @return $this */ @@ -1075,7 +1075,7 @@ public function getPointFee() /** * Sets point_fee * - * @param string|null $point_fee Point used to deduct fee + * @param string|null $point_fee Points used to deduct fee * * @return $this */ diff --git a/src/Model/OrderBook.php b/src/Model/OrderBook.php index 3e68dfc..af990fe 100644 --- a/src/Model/OrderBook.php +++ b/src/Model/OrderBook.php @@ -268,7 +268,7 @@ public function getCurrent() /** * Sets current * - * @param int|null $current Response data generation timestamp in milliseconds + * @param int|null $current The timestamp of the response data being generated (in milliseconds) * * @return $this */ @@ -292,7 +292,7 @@ public function getUpdate() /** * Sets update * - * @param int|null $update Order book changed timestamp in milliseconds + * @param int|null $update The timestamp of when the orderbook last changed (in milliseconds) * * @return $this */ diff --git a/src/Model/Position.php b/src/Model/Position.php index 01dc2ef..e2455a2 100644 --- a/src/Model/Position.php +++ b/src/Model/Position.php @@ -804,7 +804,7 @@ public function getAdlRanking() /** * Sets adl_ranking * - * @param int|null $adl_ranking ADL ranking, range from 1 to 5 + * @param int|null $adl_ranking ADL ranking, ranging from 1 to 5 * * @return $this */ diff --git a/src/Model/SpotPriceTrigger.php b/src/Model/SpotPriceTrigger.php index 0682b07..56290be 100644 --- a/src/Model/SpotPriceTrigger.php +++ b/src/Model/SpotPriceTrigger.php @@ -315,7 +315,7 @@ public function getExpiration() /** * Sets expiration * - * @param int $expiration How many seconds will the order wait for the condition being triggered. Order will be cancelled on timed out + * @param int $expiration How long (in seconds) to wait for the condition to be triggered before cancelling the order. * * @return $this */ diff --git a/src/Model/SpotPriceTriggeredOrder.php b/src/Model/SpotPriceTriggeredOrder.php index 8a88c11..2025873 100644 --- a/src/Model/SpotPriceTriggeredOrder.php +++ b/src/Model/SpotPriceTriggeredOrder.php @@ -494,7 +494,7 @@ public function getReason() /** * Sets reason * - * @param string|null $reason Extra messages of how order is finished + * @param string|null $reason Additional remarks on how the order was finished * * @return $this */ diff --git a/src/Model/TotalBalance.php b/src/Model/TotalBalance.php new file mode 100644 index 0000000..dbda5d0 --- /dev/null +++ b/src/Model/TotalBalance.php @@ -0,0 +1,335 @@ + '\GateApi\Model\AccountBalance', + 'details' => 'map[string,\GateApi\Model\AccountBalance]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'total' => null, + 'details' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'total' => 'total', + 'details' => 'details' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'total' => 'setTotal', + 'details' => 'setDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'total' => 'getTotal', + 'details' => 'getDetails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['total'] = isset($data['total']) ? $data['total'] : null; + $this->container['details'] = isset($data['details']) ? $data['details'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets total + * + * @return \GateApi\Model\AccountBalance|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param \GateApi\Model\AccountBalance|null $total total + * + * @return $this + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets details + * + * @return map[string,\GateApi\Model\AccountBalance]|null + */ + public function getDetails() + { + return $this->container['details']; + } + + /** + * Sets details + * + * @param map[string,\GateApi\Model\AccountBalance]|null $details Total balances in different accounts - cross_margin: cross margin account - spot: spot account - finance: finance account - margin: margin account - quant: quant account - futures: futures account - delivery: delivery account - warrant: warrant account - cbbc: cbbc account + * + * @return $this + */ + public function setDetails($details) + { + $this->container['details'] = $details; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Trade.php b/src/Model/Trade.php index d78cefc..16711ff 100644 --- a/src/Model/Trade.php +++ b/src/Model/Trade.php @@ -614,7 +614,7 @@ public function getPointFee() /** * Sets point_fee * - * @param string|null $point_fee Point used to deduct fee + * @param string|null $point_fee Points used to deduct fee * * @return $this */ diff --git a/src/Model/TradeFee.php b/src/Model/TradeFee.php index e1a5ad1..0f9b43e 100644 --- a/src/Model/TradeFee.php +++ b/src/Model/TradeFee.php @@ -340,7 +340,7 @@ public function getGtDiscount() /** * Sets gt_discount * - * @param bool|null $gt_discount Is GT deduction is enabled + * @param bool|null $gt_discount If GT deduction is enabled * * @return $this */ diff --git a/src/Model/Transfer.php b/src/Model/Transfer.php index 4e76650..f59afd5 100644 --- a/src/Model/Transfer.php +++ b/src/Model/Transfer.php @@ -339,7 +339,7 @@ public function getFrom() /** * Sets from * - * @param string $from Account transferred from + * @param string $from Account to transfer from * * @return $this */ @@ -372,7 +372,7 @@ public function getTo() /** * Sets to * - * @param string $to Account transferred to + * @param string $to Account to transfer to * * @return $this */ From 0856c7a81069a6a7ddb19af9f7d983668c6b65c6 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Wed, 29 Sep 2021 17:05:56 +0800 Subject: [PATCH 05/17] add more status enum for LedgerRecord; add auto_size in FuturesOrder --- README.md | 4 +-- composer.json | 2 +- composer.lock | 36 +++++++++---------- docs/Api/SpotApi.md | 4 +-- docs/Model/FuturesOrder.md | 1 + docs/Model/LedgerRecord.md | 2 +- src/Configuration.php | 6 ++-- src/Model/FuturesOrder.php | 72 +++++++++++++++++++++++++++++++++++--- src/Model/LedgerRecord.php | 6 +++- src/Model/TotalBalance.php | 2 +- 10 files changed, 101 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index b9c74b3..4aaa29f 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.22.1 -- Package version: 5.22.1 +- API version: 4.22.2 +- Package version: 5.22.2 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) diff --git a/composer.json b/composer.json index 89f66a5..9feebc3 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.22.1", + "version": "5.22.2", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index 537ed54..b6cca6d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b430509cdcbece1a85e100d0a12c5504", + "content-hash": "c7fce2a784f01818fd2bd59afa355ba9", "packages": [ { "name": "guzzlehttp/guzzle", @@ -1482,16 +1482,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30f38bffc6f24293dadd1823936372dfa9e86e2f", + "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f", "shasum": "", "mirrors": [ { @@ -1505,7 +1505,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -1531,22 +1532,22 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.0" }, - "time": "2020-09-17T18:55:26+00:00" + "time": "2021-09-17T15:28:14+00:00" }, { "name": "phpspec/prophecy", - "version": "1.13.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", - "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", "shasum": "", "mirrors": [ { @@ -1557,19 +1558,19 @@ }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.1", + "php": "^7.2 || ~8.0, <8.2", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^6.0", + "phpspec/phpspec": "^6.0 || ^7.0", "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -1604,9 +1605,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.13.0" + "source": "https://github.com/phpspec/prophecy/tree/1.14.0" }, - "time": "2021-03-17T13:42:18+00:00" + "time": "2021-09-10T09:02:12+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2919,7 +2920,6 @@ "type": "github" } ], - "abandoned": true, "time": "2020-11-30T07:30:19+00:00" }, { diff --git a/docs/Api/SpotApi.md b/docs/Api/SpotApi.md index c40bb95..574547d 100644 --- a/docs/Api/SpotApi.md +++ b/docs/Api/SpotApi.md @@ -766,7 +766,7 @@ Name | Type | Description | Notes List orders -Spot and margin orders are returned by default. If cross margin orders are needed, `account` must be set to `cross_margin` When `status` is `open`, i.e., listing open orders, only pagination parameters `page` and `limit` are supported and `limit` cannot be larger than 100. Query by `side` and time range parameters `from` and `to` are not supported. When `status` is `finished`, i.e., listing finished orders, pagination parameters, time range parameters `from` and `to`, and `side` parameters are all supported. +Spot and margin orders are returned by default. If cross margin orders are needed, `account` must be set to `cross_margin` When `status` is `open`, i.e., listing open orders, only pagination parameters `page` and `limit` are supported and `limit` cannot be larger than 100. Query by `side` and time range parameters `from` and `to` are not supported. When `status` is `finished`, i.e., listing finished orders, pagination parameters, time range parameters `from` and `to`, and `side` parameters are all supported. Time range parameters are handled as order finish time. ### Example @@ -1166,7 +1166,7 @@ Name | Type | Description | Notes List personal trading history -Spot and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range +Spot and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range Time range parameters are handled as order finish time. ### Example diff --git a/docs/Model/FuturesOrder.md b/docs/Model/FuturesOrder.md index c33a35b..49aba07 100644 --- a/docs/Model/FuturesOrder.md +++ b/docs/Model/FuturesOrder.md @@ -26,5 +26,6 @@ Name | Type | Description | Notes **tkfr** | **string** | Taker fee | [optional] [readonly] **mkfr** | **string** | Maker fee | [optional] [readonly] **refu** | **int** | Reference user ID | [optional] [readonly] +**auto_size** | **string** | Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LedgerRecord.md b/docs/Model/LedgerRecord.md index 7e48f8e..b3ddf46 100644 --- a/docs/Model/LedgerRecord.md +++ b/docs/Model/LedgerRecord.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **currency** | **string** | Currency name | **address** | **string** | Withdrawal address. Required for withdrawals | [optional] **memo** | **string** | Additional remarks with regards to the withdrawal | [optional] -**status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation | [optional] [readonly] +**status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail | [optional] [readonly] **chain** | **string** | Name of the chain used in withdrawals | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/src/Configuration.php b/src/Configuration.php index 14801b9..06f0140 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.22.1/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.22.2/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.22.1' . PHP_EOL; - $report .= ' SDK Package Version: 5.22.1' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.22.2' . PHP_EOL; + $report .= ' SDK Package Version: 5.22.2' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/FuturesOrder.php b/src/Model/FuturesOrder.php index e473b72..92a4eb8 100644 --- a/src/Model/FuturesOrder.php +++ b/src/Model/FuturesOrder.php @@ -76,7 +76,8 @@ class FuturesOrder implements ModelInterface, ArrayAccess 'text' => 'string', 'tkfr' => 'string', 'mkfr' => 'string', - 'refu' => 'int' + 'refu' => 'int', + 'auto_size' => 'string' ]; /** @@ -106,7 +107,8 @@ class FuturesOrder implements ModelInterface, ArrayAccess 'text' => null, 'tkfr' => null, 'mkfr' => null, - 'refu' => null + 'refu' => null, + 'auto_size' => null ]; /** @@ -157,7 +159,8 @@ public static function openAPIFormats() 'text' => 'text', 'tkfr' => 'tkfr', 'mkfr' => 'mkfr', - 'refu' => 'refu' + 'refu' => 'refu', + 'auto_size' => 'auto_size' ]; /** @@ -187,7 +190,8 @@ public static function openAPIFormats() 'text' => 'setText', 'tkfr' => 'setTkfr', 'mkfr' => 'setMkfr', - 'refu' => 'setRefu' + 'refu' => 'setRefu', + 'auto_size' => 'setAutoSize' ]; /** @@ -217,7 +221,8 @@ public static function openAPIFormats() 'text' => 'getText', 'tkfr' => 'getTkfr', 'mkfr' => 'getMkfr', - 'refu' => 'getRefu' + 'refu' => 'getRefu', + 'auto_size' => 'getAutoSize' ]; /** @@ -274,6 +279,8 @@ public function getModelName() const TIF_GTC = 'gtc'; const TIF_IOC = 'ioc'; const TIF_POC = 'poc'; + const AUTO_SIZE_LONG = 'close_long'; + const AUTO_SIZE_SHORT = 'close_short'; @@ -323,6 +330,19 @@ public function getTifAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAutoSizeAllowableValues() + { + return [ + self::AUTO_SIZE_LONG, + self::AUTO_SIZE_SHORT, + ]; + } + /** * Associative array for storing property values @@ -361,6 +381,7 @@ public function __construct(array $data = null) $this->container['tkfr'] = isset($data['tkfr']) ? $data['tkfr'] : null; $this->container['mkfr'] = isset($data['mkfr']) ? $data['mkfr'] : null; $this->container['refu'] = isset($data['refu']) ? $data['refu'] : null; + $this->container['auto_size'] = isset($data['auto_size']) ? $data['auto_size'] : null; } /** @@ -402,6 +423,14 @@ public function listInvalidProperties() ); } + $allowedValues = $this->getAutoSizeAllowableValues(); + if (!is_null($this->container['auto_size']) && !in_array($this->container['auto_size'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'auto_size', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -971,6 +1000,39 @@ public function setRefu($refu) return $this; } + + /** + * Gets auto_size + * + * @return string|null + */ + public function getAutoSize() + { + return $this->container['auto_size']; + } + + /** + * Sets auto_size + * + * @param string|null $auto_size Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 + * + * @return $this + */ + public function setAutoSize($auto_size) + { + $allowedValues = $this->getAutoSizeAllowableValues(); + if (!is_null($auto_size) && !in_array($auto_size, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'auto_size', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['auto_size'] = $auto_size; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/LedgerRecord.php b/src/Model/LedgerRecord.php index 6c78f35..d8421a8 100644 --- a/src/Model/LedgerRecord.php +++ b/src/Model/LedgerRecord.php @@ -200,6 +200,8 @@ public function getModelName() const STATUS_REQUEST = 'REQUEST'; const STATUS_MANUAL = 'MANUAL'; const STATUS_BCODE = 'BCODE'; + const STATUS_EXTPEND = 'EXTPEND'; + const STATUS_FAIL = 'FAIL'; @@ -216,6 +218,8 @@ public function getStatusAllowableValues() self::STATUS_REQUEST, self::STATUS_MANUAL, self::STATUS_BCODE, + self::STATUS_EXTPEND, + self::STATUS_FAIL, ]; } @@ -465,7 +469,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation + * @param string|null $status Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail * * @return $this */ diff --git a/src/Model/TotalBalance.php b/src/Model/TotalBalance.php index dbda5d0..fa823eb 100644 --- a/src/Model/TotalBalance.php +++ b/src/Model/TotalBalance.php @@ -33,7 +33,7 @@ * TotalBalance Class Doc Comment * * @category Class - * @description 用户总资产信息 + * @description User's balance in all accounts * @package GateApi * @author GateIO * @link https://www.gate.io From b036f451401ffb190afc3d07b5cca87bab890828 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Thu, 28 Oct 2021 12:12:26 +0800 Subject: [PATCH 06/17] spot public trades supports time range query --- README.md | 4 +- composer.json | 2 +- composer.lock | 131 +++++++++++++++++++++++++++++++----------- docs/Api/MarginApi.md | 12 ++-- docs/Api/SpotApi.md | 22 ++++--- src/Api/MarginApi.php | 20 +++---- src/Api/SpotApi.php | 78 +++++++++++++++++++++---- src/Configuration.php | 6 +- 8 files changed, 203 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index 4aaa29f..1bdf142 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.22.2 -- Package version: 5.22.2 +- API version: 4.22.3 +- Package version: 5.22.3 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) diff --git a/composer.json b/composer.json index 9feebc3..9b28dd5 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.22.2", + "version": "5.22.3", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index b6cca6d..d168703 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c7fce2a784f01818fd2bd59afa355ba9", + "content-hash": "2a0ac037f146224d2a1e6e941e262200", "packages": [ { "name": "guzzlehttp/guzzle", @@ -85,16 +85,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.4.1", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", - "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "shasum": "", "mirrors": [ { @@ -112,7 +112,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -128,10 +128,25 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle promises library", @@ -140,22 +155,36 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.4.1" + "source": "https://github.com/guzzle/promises/tree/1.5.1" }, - "time": "2021-03-07T09:25:29+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.8.2", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91" + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", "shasum": "", "mirrors": [ { @@ -198,13 +227,34 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" } ], @@ -221,9 +271,23 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.2" + "source": "https://github.com/guzzle/psr7/tree/1.8.3" }, - "time": "2021-04-26T09:17:50+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2021-10-05T13:56:00+00:00" }, { "name": "psr/http-message", @@ -603,16 +667,16 @@ "packages-dev": [ { "name": "composer/semver", - "version": "3.2.5", + "version": "3.2.6", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" + "reference": "83e511e247de329283478496f7a1e114c9517506" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", + "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", + "reference": "83e511e247de329283478496f7a1e114c9517506", "shasum": "", "mirrors": [ { @@ -670,7 +734,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.5" + "source": "https://github.com/composer/semver/tree/3.2.6" }, "funding": [ { @@ -686,7 +750,7 @@ "type": "tidelift" } ], - "time": "2021-05-24T12:41:47+00:00" + "time": "2021-10-25T11:34:17+00:00" }, { "name": "composer/xdebug-handler", @@ -1420,16 +1484,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.2.2", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "", "mirrors": [ { @@ -1446,7 +1510,8 @@ "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.2" + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -1476,22 +1541,22 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" }, - "time": "2020-09-03T19:13:55+00:00" + "time": "2021-10-19T17:43:47+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f" + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30f38bffc6f24293dadd1823936372dfa9e86e2f", - "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "shasum": "", "mirrors": [ { @@ -1532,9 +1597,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" }, - "time": "2021-09-17T15:28:14+00:00" + "time": "2021-10-02T14:08:47+00:00" }, { "name": "phpspec/prophecy", diff --git a/docs/Api/MarginApi.md b/docs/Api/MarginApi.md index b526b26..b4ef42b 100644 --- a/docs/Api/MarginApi.md +++ b/docs/Api/MarginApi.md @@ -290,8 +290,8 @@ $apiInstance = new GateApi\Api\MarginApi( ); $associate_array['currency'] = 'currency_example'; // string | List records related to specified currency only. If specified, `currency_pair` is also required. $associate_array['currency_pair'] = 'currency_pair_example'; // string | List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided -$associate_array['from'] = 56; // int | Time range beginning, default to 7 days before current time -$associate_array['to'] = 56; // int | Time range ending, default to current time +$associate_array['from'] = 1627706330; // int | Start timestamp of the query +$associate_array['to'] = 1635329650; // int | Time range ending, default to current time $associate_array['page'] = 1; // int | Page number $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list @@ -315,7 +315,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency** | **string**| List records related to specified currency only. If specified, `currency_pair` is also required. | [optional] **currency_pair** | **string**| List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided | [optional] - **from** | **int**| Time range beginning, default to 7 days before current time | [optional] + **from** | **int**| Start timestamp of the query | [optional] **to** | **int**| Time range ending, default to current time | [optional] **page** | **int**| Page number | [optional] [default to 1] **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] @@ -1537,8 +1537,8 @@ $apiInstance = new GateApi\Api\MarginApi( $config ); $associate_array['currency'] = 'currency_example'; // string | Filter by currency -$associate_array['from'] = 56; // int | Time range beginning, default to 7 days before current time -$associate_array['to'] = 56; // int | Time range ending, default to current time +$associate_array['from'] = 1627706330; // int | Start timestamp of the query +$associate_array['to'] = 1635329650; // int | Time range ending, default to current time $associate_array['page'] = 1; // int | Page number $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['type'] = 'borrow'; // string | Only retrieve changes of the specified type. All types will be returned if not specified. @@ -1562,7 +1562,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency** | **string**| Filter by currency | [optional] - **from** | **int**| Time range beginning, default to 7 days before current time | [optional] + **from** | **int**| Start timestamp of the query | [optional] **to** | **int**| Time range ending, default to current time | [optional] **page** | **int**| Page number | [optional] [default to 1] **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] diff --git a/docs/Api/SpotApi.md b/docs/Api/SpotApi.md index 574547d..c5fa2a6 100644 --- a/docs/Api/SpotApi.md +++ b/docs/Api/SpotApi.md @@ -374,10 +374,12 @@ No authorization required ## listTrades -> \GateApi\Model\Trade[] listTrades($currency_pair, $limit, $last_id, $reverse) +> \GateApi\Model\Trade[] listTrades($currency_pair, $limit, $last_id, $reverse, $from, $to, $page) Retrieve market trades +You can use `from` and `to` to query by time range, or use `last_id` by scrolling page. The default behavior is by time range. Scrolling query using `last_id` is not recommended any more. If `last_id` is specified, time range query parameters will be ignored. + ### Example ```php @@ -394,6 +396,9 @@ $associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['last_id'] = '12345'; // string | Specify list staring point using the `id` of last record in previous list-query results $associate_array['reverse'] = false; // bool | Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. +$associate_array['from'] = 1627706330; // int | Start timestamp of the query +$associate_array['to'] = 1635329650; // int | Time range ending, default to current time +$associate_array['page'] = 1; // int | Page number try { $result = $apiInstance->listTrades($associate_array); @@ -417,6 +422,9 @@ Name | Type | Description | Notes **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **last_id** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] **reverse** | **bool**| Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. | [optional] [default to false] + **from** | **int**| Start timestamp of the query | [optional] + **to** | **int**| Time range ending, default to current time | [optional] + **page** | **int**| Page number | [optional] [default to 1] ### Return type @@ -789,8 +797,8 @@ $associate_array['status'] = 'open'; // string | List orders based on status `o $associate_array['page'] = 1; // int | Page number $associate_array['limit'] = 100; // int | Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 $associate_array['account'] = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account -$associate_array['from'] = 56; // int | Time range beginning, default to 7 days before current time -$associate_array['to'] = 56; // int | Time range ending, default to current time +$associate_array['from'] = 1627706330; // int | Start timestamp of the query +$associate_array['to'] = 1635329650; // int | Time range ending, default to current time $associate_array['side'] = 'sell'; // string | All bids or asks. Both included if not specified try { @@ -816,7 +824,7 @@ Name | Type | Description | Notes **page** | **int**| Page number | [optional] [default to 1] **limit** | **int**| Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 | [optional] [default to 100] **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] - **from** | **int**| Time range beginning, default to 7 days before current time | [optional] + **from** | **int**| Start timestamp of the query | [optional] **to** | **int**| Time range ending, default to current time | [optional] **side** | **string**| All bids or asks. Both included if not specified | [optional] @@ -1189,8 +1197,8 @@ $associate_array['limit'] = 100; // int | Maximum number of records to be return $associate_array['page'] = 1; // int | Page number $associate_array['order_id'] = '12345'; // string | Filter trades with specified order ID. `currency_pair` is also required if this field is present $associate_array['account'] = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account -$associate_array['from'] = 56; // int | Time range beginning, default to 7 days before current time -$associate_array['to'] = 56; // int | Time range ending, default to current time +$associate_array['from'] = 1627706330; // int | Start timestamp of the query +$associate_array['to'] = 1635329650; // int | Time range ending, default to current time try { $result = $apiInstance->listMyTrades($associate_array); @@ -1215,7 +1223,7 @@ Name | Type | Description | Notes **page** | **int**| Page number | [optional] [default to 1] **order_id** | **string**| Filter trades with specified order ID. `currency_pair` is also required if this field is present | [optional] **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] - **from** | **int**| Time range beginning, default to 7 days before current time | [optional] + **from** | **int**| Start timestamp of the query | [optional] **to** | **int**| Time range ending, default to current time | [optional] ### Return type diff --git a/src/Api/MarginApi.php b/src/Api/MarginApi.php index e13fdf6..5b52763 100644 --- a/src/Api/MarginApi.php +++ b/src/Api/MarginApi.php @@ -1061,7 +1061,7 @@ protected function listMarginAccountsRequest($associative_array) * * @param string $currency List records related to specified currency only. If specified, `currency_pair` is also required. (optional) * @param string $currency_pair List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -1085,7 +1085,7 @@ public function listMarginAccountBook($associative_array) * * @param string $currency List records related to specified currency only. If specified, `currency_pair` is also required. (optional) * @param string $currency_pair List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -1146,7 +1146,7 @@ public function listMarginAccountBookWithHttpInfo($associative_array) * * @param string $currency List records related to specified currency only. If specified, `currency_pair` is also required. (optional) * @param string $currency_pair List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -1173,7 +1173,7 @@ function ($response) { * * @param string $currency List records related to specified currency only. If specified, `currency_pair` is also required. (optional) * @param string $currency_pair List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -1227,7 +1227,7 @@ function ($exception) { * * @param string $currency List records related to specified currency only. If specified, `currency_pair` is also required. (optional) * @param string $currency_pair List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -6342,7 +6342,7 @@ protected function getCrossMarginAccountRequest() * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency Filter by currency (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -6366,7 +6366,7 @@ public function listCrossMarginAccountBook($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency Filter by currency (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -6427,7 +6427,7 @@ public function listCrossMarginAccountBookWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency Filter by currency (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -6454,7 +6454,7 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency Filter by currency (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -6508,7 +6508,7 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency Filter by currency (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) diff --git a/src/Api/SpotApi.php b/src/Api/SpotApi.php index e92edca..ccddbca 100644 --- a/src/Api/SpotApi.php +++ b/src/Api/SpotApi.php @@ -1580,6 +1580,9 @@ protected function listOrderBookRequest($associative_array) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param int $from Start timestamp of the query (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $page Page number (optional, default to 1) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1602,6 +1605,9 @@ public function listTrades($associative_array) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param int $from Start timestamp of the query (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $page Page number (optional, default to 1) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1661,6 +1667,9 @@ public function listTradesWithHttpInfo($associative_array) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param int $from Start timestamp of the query (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $page Page number (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1686,6 +1695,9 @@ function ($response) { * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param int $from Start timestamp of the query (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $page Page number (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1738,6 +1750,9 @@ function ($exception) { * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param int $from Start timestamp of the query (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $page Page number (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1749,6 +1764,9 @@ protected function listTradesRequest($associative_array) $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; $last_id = array_key_exists('last_id', $associative_array) ? $associative_array['last_id'] : null; $reverse = array_key_exists('reverse', $associative_array) ? $associative_array['reverse'] : false; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + $page = array_key_exists('page', $associative_array) ? $associative_array['page'] : 1; // verify the required parameter 'currency_pair' is set if ($currency_pair === null || (is_array($currency_pair) && count($currency_pair) === 0)) { @@ -1763,6 +1781,10 @@ protected function listTradesRequest($associative_array) throw new \InvalidArgumentException('invalid value for "$limit" when calling SpotApi.listTrades, must be bigger than or equal to 1.'); } + if ($page !== null && $page < 1) { + throw new \InvalidArgumentException('invalid value for "$page" when calling SpotApi.listTrades, must be bigger than or equal to 1.'); + } + $resourcePath = '/spot/trades'; $formParams = []; @@ -1819,6 +1841,42 @@ protected function listTradesRequest($associative_array) } } + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // query params + if ($page !== null) { + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } + } + // body params $_tempBody = null; @@ -3255,7 +3313,7 @@ protected function listAllOpenOrdersRequest($associative_array) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param string $side All bids or asks. Both included if not specified (optional) * @@ -3281,7 +3339,7 @@ public function listOrders($associative_array) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param string $side All bids or asks. Both included if not specified (optional) * @@ -3344,7 +3402,7 @@ public function listOrdersWithHttpInfo($associative_array) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param string $side All bids or asks. Both included if not specified (optional) * @@ -3373,7 +3431,7 @@ function ($response) { * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param string $side All bids or asks. Both included if not specified (optional) * @@ -3429,7 +3487,7 @@ function ($exception) { * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param string $side All bids or asks. Both included if not specified (optional) * @@ -4959,7 +5017,7 @@ protected function cancelOrderRequest($order_id, $currency_pair, $account = null * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * * @throws \GateApi\ApiException on non-2xx response @@ -4984,7 +5042,7 @@ public function listMyTrades($associative_array) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * * @throws \GateApi\ApiException on non-2xx response @@ -5046,7 +5104,7 @@ public function listMyTradesWithHttpInfo($associative_array) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * * @throws \InvalidArgumentException @@ -5074,7 +5132,7 @@ function ($response) { * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * * @throws \InvalidArgumentException @@ -5129,7 +5187,7 @@ function ($exception) { * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) - * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * * @throws \InvalidArgumentException diff --git a/src/Configuration.php b/src/Configuration.php index 06f0140..76d439d 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.22.2/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.22.3/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.22.2' . PHP_EOL; - $report .= ' SDK Package Version: 5.22.2' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.22.3' . PHP_EOL; + $report .= ' SDK Package Version: 5.22.3' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; From 9cc97b968ce8e5298f584c3bcf703317a13c9dd5 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Mon, 1 Nov 2021 14:27:57 +0800 Subject: [PATCH 07/17] fix incorrect data type in SpotPriceTriggeredOrder --- README.md | 4 ++-- composer.json | 2 +- composer.lock | 26 +++++++++++++------------- docs/Model/SpotPricePutOrder.md | 4 ++-- docs/Model/SpotPriceTriggeredOrder.md | 4 ++-- src/Configuration.php | 6 +++--- src/Model/SpotPricePutOrder.php | 4 ++-- src/Model/SpotPriceTriggeredOrder.php | 16 ++++++++-------- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 1bdf142..19d6ad6 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.22.3 -- Package version: 5.22.3 +- API version: 4.22.4 +- Package version: 5.22.4 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) diff --git a/composer.json b/composer.json index 9b28dd5..7194201 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.22.3", + "version": "5.22.4", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index d168703..8f1061f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2a0ac037f146224d2a1e6e941e262200", + "content-hash": "bad1e83dd34237f13ffbad7b3f6da493", "packages": [ { "name": "guzzlehttp/guzzle", @@ -3131,16 +3131,16 @@ }, { "name": "symfony/console", - "version": "v5.3.7", + "version": "v5.3.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a" + "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a", - "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a", + "url": "https://api.github.com/repos/symfony/console/zipball/d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", + "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", "shasum": "", "mirrors": [ { @@ -3216,7 +3216,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.7" + "source": "https://github.com/symfony/console/tree/v5.3.10" }, "funding": [ { @@ -3232,7 +3232,7 @@ "type": "tidelift" } ], - "time": "2021-08-25T20:02:16+00:00" + "time": "2021-10-26T09:30:15+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4424,16 +4424,16 @@ }, { "name": "symfony/string", - "version": "v5.3.7", + "version": "v5.3.10", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5" + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5", - "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5", + "url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", "shasum": "", "mirrors": [ { @@ -4493,7 +4493,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.7" + "source": "https://github.com/symfony/string/tree/v5.3.10" }, "funding": [ { @@ -4509,7 +4509,7 @@ "type": "tidelift" } ], - "time": "2021-08-26T08:00:08+00:00" + "time": "2021-10-27T18:21:46+00:00" }, { "name": "theseer/tokenizer", diff --git a/docs/Model/SpotPricePutOrder.md b/docs/Model/SpotPricePutOrder.md index f5c5d14..89e5ee0 100644 --- a/docs/Model/SpotPricePutOrder.md +++ b/docs/Model/SpotPricePutOrder.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **side** | **string** | Order side - buy: buy side - sell: sell side | **price** | **string** | Order price | **amount** | **string** | Order amount | -**account** | **string** | Trading type - normal: spot trading - margin: margin trading | -**time_in_force** | **string** | time_in_force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only | [optional] +**account** | **string** | Trading type - normal: spot trading - margin: margin trading | [default to 'normal'] +**time_in_force** | **string** | time_in_force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only | [optional] [default to 'gtc'] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpotPriceTriggeredOrder.md b/docs/Model/SpotPriceTriggeredOrder.md index 5db4d2a..a935e44 100644 --- a/docs/Model/SpotPriceTriggeredOrder.md +++ b/docs/Model/SpotPriceTriggeredOrder.md @@ -9,8 +9,8 @@ Name | Type | Description | Notes **id** | **int** | Auto order ID | [optional] [readonly] **user** | **int** | User ID | [optional] [readonly] **market** | **string** | Currency pair | -**ctime** | **double** | Creation time | [optional] [readonly] -**ftime** | **double** | Finished time | [optional] [readonly] +**ctime** | **int** | Creation time | [optional] [readonly] +**ftime** | **int** | Finished time | [optional] [readonly] **fired_order_id** | **int** | ID of the newly created order on condition triggered | [optional] [readonly] **status** | **string** | Status - open: open - cancelled: being manually cancelled - finish: successfully executed - failed: failed to execute - expired - expired | [optional] [readonly] **reason** | **string** | Additional remarks on how the order was finished | [optional] [readonly] diff --git a/src/Configuration.php b/src/Configuration.php index 76d439d..c511710 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.22.3/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.22.4/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.22.3' . PHP_EOL; - $report .= ' SDK Package Version: 5.22.3' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.22.4' . PHP_EOL; + $report .= ' SDK Package Version: 5.22.4' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/SpotPricePutOrder.php b/src/Model/SpotPricePutOrder.php index 7b30c26..f1f82b8 100644 --- a/src/Model/SpotPricePutOrder.php +++ b/src/Model/SpotPricePutOrder.php @@ -248,8 +248,8 @@ public function __construct(array $data = null) $this->container['side'] = isset($data['side']) ? $data['side'] : null; $this->container['price'] = isset($data['price']) ? $data['price'] : null; $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; - $this->container['account'] = isset($data['account']) ? $data['account'] : null; - $this->container['time_in_force'] = isset($data['time_in_force']) ? $data['time_in_force'] : null; + $this->container['account'] = isset($data['account']) ? $data['account'] : 'normal'; + $this->container['time_in_force'] = isset($data['time_in_force']) ? $data['time_in_force'] : 'gtc'; } /** diff --git a/src/Model/SpotPriceTriggeredOrder.php b/src/Model/SpotPriceTriggeredOrder.php index 2025873..6e79f8e 100644 --- a/src/Model/SpotPriceTriggeredOrder.php +++ b/src/Model/SpotPriceTriggeredOrder.php @@ -60,8 +60,8 @@ class SpotPriceTriggeredOrder implements ModelInterface, ArrayAccess 'id' => 'int', 'user' => 'int', 'market' => 'string', - 'ctime' => 'double', - 'ftime' => 'double', + 'ctime' => 'int', + 'ftime' => 'int', 'fired_order_id' => 'int', 'status' => 'string', 'reason' => 'string' @@ -78,8 +78,8 @@ class SpotPriceTriggeredOrder implements ModelInterface, ArrayAccess 'id' => 'int64', 'user' => null, 'market' => null, - 'ctime' => 'double', - 'ftime' => 'double', + 'ctime' => 'int64', + 'ftime' => 'int64', 'fired_order_id' => 'int64', 'status' => null, 'reason' => null @@ -388,7 +388,7 @@ public function setMarket($market) /** * Gets ctime * - * @return double|null + * @return int|null */ public function getCtime() { @@ -398,7 +398,7 @@ public function getCtime() /** * Sets ctime * - * @param double|null $ctime Creation time + * @param int|null $ctime Creation time * * @return $this */ @@ -412,7 +412,7 @@ public function setCtime($ctime) /** * Gets ftime * - * @return double|null + * @return int|null */ public function getFtime() { @@ -422,7 +422,7 @@ public function getFtime() /** * Sets ftime * - * @param double|null $ftime Finished time + * @param int|null $ftime Finished time * * @return $this */ From 7029327fe445ca5b718ac5e368889756df4f735f Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Fri, 10 Dec 2021 16:39:10 +0800 Subject: [PATCH 08/17] add options API and currency chains API --- .php-cs-fixer.php | 24 + README.md | 40 +- composer.json | 2 +- composer.lock | 858 ++-- docs/Api/OptionsApi.md | 1460 ++++++ docs/Api/WalletApi.md | 61 +- docs/Model/CurrencyChain.md | 12 + docs/Model/LedgerRecord.md | 2 +- docs/Model/OptionsAccount.md | 18 + docs/Model/OptionsAccountBook.md | 13 + docs/Model/OptionsContract.md | 33 + docs/Model/OptionsMyTrade.md | 16 + docs/Model/OptionsOrder.md | 30 + docs/Model/OptionsPosition.md | 17 + docs/Model/OptionsPositionClose.md | 14 + docs/Model/OptionsSettlement.md | 14 + docs/Model/OptionsTicker.md | 26 + docs/Model/OptionsUnderlying.md | 10 + docs/Model/OptionsUnderlyingTicker.md | 11 + src/Api/OptionsApi.php | 6545 +++++++++++++++++++++++++ src/Api/WalletApi.php | 240 + src/Configuration.php | 6 +- src/Model/CurrencyChain.php | 394 ++ src/Model/LedgerRecord.php | 10 +- src/Model/OptionsAccount.php | 574 +++ src/Model/OptionsAccountBook.php | 424 ++ src/Model/OptionsContract.php | 1025 ++++ src/Model/OptionsMyTrade.php | 546 +++ src/Model/OptionsOrder.php | 1051 ++++ src/Model/OptionsPosition.php | 545 ++ src/Model/OptionsPositionClose.php | 486 ++ src/Model/OptionsSettlement.php | 454 ++ src/Model/OptionsTicker.php | 815 +++ src/Model/OptionsUnderlying.php | 334 ++ src/Model/OptionsUnderlyingTicker.php | 365 ++ src/Model/Transfer.php | 6 +- 36 files changed, 15894 insertions(+), 587 deletions(-) create mode 100644 .php-cs-fixer.php create mode 100644 docs/Api/OptionsApi.md create mode 100644 docs/Model/CurrencyChain.md create mode 100644 docs/Model/OptionsAccount.md create mode 100644 docs/Model/OptionsAccountBook.md create mode 100644 docs/Model/OptionsContract.md create mode 100644 docs/Model/OptionsMyTrade.md create mode 100644 docs/Model/OptionsOrder.md create mode 100644 docs/Model/OptionsPosition.md create mode 100644 docs/Model/OptionsPositionClose.md create mode 100644 docs/Model/OptionsSettlement.md create mode 100644 docs/Model/OptionsTicker.md create mode 100644 docs/Model/OptionsUnderlying.md create mode 100644 docs/Model/OptionsUnderlyingTicker.md create mode 100644 src/Api/OptionsApi.php create mode 100644 src/Model/CurrencyChain.php create mode 100644 src/Model/OptionsAccount.php create mode 100644 src/Model/OptionsAccountBook.php create mode 100644 src/Model/OptionsContract.php create mode 100644 src/Model/OptionsMyTrade.php create mode 100644 src/Model/OptionsOrder.php create mode 100644 src/Model/OptionsPosition.php create mode 100644 src/Model/OptionsPositionClose.php create mode 100644 src/Model/OptionsSettlement.php create mode 100644 src/Model/OptionsTicker.php create mode 100644 src/Model/OptionsUnderlying.php create mode 100644 src/Model/OptionsUnderlyingTicker.php diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..9c79484 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,24 @@ +setUsingCache(true) + ->setRules([ + '@PSR2' => true, + 'ordered_imports' => true, + 'phpdoc_order' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'strict_comparison' => true, + 'strict_param' => true, + 'no_trailing_whitespace' => false, + 'no_trailing_whitespace_in_comment' => false, + 'braces' => false, + 'single_blank_line_at_eof' => false, + 'blank_line_after_namespace' => false, + ]) + ->setRiskyAllowed(true) + ->setFinder( + PhpCsFixer\Finder::create() + ->exclude('test') + ->exclude('tests') + ->in(__DIR__) + ); diff --git a/README.md b/README.md index 19d6ad6..5bcd1fa 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.22.4 -- Package version: 5.22.4 +- API version: 4.23.0 +- Package version: 5.23.0 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) @@ -191,6 +191,29 @@ Class | Method | HTTP request | Description *MarginApi* | [**repayCrossMarginLoan**](docs/Api/MarginApi.md#repaycrossmarginloan) | **POST** /margin/cross/repayments | Repay cross margin loan *MarginApi* | [**getCrossMarginTransferable**](docs/Api/MarginApi.md#getcrossmargintransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency *MarginApi* | [**getCrossMarginBorrowable**](docs/Api/MarginApi.md#getcrossmarginborrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency +*OptionsApi* | [**listOptionsUnderlyings**](docs/Api/OptionsApi.md#listoptionsunderlyings) | **GET** /options/underlyings | List all underlyings +*OptionsApi* | [**listOptionsExpirations**](docs/Api/OptionsApi.md#listoptionsexpirations) | **GET** /options/expirations | List all expiration times +*OptionsApi* | [**listOptionsContracts**](docs/Api/OptionsApi.md#listoptionscontracts) | **GET** /options/contracts | List all the contracts with specified underlying and expiration time +*OptionsApi* | [**getOptionsContract**](docs/Api/OptionsApi.md#getoptionscontract) | **GET** /options/contracts/{contract} | Query specified contract detail +*OptionsApi* | [**listOptionsSettlements**](docs/Api/OptionsApi.md#listoptionssettlements) | **GET** /options/settlements | List settlement history +*OptionsApi* | [**getOptionsSettlement**](docs/Api/OptionsApi.md#getoptionssettlement) | **GET** /options/settlements/{contract} | Get specified contract's settlement +*OptionsApi* | [**listOptionsOrderBook**](docs/Api/OptionsApi.md#listoptionsorderbook) | **GET** /options/order_book | Futures order book +*OptionsApi* | [**listOptionsTickers**](docs/Api/OptionsApi.md#listoptionstickers) | **GET** /options/tickers | List tickers of options contracts +*OptionsApi* | [**listOptionsUnderlyingTickers**](docs/Api/OptionsApi.md#listoptionsunderlyingtickers) | **GET** /options/underlying/tickers/{underlying} | Get underlying ticker +*OptionsApi* | [**listOptionsCandlesticks**](docs/Api/OptionsApi.md#listoptionscandlesticks) | **GET** /options/candlesticks | Get futures candlesticks +*OptionsApi* | [**listOptionsUnderlyingCandlesticks**](docs/Api/OptionsApi.md#listoptionsunderlyingcandlesticks) | **GET** /options/underlying/candlesticks | Mark price candlesticks of an underlying +*OptionsApi* | [**listOptionsTrades**](docs/Api/OptionsApi.md#listoptionstrades) | **GET** /options/trades | Options trade history +*OptionsApi* | [**listOptionsAccount**](docs/Api/OptionsApi.md#listoptionsaccount) | **GET** /options/accounts | List options account +*OptionsApi* | [**listOptionsAccountBook**](docs/Api/OptionsApi.md#listoptionsaccountbook) | **GET** /options/account_book | List account changing history +*OptionsApi* | [**listOptionsPositions**](docs/Api/OptionsApi.md#listoptionspositions) | **GET** /options/positions | List user's positions of specified underlying +*OptionsApi* | [**getOptionsPosition**](docs/Api/OptionsApi.md#getoptionsposition) | **GET** /options/positions/{contract} | Get specified contract position +*OptionsApi* | [**listOptionsPositionClose**](docs/Api/OptionsApi.md#listoptionspositionclose) | **GET** /options/position_close | List user's liquidation history of specified underlying +*OptionsApi* | [**listOptionsOrders**](docs/Api/OptionsApi.md#listoptionsorders) | **GET** /options/orders | List futures orders +*OptionsApi* | [**createOptionsOrder**](docs/Api/OptionsApi.md#createoptionsorder) | **POST** /options/orders | Create an options order +*OptionsApi* | [**cancelOptionsOrders**](docs/Api/OptionsApi.md#canceloptionsorders) | **DELETE** /options/orders | Cancel all `open` orders matched +*OptionsApi* | [**getOptionsOrder**](docs/Api/OptionsApi.md#getoptionsorder) | **GET** /options/orders/{order_id} | Get a single order +*OptionsApi* | [**cancelOptionsOrder**](docs/Api/OptionsApi.md#canceloptionsorder) | **DELETE** /options/orders/{order_id} | Cancel a single order +*OptionsApi* | [**listMyOptionsTrades**](docs/Api/OptionsApi.md#listmyoptionstrades) | **GET** /options/my_trades | List personal trading history *SpotApi* | [**listCurrencies**](docs/Api/SpotApi.md#listcurrencies) | **GET** /spot/currencies | List all currencies' details *SpotApi* | [**getCurrency**](docs/Api/SpotApi.md#getcurrency) | **GET** /spot/currencies/{currency} | Get details of a specific currency *SpotApi* | [**listCurrencyPairs**](docs/Api/SpotApi.md#listcurrencypairs) | **GET** /spot/currency_pairs | List all currency pairs supported @@ -215,6 +238,7 @@ Class | Method | HTTP request | Description *SpotApi* | [**cancelSpotPriceTriggeredOrderList**](docs/Api/SpotApi.md#cancelspotpricetriggeredorderlist) | **DELETE** /spot/price_orders | Cancel all open orders *SpotApi* | [**getSpotPriceTriggeredOrder**](docs/Api/SpotApi.md#getspotpricetriggeredorder) | **GET** /spot/price_orders/{order_id} | Get a single order *SpotApi* | [**cancelSpotPriceTriggeredOrder**](docs/Api/SpotApi.md#cancelspotpricetriggeredorder) | **DELETE** /spot/price_orders/{order_id} | Cancel a single order +*WalletApi* | [**listCurrencyChains**](docs/Api/WalletApi.md#listcurrencychains) | **GET** /wallet/currency_chains | List chains supported for specified currency *WalletApi* | [**getDepositAddress**](docs/Api/WalletApi.md#getdepositaddress) | **GET** /wallet/deposit_address | Generate currency deposit address *WalletApi* | [**listWithdrawals**](docs/Api/WalletApi.md#listwithdrawals) | **GET** /wallet/withdrawals | Retrieve withdrawal records *WalletApi* | [**listDeposits**](docs/Api/WalletApi.md#listdeposits) | **GET** /wallet/deposits | Retrieve deposit records @@ -248,6 +272,7 @@ Class | Method | HTTP request | Description - [CrossMarginRepayment](docs/Model/CrossMarginRepayment.md) - [CrossMarginTransferable](docs/Model/CrossMarginTransferable.md) - [Currency](docs/Model/Currency.md) + - [CurrencyChain](docs/Model/CurrencyChain.md) - [CurrencyPair](docs/Model/CurrencyPair.md) - [DeliveryContract](docs/Model/DeliveryContract.md) - [DeliverySettlement](docs/Model/DeliverySettlement.md) @@ -281,6 +306,17 @@ Class | Method | HTTP request | Description - [MultiChainAddressItem](docs/Model/MultiChainAddressItem.md) - [MyFuturesTrade](docs/Model/MyFuturesTrade.md) - [OpenOrders](docs/Model/OpenOrders.md) + - [OptionsAccount](docs/Model/OptionsAccount.md) + - [OptionsAccountBook](docs/Model/OptionsAccountBook.md) + - [OptionsContract](docs/Model/OptionsContract.md) + - [OptionsMyTrade](docs/Model/OptionsMyTrade.md) + - [OptionsOrder](docs/Model/OptionsOrder.md) + - [OptionsPosition](docs/Model/OptionsPosition.md) + - [OptionsPositionClose](docs/Model/OptionsPositionClose.md) + - [OptionsSettlement](docs/Model/OptionsSettlement.md) + - [OptionsTicker](docs/Model/OptionsTicker.md) + - [OptionsUnderlying](docs/Model/OptionsUnderlying.md) + - [OptionsUnderlyingTicker](docs/Model/OptionsUnderlyingTicker.md) - [Order](docs/Model/Order.md) - [OrderBook](docs/Model/OrderBook.md) - [Position](docs/Model/Position.md) diff --git a/composer.json b/composer.json index 7194201..3b04777 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.22.4", + "version": "5.23.0", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index 8f1061f..ea77c39 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bad1e83dd34237f13ffbad7b3f6da493", + "content-hash": "e3771b773520cddd3910a140489238f5", "packages": [ { "name": "guzzlehttp/guzzle", @@ -18,13 +18,7 @@ "type": "zip", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-json": "*", @@ -95,13 +89,7 @@ "type": "zip", "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.5" @@ -185,13 +173,7 @@ "type": "zip", "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.4.0", @@ -301,13 +283,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.3.0" @@ -360,13 +336,7 @@ "type": "zip", "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.6" @@ -410,13 +380,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/65bd267525e82759e7d8c4e8ceea44f398838e65", "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1", @@ -503,13 +467,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -593,13 +551,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -665,6 +617,77 @@ } ], "packages-dev": [ + { + "name": "composer/pcre", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2", + "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/1.0.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-12-06T15:17:27+00:00" + }, { "name": "composer/semver", "version": "3.2.6", @@ -677,13 +700,7 @@ "type": "zip", "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", "reference": "83e511e247de329283478496f7a1e114c9517506", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" @@ -754,31 +771,27 @@ }, { "name": "composer/xdebug-handler", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" + "reference": "6555461e76962fd0379c444c46fd558a0fcfb65e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6555461e76962fd0379c444c46fd558a0fcfb65e", + "reference": "6555461e76962fd0379c444c46fd558a0fcfb65e", + "shasum": "" }, "require": { + "composer/pcre": "^1", "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" }, "type": "library", "autoload": { @@ -804,7 +817,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.3" }, "funding": [ { @@ -820,7 +833,7 @@ "type": "tidelift" } ], - "time": "2021-07-31T17:03:58+00:00" + "time": "2021-12-08T13:07:32+00:00" }, { "name": "doctrine/annotations", @@ -834,13 +847,7 @@ "type": "zip", "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", "reference": "5b668aef16090008790395c02c893b1ba13f7e08", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "doctrine/lexer": "1.*", @@ -912,13 +919,7 @@ "type": "zip", "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.1 || ^8.0" @@ -987,13 +988,7 @@ "type": "zip", "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.2 || ^8.0" @@ -1063,23 +1058,17 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.19.2", + "version": "v2.19.3", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "d5c737c2e18ba502b75b44832b31fe627f82e307" + "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/d5c737c2e18ba502b75b44832b31fe627f82e307", - "reference": "d5c737c2e18ba502b75b44832b31fe627f82e307", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/75ac86f33fab4714ea5a39a396784d83ae3b5ed8", + "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8", + "shasum": "" }, "require": { "composer/semver": "^1.4 || ^2.0 || ^3.0", @@ -1166,7 +1155,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.2" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.3" }, "funding": [ { @@ -1174,7 +1163,7 @@ "type": "github" } ], - "time": "2021-08-18T19:55:46+00:00" + "time": "2021-11-15T17:17:55+00:00" }, { "name": "myclabs/deep-copy", @@ -1188,13 +1177,7 @@ "type": "zip", "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.1 || ^8.0" @@ -1252,13 +1235,7 @@ "type": "zip", "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-dom": "*", @@ -1317,13 +1294,7 @@ "type": "zip", "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^5.6 || ^7.0" @@ -1374,13 +1345,7 @@ "type": "zip", "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^5.6 || ^7.0 || ^8.0" @@ -1435,13 +1400,7 @@ "type": "zip", "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.2 || ^8.0" @@ -1494,13 +1453,7 @@ "type": "zip", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-filter": "*", @@ -1557,13 +1510,7 @@ "type": "zip", "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.2 || ^8.0", @@ -1603,23 +1550,17 @@ }, { "name": "phpspec/prophecy", - "version": "1.14.0", + "version": "v1.15.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", - "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", @@ -1670,9 +1611,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.14.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" }, - "time": "2021-09-10T09:02:12+00:00" + "time": "2021-12-08T12:19:24+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1686,13 +1627,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-dom": "*", @@ -1749,23 +1684,17 @@ }, { "name": "phpunit/php-file-iterator", - "version": "2.0.4", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "28af674ff175d0768a5a978e6de83f697d4a7f05" + "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/28af674ff175d0768a5a978e6de83f697d4a7f05", - "reference": "28af674ff175d0768a5a978e6de83f697d4a7f05", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", + "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", + "shasum": "" }, "require": { "php": ">=7.1" @@ -1803,7 +1732,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.5" }, "funding": [ { @@ -1811,7 +1740,7 @@ "type": "github" } ], - "time": "2021-07-19T06:46:01+00:00" + "time": "2021-12-02T12:42:26+00:00" }, { "name": "phpunit/php-text-template", @@ -1825,13 +1754,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.3.3" @@ -1876,13 +1799,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -1941,13 +1858,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768", "reference": "9c1da83261628cb24b6a6df371b6e312b3954768", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-tokenizer": "*", @@ -2007,13 +1918,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "doctrine/instantiator": "^1.1", @@ -2101,13 +2006,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.3.0" @@ -2146,26 +2045,20 @@ }, { "name": "psr/container", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", "autoload": { @@ -2194,9 +2087,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { "name": "psr/event-dispatcher", @@ -2210,13 +2103,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.2.0" @@ -2266,13 +2153,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", "reference": "d49695b909c3b7628b6289db5479a1c204601f11", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.3.0" @@ -2322,13 +2203,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.6" @@ -2383,13 +2258,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1", @@ -2463,13 +2332,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -2535,13 +2398,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -2594,23 +2451,17 @@ }, { "name": "sebastian/exporter", - "version": "3.1.3", + "version": "3.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e" + "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/6b853149eab67d4da22291d36f5b0631c0fd856e", - "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", + "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", + "shasum": "" }, "require": { "php": ">=7.0", @@ -2618,7 +2469,7 @@ }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { @@ -2665,7 +2516,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.3" + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.4" }, "funding": [ { @@ -2673,7 +2524,7 @@ "type": "github" } ], - "time": "2020-11-30T07:47:53+00:00" + "time": "2021-11-11T13:51:24+00:00" }, { "name": "sebastian/global-state", @@ -2687,13 +2538,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.0" @@ -2748,13 +2593,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.0", @@ -2811,13 +2650,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.0" @@ -2872,13 +2705,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.0" @@ -2941,13 +2768,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -2999,13 +2820,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.6" @@ -3052,13 +2867,7 @@ "type": "zip", "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", "reference": "2acf168de78487db620ab4bc524135a13cfe6745", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-simplexml": "*", @@ -3131,32 +2940,26 @@ }, { "name": "symfony/console", - "version": "v5.3.10", + "version": "v5.4.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3" + "reference": "9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", - "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/console/zipball/9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4", + "reference": "9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4", + "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php73": "^1.9", "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2", - "symfony/string": "^5.1" + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" }, "conflict": { "psr/log": ">=3", @@ -3171,12 +2974,12 @@ }, "require-dev": { "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -3216,7 +3019,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.10" + "source": "https://github.com/symfony/console/tree/v5.4.1" }, "funding": [ { @@ -3232,27 +3035,21 @@ "type": "tidelift" } ], - "time": "2021-10-26T09:30:15+00:00" + "time": "2021-12-09T11:22:43+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "shasum": "" }, "require": { "php": ">=7.1" @@ -3260,7 +3057,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -3289,7 +3086,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" }, "funding": [ { @@ -3305,32 +3102,26 @@ "type": "tidelift" } ], - "time": "2021-03-23T23:28:01+00:00" + "time": "2021-07-12T14:48:14+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.3.7", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "ce7b20d69c66a20939d8952b617506a44d102130" + "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ce7b20d69c66a20939d8952b617506a44d102130", - "reference": "ce7b20d69c66a20939d8952b617506a44d102130", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/27d39ae126352b9fa3be5e196ccf4617897be3eb", + "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb", + "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/event-dispatcher-contracts": "^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/event-dispatcher-contracts": "^2|^3", "symfony/polyfill-php80": "^1.16" }, "conflict": { @@ -3342,13 +3133,13 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/error-handler": "^4.4|^5.0", - "symfony/expression-language": "^4.4|^5.0", - "symfony/http-foundation": "^4.4|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/stopwatch": "^4.4|^5.0" + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^4.4|^5.0|^6.0" }, "suggest": { "symfony/dependency-injection": "", @@ -3380,7 +3171,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.3.7" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.0" }, "funding": [ { @@ -3396,27 +3187,21 @@ "type": "tidelift" } ], - "time": "2021-08-04T21:20:46+00:00" + "time": "2021-11-23T10:19:22+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "69fee1ad2332a7cbab3aca13591953da9cdb7a11" + "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/69fee1ad2332a7cbab3aca13591953da9cdb7a11", - "reference": "69fee1ad2332a7cbab3aca13591953da9cdb7a11", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "shasum": "" }, "require": { "php": ">=7.2.5", @@ -3428,7 +3213,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -3465,7 +3250,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0" }, "funding": [ { @@ -3481,31 +3266,26 @@ "type": "tidelift" } ], - "time": "2021-03-23T23:28:01+00:00" + "time": "2021-07-12T14:48:14+00:00" }, { "name": "symfony/filesystem", - "version": "v5.3.4", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32" + "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/343f4fe324383ca46792cae728a3b6e2f708fb32", - "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/filesystem/zipball/731f917dc31edcffec2c6a777f3698c33bea8f01", + "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01", + "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", "symfony/polyfill-php80": "^1.16" }, "type": "library", @@ -3534,7 +3314,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.3.4" + "source": "https://github.com/symfony/filesystem/tree/v5.4.0" }, "funding": [ { @@ -3550,30 +3330,25 @@ "type": "tidelift" } ], - "time": "2021-07-21T12:40:44+00:00" + "time": "2021-10-28T13:39:27+00:00" }, { "name": "symfony/finder", - "version": "v5.3.7", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93" + "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a10000ada1e600d109a6c7632e9ac42e8bf2fb93", - "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/finder/zipball/d2f29dac98e96a98be467627bd49c2efb1bc2590", + "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590", + "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php80": "^1.16" }, "type": "library", @@ -3602,7 +3377,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.3.7" + "source": "https://github.com/symfony/finder/tree/v5.4.0" }, "funding": [ { @@ -3618,31 +3393,25 @@ "type": "tidelift" } ], - "time": "2021-08-04T21:20:46+00:00" + "time": "2021-11-28T15:25:38+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.3.7", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "4b78e55b179003a42523a362cc0e8327f7a69b5e" + "reference": "b0fb78576487af19c500aaddb269fd36701d4847" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4b78e55b179003a42523a362cc0e8327f7a69b5e", - "reference": "4b78e55b179003a42523a362cc0e8327f7a69b5e", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b0fb78576487af19c500aaddb269fd36701d4847", + "reference": "b0fb78576487af19c500aaddb269fd36701d4847", + "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php73": "~1.0", "symfony/polyfill-php80": "^1.16" }, @@ -3677,7 +3446,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.3.7" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.0" }, "funding": [ { @@ -3693,7 +3462,7 @@ "type": "tidelift" } ], - "time": "2021-08-04T21:20:46+00:00" + "time": "2021-11-23T10:19:22+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3707,13 +3476,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -3792,13 +3555,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -3879,13 +3636,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -3965,13 +3716,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -4039,13 +3784,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -4124,13 +3863,7 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.1" @@ -4203,23 +3936,17 @@ }, { "name": "symfony/process", - "version": "v5.3.7", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967" + "reference": "5be20b3830f726e019162b26223110c8f47cf274" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/38f26c7d6ed535217ea393e05634cb0b244a1967", - "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/process/zipball/5be20b3830f726e019162b26223110c8f47cf274", + "reference": "5be20b3830f726e019162b26223110c8f47cf274", + "shasum": "" }, "require": { "php": ">=7.2.5", @@ -4251,7 +3978,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.3.7" + "source": "https://github.com/symfony/process/tree/v5.4.0" }, "funding": [ { @@ -4267,31 +3994,29 @@ "type": "tidelift" } ], - "time": "2021-08-04T21:20:46+00:00" + "time": "2021-11-28T15:25:38+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/container": "^1.1" + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "ext-psr": "<1.1|>=2" }, "suggest": { "symfony/service-implementation": "" @@ -4299,7 +4024,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -4336,7 +4061,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" }, "funding": [ { @@ -4352,31 +4077,25 @@ "type": "tidelift" } ], - "time": "2021-04-01T10:43:52+00:00" + "time": "2021-11-04T16:48:04+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.3.4", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "b24c6a92c6db316fee69e38c80591e080e41536c" + "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b24c6a92c6db316fee69e38c80591e080e41536c", - "reference": "b24c6a92c6db316fee69e38c80591e080e41536c", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/208ef96122bfed82a8f3a61458a07113a08bdcfe", + "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe", + "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/service-contracts": "^1.0|^2" + "symfony/service-contracts": "^1|^2|^3" }, "type": "library", "autoload": { @@ -4404,7 +4123,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.3.4" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.0" }, "funding": [ { @@ -4420,27 +4139,21 @@ "type": "tidelift" } ], - "time": "2021-07-10T08:58:57+00:00" + "time": "2021-11-23T10:19:22+00:00" }, { "name": "symfony/string", - "version": "v5.3.10", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c" + "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", - "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/string/zipball/9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", + "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", + "shasum": "" }, "require": { "php": ">=7.2.5", @@ -4450,11 +4163,14 @@ "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php80": "~1.15" }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0", - "symfony/http-client": "^4.4|^5.0", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0" + "symfony/var-exporter": "^4.4|^5.0|^6.0" }, "type": "library", "autoload": { @@ -4493,7 +4209,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.10" + "source": "https://github.com/symfony/string/tree/v5.4.0" }, "funding": [ { @@ -4509,7 +4225,7 @@ "type": "tidelift" } ], - "time": "2021-10-27T18:21:46+00:00" + "time": "2021-11-24T10:02:00+00:00" }, { "name": "theseer/tokenizer", @@ -4523,13 +4239,7 @@ "type": "zip", "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-dom": "*", @@ -4579,13 +4289,7 @@ "type": "zip", "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.2 || ^8.0", @@ -4644,5 +4348,5 @@ "ext-mbstring": "*" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } diff --git a/docs/Api/OptionsApi.md b/docs/Api/OptionsApi.md new file mode 100644 index 0000000..6b88b0b --- /dev/null +++ b/docs/Api/OptionsApi.md @@ -0,0 +1,1460 @@ +# GateApi\OptionsApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**listOptionsUnderlyings**](OptionsApi.md#listOptionsUnderlyings) | **GET** /options/underlyings | List all underlyings +[**listOptionsExpirations**](OptionsApi.md#listOptionsExpirations) | **GET** /options/expirations | List all expiration times +[**listOptionsContracts**](OptionsApi.md#listOptionsContracts) | **GET** /options/contracts | List all the contracts with specified underlying and expiration time +[**getOptionsContract**](OptionsApi.md#getOptionsContract) | **GET** /options/contracts/{contract} | Query specified contract detail +[**listOptionsSettlements**](OptionsApi.md#listOptionsSettlements) | **GET** /options/settlements | List settlement history +[**getOptionsSettlement**](OptionsApi.md#getOptionsSettlement) | **GET** /options/settlements/{contract} | Get specified contract's settlement +[**listOptionsOrderBook**](OptionsApi.md#listOptionsOrderBook) | **GET** /options/order_book | Futures order book +[**listOptionsTickers**](OptionsApi.md#listOptionsTickers) | **GET** /options/tickers | List tickers of options contracts +[**listOptionsUnderlyingTickers**](OptionsApi.md#listOptionsUnderlyingTickers) | **GET** /options/underlying/tickers/{underlying} | Get underlying ticker +[**listOptionsCandlesticks**](OptionsApi.md#listOptionsCandlesticks) | **GET** /options/candlesticks | Get futures candlesticks +[**listOptionsUnderlyingCandlesticks**](OptionsApi.md#listOptionsUnderlyingCandlesticks) | **GET** /options/underlying/candlesticks | Mark price candlesticks of an underlying +[**listOptionsTrades**](OptionsApi.md#listOptionsTrades) | **GET** /options/trades | Options trade history +[**listOptionsAccount**](OptionsApi.md#listOptionsAccount) | **GET** /options/accounts | List options account +[**listOptionsAccountBook**](OptionsApi.md#listOptionsAccountBook) | **GET** /options/account_book | List account changing history +[**listOptionsPositions**](OptionsApi.md#listOptionsPositions) | **GET** /options/positions | List user's positions of specified underlying +[**getOptionsPosition**](OptionsApi.md#getOptionsPosition) | **GET** /options/positions/{contract} | Get specified contract position +[**listOptionsPositionClose**](OptionsApi.md#listOptionsPositionClose) | **GET** /options/position_close | List user's liquidation history of specified underlying +[**listOptionsOrders**](OptionsApi.md#listOptionsOrders) | **GET** /options/orders | List futures orders +[**createOptionsOrder**](OptionsApi.md#createOptionsOrder) | **POST** /options/orders | Create an options order +[**cancelOptionsOrders**](OptionsApi.md#cancelOptionsOrders) | **DELETE** /options/orders | Cancel all `open` orders matched +[**getOptionsOrder**](OptionsApi.md#getOptionsOrder) | **GET** /options/orders/{order_id} | Get a single order +[**cancelOptionsOrder**](OptionsApi.md#cancelOptionsOrder) | **DELETE** /options/orders/{order_id} | Cancel a single order +[**listMyOptionsTrades**](OptionsApi.md#listMyOptionsTrades) | **GET** /options/my_trades | List personal trading history + + +## listOptionsUnderlyings + +> \GateApi\Model\OptionsUnderlying[] listOptionsUnderlyings() + +List all underlyings + +### Example + +```php +listOptionsUnderlyings(); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsUnderlyings: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\GateApi\Model\OptionsUnderlying[]**](../Model/OptionsUnderlying.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsExpirations + +> int[] listOptionsExpirations($underlying) + +List all expiration times + +### Example + +```php +listOptionsExpirations($underlying); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsExpirations: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **string**| Underlying | + +### Return type + +**int[]** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsContracts + +> \GateApi\Model\OptionsContract[] listOptionsContracts($underlying, $expiration) + +List all the contracts with specified underlying and expiration time + +### Example + +```php +listOptionsContracts($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsContracts: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **string**| Underlying | + **expiration** | **int**| Unix timestamp of the expiration time | [optional] + +### Return type + +[**\GateApi\Model\OptionsContract[]**](../Model/OptionsContract.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## getOptionsContract + +> \GateApi\Model\OptionsContract getOptionsContract($contract) + +Query specified contract detail + +### Example + +```php +getOptionsContract($contract); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->getOptionsContract: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **string**| | + +### Return type + +[**\GateApi\Model\OptionsContract**](../Model/OptionsContract.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsSettlements + +> \GateApi\Model\OptionsSettlement[] listOptionsSettlements($underlying, $limit, $offset, $from, $to) + +List settlement history + +### Example + +```php +listOptionsSettlements($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsSettlements: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **string**| Underlying | + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **from** | **int**| Start timestamp | [optional] + **to** | **int**| End timestamp | [optional] + +### Return type + +[**\GateApi\Model\OptionsSettlement[]**](../Model/OptionsSettlement.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## getOptionsSettlement + +> \GateApi\Model\OptionsSettlement getOptionsSettlement($contract, $underlying, $at) + +Get specified contract's settlement + +### Example + +```php +getOptionsSettlement($contract, $underlying, $at); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->getOptionsSettlement: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **string**| | + **underlying** | **string**| Underlying | + **at** | **int**| | + +### Return type + +[**\GateApi\Model\OptionsSettlement**](../Model/OptionsSettlement.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsOrderBook + +> \GateApi\Model\FuturesOrderBook listOptionsOrderBook($contract, $interval, $limit, $with_id) + +Futures order book + +Bids will be sorted by price from high to low, while asks sorted reversely + +### Example + +```php +listOptionsOrderBook($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsOrderBook: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **string**| Futures contract | + **interval** | **string**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0'] + **limit** | **int**| Maximum number of order depth data in asks or bids | [optional] [default to 10] + **with_id** | **bool**| Whether the order book update ID will be returned. This ID increases by 1 on every order book update | [optional] [default to false] + +### Return type + +[**\GateApi\Model\FuturesOrderBook**](../Model/FuturesOrderBook.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsTickers + +> \GateApi\Model\OptionsTicker[] listOptionsTickers($underlying) + +List tickers of options contracts + +### Example + +```php +listOptionsTickers($underlying); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsTickers: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **string**| Underlying | + +### Return type + +[**\GateApi\Model\OptionsTicker[]**](../Model/OptionsTicker.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsUnderlyingTickers + +> \GateApi\Model\OptionsUnderlyingTicker listOptionsUnderlyingTickers($underlying) + +Get underlying ticker + +### Example + +```php +listOptionsUnderlyingTickers($underlying); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsUnderlyingTickers: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **string**| Underlying | + +### Return type + +[**\GateApi\Model\OptionsUnderlyingTicker**](../Model/OptionsUnderlyingTicker.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsCandlesticks + +> \GateApi\Model\FuturesCandlestick[] listOptionsCandlesticks($contract, $limit, $from, $to, $interval) + +Get futures candlesticks + +### Example + +```php +listOptionsCandlesticks($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsCandlesticks: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **string**| Futures contract | + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **from** | **int**| Start timestamp | [optional] + **to** | **int**| End timestamp | [optional] + **interval** | **string**| Interval time between data points | [optional] [default to '5m'] + +### Return type + +[**\GateApi\Model\FuturesCandlestick[]**](../Model/FuturesCandlestick.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsUnderlyingCandlesticks + +> \GateApi\Model\FuturesCandlestick[] listOptionsUnderlyingCandlesticks($underlying, $limit, $from, $to, $interval) + +Mark price candlesticks of an underlying + +### Example + +```php +listOptionsUnderlyingCandlesticks($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsUnderlyingCandlesticks: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **string**| Underlying | + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **from** | **int**| Start timestamp | [optional] + **to** | **int**| End timestamp | [optional] + **interval** | **string**| Interval time between data points | [optional] [default to '5m'] + +### Return type + +[**\GateApi\Model\FuturesCandlestick[]**](../Model/FuturesCandlestick.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsTrades + +> \GateApi\Model\FuturesTrade[] listOptionsTrades($contract, $type, $limit, $offset, $from, $to) + +Options trade history + +### Example + +```php +listOptionsTrades($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsTrades: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **string**| Contract name | [optional] + **type** | **string**| `C` is call, while `P` is put | [optional] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **from** | **int**| Start timestamp | [optional] + **to** | **int**| End timestamp | [optional] + +### Return type + +[**\GateApi\Model\FuturesTrade[]**](../Model/FuturesTrade.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsAccount + +> \GateApi\Model\OptionsAccount listOptionsAccount() + +List options account + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\OptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->listOptionsAccount(); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsAccount: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\GateApi\Model\OptionsAccount**](../Model/OptionsAccount.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsAccountBook + +> \GateApi\Model\OptionsAccountBook[] listOptionsAccountBook($limit, $offset, $from, $to, $type) + +List account changing history + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\OptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['offset'] = 0; // int | List offset, starting from 0 +$associate_array['from'] = 1547706332; // int | Start timestamp +$associate_array['to'] = 1547706332; // int | End timestamp +$associate_array['type'] = 'dnw'; // string | Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: settlement PNL + +try { + $result = $apiInstance->listOptionsAccountBook($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsAccountBook: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **from** | **int**| Start timestamp | [optional] + **to** | **int**| End timestamp | [optional] + **type** | **string**| Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: settlement PNL | [optional] + +### Return type + +[**\GateApi\Model\OptionsAccountBook[]**](../Model/OptionsAccountBook.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsPositions + +> \GateApi\Model\OptionsPosition[] listOptionsPositions($underlying) + +List user's positions of specified underlying + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\OptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying + +try { + $result = $apiInstance->listOptionsPositions($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsPositions: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **string**| Underlying | [optional] + +### Return type + +[**\GateApi\Model\OptionsPosition[]**](../Model/OptionsPosition.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## getOptionsPosition + +> \GateApi\Model\OptionsPosition getOptionsPosition($contract) + +Get specified contract position + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\OptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$contract = 'BTC_USDT-20211130-65000-C'; // string | + +try { + $result = $apiInstance->getOptionsPosition($contract); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->getOptionsPosition: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **string**| | + +### Return type + +[**\GateApi\Model\OptionsPosition**](../Model/OptionsPosition.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsPositionClose + +> \GateApi\Model\OptionsPositionClose[] listOptionsPositionClose($underlying, $contract) + +List user's liquidation history of specified underlying + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\OptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying +$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Contract name + +try { + $result = $apiInstance->listOptionsPositionClose($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsPositionClose: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **string**| Underlying | + **contract** | **string**| Contract name | [optional] + +### Return type + +[**\GateApi\Model\OptionsPositionClose[]**](../Model/OptionsPositionClose.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listOptionsOrders + +> \GateApi\Model\OptionsOrder[] listOptionsOrders($status, $contract, $underlying, $limit, $offset, $from, $to) + +List futures orders + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\OptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['status'] = 'open'; // string | Only list the orders with this status +$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Contract name +$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['offset'] = 0; // int | List offset, starting from 0 +$associate_array['from'] = 1547706332; // int | Start timestamp +$associate_array['to'] = 1547706332; // int | End timestamp + +try { + $result = $apiInstance->listOptionsOrders($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listOptionsOrders: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **string**| Only list the orders with this status | + **contract** | **string**| Contract name | [optional] + **underlying** | **string**| Underlying | [optional] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **from** | **int**| Start timestamp | [optional] + **to** | **int**| End timestamp | [optional] + +### Return type + +[**\GateApi\Model\OptionsOrder[]**](../Model/OptionsOrder.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## createOptionsOrder + +> \GateApi\Model\OptionsOrder createOptionsOrder($options_order) + +Create an options order + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\OptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$options_order = new \GateApi\Model\OptionsOrder(); // \GateApi\Model\OptionsOrder | + +try { + $result = $apiInstance->createOptionsOrder($options_order); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->createOptionsOrder: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **options_order** | [**\GateApi\Model\OptionsOrder**](../Model/OptionsOrder.md)| | + +### Return type + +[**\GateApi\Model\OptionsOrder**](../Model/OptionsOrder.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## cancelOptionsOrders + +> \GateApi\Model\OptionsOrder[] cancelOptionsOrders($contract, $underlying, $side) + +Cancel all `open` orders matched + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\OptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$contract = 'BTC_USDT-20210916-5000-C'; // string | Contract name +$underlying = 'BTC_USDT'; // string | Underlying +$side = 'ask'; // string | All bids or asks. Both included if not specified + +try { + $result = $apiInstance->cancelOptionsOrders($contract, $underlying, $side); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->cancelOptionsOrders: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **string**| Contract name | [optional] + **underlying** | **string**| Underlying | [optional] + **side** | **string**| All bids or asks. Both included if not specified | [optional] + +### Return type + +[**\GateApi\Model\OptionsOrder[]**](../Model/OptionsOrder.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## getOptionsOrder + +> \GateApi\Model\OptionsOrder getOptionsOrder($order_id) + +Get a single order + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\OptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$order_id = 12345; // int | Order ID returned on successful order creation + +try { + $result = $apiInstance->getOptionsOrder($order_id); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->getOptionsOrder: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Order ID returned on successful order creation | + +### Return type + +[**\GateApi\Model\OptionsOrder**](../Model/OptionsOrder.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## cancelOptionsOrder + +> \GateApi\Model\OptionsOrder cancelOptionsOrder($order_id) + +Cancel a single order + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\OptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$order_id = 12345; // int | Order ID returned on successful order creation + +try { + $result = $apiInstance->cancelOptionsOrder($order_id); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->cancelOptionsOrder: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Order ID returned on successful order creation | + +### Return type + +[**\GateApi\Model\OptionsOrder**](../Model/OptionsOrder.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listMyOptionsTrades + +> \GateApi\Model\OptionsMyTrade[] listMyOptionsTrades($underlying, $contract, $limit, $offset, $from, $to) + +List personal trading history + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\OptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying +$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Contract name +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['offset'] = 0; // int | List offset, starting from 0 +$associate_array['from'] = 1547706332; // int | Start timestamp +$associate_array['to'] = 1547706332; // int | End timestamp + +try { + $result = $apiInstance->listMyOptionsTrades($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listMyOptionsTrades: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **string**| Underlying | + **contract** | **string**| Contract name | [optional] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **from** | **int**| Start timestamp | [optional] + **to** | **int**| End timestamp | [optional] + +### Return type + +[**\GateApi\Model\OptionsMyTrade[]**](../Model/OptionsMyTrade.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Api/WalletApi.md b/docs/Api/WalletApi.md index b0d29e8..7c15881 100644 --- a/docs/Api/WalletApi.md +++ b/docs/Api/WalletApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- +[**listCurrencyChains**](WalletApi.md#listCurrencyChains) | **GET** /wallet/currency_chains | List chains supported for specified currency [**getDepositAddress**](WalletApi.md#getDepositAddress) | **GET** /wallet/deposit_address | Generate currency deposit address [**listWithdrawals**](WalletApi.md#listWithdrawals) | **GET** /wallet/withdrawals | Retrieve withdrawal records [**listDeposits**](WalletApi.md#listDeposits) | **GET** /wallet/deposits | Retrieve deposit records @@ -16,6 +17,62 @@ Method | HTTP request | Description [**getTotalBalance**](WalletApi.md#getTotalBalance) | **GET** /wallet/total_balance | Retrieve user's total balances +## listCurrencyChains + +> \GateApi\Model\CurrencyChain[] listCurrencyChains($currency) + +List chains supported for specified currency + +### Example + +```php +listCurrencyChains($currency); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling WalletApi->listCurrencyChains: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **string**| Currency name | + +### Return type + +[**\GateApi\Model\CurrencyChain[]**](../Model/CurrencyChain.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## getDepositAddress > \GateApi\Model\DepositAddress getDepositAddress($currency) @@ -226,7 +283,7 @@ Name | Type | Description | Notes Transfer between trading accounts -Transfer between different accounts. Currently support transfers between the following: 1. spot - margin 2. spot - futures(perpetual) 3. spot - delivery 4. spot - cross margin +Transfer between different accounts. Currently support transfers between the following: 1. spot - margin 2. spot - futures(perpetual) 3. spot - delivery 4. spot - cross margin 5. spot - options ### Example @@ -606,6 +663,8 @@ Name | Type | Description | Notes Retrieve user's total balances +This endpoint returns an approximate sum of exchanged amount from all currencies to input currency for each account.The exchange rate and account balance could have been cached for at most 1 minute. It is not recommended to use its result for any trading calculation. For trading calculation, use the corresponding account query endpoint for each account type. For example: - `GET /spot/accounts` to query spot account balance - `GET /margin/accounts` to query margin account balance - `GET /futures/{settle}/accounts` to query futures account balance + ### Example ```php diff --git a/docs/Model/CurrencyChain.md b/docs/Model/CurrencyChain.md new file mode 100644 index 0000000..5c87f36 --- /dev/null +++ b/docs/Model/CurrencyChain.md @@ -0,0 +1,12 @@ +# # CurrencyChain + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**chain** | **string** | Chain name | [optional] +**name_cn** | **string** | Chain name in Chinese | [optional] +**name_en** | **string** | Chain name in English | [optional] +**is_disabled** | **int** | If it is disabled. 0 means NOT being disabled | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LedgerRecord.md b/docs/Model/LedgerRecord.md index b3ddf46..28c3713 100644 --- a/docs/Model/LedgerRecord.md +++ b/docs/Model/LedgerRecord.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **currency** | **string** | Currency name | **address** | **string** | Withdrawal address. Required for withdrawals | [optional] **memo** | **string** | Additional remarks with regards to the withdrawal | [optional] -**status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail | [optional] [readonly] +**status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending | [optional] [readonly] **chain** | **string** | Name of the chain used in withdrawals | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsAccount.md b/docs/Model/OptionsAccount.md new file mode 100644 index 0000000..7f6e862 --- /dev/null +++ b/docs/Model/OptionsAccount.md @@ -0,0 +1,18 @@ +# # OptionsAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | **int** | User ID | [optional] +**total** | **string** | Total account balance | [optional] +**short_enabled** | **bool** | If the account is allowed to short | [optional] +**unrealised_pnl** | **string** | Unrealized PNL | [optional] +**init_margin** | **string** | Initial position margin | [optional] +**maint_margin** | **string** | Position maintenance margin | [optional] +**order_margin** | **string** | Order margin of unfinished orders | [optional] +**available** | **string** | Available balance to transfer out or trade | [optional] +**point** | **string** | POINT amount | [optional] +**currency** | **string** | Settle currency | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsAccountBook.md b/docs/Model/OptionsAccountBook.md new file mode 100644 index 0000000..e208de0 --- /dev/null +++ b/docs/Model/OptionsAccountBook.md @@ -0,0 +1,13 @@ +# # OptionsAccountBook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **double** | Change time | [optional] +**change** | **string** | Amount changed | [optional] +**balance** | **string** | Account total balance after change | [optional] +**type** | **string** | Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] +**text** | **string** | custom text | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsContract.md b/docs/Model/OptionsContract.md new file mode 100644 index 0000000..db9dcd2 --- /dev/null +++ b/docs/Model/OptionsContract.md @@ -0,0 +1,33 @@ +# # OptionsContract + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Futures contract | [optional] +**tag** | **string** | 标记 | [optional] +**create_time** | **double** | Creation time | [optional] +**expiration_time** | **double** | Expiration time | [optional] +**is_call** | **bool** | `true` means call options, while `false` is put options | [optional] +**multiplier** | **string** | Multiplier used in converting from invoicing to settlement currency | [optional] +**underlying** | **string** | Underlying | [optional] +**underlying_price** | **string** | Underlying price | [optional] +**last_price** | **string** | Last trading price | [optional] +**mark_price** | **string** | Current mark price | [optional] +**index_price** | **string** | Current index price | [optional] +**maker_fee_rate** | **string** | Maker fee rate, where negative means rebate | [optional] +**taker_fee_rate** | **string** | Taker fee rate | [optional] +**order_price_round** | **string** | Minimum order price increment | [optional] +**mark_price_round** | **string** | Minimum mark price increment | [optional] +**order_size_min** | **int** | Minimum order size the contract allowed | [optional] +**order_size_max** | **int** | Maximum order size the contract allowed | [optional] +**order_price_deviate** | **string** | deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate | [optional] +**ref_discount_rate** | **string** | Referral fee rate discount | [optional] +**ref_rebate_rate** | **string** | Referrer commission rate | [optional] +**orderbook_id** | **int** | Current orderbook ID | [optional] +**trade_id** | **int** | Current trade ID | [optional] +**trade_size** | **int** | Historical accumulated trade size | [optional] +**position_size** | **int** | Current total long position size | [optional] +**orders_limit** | **int** | Maximum number of open orders | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsMyTrade.md b/docs/Model/OptionsMyTrade.md new file mode 100644 index 0000000..d70ac06 --- /dev/null +++ b/docs/Model/OptionsMyTrade.md @@ -0,0 +1,16 @@ +# # OptionsMyTrade + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Trade ID | [optional] +**create_time** | **double** | Trading time | [optional] +**contract** | **string** | Futures contract | [optional] +**order_id** | **int** | Order ID related | [optional] +**size** | **int** | Trading size | [optional] +**price** | **string** | Trading price | [optional] +**underlying_price** | **string** | Underlying price | [optional] +**role** | **string** | Trade role. Available values are `taker` and `maker` | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsOrder.md b/docs/Model/OptionsOrder.md new file mode 100644 index 0000000..ff7cd1c --- /dev/null +++ b/docs/Model/OptionsOrder.md @@ -0,0 +1,30 @@ +# # OptionsOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Options order ID | [optional] [readonly] +**user** | **int** | User ID | [optional] [readonly] +**create_time** | **double** | Creation time of order | [optional] [readonly] +**finish_time** | **double** | Order finished time. Not returned if order is open | [optional] [readonly] +**finish_as** | **string** | How the order was finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set- position_closed: cancelled because of position close | [optional] [readonly] +**status** | **string** | Order status - `open`: waiting to be traded - `finished`: finished | [optional] [readonly] +**contract** | **string** | Contract name | +**size** | **int** | Order size. Specify positive number to make a bid, and negative number to ask | +**iceberg** | **int** | Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size | [optional] +**price** | **string** | Order price. 0 for market order with `tif` set as `ioc` | [optional] +**close** | **bool** | Set as `true` to close the position, with `size` set to 0 | [optional] [default to false] +**is_close** | **bool** | Is the order to close position | [optional] [readonly] +**reduce_only** | **bool** | Set as `true` to be reduce-only order | [optional] [default to false] +**is_reduce_only** | **bool** | Is the order reduce-only | [optional] [readonly] +**is_liq** | **bool** | Is the order for liquidation | [optional] [readonly] +**tif** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only | [optional] [default to 'gtc'] +**left** | **int** | Size left to be traded | [optional] [readonly] +**fill_price** | **string** | Fill price of the order | [optional] [readonly] +**text** | **string** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance | [optional] +**tkfr** | **string** | Taker fee | [optional] [readonly] +**mkfr** | **string** | Maker fee | [optional] [readonly] +**refu** | **int** | Reference user ID | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsPosition.md b/docs/Model/OptionsPosition.md new file mode 100644 index 0000000..a96e93b --- /dev/null +++ b/docs/Model/OptionsPosition.md @@ -0,0 +1,17 @@ +# # OptionsPosition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | **int** | User ID | [optional] [readonly] +**contract** | **string** | Futures contract | [optional] [readonly] +**size** | **int** | Position size | [optional] [readonly] +**entry_price** | **string** | Entry price | [optional] [readonly] +**mark_price** | **string** | Current mark price | [optional] [readonly] +**realised_pnl** | **string** | Realized PNL | [optional] [readonly] +**unrealised_pnl** | **string** | Unrealized PNL | [optional] [readonly] +**pending_orders** | **int** | Current open orders | [optional] [readonly] +**close_order** | [**\GateApi\Model\PositionCloseOrder**](PositionCloseOrder.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsPositionClose.md b/docs/Model/OptionsPositionClose.md new file mode 100644 index 0000000..6afe84b --- /dev/null +++ b/docs/Model/OptionsPositionClose.md @@ -0,0 +1,14 @@ +# # OptionsPositionClose + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **double** | Position close time | [optional] [readonly] +**contract** | **string** | Futures contract | [optional] [readonly] +**side** | **string** | Position side, long or short | [optional] [readonly] +**pnl** | **string** | PNL | [optional] [readonly] +**text** | **string** | Text of close order | [optional] [readonly] +**settle_size** | **string** | settlement size | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsSettlement.md b/docs/Model/OptionsSettlement.md new file mode 100644 index 0000000..d001fd7 --- /dev/null +++ b/docs/Model/OptionsSettlement.md @@ -0,0 +1,14 @@ +# # OptionsSettlement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **double** | Last changed time of configuration | [optional] +**contract** | **string** | Contract name | [optional] +**profit** | **string** | Settlement profit per size | [optional] +**fee** | **string** | Settlement fee per size | [optional] +**strike_price** | **string** | Strike price | [optional] +**settle_price** | **string** | settlement price | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsTicker.md b/docs/Model/OptionsTicker.md new file mode 100644 index 0000000..c6be267 --- /dev/null +++ b/docs/Model/OptionsTicker.md @@ -0,0 +1,26 @@ +# # OptionsTicker + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Options contract name | [optional] +**last_price** | **string** | Last trading price | [optional] +**mark_price** | **string** | Current mark price | [optional] +**index_price** | **string** | Current index price | [optional] +**ask1_size** | **int** | Best ask size | [optional] +**ask1_price** | **string** | Best ask price | [optional] +**bid1_size** | **int** | Best bid size | [optional] +**bid1_price** | **string** | Best bid price | [optional] +**position_size** | **int** | Current total long position size | [optional] +**mark_iv** | **string** | Implied volatility | [optional] +**bid_iv** | **string** | Bid side implied volatility | [optional] +**ask_iv** | **string** | Ask side implied volatility | [optional] +**leverage** | **string** | Current leverage. Formula: underlying_price / mark_price * delta | [optional] +**delta** | **string** | Delta | [optional] +**gamma** | **string** | Gamma | [optional] +**vega** | **string** | Vega | [optional] +**theta** | **string** | Theta | [optional] +**rho** | **string** | Rho | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsUnderlying.md b/docs/Model/OptionsUnderlying.md new file mode 100644 index 0000000..02e9341 --- /dev/null +++ b/docs/Model/OptionsUnderlying.md @@ -0,0 +1,10 @@ +# # OptionsUnderlying + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Underlying name | [optional] +**index_price** | **string** | Spot index price | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsUnderlyingTicker.md b/docs/Model/OptionsUnderlyingTicker.md new file mode 100644 index 0000000..3bafe11 --- /dev/null +++ b/docs/Model/OptionsUnderlyingTicker.md @@ -0,0 +1,11 @@ +# # OptionsUnderlyingTicker + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**trade_put** | **int** | Total put options trades amount in last 24h | [optional] +**trade_call** | **int** | Total call options trades amount in last 24h | [optional] +**index_price** | **string** | Index price | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/OptionsApi.php b/src/Api/OptionsApi.php new file mode 100644 index 0000000..800ae55 --- /dev/null +++ b/src/Api/OptionsApi.php @@ -0,0 +1,6545 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $host_index; + } + + /** + * Set the host index + * + * @param int Host index (required) + */ + public function setHostIndex($host_index) + { + $this->hostIndex = $host_index; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listOptionsUnderlyings + * + * List all underlyings + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsUnderlying[] + */ + public function listOptionsUnderlyings() + { + list($response) = $this->listOptionsUnderlyingsWithHttpInfo(); + return $response; + } + + /** + * Operation listOptionsUnderlyingsWithHttpInfo + * + * List all underlyings + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsUnderlying[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsUnderlyingsWithHttpInfo() + { + $request = $this->listOptionsUnderlyingsRequest(); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsUnderlying[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsUnderlyingsAsync + * + * List all underlyings + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsUnderlyingsAsync() + { + return $this->listOptionsUnderlyingsAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsUnderlyingsAsyncWithHttpInfo + * + * List all underlyings + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsUnderlyingsAsyncWithHttpInfo() + { + $returnType = '\GateApi\Model\OptionsUnderlying[]'; + $request = $this->listOptionsUnderlyingsRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsUnderlyings' + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsUnderlyingsRequest() + { + + $resourcePath = '/options/underlyings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsExpirations + * + * List all expiration times + * + * @param string $underlying Underlying (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return int[] + */ + public function listOptionsExpirations($underlying) + { + list($response) = $this->listOptionsExpirationsWithHttpInfo($underlying); + return $response; + } + + /** + * Operation listOptionsExpirationsWithHttpInfo + * + * List all expiration times + * + * @param string $underlying Underlying (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of int[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsExpirationsWithHttpInfo($underlying) + { + $request = $this->listOptionsExpirationsRequest($underlying); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = 'int[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsExpirationsAsync + * + * List all expiration times + * + * @param string $underlying Underlying (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsExpirationsAsync($underlying) + { + return $this->listOptionsExpirationsAsyncWithHttpInfo($underlying) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsExpirationsAsyncWithHttpInfo + * + * List all expiration times + * + * @param string $underlying Underlying (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsExpirationsAsyncWithHttpInfo($underlying) + { + $returnType = 'int[]'; + $request = $this->listOptionsExpirationsRequest($underlying); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsExpirations' + * + * @param string $underlying Underlying (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsExpirationsRequest($underlying) + { + // verify the required parameter 'underlying' is set + if ($underlying === null || (is_array($underlying) && count($underlying) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $underlying when calling listOptionsExpirations' + ); + } + + $resourcePath = '/options/expirations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($underlying !== null) { + if('form' === 'form' && is_array($underlying)) { + foreach($underlying as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['underlying'] = $underlying; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsContracts + * + * List all the contracts with specified underlying and expiration time + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $expiration Unix timestamp of the expiration time (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsContract[] + */ + public function listOptionsContracts($associative_array) + { + list($response) = $this->listOptionsContractsWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listOptionsContractsWithHttpInfo + * + * List all the contracts with specified underlying and expiration time + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $expiration Unix timestamp of the expiration time (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsContract[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsContractsWithHttpInfo($associative_array) + { + $request = $this->listOptionsContractsRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsContract[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsContractsAsync + * + * List all the contracts with specified underlying and expiration time + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $expiration Unix timestamp of the expiration time (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsContractsAsync($associative_array) + { + return $this->listOptionsContractsAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsContractsAsyncWithHttpInfo + * + * List all the contracts with specified underlying and expiration time + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $expiration Unix timestamp of the expiration time (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsContractsAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\OptionsContract[]'; + $request = $this->listOptionsContractsRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsContracts' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $expiration Unix timestamp of the expiration time (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsContractsRequest($associative_array) + { + // unbox the parameters from the associative array + $underlying = array_key_exists('underlying', $associative_array) ? $associative_array['underlying'] : null; + $expiration = array_key_exists('expiration', $associative_array) ? $associative_array['expiration'] : null; + + // verify the required parameter 'underlying' is set + if ($underlying === null || (is_array($underlying) && count($underlying) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $underlying when calling listOptionsContracts' + ); + } + + $resourcePath = '/options/contracts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($underlying !== null) { + if('form' === 'form' && is_array($underlying)) { + foreach($underlying as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['underlying'] = $underlying; + } + } + + // query params + if ($expiration !== null) { + if('form' === 'form' && is_array($expiration)) { + foreach($expiration as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['expiration'] = $expiration; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOptionsContract + * + * Query specified contract detail + * + * @param string $contract contract (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsContract + */ + public function getOptionsContract($contract) + { + list($response) = $this->getOptionsContractWithHttpInfo($contract); + return $response; + } + + /** + * Operation getOptionsContractWithHttpInfo + * + * Query specified contract detail + * + * @param string $contract (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsContract, HTTP status code, HTTP response headers (array of strings) + */ + public function getOptionsContractWithHttpInfo($contract) + { + $request = $this->getOptionsContractRequest($contract); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsContract'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getOptionsContractAsync + * + * Query specified contract detail + * + * @param string $contract (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOptionsContractAsync($contract) + { + return $this->getOptionsContractAsyncWithHttpInfo($contract) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOptionsContractAsyncWithHttpInfo + * + * Query specified contract detail + * + * @param string $contract (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOptionsContractAsyncWithHttpInfo($contract) + { + $returnType = '\GateApi\Model\OptionsContract'; + $request = $this->getOptionsContractRequest($contract); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOptionsContract' + * + * @param string $contract (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getOptionsContractRequest($contract) + { + // verify the required parameter 'contract' is set + if ($contract === null || (is_array($contract) && count($contract) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contract when calling getOptionsContract' + ); + } + + $resourcePath = '/options/contracts/{contract}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($contract !== null) { + $resourcePath = str_replace( + '{' . 'contract' . '}', + ObjectSerializer::toPathValue($contract), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsSettlements + * + * List settlement history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsSettlement[] + */ + public function listOptionsSettlements($associative_array) + { + list($response) = $this->listOptionsSettlementsWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listOptionsSettlementsWithHttpInfo + * + * List settlement history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsSettlement[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsSettlementsWithHttpInfo($associative_array) + { + $request = $this->listOptionsSettlementsRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsSettlement[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsSettlementsAsync + * + * List settlement history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsSettlementsAsync($associative_array) + { + return $this->listOptionsSettlementsAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsSettlementsAsyncWithHttpInfo + * + * List settlement history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsSettlementsAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\OptionsSettlement[]'; + $request = $this->listOptionsSettlementsRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsSettlements' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsSettlementsRequest($associative_array) + { + // unbox the parameters from the associative array + $underlying = array_key_exists('underlying', $associative_array) ? $associative_array['underlying'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + + // verify the required parameter 'underlying' is set + if ($underlying === null || (is_array($underlying) && count($underlying) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $underlying when calling listOptionsSettlements' + ); + } + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsSettlements, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsSettlements, must be bigger than or equal to 1.'); + } + + if ($offset !== null && $offset < 0) { + throw new \InvalidArgumentException('invalid value for "$offset" when calling OptionsApi.listOptionsSettlements, must be bigger than or equal to 0.'); + } + + + $resourcePath = '/options/settlements'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($underlying !== null) { + if('form' === 'form' && is_array($underlying)) { + foreach($underlying as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['underlying'] = $underlying; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($offset !== null) { + if('form' === 'form' && is_array($offset)) { + foreach($offset as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['offset'] = $offset; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOptionsSettlement + * + * Get specified contract's settlement + * + * @param string $contract contract (required) + * @param string $underlying Underlying (required) + * @param int $at at (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsSettlement + */ + public function getOptionsSettlement($contract, $underlying, $at) + { + list($response) = $this->getOptionsSettlementWithHttpInfo($contract, $underlying, $at); + return $response; + } + + /** + * Operation getOptionsSettlementWithHttpInfo + * + * Get specified contract's settlement + * + * @param string $contract (required) + * @param string $underlying Underlying (required) + * @param int $at (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsSettlement, HTTP status code, HTTP response headers (array of strings) + */ + public function getOptionsSettlementWithHttpInfo($contract, $underlying, $at) + { + $request = $this->getOptionsSettlementRequest($contract, $underlying, $at); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsSettlement'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getOptionsSettlementAsync + * + * Get specified contract's settlement + * + * @param string $contract (required) + * @param string $underlying Underlying (required) + * @param int $at (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOptionsSettlementAsync($contract, $underlying, $at) + { + return $this->getOptionsSettlementAsyncWithHttpInfo($contract, $underlying, $at) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOptionsSettlementAsyncWithHttpInfo + * + * Get specified contract's settlement + * + * @param string $contract (required) + * @param string $underlying Underlying (required) + * @param int $at (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOptionsSettlementAsyncWithHttpInfo($contract, $underlying, $at) + { + $returnType = '\GateApi\Model\OptionsSettlement'; + $request = $this->getOptionsSettlementRequest($contract, $underlying, $at); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOptionsSettlement' + * + * @param string $contract (required) + * @param string $underlying Underlying (required) + * @param int $at (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getOptionsSettlementRequest($contract, $underlying, $at) + { + // verify the required parameter 'contract' is set + if ($contract === null || (is_array($contract) && count($contract) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contract when calling getOptionsSettlement' + ); + } + // verify the required parameter 'underlying' is set + if ($underlying === null || (is_array($underlying) && count($underlying) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $underlying when calling getOptionsSettlement' + ); + } + // verify the required parameter 'at' is set + if ($at === null || (is_array($at) && count($at) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $at when calling getOptionsSettlement' + ); + } + + $resourcePath = '/options/settlements/{contract}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($underlying !== null) { + if('form' === 'form' && is_array($underlying)) { + foreach($underlying as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['underlying'] = $underlying; + } + } + + // query params + if ($at !== null) { + if('form' === 'form' && is_array($at)) { + foreach($at as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['at'] = $at; + } + } + + // path params + if ($contract !== null) { + $resourcePath = str_replace( + '{' . 'contract' . '}', + ObjectSerializer::toPathValue($contract), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsOrderBook + * + * Futures order book + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Futures contract (required) + * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') + * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FuturesOrderBook + */ + public function listOptionsOrderBook($associative_array) + { + list($response) = $this->listOptionsOrderBookWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listOptionsOrderBookWithHttpInfo + * + * Futures order book + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Futures contract (required) + * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') + * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FuturesOrderBook, HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsOrderBookWithHttpInfo($associative_array) + { + $request = $this->listOptionsOrderBookRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FuturesOrderBook'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsOrderBookAsync + * + * Futures order book + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Futures contract (required) + * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') + * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsOrderBookAsync($associative_array) + { + return $this->listOptionsOrderBookAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsOrderBookAsyncWithHttpInfo + * + * Futures order book + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Futures contract (required) + * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') + * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsOrderBookAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\FuturesOrderBook'; + $request = $this->listOptionsOrderBookRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsOrderBook' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Futures contract (required) + * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') + * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) + * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsOrderBookRequest($associative_array) + { + // unbox the parameters from the associative array + $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; + $interval = array_key_exists('interval', $associative_array) ? $associative_array['interval'] : '0'; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 10; + $with_id = array_key_exists('with_id', $associative_array) ? $associative_array['with_id'] : false; + + // verify the required parameter 'contract' is set + if ($contract === null || (is_array($contract) && count($contract) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contract when calling listOptionsOrderBook' + ); + } + if ($limit !== null && $limit > 50) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsOrderBook, must be smaller than or equal to 50.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsOrderBook, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/options/order_book'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($contract !== null) { + if('form' === 'form' && is_array($contract)) { + foreach($contract as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contract'] = $contract; + } + } + + // query params + if ($interval !== null) { + if('form' === 'form' && is_array($interval)) { + foreach($interval as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['interval'] = $interval; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($with_id !== null) { + if('form' === 'form' && is_array($with_id)) { + foreach($with_id as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['with_id'] = $with_id; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsTickers + * + * List tickers of options contracts + * + * @param string $underlying Underlying (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsTicker[] + */ + public function listOptionsTickers($underlying) + { + list($response) = $this->listOptionsTickersWithHttpInfo($underlying); + return $response; + } + + /** + * Operation listOptionsTickersWithHttpInfo + * + * List tickers of options contracts + * + * @param string $underlying Underlying (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsTicker[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsTickersWithHttpInfo($underlying) + { + $request = $this->listOptionsTickersRequest($underlying); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsTicker[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsTickersAsync + * + * List tickers of options contracts + * + * @param string $underlying Underlying (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsTickersAsync($underlying) + { + return $this->listOptionsTickersAsyncWithHttpInfo($underlying) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsTickersAsyncWithHttpInfo + * + * List tickers of options contracts + * + * @param string $underlying Underlying (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsTickersAsyncWithHttpInfo($underlying) + { + $returnType = '\GateApi\Model\OptionsTicker[]'; + $request = $this->listOptionsTickersRequest($underlying); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsTickers' + * + * @param string $underlying Underlying (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsTickersRequest($underlying) + { + // verify the required parameter 'underlying' is set + if ($underlying === null || (is_array($underlying) && count($underlying) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $underlying when calling listOptionsTickers' + ); + } + + $resourcePath = '/options/tickers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($underlying !== null) { + if('form' === 'form' && is_array($underlying)) { + foreach($underlying as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['underlying'] = $underlying; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsUnderlyingTickers + * + * Get underlying ticker + * + * @param string $underlying Underlying (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsUnderlyingTicker + */ + public function listOptionsUnderlyingTickers($underlying) + { + list($response) = $this->listOptionsUnderlyingTickersWithHttpInfo($underlying); + return $response; + } + + /** + * Operation listOptionsUnderlyingTickersWithHttpInfo + * + * Get underlying ticker + * + * @param string $underlying Underlying (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsUnderlyingTicker, HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsUnderlyingTickersWithHttpInfo($underlying) + { + $request = $this->listOptionsUnderlyingTickersRequest($underlying); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsUnderlyingTicker'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsUnderlyingTickersAsync + * + * Get underlying ticker + * + * @param string $underlying Underlying (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsUnderlyingTickersAsync($underlying) + { + return $this->listOptionsUnderlyingTickersAsyncWithHttpInfo($underlying) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsUnderlyingTickersAsyncWithHttpInfo + * + * Get underlying ticker + * + * @param string $underlying Underlying (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsUnderlyingTickersAsyncWithHttpInfo($underlying) + { + $returnType = '\GateApi\Model\OptionsUnderlyingTicker'; + $request = $this->listOptionsUnderlyingTickersRequest($underlying); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsUnderlyingTickers' + * + * @param string $underlying Underlying (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsUnderlyingTickersRequest($underlying) + { + // verify the required parameter 'underlying' is set + if ($underlying === null || (is_array($underlying) && count($underlying) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $underlying when calling listOptionsUnderlyingTickers' + ); + } + + $resourcePath = '/options/underlying/tickers/{underlying}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($underlying !== null) { + $resourcePath = str_replace( + '{' . 'underlying' . '}', + ObjectSerializer::toPathValue($underlying), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsCandlesticks + * + * Get futures candlesticks + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Futures contract (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FuturesCandlestick[] + */ + public function listOptionsCandlesticks($associative_array) + { + list($response) = $this->listOptionsCandlesticksWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listOptionsCandlesticksWithHttpInfo + * + * Get futures candlesticks + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Futures contract (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FuturesCandlestick[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsCandlesticksWithHttpInfo($associative_array) + { + $request = $this->listOptionsCandlesticksRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FuturesCandlestick[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsCandlesticksAsync + * + * Get futures candlesticks + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Futures contract (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsCandlesticksAsync($associative_array) + { + return $this->listOptionsCandlesticksAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsCandlesticksAsyncWithHttpInfo + * + * Get futures candlesticks + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Futures contract (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsCandlesticksAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\FuturesCandlestick[]'; + $request = $this->listOptionsCandlesticksRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsCandlesticks' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Futures contract (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsCandlesticksRequest($associative_array) + { + // unbox the parameters from the associative array + $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + $interval = array_key_exists('interval', $associative_array) ? $associative_array['interval'] : '5m'; + + // verify the required parameter 'contract' is set + if ($contract === null || (is_array($contract) && count($contract) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contract when calling listOptionsCandlesticks' + ); + } + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsCandlesticks, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsCandlesticks, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/options/candlesticks'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($contract !== null) { + if('form' === 'form' && is_array($contract)) { + foreach($contract as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contract'] = $contract; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // query params + if ($interval !== null) { + if('form' === 'form' && is_array($interval)) { + foreach($interval as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['interval'] = $interval; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsUnderlyingCandlesticks + * + * Mark price candlesticks of an underlying + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FuturesCandlestick[] + */ + public function listOptionsUnderlyingCandlesticks($associative_array) + { + list($response) = $this->listOptionsUnderlyingCandlesticksWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listOptionsUnderlyingCandlesticksWithHttpInfo + * + * Mark price candlesticks of an underlying + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FuturesCandlestick[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsUnderlyingCandlesticksWithHttpInfo($associative_array) + { + $request = $this->listOptionsUnderlyingCandlesticksRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FuturesCandlestick[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsUnderlyingCandlesticksAsync + * + * Mark price candlesticks of an underlying + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsUnderlyingCandlesticksAsync($associative_array) + { + return $this->listOptionsUnderlyingCandlesticksAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsUnderlyingCandlesticksAsyncWithHttpInfo + * + * Mark price candlesticks of an underlying + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsUnderlyingCandlesticksAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\FuturesCandlestick[]'; + $request = $this->listOptionsUnderlyingCandlesticksRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsUnderlyingCandlesticks' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsUnderlyingCandlesticksRequest($associative_array) + { + // unbox the parameters from the associative array + $underlying = array_key_exists('underlying', $associative_array) ? $associative_array['underlying'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + $interval = array_key_exists('interval', $associative_array) ? $associative_array['interval'] : '5m'; + + // verify the required parameter 'underlying' is set + if ($underlying === null || (is_array($underlying) && count($underlying) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $underlying when calling listOptionsUnderlyingCandlesticks' + ); + } + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsUnderlyingCandlesticks, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsUnderlyingCandlesticks, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/options/underlying/candlesticks'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($underlying !== null) { + if('form' === 'form' && is_array($underlying)) { + foreach($underlying as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['underlying'] = $underlying; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // query params + if ($interval !== null) { + if('form' === 'form' && is_array($interval)) { + foreach($interval as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['interval'] = $interval; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsTrades + * + * Options trade history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Contract name (optional) + * @param string $type `C` is call, while `P` is put (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FuturesTrade[] + */ + public function listOptionsTrades($associative_array) + { + list($response) = $this->listOptionsTradesWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listOptionsTradesWithHttpInfo + * + * Options trade history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Contract name (optional) + * @param string $type `C` is call, while `P` is put (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FuturesTrade[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsTradesWithHttpInfo($associative_array) + { + $request = $this->listOptionsTradesRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FuturesTrade[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsTradesAsync + * + * Options trade history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Contract name (optional) + * @param string $type `C` is call, while `P` is put (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsTradesAsync($associative_array) + { + return $this->listOptionsTradesAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsTradesAsyncWithHttpInfo + * + * Options trade history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Contract name (optional) + * @param string $type `C` is call, while `P` is put (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsTradesAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\FuturesTrade[]'; + $request = $this->listOptionsTradesRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsTrades' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $contract Contract name (optional) + * @param string $type `C` is call, while `P` is put (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsTradesRequest($associative_array) + { + // unbox the parameters from the associative array + $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; + $type = array_key_exists('type', $associative_array) ? $associative_array['type'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsTrades, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsTrades, must be bigger than or equal to 1.'); + } + + if ($offset !== null && $offset < 0) { + throw new \InvalidArgumentException('invalid value for "$offset" when calling OptionsApi.listOptionsTrades, must be bigger than or equal to 0.'); + } + + + $resourcePath = '/options/trades'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($contract !== null) { + if('form' === 'form' && is_array($contract)) { + foreach($contract as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contract'] = $contract; + } + } + + // query params + if ($type !== null) { + if('form' === 'form' && is_array($type)) { + foreach($type as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['type'] = $type; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($offset !== null) { + if('form' === 'form' && is_array($offset)) { + foreach($offset as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['offset'] = $offset; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsAccount + * + * List options account + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsAccount + */ + public function listOptionsAccount() + { + list($response) = $this->listOptionsAccountWithHttpInfo(); + return $response; + } + + /** + * Operation listOptionsAccountWithHttpInfo + * + * List options account + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsAccount, HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsAccountWithHttpInfo() + { + $request = $this->listOptionsAccountRequest(); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsAccount'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsAccountAsync + * + * List options account + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsAccountAsync() + { + return $this->listOptionsAccountAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsAccountAsyncWithHttpInfo + * + * List options account + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsAccountAsyncWithHttpInfo() + { + $returnType = '\GateApi\Model\OptionsAccount'; + $request = $this->listOptionsAccountRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsAccount' + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsAccountRequest() + { + + $resourcePath = '/options/accounts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsAccountBook + * + * List account changing history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $type Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: settlement PNL (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsAccountBook[] + */ + public function listOptionsAccountBook($associative_array) + { + list($response) = $this->listOptionsAccountBookWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listOptionsAccountBookWithHttpInfo + * + * List account changing history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $type Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: settlement PNL (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsAccountBook[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsAccountBookWithHttpInfo($associative_array) + { + $request = $this->listOptionsAccountBookRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsAccountBook[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsAccountBookAsync + * + * List account changing history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $type Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: settlement PNL (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsAccountBookAsync($associative_array) + { + return $this->listOptionsAccountBookAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsAccountBookAsyncWithHttpInfo + * + * List account changing history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $type Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: settlement PNL (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsAccountBookAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\OptionsAccountBook[]'; + $request = $this->listOptionsAccountBookRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsAccountBook' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * @param string $type Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: settlement PNL (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsAccountBookRequest($associative_array) + { + // unbox the parameters from the associative array + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + $type = array_key_exists('type', $associative_array) ? $associative_array['type'] : null; + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsAccountBook, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsAccountBook, must be bigger than or equal to 1.'); + } + + if ($offset !== null && $offset < 0) { + throw new \InvalidArgumentException('invalid value for "$offset" when calling OptionsApi.listOptionsAccountBook, must be bigger than or equal to 0.'); + } + + + $resourcePath = '/options/account_book'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($offset !== null) { + if('form' === 'form' && is_array($offset)) { + foreach($offset as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['offset'] = $offset; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // query params + if ($type !== null) { + if('form' === 'form' && is_array($type)) { + foreach($type as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['type'] = $type; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsPositions + * + * List user's positions of specified underlying + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsPosition[] + */ + public function listOptionsPositions($associative_array) + { + list($response) = $this->listOptionsPositionsWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listOptionsPositionsWithHttpInfo + * + * List user's positions of specified underlying + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsPosition[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsPositionsWithHttpInfo($associative_array) + { + $request = $this->listOptionsPositionsRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsPosition[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsPositionsAsync + * + * List user's positions of specified underlying + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsPositionsAsync($associative_array) + { + return $this->listOptionsPositionsAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsPositionsAsyncWithHttpInfo + * + * List user's positions of specified underlying + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsPositionsAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\OptionsPosition[]'; + $request = $this->listOptionsPositionsRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsPositions' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsPositionsRequest($associative_array) + { + // unbox the parameters from the associative array + $underlying = array_key_exists('underlying', $associative_array) ? $associative_array['underlying'] : null; + + + $resourcePath = '/options/positions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($underlying !== null) { + if('form' === 'form' && is_array($underlying)) { + foreach($underlying as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['underlying'] = $underlying; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOptionsPosition + * + * Get specified contract position + * + * @param string $contract contract (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsPosition + */ + public function getOptionsPosition($contract) + { + list($response) = $this->getOptionsPositionWithHttpInfo($contract); + return $response; + } + + /** + * Operation getOptionsPositionWithHttpInfo + * + * Get specified contract position + * + * @param string $contract (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsPosition, HTTP status code, HTTP response headers (array of strings) + */ + public function getOptionsPositionWithHttpInfo($contract) + { + $request = $this->getOptionsPositionRequest($contract); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsPosition'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getOptionsPositionAsync + * + * Get specified contract position + * + * @param string $contract (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOptionsPositionAsync($contract) + { + return $this->getOptionsPositionAsyncWithHttpInfo($contract) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOptionsPositionAsyncWithHttpInfo + * + * Get specified contract position + * + * @param string $contract (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOptionsPositionAsyncWithHttpInfo($contract) + { + $returnType = '\GateApi\Model\OptionsPosition'; + $request = $this->getOptionsPositionRequest($contract); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOptionsPosition' + * + * @param string $contract (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getOptionsPositionRequest($contract) + { + // verify the required parameter 'contract' is set + if ($contract === null || (is_array($contract) && count($contract) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contract when calling getOptionsPosition' + ); + } + + $resourcePath = '/options/positions/{contract}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($contract !== null) { + $resourcePath = str_replace( + '{' . 'contract' . '}', + ObjectSerializer::toPathValue($contract), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsPositionClose + * + * List user's liquidation history of specified underlying + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsPositionClose[] + */ + public function listOptionsPositionClose($associative_array) + { + list($response) = $this->listOptionsPositionCloseWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listOptionsPositionCloseWithHttpInfo + * + * List user's liquidation history of specified underlying + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsPositionClose[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsPositionCloseWithHttpInfo($associative_array) + { + $request = $this->listOptionsPositionCloseRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsPositionClose[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsPositionCloseAsync + * + * List user's liquidation history of specified underlying + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsPositionCloseAsync($associative_array) + { + return $this->listOptionsPositionCloseAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsPositionCloseAsyncWithHttpInfo + * + * List user's liquidation history of specified underlying + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsPositionCloseAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\OptionsPositionClose[]'; + $request = $this->listOptionsPositionCloseRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsPositionClose' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsPositionCloseRequest($associative_array) + { + // unbox the parameters from the associative array + $underlying = array_key_exists('underlying', $associative_array) ? $associative_array['underlying'] : null; + $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; + + // verify the required parameter 'underlying' is set + if ($underlying === null || (is_array($underlying) && count($underlying) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $underlying when calling listOptionsPositionClose' + ); + } + + $resourcePath = '/options/position_close'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($underlying !== null) { + if('form' === 'form' && is_array($underlying)) { + foreach($underlying as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['underlying'] = $underlying; + } + } + + // query params + if ($contract !== null) { + if('form' === 'form' && is_array($contract)) { + foreach($contract as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contract'] = $contract; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOptionsOrders + * + * List futures orders + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $status Only list the orders with this status (required) + * @param string $contract Contract name (optional) + * @param string $underlying Underlying (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsOrder[] + */ + public function listOptionsOrders($associative_array) + { + list($response) = $this->listOptionsOrdersWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listOptionsOrdersWithHttpInfo + * + * List futures orders + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $status Only list the orders with this status (required) + * @param string $contract Contract name (optional) + * @param string $underlying Underlying (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsOrder[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsOrdersWithHttpInfo($associative_array) + { + $request = $this->listOptionsOrdersRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsOrder[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listOptionsOrdersAsync + * + * List futures orders + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $status Only list the orders with this status (required) + * @param string $contract Contract name (optional) + * @param string $underlying Underlying (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsOrdersAsync($associative_array) + { + return $this->listOptionsOrdersAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsOrdersAsyncWithHttpInfo + * + * List futures orders + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $status Only list the orders with this status (required) + * @param string $contract Contract name (optional) + * @param string $underlying Underlying (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsOrdersAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\OptionsOrder[]'; + $request = $this->listOptionsOrdersRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOptionsOrders' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $status Only list the orders with this status (required) + * @param string $contract Contract name (optional) + * @param string $underlying Underlying (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listOptionsOrdersRequest($associative_array) + { + // unbox the parameters from the associative array + $status = array_key_exists('status', $associative_array) ? $associative_array['status'] : null; + $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; + $underlying = array_key_exists('underlying', $associative_array) ? $associative_array['underlying'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + + // verify the required parameter 'status' is set + if ($status === null || (is_array($status) && count($status) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $status when calling listOptionsOrders' + ); + } + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsOrders, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listOptionsOrders, must be bigger than or equal to 1.'); + } + + if ($offset !== null && $offset < 0) { + throw new \InvalidArgumentException('invalid value for "$offset" when calling OptionsApi.listOptionsOrders, must be bigger than or equal to 0.'); + } + + + $resourcePath = '/options/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($contract !== null) { + if('form' === 'form' && is_array($contract)) { + foreach($contract as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contract'] = $contract; + } + } + + // query params + if ($underlying !== null) { + if('form' === 'form' && is_array($underlying)) { + foreach($underlying as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['underlying'] = $underlying; + } + } + + // query params + if ($status !== null) { + if('form' === 'form' && is_array($status)) { + foreach($status as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['status'] = $status; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($offset !== null) { + if('form' === 'form' && is_array($offset)) { + foreach($offset as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['offset'] = $offset; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createOptionsOrder + * + * Create an options order + * + * @param \GateApi\Model\OptionsOrder $options_order options_order (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsOrder + */ + public function createOptionsOrder($options_order) + { + list($response) = $this->createOptionsOrderWithHttpInfo($options_order); + return $response; + } + + /** + * Operation createOptionsOrderWithHttpInfo + * + * Create an options order + * + * @param \GateApi\Model\OptionsOrder $options_order (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsOrder, HTTP status code, HTTP response headers (array of strings) + */ + public function createOptionsOrderWithHttpInfo($options_order) + { + $request = $this->createOptionsOrderRequest($options_order); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsOrder'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation createOptionsOrderAsync + * + * Create an options order + * + * @param \GateApi\Model\OptionsOrder $options_order (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createOptionsOrderAsync($options_order) + { + return $this->createOptionsOrderAsyncWithHttpInfo($options_order) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createOptionsOrderAsyncWithHttpInfo + * + * Create an options order + * + * @param \GateApi\Model\OptionsOrder $options_order (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createOptionsOrderAsyncWithHttpInfo($options_order) + { + $returnType = '\GateApi\Model\OptionsOrder'; + $request = $this->createOptionsOrderRequest($options_order); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createOptionsOrder' + * + * @param \GateApi\Model\OptionsOrder $options_order (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createOptionsOrderRequest($options_order) + { + // verify the required parameter 'options_order' is set + if ($options_order === null || (is_array($options_order) && count($options_order) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $options_order when calling createOptionsOrder' + ); + } + + $resourcePath = '/options/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + if (isset($options_order)) { + $_tempBody = $options_order; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('POST', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation cancelOptionsOrders + * + * Cancel all `open` orders matched + * + * @param string $contract Contract name (optional) + * @param string $underlying Underlying (optional) + * @param string $side All bids or asks. Both included if not specified (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsOrder[] + */ + public function cancelOptionsOrders($contract = null, $underlying = null, $side = null) + { + list($response) = $this->cancelOptionsOrdersWithHttpInfo($contract, $underlying, $side); + return $response; + } + + /** + * Operation cancelOptionsOrdersWithHttpInfo + * + * Cancel all `open` orders matched + * + * @param string $contract Contract name (optional) + * @param string $underlying Underlying (optional) + * @param string $side All bids or asks. Both included if not specified (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsOrder[], HTTP status code, HTTP response headers (array of strings) + */ + public function cancelOptionsOrdersWithHttpInfo($contract = null, $underlying = null, $side = null) + { + $request = $this->cancelOptionsOrdersRequest($contract, $underlying, $side); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsOrder[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation cancelOptionsOrdersAsync + * + * Cancel all `open` orders matched + * + * @param string $contract Contract name (optional) + * @param string $underlying Underlying (optional) + * @param string $side All bids or asks. Both included if not specified (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cancelOptionsOrdersAsync($contract = null, $underlying = null, $side = null) + { + return $this->cancelOptionsOrdersAsyncWithHttpInfo($contract, $underlying, $side) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation cancelOptionsOrdersAsyncWithHttpInfo + * + * Cancel all `open` orders matched + * + * @param string $contract Contract name (optional) + * @param string $underlying Underlying (optional) + * @param string $side All bids or asks. Both included if not specified (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cancelOptionsOrdersAsyncWithHttpInfo($contract = null, $underlying = null, $side = null) + { + $returnType = '\GateApi\Model\OptionsOrder[]'; + $request = $this->cancelOptionsOrdersRequest($contract, $underlying, $side); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'cancelOptionsOrders' + * + * @param string $contract Contract name (optional) + * @param string $underlying Underlying (optional) + * @param string $side All bids or asks. Both included if not specified (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function cancelOptionsOrdersRequest($contract = null, $underlying = null, $side = null) + { + + $resourcePath = '/options/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($contract !== null) { + if('form' === 'form' && is_array($contract)) { + foreach($contract as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contract'] = $contract; + } + } + + // query params + if ($underlying !== null) { + if('form' === 'form' && is_array($underlying)) { + foreach($underlying as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['underlying'] = $underlying; + } + } + + // query params + if ($side !== null) { + if('form' === 'form' && is_array($side)) { + foreach($side as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['side'] = $side; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('DELETE', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOptionsOrder + * + * Get a single order + * + * @param int $order_id Order ID returned on successful order creation (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsOrder + */ + public function getOptionsOrder($order_id) + { + list($response) = $this->getOptionsOrderWithHttpInfo($order_id); + return $response; + } + + /** + * Operation getOptionsOrderWithHttpInfo + * + * Get a single order + * + * @param int $order_id Order ID returned on successful order creation (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsOrder, HTTP status code, HTTP response headers (array of strings) + */ + public function getOptionsOrderWithHttpInfo($order_id) + { + $request = $this->getOptionsOrderRequest($order_id); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsOrder'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getOptionsOrderAsync + * + * Get a single order + * + * @param int $order_id Order ID returned on successful order creation (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOptionsOrderAsync($order_id) + { + return $this->getOptionsOrderAsyncWithHttpInfo($order_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOptionsOrderAsyncWithHttpInfo + * + * Get a single order + * + * @param int $order_id Order ID returned on successful order creation (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOptionsOrderAsyncWithHttpInfo($order_id) + { + $returnType = '\GateApi\Model\OptionsOrder'; + $request = $this->getOptionsOrderRequest($order_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOptionsOrder' + * + * @param int $order_id Order ID returned on successful order creation (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getOptionsOrderRequest($order_id) + { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOptionsOrder' + ); + } + + $resourcePath = '/options/orders/{order_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'order_id' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation cancelOptionsOrder + * + * Cancel a single order + * + * @param int $order_id Order ID returned on successful order creation (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsOrder + */ + public function cancelOptionsOrder($order_id) + { + list($response) = $this->cancelOptionsOrderWithHttpInfo($order_id); + return $response; + } + + /** + * Operation cancelOptionsOrderWithHttpInfo + * + * Cancel a single order + * + * @param int $order_id Order ID returned on successful order creation (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsOrder, HTTP status code, HTTP response headers (array of strings) + */ + public function cancelOptionsOrderWithHttpInfo($order_id) + { + $request = $this->cancelOptionsOrderRequest($order_id); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsOrder'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation cancelOptionsOrderAsync + * + * Cancel a single order + * + * @param int $order_id Order ID returned on successful order creation (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cancelOptionsOrderAsync($order_id) + { + return $this->cancelOptionsOrderAsyncWithHttpInfo($order_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation cancelOptionsOrderAsyncWithHttpInfo + * + * Cancel a single order + * + * @param int $order_id Order ID returned on successful order creation (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cancelOptionsOrderAsyncWithHttpInfo($order_id) + { + $returnType = '\GateApi\Model\OptionsOrder'; + $request = $this->cancelOptionsOrderRequest($order_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'cancelOptionsOrder' + * + * @param int $order_id Order ID returned on successful order creation (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function cancelOptionsOrderRequest($order_id) + { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling cancelOptionsOrder' + ); + } + + $resourcePath = '/options/orders/{order_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'order_id' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('DELETE', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listMyOptionsTrades + * + * List personal trading history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsMyTrade[] + */ + public function listMyOptionsTrades($associative_array) + { + list($response) = $this->listMyOptionsTradesWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listMyOptionsTradesWithHttpInfo + * + * List personal trading history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsMyTrade[], HTTP status code, HTTP response headers (array of strings) + */ + public function listMyOptionsTradesWithHttpInfo($associative_array) + { + $request = $this->listMyOptionsTradesRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsMyTrade[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listMyOptionsTradesAsync + * + * List personal trading history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listMyOptionsTradesAsync($associative_array) + { + return $this->listMyOptionsTradesAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listMyOptionsTradesAsyncWithHttpInfo + * + * List personal trading history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listMyOptionsTradesAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\OptionsMyTrade[]'; + $request = $this->listMyOptionsTradesRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listMyOptionsTrades' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listMyOptionsTradesRequest($associative_array) + { + // unbox the parameters from the associative array + $underlying = array_key_exists('underlying', $associative_array) ? $associative_array['underlying'] : null; + $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + + // verify the required parameter 'underlying' is set + if ($underlying === null || (is_array($underlying) && count($underlying) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $underlying when calling listMyOptionsTrades' + ); + } + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listMyOptionsTrades, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listMyOptionsTrades, must be bigger than or equal to 1.'); + } + + if ($offset !== null && $offset < 0) { + throw new \InvalidArgumentException('invalid value for "$offset" when calling OptionsApi.listMyOptionsTrades, must be bigger than or equal to 0.'); + } + + + $resourcePath = '/options/my_trades'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($underlying !== null) { + if('form' === 'form' && is_array($underlying)) { + foreach($underlying as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['underlying'] = $underlying; + } + } + + // query params + if ($contract !== null) { + if('form' === 'form' && is_array($contract)) { + foreach($contract as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contract'] = $contract; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($offset !== null) { + if('form' === 'form' && is_array($offset)) { + foreach($offset as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['offset'] = $offset; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/WalletApi.php b/src/Api/WalletApi.php index 5ce2a48..0b2fb83 100644 --- a/src/Api/WalletApi.php +++ b/src/Api/WalletApi.php @@ -113,6 +113,246 @@ public function getConfig() return $this->config; } + /** + * Operation listCurrencyChains + * + * List chains supported for specified currency + * + * @param string $currency Currency name (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\CurrencyChain[] + */ + public function listCurrencyChains($currency) + { + list($response) = $this->listCurrencyChainsWithHttpInfo($currency); + return $response; + } + + /** + * Operation listCurrencyChainsWithHttpInfo + * + * List chains supported for specified currency + * + * @param string $currency Currency name (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\CurrencyChain[], HTTP status code, HTTP response headers (array of strings) + */ + public function listCurrencyChainsWithHttpInfo($currency) + { + $request = $this->listCurrencyChainsRequest($currency); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\CurrencyChain[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listCurrencyChainsAsync + * + * List chains supported for specified currency + * + * @param string $currency Currency name (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listCurrencyChainsAsync($currency) + { + return $this->listCurrencyChainsAsyncWithHttpInfo($currency) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listCurrencyChainsAsyncWithHttpInfo + * + * List chains supported for specified currency + * + * @param string $currency Currency name (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listCurrencyChainsAsyncWithHttpInfo($currency) + { + $returnType = '\GateApi\Model\CurrencyChain[]'; + $request = $this->listCurrencyChainsRequest($currency); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listCurrencyChains' + * + * @param string $currency Currency name (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listCurrencyChainsRequest($currency) + { + // verify the required parameter 'currency' is set + if ($currency === null || (is_array($currency) && count($currency) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $currency when calling listCurrencyChains' + ); + } + + $resourcePath = '/wallet/currency_chains'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($currency !== null) { + if('form' === 'form' && is_array($currency)) { + foreach($currency as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency'] = $currency; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getDepositAddress * diff --git a/src/Configuration.php b/src/Configuration.php index c511710..c45d464 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.22.4/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.23.0/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.22.4' . PHP_EOL; - $report .= ' SDK Package Version: 5.22.4' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.23.0' . PHP_EOL; + $report .= ' SDK Package Version: 5.23.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/CurrencyChain.php b/src/Model/CurrencyChain.php new file mode 100644 index 0000000..e683cca --- /dev/null +++ b/src/Model/CurrencyChain.php @@ -0,0 +1,394 @@ + 'string', + 'name_cn' => 'string', + 'name_en' => 'string', + 'is_disabled' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'chain' => null, + 'name_cn' => null, + 'name_en' => null, + 'is_disabled' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'chain' => 'chain', + 'name_cn' => 'name_cn', + 'name_en' => 'name_en', + 'is_disabled' => 'is_disabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'chain' => 'setChain', + 'name_cn' => 'setNameCn', + 'name_en' => 'setNameEn', + 'is_disabled' => 'setIsDisabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'chain' => 'getChain', + 'name_cn' => 'getNameCn', + 'name_en' => 'getNameEn', + 'is_disabled' => 'getIsDisabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['chain'] = isset($data['chain']) ? $data['chain'] : null; + $this->container['name_cn'] = isset($data['name_cn']) ? $data['name_cn'] : null; + $this->container['name_en'] = isset($data['name_en']) ? $data['name_en'] : null; + $this->container['is_disabled'] = isset($data['is_disabled']) ? $data['is_disabled'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets chain + * + * @return string|null + */ + public function getChain() + { + return $this->container['chain']; + } + + /** + * Sets chain + * + * @param string|null $chain Chain name + * + * @return $this + */ + public function setChain($chain) + { + $this->container['chain'] = $chain; + + return $this; + } + + /** + * Gets name_cn + * + * @return string|null + */ + public function getNameCn() + { + return $this->container['name_cn']; + } + + /** + * Sets name_cn + * + * @param string|null $name_cn Chain name in Chinese + * + * @return $this + */ + public function setNameCn($name_cn) + { + $this->container['name_cn'] = $name_cn; + + return $this; + } + + /** + * Gets name_en + * + * @return string|null + */ + public function getNameEn() + { + return $this->container['name_en']; + } + + /** + * Sets name_en + * + * @param string|null $name_en Chain name in English + * + * @return $this + */ + public function setNameEn($name_en) + { + $this->container['name_en'] = $name_en; + + return $this; + } + + /** + * Gets is_disabled + * + * @return int|null + */ + public function getIsDisabled() + { + return $this->container['is_disabled']; + } + + /** + * Sets is_disabled + * + * @param int|null $is_disabled If it is disabled. 0 means NOT being disabled + * + * @return $this + */ + public function setIsDisabled($is_disabled) + { + $this->container['is_disabled'] = $is_disabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LedgerRecord.php b/src/Model/LedgerRecord.php index d8421a8..9847eb1 100644 --- a/src/Model/LedgerRecord.php +++ b/src/Model/LedgerRecord.php @@ -202,6 +202,10 @@ public function getModelName() const STATUS_BCODE = 'BCODE'; const STATUS_EXTPEND = 'EXTPEND'; const STATUS_FAIL = 'FAIL'; + const STATUS_INVALID = 'INVALID'; + const STATUS_VERIFY = 'VERIFY'; + const STATUS_PROCES = 'PROCES'; + const STATUS_PEND = 'PEND'; @@ -220,6 +224,10 @@ public function getStatusAllowableValues() self::STATUS_BCODE, self::STATUS_EXTPEND, self::STATUS_FAIL, + self::STATUS_INVALID, + self::STATUS_VERIFY, + self::STATUS_PROCES, + self::STATUS_PEND, ]; } @@ -469,7 +477,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail + * @param string|null $status Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending * * @return $this */ diff --git a/src/Model/OptionsAccount.php b/src/Model/OptionsAccount.php new file mode 100644 index 0000000..6b83ffe --- /dev/null +++ b/src/Model/OptionsAccount.php @@ -0,0 +1,574 @@ + 'int', + 'total' => 'string', + 'short_enabled' => 'bool', + 'unrealised_pnl' => 'string', + 'init_margin' => 'string', + 'maint_margin' => 'string', + 'order_margin' => 'string', + 'available' => 'string', + 'point' => 'string', + 'currency' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'user' => null, + 'total' => null, + 'short_enabled' => null, + 'unrealised_pnl' => null, + 'init_margin' => null, + 'maint_margin' => null, + 'order_margin' => null, + 'available' => null, + 'point' => null, + 'currency' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user' => 'user', + 'total' => 'total', + 'short_enabled' => 'short_enabled', + 'unrealised_pnl' => 'unrealised_pnl', + 'init_margin' => 'init_margin', + 'maint_margin' => 'maint_margin', + 'order_margin' => 'order_margin', + 'available' => 'available', + 'point' => 'point', + 'currency' => 'currency' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user' => 'setUser', + 'total' => 'setTotal', + 'short_enabled' => 'setShortEnabled', + 'unrealised_pnl' => 'setUnrealisedPnl', + 'init_margin' => 'setInitMargin', + 'maint_margin' => 'setMaintMargin', + 'order_margin' => 'setOrderMargin', + 'available' => 'setAvailable', + 'point' => 'setPoint', + 'currency' => 'setCurrency' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user' => 'getUser', + 'total' => 'getTotal', + 'short_enabled' => 'getShortEnabled', + 'unrealised_pnl' => 'getUnrealisedPnl', + 'init_margin' => 'getInitMargin', + 'maint_margin' => 'getMaintMargin', + 'order_margin' => 'getOrderMargin', + 'available' => 'getAvailable', + 'point' => 'getPoint', + 'currency' => 'getCurrency' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user'] = isset($data['user']) ? $data['user'] : null; + $this->container['total'] = isset($data['total']) ? $data['total'] : null; + $this->container['short_enabled'] = isset($data['short_enabled']) ? $data['short_enabled'] : null; + $this->container['unrealised_pnl'] = isset($data['unrealised_pnl']) ? $data['unrealised_pnl'] : null; + $this->container['init_margin'] = isset($data['init_margin']) ? $data['init_margin'] : null; + $this->container['maint_margin'] = isset($data['maint_margin']) ? $data['maint_margin'] : null; + $this->container['order_margin'] = isset($data['order_margin']) ? $data['order_margin'] : null; + $this->container['available'] = isset($data['available']) ? $data['available'] : null; + $this->container['point'] = isset($data['point']) ? $data['point'] : null; + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user + * + * @return int|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param int|null $user User ID + * + * @return $this + */ + public function setUser($user) + { + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets total + * + * @return string|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param string|null $total Total account balance + * + * @return $this + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets short_enabled + * + * @return bool|null + */ + public function getShortEnabled() + { + return $this->container['short_enabled']; + } + + /** + * Sets short_enabled + * + * @param bool|null $short_enabled If the account is allowed to short + * + * @return $this + */ + public function setShortEnabled($short_enabled) + { + $this->container['short_enabled'] = $short_enabled; + + return $this; + } + + /** + * Gets unrealised_pnl + * + * @return string|null + */ + public function getUnrealisedPnl() + { + return $this->container['unrealised_pnl']; + } + + /** + * Sets unrealised_pnl + * + * @param string|null $unrealised_pnl Unrealized PNL + * + * @return $this + */ + public function setUnrealisedPnl($unrealised_pnl) + { + $this->container['unrealised_pnl'] = $unrealised_pnl; + + return $this; + } + + /** + * Gets init_margin + * + * @return string|null + */ + public function getInitMargin() + { + return $this->container['init_margin']; + } + + /** + * Sets init_margin + * + * @param string|null $init_margin Initial position margin + * + * @return $this + */ + public function setInitMargin($init_margin) + { + $this->container['init_margin'] = $init_margin; + + return $this; + } + + /** + * Gets maint_margin + * + * @return string|null + */ + public function getMaintMargin() + { + return $this->container['maint_margin']; + } + + /** + * Sets maint_margin + * + * @param string|null $maint_margin Position maintenance margin + * + * @return $this + */ + public function setMaintMargin($maint_margin) + { + $this->container['maint_margin'] = $maint_margin; + + return $this; + } + + /** + * Gets order_margin + * + * @return string|null + */ + public function getOrderMargin() + { + return $this->container['order_margin']; + } + + /** + * Sets order_margin + * + * @param string|null $order_margin Order margin of unfinished orders + * + * @return $this + */ + public function setOrderMargin($order_margin) + { + $this->container['order_margin'] = $order_margin; + + return $this; + } + + /** + * Gets available + * + * @return string|null + */ + public function getAvailable() + { + return $this->container['available']; + } + + /** + * Sets available + * + * @param string|null $available Available balance to transfer out or trade + * + * @return $this + */ + public function setAvailable($available) + { + $this->container['available'] = $available; + + return $this; + } + + /** + * Gets point + * + * @return string|null + */ + public function getPoint() + { + return $this->container['point']; + } + + /** + * Sets point + * + * @param string|null $point POINT amount + * + * @return $this + */ + public function setPoint($point) + { + $this->container['point'] = $point; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency Settle currency + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OptionsAccountBook.php b/src/Model/OptionsAccountBook.php new file mode 100644 index 0000000..3c08418 --- /dev/null +++ b/src/Model/OptionsAccountBook.php @@ -0,0 +1,424 @@ + 'double', + 'change' => 'string', + 'balance' => 'string', + 'type' => 'string', + 'text' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'time' => 'double', + 'change' => null, + 'balance' => null, + 'type' => null, + 'text' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'time' => 'time', + 'change' => 'change', + 'balance' => 'balance', + 'type' => 'type', + 'text' => 'text' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'time' => 'setTime', + 'change' => 'setChange', + 'balance' => 'setBalance', + 'type' => 'setType', + 'text' => 'setText' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'time' => 'getTime', + 'change' => 'getChange', + 'balance' => 'getBalance', + 'type' => 'getType', + 'text' => 'getText' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['change'] = isset($data['change']) ? $data['change'] : null; + $this->container['balance'] = isset($data['balance']) ? $data['balance'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['text'] = isset($data['text']) ? $data['text'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets time + * + * @return double|null + */ + public function getTime() + { + return $this->container['time']; + } + + /** + * Sets time + * + * @param double|null $time Change time + * + * @return $this + */ + public function setTime($time) + { + $this->container['time'] = $time; + + return $this; + } + + /** + * Gets change + * + * @return string|null + */ + public function getChange() + { + return $this->container['change']; + } + + /** + * Sets change + * + * @param string|null $change Amount changed + * + * @return $this + */ + public function setChange($change) + { + $this->container['change'] = $change; + + return $this; + } + + /** + * Gets balance + * + * @return string|null + */ + public function getBalance() + { + return $this->container['balance']; + } + + /** + * Sets balance + * + * @param string|null $balance Account total balance after change + * + * @return $this + */ + public function setBalance($balance) + { + $this->container['balance'] = $balance; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets text + * + * @return string|null + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string|null $text custom text + * + * @return $this + */ + public function setText($text) + { + $this->container['text'] = $text; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OptionsContract.php b/src/Model/OptionsContract.php new file mode 100644 index 0000000..f5188b8 --- /dev/null +++ b/src/Model/OptionsContract.php @@ -0,0 +1,1025 @@ + 'string', + 'tag' => 'string', + 'create_time' => 'double', + 'expiration_time' => 'double', + 'is_call' => 'bool', + 'multiplier' => 'string', + 'underlying' => 'string', + 'underlying_price' => 'string', + 'last_price' => 'string', + 'mark_price' => 'string', + 'index_price' => 'string', + 'maker_fee_rate' => 'string', + 'taker_fee_rate' => 'string', + 'order_price_round' => 'string', + 'mark_price_round' => 'string', + 'order_size_min' => 'int', + 'order_size_max' => 'int', + 'order_price_deviate' => 'string', + 'ref_discount_rate' => 'string', + 'ref_rebate_rate' => 'string', + 'orderbook_id' => 'int', + 'trade_id' => 'int', + 'trade_size' => 'int', + 'position_size' => 'int', + 'orders_limit' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'tag' => null, + 'create_time' => 'double', + 'expiration_time' => 'double', + 'is_call' => null, + 'multiplier' => null, + 'underlying' => null, + 'underlying_price' => null, + 'last_price' => null, + 'mark_price' => null, + 'index_price' => null, + 'maker_fee_rate' => null, + 'taker_fee_rate' => null, + 'order_price_round' => null, + 'mark_price_round' => null, + 'order_size_min' => 'int64', + 'order_size_max' => 'int64', + 'order_price_deviate' => null, + 'ref_discount_rate' => null, + 'ref_rebate_rate' => null, + 'orderbook_id' => 'int64', + 'trade_id' => 'int64', + 'trade_size' => 'int64', + 'position_size' => 'int64', + 'orders_limit' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'tag' => 'tag', + 'create_time' => 'create_time', + 'expiration_time' => 'expiration_time', + 'is_call' => 'is_call', + 'multiplier' => 'multiplier', + 'underlying' => 'underlying', + 'underlying_price' => 'underlying_price', + 'last_price' => 'last_price', + 'mark_price' => 'mark_price', + 'index_price' => 'index_price', + 'maker_fee_rate' => 'maker_fee_rate', + 'taker_fee_rate' => 'taker_fee_rate', + 'order_price_round' => 'order_price_round', + 'mark_price_round' => 'mark_price_round', + 'order_size_min' => 'order_size_min', + 'order_size_max' => 'order_size_max', + 'order_price_deviate' => 'order_price_deviate', + 'ref_discount_rate' => 'ref_discount_rate', + 'ref_rebate_rate' => 'ref_rebate_rate', + 'orderbook_id' => 'orderbook_id', + 'trade_id' => 'trade_id', + 'trade_size' => 'trade_size', + 'position_size' => 'position_size', + 'orders_limit' => 'orders_limit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'tag' => 'setTag', + 'create_time' => 'setCreateTime', + 'expiration_time' => 'setExpirationTime', + 'is_call' => 'setIsCall', + 'multiplier' => 'setMultiplier', + 'underlying' => 'setUnderlying', + 'underlying_price' => 'setUnderlyingPrice', + 'last_price' => 'setLastPrice', + 'mark_price' => 'setMarkPrice', + 'index_price' => 'setIndexPrice', + 'maker_fee_rate' => 'setMakerFeeRate', + 'taker_fee_rate' => 'setTakerFeeRate', + 'order_price_round' => 'setOrderPriceRound', + 'mark_price_round' => 'setMarkPriceRound', + 'order_size_min' => 'setOrderSizeMin', + 'order_size_max' => 'setOrderSizeMax', + 'order_price_deviate' => 'setOrderPriceDeviate', + 'ref_discount_rate' => 'setRefDiscountRate', + 'ref_rebate_rate' => 'setRefRebateRate', + 'orderbook_id' => 'setOrderbookId', + 'trade_id' => 'setTradeId', + 'trade_size' => 'setTradeSize', + 'position_size' => 'setPositionSize', + 'orders_limit' => 'setOrdersLimit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'tag' => 'getTag', + 'create_time' => 'getCreateTime', + 'expiration_time' => 'getExpirationTime', + 'is_call' => 'getIsCall', + 'multiplier' => 'getMultiplier', + 'underlying' => 'getUnderlying', + 'underlying_price' => 'getUnderlyingPrice', + 'last_price' => 'getLastPrice', + 'mark_price' => 'getMarkPrice', + 'index_price' => 'getIndexPrice', + 'maker_fee_rate' => 'getMakerFeeRate', + 'taker_fee_rate' => 'getTakerFeeRate', + 'order_price_round' => 'getOrderPriceRound', + 'mark_price_round' => 'getMarkPriceRound', + 'order_size_min' => 'getOrderSizeMin', + 'order_size_max' => 'getOrderSizeMax', + 'order_price_deviate' => 'getOrderPriceDeviate', + 'ref_discount_rate' => 'getRefDiscountRate', + 'ref_rebate_rate' => 'getRefRebateRate', + 'orderbook_id' => 'getOrderbookId', + 'trade_id' => 'getTradeId', + 'trade_size' => 'getTradeSize', + 'position_size' => 'getPositionSize', + 'orders_limit' => 'getOrdersLimit' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['create_time'] = isset($data['create_time']) ? $data['create_time'] : null; + $this->container['expiration_time'] = isset($data['expiration_time']) ? $data['expiration_time'] : null; + $this->container['is_call'] = isset($data['is_call']) ? $data['is_call'] : null; + $this->container['multiplier'] = isset($data['multiplier']) ? $data['multiplier'] : null; + $this->container['underlying'] = isset($data['underlying']) ? $data['underlying'] : null; + $this->container['underlying_price'] = isset($data['underlying_price']) ? $data['underlying_price'] : null; + $this->container['last_price'] = isset($data['last_price']) ? $data['last_price'] : null; + $this->container['mark_price'] = isset($data['mark_price']) ? $data['mark_price'] : null; + $this->container['index_price'] = isset($data['index_price']) ? $data['index_price'] : null; + $this->container['maker_fee_rate'] = isset($data['maker_fee_rate']) ? $data['maker_fee_rate'] : null; + $this->container['taker_fee_rate'] = isset($data['taker_fee_rate']) ? $data['taker_fee_rate'] : null; + $this->container['order_price_round'] = isset($data['order_price_round']) ? $data['order_price_round'] : null; + $this->container['mark_price_round'] = isset($data['mark_price_round']) ? $data['mark_price_round'] : null; + $this->container['order_size_min'] = isset($data['order_size_min']) ? $data['order_size_min'] : null; + $this->container['order_size_max'] = isset($data['order_size_max']) ? $data['order_size_max'] : null; + $this->container['order_price_deviate'] = isset($data['order_price_deviate']) ? $data['order_price_deviate'] : null; + $this->container['ref_discount_rate'] = isset($data['ref_discount_rate']) ? $data['ref_discount_rate'] : null; + $this->container['ref_rebate_rate'] = isset($data['ref_rebate_rate']) ? $data['ref_rebate_rate'] : null; + $this->container['orderbook_id'] = isset($data['orderbook_id']) ? $data['orderbook_id'] : null; + $this->container['trade_id'] = isset($data['trade_id']) ? $data['trade_id'] : null; + $this->container['trade_size'] = isset($data['trade_size']) ? $data['trade_size'] : null; + $this->container['position_size'] = isset($data['position_size']) ? $data['position_size'] : null; + $this->container['orders_limit'] = isset($data['orders_limit']) ? $data['orders_limit'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Futures contract + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets tag + * + * @return string|null + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string|null $tag 标记 + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets create_time + * + * @return double|null + */ + public function getCreateTime() + { + return $this->container['create_time']; + } + + /** + * Sets create_time + * + * @param double|null $create_time Creation time + * + * @return $this + */ + public function setCreateTime($create_time) + { + $this->container['create_time'] = $create_time; + + return $this; + } + + /** + * Gets expiration_time + * + * @return double|null + */ + public function getExpirationTime() + { + return $this->container['expiration_time']; + } + + /** + * Sets expiration_time + * + * @param double|null $expiration_time Expiration time + * + * @return $this + */ + public function setExpirationTime($expiration_time) + { + $this->container['expiration_time'] = $expiration_time; + + return $this; + } + + /** + * Gets is_call + * + * @return bool|null + */ + public function getIsCall() + { + return $this->container['is_call']; + } + + /** + * Sets is_call + * + * @param bool|null $is_call `true` means call options, while `false` is put options + * + * @return $this + */ + public function setIsCall($is_call) + { + $this->container['is_call'] = $is_call; + + return $this; + } + + /** + * Gets multiplier + * + * @return string|null + */ + public function getMultiplier() + { + return $this->container['multiplier']; + } + + /** + * Sets multiplier + * + * @param string|null $multiplier Multiplier used in converting from invoicing to settlement currency + * + * @return $this + */ + public function setMultiplier($multiplier) + { + $this->container['multiplier'] = $multiplier; + + return $this; + } + + /** + * Gets underlying + * + * @return string|null + */ + public function getUnderlying() + { + return $this->container['underlying']; + } + + /** + * Sets underlying + * + * @param string|null $underlying Underlying + * + * @return $this + */ + public function setUnderlying($underlying) + { + $this->container['underlying'] = $underlying; + + return $this; + } + + /** + * Gets underlying_price + * + * @return string|null + */ + public function getUnderlyingPrice() + { + return $this->container['underlying_price']; + } + + /** + * Sets underlying_price + * + * @param string|null $underlying_price Underlying price + * + * @return $this + */ + public function setUnderlyingPrice($underlying_price) + { + $this->container['underlying_price'] = $underlying_price; + + return $this; + } + + /** + * Gets last_price + * + * @return string|null + */ + public function getLastPrice() + { + return $this->container['last_price']; + } + + /** + * Sets last_price + * + * @param string|null $last_price Last trading price + * + * @return $this + */ + public function setLastPrice($last_price) + { + $this->container['last_price'] = $last_price; + + return $this; + } + + /** + * Gets mark_price + * + * @return string|null + */ + public function getMarkPrice() + { + return $this->container['mark_price']; + } + + /** + * Sets mark_price + * + * @param string|null $mark_price Current mark price + * + * @return $this + */ + public function setMarkPrice($mark_price) + { + $this->container['mark_price'] = $mark_price; + + return $this; + } + + /** + * Gets index_price + * + * @return string|null + */ + public function getIndexPrice() + { + return $this->container['index_price']; + } + + /** + * Sets index_price + * + * @param string|null $index_price Current index price + * + * @return $this + */ + public function setIndexPrice($index_price) + { + $this->container['index_price'] = $index_price; + + return $this; + } + + /** + * Gets maker_fee_rate + * + * @return string|null + */ + public function getMakerFeeRate() + { + return $this->container['maker_fee_rate']; + } + + /** + * Sets maker_fee_rate + * + * @param string|null $maker_fee_rate Maker fee rate, where negative means rebate + * + * @return $this + */ + public function setMakerFeeRate($maker_fee_rate) + { + $this->container['maker_fee_rate'] = $maker_fee_rate; + + return $this; + } + + /** + * Gets taker_fee_rate + * + * @return string|null + */ + public function getTakerFeeRate() + { + return $this->container['taker_fee_rate']; + } + + /** + * Sets taker_fee_rate + * + * @param string|null $taker_fee_rate Taker fee rate + * + * @return $this + */ + public function setTakerFeeRate($taker_fee_rate) + { + $this->container['taker_fee_rate'] = $taker_fee_rate; + + return $this; + } + + /** + * Gets order_price_round + * + * @return string|null + */ + public function getOrderPriceRound() + { + return $this->container['order_price_round']; + } + + /** + * Sets order_price_round + * + * @param string|null $order_price_round Minimum order price increment + * + * @return $this + */ + public function setOrderPriceRound($order_price_round) + { + $this->container['order_price_round'] = $order_price_round; + + return $this; + } + + /** + * Gets mark_price_round + * + * @return string|null + */ + public function getMarkPriceRound() + { + return $this->container['mark_price_round']; + } + + /** + * Sets mark_price_round + * + * @param string|null $mark_price_round Minimum mark price increment + * + * @return $this + */ + public function setMarkPriceRound($mark_price_round) + { + $this->container['mark_price_round'] = $mark_price_round; + + return $this; + } + + /** + * Gets order_size_min + * + * @return int|null + */ + public function getOrderSizeMin() + { + return $this->container['order_size_min']; + } + + /** + * Sets order_size_min + * + * @param int|null $order_size_min Minimum order size the contract allowed + * + * @return $this + */ + public function setOrderSizeMin($order_size_min) + { + $this->container['order_size_min'] = $order_size_min; + + return $this; + } + + /** + * Gets order_size_max + * + * @return int|null + */ + public function getOrderSizeMax() + { + return $this->container['order_size_max']; + } + + /** + * Sets order_size_max + * + * @param int|null $order_size_max Maximum order size the contract allowed + * + * @return $this + */ + public function setOrderSizeMax($order_size_max) + { + $this->container['order_size_max'] = $order_size_max; + + return $this; + } + + /** + * Gets order_price_deviate + * + * @return string|null + */ + public function getOrderPriceDeviate() + { + return $this->container['order_price_deviate']; + } + + /** + * Sets order_price_deviate + * + * @param string|null $order_price_deviate deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate + * + * @return $this + */ + public function setOrderPriceDeviate($order_price_deviate) + { + $this->container['order_price_deviate'] = $order_price_deviate; + + return $this; + } + + /** + * Gets ref_discount_rate + * + * @return string|null + */ + public function getRefDiscountRate() + { + return $this->container['ref_discount_rate']; + } + + /** + * Sets ref_discount_rate + * + * @param string|null $ref_discount_rate Referral fee rate discount + * + * @return $this + */ + public function setRefDiscountRate($ref_discount_rate) + { + $this->container['ref_discount_rate'] = $ref_discount_rate; + + return $this; + } + + /** + * Gets ref_rebate_rate + * + * @return string|null + */ + public function getRefRebateRate() + { + return $this->container['ref_rebate_rate']; + } + + /** + * Sets ref_rebate_rate + * + * @param string|null $ref_rebate_rate Referrer commission rate + * + * @return $this + */ + public function setRefRebateRate($ref_rebate_rate) + { + $this->container['ref_rebate_rate'] = $ref_rebate_rate; + + return $this; + } + + /** + * Gets orderbook_id + * + * @return int|null + */ + public function getOrderbookId() + { + return $this->container['orderbook_id']; + } + + /** + * Sets orderbook_id + * + * @param int|null $orderbook_id Current orderbook ID + * + * @return $this + */ + public function setOrderbookId($orderbook_id) + { + $this->container['orderbook_id'] = $orderbook_id; + + return $this; + } + + /** + * Gets trade_id + * + * @return int|null + */ + public function getTradeId() + { + return $this->container['trade_id']; + } + + /** + * Sets trade_id + * + * @param int|null $trade_id Current trade ID + * + * @return $this + */ + public function setTradeId($trade_id) + { + $this->container['trade_id'] = $trade_id; + + return $this; + } + + /** + * Gets trade_size + * + * @return int|null + */ + public function getTradeSize() + { + return $this->container['trade_size']; + } + + /** + * Sets trade_size + * + * @param int|null $trade_size Historical accumulated trade size + * + * @return $this + */ + public function setTradeSize($trade_size) + { + $this->container['trade_size'] = $trade_size; + + return $this; + } + + /** + * Gets position_size + * + * @return int|null + */ + public function getPositionSize() + { + return $this->container['position_size']; + } + + /** + * Sets position_size + * + * @param int|null $position_size Current total long position size + * + * @return $this + */ + public function setPositionSize($position_size) + { + $this->container['position_size'] = $position_size; + + return $this; + } + + /** + * Gets orders_limit + * + * @return int|null + */ + public function getOrdersLimit() + { + return $this->container['orders_limit']; + } + + /** + * Sets orders_limit + * + * @param int|null $orders_limit Maximum number of open orders + * + * @return $this + */ + public function setOrdersLimit($orders_limit) + { + $this->container['orders_limit'] = $orders_limit; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OptionsMyTrade.php b/src/Model/OptionsMyTrade.php new file mode 100644 index 0000000..3b96536 --- /dev/null +++ b/src/Model/OptionsMyTrade.php @@ -0,0 +1,546 @@ + 'int', + 'create_time' => 'double', + 'contract' => 'string', + 'order_id' => 'int', + 'size' => 'int', + 'price' => 'string', + 'underlying_price' => 'string', + 'role' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'create_time' => 'double', + 'contract' => null, + 'order_id' => null, + 'size' => 'int64', + 'price' => null, + 'underlying_price' => null, + 'role' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'create_time' => 'create_time', + 'contract' => 'contract', + 'order_id' => 'order_id', + 'size' => 'size', + 'price' => 'price', + 'underlying_price' => 'underlying_price', + 'role' => 'role' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'create_time' => 'setCreateTime', + 'contract' => 'setContract', + 'order_id' => 'setOrderId', + 'size' => 'setSize', + 'price' => 'setPrice', + 'underlying_price' => 'setUnderlyingPrice', + 'role' => 'setRole' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'create_time' => 'getCreateTime', + 'contract' => 'getContract', + 'order_id' => 'getOrderId', + 'size' => 'getSize', + 'price' => 'getPrice', + 'underlying_price' => 'getUnderlyingPrice', + 'role' => 'getRole' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const ROLE_TAKER = 'taker'; + const ROLE_MAKER = 'maker'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRoleAllowableValues() + { + return [ + self::ROLE_TAKER, + self::ROLE_MAKER, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['create_time'] = isset($data['create_time']) ? $data['create_time'] : null; + $this->container['contract'] = isset($data['contract']) ? $data['contract'] : null; + $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null; + $this->container['size'] = isset($data['size']) ? $data['size'] : null; + $this->container['price'] = isset($data['price']) ? $data['price'] : null; + $this->container['underlying_price'] = isset($data['underlying_price']) ? $data['underlying_price'] : null; + $this->container['role'] = isset($data['role']) ? $data['role'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getRoleAllowableValues(); + if (!is_null($this->container['role']) && !in_array($this->container['role'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'role', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id Trade ID + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets create_time + * + * @return double|null + */ + public function getCreateTime() + { + return $this->container['create_time']; + } + + /** + * Sets create_time + * + * @param double|null $create_time Trading time + * + * @return $this + */ + public function setCreateTime($create_time) + { + $this->container['create_time'] = $create_time; + + return $this; + } + + /** + * Gets contract + * + * @return string|null + */ + public function getContract() + { + return $this->container['contract']; + } + + /** + * Sets contract + * + * @param string|null $contract Futures contract + * + * @return $this + */ + public function setContract($contract) + { + $this->container['contract'] = $contract; + + return $this; + } + + /** + * Gets order_id + * + * @return int|null + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param int|null $order_id Order ID related + * + * @return $this + */ + public function setOrderId($order_id) + { + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets size + * + * @return int|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int|null $size Trading size + * + * @return $this + */ + public function setSize($size) + { + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets price + * + * @return string|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param string|null $price Trading price + * + * @return $this + */ + public function setPrice($price) + { + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets underlying_price + * + * @return string|null + */ + public function getUnderlyingPrice() + { + return $this->container['underlying_price']; + } + + /** + * Sets underlying_price + * + * @param string|null $underlying_price Underlying price + * + * @return $this + */ + public function setUnderlyingPrice($underlying_price) + { + $this->container['underlying_price'] = $underlying_price; + + return $this; + } + + /** + * Gets role + * + * @return string|null + */ + public function getRole() + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param string|null $role Trade role. Available values are `taker` and `maker` + * + * @return $this + */ + public function setRole($role) + { + $allowedValues = $this->getRoleAllowableValues(); + if (!is_null($role) && !in_array($role, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'role', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['role'] = $role; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OptionsOrder.php b/src/Model/OptionsOrder.php new file mode 100644 index 0000000..d2fd3e9 --- /dev/null +++ b/src/Model/OptionsOrder.php @@ -0,0 +1,1051 @@ + 'int', + 'user' => 'int', + 'create_time' => 'double', + 'finish_time' => 'double', + 'finish_as' => 'string', + 'status' => 'string', + 'contract' => 'string', + 'size' => 'int', + 'iceberg' => 'int', + 'price' => 'string', + 'close' => 'bool', + 'is_close' => 'bool', + 'reduce_only' => 'bool', + 'is_reduce_only' => 'bool', + 'is_liq' => 'bool', + 'tif' => 'string', + 'left' => 'int', + 'fill_price' => 'string', + 'text' => 'string', + 'tkfr' => 'string', + 'mkfr' => 'string', + 'refu' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'user' => null, + 'create_time' => 'double', + 'finish_time' => 'double', + 'finish_as' => null, + 'status' => null, + 'contract' => null, + 'size' => 'int64', + 'iceberg' => 'int64', + 'price' => null, + 'close' => null, + 'is_close' => null, + 'reduce_only' => null, + 'is_reduce_only' => null, + 'is_liq' => null, + 'tif' => null, + 'left' => 'int64', + 'fill_price' => null, + 'text' => null, + 'tkfr' => null, + 'mkfr' => null, + 'refu' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'user' => 'user', + 'create_time' => 'create_time', + 'finish_time' => 'finish_time', + 'finish_as' => 'finish_as', + 'status' => 'status', + 'contract' => 'contract', + 'size' => 'size', + 'iceberg' => 'iceberg', + 'price' => 'price', + 'close' => 'close', + 'is_close' => 'is_close', + 'reduce_only' => 'reduce_only', + 'is_reduce_only' => 'is_reduce_only', + 'is_liq' => 'is_liq', + 'tif' => 'tif', + 'left' => 'left', + 'fill_price' => 'fill_price', + 'text' => 'text', + 'tkfr' => 'tkfr', + 'mkfr' => 'mkfr', + 'refu' => 'refu' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'user' => 'setUser', + 'create_time' => 'setCreateTime', + 'finish_time' => 'setFinishTime', + 'finish_as' => 'setFinishAs', + 'status' => 'setStatus', + 'contract' => 'setContract', + 'size' => 'setSize', + 'iceberg' => 'setIceberg', + 'price' => 'setPrice', + 'close' => 'setClose', + 'is_close' => 'setIsClose', + 'reduce_only' => 'setReduceOnly', + 'is_reduce_only' => 'setIsReduceOnly', + 'is_liq' => 'setIsLiq', + 'tif' => 'setTif', + 'left' => 'setLeft', + 'fill_price' => 'setFillPrice', + 'text' => 'setText', + 'tkfr' => 'setTkfr', + 'mkfr' => 'setMkfr', + 'refu' => 'setRefu' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'user' => 'getUser', + 'create_time' => 'getCreateTime', + 'finish_time' => 'getFinishTime', + 'finish_as' => 'getFinishAs', + 'status' => 'getStatus', + 'contract' => 'getContract', + 'size' => 'getSize', + 'iceberg' => 'getIceberg', + 'price' => 'getPrice', + 'close' => 'getClose', + 'is_close' => 'getIsClose', + 'reduce_only' => 'getReduceOnly', + 'is_reduce_only' => 'getIsReduceOnly', + 'is_liq' => 'getIsLiq', + 'tif' => 'getTif', + 'left' => 'getLeft', + 'fill_price' => 'getFillPrice', + 'text' => 'getText', + 'tkfr' => 'getTkfr', + 'mkfr' => 'getMkfr', + 'refu' => 'getRefu' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const FINISH_AS_FILLED = 'filled'; + const FINISH_AS_CANCELLED = 'cancelled'; + const FINISH_AS_LIQUIDATED = 'liquidated'; + const FINISH_AS_IOC = 'ioc'; + const FINISH_AS_AUTO_DELEVERAGED = 'auto_deleveraged'; + const FINISH_AS_REDUCE_ONLY = 'reduce_only'; + const FINISH_AS_POSITION_CLOSED = 'position_closed'; + const FINISH_AS_REDUCE_OUT = 'reduce_out'; + const STATUS_OPEN = 'open'; + const STATUS_FINISHED = 'finished'; + const TIF_GTC = 'gtc'; + const TIF_IOC = 'ioc'; + const TIF_POC = 'poc'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFinishAsAllowableValues() + { + return [ + self::FINISH_AS_FILLED, + self::FINISH_AS_CANCELLED, + self::FINISH_AS_LIQUIDATED, + self::FINISH_AS_IOC, + self::FINISH_AS_AUTO_DELEVERAGED, + self::FINISH_AS_REDUCE_ONLY, + self::FINISH_AS_POSITION_CLOSED, + self::FINISH_AS_REDUCE_OUT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_OPEN, + self::STATUS_FINISHED, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTifAllowableValues() + { + return [ + self::TIF_GTC, + self::TIF_IOC, + self::TIF_POC, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['user'] = isset($data['user']) ? $data['user'] : null; + $this->container['create_time'] = isset($data['create_time']) ? $data['create_time'] : null; + $this->container['finish_time'] = isset($data['finish_time']) ? $data['finish_time'] : null; + $this->container['finish_as'] = isset($data['finish_as']) ? $data['finish_as'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['contract'] = isset($data['contract']) ? $data['contract'] : null; + $this->container['size'] = isset($data['size']) ? $data['size'] : null; + $this->container['iceberg'] = isset($data['iceberg']) ? $data['iceberg'] : null; + $this->container['price'] = isset($data['price']) ? $data['price'] : null; + $this->container['close'] = isset($data['close']) ? $data['close'] : false; + $this->container['is_close'] = isset($data['is_close']) ? $data['is_close'] : null; + $this->container['reduce_only'] = isset($data['reduce_only']) ? $data['reduce_only'] : false; + $this->container['is_reduce_only'] = isset($data['is_reduce_only']) ? $data['is_reduce_only'] : null; + $this->container['is_liq'] = isset($data['is_liq']) ? $data['is_liq'] : null; + $this->container['tif'] = isset($data['tif']) ? $data['tif'] : 'gtc'; + $this->container['left'] = isset($data['left']) ? $data['left'] : null; + $this->container['fill_price'] = isset($data['fill_price']) ? $data['fill_price'] : null; + $this->container['text'] = isset($data['text']) ? $data['text'] : null; + $this->container['tkfr'] = isset($data['tkfr']) ? $data['tkfr'] : null; + $this->container['mkfr'] = isset($data['mkfr']) ? $data['mkfr'] : null; + $this->container['refu'] = isset($data['refu']) ? $data['refu'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFinishAsAllowableValues(); + if (!is_null($this->container['finish_as']) && !in_array($this->container['finish_as'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'finish_as', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['contract'] === null) { + $invalidProperties[] = "'contract' can't be null"; + } + if ($this->container['size'] === null) { + $invalidProperties[] = "'size' can't be null"; + } + $allowedValues = $this->getTifAllowableValues(); + if (!is_null($this->container['tif']) && !in_array($this->container['tif'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'tif', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id Options order ID + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets user + * + * @return int|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param int|null $user User ID + * + * @return $this + */ + public function setUser($user) + { + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets create_time + * + * @return double|null + */ + public function getCreateTime() + { + return $this->container['create_time']; + } + + /** + * Sets create_time + * + * @param double|null $create_time Creation time of order + * + * @return $this + */ + public function setCreateTime($create_time) + { + $this->container['create_time'] = $create_time; + + return $this; + } + + /** + * Gets finish_time + * + * @return double|null + */ + public function getFinishTime() + { + return $this->container['finish_time']; + } + + /** + * Sets finish_time + * + * @param double|null $finish_time Order finished time. Not returned if order is open + * + * @return $this + */ + public function setFinishTime($finish_time) + { + $this->container['finish_time'] = $finish_time; + + return $this; + } + + /** + * Gets finish_as + * + * @return string|null + */ + public function getFinishAs() + { + return $this->container['finish_as']; + } + + /** + * Sets finish_as + * + * @param string|null $finish_as How the order was finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set- position_closed: cancelled because of position close + * + * @return $this + */ + public function setFinishAs($finish_as) + { + $allowedValues = $this->getFinishAsAllowableValues(); + if (!is_null($finish_as) && !in_array($finish_as, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'finish_as', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['finish_as'] = $finish_as; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Order status - `open`: waiting to be traded - `finished`: finished + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets contract + * + * @return string + */ + public function getContract() + { + return $this->container['contract']; + } + + /** + * Sets contract + * + * @param string $contract Contract name + * + * @return $this + */ + public function setContract($contract) + { + $this->container['contract'] = $contract; + + return $this; + } + + /** + * Gets size + * + * @return int + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int $size Order size. Specify positive number to make a bid, and negative number to ask + * + * @return $this + */ + public function setSize($size) + { + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets iceberg + * + * @return int|null + */ + public function getIceberg() + { + return $this->container['iceberg']; + } + + /** + * Sets iceberg + * + * @param int|null $iceberg Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size + * + * @return $this + */ + public function setIceberg($iceberg) + { + $this->container['iceberg'] = $iceberg; + + return $this; + } + + /** + * Gets price + * + * @return string|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param string|null $price Order price. 0 for market order with `tif` set as `ioc` + * + * @return $this + */ + public function setPrice($price) + { + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets close + * + * @return bool|null + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param bool|null $close Set as `true` to close the position, with `size` set to 0 + * + * @return $this + */ + public function setClose($close) + { + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets is_close + * + * @return bool|null + */ + public function getIsClose() + { + return $this->container['is_close']; + } + + /** + * Sets is_close + * + * @param bool|null $is_close Is the order to close position + * + * @return $this + */ + public function setIsClose($is_close) + { + $this->container['is_close'] = $is_close; + + return $this; + } + + /** + * Gets reduce_only + * + * @return bool|null + */ + public function getReduceOnly() + { + return $this->container['reduce_only']; + } + + /** + * Sets reduce_only + * + * @param bool|null $reduce_only Set as `true` to be reduce-only order + * + * @return $this + */ + public function setReduceOnly($reduce_only) + { + $this->container['reduce_only'] = $reduce_only; + + return $this; + } + + /** + * Gets is_reduce_only + * + * @return bool|null + */ + public function getIsReduceOnly() + { + return $this->container['is_reduce_only']; + } + + /** + * Sets is_reduce_only + * + * @param bool|null $is_reduce_only Is the order reduce-only + * + * @return $this + */ + public function setIsReduceOnly($is_reduce_only) + { + $this->container['is_reduce_only'] = $is_reduce_only; + + return $this; + } + + /** + * Gets is_liq + * + * @return bool|null + */ + public function getIsLiq() + { + return $this->container['is_liq']; + } + + /** + * Sets is_liq + * + * @param bool|null $is_liq Is the order for liquidation + * + * @return $this + */ + public function setIsLiq($is_liq) + { + $this->container['is_liq'] = $is_liq; + + return $this; + } + + /** + * Gets tif + * + * @return string|null + */ + public function getTif() + { + return $this->container['tif']; + } + + /** + * Sets tif + * + * @param string|null $tif Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only + * + * @return $this + */ + public function setTif($tif) + { + $allowedValues = $this->getTifAllowableValues(); + if (!is_null($tif) && !in_array($tif, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'tif', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['tif'] = $tif; + + return $this; + } + + /** + * Gets left + * + * @return int|null + */ + public function getLeft() + { + return $this->container['left']; + } + + /** + * Sets left + * + * @param int|null $left Size left to be traded + * + * @return $this + */ + public function setLeft($left) + { + $this->container['left'] = $left; + + return $this; + } + + /** + * Gets fill_price + * + * @return string|null + */ + public function getFillPrice() + { + return $this->container['fill_price']; + } + + /** + * Sets fill_price + * + * @param string|null $fill_price Fill price of the order + * + * @return $this + */ + public function setFillPrice($fill_price) + { + $this->container['fill_price'] = $fill_price; + + return $this; + } + + /** + * Gets text + * + * @return string|null + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string|null $text User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance + * + * @return $this + */ + public function setText($text) + { + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets tkfr + * + * @return string|null + */ + public function getTkfr() + { + return $this->container['tkfr']; + } + + /** + * Sets tkfr + * + * @param string|null $tkfr Taker fee + * + * @return $this + */ + public function setTkfr($tkfr) + { + $this->container['tkfr'] = $tkfr; + + return $this; + } + + /** + * Gets mkfr + * + * @return string|null + */ + public function getMkfr() + { + return $this->container['mkfr']; + } + + /** + * Sets mkfr + * + * @param string|null $mkfr Maker fee + * + * @return $this + */ + public function setMkfr($mkfr) + { + $this->container['mkfr'] = $mkfr; + + return $this; + } + + /** + * Gets refu + * + * @return int|null + */ + public function getRefu() + { + return $this->container['refu']; + } + + /** + * Sets refu + * + * @param int|null $refu Reference user ID + * + * @return $this + */ + public function setRefu($refu) + { + $this->container['refu'] = $refu; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OptionsPosition.php b/src/Model/OptionsPosition.php new file mode 100644 index 0000000..cc0b4f9 --- /dev/null +++ b/src/Model/OptionsPosition.php @@ -0,0 +1,545 @@ + 'int', + 'contract' => 'string', + 'size' => 'int', + 'entry_price' => 'string', + 'mark_price' => 'string', + 'realised_pnl' => 'string', + 'unrealised_pnl' => 'string', + 'pending_orders' => 'int', + 'close_order' => '\GateApi\Model\PositionCloseOrder' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'user' => null, + 'contract' => null, + 'size' => 'int64', + 'entry_price' => null, + 'mark_price' => null, + 'realised_pnl' => null, + 'unrealised_pnl' => null, + 'pending_orders' => null, + 'close_order' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user' => 'user', + 'contract' => 'contract', + 'size' => 'size', + 'entry_price' => 'entry_price', + 'mark_price' => 'mark_price', + 'realised_pnl' => 'realised_pnl', + 'unrealised_pnl' => 'unrealised_pnl', + 'pending_orders' => 'pending_orders', + 'close_order' => 'close_order' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user' => 'setUser', + 'contract' => 'setContract', + 'size' => 'setSize', + 'entry_price' => 'setEntryPrice', + 'mark_price' => 'setMarkPrice', + 'realised_pnl' => 'setRealisedPnl', + 'unrealised_pnl' => 'setUnrealisedPnl', + 'pending_orders' => 'setPendingOrders', + 'close_order' => 'setCloseOrder' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user' => 'getUser', + 'contract' => 'getContract', + 'size' => 'getSize', + 'entry_price' => 'getEntryPrice', + 'mark_price' => 'getMarkPrice', + 'realised_pnl' => 'getRealisedPnl', + 'unrealised_pnl' => 'getUnrealisedPnl', + 'pending_orders' => 'getPendingOrders', + 'close_order' => 'getCloseOrder' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user'] = isset($data['user']) ? $data['user'] : null; + $this->container['contract'] = isset($data['contract']) ? $data['contract'] : null; + $this->container['size'] = isset($data['size']) ? $data['size'] : null; + $this->container['entry_price'] = isset($data['entry_price']) ? $data['entry_price'] : null; + $this->container['mark_price'] = isset($data['mark_price']) ? $data['mark_price'] : null; + $this->container['realised_pnl'] = isset($data['realised_pnl']) ? $data['realised_pnl'] : null; + $this->container['unrealised_pnl'] = isset($data['unrealised_pnl']) ? $data['unrealised_pnl'] : null; + $this->container['pending_orders'] = isset($data['pending_orders']) ? $data['pending_orders'] : null; + $this->container['close_order'] = isset($data['close_order']) ? $data['close_order'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user + * + * @return int|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param int|null $user User ID + * + * @return $this + */ + public function setUser($user) + { + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets contract + * + * @return string|null + */ + public function getContract() + { + return $this->container['contract']; + } + + /** + * Sets contract + * + * @param string|null $contract Futures contract + * + * @return $this + */ + public function setContract($contract) + { + $this->container['contract'] = $contract; + + return $this; + } + + /** + * Gets size + * + * @return int|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int|null $size Position size + * + * @return $this + */ + public function setSize($size) + { + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets entry_price + * + * @return string|null + */ + public function getEntryPrice() + { + return $this->container['entry_price']; + } + + /** + * Sets entry_price + * + * @param string|null $entry_price Entry price + * + * @return $this + */ + public function setEntryPrice($entry_price) + { + $this->container['entry_price'] = $entry_price; + + return $this; + } + + /** + * Gets mark_price + * + * @return string|null + */ + public function getMarkPrice() + { + return $this->container['mark_price']; + } + + /** + * Sets mark_price + * + * @param string|null $mark_price Current mark price + * + * @return $this + */ + public function setMarkPrice($mark_price) + { + $this->container['mark_price'] = $mark_price; + + return $this; + } + + /** + * Gets realised_pnl + * + * @return string|null + */ + public function getRealisedPnl() + { + return $this->container['realised_pnl']; + } + + /** + * Sets realised_pnl + * + * @param string|null $realised_pnl Realized PNL + * + * @return $this + */ + public function setRealisedPnl($realised_pnl) + { + $this->container['realised_pnl'] = $realised_pnl; + + return $this; + } + + /** + * Gets unrealised_pnl + * + * @return string|null + */ + public function getUnrealisedPnl() + { + return $this->container['unrealised_pnl']; + } + + /** + * Sets unrealised_pnl + * + * @param string|null $unrealised_pnl Unrealized PNL + * + * @return $this + */ + public function setUnrealisedPnl($unrealised_pnl) + { + $this->container['unrealised_pnl'] = $unrealised_pnl; + + return $this; + } + + /** + * Gets pending_orders + * + * @return int|null + */ + public function getPendingOrders() + { + return $this->container['pending_orders']; + } + + /** + * Sets pending_orders + * + * @param int|null $pending_orders Current open orders + * + * @return $this + */ + public function setPendingOrders($pending_orders) + { + $this->container['pending_orders'] = $pending_orders; + + return $this; + } + + /** + * Gets close_order + * + * @return \GateApi\Model\PositionCloseOrder|null + */ + public function getCloseOrder() + { + return $this->container['close_order']; + } + + /** + * Sets close_order + * + * @param \GateApi\Model\PositionCloseOrder|null $close_order close_order + * + * @return $this + */ + public function setCloseOrder($close_order) + { + $this->container['close_order'] = $close_order; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OptionsPositionClose.php b/src/Model/OptionsPositionClose.php new file mode 100644 index 0000000..7e1d174 --- /dev/null +++ b/src/Model/OptionsPositionClose.php @@ -0,0 +1,486 @@ + 'double', + 'contract' => 'string', + 'side' => 'string', + 'pnl' => 'string', + 'text' => 'string', + 'settle_size' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'time' => 'double', + 'contract' => null, + 'side' => null, + 'pnl' => null, + 'text' => null, + 'settle_size' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'time' => 'time', + 'contract' => 'contract', + 'side' => 'side', + 'pnl' => 'pnl', + 'text' => 'text', + 'settle_size' => 'settle_size' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'time' => 'setTime', + 'contract' => 'setContract', + 'side' => 'setSide', + 'pnl' => 'setPnl', + 'text' => 'setText', + 'settle_size' => 'setSettleSize' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'time' => 'getTime', + 'contract' => 'getContract', + 'side' => 'getSide', + 'pnl' => 'getPnl', + 'text' => 'getText', + 'settle_size' => 'getSettleSize' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const SIDE_LONG = 'long'; + const SIDE_SHORT = 'short'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSideAllowableValues() + { + return [ + self::SIDE_LONG, + self::SIDE_SHORT, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['contract'] = isset($data['contract']) ? $data['contract'] : null; + $this->container['side'] = isset($data['side']) ? $data['side'] : null; + $this->container['pnl'] = isset($data['pnl']) ? $data['pnl'] : null; + $this->container['text'] = isset($data['text']) ? $data['text'] : null; + $this->container['settle_size'] = isset($data['settle_size']) ? $data['settle_size'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getSideAllowableValues(); + if (!is_null($this->container['side']) && !in_array($this->container['side'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'side', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets time + * + * @return double|null + */ + public function getTime() + { + return $this->container['time']; + } + + /** + * Sets time + * + * @param double|null $time Position close time + * + * @return $this + */ + public function setTime($time) + { + $this->container['time'] = $time; + + return $this; + } + + /** + * Gets contract + * + * @return string|null + */ + public function getContract() + { + return $this->container['contract']; + } + + /** + * Sets contract + * + * @param string|null $contract Futures contract + * + * @return $this + */ + public function setContract($contract) + { + $this->container['contract'] = $contract; + + return $this; + } + + /** + * Gets side + * + * @return string|null + */ + public function getSide() + { + return $this->container['side']; + } + + /** + * Sets side + * + * @param string|null $side Position side, long or short + * + * @return $this + */ + public function setSide($side) + { + $allowedValues = $this->getSideAllowableValues(); + if (!is_null($side) && !in_array($side, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'side', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['side'] = $side; + + return $this; + } + + /** + * Gets pnl + * + * @return string|null + */ + public function getPnl() + { + return $this->container['pnl']; + } + + /** + * Sets pnl + * + * @param string|null $pnl PNL + * + * @return $this + */ + public function setPnl($pnl) + { + $this->container['pnl'] = $pnl; + + return $this; + } + + /** + * Gets text + * + * @return string|null + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string|null $text Text of close order + * + * @return $this + */ + public function setText($text) + { + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets settle_size + * + * @return string|null + */ + public function getSettleSize() + { + return $this->container['settle_size']; + } + + /** + * Sets settle_size + * + * @param string|null $settle_size settlement size + * + * @return $this + */ + public function setSettleSize($settle_size) + { + $this->container['settle_size'] = $settle_size; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OptionsSettlement.php b/src/Model/OptionsSettlement.php new file mode 100644 index 0000000..5862251 --- /dev/null +++ b/src/Model/OptionsSettlement.php @@ -0,0 +1,454 @@ + 'double', + 'contract' => 'string', + 'profit' => 'string', + 'fee' => 'string', + 'strike_price' => 'string', + 'settle_price' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'time' => 'double', + 'contract' => null, + 'profit' => null, + 'fee' => null, + 'strike_price' => null, + 'settle_price' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'time' => 'time', + 'contract' => 'contract', + 'profit' => 'profit', + 'fee' => 'fee', + 'strike_price' => 'strike_price', + 'settle_price' => 'settle_price' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'time' => 'setTime', + 'contract' => 'setContract', + 'profit' => 'setProfit', + 'fee' => 'setFee', + 'strike_price' => 'setStrikePrice', + 'settle_price' => 'setSettlePrice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'time' => 'getTime', + 'contract' => 'getContract', + 'profit' => 'getProfit', + 'fee' => 'getFee', + 'strike_price' => 'getStrikePrice', + 'settle_price' => 'getSettlePrice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['contract'] = isset($data['contract']) ? $data['contract'] : null; + $this->container['profit'] = isset($data['profit']) ? $data['profit'] : null; + $this->container['fee'] = isset($data['fee']) ? $data['fee'] : null; + $this->container['strike_price'] = isset($data['strike_price']) ? $data['strike_price'] : null; + $this->container['settle_price'] = isset($data['settle_price']) ? $data['settle_price'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets time + * + * @return double|null + */ + public function getTime() + { + return $this->container['time']; + } + + /** + * Sets time + * + * @param double|null $time Last changed time of configuration + * + * @return $this + */ + public function setTime($time) + { + $this->container['time'] = $time; + + return $this; + } + + /** + * Gets contract + * + * @return string|null + */ + public function getContract() + { + return $this->container['contract']; + } + + /** + * Sets contract + * + * @param string|null $contract Contract name + * + * @return $this + */ + public function setContract($contract) + { + $this->container['contract'] = $contract; + + return $this; + } + + /** + * Gets profit + * + * @return string|null + */ + public function getProfit() + { + return $this->container['profit']; + } + + /** + * Sets profit + * + * @param string|null $profit Settlement profit per size + * + * @return $this + */ + public function setProfit($profit) + { + $this->container['profit'] = $profit; + + return $this; + } + + /** + * Gets fee + * + * @return string|null + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param string|null $fee Settlement fee per size + * + * @return $this + */ + public function setFee($fee) + { + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets strike_price + * + * @return string|null + */ + public function getStrikePrice() + { + return $this->container['strike_price']; + } + + /** + * Sets strike_price + * + * @param string|null $strike_price Strike price + * + * @return $this + */ + public function setStrikePrice($strike_price) + { + $this->container['strike_price'] = $strike_price; + + return $this; + } + + /** + * Gets settle_price + * + * @return string|null + */ + public function getSettlePrice() + { + return $this->container['settle_price']; + } + + /** + * Sets settle_price + * + * @param string|null $settle_price settlement price + * + * @return $this + */ + public function setSettlePrice($settle_price) + { + $this->container['settle_price'] = $settle_price; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OptionsTicker.php b/src/Model/OptionsTicker.php new file mode 100644 index 0000000..6fefd9b --- /dev/null +++ b/src/Model/OptionsTicker.php @@ -0,0 +1,815 @@ + 'string', + 'last_price' => 'string', + 'mark_price' => 'string', + 'index_price' => 'string', + 'ask1_size' => 'int', + 'ask1_price' => 'string', + 'bid1_size' => 'int', + 'bid1_price' => 'string', + 'position_size' => 'int', + 'mark_iv' => 'string', + 'bid_iv' => 'string', + 'ask_iv' => 'string', + 'leverage' => 'string', + 'delta' => 'string', + 'gamma' => 'string', + 'vega' => 'string', + 'theta' => 'string', + 'rho' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'last_price' => null, + 'mark_price' => null, + 'index_price' => null, + 'ask1_size' => 'int64', + 'ask1_price' => null, + 'bid1_size' => 'int64', + 'bid1_price' => null, + 'position_size' => 'int64', + 'mark_iv' => null, + 'bid_iv' => null, + 'ask_iv' => null, + 'leverage' => null, + 'delta' => null, + 'gamma' => null, + 'vega' => null, + 'theta' => null, + 'rho' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'last_price' => 'last_price', + 'mark_price' => 'mark_price', + 'index_price' => 'index_price', + 'ask1_size' => 'ask1_size', + 'ask1_price' => 'ask1_price', + 'bid1_size' => 'bid1_size', + 'bid1_price' => 'bid1_price', + 'position_size' => 'position_size', + 'mark_iv' => 'mark_iv', + 'bid_iv' => 'bid_iv', + 'ask_iv' => 'ask_iv', + 'leverage' => 'leverage', + 'delta' => 'delta', + 'gamma' => 'gamma', + 'vega' => 'vega', + 'theta' => 'theta', + 'rho' => 'rho' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'last_price' => 'setLastPrice', + 'mark_price' => 'setMarkPrice', + 'index_price' => 'setIndexPrice', + 'ask1_size' => 'setAsk1Size', + 'ask1_price' => 'setAsk1Price', + 'bid1_size' => 'setBid1Size', + 'bid1_price' => 'setBid1Price', + 'position_size' => 'setPositionSize', + 'mark_iv' => 'setMarkIv', + 'bid_iv' => 'setBidIv', + 'ask_iv' => 'setAskIv', + 'leverage' => 'setLeverage', + 'delta' => 'setDelta', + 'gamma' => 'setGamma', + 'vega' => 'setVega', + 'theta' => 'setTheta', + 'rho' => 'setRho' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'last_price' => 'getLastPrice', + 'mark_price' => 'getMarkPrice', + 'index_price' => 'getIndexPrice', + 'ask1_size' => 'getAsk1Size', + 'ask1_price' => 'getAsk1Price', + 'bid1_size' => 'getBid1Size', + 'bid1_price' => 'getBid1Price', + 'position_size' => 'getPositionSize', + 'mark_iv' => 'getMarkIv', + 'bid_iv' => 'getBidIv', + 'ask_iv' => 'getAskIv', + 'leverage' => 'getLeverage', + 'delta' => 'getDelta', + 'gamma' => 'getGamma', + 'vega' => 'getVega', + 'theta' => 'getTheta', + 'rho' => 'getRho' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['last_price'] = isset($data['last_price']) ? $data['last_price'] : null; + $this->container['mark_price'] = isset($data['mark_price']) ? $data['mark_price'] : null; + $this->container['index_price'] = isset($data['index_price']) ? $data['index_price'] : null; + $this->container['ask1_size'] = isset($data['ask1_size']) ? $data['ask1_size'] : null; + $this->container['ask1_price'] = isset($data['ask1_price']) ? $data['ask1_price'] : null; + $this->container['bid1_size'] = isset($data['bid1_size']) ? $data['bid1_size'] : null; + $this->container['bid1_price'] = isset($data['bid1_price']) ? $data['bid1_price'] : null; + $this->container['position_size'] = isset($data['position_size']) ? $data['position_size'] : null; + $this->container['mark_iv'] = isset($data['mark_iv']) ? $data['mark_iv'] : null; + $this->container['bid_iv'] = isset($data['bid_iv']) ? $data['bid_iv'] : null; + $this->container['ask_iv'] = isset($data['ask_iv']) ? $data['ask_iv'] : null; + $this->container['leverage'] = isset($data['leverage']) ? $data['leverage'] : null; + $this->container['delta'] = isset($data['delta']) ? $data['delta'] : null; + $this->container['gamma'] = isset($data['gamma']) ? $data['gamma'] : null; + $this->container['vega'] = isset($data['vega']) ? $data['vega'] : null; + $this->container['theta'] = isset($data['theta']) ? $data['theta'] : null; + $this->container['rho'] = isset($data['rho']) ? $data['rho'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Options contract name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets last_price + * + * @return string|null + */ + public function getLastPrice() + { + return $this->container['last_price']; + } + + /** + * Sets last_price + * + * @param string|null $last_price Last trading price + * + * @return $this + */ + public function setLastPrice($last_price) + { + $this->container['last_price'] = $last_price; + + return $this; + } + + /** + * Gets mark_price + * + * @return string|null + */ + public function getMarkPrice() + { + return $this->container['mark_price']; + } + + /** + * Sets mark_price + * + * @param string|null $mark_price Current mark price + * + * @return $this + */ + public function setMarkPrice($mark_price) + { + $this->container['mark_price'] = $mark_price; + + return $this; + } + + /** + * Gets index_price + * + * @return string|null + */ + public function getIndexPrice() + { + return $this->container['index_price']; + } + + /** + * Sets index_price + * + * @param string|null $index_price Current index price + * + * @return $this + */ + public function setIndexPrice($index_price) + { + $this->container['index_price'] = $index_price; + + return $this; + } + + /** + * Gets ask1_size + * + * @return int|null + */ + public function getAsk1Size() + { + return $this->container['ask1_size']; + } + + /** + * Sets ask1_size + * + * @param int|null $ask1_size Best ask size + * + * @return $this + */ + public function setAsk1Size($ask1_size) + { + $this->container['ask1_size'] = $ask1_size; + + return $this; + } + + /** + * Gets ask1_price + * + * @return string|null + */ + public function getAsk1Price() + { + return $this->container['ask1_price']; + } + + /** + * Sets ask1_price + * + * @param string|null $ask1_price Best ask price + * + * @return $this + */ + public function setAsk1Price($ask1_price) + { + $this->container['ask1_price'] = $ask1_price; + + return $this; + } + + /** + * Gets bid1_size + * + * @return int|null + */ + public function getBid1Size() + { + return $this->container['bid1_size']; + } + + /** + * Sets bid1_size + * + * @param int|null $bid1_size Best bid size + * + * @return $this + */ + public function setBid1Size($bid1_size) + { + $this->container['bid1_size'] = $bid1_size; + + return $this; + } + + /** + * Gets bid1_price + * + * @return string|null + */ + public function getBid1Price() + { + return $this->container['bid1_price']; + } + + /** + * Sets bid1_price + * + * @param string|null $bid1_price Best bid price + * + * @return $this + */ + public function setBid1Price($bid1_price) + { + $this->container['bid1_price'] = $bid1_price; + + return $this; + } + + /** + * Gets position_size + * + * @return int|null + */ + public function getPositionSize() + { + return $this->container['position_size']; + } + + /** + * Sets position_size + * + * @param int|null $position_size Current total long position size + * + * @return $this + */ + public function setPositionSize($position_size) + { + $this->container['position_size'] = $position_size; + + return $this; + } + + /** + * Gets mark_iv + * + * @return string|null + */ + public function getMarkIv() + { + return $this->container['mark_iv']; + } + + /** + * Sets mark_iv + * + * @param string|null $mark_iv Implied volatility + * + * @return $this + */ + public function setMarkIv($mark_iv) + { + $this->container['mark_iv'] = $mark_iv; + + return $this; + } + + /** + * Gets bid_iv + * + * @return string|null + */ + public function getBidIv() + { + return $this->container['bid_iv']; + } + + /** + * Sets bid_iv + * + * @param string|null $bid_iv Bid side implied volatility + * + * @return $this + */ + public function setBidIv($bid_iv) + { + $this->container['bid_iv'] = $bid_iv; + + return $this; + } + + /** + * Gets ask_iv + * + * @return string|null + */ + public function getAskIv() + { + return $this->container['ask_iv']; + } + + /** + * Sets ask_iv + * + * @param string|null $ask_iv Ask side implied volatility + * + * @return $this + */ + public function setAskIv($ask_iv) + { + $this->container['ask_iv'] = $ask_iv; + + return $this; + } + + /** + * Gets leverage + * + * @return string|null + */ + public function getLeverage() + { + return $this->container['leverage']; + } + + /** + * Sets leverage + * + * @param string|null $leverage Current leverage. Formula: underlying_price / mark_price * delta + * + * @return $this + */ + public function setLeverage($leverage) + { + $this->container['leverage'] = $leverage; + + return $this; + } + + /** + * Gets delta + * + * @return string|null + */ + public function getDelta() + { + return $this->container['delta']; + } + + /** + * Sets delta + * + * @param string|null $delta Delta + * + * @return $this + */ + public function setDelta($delta) + { + $this->container['delta'] = $delta; + + return $this; + } + + /** + * Gets gamma + * + * @return string|null + */ + public function getGamma() + { + return $this->container['gamma']; + } + + /** + * Sets gamma + * + * @param string|null $gamma Gamma + * + * @return $this + */ + public function setGamma($gamma) + { + $this->container['gamma'] = $gamma; + + return $this; + } + + /** + * Gets vega + * + * @return string|null + */ + public function getVega() + { + return $this->container['vega']; + } + + /** + * Sets vega + * + * @param string|null $vega Vega + * + * @return $this + */ + public function setVega($vega) + { + $this->container['vega'] = $vega; + + return $this; + } + + /** + * Gets theta + * + * @return string|null + */ + public function getTheta() + { + return $this->container['theta']; + } + + /** + * Sets theta + * + * @param string|null $theta Theta + * + * @return $this + */ + public function setTheta($theta) + { + $this->container['theta'] = $theta; + + return $this; + } + + /** + * Gets rho + * + * @return string|null + */ + public function getRho() + { + return $this->container['rho']; + } + + /** + * Sets rho + * + * @param string|null $rho Rho + * + * @return $this + */ + public function setRho($rho) + { + $this->container['rho'] = $rho; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OptionsUnderlying.php b/src/Model/OptionsUnderlying.php new file mode 100644 index 0000000..9f0c995 --- /dev/null +++ b/src/Model/OptionsUnderlying.php @@ -0,0 +1,334 @@ + 'string', + 'index_price' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'index_price' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'index_price' => 'index_price' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'index_price' => 'setIndexPrice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'index_price' => 'getIndexPrice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['index_price'] = isset($data['index_price']) ? $data['index_price'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Underlying name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets index_price + * + * @return string|null + */ + public function getIndexPrice() + { + return $this->container['index_price']; + } + + /** + * Sets index_price + * + * @param string|null $index_price Spot index price + * + * @return $this + */ + public function setIndexPrice($index_price) + { + $this->container['index_price'] = $index_price; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OptionsUnderlyingTicker.php b/src/Model/OptionsUnderlyingTicker.php new file mode 100644 index 0000000..ed03f59 --- /dev/null +++ b/src/Model/OptionsUnderlyingTicker.php @@ -0,0 +1,365 @@ + 'int', + 'trade_call' => 'int', + 'index_price' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'trade_put' => 'int64', + 'trade_call' => 'int64', + 'index_price' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'trade_put' => 'trade_put', + 'trade_call' => 'trade_call', + 'index_price' => 'index_price' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'trade_put' => 'setTradePut', + 'trade_call' => 'setTradeCall', + 'index_price' => 'setIndexPrice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'trade_put' => 'getTradePut', + 'trade_call' => 'getTradeCall', + 'index_price' => 'getIndexPrice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['trade_put'] = isset($data['trade_put']) ? $data['trade_put'] : null; + $this->container['trade_call'] = isset($data['trade_call']) ? $data['trade_call'] : null; + $this->container['index_price'] = isset($data['index_price']) ? $data['index_price'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets trade_put + * + * @return int|null + */ + public function getTradePut() + { + return $this->container['trade_put']; + } + + /** + * Sets trade_put + * + * @param int|null $trade_put Total put options trades amount in last 24h + * + * @return $this + */ + public function setTradePut($trade_put) + { + $this->container['trade_put'] = $trade_put; + + return $this; + } + + /** + * Gets trade_call + * + * @return int|null + */ + public function getTradeCall() + { + return $this->container['trade_call']; + } + + /** + * Sets trade_call + * + * @param int|null $trade_call Total call options trades amount in last 24h + * + * @return $this + */ + public function setTradeCall($trade_call) + { + $this->container['trade_call'] = $trade_call; + + return $this; + } + + /** + * Gets index_price + * + * @return string|null + */ + public function getIndexPrice() + { + return $this->container['index_price']; + } + + /** + * Sets index_price + * + * @param string|null $index_price Index price + * + * @return $this + */ + public function setIndexPrice($index_price) + { + $this->container['index_price'] = $index_price; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Transfer.php b/src/Model/Transfer.php index f59afd5..81552df 100644 --- a/src/Model/Transfer.php +++ b/src/Model/Transfer.php @@ -33,7 +33,7 @@ * Transfer Class Doc Comment * * @category Class - * @description Accounts available to transfer: - `spot`: spot account - `margin`: margin account - `futures`: perpetual futures account - `delivery`: delivery futures account - `cross_margin`: cross margin account + * @description Accounts available to transfer: - `spot`: spot account - `margin`: margin account - `futures`: perpetual futures account - `delivery`: delivery futures account - `cross_margin`: cross margin account - `options`: options account * @package GateApi * @author GateIO * @link https://www.gate.io @@ -186,11 +186,13 @@ public function getModelName() const FROM_FUTURES = 'futures'; const FROM_DELIVERY = 'delivery'; const FROM_CROSS_MARGIN = 'cross_margin'; + const FROM_OPTIONS = 'options'; const TO_SPOT = 'spot'; const TO_MARGIN = 'margin'; const TO_FUTURES = 'futures'; const TO_DELIVERY = 'delivery'; const TO_CROSS_MARGIN = 'cross_margin'; + const TO_OPTIONS = 'options'; @@ -207,6 +209,7 @@ public function getFromAllowableValues() self::FROM_FUTURES, self::FROM_DELIVERY, self::FROM_CROSS_MARGIN, + self::FROM_OPTIONS, ]; } @@ -223,6 +226,7 @@ public function getToAllowableValues() self::TO_FUTURES, self::TO_DELIVERY, self::TO_CROSS_MARGIN, + self::TO_OPTIONS, ]; } From 0b898b1ee0b2c3752dfbbdf64512b5448c3e2aa6 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Mon, 27 Dec 2021 15:37:53 +0800 Subject: [PATCH 09/17] spot order add fok support --- README.md | 4 ++-- composer.json | 2 +- composer.lock | 2 +- docs/Model/BatchOrder.md | 2 +- docs/Model/Order.md | 2 +- src/Configuration.php | 6 +++--- src/Model/BatchOrder.php | 4 +++- src/Model/Order.php | 4 +++- 8 files changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 5bcd1fa..93e2f7d 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.23.0 -- Package version: 5.23.0 +- API version: 4.23.1 +- Package version: 5.23.1 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) diff --git a/composer.json b/composer.json index 3b04777..c03af34 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.23.0", + "version": "5.23.1", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index ea77c39..a31f237 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e3771b773520cddd3910a140489238f5", + "content-hash": "3b2ce36ad25986ecb71b37f9c7376e7e", "packages": [ { "name": "guzzlehttp/guzzle", diff --git a/docs/Model/BatchOrder.md b/docs/Model/BatchOrder.md index a16073a..0a70556 100644 --- a/docs/Model/BatchOrder.md +++ b/docs/Model/BatchOrder.md @@ -20,7 +20,7 @@ Name | Type | Description | Notes **side** | **string** | Order side | [optional] **amount** | **string** | Trade amount | [optional] **price** | **string** | Order price | [optional] -**time_in_force** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee | [optional] [default to 'gtc'] +**time_in_force** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none | [optional] [default to 'gtc'] **iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional] **auto_borrow** | **bool** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional] **auto_repay** | **bool** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. | [optional] diff --git a/docs/Model/Order.md b/docs/Model/Order.md index ed445c1..4af1fed 100644 --- a/docs/Model/Order.md +++ b/docs/Model/Order.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **side** | **string** | Order side | **amount** | **string** | Trade amount | **price** | **string** | Order price | -**time_in_force** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee | [optional] [default to 'gtc'] +**time_in_force** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none | [optional] [default to 'gtc'] **iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional] **auto_borrow** | **bool** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional] **auto_repay** | **bool** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. | [optional] diff --git a/src/Configuration.php b/src/Configuration.php index c45d464..cb16ae5 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.23.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.23.1/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.23.0' . PHP_EOL; - $report .= ' SDK Package Version: 5.23.0' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.23.1' . PHP_EOL; + $report .= ' SDK Package Version: 5.23.1' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/BatchOrder.php b/src/Model/BatchOrder.php index 7a5d6e2..7768a21 100644 --- a/src/Model/BatchOrder.php +++ b/src/Model/BatchOrder.php @@ -313,6 +313,7 @@ public function getModelName() const TIME_IN_FORCE_GTC = 'gtc'; const TIME_IN_FORCE_IOC = 'ioc'; const TIME_IN_FORCE_POC = 'poc'; + const TIME_IN_FORCE_FOK = 'fok'; @@ -380,6 +381,7 @@ public function getTimeInForceAllowableValues() self::TIME_IN_FORCE_GTC, self::TIME_IN_FORCE_IOC, self::TIME_IN_FORCE_POC, + self::TIME_IN_FORCE_FOK, ]; } @@ -928,7 +930,7 @@ public function getTimeInForce() /** * Sets time_in_force * - * @param string|null $time_in_force Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee + * @param string|null $time_in_force Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none * * @return $this */ diff --git a/src/Model/Order.php b/src/Model/Order.php index 1b1a281..df082fc 100644 --- a/src/Model/Order.php +++ b/src/Model/Order.php @@ -298,6 +298,7 @@ public function getModelName() const TIME_IN_FORCE_GTC = 'gtc'; const TIME_IN_FORCE_IOC = 'ioc'; const TIME_IN_FORCE_POC = 'poc'; + const TIME_IN_FORCE_FOK = 'fok'; @@ -365,6 +366,7 @@ public function getTimeInForceAllowableValues() self::TIME_IN_FORCE_GTC, self::TIME_IN_FORCE_IOC, self::TIME_IN_FORCE_POC, + self::TIME_IN_FORCE_FOK, ]; } @@ -850,7 +852,7 @@ public function getTimeInForce() /** * Sets time_in_force * - * @param string|null $time_in_force Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee + * @param string|null $time_in_force Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none * * @return $this */ From 6f45a90f303d9a3b4dad1b6ee085aa943b044287 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Fri, 21 Jan 2022 11:55:15 +0800 Subject: [PATCH 10/17] add withdrawl and deposit fee; add spot currency fixed rate --- README.md | 4 +- composer.json | 2 +- composer.lock | 198 +++++++++++++++++++------------------ docs/Model/Currency.md | 1 + docs/Model/LedgerRecord.md | 1 + docs/Model/Trade.md | 6 +- src/Configuration.php | 6 +- src/Model/Currency.php | 40 +++++++- src/Model/LedgerRecord.php | 40 +++++++- src/Model/Trade.php | 6 +- 10 files changed, 184 insertions(+), 120 deletions(-) diff --git a/README.md b/README.md index 93e2f7d..a5d0247 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.23.1 -- Package version: 5.23.1 +- API version: 4.23.2 +- Package version: 5.23.2 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) diff --git a/composer.json b/composer.json index c03af34..aaedd6f 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.23.1", + "version": "5.23.2", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index a31f237..89c40d9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3b2ce36ad25986ecb71b37f9c7376e7e", + "content-hash": "b66fd8ff6451e283014ade29ea971576", "packages": [ { "name": "guzzlehttp/guzzle", @@ -370,16 +370,16 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65" + "reference": "749045c69efb97c70d25d7463abba812e91f3a44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/65bd267525e82759e7d8c4e8ceea44f398838e65", - "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/749045c69efb97c70d25d7463abba812e91f3a44", + "reference": "749045c69efb97c70d25d7463abba812e91f3a44", "shasum": "" }, "require": { @@ -437,7 +437,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.24.0" }, "funding": [ { @@ -453,11 +453,11 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:27:20+00:00" + "time": "2021-09-14T14:02:44+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -521,7 +521,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.0" }, "funding": [ { @@ -541,7 +541,7 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -597,7 +597,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" }, "funding": [ { @@ -690,16 +690,16 @@ }, { "name": "composer/semver", - "version": "3.2.6", + "version": "3.2.7", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "83e511e247de329283478496f7a1e114c9517506" + "reference": "deac27056b57e46faf136fae7b449eeaa71661ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", - "reference": "83e511e247de329283478496f7a1e114c9517506", + "url": "https://api.github.com/repos/composer/semver/zipball/deac27056b57e46faf136fae7b449eeaa71661ee", + "reference": "deac27056b57e46faf136fae7b449eeaa71661ee", "shasum": "" }, "require": { @@ -751,7 +751,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.6" + "source": "https://github.com/composer/semver/tree/3.2.7" }, "funding": [ { @@ -767,20 +767,20 @@ "type": "tidelift" } ], - "time": "2021-10-25T11:34:17+00:00" + "time": "2022-01-04T09:57:54+00:00" }, { "name": "composer/xdebug-handler", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6555461e76962fd0379c444c46fd558a0fcfb65e" + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6555461e76962fd0379c444c46fd558a0fcfb65e", - "reference": "6555461e76962fd0379c444c46fd558a0fcfb65e", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", "shasum": "" }, "require": { @@ -817,7 +817,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.3" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.4" }, "funding": [ { @@ -833,7 +833,7 @@ "type": "tidelift" } ], - "time": "2021-12-08T13:07:32+00:00" + "time": "2022-01-04T17:06:45+00:00" }, { "name": "doctrine/annotations", @@ -978,32 +978,28 @@ }, { "name": "doctrine/lexer", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" + "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", + "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" + "doctrine/coding-standard": "^9.0", + "phpstan/phpstan": "1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" @@ -1038,7 +1034,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.1" + "source": "https://github.com/doctrine/lexer/tree/1.2.2" }, "funding": [ { @@ -1054,7 +1050,7 @@ "type": "tidelift" } ], - "time": "2020-05-25T17:44:05+00:00" + "time": "2022-01-12T08:27:12+00:00" }, { "name": "friendsofphp/php-cs-fixer", @@ -1500,16 +1496,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.5.1", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", "shasum": "" }, "require": { @@ -1544,9 +1540,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" }, - "time": "2021-10-02T14:08:47+00:00" + "time": "2022-01-04T19:58:01+00:00" }, { "name": "phpspec/prophecy", @@ -2940,16 +2936,16 @@ }, { "name": "symfony/console", - "version": "v5.4.1", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4" + "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4", - "reference": "9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4", + "url": "https://api.github.com/repos/symfony/console/zipball/a2c6b7ced2eb7799a35375fb9022519282b5405e", + "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e", "shasum": "" }, "require": { @@ -3019,7 +3015,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.1" + "source": "https://github.com/symfony/console/tree/v5.4.2" }, "funding": [ { @@ -3035,7 +3031,7 @@ "type": "tidelift" } ], - "time": "2021-12-09T11:22:43+00:00" + "time": "2021-12-20T16:11:12+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3334,16 +3330,16 @@ }, { "name": "symfony/finder", - "version": "v5.4.0", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590" + "reference": "e77046c252be48c48a40816187ed527703c8f76c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/d2f29dac98e96a98be467627bd49c2efb1bc2590", - "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590", + "url": "https://api.github.com/repos/symfony/finder/zipball/e77046c252be48c48a40816187ed527703c8f76c", + "reference": "e77046c252be48c48a40816187ed527703c8f76c", "shasum": "" }, "require": { @@ -3377,7 +3373,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.0" + "source": "https://github.com/symfony/finder/tree/v5.4.2" }, "funding": [ { @@ -3393,7 +3389,7 @@ "type": "tidelift" } ], - "time": "2021-11-28T15:25:38+00:00" + "time": "2021-12-15T11:06:13+00:00" }, { "name": "symfony/options-resolver", @@ -3466,21 +3462,24 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "suggest": { "ext-ctype": "For best performance" }, @@ -3525,7 +3524,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" }, "funding": [ { @@ -3541,20 +3540,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-10-20T20:35:02+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", "shasum": "" }, "require": { @@ -3606,7 +3605,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.24.0" }, "funding": [ { @@ -3622,25 +3621,28 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-23T21:10:46+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, @@ -3686,7 +3688,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" }, "funding": [ { @@ -3702,7 +3704,7 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-30T18:21:41+00:00" }, { "name": "symfony/polyfill-php70", @@ -3774,16 +3776,16 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", "shasum": "" }, "require": { @@ -3833,7 +3835,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" }, "funding": [ { @@ -3849,20 +3851,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-06-05T21:20:04+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", "shasum": "" }, "require": { @@ -3916,7 +3918,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" }, "funding": [ { @@ -3932,20 +3934,20 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2021-09-13T13:58:33+00:00" }, { "name": "symfony/process", - "version": "v5.4.0", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "5be20b3830f726e019162b26223110c8f47cf274" + "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/5be20b3830f726e019162b26223110c8f47cf274", - "reference": "5be20b3830f726e019162b26223110c8f47cf274", + "url": "https://api.github.com/repos/symfony/process/zipball/2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", + "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", "shasum": "" }, "require": { @@ -3978,7 +3980,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.0" + "source": "https://github.com/symfony/process/tree/v5.4.2" }, "funding": [ { @@ -3994,7 +3996,7 @@ "type": "tidelift" } ], - "time": "2021-11-28T15:25:38+00:00" + "time": "2021-12-27T21:01:00+00:00" }, { "name": "symfony/service-contracts", @@ -4143,16 +4145,16 @@ }, { "name": "symfony/string", - "version": "v5.4.0", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d" + "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", - "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", + "url": "https://api.github.com/repos/symfony/string/zipball/e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", + "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", "shasum": "" }, "require": { @@ -4209,7 +4211,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.0" + "source": "https://github.com/symfony/string/tree/v5.4.2" }, "funding": [ { @@ -4225,7 +4227,7 @@ "type": "tidelift" } ], - "time": "2021-11-24T10:02:00+00:00" + "time": "2021-12-16T21:52:00+00:00" }, { "name": "theseer/tokenizer", diff --git a/docs/Model/Currency.md b/docs/Model/Currency.md index d34990d..99f3d22 100644 --- a/docs/Model/Currency.md +++ b/docs/Model/Currency.md @@ -10,5 +10,6 @@ Name | Type | Description | Notes **withdraw_delayed** | **bool** | Whether currency's withdrawal is delayed | [optional] **deposit_disabled** | **bool** | Whether currency's deposit is disabled | [optional] **trade_disabled** | **bool** | Whether currency's trading is disabled | [optional] +**fixed_rate** | **string** | Fixed fee rate. Only for fixed rate currencies, not valid for normal currencies | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LedgerRecord.md b/docs/Model/LedgerRecord.md index 28c3713..56a538b 100644 --- a/docs/Model/LedgerRecord.md +++ b/docs/Model/LedgerRecord.md @@ -13,5 +13,6 @@ Name | Type | Description | Notes **memo** | **string** | Additional remarks with regards to the withdrawal | [optional] **status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending | [optional] [readonly] **chain** | **string** | Name of the chain used in withdrawals | [optional] +**fee** | **string** | Fee | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Trade.md b/docs/Model/Trade.md index 5dcc7fe..4a89eff 100644 --- a/docs/Model/Trade.md +++ b/docs/Model/Trade.md @@ -9,13 +9,13 @@ Name | Type | Description | Notes **create_time_ms** | **string** | Trading time, with millisecond precision | [optional] **currency_pair** | **string** | Currency pair | [optional] **side** | **string** | Order side | [optional] -**role** | **string** | Trade role | [optional] +**role** | **string** | Trade role. No value in public endpoints | [optional] **amount** | **string** | Trade amount | [optional] **price** | **string** | Order price | [optional] **order_id** | **string** | Related order ID. No value in public endpoints | [optional] **fee** | **string** | Fee deducted. No value in public endpoints | [optional] **fee_currency** | **string** | Fee currency unit. No value in public endpoints | [optional] -**point_fee** | **string** | Points used to deduct fee | [optional] -**gt_fee** | **string** | GT used to deduct fee | [optional] +**point_fee** | **string** | Points used to deduct fee. No value in public endpoints | [optional] +**gt_fee** | **string** | GT used to deduct fee. No value in public endpoints | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/src/Configuration.php b/src/Configuration.php index cb16ae5..afe4451 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.23.1/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.23.2/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.23.1' . PHP_EOL; - $report .= ' SDK Package Version: 5.23.1' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.23.2' . PHP_EOL; + $report .= ' SDK Package Version: 5.23.2' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/Currency.php b/src/Model/Currency.php index ec6dcf4..2f637cd 100644 --- a/src/Model/Currency.php +++ b/src/Model/Currency.php @@ -59,7 +59,8 @@ class Currency implements ModelInterface, ArrayAccess 'withdraw_disabled' => 'bool', 'withdraw_delayed' => 'bool', 'deposit_disabled' => 'bool', - 'trade_disabled' => 'bool' + 'trade_disabled' => 'bool', + 'fixed_rate' => 'string' ]; /** @@ -73,7 +74,8 @@ class Currency implements ModelInterface, ArrayAccess 'withdraw_disabled' => null, 'withdraw_delayed' => null, 'deposit_disabled' => null, - 'trade_disabled' => null + 'trade_disabled' => null, + 'fixed_rate' => null ]; /** @@ -108,7 +110,8 @@ public static function openAPIFormats() 'withdraw_disabled' => 'withdraw_disabled', 'withdraw_delayed' => 'withdraw_delayed', 'deposit_disabled' => 'deposit_disabled', - 'trade_disabled' => 'trade_disabled' + 'trade_disabled' => 'trade_disabled', + 'fixed_rate' => 'fixed_rate' ]; /** @@ -122,7 +125,8 @@ public static function openAPIFormats() 'withdraw_disabled' => 'setWithdrawDisabled', 'withdraw_delayed' => 'setWithdrawDelayed', 'deposit_disabled' => 'setDepositDisabled', - 'trade_disabled' => 'setTradeDisabled' + 'trade_disabled' => 'setTradeDisabled', + 'fixed_rate' => 'setFixedRate' ]; /** @@ -136,7 +140,8 @@ public static function openAPIFormats() 'withdraw_disabled' => 'getWithdrawDisabled', 'withdraw_delayed' => 'getWithdrawDelayed', 'deposit_disabled' => 'getDepositDisabled', - 'trade_disabled' => 'getTradeDisabled' + 'trade_disabled' => 'getTradeDisabled', + 'fixed_rate' => 'getFixedRate' ]; /** @@ -205,6 +210,7 @@ public function __construct(array $data = null) $this->container['withdraw_delayed'] = isset($data['withdraw_delayed']) ? $data['withdraw_delayed'] : null; $this->container['deposit_disabled'] = isset($data['deposit_disabled']) ? $data['deposit_disabled'] : null; $this->container['trade_disabled'] = isset($data['trade_disabled']) ? $data['trade_disabled'] : null; + $this->container['fixed_rate'] = isset($data['fixed_rate']) ? $data['fixed_rate'] : null; } /** @@ -374,6 +380,30 @@ public function setTradeDisabled($trade_disabled) return $this; } + + /** + * Gets fixed_rate + * + * @return string|null + */ + public function getFixedRate() + { + return $this->container['fixed_rate']; + } + + /** + * Sets fixed_rate + * + * @param string|null $fixed_rate Fixed fee rate. Only for fixed rate currencies, not valid for normal currencies + * + * @return $this + */ + public function setFixedRate($fixed_rate) + { + $this->container['fixed_rate'] = $fixed_rate; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/LedgerRecord.php b/src/Model/LedgerRecord.php index 9847eb1..081a4d7 100644 --- a/src/Model/LedgerRecord.php +++ b/src/Model/LedgerRecord.php @@ -62,7 +62,8 @@ class LedgerRecord implements ModelInterface, ArrayAccess 'address' => 'string', 'memo' => 'string', 'status' => 'string', - 'chain' => 'string' + 'chain' => 'string', + 'fee' => 'string' ]; /** @@ -79,7 +80,8 @@ class LedgerRecord implements ModelInterface, ArrayAccess 'address' => null, 'memo' => null, 'status' => null, - 'chain' => null + 'chain' => null, + 'fee' => null ]; /** @@ -117,7 +119,8 @@ public static function openAPIFormats() 'address' => 'address', 'memo' => 'memo', 'status' => 'status', - 'chain' => 'chain' + 'chain' => 'chain', + 'fee' => 'fee' ]; /** @@ -134,7 +137,8 @@ public static function openAPIFormats() 'address' => 'setAddress', 'memo' => 'setMemo', 'status' => 'setStatus', - 'chain' => 'setChain' + 'chain' => 'setChain', + 'fee' => 'setFee' ]; /** @@ -151,7 +155,8 @@ public static function openAPIFormats() 'address' => 'getAddress', 'memo' => 'getMemo', 'status' => 'getStatus', - 'chain' => 'getChain' + 'chain' => 'getChain', + 'fee' => 'getFee' ]; /** @@ -256,6 +261,7 @@ public function __construct(array $data = null) $this->container['memo'] = isset($data['memo']) ? $data['memo'] : null; $this->container['status'] = isset($data['status']) ? $data['status'] : null; $this->container['chain'] = isset($data['chain']) ? $data['chain'] : null; + $this->container['fee'] = isset($data['fee']) ? $data['fee'] : null; } /** @@ -520,6 +526,30 @@ public function setChain($chain) return $this; } + + /** + * Gets fee + * + * @return string|null + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param string|null $fee Fee + * + * @return $this + */ + public function setFee($fee) + { + $this->container['fee'] = $fee; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/Trade.php b/src/Model/Trade.php index 16711ff..9cf682e 100644 --- a/src/Model/Trade.php +++ b/src/Model/Trade.php @@ -461,7 +461,7 @@ public function getRole() /** * Sets role * - * @param string|null $role Trade role + * @param string|null $role Trade role. No value in public endpoints * * @return $this */ @@ -614,7 +614,7 @@ public function getPointFee() /** * Sets point_fee * - * @param string|null $point_fee Points used to deduct fee + * @param string|null $point_fee Points used to deduct fee. No value in public endpoints * * @return $this */ @@ -638,7 +638,7 @@ public function getGtFee() /** * Sets gt_fee * - * @param string|null $gt_fee GT used to deduct fee + * @param string|null $gt_fee GT used to deduct fee. No value in public endpoints * * @return $this */ From f2d9a336bda5f1fa5db71bb0c4ab2a6392009405 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Sun, 3 Apr 2022 11:29:58 +0800 Subject: [PATCH 11/17] futures delivery candlesticks support more intervals --- README.md | 4 +- composer.json | 6 +- composer.lock | 409 +++++++++++------------ docs/Api/DeliveryApi.md | 12 +- docs/Api/FuturesApi.md | 18 +- docs/Api/SpotApi.md | 2 + docs/Model/Currency.md | 1 + docs/Model/CurrencyChain.md | 2 + docs/Model/Ticker.md | 10 +- docs/Model/Transfer.md | 2 +- src/Api/DeliveryApi.php | 10 +- src/Api/FuturesApi.php | 75 +++-- src/Configuration.php | 14 +- src/HeaderSelector.php | 6 +- src/Model/AccountBalance.php | 33 +- src/Model/AutoRepaySetting.php | 33 +- src/Model/BatchOrder.php | 33 +- src/Model/CancelOrder.php | 33 +- src/Model/CancelOrderResult.php | 33 +- src/Model/Contract.php | 33 +- src/Model/ContractStat.php | 33 +- src/Model/CrossMarginAccount.php | 33 +- src/Model/CrossMarginAccountBook.php | 33 +- src/Model/CrossMarginBalance.php | 33 +- src/Model/CrossMarginBorrowable.php | 33 +- src/Model/CrossMarginCurrency.php | 33 +- src/Model/CrossMarginLoan.php | 33 +- src/Model/CrossMarginRepayRequest.php | 33 +- src/Model/CrossMarginRepayment.php | 33 +- src/Model/CrossMarginTransferable.php | 33 +- src/Model/Currency.php | 73 ++-- src/Model/CurrencyChain.php | 103 ++++-- src/Model/CurrencyPair.php | 33 +- src/Model/DeliveryContract.php | 33 +- src/Model/DeliverySettlement.php | 33 +- src/Model/DepositAddress.php | 33 +- src/Model/FundingAccount.php | 33 +- src/Model/FundingBookItem.php | 33 +- src/Model/FundingRateRecord.php | 33 +- src/Model/FuturesAccount.php | 33 +- src/Model/FuturesAccountBook.php | 33 +- src/Model/FuturesCandlestick.php | 33 +- src/Model/FuturesInitialOrder.php | 33 +- src/Model/FuturesLiquidate.php | 33 +- src/Model/FuturesOrder.php | 33 +- src/Model/FuturesOrderBook.php | 33 +- src/Model/FuturesOrderBookItem.php | 33 +- src/Model/FuturesPriceTrigger.php | 33 +- src/Model/FuturesPriceTriggeredOrder.php | 33 +- src/Model/FuturesTicker.php | 33 +- src/Model/FuturesTrade.php | 33 +- src/Model/InsuranceRecord.php | 33 +- src/Model/LedgerRecord.php | 33 +- src/Model/Loan.php | 33 +- src/Model/LoanPatch.php | 33 +- src/Model/LoanRecord.php | 33 +- src/Model/MarginAccount.php | 33 +- src/Model/MarginAccountBook.php | 33 +- src/Model/MarginAccountCurrency.php | 33 +- src/Model/MarginBorrowable.php | 33 +- src/Model/MarginCurrencyPair.php | 33 +- src/Model/MarginTransferable.php | 33 +- src/Model/MultiChainAddressItem.php | 33 +- src/Model/MyFuturesTrade.php | 33 +- src/Model/OpenOrders.php | 33 +- src/Model/OptionsAccount.php | 33 +- src/Model/OptionsAccountBook.php | 33 +- src/Model/OptionsContract.php | 33 +- src/Model/OptionsMyTrade.php | 33 +- src/Model/OptionsOrder.php | 33 +- src/Model/OptionsPosition.php | 33 +- src/Model/OptionsPositionClose.php | 33 +- src/Model/OptionsSettlement.php | 33 +- src/Model/OptionsTicker.php | 33 +- src/Model/OptionsUnderlying.php | 33 +- src/Model/OptionsUnderlyingTicker.php | 33 +- src/Model/Order.php | 33 +- src/Model/OrderBook.php | 33 +- src/Model/Position.php | 33 +- src/Model/PositionClose.php | 33 +- src/Model/PositionCloseOrder.php | 33 +- src/Model/RepayRequest.php | 33 +- src/Model/Repayment.php | 33 +- src/Model/SpotAccount.php | 33 +- src/Model/SpotPricePutOrder.php | 33 +- src/Model/SpotPriceTrigger.php | 33 +- src/Model/SpotPriceTriggeredOrder.php | 33 +- src/Model/SubAccountBalance.php | 33 +- src/Model/SubAccountTransfer.php | 33 +- src/Model/Ticker.php | 43 +-- src/Model/TotalBalance.php | 33 +- src/Model/Trade.php | 33 +- src/Model/TradeFee.php | 33 +- src/Model/Transfer.php | 35 +- src/Model/TriggerOrderResponse.php | 33 +- src/Model/WithdrawStatus.php | 33 +- src/ObjectSerializer.php | 6 +- 97 files changed, 1788 insertions(+), 1617 deletions(-) diff --git a/README.md b/README.md index a5d0247..07b7bcb 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.23.2 -- Package version: 5.23.2 +- API version: 4.23.3 +- Package version: 5.23.3 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) diff --git a/composer.json b/composer.json index aaedd6f..52ad846 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.23.2", + "version": "5.23.3", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", @@ -29,8 +29,8 @@ }, "require-dev": { "phpunit/phpunit": "^7.4", - "squizlabs/php_codesniffer": "~2.6", - "friendsofphp/php-cs-fixer": "~2.14" + "squizlabs/php_codesniffer": "~3.6", + "friendsofphp/php-cs-fixer": "~2.17" }, "autoload": { "psr-4": { "GateApi\\" : "src/" } diff --git a/composer.lock b/composer.lock index 89c40d9..2312daf 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b66fd8ff6451e283014ade29ea971576", + "content-hash": "d10d7d7b79acda81d067906db9e68034", "packages": [ { "name": "guzzlehttp/guzzle", @@ -42,12 +42,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -104,12 +104,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -163,16 +163,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.8.3", + "version": "1.8.5", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85" + "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", - "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/337e3ad8e5716c15f9657bd214d16cc5e69df268", + "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268", "shasum": "" }, "require": { @@ -197,12 +197,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -253,7 +253,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.3" + "source": "https://github.com/guzzle/psr7/tree/1.8.5" }, "funding": [ { @@ -269,7 +269,7 @@ "type": "tidelift" } ], - "time": "2021-10-05T13:56:00+00:00" + "time": "2022-03-20T21:51:18+00:00" }, { "name": "psr/http-message", @@ -370,7 +370,7 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", @@ -401,12 +401,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -437,7 +437,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.25.0" }, "funding": [ { @@ -457,7 +457,7 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -486,12 +486,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -521,7 +521,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" }, "funding": [ { @@ -541,7 +541,7 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -567,12 +567,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -597,7 +597,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" }, "funding": [ { @@ -619,23 +619,23 @@ "packages-dev": [ { "name": "composer/pcre", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2" + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2", - "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2", + "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1", + "phpstan/phpstan": "^1.3", "phpstan/phpstan-strict-rules": "^1.1", "symfony/phpunit-bridge": "^4.2 || ^5" }, @@ -670,7 +670,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.0" + "source": "https://github.com/composer/pcre/tree/1.0.1" }, "funding": [ { @@ -686,27 +686,27 @@ "type": "tidelift" } ], - "time": "2021-12-06T15:17:27+00:00" + "time": "2022-01-21T20:24:37+00:00" }, { "name": "composer/semver", - "version": "3.2.7", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "deac27056b57e46faf136fae7b449eeaa71661ee" + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/deac27056b57e46faf136fae7b449eeaa71661ee", - "reference": "deac27056b57e46faf136fae7b449eeaa71661ee", + "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.54", + "phpstan/phpstan": "^1.4", "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", @@ -751,7 +751,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.7" + "source": "https://github.com/composer/semver/tree/3.3.2" }, "funding": [ { @@ -767,20 +767,20 @@ "type": "tidelift" } ], - "time": "2022-01-04T09:57:54+00:00" + "time": "2022-04-01T19:23:25+00:00" }, { "name": "composer/xdebug-handler", - "version": "2.0.4", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a" + "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", - "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a", + "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a", "shasum": "" }, "require": { @@ -817,7 +817,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.4" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" }, "funding": [ { @@ -833,7 +833,7 @@ "type": "tidelift" } ], - "time": "2022-01-04T17:06:45+00:00" + "time": "2022-02-24T20:20:32+00:00" }, { "name": "doctrine/annotations", @@ -909,29 +909,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", + "doctrine/coding-standard": "^9", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.22" }, "type": "library", "autoload": { @@ -958,7 +959,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + "source": "https://github.com/doctrine/instantiator/tree/1.4.1" }, "funding": [ { @@ -974,20 +975,20 @@ "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2022-03-03T08:28:38+00:00" }, { "name": "doctrine/lexer", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c" + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", - "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", "shasum": "" }, "require": { @@ -995,7 +996,7 @@ }, "require-dev": { "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "1.3", + "phpstan/phpstan": "^1.3", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", "vimeo/psalm": "^4.11" }, @@ -1034,7 +1035,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.2" + "source": "https://github.com/doctrine/lexer/tree/1.2.3" }, "funding": [ { @@ -1050,7 +1051,7 @@ "type": "tidelift" } ], - "time": "2022-01-12T08:27:12+00:00" + "time": "2022-02-28T11:07:21+00:00" }, { "name": "friendsofphp/php-cs-fixer", @@ -1163,37 +1164,38 @@ }, { "name": "myclabs/deep-copy", - "version": "1.10.2", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, - "replace": { - "myclabs/deep-copy": "self.version" + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, "files": [ "src/DeepCopy/deep_copy.php" - ] + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1209,7 +1211,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" }, "funding": [ { @@ -1217,7 +1219,7 @@ "type": "tidelift" } ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2022-03-03T13:19:32+00:00" }, { "name": "phar-io/manifest", @@ -1496,16 +1498,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" + "reference": "77a32518733312af16a44300404e945338981de3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", + "reference": "77a32518733312af16a44300404e945338981de3", "shasum": "" }, "require": { @@ -1540,9 +1542,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" }, - "time": "2022-01-04T19:58:01+00:00" + "time": "2022-03-15T21:29:03+00:00" }, { "name": "phpspec/prophecy", @@ -2853,64 +2855,37 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.9.2", + "version": "3.6.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", - "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", "shasum": "" }, "require": { "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": ">=5.1.2" + "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "bin": [ - "scripts/phpcs", - "scripts/phpcbf" + "bin/phpcs", + "bin/phpcbf" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "3.x-dev" } }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Fixer.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -2922,7 +2897,7 @@ } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards" @@ -2932,20 +2907,20 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2018-11-07T22:31:41+00:00" + "time": "2021-12-12T21:44:58+00:00" }, { "name": "symfony/console", - "version": "v5.4.2", + "version": "v5.4.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e" + "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a2c6b7ced2eb7799a35375fb9022519282b5405e", - "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e", + "url": "https://api.github.com/repos/symfony/console/zipball/900275254f0a1a2afff1ab0e11abd5587a10e1d6", + "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6", "shasum": "" }, "require": { @@ -3015,7 +2990,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.2" + "source": "https://github.com/symfony/console/tree/v5.4.7" }, "funding": [ { @@ -3031,7 +3006,7 @@ "type": "tidelift" } ], - "time": "2021-12-20T16:11:12+00:00" + "time": "2022-03-31T17:09:19+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3102,16 +3077,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.4.0", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb" + "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/27d39ae126352b9fa3be5e196ccf4617897be3eb", - "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/dec8a9f58d20df252b9cd89f1c6c1530f747685d", + "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d", "shasum": "" }, "require": { @@ -3167,7 +3142,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.3" }, "funding": [ { @@ -3183,7 +3158,7 @@ "type": "tidelift" } ], - "time": "2021-11-23T10:19:22+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -3266,16 +3241,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.0", + "version": "v5.4.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01" + "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/731f917dc31edcffec2c6a777f3698c33bea8f01", - "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3a4442138d80c9f7b600fb297534ac718b61d37f", + "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f", "shasum": "" }, "require": { @@ -3310,7 +3285,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.0" + "source": "https://github.com/symfony/filesystem/tree/v5.4.7" }, "funding": [ { @@ -3326,20 +3301,20 @@ "type": "tidelift" } ], - "time": "2021-10-28T13:39:27+00:00" + "time": "2022-04-01T12:33:59+00:00" }, { "name": "symfony/finder", - "version": "v5.4.2", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "e77046c252be48c48a40816187ed527703c8f76c" + "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e77046c252be48c48a40816187ed527703c8f76c", - "reference": "e77046c252be48c48a40816187ed527703c8f76c", + "url": "https://api.github.com/repos/symfony/finder/zipball/231313534dded84c7ecaa79d14bc5da4ccb69b7d", + "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d", "shasum": "" }, "require": { @@ -3373,7 +3348,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.2" + "source": "https://github.com/symfony/finder/tree/v5.4.3" }, "funding": [ { @@ -3389,20 +3364,20 @@ "type": "tidelift" } ], - "time": "2021-12-15T11:06:13+00:00" + "time": "2022-01-26T16:34:36+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.0", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "b0fb78576487af19c500aaddb269fd36701d4847" + "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b0fb78576487af19c500aaddb269fd36701d4847", - "reference": "b0fb78576487af19c500aaddb269fd36701d4847", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc1147cb11af1b43f503ac18f31aa3bec213aba8", + "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8", "shasum": "" }, "require": { @@ -3442,7 +3417,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.0" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.3" }, "funding": [ { @@ -3458,11 +3433,11 @@ "type": "tidelift" } ], - "time": "2021-11-23T10:19:22+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -3494,12 +3469,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3524,7 +3499,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" }, "funding": [ { @@ -3544,7 +3519,7 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", @@ -3573,12 +3548,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3605,7 +3580,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" }, "funding": [ { @@ -3625,7 +3600,7 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -3657,12 +3632,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3688,7 +3663,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" }, "funding": [ { @@ -3776,7 +3751,7 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", @@ -3802,12 +3777,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -3835,7 +3810,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" }, "funding": [ { @@ -3855,16 +3830,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", - "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", "shasum": "" }, "require": { @@ -3881,12 +3856,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -3918,7 +3893,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" }, "funding": [ { @@ -3934,20 +3909,20 @@ "type": "tidelift" } ], - "time": "2021-09-13T13:58:33+00:00" + "time": "2022-03-04T08:16:47+00:00" }, { "name": "symfony/process", - "version": "v5.4.2", + "version": "v5.4.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4" + "reference": "38a44b2517b470a436e1c944bf9b9ba3961137fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", - "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", + "url": "https://api.github.com/repos/symfony/process/zipball/38a44b2517b470a436e1c944bf9b9ba3961137fb", + "reference": "38a44b2517b470a436e1c944bf9b9ba3961137fb", "shasum": "" }, "require": { @@ -3980,7 +3955,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.2" + "source": "https://github.com/symfony/process/tree/v5.4.7" }, "funding": [ { @@ -3996,7 +3971,7 @@ "type": "tidelift" } ], - "time": "2021-12-27T21:01:00+00:00" + "time": "2022-03-18T16:18:52+00:00" }, { "name": "symfony/service-contracts", @@ -4083,16 +4058,16 @@ }, { "name": "symfony/stopwatch", - "version": "v5.4.0", + "version": "v5.4.5", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe" + "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/208ef96122bfed82a8f3a61458a07113a08bdcfe", - "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", + "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", "shasum": "" }, "require": { @@ -4125,7 +4100,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.0" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.5" }, "funding": [ { @@ -4141,20 +4116,20 @@ "type": "tidelift" } ], - "time": "2021-11-23T10:19:22+00:00" + "time": "2022-02-18T16:06:09+00:00" }, { "name": "symfony/string", - "version": "v5.4.2", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d" + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", - "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", + "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10", + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10", "shasum": "" }, "require": { @@ -4176,12 +4151,12 @@ }, "type": "library", "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, "files": [ "Resources/functions.php" ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, "exclude-from-classmap": [ "/Tests/" ] @@ -4211,7 +4186,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.2" + "source": "https://github.com/symfony/string/tree/v5.4.3" }, "funding": [ { @@ -4227,7 +4202,7 @@ "type": "tidelift" } ], - "time": "2021-12-16T21:52:00+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "theseer/tokenizer", @@ -4350,5 +4325,5 @@ "ext-mbstring": "*" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.2.0" } diff --git a/docs/Api/DeliveryApi.md b/docs/Api/DeliveryApi.md index e0270bb..e5aa773 100644 --- a/docs/Api/DeliveryApi.md +++ b/docs/Api/DeliveryApi.md @@ -309,7 +309,7 @@ $associate_array['contract'] = 'BTC_USDT_20200814'; // string | Futures contract $associate_array['from'] = 1546905600; // int | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified $associate_array['to'] = 1546935600; // int | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time $associate_array['limit'] = 100; // int | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. -$associate_array['interval'] = '5m'; // string | Interval time between data points +$associate_array['interval'] = '5m'; // string | Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 try { $result = $apiInstance->listDeliveryCandlesticks($associate_array); @@ -334,7 +334,7 @@ Name | Type | Description | Notes **from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] **to** | **int**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] **limit** | **int**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] - **interval** | **string**| Interval time between data points | [optional] [default to '5m'] + **interval** | **string**| Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 | [optional] [default to '5m'] ### Return type @@ -924,7 +924,7 @@ Name | Type | Description | Notes List futures orders -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Zero-filled order cannot be retrieved 10 minutes after order cancellation ### Example @@ -1000,7 +1000,7 @@ Name | Type | Description | Notes Create a futures order -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Zero-filled order cannot be retrieved 10 minutes after order cancellation ### Example @@ -1064,7 +1064,7 @@ Name | Type | Description | Notes Cancel all `open` orders matched -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Zero-filled order cannot be retrieved 10 minutes after order cancellation ### Example @@ -1130,7 +1130,7 @@ Name | Type | Description | Notes Get a single order -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Zero-filled order cannot be retrieved 10 minutes after order cancellation ### Example diff --git a/docs/Api/FuturesApi.md b/docs/Api/FuturesApi.md index f64e953..430a910 100644 --- a/docs/Api/FuturesApi.md +++ b/docs/Api/FuturesApi.md @@ -316,7 +316,7 @@ $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract $associate_array['from'] = 1546905600; // int | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified $associate_array['to'] = 1546935600; // int | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time $associate_array['limit'] = 100; // int | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. -$associate_array['interval'] = '5m'; // string | Interval time between data points +$associate_array['interval'] = '5m'; // string | Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 try { $result = $apiInstance->listFuturesCandlesticks($associate_array); @@ -341,7 +341,7 @@ Name | Type | Description | Notes **from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] **to** | **int**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] **limit** | **int**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] - **interval** | **string**| Interval time between data points | [optional] [default to '5m'] + **interval** | **string**| Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 | [optional] [default to '5m'] ### Return type @@ -1317,7 +1317,7 @@ Name | Type | Description | Notes ## updateDualModePositionLeverage -> \GateApi\Model\Position[] updateDualModePositionLeverage($settle, $contract, $leverage) +> \GateApi\Model\Position[] updateDualModePositionLeverage($settle, $contract, $leverage, $cross_leverage_limit) Update position leverage in dual mode @@ -1340,9 +1340,10 @@ $apiInstance = new GateApi\Api\FuturesApi( $settle = 'usdt'; // string | Settle currency $contract = 'BTC_USDT'; // string | Futures contract $leverage = '10'; // string | New position leverage +$cross_leverage_limit = '10'; // string | Cross margin leverage(valid only when `leverage` is 0) try { - $result = $apiInstance->updateDualModePositionLeverage($settle, $contract, $leverage); + $result = $apiInstance->updateDualModePositionLeverage($settle, $contract, $leverage, $cross_leverage_limit); print_r($result); } catch (GateApi\GateApiException $e) { echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; @@ -1360,6 +1361,7 @@ Name | Type | Description | Notes **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **leverage** | **string**| New position leverage | + **cross_leverage_limit** | **string**| Cross margin leverage(valid only when `leverage` is 0) | [optional] ### Return type @@ -1449,7 +1451,7 @@ Name | Type | Description | Notes List futures orders -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Zero-filled order cannot be retrieved 10 minutes after order cancellation ### Example @@ -1525,7 +1527,7 @@ Name | Type | Description | Notes Create a futures order -Zero-fill order cannot be retrieved for 60 seconds after cancellation +- Creating futures orders requires `size`, which is number of contracts instead of currency amount. You can use `quanto_multiplier` in contract detail response to know how much currency 1 size contract represents - Zero-filled order cannot be retrieved 10 minutes after order cancellation. You will get a 404 not found for such orders - Set `reduce_only` to `true` can keep the position from changing side when reducing position size - In single position mode, to close a position, you need to set `size` to 0 and `close` to `true` - In dual position mode, to close one side position, you need to set `auto_size` side, `reduce_only` to true and `size` to 0 ### Example @@ -1589,7 +1591,7 @@ Name | Type | Description | Notes Cancel all `open` orders matched -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Zero-filled order cannot be retrieved 10 minutes after order cancellation ### Example @@ -1655,7 +1657,7 @@ Name | Type | Description | Notes Get a single order -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Zero-filled order cannot be retrieved 10 minutes after order cancellation ### Example diff --git a/docs/Api/SpotApi.md b/docs/Api/SpotApi.md index c5fa2a6..fe48abc 100644 --- a/docs/Api/SpotApi.md +++ b/docs/Api/SpotApi.md @@ -36,6 +36,8 @@ Method | HTTP request | Description List all currencies' details +Currency has two forms: 1. Only currency name, e.g., BTC, USDT 2. `_`, e.g., `HT_ETH` The latter one occurs when one currency has multiple chains. Currency detail contains a `chain` field whatever the form is. To retrieve all chains of one currency, you can use use all the details which has the name of the currency or name starting with `_`. + ### Example ```php diff --git a/docs/Model/Currency.md b/docs/Model/Currency.md index 99f3d22..5162e2c 100644 --- a/docs/Model/Currency.md +++ b/docs/Model/Currency.md @@ -11,5 +11,6 @@ Name | Type | Description | Notes **deposit_disabled** | **bool** | Whether currency's deposit is disabled | [optional] **trade_disabled** | **bool** | Whether currency's trading is disabled | [optional] **fixed_rate** | **string** | Fixed fee rate. Only for fixed rate currencies, not valid for normal currencies | [optional] +**chain** | **string** | Chain of currency | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CurrencyChain.md b/docs/Model/CurrencyChain.md index 5c87f36..a84ddfe 100644 --- a/docs/Model/CurrencyChain.md +++ b/docs/Model/CurrencyChain.md @@ -8,5 +8,7 @@ Name | Type | Description | Notes **name_cn** | **string** | Chain name in Chinese | [optional] **name_en** | **string** | Chain name in English | [optional] **is_disabled** | **int** | If it is disabled. 0 means NOT being disabled | [optional] +**is_deposit_disabled** | **int** | Is deposit disabled. 0 means not | [optional] +**is_withdraw_disabled** | **int** | Is withdrawal disabled. 0 means not | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Ticker.md b/docs/Model/Ticker.md index 123d2d3..6f46125 100644 --- a/docs/Model/Ticker.md +++ b/docs/Model/Ticker.md @@ -6,11 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency_pair** | **string** | Currency pair | [optional] **last** | **string** | Last trading price | [optional] -**lowest_ask** | **string** | Lowest ask | [optional] -**highest_bid** | **string** | Highest bid | [optional] -**change_percentage** | **string** | Change percentage. | [optional] -**base_volume** | **string** | Base currency trade volume | [optional] -**quote_volume** | **string** | Quote currency trade volume | [optional] +**lowest_ask** | **string** | Recent lowest ask | [optional] +**highest_bid** | **string** | Recent highest bid | [optional] +**change_percentage** | **string** | Change percentage in the last 24h | [optional] +**base_volume** | **string** | Base currency trade volume in the last 24h | [optional] +**quote_volume** | **string** | Quote currency trade volume in the last 24h | [optional] **high_24h** | **string** | Highest price in 24h | [optional] **low_24h** | **string** | Lowest price in 24h | [optional] **etf_net_value** | **string** | ETF net value | [optional] diff --git a/docs/Model/Transfer.md b/docs/Model/Transfer.md index 9b1d4ad..fe2a7b9 100644 --- a/docs/Model/Transfer.md +++ b/docs/Model/Transfer.md @@ -9,6 +9,6 @@ Name | Type | Description | Notes **to** | **string** | Account to transfer to | **amount** | **string** | Transfer amount | **currency_pair** | **string** | Margin currency pair. Required if transfer from or to margin account | [optional] -**settle** | **string** | Futures settle currency. Required if `currency` is `POINT` | [optional] +**settle** | **string** | Futures settle currency. Required if transferring from or to futures account | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/DeliveryApi.php b/src/Api/DeliveryApi.php index a367a80..1b91f83 100644 --- a/src/Api/DeliveryApi.php +++ b/src/Api/DeliveryApi.php @@ -1307,7 +1307,7 @@ protected function listDeliveryTradesRequest($associative_array) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) - * @param string $interval Interval time between data points (optional, default to '5m') + * @param string $interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional, default to '5m') * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1331,7 +1331,7 @@ public function listDeliveryCandlesticks($associative_array) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) - * @param string $interval Interval time between data points (optional, default to '5m') + * @param string $interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional, default to '5m') * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1392,7 +1392,7 @@ public function listDeliveryCandlesticksWithHttpInfo($associative_array) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) - * @param string $interval Interval time between data points (optional, default to '5m') + * @param string $interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional, default to '5m') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1419,7 +1419,7 @@ function ($response) { * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) - * @param string $interval Interval time between data points (optional, default to '5m') + * @param string $interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional, default to '5m') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1473,7 +1473,7 @@ function ($exception) { * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) - * @param string $interval Interval time between data points (optional, default to '5m') + * @param string $interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional, default to '5m') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/src/Api/FuturesApi.php b/src/Api/FuturesApi.php index f543b90..c342ad3 100644 --- a/src/Api/FuturesApi.php +++ b/src/Api/FuturesApi.php @@ -1307,7 +1307,7 @@ protected function listFuturesTradesRequest($associative_array) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) - * @param string $interval Interval time between data points (optional, default to '5m') + * @param string $interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional, default to '5m') * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1331,7 +1331,7 @@ public function listFuturesCandlesticks($associative_array) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) - * @param string $interval Interval time between data points (optional, default to '5m') + * @param string $interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional, default to '5m') * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1392,7 +1392,7 @@ public function listFuturesCandlesticksWithHttpInfo($associative_array) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) - * @param string $interval Interval time between data points (optional, default to '5m') + * @param string $interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional, default to '5m') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1419,7 +1419,7 @@ function ($response) { * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) - * @param string $interval Interval time between data points (optional, default to '5m') + * @param string $interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional, default to '5m') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1473,7 +1473,7 @@ function ($exception) { * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) - * @param string $interval Interval time between data points (optional, default to '5m') + * @param string $interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional, default to '5m') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -5923,17 +5923,18 @@ protected function updateDualModePositionMarginRequest($settle, $contract, $chan * * Update position leverage in dual mode * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract (required) - * @param string $leverage New position leverage (required) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param string $leverage New position leverage (required) + * @param string $cross_leverage_limit Cross margin leverage(valid only when `leverage` is 0) (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \GateApi\Model\Position[] */ - public function updateDualModePositionLeverage($settle, $contract, $leverage) + public function updateDualModePositionLeverage($settle, $contract, $leverage, $cross_leverage_limit = null) { - list($response) = $this->updateDualModePositionLeverageWithHttpInfo($settle, $contract, $leverage); + list($response) = $this->updateDualModePositionLeverageWithHttpInfo($settle, $contract, $leverage, $cross_leverage_limit); return $response; } @@ -5942,17 +5943,18 @@ public function updateDualModePositionLeverage($settle, $contract, $leverage) * * Update position leverage in dual mode * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract (required) - * @param string $leverage New position leverage (required) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param string $leverage New position leverage (required) + * @param string $cross_leverage_limit Cross margin leverage(valid only when `leverage` is 0) (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \GateApi\Model\Position[], HTTP status code, HTTP response headers (array of strings) */ - public function updateDualModePositionLeverageWithHttpInfo($settle, $contract, $leverage) + public function updateDualModePositionLeverageWithHttpInfo($settle, $contract, $leverage, $cross_leverage_limit = null) { - $request = $this->updateDualModePositionLeverageRequest($settle, $contract, $leverage); + $request = $this->updateDualModePositionLeverageRequest($settle, $contract, $leverage, $cross_leverage_limit); $options = $this->createHttpClientOption(); try { @@ -5998,16 +6000,17 @@ public function updateDualModePositionLeverageWithHttpInfo($settle, $contract, $ * * Update position leverage in dual mode * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract (required) - * @param string $leverage New position leverage (required) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param string $leverage New position leverage (required) + * @param string $cross_leverage_limit Cross margin leverage(valid only when `leverage` is 0) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateDualModePositionLeverageAsync($settle, $contract, $leverage) + public function updateDualModePositionLeverageAsync($settle, $contract, $leverage, $cross_leverage_limit = null) { - return $this->updateDualModePositionLeverageAsyncWithHttpInfo($settle, $contract, $leverage) + return $this->updateDualModePositionLeverageAsyncWithHttpInfo($settle, $contract, $leverage, $cross_leverage_limit) ->then( function ($response) { return $response[0]; @@ -6020,17 +6023,18 @@ function ($response) { * * Update position leverage in dual mode * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract (required) - * @param string $leverage New position leverage (required) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param string $leverage New position leverage (required) + * @param string $cross_leverage_limit Cross margin leverage(valid only when `leverage` is 0) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateDualModePositionLeverageAsyncWithHttpInfo($settle, $contract, $leverage) + public function updateDualModePositionLeverageAsyncWithHttpInfo($settle, $contract, $leverage, $cross_leverage_limit = null) { $returnType = '\GateApi\Model\Position[]'; - $request = $this->updateDualModePositionLeverageRequest($settle, $contract, $leverage); + $request = $this->updateDualModePositionLeverageRequest($settle, $contract, $leverage, $cross_leverage_limit); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6069,14 +6073,15 @@ function ($exception) { /** * Create request for operation 'updateDualModePositionLeverage' * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract (required) - * @param string $leverage New position leverage (required) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param string $leverage New position leverage (required) + * @param string $cross_leverage_limit Cross margin leverage(valid only when `leverage` is 0) (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateDualModePositionLeverageRequest($settle, $contract, $leverage) + protected function updateDualModePositionLeverageRequest($settle, $contract, $leverage, $cross_leverage_limit = null) { // verify the required parameter 'settle' is set if ($settle === null || (is_array($settle) && count($settle) === 0)) { @@ -6116,6 +6121,18 @@ protected function updateDualModePositionLeverageRequest($settle, $contract, $le } } + // query params + if ($cross_leverage_limit !== null) { + if('form' === 'form' && is_array($cross_leverage_limit)) { + foreach($cross_leverage_limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['cross_leverage_limit'] = $cross_leverage_limit; + } + } + // path params if ($settle !== null) { $resourcePath = str_replace( diff --git a/src/Configuration.php b/src/Configuration.php index afe4451..b3623e2 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.23.2/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.23.3/PHP'; /** * Debug switch (default set to false) @@ -387,18 +387,18 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.23.2' . PHP_EOL; - $report .= ' SDK Package Version: 5.23.2' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.23.3' . PHP_EOL; + $report .= ' SDK Package Version: 5.23.3' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; } /** - * @param string $method Request method - * @param string $resourcePath Request path - * @param array $queryParams Query parameter array - * @param string $payload Body string + * @param string $method Request method + * @param string $resourcePath Request path + * @param array $queryParams Query parameter array + * @param string $payload Body string * @return array Signature headers */ public function buildSignHeaders($method, $resourcePath, $queryParams = null, $payload = null) diff --git a/src/HeaderSelector.php b/src/HeaderSelector.php index 938a1c9..ac37136 100644 --- a/src/HeaderSelector.php +++ b/src/HeaderSelector.php @@ -39,8 +39,8 @@ class HeaderSelector { /** - * @param string[] $accept - * @param string[] $contentTypes + * @param string[] $accept + * @param string[] $contentTypes * @return array */ public function selectHeaders($accept, $contentTypes) @@ -57,7 +57,7 @@ public function selectHeaders($accept, $contentTypes) } /** - * @param string[] $accept + * @param string[] $accept * @return array */ public function selectHeadersForMultipart($accept) diff --git a/src/Model/AccountBalance.php b/src/Model/AccountBalance.php index 007d1a8..314f1c0 100644 --- a/src/Model/AccountBalance.php +++ b/src/Model/AccountBalance.php @@ -43,27 +43,27 @@ class AccountBalance implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AccountBalance'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'amount' => 'string', 'currency' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'amount' => null, 'currency' => null @@ -298,7 +298,7 @@ public function setCurrency($currency) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -310,9 +310,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -323,7 +324,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -339,7 +340,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/AutoRepaySetting.php b/src/Model/AutoRepaySetting.php index 198e38f..284911e 100644 --- a/src/Model/AutoRepaySetting.php +++ b/src/Model/AutoRepaySetting.php @@ -42,26 +42,26 @@ class AutoRepaySetting implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AutoRepaySetting'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'status' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'status' => null ]; @@ -263,7 +263,7 @@ public function setStatus($status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -275,9 +275,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -288,7 +289,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -304,7 +305,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/BatchOrder.php b/src/Model/BatchOrder.php index 7768a21..740d46e 100644 --- a/src/Model/BatchOrder.php +++ b/src/Model/BatchOrder.php @@ -43,17 +43,17 @@ class BatchOrder implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'BatchOrder'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'text' => 'string', 'succeeded' => 'bool', @@ -88,10 +88,10 @@ class BatchOrder implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'text' => null, 'succeeded' => null, @@ -1268,7 +1268,7 @@ public function setRebatedFeeCurrency($rebated_fee_currency) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1280,9 +1280,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -1293,7 +1294,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1309,7 +1310,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CancelOrder.php b/src/Model/CancelOrder.php index 7e58653..5d26d33 100644 --- a/src/Model/CancelOrder.php +++ b/src/Model/CancelOrder.php @@ -43,17 +43,17 @@ class CancelOrder implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CancelOrder'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency_pair' => 'string', 'id' => 'string', @@ -61,10 +61,10 @@ class CancelOrder implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency_pair' => null, 'id' => null, @@ -298,7 +298,7 @@ public function setAccount($account) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -310,9 +310,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -323,7 +324,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -339,7 +340,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CancelOrderResult.php b/src/Model/CancelOrderResult.php index f4e1b2d..9e0e746 100644 --- a/src/Model/CancelOrderResult.php +++ b/src/Model/CancelOrderResult.php @@ -43,17 +43,17 @@ class CancelOrderResult implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CancelOrderResult'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency_pair' => 'string', 'id' => 'string', @@ -64,10 +64,10 @@ class CancelOrderResult implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency_pair' => null, 'id' => null, @@ -382,7 +382,7 @@ public function setAccount($account) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -394,9 +394,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -407,7 +408,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -423,7 +424,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/Contract.php b/src/Model/Contract.php index 3f9efbd..935507d 100644 --- a/src/Model/Contract.php +++ b/src/Model/Contract.php @@ -43,17 +43,17 @@ class Contract implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Contract'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'type' => 'string', @@ -90,10 +90,10 @@ class Contract implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'name' => null, 'type' => null, @@ -1226,7 +1226,7 @@ public function setOrdersLimit($orders_limit) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1238,9 +1238,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -1251,7 +1252,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1267,7 +1268,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/ContractStat.php b/src/Model/ContractStat.php index 7646c32..622a011 100644 --- a/src/Model/ContractStat.php +++ b/src/Model/ContractStat.php @@ -42,17 +42,17 @@ class ContractStat implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ContractStat'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'time' => 'int', 'lsr_taker' => 'float', @@ -70,10 +70,10 @@ class ContractStat implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'time' => 'int64', 'lsr_taker' => null, @@ -591,7 +591,7 @@ public function setTopLsrSize($top_lsr_size) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -603,9 +603,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -616,7 +617,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -632,7 +633,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CrossMarginAccount.php b/src/Model/CrossMarginAccount.php index f3053dc..f0734bf 100644 --- a/src/Model/CrossMarginAccount.php +++ b/src/Model/CrossMarginAccount.php @@ -42,17 +42,17 @@ class CrossMarginAccount implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CrossMarginAccount'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'user_id' => 'int', 'locked' => 'bool', @@ -64,10 +64,10 @@ class CrossMarginAccount implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'user_id' => 'int64', 'locked' => null, @@ -411,7 +411,7 @@ public function setRisk($risk) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -423,9 +423,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -436,7 +437,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -452,7 +453,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CrossMarginAccountBook.php b/src/Model/CrossMarginAccountBook.php index abe91c7..0036105 100644 --- a/src/Model/CrossMarginAccountBook.php +++ b/src/Model/CrossMarginAccountBook.php @@ -42,17 +42,17 @@ class CrossMarginAccountBook implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CrossMarginAccountBook'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'time' => 'int', @@ -63,10 +63,10 @@ class CrossMarginAccountBook implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => null, 'time' => 'int64', @@ -427,7 +427,7 @@ public function setType($type) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -439,9 +439,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -452,7 +453,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -468,7 +469,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CrossMarginBalance.php b/src/Model/CrossMarginBalance.php index 244a4d9..6c47acc 100644 --- a/src/Model/CrossMarginBalance.php +++ b/src/Model/CrossMarginBalance.php @@ -42,17 +42,17 @@ class CrossMarginBalance implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CrossMarginBalance'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'available' => 'string', 'freeze' => 'string', @@ -61,10 +61,10 @@ class CrossMarginBalance implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'available' => null, 'freeze' => null, @@ -321,7 +321,7 @@ public function setInterest($interest) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -333,9 +333,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -346,7 +347,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -362,7 +363,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CrossMarginBorrowable.php b/src/Model/CrossMarginBorrowable.php index 4dd6814..94a7270 100644 --- a/src/Model/CrossMarginBorrowable.php +++ b/src/Model/CrossMarginBorrowable.php @@ -42,27 +42,27 @@ class CrossMarginBorrowable implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CrossMarginBorrowable'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'amount' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'amount' => null @@ -261,7 +261,7 @@ public function setAmount($amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -273,9 +273,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -286,7 +287,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,7 +303,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CrossMarginCurrency.php b/src/Model/CrossMarginCurrency.php index bfb4df9..e8184fb 100644 --- a/src/Model/CrossMarginCurrency.php +++ b/src/Model/CrossMarginCurrency.php @@ -42,17 +42,17 @@ class CrossMarginCurrency implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CrossMarginCurrency'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'rate' => 'string', @@ -65,10 +65,10 @@ class CrossMarginCurrency implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'name' => null, 'rate' => null, @@ -441,7 +441,7 @@ public function setPrice($price) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -453,9 +453,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -466,7 +467,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -482,7 +483,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CrossMarginLoan.php b/src/Model/CrossMarginLoan.php index 9ee74ae..debb854 100644 --- a/src/Model/CrossMarginLoan.php +++ b/src/Model/CrossMarginLoan.php @@ -42,17 +42,17 @@ class CrossMarginLoan implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CrossMarginLoan'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'create_time' => 'int', @@ -67,10 +67,10 @@ class CrossMarginLoan implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => null, 'create_time' => 'int64', @@ -541,7 +541,7 @@ public function setUnpaidInterest($unpaid_interest) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -553,9 +553,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -566,7 +567,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -582,7 +583,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CrossMarginRepayRequest.php b/src/Model/CrossMarginRepayRequest.php index 3767471..9585de6 100644 --- a/src/Model/CrossMarginRepayRequest.php +++ b/src/Model/CrossMarginRepayRequest.php @@ -42,27 +42,27 @@ class CrossMarginRepayRequest implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CrossMarginRepayRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'amount' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'amount' => null @@ -267,7 +267,7 @@ public function setAmount($amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -279,9 +279,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -292,7 +293,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -308,7 +309,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CrossMarginRepayment.php b/src/Model/CrossMarginRepayment.php index be9b2ec..1808b94 100644 --- a/src/Model/CrossMarginRepayment.php +++ b/src/Model/CrossMarginRepayment.php @@ -42,17 +42,17 @@ class CrossMarginRepayment implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CrossMarginRepayment'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'create_time' => 'int', @@ -63,10 +63,10 @@ class CrossMarginRepayment implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => null, 'create_time' => 'int64', @@ -381,7 +381,7 @@ public function setInterest($interest) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -393,9 +393,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -406,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -422,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CrossMarginTransferable.php b/src/Model/CrossMarginTransferable.php index a9a616f..adfe6f3 100644 --- a/src/Model/CrossMarginTransferable.php +++ b/src/Model/CrossMarginTransferable.php @@ -42,27 +42,27 @@ class CrossMarginTransferable implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CrossMarginTransferable'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'amount' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'amount' => null @@ -261,7 +261,7 @@ public function setAmount($amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -273,9 +273,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -286,7 +287,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,7 +303,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/Currency.php b/src/Model/Currency.php index 2f637cd..61a7425 100644 --- a/src/Model/Currency.php +++ b/src/Model/Currency.php @@ -42,17 +42,17 @@ class Currency implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Currency'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'delisted' => 'bool', @@ -60,14 +60,15 @@ class Currency implements ModelInterface, ArrayAccess 'withdraw_delayed' => 'bool', 'deposit_disabled' => 'bool', 'trade_disabled' => 'bool', - 'fixed_rate' => 'string' + 'fixed_rate' => 'string', + 'chain' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'delisted' => null, @@ -75,7 +76,8 @@ class Currency implements ModelInterface, ArrayAccess 'withdraw_delayed' => null, 'deposit_disabled' => null, 'trade_disabled' => null, - 'fixed_rate' => null + 'fixed_rate' => null, + 'chain' => null ]; /** @@ -111,7 +113,8 @@ public static function openAPIFormats() 'withdraw_delayed' => 'withdraw_delayed', 'deposit_disabled' => 'deposit_disabled', 'trade_disabled' => 'trade_disabled', - 'fixed_rate' => 'fixed_rate' + 'fixed_rate' => 'fixed_rate', + 'chain' => 'chain' ]; /** @@ -126,7 +129,8 @@ public static function openAPIFormats() 'withdraw_delayed' => 'setWithdrawDelayed', 'deposit_disabled' => 'setDepositDisabled', 'trade_disabled' => 'setTradeDisabled', - 'fixed_rate' => 'setFixedRate' + 'fixed_rate' => 'setFixedRate', + 'chain' => 'setChain' ]; /** @@ -141,7 +145,8 @@ public static function openAPIFormats() 'withdraw_delayed' => 'getWithdrawDelayed', 'deposit_disabled' => 'getDepositDisabled', 'trade_disabled' => 'getTradeDisabled', - 'fixed_rate' => 'getFixedRate' + 'fixed_rate' => 'getFixedRate', + 'chain' => 'getChain' ]; /** @@ -211,6 +216,7 @@ public function __construct(array $data = null) $this->container['deposit_disabled'] = isset($data['deposit_disabled']) ? $data['deposit_disabled'] : null; $this->container['trade_disabled'] = isset($data['trade_disabled']) ? $data['trade_disabled'] : null; $this->container['fixed_rate'] = isset($data['fixed_rate']) ? $data['fixed_rate'] : null; + $this->container['chain'] = isset($data['chain']) ? $data['chain'] : null; } /** @@ -404,6 +410,30 @@ public function setFixedRate($fixed_rate) return $this; } + + /** + * Gets chain + * + * @return string|null + */ + public function getChain() + { + return $this->container['chain']; + } + + /** + * Sets chain + * + * @param string|null $chain Chain of currency + * + * @return $this + */ + public function setChain($chain) + { + $this->container['chain'] = $chain; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -411,7 +441,7 @@ public function setFixedRate($fixed_rate) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -423,9 +453,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -436,7 +467,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -452,7 +483,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CurrencyChain.php b/src/Model/CurrencyChain.php index e683cca..ac594dc 100644 --- a/src/Model/CurrencyChain.php +++ b/src/Model/CurrencyChain.php @@ -42,34 +42,38 @@ class CurrencyChain implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CurrencyChain'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'chain' => 'string', 'name_cn' => 'string', 'name_en' => 'string', - 'is_disabled' => 'int' + 'is_disabled' => 'int', + 'is_deposit_disabled' => 'int', + 'is_withdraw_disabled' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'chain' => null, 'name_cn' => null, 'name_en' => null, - 'is_disabled' => null + 'is_disabled' => null, + 'is_deposit_disabled' => null, + 'is_withdraw_disabled' => null ]; /** @@ -102,7 +106,9 @@ public static function openAPIFormats() 'chain' => 'chain', 'name_cn' => 'name_cn', 'name_en' => 'name_en', - 'is_disabled' => 'is_disabled' + 'is_disabled' => 'is_disabled', + 'is_deposit_disabled' => 'is_deposit_disabled', + 'is_withdraw_disabled' => 'is_withdraw_disabled' ]; /** @@ -114,7 +120,9 @@ public static function openAPIFormats() 'chain' => 'setChain', 'name_cn' => 'setNameCn', 'name_en' => 'setNameEn', - 'is_disabled' => 'setIsDisabled' + 'is_disabled' => 'setIsDisabled', + 'is_deposit_disabled' => 'setIsDepositDisabled', + 'is_withdraw_disabled' => 'setIsWithdrawDisabled' ]; /** @@ -126,7 +134,9 @@ public static function openAPIFormats() 'chain' => 'getChain', 'name_cn' => 'getNameCn', 'name_en' => 'getNameEn', - 'is_disabled' => 'getIsDisabled' + 'is_disabled' => 'getIsDisabled', + 'is_deposit_disabled' => 'getIsDepositDisabled', + 'is_withdraw_disabled' => 'getIsWithdrawDisabled' ]; /** @@ -193,6 +203,8 @@ public function __construct(array $data = null) $this->container['name_cn'] = isset($data['name_cn']) ? $data['name_cn'] : null; $this->container['name_en'] = isset($data['name_en']) ? $data['name_en'] : null; $this->container['is_disabled'] = isset($data['is_disabled']) ? $data['is_disabled'] : null; + $this->container['is_deposit_disabled'] = isset($data['is_deposit_disabled']) ? $data['is_deposit_disabled'] : null; + $this->container['is_withdraw_disabled'] = isset($data['is_withdraw_disabled']) ? $data['is_withdraw_disabled'] : null; } /** @@ -314,6 +326,54 @@ public function setIsDisabled($is_disabled) return $this; } + + /** + * Gets is_deposit_disabled + * + * @return int|null + */ + public function getIsDepositDisabled() + { + return $this->container['is_deposit_disabled']; + } + + /** + * Sets is_deposit_disabled + * + * @param int|null $is_deposit_disabled Is deposit disabled. 0 means not + * + * @return $this + */ + public function setIsDepositDisabled($is_deposit_disabled) + { + $this->container['is_deposit_disabled'] = $is_deposit_disabled; + + return $this; + } + + /** + * Gets is_withdraw_disabled + * + * @return int|null + */ + public function getIsWithdrawDisabled() + { + return $this->container['is_withdraw_disabled']; + } + + /** + * Sets is_withdraw_disabled + * + * @param int|null $is_withdraw_disabled Is withdrawal disabled. 0 means not + * + * @return $this + */ + public function setIsWithdrawDisabled($is_withdraw_disabled) + { + $this->container['is_withdraw_disabled'] = $is_withdraw_disabled; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -321,7 +381,7 @@ public function setIsDisabled($is_disabled) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -333,9 +393,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -346,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -362,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/CurrencyPair.php b/src/Model/CurrencyPair.php index d529adb..adcf004 100644 --- a/src/Model/CurrencyPair.php +++ b/src/Model/CurrencyPair.php @@ -43,17 +43,17 @@ class CurrencyPair implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CurrencyPair'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'base' => 'string', @@ -69,10 +69,10 @@ class CurrencyPair implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => null, 'base' => null, @@ -568,7 +568,7 @@ public function setBuyStart($buy_start) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -580,9 +580,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -593,7 +594,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -609,7 +610,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/DeliveryContract.php b/src/Model/DeliveryContract.php index 7f9d7aa..f3cbaae 100644 --- a/src/Model/DeliveryContract.php +++ b/src/Model/DeliveryContract.php @@ -43,17 +43,17 @@ class DeliveryContract implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'DeliveryContract'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'underlying' => 'string', @@ -96,10 +96,10 @@ class DeliveryContract implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'name' => null, 'underlying' => null, @@ -1442,7 +1442,7 @@ public function setOrdersLimit($orders_limit) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1454,9 +1454,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -1467,7 +1468,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1483,7 +1484,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/DeliverySettlement.php b/src/Model/DeliverySettlement.php index ec537d7..d6d6f30 100644 --- a/src/Model/DeliverySettlement.php +++ b/src/Model/DeliverySettlement.php @@ -42,17 +42,17 @@ class DeliverySettlement implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'DeliverySettlement'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'time' => 'int', 'contract' => 'string', @@ -66,10 +66,10 @@ class DeliverySettlement implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'time' => 'int64', 'contract' => null, @@ -471,7 +471,7 @@ public function setFee($fee) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -483,9 +483,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -496,7 +497,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -512,7 +513,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/DepositAddress.php b/src/Model/DepositAddress.php index d008648..12839f5 100644 --- a/src/Model/DepositAddress.php +++ b/src/Model/DepositAddress.php @@ -42,17 +42,17 @@ class DepositAddress implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'DepositAddress'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'address' => 'string', @@ -60,10 +60,10 @@ class DepositAddress implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'address' => null, @@ -297,7 +297,7 @@ public function setMultichainAddresses($multichain_addresses) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -309,9 +309,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -322,7 +323,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -338,7 +339,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FundingAccount.php b/src/Model/FundingAccount.php index 79e4ae3..b6aeac4 100644 --- a/src/Model/FundingAccount.php +++ b/src/Model/FundingAccount.php @@ -42,17 +42,17 @@ class FundingAccount implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FundingAccount'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'available' => 'string', @@ -62,10 +62,10 @@ class FundingAccount implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'available' => null, @@ -351,7 +351,7 @@ public function setTotalLent($total_lent) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -363,9 +363,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -376,7 +377,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -392,7 +393,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FundingBookItem.php b/src/Model/FundingBookItem.php index 5fd0f18..5c1698b 100644 --- a/src/Model/FundingBookItem.php +++ b/src/Model/FundingBookItem.php @@ -42,17 +42,17 @@ class FundingBookItem implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FundingBookItem'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'rate' => 'string', 'amount' => 'string', @@ -60,10 +60,10 @@ class FundingBookItem implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'rate' => null, 'amount' => null, @@ -291,7 +291,7 @@ public function setDays($days) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -303,9 +303,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -316,7 +317,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,7 +333,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FundingRateRecord.php b/src/Model/FundingRateRecord.php index 728d189..5a3af72 100644 --- a/src/Model/FundingRateRecord.php +++ b/src/Model/FundingRateRecord.php @@ -42,27 +42,27 @@ class FundingRateRecord implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FundingRateRecord'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 't' => 'int', 'r' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 't' => 'int64', 'r' => null @@ -261,7 +261,7 @@ public function setR($r) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -273,9 +273,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -286,7 +287,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,7 +303,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FuturesAccount.php b/src/Model/FuturesAccount.php index 2ce1604..00904e9 100644 --- a/src/Model/FuturesAccount.php +++ b/src/Model/FuturesAccount.php @@ -42,17 +42,17 @@ class FuturesAccount implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FuturesAccount'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'total' => 'string', 'unrealised_pnl' => 'string', @@ -65,10 +65,10 @@ class FuturesAccount implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'total' => null, 'unrealised_pnl' => null, @@ -441,7 +441,7 @@ public function setInDualMode($in_dual_mode) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -453,9 +453,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -466,7 +467,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -482,7 +483,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FuturesAccountBook.php b/src/Model/FuturesAccountBook.php index be2f976..3e52f58 100644 --- a/src/Model/FuturesAccountBook.php +++ b/src/Model/FuturesAccountBook.php @@ -42,17 +42,17 @@ class FuturesAccountBook implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FuturesAccountBook'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'time' => 'double', 'change' => 'string', @@ -62,10 +62,10 @@ class FuturesAccountBook implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'time' => 'double', 'change' => null, @@ -395,7 +395,7 @@ public function setText($text) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -407,9 +407,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -420,7 +421,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -436,7 +437,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FuturesCandlestick.php b/src/Model/FuturesCandlestick.php index 748bcba..bfd519a 100644 --- a/src/Model/FuturesCandlestick.php +++ b/src/Model/FuturesCandlestick.php @@ -43,17 +43,17 @@ class FuturesCandlestick implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FuturesCandlestick'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 't' => 'double', 'v' => 'int', @@ -64,10 +64,10 @@ class FuturesCandlestick implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 't' => 'double', 'v' => 'int64', @@ -382,7 +382,7 @@ public function setO($o) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -394,9 +394,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -407,7 +408,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -423,7 +424,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FuturesInitialOrder.php b/src/Model/FuturesInitialOrder.php index bd854ec..231cb89 100644 --- a/src/Model/FuturesInitialOrder.php +++ b/src/Model/FuturesInitialOrder.php @@ -42,17 +42,17 @@ class FuturesInitialOrder implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FuturesInitialOrder'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'contract' => 'string', 'size' => 'int', @@ -66,10 +66,10 @@ class FuturesInitialOrder implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'contract' => null, 'size' => 'int64', @@ -509,7 +509,7 @@ public function setIsClose($is_close) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -521,9 +521,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -534,7 +535,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -550,7 +551,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FuturesLiquidate.php b/src/Model/FuturesLiquidate.php index 112c2b7..db5b782 100644 --- a/src/Model/FuturesLiquidate.php +++ b/src/Model/FuturesLiquidate.php @@ -42,17 +42,17 @@ class FuturesLiquidate implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FuturesLiquidate'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'time' => 'int', 'contract' => 'string', @@ -69,10 +69,10 @@ class FuturesLiquidate implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'time' => 'int64', 'contract' => null, @@ -561,7 +561,7 @@ public function setLeft($left) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -573,9 +573,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -586,7 +587,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -602,7 +603,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FuturesOrder.php b/src/Model/FuturesOrder.php index 92a4eb8..a49904d 100644 --- a/src/Model/FuturesOrder.php +++ b/src/Model/FuturesOrder.php @@ -43,17 +43,17 @@ class FuturesOrder implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FuturesOrder'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'user' => 'int', @@ -81,10 +81,10 @@ class FuturesOrder implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'user' => null, @@ -1040,7 +1040,7 @@ public function setAutoSize($auto_size) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1052,9 +1052,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -1065,7 +1066,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1081,7 +1082,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FuturesOrderBook.php b/src/Model/FuturesOrderBook.php index 89df464..74a436d 100644 --- a/src/Model/FuturesOrderBook.php +++ b/src/Model/FuturesOrderBook.php @@ -42,17 +42,17 @@ class FuturesOrderBook implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FuturesOrderBook'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'current' => 'double', @@ -62,10 +62,10 @@ class FuturesOrderBook implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'current' => 'double', @@ -357,7 +357,7 @@ public function setBids($bids) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -369,9 +369,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -382,7 +383,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -398,7 +399,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FuturesOrderBookItem.php b/src/Model/FuturesOrderBookItem.php index 8e775b7..b51ccc9 100644 --- a/src/Model/FuturesOrderBookItem.php +++ b/src/Model/FuturesOrderBookItem.php @@ -42,27 +42,27 @@ class FuturesOrderBookItem implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'futures_order_book_item'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'p' => 'string', 's' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'p' => null, 's' => 'int64' @@ -261,7 +261,7 @@ public function setS($s) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -273,9 +273,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -286,7 +287,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,7 +303,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FuturesPriceTrigger.php b/src/Model/FuturesPriceTrigger.php index 3266215..01aa38f 100644 --- a/src/Model/FuturesPriceTrigger.php +++ b/src/Model/FuturesPriceTrigger.php @@ -42,17 +42,17 @@ class FuturesPriceTrigger implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FuturesPriceTrigger'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'strategy_type' => 'int', 'price_type' => 'int', @@ -62,10 +62,10 @@ class FuturesPriceTrigger implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'strategy_type' => null, 'price_type' => null, @@ -449,7 +449,7 @@ public function setExpiration($expiration) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -461,9 +461,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -474,7 +475,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -490,7 +491,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FuturesPriceTriggeredOrder.php b/src/Model/FuturesPriceTriggeredOrder.php index e4fe249..46b8bfd 100644 --- a/src/Model/FuturesPriceTriggeredOrder.php +++ b/src/Model/FuturesPriceTriggeredOrder.php @@ -43,17 +43,17 @@ class FuturesPriceTriggeredOrder implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FuturesPriceTriggeredOrder'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'initial' => '\GateApi\Model\FuturesInitialOrder', 'trigger' => '\GateApi\Model\FuturesPriceTrigger', @@ -68,10 +68,10 @@ class FuturesPriceTriggeredOrder implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'initial' => null, 'trigger' => null, @@ -576,7 +576,7 @@ public function setReason($reason) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -588,9 +588,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -601,7 +602,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -617,7 +618,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FuturesTicker.php b/src/Model/FuturesTicker.php index d5ffd7a..b96448b 100644 --- a/src/Model/FuturesTicker.php +++ b/src/Model/FuturesTicker.php @@ -42,17 +42,17 @@ class FuturesTicker implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FuturesTicker'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'contract' => 'string', 'last' => 'string', @@ -74,10 +74,10 @@ class FuturesTicker implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'contract' => null, 'last' => null, @@ -711,7 +711,7 @@ public function setQuantoBaseRate($quanto_base_rate) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -723,9 +723,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -736,7 +737,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -752,7 +753,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/FuturesTrade.php b/src/Model/FuturesTrade.php index cf12d37..b242a53 100644 --- a/src/Model/FuturesTrade.php +++ b/src/Model/FuturesTrade.php @@ -42,17 +42,17 @@ class FuturesTrade implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FuturesTrade'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'create_time' => 'double', @@ -63,10 +63,10 @@ class FuturesTrade implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'create_time' => 'double', @@ -381,7 +381,7 @@ public function setPrice($price) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -393,9 +393,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -406,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -422,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/InsuranceRecord.php b/src/Model/InsuranceRecord.php index c143a5d..4c89cf8 100644 --- a/src/Model/InsuranceRecord.php +++ b/src/Model/InsuranceRecord.php @@ -42,27 +42,27 @@ class InsuranceRecord implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'InsuranceRecord'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 't' => 'int', 'b' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 't' => 'int64', 'b' => null @@ -261,7 +261,7 @@ public function setB($b) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -273,9 +273,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -286,7 +287,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,7 +303,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/LedgerRecord.php b/src/Model/LedgerRecord.php index 081a4d7..847c7f1 100644 --- a/src/Model/LedgerRecord.php +++ b/src/Model/LedgerRecord.php @@ -42,17 +42,17 @@ class LedgerRecord implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'LedgerRecord'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'txid' => 'string', @@ -67,10 +67,10 @@ class LedgerRecord implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => null, 'txid' => null, @@ -557,7 +557,7 @@ public function setFee($fee) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -569,9 +569,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -582,7 +583,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -598,7 +599,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/Loan.php b/src/Model/Loan.php index c094aaf..a6e89dc 100644 --- a/src/Model/Loan.php +++ b/src/Model/Loan.php @@ -43,17 +43,17 @@ class Loan implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Loan'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'create_time' => 'string', @@ -76,10 +76,10 @@ class Loan implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => null, 'create_time' => null, @@ -819,7 +819,7 @@ public function setText($text) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -831,9 +831,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -844,7 +845,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -860,7 +861,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/LoanPatch.php b/src/Model/LoanPatch.php index 3a2d25a..4b3c73f 100644 --- a/src/Model/LoanPatch.php +++ b/src/Model/LoanPatch.php @@ -42,17 +42,17 @@ class LoanPatch implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'LoanPatch'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'side' => 'string', @@ -62,10 +62,10 @@ class LoanPatch implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'side' => null, @@ -392,7 +392,7 @@ public function setLoanId($loan_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -404,9 +404,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -417,7 +418,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -433,7 +434,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/LoanRecord.php b/src/Model/LoanRecord.php index dd35a4b..547971e 100644 --- a/src/Model/LoanRecord.php +++ b/src/Model/LoanRecord.php @@ -43,17 +43,17 @@ class LoanRecord implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'LoanRecord'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'loan_id' => 'string', @@ -72,10 +72,10 @@ class LoanRecord implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => null, 'loan_id' => null, @@ -654,7 +654,7 @@ public function setUnpaidInterest($unpaid_interest) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -666,9 +666,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -679,7 +680,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -695,7 +696,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/MarginAccount.php b/src/Model/MarginAccount.php index 5da1789..18d670f 100644 --- a/src/Model/MarginAccount.php +++ b/src/Model/MarginAccount.php @@ -43,17 +43,17 @@ class MarginAccount implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'MarginAccount'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency_pair' => 'string', 'locked' => 'bool', @@ -63,10 +63,10 @@ class MarginAccount implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency_pair' => null, 'locked' => null, @@ -352,7 +352,7 @@ public function setQuote($quote) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -364,9 +364,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -377,7 +378,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -393,7 +394,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/MarginAccountBook.php b/src/Model/MarginAccountBook.php index 4b22c8c..56ac9cc 100644 --- a/src/Model/MarginAccountBook.php +++ b/src/Model/MarginAccountBook.php @@ -42,17 +42,17 @@ class MarginAccountBook implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'MarginAccountBook'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'time' => 'string', @@ -64,10 +64,10 @@ class MarginAccountBook implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => null, 'time' => null, @@ -411,7 +411,7 @@ public function setBalance($balance) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -423,9 +423,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -436,7 +437,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -452,7 +453,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/MarginAccountCurrency.php b/src/Model/MarginAccountCurrency.php index e68f194..f6549cd 100644 --- a/src/Model/MarginAccountCurrency.php +++ b/src/Model/MarginAccountCurrency.php @@ -43,17 +43,17 @@ class MarginAccountCurrency implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'MarginAccountCurrency'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'available' => 'string', @@ -63,10 +63,10 @@ class MarginAccountCurrency implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'available' => null, @@ -352,7 +352,7 @@ public function setInterest($interest) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -364,9 +364,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -377,7 +378,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -393,7 +394,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/MarginBorrowable.php b/src/Model/MarginBorrowable.php index ab3b736..0efc6bf 100644 --- a/src/Model/MarginBorrowable.php +++ b/src/Model/MarginBorrowable.php @@ -42,17 +42,17 @@ class MarginBorrowable implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'MarginBorrowable'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'currency_pair' => 'string', @@ -60,10 +60,10 @@ class MarginBorrowable implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'currency_pair' => null, @@ -291,7 +291,7 @@ public function setAmount($amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -303,9 +303,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -316,7 +317,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,7 +333,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/MarginCurrencyPair.php b/src/Model/MarginCurrencyPair.php index 392411d..b43d848 100644 --- a/src/Model/MarginCurrencyPair.php +++ b/src/Model/MarginCurrencyPair.php @@ -42,17 +42,17 @@ class MarginCurrencyPair implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'MarginCurrencyPair'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'base' => 'string', @@ -64,10 +64,10 @@ class MarginCurrencyPair implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => null, 'base' => null, @@ -411,7 +411,7 @@ public function setMaxQuoteAmount($max_quote_amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -423,9 +423,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -436,7 +437,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -452,7 +453,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/MarginTransferable.php b/src/Model/MarginTransferable.php index 75b6039..5c4a7e1 100644 --- a/src/Model/MarginTransferable.php +++ b/src/Model/MarginTransferable.php @@ -42,17 +42,17 @@ class MarginTransferable implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'MarginTransferable'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'currency_pair' => 'string', @@ -60,10 +60,10 @@ class MarginTransferable implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'currency_pair' => null, @@ -291,7 +291,7 @@ public function setAmount($amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -303,9 +303,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -316,7 +317,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,7 +333,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/MultiChainAddressItem.php b/src/Model/MultiChainAddressItem.php index 126ed0e..7843ed0 100644 --- a/src/Model/MultiChainAddressItem.php +++ b/src/Model/MultiChainAddressItem.php @@ -42,17 +42,17 @@ class MultiChainAddressItem implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'MultiChainAddressItem'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'chain' => 'string', 'address' => 'string', @@ -62,10 +62,10 @@ class MultiChainAddressItem implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'chain' => null, 'address' => null, @@ -351,7 +351,7 @@ public function setObtainFailed($obtain_failed) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -363,9 +363,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -376,7 +377,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -392,7 +393,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/MyFuturesTrade.php b/src/Model/MyFuturesTrade.php index cf62509..441bf11 100644 --- a/src/Model/MyFuturesTrade.php +++ b/src/Model/MyFuturesTrade.php @@ -42,17 +42,17 @@ class MyFuturesTrade implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'MyFuturesTrade'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'create_time' => 'double', @@ -64,10 +64,10 @@ class MyFuturesTrade implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'create_time' => 'double', @@ -443,7 +443,7 @@ public function setRole($role) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -455,9 +455,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -468,7 +469,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -484,7 +485,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OpenOrders.php b/src/Model/OpenOrders.php index 4ee2586..379ad3c 100644 --- a/src/Model/OpenOrders.php +++ b/src/Model/OpenOrders.php @@ -42,17 +42,17 @@ class OpenOrders implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OpenOrders'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency_pair' => 'string', 'total' => 'int', @@ -60,10 +60,10 @@ class OpenOrders implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency_pair' => null, 'total' => null, @@ -291,7 +291,7 @@ public function setOrders($orders) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -303,9 +303,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -316,7 +317,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,7 +333,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OptionsAccount.php b/src/Model/OptionsAccount.php index 6b83ffe..facfeda 100644 --- a/src/Model/OptionsAccount.php +++ b/src/Model/OptionsAccount.php @@ -42,17 +42,17 @@ class OptionsAccount implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OptionsAccount'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'user' => 'int', 'total' => 'string', @@ -67,10 +67,10 @@ class OptionsAccount implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'user' => null, 'total' => null, @@ -501,7 +501,7 @@ public function setCurrency($currency) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -513,9 +513,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -526,7 +527,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -542,7 +543,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OptionsAccountBook.php b/src/Model/OptionsAccountBook.php index 3c08418..55437a8 100644 --- a/src/Model/OptionsAccountBook.php +++ b/src/Model/OptionsAccountBook.php @@ -42,17 +42,17 @@ class OptionsAccountBook implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OptionsAccountBook'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'time' => 'double', 'change' => 'string', @@ -62,10 +62,10 @@ class OptionsAccountBook implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'time' => 'double', 'change' => null, @@ -351,7 +351,7 @@ public function setText($text) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -363,9 +363,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -376,7 +377,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -392,7 +393,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OptionsContract.php b/src/Model/OptionsContract.php index f5188b8..508ec1a 100644 --- a/src/Model/OptionsContract.php +++ b/src/Model/OptionsContract.php @@ -43,17 +43,17 @@ class OptionsContract implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OptionsContract'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'tag' => 'string', @@ -83,10 +83,10 @@ class OptionsContract implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'name' => null, 'tag' => null, @@ -952,7 +952,7 @@ public function setOrdersLimit($orders_limit) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -964,9 +964,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -977,7 +978,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -993,7 +994,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OptionsMyTrade.php b/src/Model/OptionsMyTrade.php index 3b96536..1bd2f4e 100644 --- a/src/Model/OptionsMyTrade.php +++ b/src/Model/OptionsMyTrade.php @@ -42,17 +42,17 @@ class OptionsMyTrade implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OptionsMyTrade'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'create_time' => 'double', @@ -65,10 +65,10 @@ class OptionsMyTrade implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'create_time' => 'double', @@ -473,7 +473,7 @@ public function setRole($role) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -485,9 +485,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -498,7 +499,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -514,7 +515,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OptionsOrder.php b/src/Model/OptionsOrder.php index d2fd3e9..0800fc1 100644 --- a/src/Model/OptionsOrder.php +++ b/src/Model/OptionsOrder.php @@ -43,17 +43,17 @@ class OptionsOrder implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OptionsOrder'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'user' => 'int', @@ -80,10 +80,10 @@ class OptionsOrder implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'user' => null, @@ -978,7 +978,7 @@ public function setRefu($refu) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -990,9 +990,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -1003,7 +1004,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1019,7 +1020,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OptionsPosition.php b/src/Model/OptionsPosition.php index cc0b4f9..324974b 100644 --- a/src/Model/OptionsPosition.php +++ b/src/Model/OptionsPosition.php @@ -43,17 +43,17 @@ class OptionsPosition implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OptionsPosition'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'user' => 'int', 'contract' => 'string', @@ -67,10 +67,10 @@ class OptionsPosition implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'user' => null, 'contract' => null, @@ -472,7 +472,7 @@ public function setCloseOrder($close_order) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -484,9 +484,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -497,7 +498,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -513,7 +514,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OptionsPositionClose.php b/src/Model/OptionsPositionClose.php index 7e1d174..17b8610 100644 --- a/src/Model/OptionsPositionClose.php +++ b/src/Model/OptionsPositionClose.php @@ -42,17 +42,17 @@ class OptionsPositionClose implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OptionsPositionClose'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'time' => 'double', 'contract' => 'string', @@ -63,10 +63,10 @@ class OptionsPositionClose implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'time' => 'double', 'contract' => null, @@ -413,7 +413,7 @@ public function setSettleSize($settle_size) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -425,9 +425,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -438,7 +439,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -454,7 +455,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OptionsSettlement.php b/src/Model/OptionsSettlement.php index 5862251..76e2a2a 100644 --- a/src/Model/OptionsSettlement.php +++ b/src/Model/OptionsSettlement.php @@ -42,17 +42,17 @@ class OptionsSettlement implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OptionsSettlement'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'time' => 'double', 'contract' => 'string', @@ -63,10 +63,10 @@ class OptionsSettlement implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'time' => 'double', 'contract' => null, @@ -381,7 +381,7 @@ public function setSettlePrice($settle_price) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -393,9 +393,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -406,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -422,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OptionsTicker.php b/src/Model/OptionsTicker.php index 6fefd9b..4a113d7 100644 --- a/src/Model/OptionsTicker.php +++ b/src/Model/OptionsTicker.php @@ -43,17 +43,17 @@ class OptionsTicker implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OptionsTicker'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'last_price' => 'string', @@ -76,10 +76,10 @@ class OptionsTicker implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'name' => null, 'last_price' => null, @@ -742,7 +742,7 @@ public function setRho($rho) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -754,9 +754,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -767,7 +768,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -783,7 +784,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OptionsUnderlying.php b/src/Model/OptionsUnderlying.php index 9f0c995..d55eeca 100644 --- a/src/Model/OptionsUnderlying.php +++ b/src/Model/OptionsUnderlying.php @@ -42,27 +42,27 @@ class OptionsUnderlying implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OptionsUnderlying'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'index_price' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'name' => null, 'index_price' => null @@ -261,7 +261,7 @@ public function setIndexPrice($index_price) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -273,9 +273,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -286,7 +287,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,7 +303,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OptionsUnderlyingTicker.php b/src/Model/OptionsUnderlyingTicker.php index ed03f59..9bce887 100644 --- a/src/Model/OptionsUnderlyingTicker.php +++ b/src/Model/OptionsUnderlyingTicker.php @@ -43,17 +43,17 @@ class OptionsUnderlyingTicker implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OptionsUnderlyingTicker'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'trade_put' => 'int', 'trade_call' => 'int', @@ -61,10 +61,10 @@ class OptionsUnderlyingTicker implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'trade_put' => 'int64', 'trade_call' => 'int64', @@ -292,7 +292,7 @@ public function setIndexPrice($index_price) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -304,9 +304,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -317,7 +318,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -333,7 +334,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/Order.php b/src/Model/Order.php index df082fc..9f2f5bb 100644 --- a/src/Model/Order.php +++ b/src/Model/Order.php @@ -43,17 +43,17 @@ class Order implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Order'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'text' => 'string', @@ -85,10 +85,10 @@ class Order implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => null, 'text' => null, @@ -1190,7 +1190,7 @@ public function setRebatedFeeCurrency($rebated_fee_currency) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1202,9 +1202,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -1215,7 +1216,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1231,7 +1232,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/OrderBook.php b/src/Model/OrderBook.php index af990fe..c0bf3f6 100644 --- a/src/Model/OrderBook.php +++ b/src/Model/OrderBook.php @@ -42,17 +42,17 @@ class OrderBook implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OrderBook'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'current' => 'int', @@ -62,10 +62,10 @@ class OrderBook implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'current' => 'int64', @@ -357,7 +357,7 @@ public function setBids($bids) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -369,9 +369,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -382,7 +383,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -398,7 +399,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/Position.php b/src/Model/Position.php index e2455a2..664faa8 100644 --- a/src/Model/Position.php +++ b/src/Model/Position.php @@ -43,17 +43,17 @@ class Position implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Position'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'user' => 'int', 'contract' => 'string', @@ -81,10 +81,10 @@ class Position implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'user' => 'int64', 'contract' => null, @@ -926,7 +926,7 @@ public function setCrossLeverageLimit($cross_leverage_limit) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -938,9 +938,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -951,7 +952,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -967,7 +968,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/PositionClose.php b/src/Model/PositionClose.php index 02f2024..313cee2 100644 --- a/src/Model/PositionClose.php +++ b/src/Model/PositionClose.php @@ -42,17 +42,17 @@ class PositionClose implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'PositionClose'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'time' => 'double', 'contract' => 'string', @@ -62,10 +62,10 @@ class PositionClose implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'time' => 'double', 'contract' => null, @@ -383,7 +383,7 @@ public function setText($text) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -395,9 +395,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -408,7 +409,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -424,7 +425,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/PositionCloseOrder.php b/src/Model/PositionCloseOrder.php index 861368c..833bb0b 100644 --- a/src/Model/PositionCloseOrder.php +++ b/src/Model/PositionCloseOrder.php @@ -43,17 +43,17 @@ class PositionCloseOrder implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Position_close_order'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'price' => 'string', @@ -61,10 +61,10 @@ class PositionCloseOrder implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'price' => null, @@ -292,7 +292,7 @@ public function setIsLiq($is_liq) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -304,9 +304,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -317,7 +318,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -333,7 +334,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/RepayRequest.php b/src/Model/RepayRequest.php index 576a6c6..a76018f 100644 --- a/src/Model/RepayRequest.php +++ b/src/Model/RepayRequest.php @@ -42,17 +42,17 @@ class RepayRequest implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'RepayRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency_pair' => 'string', 'currency' => 'string', @@ -61,10 +61,10 @@ class RepayRequest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency_pair' => null, 'currency' => null, @@ -362,7 +362,7 @@ public function setAmount($amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -374,9 +374,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -387,7 +388,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -403,7 +404,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/Repayment.php b/src/Model/Repayment.php index cd2f12a..55f3eb9 100644 --- a/src/Model/Repayment.php +++ b/src/Model/Repayment.php @@ -42,17 +42,17 @@ class Repayment implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Repayment'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'create_time' => 'string', @@ -61,10 +61,10 @@ class Repayment implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => null, 'create_time' => null, @@ -321,7 +321,7 @@ public function setInterest($interest) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -333,9 +333,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -346,7 +347,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -362,7 +363,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/SpotAccount.php b/src/Model/SpotAccount.php index 630f206..c7d0970 100644 --- a/src/Model/SpotAccount.php +++ b/src/Model/SpotAccount.php @@ -42,17 +42,17 @@ class SpotAccount implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SpotAccount'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'available' => 'string', @@ -60,10 +60,10 @@ class SpotAccount implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'available' => null, @@ -291,7 +291,7 @@ public function setLocked($locked) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -303,9 +303,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -316,7 +317,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,7 +333,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/SpotPricePutOrder.php b/src/Model/SpotPricePutOrder.php index f1f82b8..d627b69 100644 --- a/src/Model/SpotPricePutOrder.php +++ b/src/Model/SpotPricePutOrder.php @@ -42,17 +42,17 @@ class SpotPricePutOrder implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SpotPricePutOrder'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'side' => 'string', @@ -63,10 +63,10 @@ class SpotPricePutOrder implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'type' => null, 'side' => null, @@ -489,7 +489,7 @@ public function setTimeInForce($time_in_force) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -501,9 +501,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -514,7 +515,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -530,7 +531,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/SpotPriceTrigger.php b/src/Model/SpotPriceTrigger.php index 56290be..dec17a9 100644 --- a/src/Model/SpotPriceTrigger.php +++ b/src/Model/SpotPriceTrigger.php @@ -42,17 +42,17 @@ class SpotPriceTrigger implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SpotPriceTrigger'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'price' => 'string', 'rule' => 'string', @@ -60,10 +60,10 @@ class SpotPriceTrigger implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'price' => null, 'rule' => null, @@ -332,7 +332,7 @@ public function setExpiration($expiration) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -344,9 +344,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -357,7 +358,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -373,7 +374,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/SpotPriceTriggeredOrder.php b/src/Model/SpotPriceTriggeredOrder.php index 6e79f8e..8642694 100644 --- a/src/Model/SpotPriceTriggeredOrder.php +++ b/src/Model/SpotPriceTriggeredOrder.php @@ -43,17 +43,17 @@ class SpotPriceTriggeredOrder implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SpotPriceTriggeredOrder'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'trigger' => '\GateApi\Model\SpotPriceTrigger', 'put' => '\GateApi\Model\SpotPricePutOrder', @@ -68,10 +68,10 @@ class SpotPriceTriggeredOrder implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'trigger' => null, 'put' => null, @@ -511,7 +511,7 @@ public function setReason($reason) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -523,9 +523,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -536,7 +537,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -552,7 +553,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/SubAccountBalance.php b/src/Model/SubAccountBalance.php index e955bdb..3c57757 100644 --- a/src/Model/SubAccountBalance.php +++ b/src/Model/SubAccountBalance.php @@ -42,27 +42,27 @@ class SubAccountBalance implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubAccountBalance'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'uid' => 'string', 'available' => 'map[string,string]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'uid' => null, 'available' => null @@ -261,7 +261,7 @@ public function setAvailable($available) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -273,9 +273,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -286,7 +287,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,7 +303,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/SubAccountTransfer.php b/src/Model/SubAccountTransfer.php index 97c90bb..883fdcd 100644 --- a/src/Model/SubAccountTransfer.php +++ b/src/Model/SubAccountTransfer.php @@ -42,17 +42,17 @@ class SubAccountTransfer implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SubAccountTransfer'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'sub_account' => 'string', @@ -65,10 +65,10 @@ class SubAccountTransfer implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'sub_account' => null, @@ -517,7 +517,7 @@ public function setSubAccountType($sub_account_type) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -529,9 +529,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -542,7 +543,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -558,7 +559,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/Ticker.php b/src/Model/Ticker.php index 0568867..c169edd 100644 --- a/src/Model/Ticker.php +++ b/src/Model/Ticker.php @@ -42,17 +42,17 @@ class Ticker implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Ticker'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency_pair' => 'string', 'last' => 'string', @@ -70,10 +70,10 @@ class Ticker implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency_pair' => null, 'last' => null, @@ -334,7 +334,7 @@ public function getLowestAsk() /** * Sets lowest_ask * - * @param string|null $lowest_ask Lowest ask + * @param string|null $lowest_ask Recent lowest ask * * @return $this */ @@ -358,7 +358,7 @@ public function getHighestBid() /** * Sets highest_bid * - * @param string|null $highest_bid Highest bid + * @param string|null $highest_bid Recent highest bid * * @return $this */ @@ -382,7 +382,7 @@ public function getChangePercentage() /** * Sets change_percentage * - * @param string|null $change_percentage Change percentage. + * @param string|null $change_percentage Change percentage in the last 24h * * @return $this */ @@ -406,7 +406,7 @@ public function getBaseVolume() /** * Sets base_volume * - * @param string|null $base_volume Base currency trade volume + * @param string|null $base_volume Base currency trade volume in the last 24h * * @return $this */ @@ -430,7 +430,7 @@ public function getQuoteVolume() /** * Sets quote_volume * - * @param string|null $quote_volume Quote currency trade volume + * @param string|null $quote_volume Quote currency trade volume in the last 24h * * @return $this */ @@ -591,7 +591,7 @@ public function setEtfLeverage($etf_leverage) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -603,9 +603,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -616,7 +617,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -632,7 +633,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/TotalBalance.php b/src/Model/TotalBalance.php index fa823eb..edd256b 100644 --- a/src/Model/TotalBalance.php +++ b/src/Model/TotalBalance.php @@ -43,27 +43,27 @@ class TotalBalance implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TotalBalance'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'total' => '\GateApi\Model\AccountBalance', 'details' => 'map[string,\GateApi\Model\AccountBalance]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'total' => null, 'details' => null @@ -262,7 +262,7 @@ public function setDetails($details) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -274,9 +274,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -287,7 +288,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -303,7 +304,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/Trade.php b/src/Model/Trade.php index 9cf682e..a76af44 100644 --- a/src/Model/Trade.php +++ b/src/Model/Trade.php @@ -42,17 +42,17 @@ class Trade implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Trade'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'create_time' => 'string', @@ -70,10 +70,10 @@ class Trade implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => null, 'create_time' => null, @@ -655,7 +655,7 @@ public function setGtFee($gt_fee) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -667,9 +667,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -680,7 +681,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -696,7 +697,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/TradeFee.php b/src/Model/TradeFee.php index 0f9b43e..1b77501 100644 --- a/src/Model/TradeFee.php +++ b/src/Model/TradeFee.php @@ -42,17 +42,17 @@ class TradeFee implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TradeFee'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'user_id' => 'int', 'taker_fee' => 'string', @@ -67,10 +67,10 @@ class TradeFee implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'user_id' => 'int64', 'taker_fee' => null, @@ -501,7 +501,7 @@ public function setFuturesMakerFee($futures_maker_fee) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -513,9 +513,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -526,7 +527,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -542,7 +543,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/Transfer.php b/src/Model/Transfer.php index 81552df..ea49317 100644 --- a/src/Model/Transfer.php +++ b/src/Model/Transfer.php @@ -43,17 +43,17 @@ class Transfer implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Transfer'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'from' => 'string', @@ -64,10 +64,10 @@ class Transfer implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'from' => null, @@ -457,7 +457,7 @@ public function getSettle() /** * Sets settle * - * @param string|null $settle Futures settle currency. Required if `currency` is `POINT` + * @param string|null $settle Futures settle currency. Required if transferring from or to futures account * * @return $this */ @@ -474,7 +474,7 @@ public function setSettle($settle) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -486,9 +486,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -499,7 +500,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -515,7 +516,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/TriggerOrderResponse.php b/src/Model/TriggerOrderResponse.php index 3241d7c..1734271 100644 --- a/src/Model/TriggerOrderResponse.php +++ b/src/Model/TriggerOrderResponse.php @@ -42,26 +42,26 @@ class TriggerOrderResponse implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'TriggerOrderResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64' ]; @@ -231,7 +231,7 @@ public function setId($id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -243,9 +243,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -256,7 +257,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -272,7 +273,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/Model/WithdrawStatus.php b/src/Model/WithdrawStatus.php index 840016e..c108caf 100644 --- a/src/Model/WithdrawStatus.php +++ b/src/Model/WithdrawStatus.php @@ -42,17 +42,17 @@ class WithdrawStatus implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'WithdrawStatus'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'name' => 'string', @@ -68,10 +68,10 @@ class WithdrawStatus implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'currency' => null, 'name' => null, @@ -531,7 +531,7 @@ public function setWithdrawFixOnChains($withdraw_fix_on_chains) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -543,9 +543,10 @@ public function offsetExists($offset) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** @@ -556,7 +557,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -572,7 +573,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } diff --git a/src/ObjectSerializer.php b/src/ObjectSerializer.php index 1b7288c..92de72d 100644 --- a/src/ObjectSerializer.php +++ b/src/ObjectSerializer.php @@ -39,8 +39,8 @@ class ObjectSerializer { /** - * @var string -*/ + * @var string + */ private static $dateTimeFormat = \DateTime::ATOM; /** @@ -214,7 +214,7 @@ public static function toString($value) * * @param array $collection collection to serialize to a string * @param string $style the format use for serialization (csv, - * ssv, tsv, pipes, multi) + * ssv, tsv, pipes, multi) * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array * * @return string From 3c74b94691198891278c3de71a1e553123dc15b8 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Mon, 25 Apr 2022 16:20:56 +0800 Subject: [PATCH 12/17] support futures order amendment; spot candles suport 30d --- README.md | 6 +- composer.json | 2 +- composer.lock | 42 ++-- docs/Api/FuturesApi.md | 65 ++++++ docs/Api/SpotApi.md | 8 +- docs/Model/FuturesOrderAmendment.md | 10 + src/Api/FuturesApi.php | 274 +++++++++++++++++++++++ src/Api/SpotApi.php | 20 +- src/Configuration.php | 6 +- src/Model/FuturesOrderAmendment.php | 335 ++++++++++++++++++++++++++++ 10 files changed, 727 insertions(+), 41 deletions(-) create mode 100644 docs/Model/FuturesOrderAmendment.md create mode 100644 src/Model/FuturesOrderAmendment.php diff --git a/README.md b/README.md index 07b7bcb..7ca5dae 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.23.3 -- Package version: 5.23.3 +- API version: 4.23.4 +- Package version: 5.23.4 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) @@ -150,6 +150,7 @@ Class | Method | HTTP request | Description *FuturesApi* | [**createFuturesOrder**](docs/Api/FuturesApi.md#createfuturesorder) | **POST** /futures/{settle}/orders | Create a futures order *FuturesApi* | [**cancelFuturesOrders**](docs/Api/FuturesApi.md#cancelfuturesorders) | **DELETE** /futures/{settle}/orders | Cancel all `open` orders matched *FuturesApi* | [**getFuturesOrder**](docs/Api/FuturesApi.md#getfuturesorder) | **GET** /futures/{settle}/orders/{order_id} | Get a single order +*FuturesApi* | [**amendFuturesOrder**](docs/Api/FuturesApi.md#amendfuturesorder) | **PUT** /futures/{settle}/orders/{order_id} | Amend an order *FuturesApi* | [**cancelFuturesOrder**](docs/Api/FuturesApi.md#cancelfuturesorder) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel a single order *FuturesApi* | [**getMyTrades**](docs/Api/FuturesApi.md#getmytrades) | **GET** /futures/{settle}/my_trades | List personal trading history *FuturesApi* | [**listPositionClose**](docs/Api/FuturesApi.md#listpositionclose) | **GET** /futures/{settle}/position_close | List position close history @@ -286,6 +287,7 @@ Class | Method | HTTP request | Description - [FuturesInitialOrder](docs/Model/FuturesInitialOrder.md) - [FuturesLiquidate](docs/Model/FuturesLiquidate.md) - [FuturesOrder](docs/Model/FuturesOrder.md) + - [FuturesOrderAmendment](docs/Model/FuturesOrderAmendment.md) - [FuturesOrderBook](docs/Model/FuturesOrderBook.md) - [FuturesOrderBookItem](docs/Model/FuturesOrderBookItem.md) - [FuturesPriceTrigger](docs/Model/FuturesPriceTrigger.md) diff --git a/composer.json b/composer.json index 52ad846..b50b6de 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.23.3", + "version": "5.23.4", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index 2312daf..6aaf03e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d10d7d7b79acda81d067906db9e68034", + "content-hash": "e19611095adad4dbc5d95c998b8b4bd0", "packages": [ { "name": "guzzlehttp/guzzle", @@ -3010,16 +3010,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { @@ -3057,7 +3057,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" }, "funding": [ { @@ -3073,7 +3073,7 @@ "type": "tidelift" } ], - "time": "2021-07-12T14:48:14+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/event-dispatcher", @@ -3162,16 +3162,16 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a" + "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", - "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", + "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", "shasum": "" }, "require": { @@ -3221,7 +3221,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.1" }, "funding": [ { @@ -3237,7 +3237,7 @@ "type": "tidelift" } ], - "time": "2021-07-12T14:48:14+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/filesystem", @@ -3975,22 +3975,22 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", "shasum": "" }, "require": { "php": ">=7.2.5", "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1" + "symfony/deprecation-contracts": "^2.1|^3" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -4038,7 +4038,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.1" }, "funding": [ { @@ -4054,7 +4054,7 @@ "type": "tidelift" } ], - "time": "2021-11-04T16:48:04+00:00" + "time": "2022-03-13T20:07:29+00:00" }, { "name": "symfony/stopwatch", @@ -4325,5 +4325,5 @@ "ext-mbstring": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/docs/Api/FuturesApi.md b/docs/Api/FuturesApi.md index 430a910..3f1cf8c 100644 --- a/docs/Api/FuturesApi.md +++ b/docs/Api/FuturesApi.md @@ -30,6 +30,7 @@ Method | HTTP request | Description [**createFuturesOrder**](FuturesApi.md#createFuturesOrder) | **POST** /futures/{settle}/orders | Create a futures order [**cancelFuturesOrders**](FuturesApi.md#cancelFuturesOrders) | **DELETE** /futures/{settle}/orders | Cancel all `open` orders matched [**getFuturesOrder**](FuturesApi.md#getFuturesOrder) | **GET** /futures/{settle}/orders/{order_id} | Get a single order +[**amendFuturesOrder**](FuturesApi.md#amendFuturesOrder) | **PUT** /futures/{settle}/orders/{order_id} | Amend an order [**cancelFuturesOrder**](FuturesApi.md#cancelFuturesOrder) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel a single order [**getMyTrades**](FuturesApi.md#getMyTrades) | **GET** /futures/{settle}/my_trades | List personal trading history [**listPositionClose**](FuturesApi.md#listPositionClose) | **GET** /futures/{settle}/position_close | List position close history @@ -1715,6 +1716,70 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## amendFuturesOrder + +> \GateApi\Model\FuturesOrder amendFuturesOrder($settle, $order_id, $futures_order_amendment) + +Amend an order + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\FuturesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$settle = 'usdt'; // string | Settle currency +$order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +$futures_order_amendment = new \GateApi\Model\FuturesOrderAmendment(); // \GateApi\Model\FuturesOrderAmendment | + +try { + $result = $apiInstance->amendFuturesOrder($settle, $order_id, $futures_order_amendment); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FuturesApi->amendFuturesOrder: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **string**| Settle currency | + **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | + **futures_order_amendment** | [**\GateApi\Model\FuturesOrderAmendment**](../Model/FuturesOrderAmendment.md)| | + +### Return type + +[**\GateApi\Model\FuturesOrder**](../Model/FuturesOrder.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## cancelFuturesOrder > \GateApi\Model\FuturesOrder cancelFuturesOrder($settle, $order_id) diff --git a/docs/Api/SpotApi.md b/docs/Api/SpotApi.md index fe48abc..e81efef 100644 --- a/docs/Api/SpotApi.md +++ b/docs/Api/SpotApi.md @@ -397,7 +397,7 @@ $apiInstance = new GateApi\Api\SpotApi( $associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['last_id'] = '12345'; // string | Specify list staring point using the `id` of last record in previous list-query results -$associate_array['reverse'] = false; // bool | Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. +$associate_array['reverse'] = false; // bool | Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. $associate_array['from'] = 1627706330; // int | Start timestamp of the query $associate_array['to'] = 1635329650; // int | Time range ending, default to current time $associate_array['page'] = 1; // int | Page number @@ -423,7 +423,7 @@ Name | Type | Description | Notes **currency_pair** | **string**| Currency pair | **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **last_id** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] - **reverse** | **bool**| Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. | [optional] [default to false] + **reverse** | **bool**| Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. | [optional] [default to false] **from** | **int**| Start timestamp of the query | [optional] **to** | **int**| Time range ending, default to current time | [optional] **page** | **int**| Page number | [optional] [default to 1] @@ -470,7 +470,7 @@ $associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair $associate_array['limit'] = 100; // int | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. $associate_array['from'] = 1546905600; // int | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified $associate_array['to'] = 1546935600; // int | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time -$associate_array['interval'] = '30m'; // string | Interval time between data points +$associate_array['interval'] = '30m'; // string | Interval time between data points. Note that `30d` means 1 natual month, not 30 days try { $result = $apiInstance->listCandlesticks($associate_array); @@ -494,7 +494,7 @@ Name | Type | Description | Notes **limit** | **int**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] **from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] **to** | **int**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] - **interval** | **string**| Interval time between data points | [optional] [default to '30m'] + **interval** | **string**| Interval time between data points. Note that `30d` means 1 natual month, not 30 days | [optional] [default to '30m'] ### Return type diff --git a/docs/Model/FuturesOrderAmendment.md b/docs/Model/FuturesOrderAmendment.md new file mode 100644 index 0000000..9a92e22 --- /dev/null +++ b/docs/Model/FuturesOrderAmendment.md @@ -0,0 +1,10 @@ +# # FuturesOrderAmendment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**size** | **int** | New order size, including filled part. - If new size is less than or equal to filled size, the order will be cancelled. - Order side must be identical to the original one. - Close order size cannot be changed. - For reduce only orders, increasing size may leads to other reduce only orders being cancelled. - If price is not changed, decreasing size will not change its precedence in order book, while increasing will move it to the last at current price. | [optional] +**price** | **string** | New order price. New price cannot take any orders | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/FuturesApi.php b/src/Api/FuturesApi.php index c342ad3..44aa256 100644 --- a/src/Api/FuturesApi.php +++ b/src/Api/FuturesApi.php @@ -7679,6 +7679,280 @@ protected function getFuturesOrderRequest($settle, $order_id) ); } + /** + * Operation amendFuturesOrder + * + * Amend an order + * + * @param string $settle Settle currency (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param \GateApi\Model\FuturesOrderAmendment $futures_order_amendment futures_order_amendment (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FuturesOrder + */ + public function amendFuturesOrder($settle, $order_id, $futures_order_amendment) + { + list($response) = $this->amendFuturesOrderWithHttpInfo($settle, $order_id, $futures_order_amendment); + return $response; + } + + /** + * Operation amendFuturesOrderWithHttpInfo + * + * Amend an order + * + * @param string $settle Settle currency (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param \GateApi\Model\FuturesOrderAmendment $futures_order_amendment (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FuturesOrder, HTTP status code, HTTP response headers (array of strings) + */ + public function amendFuturesOrderWithHttpInfo($settle, $order_id, $futures_order_amendment) + { + $request = $this->amendFuturesOrderRequest($settle, $order_id, $futures_order_amendment); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FuturesOrder'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation amendFuturesOrderAsync + * + * Amend an order + * + * @param string $settle Settle currency (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param \GateApi\Model\FuturesOrderAmendment $futures_order_amendment (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function amendFuturesOrderAsync($settle, $order_id, $futures_order_amendment) + { + return $this->amendFuturesOrderAsyncWithHttpInfo($settle, $order_id, $futures_order_amendment) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation amendFuturesOrderAsyncWithHttpInfo + * + * Amend an order + * + * @param string $settle Settle currency (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param \GateApi\Model\FuturesOrderAmendment $futures_order_amendment (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function amendFuturesOrderAsyncWithHttpInfo($settle, $order_id, $futures_order_amendment) + { + $returnType = '\GateApi\Model\FuturesOrder'; + $request = $this->amendFuturesOrderRequest($settle, $order_id, $futures_order_amendment); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'amendFuturesOrder' + * + * @param string $settle Settle currency (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param \GateApi\Model\FuturesOrderAmendment $futures_order_amendment (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function amendFuturesOrderRequest($settle, $order_id, $futures_order_amendment) + { + // verify the required parameter 'settle' is set + if ($settle === null || (is_array($settle) && count($settle) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $settle when calling amendFuturesOrder' + ); + } + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling amendFuturesOrder' + ); + } + // verify the required parameter 'futures_order_amendment' is set + if ($futures_order_amendment === null || (is_array($futures_order_amendment) && count($futures_order_amendment) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $futures_order_amendment when calling amendFuturesOrder' + ); + } + + $resourcePath = '/futures/{settle}/orders/{order_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($settle !== null) { + $resourcePath = str_replace( + '{' . 'settle' . '}', + ObjectSerializer::toPathValue($settle), + $resourcePath + ); + } + + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'order_id' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($futures_order_amendment)) { + $_tempBody = $futures_order_amendment; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('PUT', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation cancelFuturesOrder * diff --git a/src/Api/SpotApi.php b/src/Api/SpotApi.php index ccddbca..107fa91 100644 --- a/src/Api/SpotApi.php +++ b/src/Api/SpotApi.php @@ -1579,7 +1579,7 @@ protected function listOrderBookRequest($associative_array) * @param string $currency_pair Currency pair (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param bool $reverse Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) @@ -1604,7 +1604,7 @@ public function listTrades($associative_array) * @param string $currency_pair Currency pair (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param bool $reverse Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) @@ -1666,7 +1666,7 @@ public function listTradesWithHttpInfo($associative_array) * @param string $currency_pair Currency pair (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param bool $reverse Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) @@ -1694,7 +1694,7 @@ function ($response) { * @param string $currency_pair Currency pair (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param bool $reverse Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) @@ -1749,7 +1749,7 @@ function ($exception) { * @param string $currency_pair Currency pair (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param bool $reverse Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) + * @param bool $reverse Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param int $page Page number (optional, default to 1) @@ -1952,7 +1952,7 @@ protected function listTradesRequest($associative_array) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param string $interval Interval time between data points (optional, default to '30m') + * @param string $interval Interval time between data points. Note that `30d` means 1 natual month, not 30 days (optional, default to '30m') * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1975,7 +1975,7 @@ public function listCandlesticks($associative_array) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param string $interval Interval time between data points (optional, default to '30m') + * @param string $interval Interval time between data points. Note that `30d` means 1 natual month, not 30 days (optional, default to '30m') * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2035,7 +2035,7 @@ public function listCandlesticksWithHttpInfo($associative_array) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param string $interval Interval time between data points (optional, default to '30m') + * @param string $interval Interval time between data points. Note that `30d` means 1 natual month, not 30 days (optional, default to '30m') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2061,7 +2061,7 @@ function ($response) { * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param string $interval Interval time between data points (optional, default to '30m') + * @param string $interval Interval time between data points. Note that `30d` means 1 natual month, not 30 days (optional, default to '30m') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2114,7 +2114,7 @@ function ($exception) { * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) - * @param string $interval Interval time between data points (optional, default to '30m') + * @param string $interval Interval time between data points. Note that `30d` means 1 natual month, not 30 days (optional, default to '30m') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/src/Configuration.php b/src/Configuration.php index b3623e2..e30dffd 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.23.3/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.23.4/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.23.3' . PHP_EOL; - $report .= ' SDK Package Version: 5.23.3' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.23.4' . PHP_EOL; + $report .= ' SDK Package Version: 5.23.4' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/FuturesOrderAmendment.php b/src/Model/FuturesOrderAmendment.php new file mode 100644 index 0000000..7f57e26 --- /dev/null +++ b/src/Model/FuturesOrderAmendment.php @@ -0,0 +1,335 @@ + 'int', + 'price' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'size' => 'int64', + 'price' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'size' => 'size', + 'price' => 'price' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'size' => 'setSize', + 'price' => 'setPrice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'size' => 'getSize', + 'price' => 'getPrice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['size'] = isset($data['size']) ? $data['size'] : null; + $this->container['price'] = isset($data['price']) ? $data['price'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets size + * + * @return int|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int|null $size New order size, including filled part. - If new size is less than or equal to filled size, the order will be cancelled. - Order side must be identical to the original one. - Close order size cannot be changed. - For reduce only orders, increasing size may leads to other reduce only orders being cancelled. - If price is not changed, decreasing size will not change its precedence in order book, while increasing will move it to the last at current price. + * + * @return $this + */ + public function setSize($size) + { + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets price + * + * @return string|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param string|null $price New order price. New price cannot take any orders + * + * @return $this + */ + public function setPrice($price) + { + $this->container['price'] = $price; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + From 4620d5ed33648b03537723d20649f27712beff64 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Fri, 27 May 2022 17:27:53 +0800 Subject: [PATCH 13/17] flash swap api; missing fields in futures auto order; wallet sub account balances --- README.md | 20 +- composer.json | 2 +- composer.lock | 130 +- docs/Api/FlashSwapApi.md | 318 +++++ docs/Api/FuturesApi.md | 59 + docs/Api/WalletApi.md | 128 ++ docs/Model/FlashSwapCurrency.md | 12 + docs/Model/FlashSwapOrder.md | 17 + docs/Model/FlashSwapOrderPreview.md | 14 + docs/Model/FlashSwapOrderRequest.md | 13 + docs/Model/FuturesIndexConstituents.md | 10 + docs/Model/FuturesInitialOrder.md | 1 + docs/Model/FuturesPriceTriggeredOrder.md | 4 +- docs/Model/IndexConstituent.md | 10 + docs/Model/LedgerRecord.md | 2 +- docs/Model/SubAccountFuturesBalance.md | 10 + docs/Model/SubAccountMarginBalance.md | 10 + src/Api/FlashSwapApi.php | 1405 ++++++++++++++++++++++ src/Api/FuturesApi.php | 257 ++++ src/Api/WalletApi.php | 518 ++++++++ src/Configuration.php | 6 +- src/Model/CrossMarginLoan.php | 2 +- src/Model/FlashSwapCurrency.php | 396 ++++++ src/Model/FlashSwapOrder.php | 546 +++++++++ src/Model/FlashSwapOrderPreview.php | 456 +++++++ src/Model/FlashSwapOrderRequest.php | 432 +++++++ src/Model/FuturesIndexConstituents.php | 335 ++++++ src/Model/FuturesInitialOrder.php | 30 + src/Model/FuturesPriceTrigger.php | 4 +- src/Model/FuturesPriceTriggeredOrder.php | 76 +- src/Model/IndexConstituent.php | 335 ++++++ src/Model/LedgerRecord.php | 6 +- src/Model/SubAccountFuturesBalance.php | 335 ++++++ src/Model/SubAccountMarginBalance.php | 335 ++++++ 34 files changed, 6173 insertions(+), 61 deletions(-) create mode 100644 docs/Api/FlashSwapApi.md create mode 100644 docs/Model/FlashSwapCurrency.md create mode 100644 docs/Model/FlashSwapOrder.md create mode 100644 docs/Model/FlashSwapOrderPreview.md create mode 100644 docs/Model/FlashSwapOrderRequest.md create mode 100644 docs/Model/FuturesIndexConstituents.md create mode 100644 docs/Model/IndexConstituent.md create mode 100644 docs/Model/SubAccountFuturesBalance.md create mode 100644 docs/Model/SubAccountMarginBalance.md create mode 100644 src/Api/FlashSwapApi.php create mode 100644 src/Model/FlashSwapCurrency.php create mode 100644 src/Model/FlashSwapOrder.php create mode 100644 src/Model/FlashSwapOrderPreview.php create mode 100644 src/Model/FlashSwapOrderRequest.php create mode 100644 src/Model/FuturesIndexConstituents.php create mode 100644 src/Model/IndexConstituent.php create mode 100644 src/Model/SubAccountFuturesBalance.php create mode 100644 src/Model/SubAccountMarginBalance.php diff --git a/README.md b/README.md index 7ca5dae..411881c 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.23.4 -- Package version: 5.23.4 +- API version: 4.24.0 +- Package version: 5.24.0 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) @@ -124,6 +124,11 @@ Class | Method | HTTP request | Description *DeliveryApi* | [**cancelPriceTriggeredDeliveryOrderList**](docs/Api/DeliveryApi.md#cancelpricetriggereddeliveryorderlist) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders *DeliveryApi* | [**getPriceTriggeredDeliveryOrder**](docs/Api/DeliveryApi.md#getpricetriggereddeliveryorder) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a single order *DeliveryApi* | [**cancelPriceTriggeredDeliveryOrder**](docs/Api/DeliveryApi.md#cancelpricetriggereddeliveryorder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel a single order +*FlashSwapApi* | [**listFlashSwapCurrencies**](docs/Api/FlashSwapApi.md#listflashswapcurrencies) | **GET** /flash_swap/currencies | List all supported currencies in flash swap +*FlashSwapApi* | [**listFlashSwapOrders**](docs/Api/FlashSwapApi.md#listflashswaporders) | **GET** /flash_swap/orders | List all flash swap orders +*FlashSwapApi* | [**createFlashSwapOrder**](docs/Api/FlashSwapApi.md#createflashswaporder) | **POST** /flash_swap/orders | Create a flash swap order +*FlashSwapApi* | [**getFlashSwapOrder**](docs/Api/FlashSwapApi.md#getflashswaporder) | **GET** /flash_swap/orders/{order_id} | Get a single flash swap order's detail +*FlashSwapApi* | [**previewFlashSwapOrder**](docs/Api/FlashSwapApi.md#previewflashswaporder) | **POST** /flash_swap/orders/preview | Initiate a flash swap order preview *FuturesApi* | [**listFuturesContracts**](docs/Api/FuturesApi.md#listfuturescontracts) | **GET** /futures/{settle}/contracts | List all futures contracts *FuturesApi* | [**getFuturesContract**](docs/Api/FuturesApi.md#getfuturescontract) | **GET** /futures/{settle}/contracts/{contract} | Get a single contract *FuturesApi* | [**listFuturesOrderBook**](docs/Api/FuturesApi.md#listfuturesorderbook) | **GET** /futures/{settle}/order_book | Futures order book @@ -133,6 +138,7 @@ Class | Method | HTTP request | Description *FuturesApi* | [**listFuturesFundingRateHistory**](docs/Api/FuturesApi.md#listfuturesfundingratehistory) | **GET** /futures/{settle}/funding_rate | Funding rate history *FuturesApi* | [**listFuturesInsuranceLedger**](docs/Api/FuturesApi.md#listfuturesinsuranceledger) | **GET** /futures/{settle}/insurance | Futures insurance balance history *FuturesApi* | [**listContractStats**](docs/Api/FuturesApi.md#listcontractstats) | **GET** /futures/{settle}/contract_stats | Futures stats +*FuturesApi* | [**getIndexConstituents**](docs/Api/FuturesApi.md#getindexconstituents) | **GET** /futures/{settle}/index_constituents/{index} | Get index constituents *FuturesApi* | [**listLiquidatedOrders**](docs/Api/FuturesApi.md#listliquidatedorders) | **GET** /futures/{settle}/liq_orders | Retrieve liquidation history *FuturesApi* | [**listFuturesAccounts**](docs/Api/FuturesApi.md#listfuturesaccounts) | **GET** /futures/{settle}/accounts | Query futures account *FuturesApi* | [**listFuturesAccountBook**](docs/Api/FuturesApi.md#listfuturesaccountbook) | **GET** /futures/{settle}/account_book | Query account book @@ -248,6 +254,8 @@ Class | Method | HTTP request | Description *WalletApi* | [**transferWithSubAccount**](docs/Api/WalletApi.md#transferwithsubaccount) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts *WalletApi* | [**listWithdrawStatus**](docs/Api/WalletApi.md#listwithdrawstatus) | **GET** /wallet/withdraw_status | Retrieve withdrawal status *WalletApi* | [**listSubAccountBalances**](docs/Api/WalletApi.md#listsubaccountbalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances +*WalletApi* | [**listSubAccountMarginBalances**](docs/Api/WalletApi.md#listsubaccountmarginbalances) | **GET** /wallet/sub_account_margin_balances | Query sub accounts' margin balances +*WalletApi* | [**listSubAccountFuturesBalances**](docs/Api/WalletApi.md#listsubaccountfuturesbalances) | **GET** /wallet/sub_account_futures_balances | Query sub accounts' futures account balances *WalletApi* | [**getTradeFee**](docs/Api/WalletApi.md#gettradefee) | **GET** /wallet/fee | Retrieve personal trading fee *WalletApi* | [**getTotalBalance**](docs/Api/WalletApi.md#gettotalbalance) | **GET** /wallet/total_balance | Retrieve user's total balances *WithdrawalApi* | [**withdraw**](docs/Api/WithdrawalApi.md#withdraw) | **POST** /withdrawals | Withdraw @@ -278,12 +286,17 @@ Class | Method | HTTP request | Description - [DeliveryContract](docs/Model/DeliveryContract.md) - [DeliverySettlement](docs/Model/DeliverySettlement.md) - [DepositAddress](docs/Model/DepositAddress.md) + - [FlashSwapCurrency](docs/Model/FlashSwapCurrency.md) + - [FlashSwapOrder](docs/Model/FlashSwapOrder.md) + - [FlashSwapOrderPreview](docs/Model/FlashSwapOrderPreview.md) + - [FlashSwapOrderRequest](docs/Model/FlashSwapOrderRequest.md) - [FundingAccount](docs/Model/FundingAccount.md) - [FundingBookItem](docs/Model/FundingBookItem.md) - [FundingRateRecord](docs/Model/FundingRateRecord.md) - [FuturesAccount](docs/Model/FuturesAccount.md) - [FuturesAccountBook](docs/Model/FuturesAccountBook.md) - [FuturesCandlestick](docs/Model/FuturesCandlestick.md) + - [FuturesIndexConstituents](docs/Model/FuturesIndexConstituents.md) - [FuturesInitialOrder](docs/Model/FuturesInitialOrder.md) - [FuturesLiquidate](docs/Model/FuturesLiquidate.md) - [FuturesOrder](docs/Model/FuturesOrder.md) @@ -294,6 +307,7 @@ Class | Method | HTTP request | Description - [FuturesPriceTriggeredOrder](docs/Model/FuturesPriceTriggeredOrder.md) - [FuturesTicker](docs/Model/FuturesTicker.md) - [FuturesTrade](docs/Model/FuturesTrade.md) + - [IndexConstituent](docs/Model/IndexConstituent.md) - [InsuranceRecord](docs/Model/InsuranceRecord.md) - [LedgerRecord](docs/Model/LedgerRecord.md) - [Loan](docs/Model/Loan.md) @@ -331,6 +345,8 @@ Class | Method | HTTP request | Description - [SpotPriceTrigger](docs/Model/SpotPriceTrigger.md) - [SpotPriceTriggeredOrder](docs/Model/SpotPriceTriggeredOrder.md) - [SubAccountBalance](docs/Model/SubAccountBalance.md) + - [SubAccountFuturesBalance](docs/Model/SubAccountFuturesBalance.md) + - [SubAccountMarginBalance](docs/Model/SubAccountMarginBalance.md) - [SubAccountTransfer](docs/Model/SubAccountTransfer.md) - [Ticker](docs/Model/Ticker.md) - [TotalBalance](docs/Model/TotalBalance.md) diff --git a/composer.json b/composer.json index b50b6de..6ca8557 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.23.4", + "version": "5.24.0", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index 6aaf03e..625df1f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e19611095adad4dbc5d95c998b8b4bd0", + "content-hash": "d96c459c7f61c508a861f241bd2c4b13", "packages": [ { "name": "guzzlehttp/guzzle", - "version": "6.5.5", + "version": "6.5.6", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" + "reference": "f092dd734083473658de3ee4bef093ed77d2689c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", - "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f092dd734083473658de3ee4bef093ed77d2689c", + "reference": "f092dd734083473658de3ee4bef093ed77d2689c", "shasum": "" }, "require": { @@ -54,10 +54,40 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle is a PHP HTTP client library", @@ -73,9 +103,23 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/6.5" + "source": "https://github.com/guzzle/guzzle/tree/6.5.6" }, - "time": "2020-06-16T21:01:06+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2022-05-25T13:19:12+00:00" }, { "name": "guzzlehttp/promises", @@ -2911,16 +2955,16 @@ }, { "name": "symfony/console", - "version": "v5.4.7", + "version": "v5.4.9", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6" + "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/900275254f0a1a2afff1ab0e11abd5587a10e1d6", - "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6", + "url": "https://api.github.com/repos/symfony/console/zipball/829d5d1bf60b2efeb0887b7436873becc71a45eb", + "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb", "shasum": "" }, "require": { @@ -2990,7 +3034,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.7" + "source": "https://github.com/symfony/console/tree/v5.4.9" }, "funding": [ { @@ -3006,7 +3050,7 @@ "type": "tidelift" } ], - "time": "2022-03-31T17:09:19+00:00" + "time": "2022-05-18T06:17:34+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3077,16 +3121,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.4.3", + "version": "v5.4.9", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d" + "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/dec8a9f58d20df252b9cd89f1c6c1530f747685d", - "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", + "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", "shasum": "" }, "require": { @@ -3142,7 +3186,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.3" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.9" }, "funding": [ { @@ -3158,7 +3202,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-05-05T16:45:39+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -3241,16 +3285,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.7", + "version": "v5.4.9", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f" + "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3a4442138d80c9f7b600fb297534ac718b61d37f", - "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/36a017fa4cce1eff1b8e8129ff53513abcef05ba", + "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba", "shasum": "" }, "require": { @@ -3285,7 +3329,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.7" + "source": "https://github.com/symfony/filesystem/tree/v5.4.9" }, "funding": [ { @@ -3301,20 +3345,20 @@ "type": "tidelift" } ], - "time": "2022-04-01T12:33:59+00:00" + "time": "2022-05-20T13:55:35+00:00" }, { "name": "symfony/finder", - "version": "v5.4.3", + "version": "v5.4.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d" + "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/231313534dded84c7ecaa79d14bc5da4ccb69b7d", - "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d", + "url": "https://api.github.com/repos/symfony/finder/zipball/9b630f3427f3ebe7cd346c277a1408b00249dad9", + "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9", "shasum": "" }, "require": { @@ -3348,7 +3392,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.3" + "source": "https://github.com/symfony/finder/tree/v5.4.8" }, "funding": [ { @@ -3364,7 +3408,7 @@ "type": "tidelift" } ], - "time": "2022-01-26T16:34:36+00:00" + "time": "2022-04-15T08:07:45+00:00" }, { "name": "symfony/options-resolver", @@ -3913,16 +3957,16 @@ }, { "name": "symfony/process", - "version": "v5.4.7", + "version": "v5.4.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "38a44b2517b470a436e1c944bf9b9ba3961137fb" + "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/38a44b2517b470a436e1c944bf9b9ba3961137fb", - "reference": "38a44b2517b470a436e1c944bf9b9ba3961137fb", + "url": "https://api.github.com/repos/symfony/process/zipball/597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", + "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", "shasum": "" }, "require": { @@ -3955,7 +3999,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.7" + "source": "https://github.com/symfony/process/tree/v5.4.8" }, "funding": [ { @@ -3971,7 +4015,7 @@ "type": "tidelift" } ], - "time": "2022-03-18T16:18:52+00:00" + "time": "2022-04-08T05:07:18+00:00" }, { "name": "symfony/service-contracts", @@ -4120,16 +4164,16 @@ }, { "name": "symfony/string", - "version": "v5.4.3", + "version": "v5.4.9", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10" + "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10", - "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10", + "url": "https://api.github.com/repos/symfony/string/zipball/985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", + "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", "shasum": "" }, "require": { @@ -4186,7 +4230,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.3" + "source": "https://github.com/symfony/string/tree/v5.4.9" }, "funding": [ { @@ -4202,7 +4246,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-04-19T10:40:37+00:00" }, { "name": "theseer/tokenizer", diff --git a/docs/Api/FlashSwapApi.md b/docs/Api/FlashSwapApi.md new file mode 100644 index 0000000..72598c6 --- /dev/null +++ b/docs/Api/FlashSwapApi.md @@ -0,0 +1,318 @@ +# GateApi\FlashSwapApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**listFlashSwapCurrencies**](FlashSwapApi.md#listFlashSwapCurrencies) | **GET** /flash_swap/currencies | List all supported currencies in flash swap +[**listFlashSwapOrders**](FlashSwapApi.md#listFlashSwapOrders) | **GET** /flash_swap/orders | List all flash swap orders +[**createFlashSwapOrder**](FlashSwapApi.md#createFlashSwapOrder) | **POST** /flash_swap/orders | Create a flash swap order +[**getFlashSwapOrder**](FlashSwapApi.md#getFlashSwapOrder) | **GET** /flash_swap/orders/{order_id} | Get a single flash swap order's detail +[**previewFlashSwapOrder**](FlashSwapApi.md#previewFlashSwapOrder) | **POST** /flash_swap/orders/preview | Initiate a flash swap order preview + + +## listFlashSwapCurrencies + +> \GateApi\Model\FlashSwapCurrency[] listFlashSwapCurrencies() + +List all supported currencies in flash swap + +### Example + +```php +listFlashSwapCurrencies(); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FlashSwapApi->listFlashSwapCurrencies: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\GateApi\Model\FlashSwapCurrency[]**](../Model/FlashSwapCurrency.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listFlashSwapOrders + +> \GateApi\Model\FlashSwapOrder[] listFlashSwapOrders($status, $sell_currency, $buy_currency, $reverse, $limit, $page) + +List all flash swap orders + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\FlashSwapApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['status'] = 1; // int | Flash swap order status `1` - success `2` - failure +$associate_array['sell_currency'] = 'BTC'; // string | Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` +$associate_array['buy_currency'] = 'BTC'; // string | Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` +$associate_array['reverse'] = true; // bool | If results are sorted by id in reverse order. Default to `true` - `true`: sort by id in descending order(recent first) - `false`: sort by id in ascending order(oldest first) +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['page'] = 1; // int | Page number + +try { + $result = $apiInstance->listFlashSwapOrders($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FlashSwapApi->listFlashSwapOrders: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **int**| Flash swap order status `1` - success `2` - failure | [optional] + **sell_currency** | **string**| Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` | [optional] + **buy_currency** | **string**| Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` | [optional] + **reverse** | **bool**| If results are sorted by id in reverse order. Default to `true` - `true`: sort by id in descending order(recent first) - `false`: sort by id in ascending order(oldest first) | [optional] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **page** | **int**| Page number | [optional] [default to 1] + +### Return type + +[**\GateApi\Model\FlashSwapOrder[]**](../Model/FlashSwapOrder.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## createFlashSwapOrder + +> \GateApi\Model\FlashSwapOrder createFlashSwapOrder($flash_swap_order_request) + +Create a flash swap order + +Initiate a flash swap preview in advance because order creation requires a preview result + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\FlashSwapApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$flash_swap_order_request = new \GateApi\Model\FlashSwapOrderRequest(); // \GateApi\Model\FlashSwapOrderRequest | + +try { + $result = $apiInstance->createFlashSwapOrder($flash_swap_order_request); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FlashSwapApi->createFlashSwapOrder: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flash_swap_order_request** | [**\GateApi\Model\FlashSwapOrderRequest**](../Model/FlashSwapOrderRequest.md)| | + +### Return type + +[**\GateApi\Model\FlashSwapOrder**](../Model/FlashSwapOrder.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## getFlashSwapOrder + +> \GateApi\Model\FlashSwapOrder getFlashSwapOrder($order_id) + +Get a single flash swap order's detail + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\FlashSwapApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$order_id = 1; // int | Flash swap order ID + +try { + $result = $apiInstance->getFlashSwapOrder($order_id); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FlashSwapApi->getFlashSwapOrder: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Flash swap order ID | + +### Return type + +[**\GateApi\Model\FlashSwapOrder**](../Model/FlashSwapOrder.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## previewFlashSwapOrder + +> \GateApi\Model\FlashSwapOrderPreview previewFlashSwapOrder($flash_swap_order_request) + +Initiate a flash swap order preview + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\FlashSwapApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$flash_swap_order_request = new \GateApi\Model\FlashSwapOrderRequest(); // \GateApi\Model\FlashSwapOrderRequest | + +try { + $result = $apiInstance->previewFlashSwapOrder($flash_swap_order_request); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FlashSwapApi->previewFlashSwapOrder: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flash_swap_order_request** | [**\GateApi\Model\FlashSwapOrderRequest**](../Model/FlashSwapOrderRequest.md)| | + +### Return type + +[**\GateApi\Model\FlashSwapOrderPreview**](../Model/FlashSwapOrderPreview.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Api/FuturesApi.md b/docs/Api/FuturesApi.md index 3f1cf8c..dc182d1 100644 --- a/docs/Api/FuturesApi.md +++ b/docs/Api/FuturesApi.md @@ -13,6 +13,7 @@ Method | HTTP request | Description [**listFuturesFundingRateHistory**](FuturesApi.md#listFuturesFundingRateHistory) | **GET** /futures/{settle}/funding_rate | Funding rate history [**listFuturesInsuranceLedger**](FuturesApi.md#listFuturesInsuranceLedger) | **GET** /futures/{settle}/insurance | Futures insurance balance history [**listContractStats**](FuturesApi.md#listContractStats) | **GET** /futures/{settle}/contract_stats | Futures stats +[**getIndexConstituents**](FuturesApi.md#getIndexConstituents) | **GET** /futures/{settle}/index_constituents/{index} | Get index constituents [**listLiquidatedOrders**](FuturesApi.md#listLiquidatedOrders) | **GET** /futures/{settle}/liq_orders | Retrieve liquidation history [**listFuturesAccounts**](FuturesApi.md#listFuturesAccounts) | **GET** /futures/{settle}/accounts | Query futures account [**listFuturesAccountBook**](FuturesApi.md#listFuturesAccountBook) | **GET** /futures/{settle}/account_book | Query account book @@ -610,6 +611,64 @@ No authorization required [[Back to README]](../../README.md) +## getIndexConstituents + +> \GateApi\Model\FuturesIndexConstituents getIndexConstituents($settle, $index) + +Get index constituents + +### Example + +```php +getIndexConstituents($settle, $index); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FuturesApi->getIndexConstituents: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **string**| Settle currency | + **index** | **string**| Index name | + +### Return type + +[**\GateApi\Model\FuturesIndexConstituents**](../Model/FuturesIndexConstituents.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listLiquidatedOrders > \GateApi\Model\FuturesLiquidate[] listLiquidatedOrders($settle, $contract, $from, $to, $limit) diff --git a/docs/Api/WalletApi.md b/docs/Api/WalletApi.md index 7c15881..7270b14 100644 --- a/docs/Api/WalletApi.md +++ b/docs/Api/WalletApi.md @@ -13,6 +13,8 @@ Method | HTTP request | Description [**transferWithSubAccount**](WalletApi.md#transferWithSubAccount) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts [**listWithdrawStatus**](WalletApi.md#listWithdrawStatus) | **GET** /wallet/withdraw_status | Retrieve withdrawal status [**listSubAccountBalances**](WalletApi.md#listSubAccountBalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances +[**listSubAccountMarginBalances**](WalletApi.md#listSubAccountMarginBalances) | **GET** /wallet/sub_account_margin_balances | Query sub accounts' margin balances +[**listSubAccountFuturesBalances**](WalletApi.md#listSubAccountFuturesBalances) | **GET** /wallet/sub_account_futures_balances | Query sub accounts' futures account balances [**getTradeFee**](WalletApi.md#getTradeFee) | **GET** /wallet/fee | Retrieve personal trading fee [**getTotalBalance**](WalletApi.md#getTotalBalance) | **GET** /wallet/total_balance | Retrieve user's total balances @@ -595,6 +597,132 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## listSubAccountMarginBalances + +> \GateApi\Model\SubAccountMarginBalance[] listSubAccountMarginBalances($sub_uid) + +Query sub accounts' margin balances + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\WalletApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['sub_uid'] = '10003'; // string | Sub account user ID. Return records related to all sub accounts if not specified + +try { + $result = $apiInstance->listSubAccountMarginBalances($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling WalletApi->listSubAccountMarginBalances: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sub_uid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] + +### Return type + +[**\GateApi\Model\SubAccountMarginBalance[]**](../Model/SubAccountMarginBalance.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listSubAccountFuturesBalances + +> \GateApi\Model\SubAccountFuturesBalance[] listSubAccountFuturesBalances($sub_uid, $settle) + +Query sub accounts' futures account balances + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\WalletApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['sub_uid'] = '10003'; // string | Sub account user ID. Return records related to all sub accounts if not specified +$associate_array['settle'] = 'usdt'; // string | Query only balances of specified settle currency + +try { + $result = $apiInstance->listSubAccountFuturesBalances($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling WalletApi->listSubAccountFuturesBalances: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sub_uid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] + **settle** | **string**| Query only balances of specified settle currency | [optional] + +### Return type + +[**\GateApi\Model\SubAccountFuturesBalance[]**](../Model/SubAccountFuturesBalance.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## getTradeFee > \GateApi\Model\TradeFee getTradeFee($currency_pair) diff --git a/docs/Model/FlashSwapCurrency.md b/docs/Model/FlashSwapCurrency.md new file mode 100644 index 0000000..84ae8ca --- /dev/null +++ b/docs/Model/FlashSwapCurrency.md @@ -0,0 +1,12 @@ +# # FlashSwapCurrency + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **string** | Currency name | [optional] [readonly] +**min_amount** | **string** | Minimum amount required in flash swap | [optional] [readonly] +**max_amount** | **string** | Maximum amount allowed in flash swap | [optional] [readonly] +**swappable** | **string[]** | Currencies which can be swapped to from this currency | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FlashSwapOrder.md b/docs/Model/FlashSwapOrder.md new file mode 100644 index 0000000..73cfba6 --- /dev/null +++ b/docs/Model/FlashSwapOrder.md @@ -0,0 +1,17 @@ +# # FlashSwapOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Flash swap order ID | [optional] [readonly] +**create_time** | **int** | Creation time of order (in milliseconds) | [optional] [readonly] +**user_id** | **int** | User ID | [optional] [readonly] +**sell_currency** | **string** | Currency to sell | [optional] [readonly] +**sell_amount** | **string** | Amount to sell | [optional] [readonly] +**buy_currency** | **string** | Currency to buy | [optional] [readonly] +**buy_amount** | **string** | Amount to buy | [optional] [readonly] +**price** | **string** | Price | [optional] [readonly] +**status** | **int** | Flash swap order status `1` - success `2` - failure | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FlashSwapOrderPreview.md b/docs/Model/FlashSwapOrderPreview.md new file mode 100644 index 0000000..c9df7f3 --- /dev/null +++ b/docs/Model/FlashSwapOrderPreview.md @@ -0,0 +1,14 @@ +# # FlashSwapOrderPreview + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**preview_id** | **string** | Preview result ID | [optional] +**sell_currency** | **string** | Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` | [optional] +**sell_amount** | **string** | Amount to sell | [optional] +**buy_currency** | **string** | Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` | [optional] +**buy_amount** | **string** | Amount to buy | [optional] +**price** | **string** | Price | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FlashSwapOrderRequest.md b/docs/Model/FlashSwapOrderRequest.md new file mode 100644 index 0000000..8a3b872 --- /dev/null +++ b/docs/Model/FlashSwapOrderRequest.md @@ -0,0 +1,13 @@ +# # FlashSwapOrderRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**preview_id** | **string** | Preview result ID | [optional] +**sell_currency** | **string** | Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` | +**sell_amount** | **string** | Amount to sell. It is required to choose one parameter between `sell_amount` and `buy_amount` | [optional] +**buy_currency** | **string** | Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` | +**buy_amount** | **string** | Amount to buy. It is required to choose one parameter between `sell_amount` and `buy_amount` | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesIndexConstituents.md b/docs/Model/FuturesIndexConstituents.md new file mode 100644 index 0000000..50a07b6 --- /dev/null +++ b/docs/Model/FuturesIndexConstituents.md @@ -0,0 +1,10 @@ +# # FuturesIndexConstituents + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index** | **string** | Index name | [optional] [readonly] +**constituents** | [**\GateApi\Model\IndexConstituent[]**](IndexConstituent.md) | Constituents | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesInitialOrder.md b/docs/Model/FuturesInitialOrder.md index bf2afb5..e7dc0aa 100644 --- a/docs/Model/FuturesInitialOrder.md +++ b/docs/Model/FuturesInitialOrder.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **tif** | **string** | Time in force. If using market price, only `ioc` is supported. - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled | [optional] [default to 'gtc'] **text** | **string** | How the order is created. Possible values are: web, api and app | [optional] **reduce_only** | **bool** | Set to true to create a reduce-only order | [optional] [default to false] +**auto_size** | **string** | Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 | [optional] **is_reduce_only** | **bool** | Is the order reduce-only | [optional] [readonly] **is_close** | **bool** | Is the order to close position | [optional] [readonly] diff --git a/docs/Model/FuturesPriceTriggeredOrder.md b/docs/Model/FuturesPriceTriggeredOrder.md index f274023..c5f9bb3 100644 --- a/docs/Model/FuturesPriceTriggeredOrder.md +++ b/docs/Model/FuturesPriceTriggeredOrder.md @@ -11,8 +11,10 @@ Name | Type | Description | Notes **create_time** | **double** | Creation time | [optional] [readonly] **finish_time** | **double** | Finished time | [optional] [readonly] **trade_id** | **int** | ID of the newly created order on condition triggered | [optional] [readonly] -**status** | **string** | Order status. | [optional] [readonly] +**status** | **string** | Auto order status - `open`: order is active - `finished`: order is finished - `inactive`: order is not active, only for close-long-order or close-short-order - `invalid`: order is invalid, only for close-long-order or close-short-order | [optional] [readonly] **finish_as** | **string** | How order is finished | [optional] [readonly] **reason** | **string** | Additional remarks on how the order was finished | [optional] [readonly] +**order_type** | **string** | Take-profit/stop-loss types, which include: - `close-long-order`: order take-profit/stop-loss, close long position - `close-short-order`: order take-profit/stop-loss, close short position - `close-long-position`: position take-profit/stop-loss, close long position - `close-short-position`: position take-profit/stop-loss, close short position - `plan-close-long-position`: position planned take-profit/stop-loss, close long position - `plan-close-short-position`: position planned take-profit/stop-loss, close short position The order take-profit/stop-loss can not be passed by request. These two types are read only. | [optional] +**me_order_id** | **string** | Corresponding order ID of order take-profit/stop-loss. | [optional] [readonly] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IndexConstituent.md b/docs/Model/IndexConstituent.md new file mode 100644 index 0000000..67be342 --- /dev/null +++ b/docs/Model/IndexConstituent.md @@ -0,0 +1,10 @@ +# # IndexConstituent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exchange** | **string** | Exchange | [optional] +**symbols** | **string[]** | Symbol list | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LedgerRecord.md b/docs/Model/LedgerRecord.md index 56a538b..e662336 100644 --- a/docs/Model/LedgerRecord.md +++ b/docs/Model/LedgerRecord.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **currency** | **string** | Currency name | **address** | **string** | Withdrawal address. Required for withdrawals | [optional] **memo** | **string** | Additional remarks with regards to the withdrawal | [optional] -**status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending | [optional] [readonly] +**status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending - DMOVE: required manual approval - SPLITPEND: the order is automatically split due to large amount | [optional] [readonly] **chain** | **string** | Name of the chain used in withdrawals | [optional] **fee** | **string** | Fee | [optional] diff --git a/docs/Model/SubAccountFuturesBalance.md b/docs/Model/SubAccountFuturesBalance.md new file mode 100644 index 0000000..87a5299 --- /dev/null +++ b/docs/Model/SubAccountFuturesBalance.md @@ -0,0 +1,10 @@ +# # SubAccountFuturesBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uid** | **string** | User ID | [optional] +**available** | [**map[string,\GateApi\Model\FuturesAccount]**](FuturesAccount.md) | Futures account balances | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubAccountMarginBalance.md b/docs/Model/SubAccountMarginBalance.md new file mode 100644 index 0000000..7454b32 --- /dev/null +++ b/docs/Model/SubAccountMarginBalance.md @@ -0,0 +1,10 @@ +# # SubAccountMarginBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uid** | **string** | User ID | [optional] +**available** | [**\GateApi\Model\MarginAccount[]**](MarginAccount.md) | Margin account balances | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/FlashSwapApi.php b/src/Api/FlashSwapApi.php new file mode 100644 index 0000000..ad2e3f9 --- /dev/null +++ b/src/Api/FlashSwapApi.php @@ -0,0 +1,1405 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $host_index; + } + + /** + * Set the host index + * + * @param int Host index (required) + */ + public function setHostIndex($host_index) + { + $this->hostIndex = $host_index; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listFlashSwapCurrencies + * + * List all supported currencies in flash swap + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FlashSwapCurrency[] + */ + public function listFlashSwapCurrencies() + { + list($response) = $this->listFlashSwapCurrenciesWithHttpInfo(); + return $response; + } + + /** + * Operation listFlashSwapCurrenciesWithHttpInfo + * + * List all supported currencies in flash swap + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FlashSwapCurrency[], HTTP status code, HTTP response headers (array of strings) + */ + public function listFlashSwapCurrenciesWithHttpInfo() + { + $request = $this->listFlashSwapCurrenciesRequest(); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FlashSwapCurrency[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listFlashSwapCurrenciesAsync + * + * List all supported currencies in flash swap + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFlashSwapCurrenciesAsync() + { + return $this->listFlashSwapCurrenciesAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listFlashSwapCurrenciesAsyncWithHttpInfo + * + * List all supported currencies in flash swap + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFlashSwapCurrenciesAsyncWithHttpInfo() + { + $returnType = '\GateApi\Model\FlashSwapCurrency[]'; + $request = $this->listFlashSwapCurrenciesRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listFlashSwapCurrencies' + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listFlashSwapCurrenciesRequest() + { + + $resourcePath = '/flash_swap/currencies'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listFlashSwapOrders + * + * List all flash swap orders + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int $status Flash swap order status `1` - success `2` - failure (optional) + * @param string $sell_currency Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional) + * @param string $buy_currency Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional) + * @param bool $reverse If results are sorted by id in reverse order. Default to `true` - `true`: sort by id in descending order(recent first) - `false`: sort by id in ascending order(oldest first) (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $page Page number (optional, default to 1) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FlashSwapOrder[] + */ + public function listFlashSwapOrders($associative_array) + { + list($response) = $this->listFlashSwapOrdersWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listFlashSwapOrdersWithHttpInfo + * + * List all flash swap orders + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int $status Flash swap order status `1` - success `2` - failure (optional) + * @param string $sell_currency Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional) + * @param string $buy_currency Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional) + * @param bool $reverse If results are sorted by id in reverse order. Default to `true` - `true`: sort by id in descending order(recent first) - `false`: sort by id in ascending order(oldest first) (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $page Page number (optional, default to 1) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FlashSwapOrder[], HTTP status code, HTTP response headers (array of strings) + */ + public function listFlashSwapOrdersWithHttpInfo($associative_array) + { + $request = $this->listFlashSwapOrdersRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FlashSwapOrder[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listFlashSwapOrdersAsync + * + * List all flash swap orders + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int $status Flash swap order status `1` - success `2` - failure (optional) + * @param string $sell_currency Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional) + * @param string $buy_currency Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional) + * @param bool $reverse If results are sorted by id in reverse order. Default to `true` - `true`: sort by id in descending order(recent first) - `false`: sort by id in ascending order(oldest first) (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $page Page number (optional, default to 1) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFlashSwapOrdersAsync($associative_array) + { + return $this->listFlashSwapOrdersAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listFlashSwapOrdersAsyncWithHttpInfo + * + * List all flash swap orders + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int $status Flash swap order status `1` - success `2` - failure (optional) + * @param string $sell_currency Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional) + * @param string $buy_currency Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional) + * @param bool $reverse If results are sorted by id in reverse order. Default to `true` - `true`: sort by id in descending order(recent first) - `false`: sort by id in ascending order(oldest first) (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $page Page number (optional, default to 1) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFlashSwapOrdersAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\FlashSwapOrder[]'; + $request = $this->listFlashSwapOrdersRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listFlashSwapOrders' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int $status Flash swap order status `1` - success `2` - failure (optional) + * @param string $sell_currency Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional) + * @param string $buy_currency Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional) + * @param bool $reverse If results are sorted by id in reverse order. Default to `true` - `true`: sort by id in descending order(recent first) - `false`: sort by id in ascending order(oldest first) (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $page Page number (optional, default to 1) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listFlashSwapOrdersRequest($associative_array) + { + // unbox the parameters from the associative array + $status = array_key_exists('status', $associative_array) ? $associative_array['status'] : null; + $sell_currency = array_key_exists('sell_currency', $associative_array) ? $associative_array['sell_currency'] : null; + $buy_currency = array_key_exists('buy_currency', $associative_array) ? $associative_array['buy_currency'] : null; + $reverse = array_key_exists('reverse', $associative_array) ? $associative_array['reverse'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $page = array_key_exists('page', $associative_array) ? $associative_array['page'] : 1; + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FlashSwapApi.listFlashSwapOrders, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FlashSwapApi.listFlashSwapOrders, must be bigger than or equal to 1.'); + } + + if ($page !== null && $page < 1) { + throw new \InvalidArgumentException('invalid value for "$page" when calling FlashSwapApi.listFlashSwapOrders, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/flash_swap/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($status !== null) { + if('form' === 'form' && is_array($status)) { + foreach($status as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['status'] = $status; + } + } + + // query params + if ($sell_currency !== null) { + if('form' === 'form' && is_array($sell_currency)) { + foreach($sell_currency as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['sell_currency'] = $sell_currency; + } + } + + // query params + if ($buy_currency !== null) { + if('form' === 'form' && is_array($buy_currency)) { + foreach($buy_currency as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['buy_currency'] = $buy_currency; + } + } + + // query params + if ($reverse !== null) { + if('form' === 'form' && is_array($reverse)) { + foreach($reverse as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['reverse'] = $reverse; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($page !== null) { + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createFlashSwapOrder + * + * Create a flash swap order + * + * @param \GateApi\Model\FlashSwapOrderRequest $flash_swap_order_request flash_swap_order_request (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FlashSwapOrder + */ + public function createFlashSwapOrder($flash_swap_order_request) + { + list($response) = $this->createFlashSwapOrderWithHttpInfo($flash_swap_order_request); + return $response; + } + + /** + * Operation createFlashSwapOrderWithHttpInfo + * + * Create a flash swap order + * + * @param \GateApi\Model\FlashSwapOrderRequest $flash_swap_order_request (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FlashSwapOrder, HTTP status code, HTTP response headers (array of strings) + */ + public function createFlashSwapOrderWithHttpInfo($flash_swap_order_request) + { + $request = $this->createFlashSwapOrderRequest($flash_swap_order_request); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FlashSwapOrder'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation createFlashSwapOrderAsync + * + * Create a flash swap order + * + * @param \GateApi\Model\FlashSwapOrderRequest $flash_swap_order_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createFlashSwapOrderAsync($flash_swap_order_request) + { + return $this->createFlashSwapOrderAsyncWithHttpInfo($flash_swap_order_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createFlashSwapOrderAsyncWithHttpInfo + * + * Create a flash swap order + * + * @param \GateApi\Model\FlashSwapOrderRequest $flash_swap_order_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createFlashSwapOrderAsyncWithHttpInfo($flash_swap_order_request) + { + $returnType = '\GateApi\Model\FlashSwapOrder'; + $request = $this->createFlashSwapOrderRequest($flash_swap_order_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createFlashSwapOrder' + * + * @param \GateApi\Model\FlashSwapOrderRequest $flash_swap_order_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createFlashSwapOrderRequest($flash_swap_order_request) + { + // verify the required parameter 'flash_swap_order_request' is set + if ($flash_swap_order_request === null || (is_array($flash_swap_order_request) && count($flash_swap_order_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $flash_swap_order_request when calling createFlashSwapOrder' + ); + } + + $resourcePath = '/flash_swap/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + if (isset($flash_swap_order_request)) { + $_tempBody = $flash_swap_order_request; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('POST', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFlashSwapOrder + * + * Get a single flash swap order's detail + * + * @param int $order_id Flash swap order ID (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FlashSwapOrder + */ + public function getFlashSwapOrder($order_id) + { + list($response) = $this->getFlashSwapOrderWithHttpInfo($order_id); + return $response; + } + + /** + * Operation getFlashSwapOrderWithHttpInfo + * + * Get a single flash swap order's detail + * + * @param int $order_id Flash swap order ID (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FlashSwapOrder, HTTP status code, HTTP response headers (array of strings) + */ + public function getFlashSwapOrderWithHttpInfo($order_id) + { + $request = $this->getFlashSwapOrderRequest($order_id); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FlashSwapOrder'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getFlashSwapOrderAsync + * + * Get a single flash swap order's detail + * + * @param int $order_id Flash swap order ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFlashSwapOrderAsync($order_id) + { + return $this->getFlashSwapOrderAsyncWithHttpInfo($order_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFlashSwapOrderAsyncWithHttpInfo + * + * Get a single flash swap order's detail + * + * @param int $order_id Flash swap order ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFlashSwapOrderAsyncWithHttpInfo($order_id) + { + $returnType = '\GateApi\Model\FlashSwapOrder'; + $request = $this->getFlashSwapOrderRequest($order_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFlashSwapOrder' + * + * @param int $order_id Flash swap order ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getFlashSwapOrderRequest($order_id) + { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getFlashSwapOrder' + ); + } + + $resourcePath = '/flash_swap/orders/{order_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'order_id' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation previewFlashSwapOrder + * + * Initiate a flash swap order preview + * + * @param \GateApi\Model\FlashSwapOrderRequest $flash_swap_order_request flash_swap_order_request (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FlashSwapOrderPreview + */ + public function previewFlashSwapOrder($flash_swap_order_request) + { + list($response) = $this->previewFlashSwapOrderWithHttpInfo($flash_swap_order_request); + return $response; + } + + /** + * Operation previewFlashSwapOrderWithHttpInfo + * + * Initiate a flash swap order preview + * + * @param \GateApi\Model\FlashSwapOrderRequest $flash_swap_order_request (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FlashSwapOrderPreview, HTTP status code, HTTP response headers (array of strings) + */ + public function previewFlashSwapOrderWithHttpInfo($flash_swap_order_request) + { + $request = $this->previewFlashSwapOrderRequest($flash_swap_order_request); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FlashSwapOrderPreview'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation previewFlashSwapOrderAsync + * + * Initiate a flash swap order preview + * + * @param \GateApi\Model\FlashSwapOrderRequest $flash_swap_order_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function previewFlashSwapOrderAsync($flash_swap_order_request) + { + return $this->previewFlashSwapOrderAsyncWithHttpInfo($flash_swap_order_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation previewFlashSwapOrderAsyncWithHttpInfo + * + * Initiate a flash swap order preview + * + * @param \GateApi\Model\FlashSwapOrderRequest $flash_swap_order_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function previewFlashSwapOrderAsyncWithHttpInfo($flash_swap_order_request) + { + $returnType = '\GateApi\Model\FlashSwapOrderPreview'; + $request = $this->previewFlashSwapOrderRequest($flash_swap_order_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'previewFlashSwapOrder' + * + * @param \GateApi\Model\FlashSwapOrderRequest $flash_swap_order_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function previewFlashSwapOrderRequest($flash_swap_order_request) + { + // verify the required parameter 'flash_swap_order_request' is set + if ($flash_swap_order_request === null || (is_array($flash_swap_order_request) && count($flash_swap_order_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $flash_swap_order_request when calling previewFlashSwapOrder' + ); + } + + $resourcePath = '/flash_swap/orders/preview'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + if (isset($flash_swap_order_request)) { + $_tempBody = $flash_swap_order_request; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('POST', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/FuturesApi.php b/src/Api/FuturesApi.php index 44aa256..e2fbd41 100644 --- a/src/Api/FuturesApi.php +++ b/src/Api/FuturesApi.php @@ -2822,6 +2822,263 @@ protected function listContractStatsRequest($associative_array) ); } + /** + * Operation getIndexConstituents + * + * Get index constituents + * + * @param string $settle Settle currency (required) + * @param string $index Index name (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FuturesIndexConstituents + */ + public function getIndexConstituents($settle, $index) + { + list($response) = $this->getIndexConstituentsWithHttpInfo($settle, $index); + return $response; + } + + /** + * Operation getIndexConstituentsWithHttpInfo + * + * Get index constituents + * + * @param string $settle Settle currency (required) + * @param string $index Index name (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FuturesIndexConstituents, HTTP status code, HTTP response headers (array of strings) + */ + public function getIndexConstituentsWithHttpInfo($settle, $index) + { + $request = $this->getIndexConstituentsRequest($settle, $index); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FuturesIndexConstituents'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getIndexConstituentsAsync + * + * Get index constituents + * + * @param string $settle Settle currency (required) + * @param string $index Index name (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIndexConstituentsAsync($settle, $index) + { + return $this->getIndexConstituentsAsyncWithHttpInfo($settle, $index) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getIndexConstituentsAsyncWithHttpInfo + * + * Get index constituents + * + * @param string $settle Settle currency (required) + * @param string $index Index name (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIndexConstituentsAsyncWithHttpInfo($settle, $index) + { + $returnType = '\GateApi\Model\FuturesIndexConstituents'; + $request = $this->getIndexConstituentsRequest($settle, $index); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getIndexConstituents' + * + * @param string $settle Settle currency (required) + * @param string $index Index name (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getIndexConstituentsRequest($settle, $index) + { + // verify the required parameter 'settle' is set + if ($settle === null || (is_array($settle) && count($settle) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $settle when calling getIndexConstituents' + ); + } + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getIndexConstituents' + ); + } + + $resourcePath = '/futures/{settle}/index_constituents/{index}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($settle !== null) { + $resourcePath = str_replace( + '{' . 'settle' . '}', + ObjectSerializer::toPathValue($settle), + $resourcePath + ); + } + + // path params + if ($index !== null) { + $resourcePath = str_replace( + '{' . 'index' . '}', + ObjectSerializer::toPathValue($index), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listLiquidatedOrders * diff --git a/src/Api/WalletApi.php b/src/Api/WalletApi.php index 0b2fb83..3c6a30d 100644 --- a/src/Api/WalletApi.php +++ b/src/Api/WalletApi.php @@ -2515,6 +2515,524 @@ protected function listSubAccountBalancesRequest($associative_array) ); } + /** + * Operation listSubAccountMarginBalances + * + * Query sub accounts' margin balances + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\SubAccountMarginBalance[] + */ + public function listSubAccountMarginBalances($associative_array) + { + list($response) = $this->listSubAccountMarginBalancesWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listSubAccountMarginBalancesWithHttpInfo + * + * Query sub accounts' margin balances + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\SubAccountMarginBalance[], HTTP status code, HTTP response headers (array of strings) + */ + public function listSubAccountMarginBalancesWithHttpInfo($associative_array) + { + $request = $this->listSubAccountMarginBalancesRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\SubAccountMarginBalance[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listSubAccountMarginBalancesAsync + * + * Query sub accounts' margin balances + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSubAccountMarginBalancesAsync($associative_array) + { + return $this->listSubAccountMarginBalancesAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listSubAccountMarginBalancesAsyncWithHttpInfo + * + * Query sub accounts' margin balances + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSubAccountMarginBalancesAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\SubAccountMarginBalance[]'; + $request = $this->listSubAccountMarginBalancesRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listSubAccountMarginBalances' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listSubAccountMarginBalancesRequest($associative_array) + { + // unbox the parameters from the associative array + $sub_uid = array_key_exists('sub_uid', $associative_array) ? $associative_array['sub_uid'] : null; + + + $resourcePath = '/wallet/sub_account_margin_balances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($sub_uid !== null) { + if('form' === 'form' && is_array($sub_uid)) { + foreach($sub_uid as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['sub_uid'] = $sub_uid; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listSubAccountFuturesBalances + * + * Query sub accounts' futures account balances + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $settle Query only balances of specified settle currency (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\SubAccountFuturesBalance[] + */ + public function listSubAccountFuturesBalances($associative_array) + { + list($response) = $this->listSubAccountFuturesBalancesWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listSubAccountFuturesBalancesWithHttpInfo + * + * Query sub accounts' futures account balances + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $settle Query only balances of specified settle currency (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\SubAccountFuturesBalance[], HTTP status code, HTTP response headers (array of strings) + */ + public function listSubAccountFuturesBalancesWithHttpInfo($associative_array) + { + $request = $this->listSubAccountFuturesBalancesRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\SubAccountFuturesBalance[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listSubAccountFuturesBalancesAsync + * + * Query sub accounts' futures account balances + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $settle Query only balances of specified settle currency (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSubAccountFuturesBalancesAsync($associative_array) + { + return $this->listSubAccountFuturesBalancesAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listSubAccountFuturesBalancesAsyncWithHttpInfo + * + * Query sub accounts' futures account balances + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $settle Query only balances of specified settle currency (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSubAccountFuturesBalancesAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\SubAccountFuturesBalance[]'; + $request = $this->listSubAccountFuturesBalancesRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listSubAccountFuturesBalances' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $settle Query only balances of specified settle currency (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listSubAccountFuturesBalancesRequest($associative_array) + { + // unbox the parameters from the associative array + $sub_uid = array_key_exists('sub_uid', $associative_array) ? $associative_array['sub_uid'] : null; + $settle = array_key_exists('settle', $associative_array) ? $associative_array['settle'] : null; + + + $resourcePath = '/wallet/sub_account_futures_balances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($sub_uid !== null) { + if('form' === 'form' && is_array($sub_uid)) { + foreach($sub_uid as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['sub_uid'] = $sub_uid; + } + } + + // query params + if ($settle !== null) { + if('form' === 'form' && is_array($settle)) { + foreach($settle as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['settle'] = $settle; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getTradeFee * diff --git a/src/Configuration.php b/src/Configuration.php index e30dffd..5f04f06 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.23.4/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.24.0/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.23.4' . PHP_EOL; - $report .= ' SDK Package Version: 5.23.4' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.24.0' . PHP_EOL; + $report .= ' SDK Package Version: 5.24.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/CrossMarginLoan.php b/src/Model/CrossMarginLoan.php index debb854..b81cc0e 100644 --- a/src/Model/CrossMarginLoan.php +++ b/src/Model/CrossMarginLoan.php @@ -78,7 +78,7 @@ class CrossMarginLoan implements ModelInterface, ArrayAccess 'currency' => null, 'amount' => null, 'text' => null, - 'status' => null, + 'status' => 'int32', 'repaid' => null, 'repaid_interest' => null, 'unpaid_interest' => null diff --git a/src/Model/FlashSwapCurrency.php b/src/Model/FlashSwapCurrency.php new file mode 100644 index 0000000..eab67ec --- /dev/null +++ b/src/Model/FlashSwapCurrency.php @@ -0,0 +1,396 @@ + 'string', + 'min_amount' => 'string', + 'max_amount' => 'string', + 'swappable' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'min_amount' => null, + 'max_amount' => null, + 'swappable' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'min_amount' => 'min_amount', + 'max_amount' => 'max_amount', + 'swappable' => 'swappable' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'min_amount' => 'setMinAmount', + 'max_amount' => 'setMaxAmount', + 'swappable' => 'setSwappable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'min_amount' => 'getMinAmount', + 'max_amount' => 'getMaxAmount', + 'swappable' => 'getSwappable' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['min_amount'] = isset($data['min_amount']) ? $data['min_amount'] : null; + $this->container['max_amount'] = isset($data['max_amount']) ? $data['max_amount'] : null; + $this->container['swappable'] = isset($data['swappable']) ? $data['swappable'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency Currency name + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets min_amount + * + * @return string|null + */ + public function getMinAmount() + { + return $this->container['min_amount']; + } + + /** + * Sets min_amount + * + * @param string|null $min_amount Minimum amount required in flash swap + * + * @return $this + */ + public function setMinAmount($min_amount) + { + $this->container['min_amount'] = $min_amount; + + return $this; + } + + /** + * Gets max_amount + * + * @return string|null + */ + public function getMaxAmount() + { + return $this->container['max_amount']; + } + + /** + * Sets max_amount + * + * @param string|null $max_amount Maximum amount allowed in flash swap + * + * @return $this + */ + public function setMaxAmount($max_amount) + { + $this->container['max_amount'] = $max_amount; + + return $this; + } + + /** + * Gets swappable + * + * @return string[]|null + */ + public function getSwappable() + { + return $this->container['swappable']; + } + + /** + * Sets swappable + * + * @param string[]|null $swappable Currencies which can be swapped to from this currency + * + * @return $this + */ + public function setSwappable($swappable) + { + $this->container['swappable'] = $swappable; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FlashSwapOrder.php b/src/Model/FlashSwapOrder.php new file mode 100644 index 0000000..9c292d4 --- /dev/null +++ b/src/Model/FlashSwapOrder.php @@ -0,0 +1,546 @@ + 'int', + 'create_time' => 'int', + 'user_id' => 'int', + 'sell_currency' => 'string', + 'sell_amount' => 'string', + 'buy_currency' => 'string', + 'buy_amount' => 'string', + 'price' => 'string', + 'status' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'create_time' => 'int64', + 'user_id' => 'int64', + 'sell_currency' => null, + 'sell_amount' => null, + 'buy_currency' => null, + 'buy_amount' => null, + 'price' => null, + 'status' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'create_time' => 'create_time', + 'user_id' => 'user_id', + 'sell_currency' => 'sell_currency', + 'sell_amount' => 'sell_amount', + 'buy_currency' => 'buy_currency', + 'buy_amount' => 'buy_amount', + 'price' => 'price', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'create_time' => 'setCreateTime', + 'user_id' => 'setUserId', + 'sell_currency' => 'setSellCurrency', + 'sell_amount' => 'setSellAmount', + 'buy_currency' => 'setBuyCurrency', + 'buy_amount' => 'setBuyAmount', + 'price' => 'setPrice', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'create_time' => 'getCreateTime', + 'user_id' => 'getUserId', + 'sell_currency' => 'getSellCurrency', + 'sell_amount' => 'getSellAmount', + 'buy_currency' => 'getBuyCurrency', + 'buy_amount' => 'getBuyAmount', + 'price' => 'getPrice', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['create_time'] = isset($data['create_time']) ? $data['create_time'] : null; + $this->container['user_id'] = isset($data['user_id']) ? $data['user_id'] : null; + $this->container['sell_currency'] = isset($data['sell_currency']) ? $data['sell_currency'] : null; + $this->container['sell_amount'] = isset($data['sell_amount']) ? $data['sell_amount'] : null; + $this->container['buy_currency'] = isset($data['buy_currency']) ? $data['buy_currency'] : null; + $this->container['buy_amount'] = isset($data['buy_amount']) ? $data['buy_amount'] : null; + $this->container['price'] = isset($data['price']) ? $data['price'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id Flash swap order ID + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets create_time + * + * @return int|null + */ + public function getCreateTime() + { + return $this->container['create_time']; + } + + /** + * Sets create_time + * + * @param int|null $create_time Creation time of order (in milliseconds) + * + * @return $this + */ + public function setCreateTime($create_time) + { + $this->container['create_time'] = $create_time; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id User ID + * + * @return $this + */ + public function setUserId($user_id) + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets sell_currency + * + * @return string|null + */ + public function getSellCurrency() + { + return $this->container['sell_currency']; + } + + /** + * Sets sell_currency + * + * @param string|null $sell_currency Currency to sell + * + * @return $this + */ + public function setSellCurrency($sell_currency) + { + $this->container['sell_currency'] = $sell_currency; + + return $this; + } + + /** + * Gets sell_amount + * + * @return string|null + */ + public function getSellAmount() + { + return $this->container['sell_amount']; + } + + /** + * Sets sell_amount + * + * @param string|null $sell_amount Amount to sell + * + * @return $this + */ + public function setSellAmount($sell_amount) + { + $this->container['sell_amount'] = $sell_amount; + + return $this; + } + + /** + * Gets buy_currency + * + * @return string|null + */ + public function getBuyCurrency() + { + return $this->container['buy_currency']; + } + + /** + * Sets buy_currency + * + * @param string|null $buy_currency Currency to buy + * + * @return $this + */ + public function setBuyCurrency($buy_currency) + { + $this->container['buy_currency'] = $buy_currency; + + return $this; + } + + /** + * Gets buy_amount + * + * @return string|null + */ + public function getBuyAmount() + { + return $this->container['buy_amount']; + } + + /** + * Sets buy_amount + * + * @param string|null $buy_amount Amount to buy + * + * @return $this + */ + public function setBuyAmount($buy_amount) + { + $this->container['buy_amount'] = $buy_amount; + + return $this; + } + + /** + * Gets price + * + * @return string|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param string|null $price Price + * + * @return $this + */ + public function setPrice($price) + { + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets status + * + * @return int|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int|null $status Flash swap order status `1` - success `2` - failure + * + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FlashSwapOrderPreview.php b/src/Model/FlashSwapOrderPreview.php new file mode 100644 index 0000000..eb27fbf --- /dev/null +++ b/src/Model/FlashSwapOrderPreview.php @@ -0,0 +1,456 @@ + 'string', + 'sell_currency' => 'string', + 'sell_amount' => 'string', + 'buy_currency' => 'string', + 'buy_amount' => 'string', + 'price' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'preview_id' => null, + 'sell_currency' => null, + 'sell_amount' => null, + 'buy_currency' => null, + 'buy_amount' => null, + 'price' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'preview_id' => 'preview_id', + 'sell_currency' => 'sell_currency', + 'sell_amount' => 'sell_amount', + 'buy_currency' => 'buy_currency', + 'buy_amount' => 'buy_amount', + 'price' => 'price' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'preview_id' => 'setPreviewId', + 'sell_currency' => 'setSellCurrency', + 'sell_amount' => 'setSellAmount', + 'buy_currency' => 'setBuyCurrency', + 'buy_amount' => 'setBuyAmount', + 'price' => 'setPrice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'preview_id' => 'getPreviewId', + 'sell_currency' => 'getSellCurrency', + 'sell_amount' => 'getSellAmount', + 'buy_currency' => 'getBuyCurrency', + 'buy_amount' => 'getBuyAmount', + 'price' => 'getPrice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['preview_id'] = isset($data['preview_id']) ? $data['preview_id'] : null; + $this->container['sell_currency'] = isset($data['sell_currency']) ? $data['sell_currency'] : null; + $this->container['sell_amount'] = isset($data['sell_amount']) ? $data['sell_amount'] : null; + $this->container['buy_currency'] = isset($data['buy_currency']) ? $data['buy_currency'] : null; + $this->container['buy_amount'] = isset($data['buy_amount']) ? $data['buy_amount'] : null; + $this->container['price'] = isset($data['price']) ? $data['price'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets preview_id + * + * @return string|null + */ + public function getPreviewId() + { + return $this->container['preview_id']; + } + + /** + * Sets preview_id + * + * @param string|null $preview_id Preview result ID + * + * @return $this + */ + public function setPreviewId($preview_id) + { + $this->container['preview_id'] = $preview_id; + + return $this; + } + + /** + * Gets sell_currency + * + * @return string|null + */ + public function getSellCurrency() + { + return $this->container['sell_currency']; + } + + /** + * Sets sell_currency + * + * @param string|null $sell_currency Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` + * + * @return $this + */ + public function setSellCurrency($sell_currency) + { + $this->container['sell_currency'] = $sell_currency; + + return $this; + } + + /** + * Gets sell_amount + * + * @return string|null + */ + public function getSellAmount() + { + return $this->container['sell_amount']; + } + + /** + * Sets sell_amount + * + * @param string|null $sell_amount Amount to sell + * + * @return $this + */ + public function setSellAmount($sell_amount) + { + $this->container['sell_amount'] = $sell_amount; + + return $this; + } + + /** + * Gets buy_currency + * + * @return string|null + */ + public function getBuyCurrency() + { + return $this->container['buy_currency']; + } + + /** + * Sets buy_currency + * + * @param string|null $buy_currency Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` + * + * @return $this + */ + public function setBuyCurrency($buy_currency) + { + $this->container['buy_currency'] = $buy_currency; + + return $this; + } + + /** + * Gets buy_amount + * + * @return string|null + */ + public function getBuyAmount() + { + return $this->container['buy_amount']; + } + + /** + * Sets buy_amount + * + * @param string|null $buy_amount Amount to buy + * + * @return $this + */ + public function setBuyAmount($buy_amount) + { + $this->container['buy_amount'] = $buy_amount; + + return $this; + } + + /** + * Gets price + * + * @return string|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param string|null $price Price + * + * @return $this + */ + public function setPrice($price) + { + $this->container['price'] = $price; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FlashSwapOrderRequest.php b/src/Model/FlashSwapOrderRequest.php new file mode 100644 index 0000000..5fe3fa0 --- /dev/null +++ b/src/Model/FlashSwapOrderRequest.php @@ -0,0 +1,432 @@ + 'string', + 'sell_currency' => 'string', + 'sell_amount' => 'string', + 'buy_currency' => 'string', + 'buy_amount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'preview_id' => null, + 'sell_currency' => null, + 'sell_amount' => null, + 'buy_currency' => null, + 'buy_amount' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'preview_id' => 'preview_id', + 'sell_currency' => 'sell_currency', + 'sell_amount' => 'sell_amount', + 'buy_currency' => 'buy_currency', + 'buy_amount' => 'buy_amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'preview_id' => 'setPreviewId', + 'sell_currency' => 'setSellCurrency', + 'sell_amount' => 'setSellAmount', + 'buy_currency' => 'setBuyCurrency', + 'buy_amount' => 'setBuyAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'preview_id' => 'getPreviewId', + 'sell_currency' => 'getSellCurrency', + 'sell_amount' => 'getSellAmount', + 'buy_currency' => 'getBuyCurrency', + 'buy_amount' => 'getBuyAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['preview_id'] = isset($data['preview_id']) ? $data['preview_id'] : null; + $this->container['sell_currency'] = isset($data['sell_currency']) ? $data['sell_currency'] : null; + $this->container['sell_amount'] = isset($data['sell_amount']) ? $data['sell_amount'] : null; + $this->container['buy_currency'] = isset($data['buy_currency']) ? $data['buy_currency'] : null; + $this->container['buy_amount'] = isset($data['buy_amount']) ? $data['buy_amount'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sell_currency'] === null) { + $invalidProperties[] = "'sell_currency' can't be null"; + } + if ($this->container['buy_currency'] === null) { + $invalidProperties[] = "'buy_currency' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets preview_id + * + * @return string|null + */ + public function getPreviewId() + { + return $this->container['preview_id']; + } + + /** + * Sets preview_id + * + * @param string|null $preview_id Preview result ID + * + * @return $this + */ + public function setPreviewId($preview_id) + { + $this->container['preview_id'] = $preview_id; + + return $this; + } + + /** + * Gets sell_currency + * + * @return string + */ + public function getSellCurrency() + { + return $this->container['sell_currency']; + } + + /** + * Sets sell_currency + * + * @param string $sell_currency Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` + * + * @return $this + */ + public function setSellCurrency($sell_currency) + { + $this->container['sell_currency'] = $sell_currency; + + return $this; + } + + /** + * Gets sell_amount + * + * @return string|null + */ + public function getSellAmount() + { + return $this->container['sell_amount']; + } + + /** + * Sets sell_amount + * + * @param string|null $sell_amount Amount to sell. It is required to choose one parameter between `sell_amount` and `buy_amount` + * + * @return $this + */ + public function setSellAmount($sell_amount) + { + $this->container['sell_amount'] = $sell_amount; + + return $this; + } + + /** + * Gets buy_currency + * + * @return string + */ + public function getBuyCurrency() + { + return $this->container['buy_currency']; + } + + /** + * Sets buy_currency + * + * @param string $buy_currency Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` + * + * @return $this + */ + public function setBuyCurrency($buy_currency) + { + $this->container['buy_currency'] = $buy_currency; + + return $this; + } + + /** + * Gets buy_amount + * + * @return string|null + */ + public function getBuyAmount() + { + return $this->container['buy_amount']; + } + + /** + * Sets buy_amount + * + * @param string|null $buy_amount Amount to buy. It is required to choose one parameter between `sell_amount` and `buy_amount` + * + * @return $this + */ + public function setBuyAmount($buy_amount) + { + $this->container['buy_amount'] = $buy_amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FuturesIndexConstituents.php b/src/Model/FuturesIndexConstituents.php new file mode 100644 index 0000000..89e7960 --- /dev/null +++ b/src/Model/FuturesIndexConstituents.php @@ -0,0 +1,335 @@ + 'string', + 'constituents' => '\GateApi\Model\IndexConstituent[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'index' => null, + 'constituents' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'index' => 'index', + 'constituents' => 'constituents' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'index' => 'setIndex', + 'constituents' => 'setConstituents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'index' => 'getIndex', + 'constituents' => 'getConstituents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['index'] = isset($data['index']) ? $data['index'] : null; + $this->container['constituents'] = isset($data['constituents']) ? $data['constituents'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string|null $index Index name + * + * @return $this + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets constituents + * + * @return \GateApi\Model\IndexConstituent[]|null + */ + public function getConstituents() + { + return $this->container['constituents']; + } + + /** + * Sets constituents + * + * @param \GateApi\Model\IndexConstituent[]|null $constituents Constituents + * + * @return $this + */ + public function setConstituents($constituents) + { + $this->container['constituents'] = $constituents; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FuturesInitialOrder.php b/src/Model/FuturesInitialOrder.php index 231cb89..4b9d6e8 100644 --- a/src/Model/FuturesInitialOrder.php +++ b/src/Model/FuturesInitialOrder.php @@ -61,6 +61,7 @@ class FuturesInitialOrder implements ModelInterface, ArrayAccess 'tif' => 'string', 'text' => 'string', 'reduce_only' => 'bool', + 'auto_size' => 'string', 'is_reduce_only' => 'bool', 'is_close' => 'bool' ]; @@ -78,6 +79,7 @@ class FuturesInitialOrder implements ModelInterface, ArrayAccess 'tif' => null, 'text' => null, 'reduce_only' => null, + 'auto_size' => null, 'is_reduce_only' => null, 'is_close' => null ]; @@ -116,6 +118,7 @@ public static function openAPIFormats() 'tif' => 'tif', 'text' => 'text', 'reduce_only' => 'reduce_only', + 'auto_size' => 'auto_size', 'is_reduce_only' => 'is_reduce_only', 'is_close' => 'is_close' ]; @@ -133,6 +136,7 @@ public static function openAPIFormats() 'tif' => 'setTif', 'text' => 'setText', 'reduce_only' => 'setReduceOnly', + 'auto_size' => 'setAutoSize', 'is_reduce_only' => 'setIsReduceOnly', 'is_close' => 'setIsClose' ]; @@ -150,6 +154,7 @@ public static function openAPIFormats() 'tif' => 'getTif', 'text' => 'getText', 'reduce_only' => 'getReduceOnly', + 'auto_size' => 'getAutoSize', 'is_reduce_only' => 'getIsReduceOnly', 'is_close' => 'getIsClose' ]; @@ -236,6 +241,7 @@ public function __construct(array $data = null) $this->container['tif'] = isset($data['tif']) ? $data['tif'] : 'gtc'; $this->container['text'] = isset($data['text']) ? $data['text'] : null; $this->container['reduce_only'] = isset($data['reduce_only']) ? $data['reduce_only'] : false; + $this->container['auto_size'] = isset($data['auto_size']) ? $data['auto_size'] : null; $this->container['is_reduce_only'] = isset($data['is_reduce_only']) ? $data['is_reduce_only'] : null; $this->container['is_close'] = isset($data['is_close']) ? $data['is_close'] : null; } @@ -455,6 +461,30 @@ public function setReduceOnly($reduce_only) return $this; } + /** + * Gets auto_size + * + * @return string|null + */ + public function getAutoSize() + { + return $this->container['auto_size']; + } + + /** + * Sets auto_size + * + * @param string|null $auto_size Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 + * + * @return $this + */ + public function setAutoSize($auto_size) + { + $this->container['auto_size'] = $auto_size; + + return $this; + } + /** * Gets is_reduce_only * diff --git a/src/Model/FuturesPriceTrigger.php b/src/Model/FuturesPriceTrigger.php index 01aa38f..f3948a4 100644 --- a/src/Model/FuturesPriceTrigger.php +++ b/src/Model/FuturesPriceTrigger.php @@ -68,9 +68,9 @@ class FuturesPriceTrigger implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'strategy_type' => null, - 'price_type' => null, + 'price_type' => 'int32', 'price' => null, - 'rule' => null, + 'rule' => 'int32', 'expiration' => null ]; diff --git a/src/Model/FuturesPriceTriggeredOrder.php b/src/Model/FuturesPriceTriggeredOrder.php index 46b8bfd..52489f4 100644 --- a/src/Model/FuturesPriceTriggeredOrder.php +++ b/src/Model/FuturesPriceTriggeredOrder.php @@ -64,7 +64,9 @@ class FuturesPriceTriggeredOrder implements ModelInterface, ArrayAccess 'trade_id' => 'int', 'status' => 'string', 'finish_as' => 'string', - 'reason' => 'string' + 'reason' => 'string', + 'order_type' => 'string', + 'me_order_id' => 'string' ]; /** @@ -82,7 +84,9 @@ class FuturesPriceTriggeredOrder implements ModelInterface, ArrayAccess 'trade_id' => 'int64', 'status' => null, 'finish_as' => null, - 'reason' => null + 'reason' => null, + 'order_type' => null, + 'me_order_id' => null ]; /** @@ -121,7 +125,9 @@ public static function openAPIFormats() 'trade_id' => 'trade_id', 'status' => 'status', 'finish_as' => 'finish_as', - 'reason' => 'reason' + 'reason' => 'reason', + 'order_type' => 'order_type', + 'me_order_id' => 'me_order_id' ]; /** @@ -139,7 +145,9 @@ public static function openAPIFormats() 'trade_id' => 'setTradeId', 'status' => 'setStatus', 'finish_as' => 'setFinishAs', - 'reason' => 'setReason' + 'reason' => 'setReason', + 'order_type' => 'setOrderType', + 'me_order_id' => 'setMeOrderId' ]; /** @@ -157,7 +165,9 @@ public static function openAPIFormats() 'trade_id' => 'getTradeId', 'status' => 'getStatus', 'finish_as' => 'getFinishAs', - 'reason' => 'getReason' + 'reason' => 'getReason', + 'order_type' => 'getOrderType', + 'me_order_id' => 'getMeOrderId' ]; /** @@ -203,6 +213,8 @@ public function getModelName() const STATUS_OPEN = 'open'; const STATUS_FINISHED = 'finished'; + const STATUS_INACTIVE = 'inactive'; + const STATUS_INVALID = 'invalid'; const FINISH_AS_CANCELLED = 'cancelled'; const FINISH_AS_SUCCEEDED = 'succeeded'; const FINISH_AS_FAILED = 'failed'; @@ -220,6 +232,8 @@ public function getStatusAllowableValues() return [ self::STATUS_OPEN, self::STATUS_FINISHED, + self::STATUS_INACTIVE, + self::STATUS_INVALID, ]; } @@ -264,6 +278,8 @@ public function __construct(array $data = null) $this->container['status'] = isset($data['status']) ? $data['status'] : null; $this->container['finish_as'] = isset($data['finish_as']) ? $data['finish_as'] : null; $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; + $this->container['order_type'] = isset($data['order_type']) ? $data['order_type'] : null; + $this->container['me_order_id'] = isset($data['me_order_id']) ? $data['me_order_id'] : null; } /** @@ -493,7 +509,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status Order status. + * @param string|null $status Auto order status - `open`: order is active - `finished`: order is finished - `inactive`: order is not active, only for close-long-order or close-short-order - `invalid`: order is invalid, only for close-long-order or close-short-order * * @return $this */ @@ -569,6 +585,54 @@ public function setReason($reason) return $this; } + + /** + * Gets order_type + * + * @return string|null + */ + public function getOrderType() + { + return $this->container['order_type']; + } + + /** + * Sets order_type + * + * @param string|null $order_type Take-profit/stop-loss types, which include: - `close-long-order`: order take-profit/stop-loss, close long position - `close-short-order`: order take-profit/stop-loss, close short position - `close-long-position`: position take-profit/stop-loss, close long position - `close-short-position`: position take-profit/stop-loss, close short position - `plan-close-long-position`: position planned take-profit/stop-loss, close long position - `plan-close-short-position`: position planned take-profit/stop-loss, close short position The order take-profit/stop-loss can not be passed by request. These two types are read only. + * + * @return $this + */ + public function setOrderType($order_type) + { + $this->container['order_type'] = $order_type; + + return $this; + } + + /** + * Gets me_order_id + * + * @return string|null + */ + public function getMeOrderId() + { + return $this->container['me_order_id']; + } + + /** + * Sets me_order_id + * + * @param string|null $me_order_id Corresponding order ID of order take-profit/stop-loss. + * + * @return $this + */ + public function setMeOrderId($me_order_id) + { + $this->container['me_order_id'] = $me_order_id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/IndexConstituent.php b/src/Model/IndexConstituent.php new file mode 100644 index 0000000..59218b7 --- /dev/null +++ b/src/Model/IndexConstituent.php @@ -0,0 +1,335 @@ + 'string', + 'symbols' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'exchange' => null, + 'symbols' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'exchange' => 'exchange', + 'symbols' => 'symbols' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'exchange' => 'setExchange', + 'symbols' => 'setSymbols' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'exchange' => 'getExchange', + 'symbols' => 'getSymbols' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['exchange'] = isset($data['exchange']) ? $data['exchange'] : null; + $this->container['symbols'] = isset($data['symbols']) ? $data['symbols'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets exchange + * + * @return string|null + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param string|null $exchange Exchange + * + * @return $this + */ + public function setExchange($exchange) + { + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets symbols + * + * @return string[]|null + */ + public function getSymbols() + { + return $this->container['symbols']; + } + + /** + * Sets symbols + * + * @param string[]|null $symbols Symbol list + * + * @return $this + */ + public function setSymbols($symbols) + { + $this->container['symbols'] = $symbols; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LedgerRecord.php b/src/Model/LedgerRecord.php index 847c7f1..5b8a4aa 100644 --- a/src/Model/LedgerRecord.php +++ b/src/Model/LedgerRecord.php @@ -211,6 +211,8 @@ public function getModelName() const STATUS_VERIFY = 'VERIFY'; const STATUS_PROCES = 'PROCES'; const STATUS_PEND = 'PEND'; + const STATUS_DMOVE = 'DMOVE'; + const STATUS_SPLITPEND = 'SPLITPEND'; @@ -233,6 +235,8 @@ public function getStatusAllowableValues() self::STATUS_VERIFY, self::STATUS_PROCES, self::STATUS_PEND, + self::STATUS_DMOVE, + self::STATUS_SPLITPEND, ]; } @@ -483,7 +487,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending + * @param string|null $status Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending - DMOVE: required manual approval - SPLITPEND: the order is automatically split due to large amount * * @return $this */ diff --git a/src/Model/SubAccountFuturesBalance.php b/src/Model/SubAccountFuturesBalance.php new file mode 100644 index 0000000..a5caabd --- /dev/null +++ b/src/Model/SubAccountFuturesBalance.php @@ -0,0 +1,335 @@ + 'string', + 'available' => 'map[string,\GateApi\Model\FuturesAccount]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'uid' => null, + 'available' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'uid' => 'uid', + 'available' => 'available' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'uid' => 'setUid', + 'available' => 'setAvailable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'uid' => 'getUid', + 'available' => 'getAvailable' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['uid'] = isset($data['uid']) ? $data['uid'] : null; + $this->container['available'] = isset($data['available']) ? $data['available'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uid + * + * @return string|null + */ + public function getUid() + { + return $this->container['uid']; + } + + /** + * Sets uid + * + * @param string|null $uid User ID + * + * @return $this + */ + public function setUid($uid) + { + $this->container['uid'] = $uid; + + return $this; + } + + /** + * Gets available + * + * @return map[string,\GateApi\Model\FuturesAccount]|null + */ + public function getAvailable() + { + return $this->container['available']; + } + + /** + * Sets available + * + * @param map[string,\GateApi\Model\FuturesAccount]|null $available Futures account balances + * + * @return $this + */ + public function setAvailable($available) + { + $this->container['available'] = $available; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SubAccountMarginBalance.php b/src/Model/SubAccountMarginBalance.php new file mode 100644 index 0000000..fda523d --- /dev/null +++ b/src/Model/SubAccountMarginBalance.php @@ -0,0 +1,335 @@ + 'string', + 'available' => '\GateApi\Model\MarginAccount[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'uid' => null, + 'available' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'uid' => 'uid', + 'available' => 'available' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'uid' => 'setUid', + 'available' => 'setAvailable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'uid' => 'getUid', + 'available' => 'getAvailable' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['uid'] = isset($data['uid']) ? $data['uid'] : null; + $this->container['available'] = isset($data['available']) ? $data['available'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uid + * + * @return string|null + */ + public function getUid() + { + return $this->container['uid']; + } + + /** + * Sets uid + * + * @param string|null $uid User ID + * + * @return $this + */ + public function setUid($uid) + { + $this->container['uid'] = $uid; + + return $this; + } + + /** + * Gets available + * + * @return \GateApi\Model\MarginAccount[]|null + */ + public function getAvailable() + { + return $this->container['available']; + } + + /** + * Sets available + * + * @param \GateApi\Model\MarginAccount[]|null $available Margin account balances + * + * @return $this + */ + public function setAvailable($available) + { + $this->container['available'] = $available; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + From c5d1905e7f6d23705d6306b4bc222d3860c8bd86 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Fri, 15 Jul 2022 18:12:21 +0800 Subject: [PATCH 14/17] porfolio margin account support --- README.md | 19 +- composer.json | 2 +- composer.lock | 231 +++++------ docs/Api/DeliveryApi.md | 4 +- docs/Api/FuturesApi.md | 4 +- docs/Api/MarginApi.md | 4 +- docs/Api/OptionsApi.md | 73 ++++ docs/Api/SpotApi.md | 152 +++++++- docs/Model/CancelOrder.md | 2 +- docs/Model/CrossMarginAccount.md | 6 + docs/Model/CrossMarginCurrency.md | 1 + docs/Model/FuturesAccount.md | 9 +- docs/Model/FuturesAccountHistory.md | 18 + docs/Model/LiquidateOrder.md | 12 + docs/Model/MyFuturesTrade.md | 3 + docs/Model/OptionsContract.md | 2 +- docs/Model/OptionsMySettlements.md | 17 + docs/Model/Order.md | 2 +- docs/Model/Position.md | 2 + docs/Model/SubAccountTransfer.md | 2 +- docs/Model/SystemTime.md | 9 + docs/Model/Ticker.md | 2 + src/Api/DeliveryApi.php | 8 +- src/Api/FuturesApi.php | 8 +- src/Api/MarginApi.php | 8 +- src/Api/OptionsApi.php | 357 +++++++++++++++++ src/Api/SpotApi.php | 537 ++++++++++++++++++++++++-- src/Configuration.php | 6 +- src/Model/CancelOrder.php | 2 +- src/Model/CrossMarginAccount.php | 190 ++++++++- src/Model/CrossMarginCurrency.php | 40 +- src/Model/FuturesAccount.php | 164 +++++++- src/Model/FuturesAccountHistory.php | 576 ++++++++++++++++++++++++++++ src/Model/LiquidateOrder.php | 405 +++++++++++++++++++ src/Model/MyFuturesTrade.php | 100 ++++- src/Model/OptionsContract.php | 2 +- src/Model/OptionsMySettlements.php | 545 ++++++++++++++++++++++++++ src/Model/Order.php | 2 +- src/Model/Position.php | 60 +++ src/Model/SubAccountTransfer.php | 4 +- src/Model/SystemTime.php | 305 +++++++++++++++ src/Model/Ticker.php | 60 +++ 42 files changed, 3729 insertions(+), 226 deletions(-) create mode 100644 docs/Model/FuturesAccountHistory.md create mode 100644 docs/Model/LiquidateOrder.md create mode 100644 docs/Model/OptionsMySettlements.md create mode 100644 docs/Model/SystemTime.md create mode 100644 src/Model/FuturesAccountHistory.php create mode 100644 src/Model/LiquidateOrder.php create mode 100644 src/Model/OptionsMySettlements.php create mode 100644 src/Model/SystemTime.php diff --git a/README.md b/README.md index 411881c..5ecd6bb 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.24.0 -- Package version: 5.24.0 +- API version: 4.25.1 +- Package version: 5.25.1 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) @@ -123,7 +123,7 @@ Class | Method | HTTP request | Description *DeliveryApi* | [**createPriceTriggeredDeliveryOrder**](docs/Api/DeliveryApi.md#createpricetriggereddeliveryorder) | **POST** /delivery/{settle}/price_orders | Create a price-triggered order *DeliveryApi* | [**cancelPriceTriggeredDeliveryOrderList**](docs/Api/DeliveryApi.md#cancelpricetriggereddeliveryorderlist) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders *DeliveryApi* | [**getPriceTriggeredDeliveryOrder**](docs/Api/DeliveryApi.md#getpricetriggereddeliveryorder) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a single order -*DeliveryApi* | [**cancelPriceTriggeredDeliveryOrder**](docs/Api/DeliveryApi.md#cancelpricetriggereddeliveryorder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel a single order +*DeliveryApi* | [**cancelPriceTriggeredDeliveryOrder**](docs/Api/DeliveryApi.md#cancelpricetriggereddeliveryorder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order *FlashSwapApi* | [**listFlashSwapCurrencies**](docs/Api/FlashSwapApi.md#listflashswapcurrencies) | **GET** /flash_swap/currencies | List all supported currencies in flash swap *FlashSwapApi* | [**listFlashSwapOrders**](docs/Api/FlashSwapApi.md#listflashswaporders) | **GET** /flash_swap/orders | List all flash swap orders *FlashSwapApi* | [**createFlashSwapOrder**](docs/Api/FlashSwapApi.md#createflashswaporder) | **POST** /flash_swap/orders | Create a flash swap order @@ -165,7 +165,7 @@ Class | Method | HTTP request | Description *FuturesApi* | [**createPriceTriggeredOrder**](docs/Api/FuturesApi.md#createpricetriggeredorder) | **POST** /futures/{settle}/price_orders | Create a price-triggered order *FuturesApi* | [**cancelPriceTriggeredOrderList**](docs/Api/FuturesApi.md#cancelpricetriggeredorderlist) | **DELETE** /futures/{settle}/price_orders | Cancel all open orders *FuturesApi* | [**getPriceTriggeredOrder**](docs/Api/FuturesApi.md#getpricetriggeredorder) | **GET** /futures/{settle}/price_orders/{order_id} | Get a single order -*FuturesApi* | [**cancelPriceTriggeredOrder**](docs/Api/FuturesApi.md#cancelpricetriggeredorder) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel a single order +*FuturesApi* | [**cancelPriceTriggeredOrder**](docs/Api/FuturesApi.md#cancelpricetriggeredorder) | **DELETE** /futures/{settle}/price_orders/{order_id} | cancel a price-triggered order *MarginApi* | [**listMarginCurrencyPairs**](docs/Api/MarginApi.md#listmargincurrencypairs) | **GET** /margin/currency_pairs | List all supported currency pairs supported in margin trading *MarginApi* | [**getMarginCurrencyPair**](docs/Api/MarginApi.md#getmargincurrencypair) | **GET** /margin/currency_pairs/{currency_pair} | Query one single margin currency pair *MarginApi* | [**listFundingBook**](docs/Api/MarginApi.md#listfundingbook) | **GET** /margin/funding_book | Order book of lending loans @@ -195,7 +195,7 @@ Class | Method | HTTP request | Description *MarginApi* | [**createCrossMarginLoan**](docs/Api/MarginApi.md#createcrossmarginloan) | **POST** /margin/cross/loans | Create a cross margin borrow loan *MarginApi* | [**getCrossMarginLoan**](docs/Api/MarginApi.md#getcrossmarginloan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail *MarginApi* | [**listCrossMarginRepayments**](docs/Api/MarginApi.md#listcrossmarginrepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments -*MarginApi* | [**repayCrossMarginLoan**](docs/Api/MarginApi.md#repaycrossmarginloan) | **POST** /margin/cross/repayments | Repay cross margin loan +*MarginApi* | [**repayCrossMarginLoan**](docs/Api/MarginApi.md#repaycrossmarginloan) | **POST** /margin/cross/repayments | When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first *MarginApi* | [**getCrossMarginTransferable**](docs/Api/MarginApi.md#getcrossmargintransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency *MarginApi* | [**getCrossMarginBorrowable**](docs/Api/MarginApi.md#getcrossmarginborrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency *OptionsApi* | [**listOptionsUnderlyings**](docs/Api/OptionsApi.md#listoptionsunderlyings) | **GET** /options/underlyings | List all underlyings @@ -204,6 +204,7 @@ Class | Method | HTTP request | Description *OptionsApi* | [**getOptionsContract**](docs/Api/OptionsApi.md#getoptionscontract) | **GET** /options/contracts/{contract} | Query specified contract detail *OptionsApi* | [**listOptionsSettlements**](docs/Api/OptionsApi.md#listoptionssettlements) | **GET** /options/settlements | List settlement history *OptionsApi* | [**getOptionsSettlement**](docs/Api/OptionsApi.md#getoptionssettlement) | **GET** /options/settlements/{contract} | Get specified contract's settlement +*OptionsApi* | [**listMyOptionsSettlements**](docs/Api/OptionsApi.md#listmyoptionssettlements) | **GET** /options/my_settlements | List my options settlements *OptionsApi* | [**listOptionsOrderBook**](docs/Api/OptionsApi.md#listoptionsorderbook) | **GET** /options/order_book | Futures order book *OptionsApi* | [**listOptionsTickers**](docs/Api/OptionsApi.md#listoptionstickers) | **GET** /options/tickers | List tickers of options contracts *OptionsApi* | [**listOptionsUnderlyingTickers**](docs/Api/OptionsApi.md#listoptionsunderlyingtickers) | **GET** /options/underlying/tickers/{underlying} | Get underlying ticker @@ -233,6 +234,7 @@ Class | Method | HTTP request | Description *SpotApi* | [**listSpotAccounts**](docs/Api/SpotApi.md#listspotaccounts) | **GET** /spot/accounts | List spot accounts *SpotApi* | [**createBatchOrders**](docs/Api/SpotApi.md#createbatchorders) | **POST** /spot/batch_orders | Create a batch of orders *SpotApi* | [**listAllOpenOrders**](docs/Api/SpotApi.md#listallopenorders) | **GET** /spot/open_orders | List all open orders +*SpotApi* | [**createCrossLiquidateOrder**](docs/Api/SpotApi.md#createcrossliquidateorder) | **POST** /spot/cross_liquidate_orders | close position when cross-currency is disabled *SpotApi* | [**listOrders**](docs/Api/SpotApi.md#listorders) | **GET** /spot/orders | List orders *SpotApi* | [**createOrder**](docs/Api/SpotApi.md#createorder) | **POST** /spot/orders | Create an order *SpotApi* | [**cancelOrders**](docs/Api/SpotApi.md#cancelorders) | **DELETE** /spot/orders | Cancel all `open` orders in specified currency pair @@ -240,11 +242,12 @@ Class | Method | HTTP request | Description *SpotApi* | [**getOrder**](docs/Api/SpotApi.md#getorder) | **GET** /spot/orders/{order_id} | Get a single order *SpotApi* | [**cancelOrder**](docs/Api/SpotApi.md#cancelorder) | **DELETE** /spot/orders/{order_id} | Cancel a single order *SpotApi* | [**listMyTrades**](docs/Api/SpotApi.md#listmytrades) | **GET** /spot/my_trades | List personal trading history +*SpotApi* | [**getSystemTime**](docs/Api/SpotApi.md#getsystemtime) | **GET** /spot/time | Get server current time *SpotApi* | [**listSpotPriceTriggeredOrders**](docs/Api/SpotApi.md#listspotpricetriggeredorders) | **GET** /spot/price_orders | Retrieve running auto order list *SpotApi* | [**createSpotPriceTriggeredOrder**](docs/Api/SpotApi.md#createspotpricetriggeredorder) | **POST** /spot/price_orders | Create a price-triggered order *SpotApi* | [**cancelSpotPriceTriggeredOrderList**](docs/Api/SpotApi.md#cancelspotpricetriggeredorderlist) | **DELETE** /spot/price_orders | Cancel all open orders *SpotApi* | [**getSpotPriceTriggeredOrder**](docs/Api/SpotApi.md#getspotpricetriggeredorder) | **GET** /spot/price_orders/{order_id} | Get a single order -*SpotApi* | [**cancelSpotPriceTriggeredOrder**](docs/Api/SpotApi.md#cancelspotpricetriggeredorder) | **DELETE** /spot/price_orders/{order_id} | Cancel a single order +*SpotApi* | [**cancelSpotPriceTriggeredOrder**](docs/Api/SpotApi.md#cancelspotpricetriggeredorder) | **DELETE** /spot/price_orders/{order_id} | cancel a price-triggered order *WalletApi* | [**listCurrencyChains**](docs/Api/WalletApi.md#listcurrencychains) | **GET** /wallet/currency_chains | List chains supported for specified currency *WalletApi* | [**getDepositAddress**](docs/Api/WalletApi.md#getdepositaddress) | **GET** /wallet/deposit_address | Generate currency deposit address *WalletApi* | [**listWithdrawals**](docs/Api/WalletApi.md#listwithdrawals) | **GET** /wallet/withdrawals | Retrieve withdrawal records @@ -295,6 +298,7 @@ Class | Method | HTTP request | Description - [FundingRateRecord](docs/Model/FundingRateRecord.md) - [FuturesAccount](docs/Model/FuturesAccount.md) - [FuturesAccountBook](docs/Model/FuturesAccountBook.md) + - [FuturesAccountHistory](docs/Model/FuturesAccountHistory.md) - [FuturesCandlestick](docs/Model/FuturesCandlestick.md) - [FuturesIndexConstituents](docs/Model/FuturesIndexConstituents.md) - [FuturesInitialOrder](docs/Model/FuturesInitialOrder.md) @@ -310,6 +314,7 @@ Class | Method | HTTP request | Description - [IndexConstituent](docs/Model/IndexConstituent.md) - [InsuranceRecord](docs/Model/InsuranceRecord.md) - [LedgerRecord](docs/Model/LedgerRecord.md) + - [LiquidateOrder](docs/Model/LiquidateOrder.md) - [Loan](docs/Model/Loan.md) - [LoanPatch](docs/Model/LoanPatch.md) - [LoanRecord](docs/Model/LoanRecord.md) @@ -325,6 +330,7 @@ Class | Method | HTTP request | Description - [OptionsAccount](docs/Model/OptionsAccount.md) - [OptionsAccountBook](docs/Model/OptionsAccountBook.md) - [OptionsContract](docs/Model/OptionsContract.md) + - [OptionsMySettlements](docs/Model/OptionsMySettlements.md) - [OptionsMyTrade](docs/Model/OptionsMyTrade.md) - [OptionsOrder](docs/Model/OptionsOrder.md) - [OptionsPosition](docs/Model/OptionsPosition.md) @@ -348,6 +354,7 @@ Class | Method | HTTP request | Description - [SubAccountFuturesBalance](docs/Model/SubAccountFuturesBalance.md) - [SubAccountMarginBalance](docs/Model/SubAccountMarginBalance.md) - [SubAccountTransfer](docs/Model/SubAccountTransfer.md) + - [SystemTime](docs/Model/SystemTime.md) - [Ticker](docs/Model/Ticker.md) - [TotalBalance](docs/Model/TotalBalance.md) - [Trade](docs/Model/Trade.md) diff --git a/composer.json b/composer.json index 6ca8557..3a8f4e0 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.24.0", + "version": "5.25.1", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index 625df1f..f70c1d4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,28 +4,28 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d96c459c7f61c508a861f241bd2c4b13", + "content-hash": "a56a0488fad2e4bde424fa60802ace2b", "packages": [ { "name": "guzzlehttp/guzzle", - "version": "6.5.6", + "version": "6.5.8", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f092dd734083473658de3ee4bef093ed77d2689c" + "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f092dd734083473658de3ee4bef093ed77d2689c", - "reference": "f092dd734083473658de3ee4bef093ed77d2689c", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", + "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.6.1", + "guzzlehttp/psr7": "^1.9", "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.17.0" + "symfony/polyfill-intl-idn": "^1.17" }, "require-dev": { "ext-curl": "*", @@ -103,7 +103,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/6.5.6" + "source": "https://github.com/guzzle/guzzle/tree/6.5.8" }, "funding": [ { @@ -119,7 +119,7 @@ "type": "tidelift" } ], - "time": "2022-05-25T13:19:12+00:00" + "time": "2022-06-20T22:16:07+00:00" }, { "name": "guzzlehttp/promises", @@ -207,16 +207,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.8.5", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268" + "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/337e3ad8e5716c15f9657bd214d16cc5e69df268", - "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", + "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", "shasum": "" }, "require": { @@ -237,7 +237,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -297,7 +297,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.5" + "source": "https://github.com/guzzle/psr7/tree/1.9.0" }, "funding": [ { @@ -313,7 +313,7 @@ "type": "tidelift" } ], - "time": "2022-03-20T21:51:18+00:00" + "time": "2022-06-20T21:43:03+00:00" }, { "name": "psr/http-message", @@ -414,16 +414,16 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "749045c69efb97c70d25d7463abba812e91f3a44" + "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/749045c69efb97c70d25d7463abba812e91f3a44", - "reference": "749045c69efb97c70d25d7463abba812e91f3a44", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/59a8d271f00dd0e4c2e518104cc7963f655a1aa8", + "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8", "shasum": "" }, "require": { @@ -437,7 +437,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -481,7 +481,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.26.0" }, "funding": [ { @@ -497,20 +497,20 @@ "type": "tidelift" } ], - "time": "2021-09-14T14:02:44+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + "reference": "219aa369ceff116e673852dce47c3a41794c14bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", + "reference": "219aa369ceff116e673852dce47c3a41794c14bd", "shasum": "" }, "require": { @@ -522,7 +522,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -565,7 +565,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" }, "funding": [ { @@ -581,20 +581,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/bf44a9fd41feaac72b074de600314a93e2ae78e2", + "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2", "shasum": "" }, "require": { @@ -603,7 +603,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -641,7 +641,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.26.0" }, "funding": [ { @@ -657,7 +657,7 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:17:38+00:00" + "time": "2022-05-24T11:49:31+00:00" } ], "packages-dev": [ @@ -881,16 +881,16 @@ }, { "name": "doctrine/annotations", - "version": "1.13.2", + "version": "1.13.3", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08" + "reference": "648b0343343565c4a056bfc8392201385e8d89f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", + "reference": "648b0343343565c4a056bfc8392201385e8d89f0", "shasum": "" }, "require": { @@ -902,9 +902,10 @@ "require-dev": { "doctrine/cache": "^1.11 || ^2.0", "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", + "phpstan/phpstan": "^1.4.10 || ^1.8.0", "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2" + "symfony/cache": "^4.4 || ^5.2", + "vimeo/psalm": "^4.10" }, "type": "library", "autoload": { @@ -947,9 +948,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.2" + "source": "https://github.com/doctrine/annotations/tree/1.13.3" }, - "time": "2021-08-05T19:00:23+00:00" + "time": "2022-07-02T10:48:51+00:00" }, { "name": "doctrine/instantiator", @@ -2899,16 +2900,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.2", + "version": "3.7.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", "shasum": "" }, "require": { @@ -2951,20 +2952,20 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2021-12-12T21:44:58+00:00" + "time": "2022-06-18T07:21:10+00:00" }, { "name": "symfony/console", - "version": "v5.4.9", + "version": "v5.4.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb" + "reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/829d5d1bf60b2efeb0887b7436873becc71a45eb", - "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb", + "url": "https://api.github.com/repos/symfony/console/zipball/4d671ab4ddac94ee439ea73649c69d9d200b5000", + "reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000", "shasum": "" }, "require": { @@ -3034,7 +3035,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.9" + "source": "https://github.com/symfony/console/tree/v5.4.10" }, "funding": [ { @@ -3050,11 +3051,11 @@ "type": "tidelift" } ], - "time": "2022-05-18T06:17:34+00:00" + "time": "2022-06-26T13:00:04+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", @@ -3101,7 +3102,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" }, "funding": [ { @@ -3206,7 +3207,7 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", @@ -3265,7 +3266,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2" }, "funding": [ { @@ -3481,16 +3482,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", "shasum": "" }, "require": { @@ -3505,7 +3506,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3543,7 +3544,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" }, "funding": [ { @@ -3559,20 +3560,20 @@ "type": "tidelift" } ], - "time": "2021-10-20T20:35:02+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" + "reference": "433d05519ce6990bf3530fba6957499d327395c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", + "reference": "433d05519ce6990bf3530fba6957499d327395c2", "shasum": "" }, "require": { @@ -3584,7 +3585,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3624,7 +3625,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" }, "funding": [ { @@ -3640,20 +3641,20 @@ "type": "tidelift" } ], - "time": "2021-11-23T21:10:46+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", "shasum": "" }, "require": { @@ -3668,7 +3669,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3707,7 +3708,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" }, "funding": [ { @@ -3723,7 +3724,7 @@ "type": "tidelift" } ], - "time": "2021-11-30T18:21:41+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php70", @@ -3795,16 +3796,16 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", + "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", "shasum": "" }, "require": { @@ -3813,7 +3814,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3854,7 +3855,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" }, "funding": [ { @@ -3870,20 +3871,20 @@ "type": "tidelift" } ], - "time": "2021-06-05T21:20:04+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", "shasum": "" }, "require": { @@ -3892,7 +3893,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3937,7 +3938,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" }, "funding": [ { @@ -3953,7 +3954,7 @@ "type": "tidelift" } ], - "time": "2022-03-04T08:16:47+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { "name": "symfony/process", @@ -4019,16 +4020,16 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", "shasum": "" }, "require": { @@ -4082,7 +4083,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" }, "funding": [ { @@ -4098,7 +4099,7 @@ "type": "tidelift" } ], - "time": "2022-03-13T20:07:29+00:00" + "time": "2022-05-30T19:17:29+00:00" }, { "name": "symfony/stopwatch", @@ -4164,16 +4165,16 @@ }, { "name": "symfony/string", - "version": "v5.4.9", + "version": "v5.4.10", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99" + "reference": "4432bc7df82a554b3e413a8570ce2fea90e94097" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", - "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", + "url": "https://api.github.com/repos/symfony/string/zipball/4432bc7df82a554b3e413a8570ce2fea90e94097", + "reference": "4432bc7df82a554b3e413a8570ce2fea90e94097", "shasum": "" }, "require": { @@ -4230,7 +4231,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.9" + "source": "https://github.com/symfony/string/tree/v5.4.10" }, "funding": [ { @@ -4246,7 +4247,7 @@ "type": "tidelift" } ], - "time": "2022-04-19T10:40:37+00:00" + "time": "2022-06-26T15:57:47+00:00" }, { "name": "theseer/tokenizer", @@ -4300,21 +4301,21 @@ }, { "name": "webmozart/assert", - "version": "1.10.0", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" + "ext-ctype": "*", + "php": "^7.2 || ^8.0" }, "conflict": { "phpstan/phpstan": "<0.12.20", @@ -4352,9 +4353,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" + "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, - "time": "2021-03-09T10:59:23+00:00" + "time": "2022-06-03T18:03:27+00:00" } ], "aliases": [], diff --git a/docs/Api/DeliveryApi.md b/docs/Api/DeliveryApi.md index e5aa773..66448cd 100644 --- a/docs/Api/DeliveryApi.md +++ b/docs/Api/DeliveryApi.md @@ -31,7 +31,7 @@ Method | HTTP request | Description [**createPriceTriggeredDeliveryOrder**](DeliveryApi.md#createPriceTriggeredDeliveryOrder) | **POST** /delivery/{settle}/price_orders | Create a price-triggered order [**cancelPriceTriggeredDeliveryOrderList**](DeliveryApi.md#cancelPriceTriggeredDeliveryOrderList) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders [**getPriceTriggeredDeliveryOrder**](DeliveryApi.md#getPriceTriggeredDeliveryOrder) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a single order -[**cancelPriceTriggeredDeliveryOrder**](DeliveryApi.md#cancelPriceTriggeredDeliveryOrder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel a single order +[**cancelPriceTriggeredDeliveryOrder**](DeliveryApi.md#cancelPriceTriggeredDeliveryOrder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order ## listDeliveryContracts @@ -1786,7 +1786,7 @@ Name | Type | Description | Notes > \GateApi\Model\FuturesPriceTriggeredOrder cancelPriceTriggeredDeliveryOrder($settle, $order_id) -Cancel a single order +cancel a price-triggered order ### Example diff --git a/docs/Api/FuturesApi.md b/docs/Api/FuturesApi.md index dc182d1..52a5138 100644 --- a/docs/Api/FuturesApi.md +++ b/docs/Api/FuturesApi.md @@ -40,7 +40,7 @@ Method | HTTP request | Description [**createPriceTriggeredOrder**](FuturesApi.md#createPriceTriggeredOrder) | **POST** /futures/{settle}/price_orders | Create a price-triggered order [**cancelPriceTriggeredOrderList**](FuturesApi.md#cancelPriceTriggeredOrderList) | **DELETE** /futures/{settle}/price_orders | Cancel all open orders [**getPriceTriggeredOrder**](FuturesApi.md#getPriceTriggeredOrder) | **GET** /futures/{settle}/price_orders/{order_id} | Get a single order -[**cancelPriceTriggeredOrder**](FuturesApi.md#cancelPriceTriggeredOrder) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel a single order +[**cancelPriceTriggeredOrder**](FuturesApi.md#cancelPriceTriggeredOrder) | **DELETE** /futures/{settle}/price_orders/{order_id} | cancel a price-triggered order ## listFuturesContracts @@ -2375,7 +2375,7 @@ Name | Type | Description | Notes > \GateApi\Model\FuturesPriceTriggeredOrder cancelPriceTriggeredOrder($settle, $order_id) -Cancel a single order +cancel a price-triggered order ### Example diff --git a/docs/Api/MarginApi.md b/docs/Api/MarginApi.md index b4ef42b..cb6da97 100644 --- a/docs/Api/MarginApi.md +++ b/docs/Api/MarginApi.md @@ -33,7 +33,7 @@ Method | HTTP request | Description [**createCrossMarginLoan**](MarginApi.md#createCrossMarginLoan) | **POST** /margin/cross/loans | Create a cross margin borrow loan [**getCrossMarginLoan**](MarginApi.md#getCrossMarginLoan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail [**listCrossMarginRepayments**](MarginApi.md#listCrossMarginRepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments -[**repayCrossMarginLoan**](MarginApi.md#repayCrossMarginLoan) | **POST** /margin/cross/repayments | Repay cross margin loan +[**repayCrossMarginLoan**](MarginApi.md#repayCrossMarginLoan) | **POST** /margin/cross/repayments | When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first [**getCrossMarginTransferable**](MarginApi.md#getCrossMarginTransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency [**getCrossMarginBorrowable**](MarginApi.md#getCrossMarginBorrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency @@ -1856,7 +1856,7 @@ Name | Type | Description | Notes > \GateApi\Model\CrossMarginLoan[] repayCrossMarginLoan($cross_margin_repay_request) -Repay cross margin loan +When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first ### Example diff --git a/docs/Api/OptionsApi.md b/docs/Api/OptionsApi.md index 6b88b0b..f13fb2f 100644 --- a/docs/Api/OptionsApi.md +++ b/docs/Api/OptionsApi.md @@ -10,6 +10,7 @@ Method | HTTP request | Description [**getOptionsContract**](OptionsApi.md#getOptionsContract) | **GET** /options/contracts/{contract} | Query specified contract detail [**listOptionsSettlements**](OptionsApi.md#listOptionsSettlements) | **GET** /options/settlements | List settlement history [**getOptionsSettlement**](OptionsApi.md#getOptionsSettlement) | **GET** /options/settlements/{contract} | Get specified contract's settlement +[**listMyOptionsSettlements**](OptionsApi.md#listMyOptionsSettlements) | **GET** /options/my_settlements | List my options settlements [**listOptionsOrderBook**](OptionsApi.md#listOptionsOrderBook) | **GET** /options/order_book | Futures order book [**listOptionsTickers**](OptionsApi.md#listOptionsTickers) | **GET** /options/tickers | List tickers of options contracts [**listOptionsUnderlyingTickers**](OptionsApi.md#listOptionsUnderlyingTickers) | **GET** /options/underlying/tickers/{underlying} | Get underlying ticker @@ -379,6 +380,78 @@ No authorization required [[Back to README]](../../README.md) +## listMyOptionsSettlements + +> \GateApi\Model\OptionsMySettlements[] listMyOptionsSettlements($underlying, $contract, $limit, $offset, $from, $to) + +List my options settlements + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\OptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying +$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Contract name +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['offset'] = 0; // int | List offset, starting from 0 +$associate_array['from'] = 1547706332; // int | Start timestamp +$associate_array['to'] = 1547706332; // int | End timestamp + +try { + $result = $apiInstance->listMyOptionsSettlements($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling OptionsApi->listMyOptionsSettlements: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **string**| Underlying | + **contract** | **string**| Contract name | [optional] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **from** | **int**| Start timestamp | [optional] + **to** | **int**| End timestamp | [optional] + +### Return type + +[**\GateApi\Model\OptionsMySettlements[]**](../Model/OptionsMySettlements.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listOptionsOrderBook > \GateApi\Model\FuturesOrderBook listOptionsOrderBook($contract, $interval, $limit, $with_id) diff --git a/docs/Api/SpotApi.md b/docs/Api/SpotApi.md index e81efef..b62203d 100644 --- a/docs/Api/SpotApi.md +++ b/docs/Api/SpotApi.md @@ -16,6 +16,7 @@ Method | HTTP request | Description [**listSpotAccounts**](SpotApi.md#listSpotAccounts) | **GET** /spot/accounts | List spot accounts [**createBatchOrders**](SpotApi.md#createBatchOrders) | **POST** /spot/batch_orders | Create a batch of orders [**listAllOpenOrders**](SpotApi.md#listAllOpenOrders) | **GET** /spot/open_orders | List all open orders +[**createCrossLiquidateOrder**](SpotApi.md#createCrossLiquidateOrder) | **POST** /spot/cross_liquidate_orders | close position when cross-currency is disabled [**listOrders**](SpotApi.md#listOrders) | **GET** /spot/orders | List orders [**createOrder**](SpotApi.md#createOrder) | **POST** /spot/orders | Create an order [**cancelOrders**](SpotApi.md#cancelOrders) | **DELETE** /spot/orders | Cancel all `open` orders in specified currency pair @@ -23,11 +24,12 @@ Method | HTTP request | Description [**getOrder**](SpotApi.md#getOrder) | **GET** /spot/orders/{order_id} | Get a single order [**cancelOrder**](SpotApi.md#cancelOrder) | **DELETE** /spot/orders/{order_id} | Cancel a single order [**listMyTrades**](SpotApi.md#listMyTrades) | **GET** /spot/my_trades | List personal trading history +[**getSystemTime**](SpotApi.md#getSystemTime) | **GET** /spot/time | Get server current time [**listSpotPriceTriggeredOrders**](SpotApi.md#listSpotPriceTriggeredOrders) | **GET** /spot/price_orders | Retrieve running auto order list [**createSpotPriceTriggeredOrder**](SpotApi.md#createSpotPriceTriggeredOrder) | **POST** /spot/price_orders | Create a price-triggered order [**cancelSpotPriceTriggeredOrderList**](SpotApi.md#cancelSpotPriceTriggeredOrderList) | **DELETE** /spot/price_orders | Cancel all open orders [**getSpotPriceTriggeredOrder**](SpotApi.md#getSpotPriceTriggeredOrder) | **GET** /spot/price_orders/{order_id} | Get a single order -[**cancelSpotPriceTriggeredOrder**](SpotApi.md#cancelSpotPriceTriggeredOrder) | **DELETE** /spot/price_orders/{order_id} | Cancel a single order +[**cancelSpotPriceTriggeredOrder**](SpotApi.md#cancelSpotPriceTriggeredOrder) | **DELETE** /spot/price_orders/{order_id} | cancel a price-triggered order ## listCurrencies @@ -250,7 +252,7 @@ No authorization required ## listTickers -> \GateApi\Model\Ticker[] listTickers($currency_pair) +> \GateApi\Model\Ticker[] listTickers($currency_pair, $timezone) Retrieve ticker information @@ -269,6 +271,7 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client() ); $associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair +$associate_array['timezone'] = 'utc0'; // string | Timezone try { $result = $apiInstance->listTickers($associate_array); @@ -289,6 +292,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **string**| Currency pair | [optional] + **timezone** | **string**| Timezone | [optional] ### Return type @@ -728,7 +732,7 @@ $apiInstance = new GateApi\Api\SpotApi( ); $associate_array['page'] = 1; // int | Page number $associate_array['limit'] = 100; // int | Maximum number of records returned in one page in each currency pair -$associate_array['account'] = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account +$associate_array['account'] = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only try { $result = $apiInstance->listAllOpenOrders($associate_array); @@ -750,7 +754,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **page** | **int**| Page number | [optional] [default to 1] **limit** | **int**| Maximum number of records returned in one page in each currency pair | [optional] [default to 100] - **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] + **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] ### Return type @@ -770,6 +774,68 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## createCrossLiquidateOrder + +> \GateApi\Model\Order createCrossLiquidateOrder($liquidate_order) + +close position when cross-currency is disabled + +Currently, only cross-margin accounts are supported to close position when cross currencies are disabled. Maximum buy quantity = (unpaid principal and interest - currency balance - the amount of the currency in the order book) / 0.998 + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SpotApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$liquidate_order = new \GateApi\Model\LiquidateOrder(); // \GateApi\Model\LiquidateOrder | + +try { + $result = $apiInstance->createCrossLiquidateOrder($liquidate_order); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SpotApi->createCrossLiquidateOrder: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **liquidate_order** | [**\GateApi\Model\LiquidateOrder**](../Model/LiquidateOrder.md)| | + +### Return type + +[**\GateApi\Model\Order**](../Model/Order.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listOrders > \GateApi\Model\Order[] listOrders($currency_pair, $status, $page, $limit, $account, $from, $to, $side) @@ -798,7 +864,7 @@ $associate_array['currency_pair'] = 'BTC_USDT'; // string | Retrieve results wit $associate_array['status'] = 'open'; // string | List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled $associate_array['page'] = 1; // int | Page number $associate_array['limit'] = 100; // int | Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 -$associate_array['account'] = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account +$associate_array['account'] = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only $associate_array['from'] = 1627706330; // int | Start timestamp of the query $associate_array['to'] = 1635329650; // int | Time range ending, default to current time $associate_array['side'] = 'sell'; // string | All bids or asks. Both included if not specified @@ -825,7 +891,7 @@ Name | Type | Description | Notes **status** | **string**| List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled | **page** | **int**| Page number | [optional] [default to 1] **limit** | **int**| Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 | [optional] [default to 100] - **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] + **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] **from** | **int**| Start timestamp of the query | [optional] **to** | **int**| Time range ending, default to current time | [optional] **side** | **string**| All bids or asks. Both included if not specified | [optional] @@ -936,7 +1002,7 @@ $apiInstance = new GateApi\Api\SpotApi( ); $currency_pair = 'BTC_USDT'; // string | Currency pair $side = 'sell'; // string | All bids or asks. Both included if not specified -$account = 'spot'; // string | Specify account type. Default to all account types being included +$account = 'spot'; // string | Specify account type - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only try { $result = $apiInstance->cancelOrders($currency_pair, $side, $account); @@ -956,7 +1022,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **string**| Currency pair | **side** | **string**| All bids or asks. Both included if not specified | [optional] - **account** | **string**| Specify account type. Default to all account types being included | [optional] + **account** | **string**| Specify account type - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only | [optional] ### Return type @@ -1044,7 +1110,7 @@ Name | Type | Description | Notes Get a single order -Spot and margin orders are queried by default. If cross margin orders are needed, `account` must be set to `cross_margin` +Spot and margin orders are queried by default. If cross margin orders are needed or portfolio margin account are used, account must be set to cross_margin. ### Example @@ -1064,7 +1130,7 @@ $apiInstance = new GateApi\Api\SpotApi( ); $order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. $currency_pair = 'BTC_USDT'; // string | Currency pair -$account = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account +$account = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only try { $result = $apiInstance->getOrder($order_id, $currency_pair, $account); @@ -1084,7 +1150,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | **currency_pair** | **string**| Currency pair | - **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] + **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] ### Return type @@ -1110,7 +1176,7 @@ Name | Type | Description | Notes Cancel a single order -Spot and margin orders are cancelled by default. If trying to cancel cross margin orders, `account` must be set to `cross_margin` +Spot and margin orders are cancelled by default. If trying to cancel cross margin orders or portfolio margin account are used, account must be set to cross_margin ### Example @@ -1130,7 +1196,7 @@ $apiInstance = new GateApi\Api\SpotApi( ); $order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. $currency_pair = 'BTC_USDT'; // string | Currency pair -$account = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account +$account = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only try { $result = $apiInstance->cancelOrder($order_id, $currency_pair, $account); @@ -1150,7 +1216,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | **currency_pair** | **string**| Currency pair | - **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] + **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] ### Return type @@ -1198,7 +1264,7 @@ $associate_array['currency_pair'] = 'BTC_USDT'; // string | Retrieve results wit $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['page'] = 1; // int | Page number $associate_array['order_id'] = '12345'; // string | Filter trades with specified order ID. `currency_pair` is also required if this field is present -$associate_array['account'] = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account +$associate_array['account'] = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only $associate_array['from'] = 1627706330; // int | Start timestamp of the query $associate_array['to'] = 1635329650; // int | Time range ending, default to current time @@ -1224,7 +1290,7 @@ Name | Type | Description | Notes **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **page** | **int**| Page number | [optional] [default to 1] **order_id** | **string**| Filter trades with specified order ID. `currency_pair` is also required if this field is present | [optional] - **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] + **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] **from** | **int**| Start timestamp of the query | [optional] **to** | **int**| Time range ending, default to current time | [optional] @@ -1246,6 +1312,58 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## getSystemTime + +> \GateApi\Model\SystemTime getSystemTime() + +Get server current time + +### Example + +```php +getSystemTime(); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SpotApi->getSystemTime: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\GateApi\Model\SystemTime**](../Model/SystemTime.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listSpotPriceTriggeredOrders > \GateApi\Model\SpotPriceTriggeredOrder[] listSpotPriceTriggeredOrders($status, $market, $account, $limit, $offset) @@ -1502,7 +1620,7 @@ Name | Type | Description | Notes > \GateApi\Model\SpotPriceTriggeredOrder cancelSpotPriceTriggeredOrder($order_id) -Cancel a single order +cancel a price-triggered order ### Example diff --git a/docs/Model/CancelOrder.md b/docs/Model/CancelOrder.md index c2c88c6..7c878ea 100644 --- a/docs/Model/CancelOrder.md +++ b/docs/Model/CancelOrder.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency_pair** | **string** | Order currency pair | **id** | **string** | Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation | -**account** | **string** | If cancelled order is cross margin order, this field must be set and can only be `cross_margin` | [optional] +**account** | **string** | If cancelled order is cross margin order or is portfolio margin account's API key, this field must be set and can only be `cross_margin`If cancelled order is cross margin order, this field must be set and can only be `cross_margin` | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CrossMarginAccount.md b/docs/Model/CrossMarginAccount.md index 8f57db4..df81b8e 100644 --- a/docs/Model/CrossMarginAccount.md +++ b/docs/Model/CrossMarginAccount.md @@ -11,5 +11,11 @@ Name | Type | Description | Notes **borrowed** | **string** | Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` | [optional] **interest** | **string** | Total unpaid interests in USDT, i.e., the sum of all currencies' `interest*price*discount` | [optional] **risk** | **string** | Risk rate. When it belows 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` | [optional] +**total_initial_margin** | **string** | Total initial margin | [optional] +**total_margin_balance** | **string** | Total margin balance | [optional] +**total_maintenance_margin** | **string** | Total maintenance margin | [optional] +**total_initial_margin_rate** | **string** | Total initial margin rate | [optional] +**total_maintenance_margin_rate** | **string** | Total maintenance margin rate | [optional] +**total_available_margin** | **string** | Total available margin | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CrossMarginCurrency.md b/docs/Model/CrossMarginCurrency.md index 222b353..c6eeef1 100644 --- a/docs/Model/CrossMarginCurrency.md +++ b/docs/Model/CrossMarginCurrency.md @@ -12,5 +12,6 @@ Name | Type | Description | Notes **user_max_borrow_amount** | **string** | Maximum borrow value allowed per user, in USDT | [optional] **total_max_borrow_amount** | **string** | Maximum borrow value allowed for this currency, in USDT | [optional] **price** | **string** | Price change between this currency and USDT | [optional] +**status** | **int** | status - `0` : disable - `1` : enable | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesAccount.md b/docs/Model/FuturesAccount.md index b630546..808f568 100644 --- a/docs/Model/FuturesAccount.md +++ b/docs/Model/FuturesAccount.md @@ -4,13 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total** | **string** | Total assets, total = position_margin + order_margin + available | [optional] +**total** | **string** | total = position_margin + order_margin + available | [optional] **unrealised_pnl** | **string** | Unrealized PNL | [optional] **position_margin** | **string** | Position margin | [optional] **order_margin** | **string** | Order margin of unfinished orders | [optional] -**available** | **string** | Available balance to transfer out or trade | [optional] +**available** | **string** | The available balance for transferring or trading | [optional] **point** | **string** | POINT amount | [optional] **currency** | **string** | Settle currency | [optional] **in_dual_mode** | **bool** | Whether dual mode is enabled | [optional] +**enable_credit** | **bool** | Whether portfolio margin account mode is enabled | [optional] +**position_initial_margin** | **string** | Initial margin position, applicable to the portfolio margin account model | [optional] +**maintenance_margin** | **string** | Maintenance margin position, applicable to the portfolio margin account model | [optional] +**bonus** | **string** | Perpetual Contract Bonus | [optional] +**history** | [**\GateApi\Model\FuturesAccountHistory**](FuturesAccountHistory.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesAccountHistory.md b/docs/Model/FuturesAccountHistory.md new file mode 100644 index 0000000..290d09e --- /dev/null +++ b/docs/Model/FuturesAccountHistory.md @@ -0,0 +1,18 @@ +# # FuturesAccountHistory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dnw** | **string** | total amount of deposit and withdraw | [optional] +**pnl** | **string** | total amount of trading profit and loss | [optional] +**fee** | **string** | total amount of fee | [optional] +**refr** | **string** | total amount of referrer rebates | [optional] +**fund** | **string** | total amount of funding costs | [optional] +**point_dnw** | **string** | total amount of point deposit and withdraw | [optional] +**point_fee** | **string** | total amount of point fee | [optional] +**point_refr** | **string** | total amount of referrer rebates of point fee | [optional] +**bonus_dnw** | **string** | total amount of perpetual contract bonus transfer | [optional] +**bonus_offset** | **string** | total amount of perpetual contract bonus deduction | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LiquidateOrder.md b/docs/Model/LiquidateOrder.md new file mode 100644 index 0000000..9a1089b --- /dev/null +++ b/docs/Model/LiquidateOrder.md @@ -0,0 +1,12 @@ +# # LiquidateOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**text** | **string** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional] +**currency_pair** | **string** | Currency pair | +**amount** | **string** | Trade amount | +**price** | **string** | Order price | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MyFuturesTrade.md b/docs/Model/MyFuturesTrade.md index 1dbc14d..ff7e4a5 100644 --- a/docs/Model/MyFuturesTrade.md +++ b/docs/Model/MyFuturesTrade.md @@ -11,5 +11,8 @@ Name | Type | Description | Notes **size** | **int** | Trading size | [optional] **price** | **string** | Trading price | [optional] **role** | **string** | Trade role. Available values are `taker` and `maker` | [optional] +**text** | **string** | User defined information | [optional] +**fee** | **string** | Fee deducted | [optional] +**point_fee** | **string** | Points used to deduct fee | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsContract.md b/docs/Model/OptionsContract.md index db9dcd2..efe3fd7 100644 --- a/docs/Model/OptionsContract.md +++ b/docs/Model/OptionsContract.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Futures contract | [optional] -**tag** | **string** | 标记 | [optional] +**tag** | **string** | tag | [optional] **create_time** | **double** | Creation time | [optional] **expiration_time** | **double** | Expiration time | [optional] **is_call** | **bool** | `true` means call options, while `false` is put options | [optional] diff --git a/docs/Model/OptionsMySettlements.md b/docs/Model/OptionsMySettlements.md new file mode 100644 index 0000000..d52305f --- /dev/null +++ b/docs/Model/OptionsMySettlements.md @@ -0,0 +1,17 @@ +# # OptionsMySettlements + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **double** | Settlement time | [optional] +**underlying** | **string** | Underlying | [optional] +**contract** | **string** | Futures contract | [optional] +**strike_price** | **string** | Strike price | [optional] +**settle_price** | **string** | settlement price | [optional] +**size** | **int** | Size | [optional] +**settle_profit** | **string** | Settlement profit | [optional] +**fee** | **string** | Fee | [optional] +**realised_pnl** | **string** | The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Order.md b/docs/Model/Order.md index 4af1fed..a4979a4 100644 --- a/docs/Model/Order.md +++ b/docs/Model/Order.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **status** | **string** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] **currency_pair** | **string** | Currency pair | **type** | **string** | Order type. limit - limit order | [optional] [default to 'limit'] -**account** | **string** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account | [optional] [default to 'spot'] +**account** | **string** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account. Portfolio margin account must set to `cross-margin` | [optional] [default to 'spot'] **side** | **string** | Order side | **amount** | **string** | Trade amount | **price** | **string** | Order price | diff --git a/docs/Model/Position.md b/docs/Model/Position.md index 14fc72f..71bb937 100644 --- a/docs/Model/Position.md +++ b/docs/Model/Position.md @@ -16,6 +16,8 @@ Name | Type | Description | Notes **entry_price** | **string** | Entry price | [optional] [readonly] **liq_price** | **string** | Liquidation price | [optional] [readonly] **mark_price** | **string** | Current mark price | [optional] [readonly] +**initial_margin** | **string** | The initial margin occupied by the position, applicable to the portfolio margin account | [optional] [readonly] +**maintenance_margin** | **string** | Maintenance margin required for the position, applicable to portfolio margin account | [optional] [readonly] **unrealised_pnl** | **string** | Unrealized PNL | [optional] [readonly] **realised_pnl** | **string** | Realized PNL | [optional] [readonly] **history_pnl** | **string** | History realized PNL | [optional] [readonly] diff --git a/docs/Model/SubAccountTransfer.md b/docs/Model/SubAccountTransfer.md index 8cfbf5d..3ee0166 100644 --- a/docs/Model/SubAccountTransfer.md +++ b/docs/Model/SubAccountTransfer.md @@ -11,6 +11,6 @@ Name | Type | Description | Notes **uid** | **string** | Main account user ID | [optional] [readonly] **timest** | **string** | Transfer timestamp | [optional] [readonly] **source** | **string** | Where the operation is initiated from | [optional] [readonly] -**sub_account_type** | **string** | Target sub user's account. `spot` - spot account, `futures` - perpetual contract account | [optional] [default to 'spot'] +**sub_account_type** | **string** | Target sub user's account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account | [optional] [default to 'spot'] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SystemTime.md b/docs/Model/SystemTime.md new file mode 100644 index 0000000..fb397a4 --- /dev/null +++ b/docs/Model/SystemTime.md @@ -0,0 +1,9 @@ +# # SystemTime + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**server_time** | **int** | Server current time(ms) | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Ticker.md b/docs/Model/Ticker.md index 6f46125..b051559 100644 --- a/docs/Model/Ticker.md +++ b/docs/Model/Ticker.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **lowest_ask** | **string** | Recent lowest ask | [optional] **highest_bid** | **string** | Recent highest bid | [optional] **change_percentage** | **string** | Change percentage in the last 24h | [optional] +**change_utc0** | **string** | utc0 timezone, the percentage change in the last 24 hours | [optional] +**change_utc8** | **string** | utc8 timezone, the percentage change in the last 24 hours | [optional] **base_volume** | **string** | Base currency trade volume in the last 24h | [optional] **quote_volume** | **string** | Quote currency trade volume in the last 24h | [optional] **high_24h** | **string** | Highest price in 24h | [optional] diff --git a/src/Api/DeliveryApi.php b/src/Api/DeliveryApi.php index 1b91f83..60a7548 100644 --- a/src/Api/DeliveryApi.php +++ b/src/Api/DeliveryApi.php @@ -7959,7 +7959,7 @@ protected function getPriceTriggeredDeliveryOrderRequest($settle, $order_id) /** * Operation cancelPriceTriggeredDeliveryOrder * - * Cancel a single order + * cancel a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) @@ -7977,7 +7977,7 @@ public function cancelPriceTriggeredDeliveryOrder($settle, $order_id) /** * Operation cancelPriceTriggeredDeliveryOrderWithHttpInfo * - * Cancel a single order + * cancel a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) @@ -8032,7 +8032,7 @@ public function cancelPriceTriggeredDeliveryOrderWithHttpInfo($settle, $order_id /** * Operation cancelPriceTriggeredDeliveryOrderAsync * - * Cancel a single order + * cancel a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) @@ -8053,7 +8053,7 @@ function ($response) { /** * Operation cancelPriceTriggeredDeliveryOrderAsyncWithHttpInfo * - * Cancel a single order + * cancel a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) diff --git a/src/Api/FuturesApi.php b/src/Api/FuturesApi.php index e2fbd41..fc73ab9 100644 --- a/src/Api/FuturesApi.php +++ b/src/Api/FuturesApi.php @@ -10632,7 +10632,7 @@ protected function getPriceTriggeredOrderRequest($settle, $order_id) /** * Operation cancelPriceTriggeredOrder * - * Cancel a single order + * cancel a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) @@ -10650,7 +10650,7 @@ public function cancelPriceTriggeredOrder($settle, $order_id) /** * Operation cancelPriceTriggeredOrderWithHttpInfo * - * Cancel a single order + * cancel a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) @@ -10705,7 +10705,7 @@ public function cancelPriceTriggeredOrderWithHttpInfo($settle, $order_id) /** * Operation cancelPriceTriggeredOrderAsync * - * Cancel a single order + * cancel a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) @@ -10726,7 +10726,7 @@ function ($response) { /** * Operation cancelPriceTriggeredOrderAsyncWithHttpInfo * - * Cancel a single order + * cancel a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) diff --git a/src/Api/MarginApi.php b/src/Api/MarginApi.php index 5b52763..3cfbf0f 100644 --- a/src/Api/MarginApi.php +++ b/src/Api/MarginApi.php @@ -7834,7 +7834,7 @@ protected function listCrossMarginRepaymentsRequest($associative_array) /** * Operation repayCrossMarginLoan * - * Repay cross margin loan + * When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first * * @param \GateApi\Model\CrossMarginRepayRequest $cross_margin_repay_request cross_margin_repay_request (required) * @@ -7851,7 +7851,7 @@ public function repayCrossMarginLoan($cross_margin_repay_request) /** * Operation repayCrossMarginLoanWithHttpInfo * - * Repay cross margin loan + * When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first * * @param \GateApi\Model\CrossMarginRepayRequest $cross_margin_repay_request (required) * @@ -7905,7 +7905,7 @@ public function repayCrossMarginLoanWithHttpInfo($cross_margin_repay_request) /** * Operation repayCrossMarginLoanAsync * - * Repay cross margin loan + * When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first * * @param \GateApi\Model\CrossMarginRepayRequest $cross_margin_repay_request (required) * @@ -7925,7 +7925,7 @@ function ($response) { /** * Operation repayCrossMarginLoanAsyncWithHttpInfo * - * Repay cross margin loan + * When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first * * @param \GateApi\Model\CrossMarginRepayRequest $cross_margin_repay_request (required) * diff --git a/src/Api/OptionsApi.php b/src/Api/OptionsApi.php index 800ae55..40232e1 100644 --- a/src/Api/OptionsApi.php +++ b/src/Api/OptionsApi.php @@ -1692,6 +1692,363 @@ protected function getOptionsSettlementRequest($contract, $underlying, $at) ); } + /** + * Operation listMyOptionsSettlements + * + * List my options settlements + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\OptionsMySettlements[] + */ + public function listMyOptionsSettlements($associative_array) + { + list($response) = $this->listMyOptionsSettlementsWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listMyOptionsSettlementsWithHttpInfo + * + * List my options settlements + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\OptionsMySettlements[], HTTP status code, HTTP response headers (array of strings) + */ + public function listMyOptionsSettlementsWithHttpInfo($associative_array) + { + $request = $this->listMyOptionsSettlementsRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\OptionsMySettlements[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listMyOptionsSettlementsAsync + * + * List my options settlements + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listMyOptionsSettlementsAsync($associative_array) + { + return $this->listMyOptionsSettlementsAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listMyOptionsSettlementsAsyncWithHttpInfo + * + * List my options settlements + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listMyOptionsSettlementsAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\OptionsMySettlements[]'; + $request = $this->listMyOptionsSettlementsRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listMyOptionsSettlements' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $underlying Underlying (required) + * @param string $contract Contract name (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listMyOptionsSettlementsRequest($associative_array) + { + // unbox the parameters from the associative array + $underlying = array_key_exists('underlying', $associative_array) ? $associative_array['underlying'] : null; + $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + + // verify the required parameter 'underlying' is set + if ($underlying === null || (is_array($underlying) && count($underlying) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $underlying when calling listMyOptionsSettlements' + ); + } + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listMyOptionsSettlements, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsApi.listMyOptionsSettlements, must be bigger than or equal to 1.'); + } + + if ($offset !== null && $offset < 0) { + throw new \InvalidArgumentException('invalid value for "$offset" when calling OptionsApi.listMyOptionsSettlements, must be bigger than or equal to 0.'); + } + + + $resourcePath = '/options/my_settlements'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($underlying !== null) { + if('form' === 'form' && is_array($underlying)) { + foreach($underlying as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['underlying'] = $underlying; + } + } + + // query params + if ($contract !== null) { + if('form' === 'form' && is_array($contract)) { + foreach($contract as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contract'] = $contract; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($offset !== null) { + if('form' === 'form' && is_array($offset)) { + foreach($offset as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['offset'] = $offset; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listOptionsOrderBook * diff --git a/src/Api/SpotApi.php b/src/Api/SpotApi.php index 107fa91..04d0d50 100644 --- a/src/Api/SpotApi.php +++ b/src/Api/SpotApi.php @@ -1019,6 +1019,7 @@ protected function getCurrencyPairRequest($currency_pair) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (optional) + * @param string $timezone Timezone (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1038,6 +1039,7 @@ public function listTickers($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (optional) + * @param string $timezone Timezone (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1094,6 +1096,7 @@ public function listTickersWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (optional) + * @param string $timezone Timezone (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1116,6 +1119,7 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (optional) + * @param string $timezone Timezone (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1165,6 +1169,7 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (optional) + * @param string $timezone Timezone (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1173,6 +1178,7 @@ protected function listTickersRequest($associative_array) { // unbox the parameters from the associative array $currency_pair = array_key_exists('currency_pair', $associative_array) ? $associative_array['currency_pair'] : null; + $timezone = array_key_exists('timezone', $associative_array) ? $associative_array['timezone'] : null; $resourcePath = '/spot/tickers'; @@ -1194,6 +1200,18 @@ protected function listTickersRequest($associative_array) } } + // query params + if ($timezone !== null) { + if('form' === 'form' && is_array($timezone)) { + foreach($timezone as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['timezone'] = $timezone; + } + } + // body params $_tempBody = null; @@ -3013,7 +3031,7 @@ protected function createBatchOrdersRequest($order) * * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records returned in one page in each currency pair (optional, default to 100) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3034,7 +3052,7 @@ public function listAllOpenOrders($associative_array) * * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records returned in one page in each currency pair (optional, default to 100) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3092,7 +3110,7 @@ public function listAllOpenOrdersWithHttpInfo($associative_array) * * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records returned in one page in each currency pair (optional, default to 100) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3116,7 +3134,7 @@ function ($response) { * * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records returned in one page in each currency pair (optional, default to 100) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3167,7 +3185,7 @@ function ($exception) { * * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records returned in one page in each currency pair (optional, default to 100) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -3301,6 +3319,240 @@ protected function listAllOpenOrdersRequest($associative_array) ); } + /** + * Operation createCrossLiquidateOrder + * + * close position when cross-currency is disabled + * + * @param \GateApi\Model\LiquidateOrder $liquidate_order liquidate_order (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\Order + */ + public function createCrossLiquidateOrder($liquidate_order) + { + list($response) = $this->createCrossLiquidateOrderWithHttpInfo($liquidate_order); + return $response; + } + + /** + * Operation createCrossLiquidateOrderWithHttpInfo + * + * close position when cross-currency is disabled + * + * @param \GateApi\Model\LiquidateOrder $liquidate_order (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\Order, HTTP status code, HTTP response headers (array of strings) + */ + public function createCrossLiquidateOrderWithHttpInfo($liquidate_order) + { + $request = $this->createCrossLiquidateOrderRequest($liquidate_order); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\Order'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation createCrossLiquidateOrderAsync + * + * close position when cross-currency is disabled + * + * @param \GateApi\Model\LiquidateOrder $liquidate_order (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createCrossLiquidateOrderAsync($liquidate_order) + { + return $this->createCrossLiquidateOrderAsyncWithHttpInfo($liquidate_order) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createCrossLiquidateOrderAsyncWithHttpInfo + * + * close position when cross-currency is disabled + * + * @param \GateApi\Model\LiquidateOrder $liquidate_order (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createCrossLiquidateOrderAsyncWithHttpInfo($liquidate_order) + { + $returnType = '\GateApi\Model\Order'; + $request = $this->createCrossLiquidateOrderRequest($liquidate_order); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createCrossLiquidateOrder' + * + * @param \GateApi\Model\LiquidateOrder $liquidate_order (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createCrossLiquidateOrderRequest($liquidate_order) + { + // verify the required parameter 'liquidate_order' is set + if ($liquidate_order === null || (is_array($liquidate_order) && count($liquidate_order) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $liquidate_order when calling createCrossLiquidateOrder' + ); + } + + $resourcePath = '/spot/cross_liquidate_orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + if (isset($liquidate_order)) { + $_tempBody = $liquidate_order; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('POST', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listOrders * @@ -3312,7 +3564,7 @@ protected function listAllOpenOrdersRequest($associative_array) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param string $side All bids or asks. Both included if not specified (optional) @@ -3338,7 +3590,7 @@ public function listOrders($associative_array) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param string $side All bids or asks. Both included if not specified (optional) @@ -3401,7 +3653,7 @@ public function listOrdersWithHttpInfo($associative_array) * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param string $side All bids or asks. Both included if not specified (optional) @@ -3430,7 +3682,7 @@ function ($response) { * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param string $side All bids or asks. Both included if not specified (optional) @@ -3486,7 +3738,7 @@ function ($exception) { * @param string $status List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) * @param int $page Page number (optional, default to 1) * @param int $limit Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional, default to 100) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @param string $side All bids or asks. Both included if not specified (optional) @@ -3941,7 +4193,8 @@ protected function createOrderRequest($order) * * @param string $currency_pair Currency pair (required) * @param string $side All bids or asks. Both included if not specified (optional) - * @param string $account Specify account type. Default to all account types being included (optional) + * @param string $account Specify account type - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only + * (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3960,7 +4213,8 @@ public function cancelOrders($currency_pair, $side = null, $account = null) * * @param string $currency_pair Currency pair (required) * @param string $side All bids or asks. Both included if not specified (optional) - * @param string $account Specify account type. Default to all account types being included (optional) + * @param string $account Specify account type - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only + * (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -4016,7 +4270,8 @@ public function cancelOrdersWithHttpInfo($currency_pair, $side = null, $account * * @param string $currency_pair Currency pair (required) * @param string $side All bids or asks. Both included if not specified (optional) - * @param string $account Specify account type. Default to all account types being included (optional) + * @param string $account Specify account type - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only + * (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -4038,7 +4293,8 @@ function ($response) { * * @param string $currency_pair Currency pair (required) * @param string $side All bids or asks. Both included if not specified (optional) - * @param string $account Specify account type. Default to all account types being included (optional) + * @param string $account Specify account type - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only + * (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -4087,7 +4343,8 @@ function ($exception) { * * @param string $currency_pair Currency pair (required) * @param string $side All bids or asks. Both included if not specified (optional) - * @param string $account Specify account type. Default to all account types being included (optional) + * @param string $account Specify account type - classic account:Default to all account types being included - portfolio margin account:`cross_margin` only + * (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -4452,7 +4709,7 @@ protected function cancelBatchOrdersRequest($cancel_order) * * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -4471,7 +4728,7 @@ public function getOrder($order_id, $currency_pair, $account = null) * * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -4527,7 +4784,7 @@ public function getOrderWithHttpInfo($order_id, $currency_pair, $account = null) * * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -4549,7 +4806,7 @@ function ($response) { * * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -4598,7 +4855,7 @@ function ($exception) { * * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -4732,7 +4989,7 @@ protected function getOrderRequest($order_id, $currency_pair, $account = null) * * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -4751,7 +5008,7 @@ public function cancelOrder($order_id, $currency_pair, $account = null) * * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -4807,7 +5064,7 @@ public function cancelOrderWithHttpInfo($order_id, $currency_pair, $account = nu * * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -4829,7 +5086,7 @@ function ($response) { * * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -4878,7 +5135,7 @@ function ($exception) { * * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -5016,7 +5273,7 @@ protected function cancelOrderRequest($order_id, $currency_pair, $account = null * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @@ -5041,7 +5298,7 @@ public function listMyTrades($associative_array) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @@ -5103,7 +5360,7 @@ public function listMyTradesWithHttpInfo($associative_array) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @@ -5131,7 +5388,7 @@ function ($response) { * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @@ -5186,7 +5443,7 @@ function ($exception) { * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) - * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @param int $from Start timestamp of the query (optional) * @param int $to Time range ending, default to current time (optional) * @@ -5380,6 +5637,218 @@ protected function listMyTradesRequest($associative_array) ); } + /** + * Operation getSystemTime + * + * Get server current time + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\SystemTime + */ + public function getSystemTime() + { + list($response) = $this->getSystemTimeWithHttpInfo(); + return $response; + } + + /** + * Operation getSystemTimeWithHttpInfo + * + * Get server current time + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\SystemTime, HTTP status code, HTTP response headers (array of strings) + */ + public function getSystemTimeWithHttpInfo() + { + $request = $this->getSystemTimeRequest(); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\SystemTime'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getSystemTimeAsync + * + * Get server current time + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSystemTimeAsync() + { + return $this->getSystemTimeAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSystemTimeAsyncWithHttpInfo + * + * Get server current time + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSystemTimeAsyncWithHttpInfo() + { + $returnType = '\GateApi\Model\SystemTime'; + $request = $this->getSystemTimeRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSystemTime' + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getSystemTimeRequest() + { + + $resourcePath = '/spot/time'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listSpotPriceTriggeredOrders * @@ -6450,7 +6919,7 @@ protected function getSpotPriceTriggeredOrderRequest($order_id) /** * Operation cancelSpotPriceTriggeredOrder * - * Cancel a single order + * cancel a price-triggered order * * @param string $order_id Retrieve the data of the order with the specified ID (required) * @@ -6467,7 +6936,7 @@ public function cancelSpotPriceTriggeredOrder($order_id) /** * Operation cancelSpotPriceTriggeredOrderWithHttpInfo * - * Cancel a single order + * cancel a price-triggered order * * @param string $order_id Retrieve the data of the order with the specified ID (required) * @@ -6521,7 +6990,7 @@ public function cancelSpotPriceTriggeredOrderWithHttpInfo($order_id) /** * Operation cancelSpotPriceTriggeredOrderAsync * - * Cancel a single order + * cancel a price-triggered order * * @param string $order_id Retrieve the data of the order with the specified ID (required) * @@ -6541,7 +7010,7 @@ function ($response) { /** * Operation cancelSpotPriceTriggeredOrderAsyncWithHttpInfo * - * Cancel a single order + * cancel a price-triggered order * * @param string $order_id Retrieve the data of the order with the specified ID (required) * diff --git a/src/Configuration.php b/src/Configuration.php index 5f04f06..6474eaa 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.24.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.25.1/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.24.0' . PHP_EOL; - $report .= ' SDK Package Version: 5.24.0' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.25.1' . PHP_EOL; + $report .= ' SDK Package Version: 5.25.1' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/CancelOrder.php b/src/Model/CancelOrder.php index 5d26d33..16e7218 100644 --- a/src/Model/CancelOrder.php +++ b/src/Model/CancelOrder.php @@ -281,7 +281,7 @@ public function getAccount() /** * Sets account * - * @param string|null $account If cancelled order is cross margin order, this field must be set and can only be `cross_margin` + * @param string|null $account If cancelled order is cross margin order or is portfolio margin account's API key, this field must be set and can only be `cross_margin`If cancelled order is cross margin order, this field must be set and can only be `cross_margin` * * @return $this */ diff --git a/src/Model/CrossMarginAccount.php b/src/Model/CrossMarginAccount.php index f0734bf..dde090a 100644 --- a/src/Model/CrossMarginAccount.php +++ b/src/Model/CrossMarginAccount.php @@ -60,7 +60,13 @@ class CrossMarginAccount implements ModelInterface, ArrayAccess 'total' => 'string', 'borrowed' => 'string', 'interest' => 'string', - 'risk' => 'string' + 'risk' => 'string', + 'total_initial_margin' => 'string', + 'total_margin_balance' => 'string', + 'total_maintenance_margin' => 'string', + 'total_initial_margin_rate' => 'string', + 'total_maintenance_margin_rate' => 'string', + 'total_available_margin' => 'string' ]; /** @@ -75,7 +81,13 @@ class CrossMarginAccount implements ModelInterface, ArrayAccess 'total' => null, 'borrowed' => null, 'interest' => null, - 'risk' => null + 'risk' => null, + 'total_initial_margin' => null, + 'total_margin_balance' => null, + 'total_maintenance_margin' => null, + 'total_initial_margin_rate' => null, + 'total_maintenance_margin_rate' => null, + 'total_available_margin' => null ]; /** @@ -111,7 +123,13 @@ public static function openAPIFormats() 'total' => 'total', 'borrowed' => 'borrowed', 'interest' => 'interest', - 'risk' => 'risk' + 'risk' => 'risk', + 'total_initial_margin' => 'total_initial_margin', + 'total_margin_balance' => 'total_margin_balance', + 'total_maintenance_margin' => 'total_maintenance_margin', + 'total_initial_margin_rate' => 'total_initial_margin_rate', + 'total_maintenance_margin_rate' => 'total_maintenance_margin_rate', + 'total_available_margin' => 'total_available_margin' ]; /** @@ -126,7 +144,13 @@ public static function openAPIFormats() 'total' => 'setTotal', 'borrowed' => 'setBorrowed', 'interest' => 'setInterest', - 'risk' => 'setRisk' + 'risk' => 'setRisk', + 'total_initial_margin' => 'setTotalInitialMargin', + 'total_margin_balance' => 'setTotalMarginBalance', + 'total_maintenance_margin' => 'setTotalMaintenanceMargin', + 'total_initial_margin_rate' => 'setTotalInitialMarginRate', + 'total_maintenance_margin_rate' => 'setTotalMaintenanceMarginRate', + 'total_available_margin' => 'setTotalAvailableMargin' ]; /** @@ -141,7 +165,13 @@ public static function openAPIFormats() 'total' => 'getTotal', 'borrowed' => 'getBorrowed', 'interest' => 'getInterest', - 'risk' => 'getRisk' + 'risk' => 'getRisk', + 'total_initial_margin' => 'getTotalInitialMargin', + 'total_margin_balance' => 'getTotalMarginBalance', + 'total_maintenance_margin' => 'getTotalMaintenanceMargin', + 'total_initial_margin_rate' => 'getTotalInitialMarginRate', + 'total_maintenance_margin_rate' => 'getTotalMaintenanceMarginRate', + 'total_available_margin' => 'getTotalAvailableMargin' ]; /** @@ -211,6 +241,12 @@ public function __construct(array $data = null) $this->container['borrowed'] = isset($data['borrowed']) ? $data['borrowed'] : null; $this->container['interest'] = isset($data['interest']) ? $data['interest'] : null; $this->container['risk'] = isset($data['risk']) ? $data['risk'] : null; + $this->container['total_initial_margin'] = isset($data['total_initial_margin']) ? $data['total_initial_margin'] : null; + $this->container['total_margin_balance'] = isset($data['total_margin_balance']) ? $data['total_margin_balance'] : null; + $this->container['total_maintenance_margin'] = isset($data['total_maintenance_margin']) ? $data['total_maintenance_margin'] : null; + $this->container['total_initial_margin_rate'] = isset($data['total_initial_margin_rate']) ? $data['total_initial_margin_rate'] : null; + $this->container['total_maintenance_margin_rate'] = isset($data['total_maintenance_margin_rate']) ? $data['total_maintenance_margin_rate'] : null; + $this->container['total_available_margin'] = isset($data['total_available_margin']) ? $data['total_available_margin'] : null; } /** @@ -404,6 +440,150 @@ public function setRisk($risk) return $this; } + + /** + * Gets total_initial_margin + * + * @return string|null + */ + public function getTotalInitialMargin() + { + return $this->container['total_initial_margin']; + } + + /** + * Sets total_initial_margin + * + * @param string|null $total_initial_margin Total initial margin + * + * @return $this + */ + public function setTotalInitialMargin($total_initial_margin) + { + $this->container['total_initial_margin'] = $total_initial_margin; + + return $this; + } + + /** + * Gets total_margin_balance + * + * @return string|null + */ + public function getTotalMarginBalance() + { + return $this->container['total_margin_balance']; + } + + /** + * Sets total_margin_balance + * + * @param string|null $total_margin_balance Total margin balance + * + * @return $this + */ + public function setTotalMarginBalance($total_margin_balance) + { + $this->container['total_margin_balance'] = $total_margin_balance; + + return $this; + } + + /** + * Gets total_maintenance_margin + * + * @return string|null + */ + public function getTotalMaintenanceMargin() + { + return $this->container['total_maintenance_margin']; + } + + /** + * Sets total_maintenance_margin + * + * @param string|null $total_maintenance_margin Total maintenance margin + * + * @return $this + */ + public function setTotalMaintenanceMargin($total_maintenance_margin) + { + $this->container['total_maintenance_margin'] = $total_maintenance_margin; + + return $this; + } + + /** + * Gets total_initial_margin_rate + * + * @return string|null + */ + public function getTotalInitialMarginRate() + { + return $this->container['total_initial_margin_rate']; + } + + /** + * Sets total_initial_margin_rate + * + * @param string|null $total_initial_margin_rate Total initial margin rate + * + * @return $this + */ + public function setTotalInitialMarginRate($total_initial_margin_rate) + { + $this->container['total_initial_margin_rate'] = $total_initial_margin_rate; + + return $this; + } + + /** + * Gets total_maintenance_margin_rate + * + * @return string|null + */ + public function getTotalMaintenanceMarginRate() + { + return $this->container['total_maintenance_margin_rate']; + } + + /** + * Sets total_maintenance_margin_rate + * + * @param string|null $total_maintenance_margin_rate Total maintenance margin rate + * + * @return $this + */ + public function setTotalMaintenanceMarginRate($total_maintenance_margin_rate) + { + $this->container['total_maintenance_margin_rate'] = $total_maintenance_margin_rate; + + return $this; + } + + /** + * Gets total_available_margin + * + * @return string|null + */ + public function getTotalAvailableMargin() + { + return $this->container['total_available_margin']; + } + + /** + * Sets total_available_margin + * + * @param string|null $total_available_margin Total available margin + * + * @return $this + */ + public function setTotalAvailableMargin($total_available_margin) + { + $this->container['total_available_margin'] = $total_available_margin; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/CrossMarginCurrency.php b/src/Model/CrossMarginCurrency.php index e8184fb..e79a424 100644 --- a/src/Model/CrossMarginCurrency.php +++ b/src/Model/CrossMarginCurrency.php @@ -61,7 +61,8 @@ class CrossMarginCurrency implements ModelInterface, ArrayAccess 'min_borrow_amount' => 'string', 'user_max_borrow_amount' => 'string', 'total_max_borrow_amount' => 'string', - 'price' => 'string' + 'price' => 'string', + 'status' => 'int' ]; /** @@ -77,7 +78,8 @@ class CrossMarginCurrency implements ModelInterface, ArrayAccess 'min_borrow_amount' => null, 'user_max_borrow_amount' => null, 'total_max_borrow_amount' => null, - 'price' => null + 'price' => null, + 'status' => null ]; /** @@ -114,7 +116,8 @@ public static function openAPIFormats() 'min_borrow_amount' => 'min_borrow_amount', 'user_max_borrow_amount' => 'user_max_borrow_amount', 'total_max_borrow_amount' => 'total_max_borrow_amount', - 'price' => 'price' + 'price' => 'price', + 'status' => 'status' ]; /** @@ -130,7 +133,8 @@ public static function openAPIFormats() 'min_borrow_amount' => 'setMinBorrowAmount', 'user_max_borrow_amount' => 'setUserMaxBorrowAmount', 'total_max_borrow_amount' => 'setTotalMaxBorrowAmount', - 'price' => 'setPrice' + 'price' => 'setPrice', + 'status' => 'setStatus' ]; /** @@ -146,7 +150,8 @@ public static function openAPIFormats() 'min_borrow_amount' => 'getMinBorrowAmount', 'user_max_borrow_amount' => 'getUserMaxBorrowAmount', 'total_max_borrow_amount' => 'getTotalMaxBorrowAmount', - 'price' => 'getPrice' + 'price' => 'getPrice', + 'status' => 'getStatus' ]; /** @@ -217,6 +222,7 @@ public function __construct(array $data = null) $this->container['user_max_borrow_amount'] = isset($data['user_max_borrow_amount']) ? $data['user_max_borrow_amount'] : null; $this->container['total_max_borrow_amount'] = isset($data['total_max_borrow_amount']) ? $data['total_max_borrow_amount'] : null; $this->container['price'] = isset($data['price']) ? $data['price'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; } /** @@ -434,6 +440,30 @@ public function setPrice($price) return $this; } + + /** + * Gets status + * + * @return int|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int|null $status status - `0` : disable - `1` : enable + * + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/FuturesAccount.php b/src/Model/FuturesAccount.php index 00904e9..6e762e8 100644 --- a/src/Model/FuturesAccount.php +++ b/src/Model/FuturesAccount.php @@ -61,7 +61,12 @@ class FuturesAccount implements ModelInterface, ArrayAccess 'available' => 'string', 'point' => 'string', 'currency' => 'string', - 'in_dual_mode' => 'bool' + 'in_dual_mode' => 'bool', + 'enable_credit' => 'bool', + 'position_initial_margin' => 'string', + 'maintenance_margin' => 'string', + 'bonus' => 'string', + 'history' => '\GateApi\Model\FuturesAccountHistory' ]; /** @@ -77,7 +82,12 @@ class FuturesAccount implements ModelInterface, ArrayAccess 'available' => null, 'point' => null, 'currency' => null, - 'in_dual_mode' => null + 'in_dual_mode' => null, + 'enable_credit' => null, + 'position_initial_margin' => null, + 'maintenance_margin' => null, + 'bonus' => null, + 'history' => null ]; /** @@ -114,7 +124,12 @@ public static function openAPIFormats() 'available' => 'available', 'point' => 'point', 'currency' => 'currency', - 'in_dual_mode' => 'in_dual_mode' + 'in_dual_mode' => 'in_dual_mode', + 'enable_credit' => 'enable_credit', + 'position_initial_margin' => 'position_initial_margin', + 'maintenance_margin' => 'maintenance_margin', + 'bonus' => 'bonus', + 'history' => 'history' ]; /** @@ -130,7 +145,12 @@ public static function openAPIFormats() 'available' => 'setAvailable', 'point' => 'setPoint', 'currency' => 'setCurrency', - 'in_dual_mode' => 'setInDualMode' + 'in_dual_mode' => 'setInDualMode', + 'enable_credit' => 'setEnableCredit', + 'position_initial_margin' => 'setPositionInitialMargin', + 'maintenance_margin' => 'setMaintenanceMargin', + 'bonus' => 'setBonus', + 'history' => 'setHistory' ]; /** @@ -146,7 +166,12 @@ public static function openAPIFormats() 'available' => 'getAvailable', 'point' => 'getPoint', 'currency' => 'getCurrency', - 'in_dual_mode' => 'getInDualMode' + 'in_dual_mode' => 'getInDualMode', + 'enable_credit' => 'getEnableCredit', + 'position_initial_margin' => 'getPositionInitialMargin', + 'maintenance_margin' => 'getMaintenanceMargin', + 'bonus' => 'getBonus', + 'history' => 'getHistory' ]; /** @@ -217,6 +242,11 @@ public function __construct(array $data = null) $this->container['point'] = isset($data['point']) ? $data['point'] : null; $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; $this->container['in_dual_mode'] = isset($data['in_dual_mode']) ? $data['in_dual_mode'] : null; + $this->container['enable_credit'] = isset($data['enable_credit']) ? $data['enable_credit'] : null; + $this->container['position_initial_margin'] = isset($data['position_initial_margin']) ? $data['position_initial_margin'] : null; + $this->container['maintenance_margin'] = isset($data['maintenance_margin']) ? $data['maintenance_margin'] : null; + $this->container['bonus'] = isset($data['bonus']) ? $data['bonus'] : null; + $this->container['history'] = isset($data['history']) ? $data['history'] : null; } /** @@ -256,7 +286,7 @@ public function getTotal() /** * Sets total * - * @param string|null $total Total assets, total = position_margin + order_margin + available + * @param string|null $total total = position_margin + order_margin + available * * @return $this */ @@ -352,7 +382,7 @@ public function getAvailable() /** * Sets available * - * @param string|null $available Available balance to transfer out or trade + * @param string|null $available The available balance for transferring or trading * * @return $this */ @@ -434,6 +464,126 @@ public function setInDualMode($in_dual_mode) return $this; } + + /** + * Gets enable_credit + * + * @return bool|null + */ + public function getEnableCredit() + { + return $this->container['enable_credit']; + } + + /** + * Sets enable_credit + * + * @param bool|null $enable_credit Whether portfolio margin account mode is enabled + * + * @return $this + */ + public function setEnableCredit($enable_credit) + { + $this->container['enable_credit'] = $enable_credit; + + return $this; + } + + /** + * Gets position_initial_margin + * + * @return string|null + */ + public function getPositionInitialMargin() + { + return $this->container['position_initial_margin']; + } + + /** + * Sets position_initial_margin + * + * @param string|null $position_initial_margin Initial margin position, applicable to the portfolio margin account model + * + * @return $this + */ + public function setPositionInitialMargin($position_initial_margin) + { + $this->container['position_initial_margin'] = $position_initial_margin; + + return $this; + } + + /** + * Gets maintenance_margin + * + * @return string|null + */ + public function getMaintenanceMargin() + { + return $this->container['maintenance_margin']; + } + + /** + * Sets maintenance_margin + * + * @param string|null $maintenance_margin Maintenance margin position, applicable to the portfolio margin account model + * + * @return $this + */ + public function setMaintenanceMargin($maintenance_margin) + { + $this->container['maintenance_margin'] = $maintenance_margin; + + return $this; + } + + /** + * Gets bonus + * + * @return string|null + */ + public function getBonus() + { + return $this->container['bonus']; + } + + /** + * Sets bonus + * + * @param string|null $bonus Perpetual Contract Bonus + * + * @return $this + */ + public function setBonus($bonus) + { + $this->container['bonus'] = $bonus; + + return $this; + } + + /** + * Gets history + * + * @return \GateApi\Model\FuturesAccountHistory|null + */ + public function getHistory() + { + return $this->container['history']; + } + + /** + * Sets history + * + * @param \GateApi\Model\FuturesAccountHistory|null $history history + * + * @return $this + */ + public function setHistory($history) + { + $this->container['history'] = $history; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/FuturesAccountHistory.php b/src/Model/FuturesAccountHistory.php new file mode 100644 index 0000000..9cd2d06 --- /dev/null +++ b/src/Model/FuturesAccountHistory.php @@ -0,0 +1,576 @@ + 'string', + 'pnl' => 'string', + 'fee' => 'string', + 'refr' => 'string', + 'fund' => 'string', + 'point_dnw' => 'string', + 'point_fee' => 'string', + 'point_refr' => 'string', + 'bonus_dnw' => 'string', + 'bonus_offset' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'dnw' => null, + 'pnl' => null, + 'fee' => null, + 'refr' => null, + 'fund' => null, + 'point_dnw' => null, + 'point_fee' => null, + 'point_refr' => null, + 'bonus_dnw' => null, + 'bonus_offset' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'dnw' => 'dnw', + 'pnl' => 'pnl', + 'fee' => 'fee', + 'refr' => 'refr', + 'fund' => 'fund', + 'point_dnw' => 'point_dnw', + 'point_fee' => 'point_fee', + 'point_refr' => 'point_refr', + 'bonus_dnw' => 'bonus_dnw', + 'bonus_offset' => 'bonus_offset' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dnw' => 'setDnw', + 'pnl' => 'setPnl', + 'fee' => 'setFee', + 'refr' => 'setRefr', + 'fund' => 'setFund', + 'point_dnw' => 'setPointDnw', + 'point_fee' => 'setPointFee', + 'point_refr' => 'setPointRefr', + 'bonus_dnw' => 'setBonusDnw', + 'bonus_offset' => 'setBonusOffset' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dnw' => 'getDnw', + 'pnl' => 'getPnl', + 'fee' => 'getFee', + 'refr' => 'getRefr', + 'fund' => 'getFund', + 'point_dnw' => 'getPointDnw', + 'point_fee' => 'getPointFee', + 'point_refr' => 'getPointRefr', + 'bonus_dnw' => 'getBonusDnw', + 'bonus_offset' => 'getBonusOffset' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['dnw'] = isset($data['dnw']) ? $data['dnw'] : null; + $this->container['pnl'] = isset($data['pnl']) ? $data['pnl'] : null; + $this->container['fee'] = isset($data['fee']) ? $data['fee'] : null; + $this->container['refr'] = isset($data['refr']) ? $data['refr'] : null; + $this->container['fund'] = isset($data['fund']) ? $data['fund'] : null; + $this->container['point_dnw'] = isset($data['point_dnw']) ? $data['point_dnw'] : null; + $this->container['point_fee'] = isset($data['point_fee']) ? $data['point_fee'] : null; + $this->container['point_refr'] = isset($data['point_refr']) ? $data['point_refr'] : null; + $this->container['bonus_dnw'] = isset($data['bonus_dnw']) ? $data['bonus_dnw'] : null; + $this->container['bonus_offset'] = isset($data['bonus_offset']) ? $data['bonus_offset'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets dnw + * + * @return string|null + */ + public function getDnw() + { + return $this->container['dnw']; + } + + /** + * Sets dnw + * + * @param string|null $dnw total amount of deposit and withdraw + * + * @return $this + */ + public function setDnw($dnw) + { + $this->container['dnw'] = $dnw; + + return $this; + } + + /** + * Gets pnl + * + * @return string|null + */ + public function getPnl() + { + return $this->container['pnl']; + } + + /** + * Sets pnl + * + * @param string|null $pnl total amount of trading profit and loss + * + * @return $this + */ + public function setPnl($pnl) + { + $this->container['pnl'] = $pnl; + + return $this; + } + + /** + * Gets fee + * + * @return string|null + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param string|null $fee total amount of fee + * + * @return $this + */ + public function setFee($fee) + { + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets refr + * + * @return string|null + */ + public function getRefr() + { + return $this->container['refr']; + } + + /** + * Sets refr + * + * @param string|null $refr total amount of referrer rebates + * + * @return $this + */ + public function setRefr($refr) + { + $this->container['refr'] = $refr; + + return $this; + } + + /** + * Gets fund + * + * @return string|null + */ + public function getFund() + { + return $this->container['fund']; + } + + /** + * Sets fund + * + * @param string|null $fund total amount of funding costs + * + * @return $this + */ + public function setFund($fund) + { + $this->container['fund'] = $fund; + + return $this; + } + + /** + * Gets point_dnw + * + * @return string|null + */ + public function getPointDnw() + { + return $this->container['point_dnw']; + } + + /** + * Sets point_dnw + * + * @param string|null $point_dnw total amount of point deposit and withdraw + * + * @return $this + */ + public function setPointDnw($point_dnw) + { + $this->container['point_dnw'] = $point_dnw; + + return $this; + } + + /** + * Gets point_fee + * + * @return string|null + */ + public function getPointFee() + { + return $this->container['point_fee']; + } + + /** + * Sets point_fee + * + * @param string|null $point_fee total amount of point fee + * + * @return $this + */ + public function setPointFee($point_fee) + { + $this->container['point_fee'] = $point_fee; + + return $this; + } + + /** + * Gets point_refr + * + * @return string|null + */ + public function getPointRefr() + { + return $this->container['point_refr']; + } + + /** + * Sets point_refr + * + * @param string|null $point_refr total amount of referrer rebates of point fee + * + * @return $this + */ + public function setPointRefr($point_refr) + { + $this->container['point_refr'] = $point_refr; + + return $this; + } + + /** + * Gets bonus_dnw + * + * @return string|null + */ + public function getBonusDnw() + { + return $this->container['bonus_dnw']; + } + + /** + * Sets bonus_dnw + * + * @param string|null $bonus_dnw total amount of perpetual contract bonus transfer + * + * @return $this + */ + public function setBonusDnw($bonus_dnw) + { + $this->container['bonus_dnw'] = $bonus_dnw; + + return $this; + } + + /** + * Gets bonus_offset + * + * @return string|null + */ + public function getBonusOffset() + { + return $this->container['bonus_offset']; + } + + /** + * Sets bonus_offset + * + * @param string|null $bonus_offset total amount of perpetual contract bonus deduction + * + * @return $this + */ + public function setBonusOffset($bonus_offset) + { + $this->container['bonus_offset'] = $bonus_offset; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LiquidateOrder.php b/src/Model/LiquidateOrder.php new file mode 100644 index 0000000..06cfd45 --- /dev/null +++ b/src/Model/LiquidateOrder.php @@ -0,0 +1,405 @@ + 'string', + 'currency_pair' => 'string', + 'amount' => 'string', + 'price' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'text' => null, + 'currency_pair' => null, + 'amount' => null, + 'price' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'text' => 'text', + 'currency_pair' => 'currency_pair', + 'amount' => 'amount', + 'price' => 'price' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'text' => 'setText', + 'currency_pair' => 'setCurrencyPair', + 'amount' => 'setAmount', + 'price' => 'setPrice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'text' => 'getText', + 'currency_pair' => 'getCurrencyPair', + 'amount' => 'getAmount', + 'price' => 'getPrice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['text'] = isset($data['text']) ? $data['text'] : null; + $this->container['currency_pair'] = isset($data['currency_pair']) ? $data['currency_pair'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['price'] = isset($data['price']) ? $data['price'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency_pair'] === null) { + $invalidProperties[] = "'currency_pair' can't be null"; + } + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['price'] === null) { + $invalidProperties[] = "'price' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets text + * + * @return string|null + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string|null $text User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) + * + * @return $this + */ + public function setText($text) + { + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets currency_pair + * + * @return string + */ + public function getCurrencyPair() + { + return $this->container['currency_pair']; + } + + /** + * Sets currency_pair + * + * @param string $currency_pair Currency pair + * + * @return $this + */ + public function setCurrencyPair($currency_pair) + { + $this->container['currency_pair'] = $currency_pair; + + return $this; + } + + /** + * Gets amount + * + * @return string + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string $amount Trade amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets price + * + * @return string + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param string $price Order price + * + * @return $this + */ + public function setPrice($price) + { + $this->container['price'] = $price; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/MyFuturesTrade.php b/src/Model/MyFuturesTrade.php index 441bf11..bc9e14f 100644 --- a/src/Model/MyFuturesTrade.php +++ b/src/Model/MyFuturesTrade.php @@ -60,7 +60,10 @@ class MyFuturesTrade implements ModelInterface, ArrayAccess 'order_id' => 'string', 'size' => 'int', 'price' => 'string', - 'role' => 'string' + 'role' => 'string', + 'text' => 'string', + 'fee' => 'string', + 'point_fee' => 'string' ]; /** @@ -75,7 +78,10 @@ class MyFuturesTrade implements ModelInterface, ArrayAccess 'order_id' => null, 'size' => 'int64', 'price' => null, - 'role' => null + 'role' => null, + 'text' => null, + 'fee' => null, + 'point_fee' => null ]; /** @@ -111,7 +117,10 @@ public static function openAPIFormats() 'order_id' => 'order_id', 'size' => 'size', 'price' => 'price', - 'role' => 'role' + 'role' => 'role', + 'text' => 'text', + 'fee' => 'fee', + 'point_fee' => 'point_fee' ]; /** @@ -126,7 +135,10 @@ public static function openAPIFormats() 'order_id' => 'setOrderId', 'size' => 'setSize', 'price' => 'setPrice', - 'role' => 'setRole' + 'role' => 'setRole', + 'text' => 'setText', + 'fee' => 'setFee', + 'point_fee' => 'setPointFee' ]; /** @@ -141,7 +153,10 @@ public static function openAPIFormats() 'order_id' => 'getOrderId', 'size' => 'getSize', 'price' => 'getPrice', - 'role' => 'getRole' + 'role' => 'getRole', + 'text' => 'getText', + 'fee' => 'getFee', + 'point_fee' => 'getPointFee' ]; /** @@ -226,6 +241,9 @@ public function __construct(array $data = null) $this->container['size'] = isset($data['size']) ? $data['size'] : null; $this->container['price'] = isset($data['price']) ? $data['price'] : null; $this->container['role'] = isset($data['role']) ? $data['role'] : null; + $this->container['text'] = isset($data['text']) ? $data['text'] : null; + $this->container['fee'] = isset($data['fee']) ? $data['fee'] : null; + $this->container['point_fee'] = isset($data['point_fee']) ? $data['point_fee'] : null; } /** @@ -436,6 +454,78 @@ public function setRole($role) return $this; } + + /** + * Gets text + * + * @return string|null + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string|null $text User defined information + * + * @return $this + */ + public function setText($text) + { + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets fee + * + * @return string|null + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param string|null $fee Fee deducted + * + * @return $this + */ + public function setFee($fee) + { + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets point_fee + * + * @return string|null + */ + public function getPointFee() + { + return $this->container['point_fee']; + } + + /** + * Sets point_fee + * + * @param string|null $point_fee Points used to deduct fee + * + * @return $this + */ + public function setPointFee($point_fee) + { + $this->container['point_fee'] = $point_fee; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/OptionsContract.php b/src/Model/OptionsContract.php index 508ec1a..8f17367 100644 --- a/src/Model/OptionsContract.php +++ b/src/Model/OptionsContract.php @@ -383,7 +383,7 @@ public function getTag() /** * Sets tag * - * @param string|null $tag 标记 + * @param string|null $tag tag * * @return $this */ diff --git a/src/Model/OptionsMySettlements.php b/src/Model/OptionsMySettlements.php new file mode 100644 index 0000000..803c8dd --- /dev/null +++ b/src/Model/OptionsMySettlements.php @@ -0,0 +1,545 @@ + 'double', + 'underlying' => 'string', + 'contract' => 'string', + 'strike_price' => 'string', + 'settle_price' => 'string', + 'size' => 'int', + 'settle_profit' => 'string', + 'fee' => 'string', + 'realised_pnl' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'time' => 'double', + 'underlying' => null, + 'contract' => null, + 'strike_price' => null, + 'settle_price' => null, + 'size' => 'int64', + 'settle_profit' => null, + 'fee' => null, + 'realised_pnl' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'time' => 'time', + 'underlying' => 'underlying', + 'contract' => 'contract', + 'strike_price' => 'strike_price', + 'settle_price' => 'settle_price', + 'size' => 'size', + 'settle_profit' => 'settle_profit', + 'fee' => 'fee', + 'realised_pnl' => 'realised_pnl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'time' => 'setTime', + 'underlying' => 'setUnderlying', + 'contract' => 'setContract', + 'strike_price' => 'setStrikePrice', + 'settle_price' => 'setSettlePrice', + 'size' => 'setSize', + 'settle_profit' => 'setSettleProfit', + 'fee' => 'setFee', + 'realised_pnl' => 'setRealisedPnl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'time' => 'getTime', + 'underlying' => 'getUnderlying', + 'contract' => 'getContract', + 'strike_price' => 'getStrikePrice', + 'settle_price' => 'getSettlePrice', + 'size' => 'getSize', + 'settle_profit' => 'getSettleProfit', + 'fee' => 'getFee', + 'realised_pnl' => 'getRealisedPnl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['underlying'] = isset($data['underlying']) ? $data['underlying'] : null; + $this->container['contract'] = isset($data['contract']) ? $data['contract'] : null; + $this->container['strike_price'] = isset($data['strike_price']) ? $data['strike_price'] : null; + $this->container['settle_price'] = isset($data['settle_price']) ? $data['settle_price'] : null; + $this->container['size'] = isset($data['size']) ? $data['size'] : null; + $this->container['settle_profit'] = isset($data['settle_profit']) ? $data['settle_profit'] : null; + $this->container['fee'] = isset($data['fee']) ? $data['fee'] : null; + $this->container['realised_pnl'] = isset($data['realised_pnl']) ? $data['realised_pnl'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets time + * + * @return double|null + */ + public function getTime() + { + return $this->container['time']; + } + + /** + * Sets time + * + * @param double|null $time Settlement time + * + * @return $this + */ + public function setTime($time) + { + $this->container['time'] = $time; + + return $this; + } + + /** + * Gets underlying + * + * @return string|null + */ + public function getUnderlying() + { + return $this->container['underlying']; + } + + /** + * Sets underlying + * + * @param string|null $underlying Underlying + * + * @return $this + */ + public function setUnderlying($underlying) + { + $this->container['underlying'] = $underlying; + + return $this; + } + + /** + * Gets contract + * + * @return string|null + */ + public function getContract() + { + return $this->container['contract']; + } + + /** + * Sets contract + * + * @param string|null $contract Futures contract + * + * @return $this + */ + public function setContract($contract) + { + $this->container['contract'] = $contract; + + return $this; + } + + /** + * Gets strike_price + * + * @return string|null + */ + public function getStrikePrice() + { + return $this->container['strike_price']; + } + + /** + * Sets strike_price + * + * @param string|null $strike_price Strike price + * + * @return $this + */ + public function setStrikePrice($strike_price) + { + $this->container['strike_price'] = $strike_price; + + return $this; + } + + /** + * Gets settle_price + * + * @return string|null + */ + public function getSettlePrice() + { + return $this->container['settle_price']; + } + + /** + * Sets settle_price + * + * @param string|null $settle_price settlement price + * + * @return $this + */ + public function setSettlePrice($settle_price) + { + $this->container['settle_price'] = $settle_price; + + return $this; + } + + /** + * Gets size + * + * @return int|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int|null $size Size + * + * @return $this + */ + public function setSize($size) + { + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets settle_profit + * + * @return string|null + */ + public function getSettleProfit() + { + return $this->container['settle_profit']; + } + + /** + * Sets settle_profit + * + * @param string|null $settle_profit Settlement profit + * + * @return $this + */ + public function setSettleProfit($settle_profit) + { + $this->container['settle_profit'] = $settle_profit; + + return $this; + } + + /** + * Gets fee + * + * @return string|null + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param string|null $fee Fee + * + * @return $this + */ + public function setFee($fee) + { + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets realised_pnl + * + * @return string|null + */ + public function getRealisedPnl() + { + return $this->container['realised_pnl']; + } + + /** + * Sets realised_pnl + * + * @param string|null $realised_pnl The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. + * + * @return $this + */ + public function setRealisedPnl($realised_pnl) + { + $this->container['realised_pnl'] = $realised_pnl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Order.php b/src/Model/Order.php index 9f2f5bb..ccaa786 100644 --- a/src/Model/Order.php +++ b/src/Model/Order.php @@ -738,7 +738,7 @@ public function getAccount() /** * Sets account * - * @param string|null $account Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account + * @param string|null $account Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account. Portfolio margin account must set to `cross-margin` * * @return $this */ diff --git a/src/Model/Position.php b/src/Model/Position.php index 664faa8..d2c8bc7 100644 --- a/src/Model/Position.php +++ b/src/Model/Position.php @@ -67,6 +67,8 @@ class Position implements ModelInterface, ArrayAccess 'entry_price' => 'string', 'liq_price' => 'string', 'mark_price' => 'string', + 'initial_margin' => 'string', + 'maintenance_margin' => 'string', 'unrealised_pnl' => 'string', 'realised_pnl' => 'string', 'history_pnl' => 'string', @@ -98,6 +100,8 @@ class Position implements ModelInterface, ArrayAccess 'entry_price' => null, 'liq_price' => null, 'mark_price' => null, + 'initial_margin' => null, + 'maintenance_margin' => null, 'unrealised_pnl' => null, 'realised_pnl' => null, 'history_pnl' => null, @@ -150,6 +154,8 @@ public static function openAPIFormats() 'entry_price' => 'entry_price', 'liq_price' => 'liq_price', 'mark_price' => 'mark_price', + 'initial_margin' => 'initial_margin', + 'maintenance_margin' => 'maintenance_margin', 'unrealised_pnl' => 'unrealised_pnl', 'realised_pnl' => 'realised_pnl', 'history_pnl' => 'history_pnl', @@ -181,6 +187,8 @@ public static function openAPIFormats() 'entry_price' => 'setEntryPrice', 'liq_price' => 'setLiqPrice', 'mark_price' => 'setMarkPrice', + 'initial_margin' => 'setInitialMargin', + 'maintenance_margin' => 'setMaintenanceMargin', 'unrealised_pnl' => 'setUnrealisedPnl', 'realised_pnl' => 'setRealisedPnl', 'history_pnl' => 'setHistoryPnl', @@ -212,6 +220,8 @@ public static function openAPIFormats() 'entry_price' => 'getEntryPrice', 'liq_price' => 'getLiqPrice', 'mark_price' => 'getMarkPrice', + 'initial_margin' => 'getInitialMargin', + 'maintenance_margin' => 'getMaintenanceMargin', 'unrealised_pnl' => 'getUnrealisedPnl', 'realised_pnl' => 'getRealisedPnl', 'history_pnl' => 'getHistoryPnl', @@ -314,6 +324,8 @@ public function __construct(array $data = null) $this->container['entry_price'] = isset($data['entry_price']) ? $data['entry_price'] : null; $this->container['liq_price'] = isset($data['liq_price']) ? $data['liq_price'] : null; $this->container['mark_price'] = isset($data['mark_price']) ? $data['mark_price'] : null; + $this->container['initial_margin'] = isset($data['initial_margin']) ? $data['initial_margin'] : null; + $this->container['maintenance_margin'] = isset($data['maintenance_margin']) ? $data['maintenance_margin'] : null; $this->container['unrealised_pnl'] = isset($data['unrealised_pnl']) ? $data['unrealised_pnl'] : null; $this->container['realised_pnl'] = isset($data['realised_pnl']) ? $data['realised_pnl'] : null; $this->container['history_pnl'] = isset($data['history_pnl']) ? $data['history_pnl'] : null; @@ -647,6 +659,54 @@ public function setMarkPrice($mark_price) return $this; } + /** + * Gets initial_margin + * + * @return string|null + */ + public function getInitialMargin() + { + return $this->container['initial_margin']; + } + + /** + * Sets initial_margin + * + * @param string|null $initial_margin The initial margin occupied by the position, applicable to the portfolio margin account + * + * @return $this + */ + public function setInitialMargin($initial_margin) + { + $this->container['initial_margin'] = $initial_margin; + + return $this; + } + + /** + * Gets maintenance_margin + * + * @return string|null + */ + public function getMaintenanceMargin() + { + return $this->container['maintenance_margin']; + } + + /** + * Sets maintenance_margin + * + * @param string|null $maintenance_margin Maintenance margin required for the position, applicable to portfolio margin account + * + * @return $this + */ + public function setMaintenanceMargin($maintenance_margin) + { + $this->container['maintenance_margin'] = $maintenance_margin; + + return $this; + } + /** * Gets unrealised_pnl * diff --git a/src/Model/SubAccountTransfer.php b/src/Model/SubAccountTransfer.php index 883fdcd..8e82988 100644 --- a/src/Model/SubAccountTransfer.php +++ b/src/Model/SubAccountTransfer.php @@ -194,6 +194,7 @@ public function getModelName() const DIRECTION_FROM = 'from'; const SUB_ACCOUNT_TYPE_SPOT = 'spot'; const SUB_ACCOUNT_TYPE_FUTURES = 'futures'; + const SUB_ACCOUNT_TYPE_CROSS_MARGIN = 'cross_margin'; @@ -220,6 +221,7 @@ public function getSubAccountTypeAllowableValues() return [ self::SUB_ACCOUNT_TYPE_SPOT, self::SUB_ACCOUNT_TYPE_FUTURES, + self::SUB_ACCOUNT_TYPE_CROSS_MARGIN, ]; } @@ -491,7 +493,7 @@ public function getSubAccountType() /** * Sets sub_account_type * - * @param string|null $sub_account_type Target sub user's account. `spot` - spot account, `futures` - perpetual contract account + * @param string|null $sub_account_type Target sub user's account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account * * @return $this */ diff --git a/src/Model/SystemTime.php b/src/Model/SystemTime.php new file mode 100644 index 0000000..a8610df --- /dev/null +++ b/src/Model/SystemTime.php @@ -0,0 +1,305 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'server_time' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'server_time' => 'server_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'server_time' => 'setServerTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'server_time' => 'getServerTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['server_time'] = isset($data['server_time']) ? $data['server_time'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets server_time + * + * @return int|null + */ + public function getServerTime() + { + return $this->container['server_time']; + } + + /** + * Sets server_time + * + * @param int|null $server_time Server current time(ms) + * + * @return $this + */ + public function setServerTime($server_time) + { + $this->container['server_time'] = $server_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Ticker.php b/src/Model/Ticker.php index c169edd..0643706 100644 --- a/src/Model/Ticker.php +++ b/src/Model/Ticker.php @@ -59,6 +59,8 @@ class Ticker implements ModelInterface, ArrayAccess 'lowest_ask' => 'string', 'highest_bid' => 'string', 'change_percentage' => 'string', + 'change_utc0' => 'string', + 'change_utc8' => 'string', 'base_volume' => 'string', 'quote_volume' => 'string', 'high_24h' => 'string', @@ -80,6 +82,8 @@ class Ticker implements ModelInterface, ArrayAccess 'lowest_ask' => null, 'highest_bid' => null, 'change_percentage' => null, + 'change_utc0' => null, + 'change_utc8' => null, 'base_volume' => null, 'quote_volume' => null, 'high_24h' => null, @@ -122,6 +126,8 @@ public static function openAPIFormats() 'lowest_ask' => 'lowest_ask', 'highest_bid' => 'highest_bid', 'change_percentage' => 'change_percentage', + 'change_utc0' => 'change_utc0', + 'change_utc8' => 'change_utc8', 'base_volume' => 'base_volume', 'quote_volume' => 'quote_volume', 'high_24h' => 'high_24h', @@ -143,6 +149,8 @@ public static function openAPIFormats() 'lowest_ask' => 'setLowestAsk', 'highest_bid' => 'setHighestBid', 'change_percentage' => 'setChangePercentage', + 'change_utc0' => 'setChangeUtc0', + 'change_utc8' => 'setChangeUtc8', 'base_volume' => 'setBaseVolume', 'quote_volume' => 'setQuoteVolume', 'high_24h' => 'setHigh24h', @@ -164,6 +172,8 @@ public static function openAPIFormats() 'lowest_ask' => 'getLowestAsk', 'highest_bid' => 'getHighestBid', 'change_percentage' => 'getChangePercentage', + 'change_utc0' => 'getChangeUtc0', + 'change_utc8' => 'getChangeUtc8', 'base_volume' => 'getBaseVolume', 'quote_volume' => 'getQuoteVolume', 'high_24h' => 'getHigh24h', @@ -239,6 +249,8 @@ public function __construct(array $data = null) $this->container['lowest_ask'] = isset($data['lowest_ask']) ? $data['lowest_ask'] : null; $this->container['highest_bid'] = isset($data['highest_bid']) ? $data['highest_bid'] : null; $this->container['change_percentage'] = isset($data['change_percentage']) ? $data['change_percentage'] : null; + $this->container['change_utc0'] = isset($data['change_utc0']) ? $data['change_utc0'] : null; + $this->container['change_utc8'] = isset($data['change_utc8']) ? $data['change_utc8'] : null; $this->container['base_volume'] = isset($data['base_volume']) ? $data['base_volume'] : null; $this->container['quote_volume'] = isset($data['quote_volume']) ? $data['quote_volume'] : null; $this->container['high_24h'] = isset($data['high_24h']) ? $data['high_24h'] : null; @@ -393,6 +405,54 @@ public function setChangePercentage($change_percentage) return $this; } + /** + * Gets change_utc0 + * + * @return string|null + */ + public function getChangeUtc0() + { + return $this->container['change_utc0']; + } + + /** + * Sets change_utc0 + * + * @param string|null $change_utc0 utc0 timezone, the percentage change in the last 24 hours + * + * @return $this + */ + public function setChangeUtc0($change_utc0) + { + $this->container['change_utc0'] = $change_utc0; + + return $this; + } + + /** + * Gets change_utc8 + * + * @return string|null + */ + public function getChangeUtc8() + { + return $this->container['change_utc8']; + } + + /** + * Sets change_utc8 + * + * @param string|null $change_utc8 utc8 timezone, the percentage change in the last 24 hours + * + * @return $this + */ + public function setChangeUtc8($change_utc8) + { + $this->container['change_utc8'] = $change_utc8; + + return $this; + } + /** * Gets base_volume * From 5e8d57db7ed6a9ab12ec771172c00891e4ea11e1 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Fri, 15 Jul 2022 21:29:26 +0800 Subject: [PATCH 15/17] add transfer id and sub account cross margin balances --- README.md | 10 +- composer.json | 2 +- composer.lock | 2 +- docs/Api/SpotApi.md | 8 +- docs/Api/WalletApi.md | 139 +++- docs/Model/MarginCurrencyPair.md | 1 + docs/Model/SavedAddress.md | 14 + docs/Model/SpotPricePutOrder.md | 2 +- docs/Model/SubAccountCrossMarginBalance.md | 10 + docs/Model/SubCrossMarginAccount.md | 24 + docs/Model/TransactionID.md | 9 + src/Api/SpotApi.php | 20 +- src/Api/WalletApi.php | 582 +++++++++++++++- src/Configuration.php | 6 +- src/Model/MarginCurrencyPair.php | 40 +- src/Model/SavedAddress.php | 455 +++++++++++++ src/Model/SpotPricePutOrder.php | 4 +- src/Model/SubAccountCrossMarginBalance.php | 335 +++++++++ src/Model/SubCrossMarginAccount.php | 755 +++++++++++++++++++++ src/Model/TransactionID.php | 305 +++++++++ 20 files changed, 2683 insertions(+), 40 deletions(-) create mode 100644 docs/Model/SavedAddress.md create mode 100644 docs/Model/SubAccountCrossMarginBalance.md create mode 100644 docs/Model/SubCrossMarginAccount.md create mode 100644 docs/Model/TransactionID.md create mode 100644 src/Model/SavedAddress.php create mode 100644 src/Model/SubAccountCrossMarginBalance.php create mode 100644 src/Model/SubCrossMarginAccount.php create mode 100644 src/Model/TransactionID.php diff --git a/README.md b/README.md index 5ecd6bb..de2db6b 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.25.1 -- Package version: 5.25.1 +- API version: 4.26.0 +- Package version: 5.26.0 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) @@ -259,6 +259,8 @@ Class | Method | HTTP request | Description *WalletApi* | [**listSubAccountBalances**](docs/Api/WalletApi.md#listsubaccountbalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances *WalletApi* | [**listSubAccountMarginBalances**](docs/Api/WalletApi.md#listsubaccountmarginbalances) | **GET** /wallet/sub_account_margin_balances | Query sub accounts' margin balances *WalletApi* | [**listSubAccountFuturesBalances**](docs/Api/WalletApi.md#listsubaccountfuturesbalances) | **GET** /wallet/sub_account_futures_balances | Query sub accounts' futures account balances +*WalletApi* | [**listSubAccountCrossMarginBalances**](docs/Api/WalletApi.md#listsubaccountcrossmarginbalances) | **GET** /wallet/sub_account_cross_margin_balances | Query subaccount's cross_margin account info +*WalletApi* | [**listSavedAddress**](docs/Api/WalletApi.md#listsavedaddress) | **GET** /wallet/saved_address | Query saved address *WalletApi* | [**getTradeFee**](docs/Api/WalletApi.md#gettradefee) | **GET** /wallet/fee | Retrieve personal trading fee *WalletApi* | [**getTotalBalance**](docs/Api/WalletApi.md#gettotalbalance) | **GET** /wallet/total_balance | Retrieve user's total balances *WithdrawalApi* | [**withdraw**](docs/Api/WithdrawalApi.md#withdraw) | **POST** /withdrawals | Withdraw @@ -346,19 +348,23 @@ Class | Method | HTTP request | Description - [PositionCloseOrder](docs/Model/PositionCloseOrder.md) - [RepayRequest](docs/Model/RepayRequest.md) - [Repayment](docs/Model/Repayment.md) + - [SavedAddress](docs/Model/SavedAddress.md) - [SpotAccount](docs/Model/SpotAccount.md) - [SpotPricePutOrder](docs/Model/SpotPricePutOrder.md) - [SpotPriceTrigger](docs/Model/SpotPriceTrigger.md) - [SpotPriceTriggeredOrder](docs/Model/SpotPriceTriggeredOrder.md) - [SubAccountBalance](docs/Model/SubAccountBalance.md) + - [SubAccountCrossMarginBalance](docs/Model/SubAccountCrossMarginBalance.md) - [SubAccountFuturesBalance](docs/Model/SubAccountFuturesBalance.md) - [SubAccountMarginBalance](docs/Model/SubAccountMarginBalance.md) - [SubAccountTransfer](docs/Model/SubAccountTransfer.md) + - [SubCrossMarginAccount](docs/Model/SubCrossMarginAccount.md) - [SystemTime](docs/Model/SystemTime.md) - [Ticker](docs/Model/Ticker.md) - [TotalBalance](docs/Model/TotalBalance.md) - [Trade](docs/Model/Trade.md) - [TradeFee](docs/Model/TradeFee.md) + - [TransactionID](docs/Model/TransactionID.md) - [Transfer](docs/Model/Transfer.md) - [TriggerOrderResponse](docs/Model/TriggerOrderResponse.md) - [WithdrawStatus](docs/Model/WithdrawStatus.md) diff --git a/composer.json b/composer.json index 3a8f4e0..bf59e0e 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.25.1", + "version": "5.26.0", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index f70c1d4..30a8b55 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a56a0488fad2e4bde424fa60802ace2b", + "content-hash": "466eff280a740e0d485beaf696a15b83", "packages": [ { "name": "guzzlehttp/guzzle", diff --git a/docs/Api/SpotApi.md b/docs/Api/SpotApi.md index b62203d..f64df6d 100644 --- a/docs/Api/SpotApi.md +++ b/docs/Api/SpotApi.md @@ -1388,7 +1388,7 @@ $apiInstance = new GateApi\Api\SpotApi( ); $associate_array['status'] = 'status_example'; // string | Only list the orders with this status $associate_array['market'] = 'BTC_USDT'; // string | Currency pair -$associate_array['account'] = 'account_example'; // string | Trading account +$associate_array['account'] = 'account_example'; // string | Trading account type. Portfolio margin account must set to `cross_margin` $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 @@ -1412,7 +1412,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | **string**| Only list the orders with this status | **market** | **string**| Currency pair | [optional] - **account** | **string**| Trading account | [optional] + **account** | **string**| Trading account type. Portfolio margin account must set to `cross_margin` | [optional] **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] @@ -1517,7 +1517,7 @@ $apiInstance = new GateApi\Api\SpotApi( $config ); $market = 'BTC_USDT'; // string | Currency pair -$account = 'account_example'; // string | Trading account +$account = 'account_example'; // string | Trading account type. Portfolio margin account must set to `cross_margin` try { $result = $apiInstance->cancelSpotPriceTriggeredOrderList($market, $account); @@ -1536,7 +1536,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **market** | **string**| Currency pair | [optional] - **account** | **string**| Trading account | [optional] + **account** | **string**| Trading account type. Portfolio margin account must set to `cross_margin` | [optional] ### Return type diff --git a/docs/Api/WalletApi.md b/docs/Api/WalletApi.md index 7270b14..c0dd9be 100644 --- a/docs/Api/WalletApi.md +++ b/docs/Api/WalletApi.md @@ -15,6 +15,8 @@ Method | HTTP request | Description [**listSubAccountBalances**](WalletApi.md#listSubAccountBalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances [**listSubAccountMarginBalances**](WalletApi.md#listSubAccountMarginBalances) | **GET** /wallet/sub_account_margin_balances | Query sub accounts' margin balances [**listSubAccountFuturesBalances**](WalletApi.md#listSubAccountFuturesBalances) | **GET** /wallet/sub_account_futures_balances | Query sub accounts' futures account balances +[**listSubAccountCrossMarginBalances**](WalletApi.md#listSubAccountCrossMarginBalances) | **GET** /wallet/sub_account_cross_margin_balances | Query subaccount's cross_margin account info +[**listSavedAddress**](WalletApi.md#listSavedAddress) | **GET** /wallet/saved_address | Query saved address [**getTradeFee**](WalletApi.md#getTradeFee) | **GET** /wallet/fee | Retrieve personal trading fee [**getTotalBalance**](WalletApi.md#getTotalBalance) | **GET** /wallet/total_balance | Retrieve user's total balances @@ -281,7 +283,7 @@ Name | Type | Description | Notes ## transfer -> transfer($transfer) +> \GateApi\Model\TransactionID transfer($transfer) Transfer between trading accounts @@ -306,7 +308,8 @@ $apiInstance = new GateApi\Api\WalletApi( $transfer = new \GateApi\Model\Transfer(); // \GateApi\Model\Transfer | try { - $apiInstance->transfer($transfer); + $result = $apiInstance->transfer($transfer); + print_r($result); } catch (GateApi\GateApiException $e) { echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; } catch (Exception $e) { @@ -324,7 +327,7 @@ Name | Type | Description | Notes ### Return type -void (empty response body) +[**\GateApi\Model\TransactionID**](../Model/TransactionID.md) ### Authorization @@ -333,7 +336,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json -- **Accept**: Not defined +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) @@ -723,6 +726,134 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## listSubAccountCrossMarginBalances + +> \GateApi\Model\SubAccountCrossMarginBalance[] listSubAccountCrossMarginBalances($sub_uid) + +Query subaccount's cross_margin account info + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\WalletApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['sub_uid'] = '10003'; // string | Sub account user ID. Return records related to all sub accounts if not specified + +try { + $result = $apiInstance->listSubAccountCrossMarginBalances($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling WalletApi->listSubAccountCrossMarginBalances: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sub_uid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] + +### Return type + +[**\GateApi\Model\SubAccountCrossMarginBalance[]**](../Model/SubAccountCrossMarginBalance.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listSavedAddress + +> \GateApi\Model\SavedAddress[] listSavedAddress($currency, $chain, $limit) + +Query saved address + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\WalletApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['currency'] = 'USDT'; // string | Currency +$associate_array['chain'] = ''; // string | Chain name +$associate_array['limit'] = '50'; // string | Maximum number returned, 100 at most + +try { + $result = $apiInstance->listSavedAddress($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling WalletApi->listSavedAddress: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **string**| Currency | + **chain** | **string**| Chain name | [optional] [default to ''] + **limit** | **string**| Maximum number returned, 100 at most | [optional] [default to '50'] + +### Return type + +[**\GateApi\Model\SavedAddress[]**](../Model/SavedAddress.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## getTradeFee > \GateApi\Model\TradeFee getTradeFee($currency_pair) diff --git a/docs/Model/MarginCurrencyPair.md b/docs/Model/MarginCurrencyPair.md index 8c6babc..b9a2542 100644 --- a/docs/Model/MarginCurrencyPair.md +++ b/docs/Model/MarginCurrencyPair.md @@ -11,5 +11,6 @@ Name | Type | Description | Notes **min_base_amount** | **string** | Minimum base currency to loan, `null` means no limit | [optional] **min_quote_amount** | **string** | Minimum quote currency to loan, `null` means no limit | [optional] **max_quote_amount** | **string** | Maximum borrowable amount for quote currency. Base currency limit is calculated by quote maximum and market price. `null` means no limit | [optional] +**status** | **int** | Currency pair status - `0`: disabled - `1`: enabled | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SavedAddress.md b/docs/Model/SavedAddress.md new file mode 100644 index 0000000..3387dd0 --- /dev/null +++ b/docs/Model/SavedAddress.md @@ -0,0 +1,14 @@ +# # SavedAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **string** | Currency | [optional] +**chain** | **string** | Chain name | [optional] +**address** | **string** | Address | [optional] +**name** | **string** | Name | [optional] +**tag** | **string** | Tag | [optional] +**verified** | **string** | Whether to pass the verification 0-unverified, 1-verified | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpotPricePutOrder.md b/docs/Model/SpotPricePutOrder.md index 89e5ee0..be92ba1 100644 --- a/docs/Model/SpotPricePutOrder.md +++ b/docs/Model/SpotPricePutOrder.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **side** | **string** | Order side - buy: buy side - sell: sell side | **price** | **string** | Order price | **amount** | **string** | Order amount | -**account** | **string** | Trading type - normal: spot trading - margin: margin trading | [default to 'normal'] +**account** | **string** | Trading account type. Portfolio margin account must set to `cross_margin` - normal: spot trading - margin: margin trading - cross_margin: cross_margin trading | [default to 'normal'] **time_in_force** | **string** | time_in_force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only | [optional] [default to 'gtc'] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubAccountCrossMarginBalance.md b/docs/Model/SubAccountCrossMarginBalance.md new file mode 100644 index 0000000..4576883 --- /dev/null +++ b/docs/Model/SubAccountCrossMarginBalance.md @@ -0,0 +1,10 @@ +# # SubAccountCrossMarginBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uid** | **string** | User ID | [optional] +**available** | [**\GateApi\Model\SubCrossMarginAccount**](.md) | 账户余额信息 | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubCrossMarginAccount.md b/docs/Model/SubCrossMarginAccount.md new file mode 100644 index 0000000..56ed987 --- /dev/null +++ b/docs/Model/SubCrossMarginAccount.md @@ -0,0 +1,24 @@ +# # SubCrossMarginAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | User ID of the cross margin account. 0 means that the subaccount has not yet opened a cross margin account | [optional] +**locked** | **bool** | Whether account is locked | [optional] +**balances** | [**map[string,\GateApi\Model\CrossMarginBalance]**](CrossMarginBalance.md) | | [optional] +**total** | **string** | Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` | [optional] +**borrowed** | **string** | Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` | [optional] +**borrowed_net** | **string** | Total borrowed value in USDT * borrowed factor | [optional] +**net** | **string** | Total net assets in USDT | [optional] +**leverage** | **string** | Position leverage | [optional] +**interest** | **string** | Total unpaid interests in USDT, i.e., the sum of all currencies' `interest*price*discount` | [optional] +**risk** | **string** | Risk rate. When it belows 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` | [optional] +**total_initial_margin** | **string** | Total initial margin | [optional] +**total_margin_balance** | **string** | Total margin balance | [optional] +**total_maintenance_margin** | **string** | Total maintenance margin | [optional] +**total_initial_margin_rate** | **string** | Total initial margin rate | [optional] +**total_maintenance_margin_rate** | **string** | Total maintenance margin rate | [optional] +**total_available_margin** | **string** | Total available margin | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransactionID.md b/docs/Model/TransactionID.md new file mode 100644 index 0000000..0bfd311 --- /dev/null +++ b/docs/Model/TransactionID.md @@ -0,0 +1,9 @@ +# # TransactionID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tx_id** | **int** | Order id | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/SpotApi.php b/src/Api/SpotApi.php index 04d0d50..6765dd7 100644 --- a/src/Api/SpotApi.php +++ b/src/Api/SpotApi.php @@ -5858,7 +5858,7 @@ protected function getSystemTimeRequest() * * @param string $status Only list the orders with this status (required) * @param string $market Currency pair (optional) - * @param string $account Trading account (optional) + * @param string $account Trading account type. Portfolio margin account must set to `cross_margin` (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @@ -5881,7 +5881,7 @@ public function listSpotPriceTriggeredOrders($associative_array) * * @param string $status Only list the orders with this status (required) * @param string $market Currency pair (optional) - * @param string $account Trading account (optional) + * @param string $account Trading account type. Portfolio margin account must set to `cross_margin` (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @@ -5941,7 +5941,7 @@ public function listSpotPriceTriggeredOrdersWithHttpInfo($associative_array) * * @param string $status Only list the orders with this status (required) * @param string $market Currency pair (optional) - * @param string $account Trading account (optional) + * @param string $account Trading account type. Portfolio margin account must set to `cross_margin` (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @@ -5967,7 +5967,7 @@ function ($response) { * * @param string $status Only list the orders with this status (required) * @param string $market Currency pair (optional) - * @param string $account Trading account (optional) + * @param string $account Trading account type. Portfolio margin account must set to `cross_margin` (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @@ -6020,7 +6020,7 @@ function ($exception) { * * @param string $status Only list the orders with this status (required) * @param string $market Currency pair (optional) - * @param string $account Trading account (optional) + * @param string $account Trading account type. Portfolio margin account must set to `cross_margin` (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @@ -6428,7 +6428,7 @@ protected function createSpotPriceTriggeredOrderRequest($spot_price_triggered_or * Cancel all open orders * * @param string $market Currency pair (optional) - * @param string $account Trading account (optional) + * @param string $account Trading account type. Portfolio margin account must set to `cross_margin` (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -6446,7 +6446,7 @@ public function cancelSpotPriceTriggeredOrderList($market = null, $account = nul * Cancel all open orders * * @param string $market Currency pair (optional) - * @param string $account Trading account (optional) + * @param string $account Trading account type. Portfolio margin account must set to `cross_margin` (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -6501,7 +6501,7 @@ public function cancelSpotPriceTriggeredOrderListWithHttpInfo($market = null, $a * Cancel all open orders * * @param string $market Currency pair (optional) - * @param string $account Trading account (optional) + * @param string $account Trading account type. Portfolio margin account must set to `cross_margin` (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -6522,7 +6522,7 @@ function ($response) { * Cancel all open orders * * @param string $market Currency pair (optional) - * @param string $account Trading account (optional) + * @param string $account Trading account type. Portfolio margin account must set to `cross_margin` (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -6570,7 +6570,7 @@ function ($exception) { * Create request for operation 'cancelSpotPriceTriggeredOrderList' * * @param string $market Currency pair (optional) - * @param string $account Trading account (optional) + * @param string $account Trading account type. Portfolio margin account must set to `cross_margin` (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/src/Api/WalletApi.php b/src/Api/WalletApi.php index 3c6a30d..6f1c0f2 100644 --- a/src/Api/WalletApi.php +++ b/src/Api/WalletApi.php @@ -1271,11 +1271,12 @@ protected function listDepositsRequest($associative_array) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \GateApi\Model\TransactionID */ public function transfer($transfer) { - $this->transferWithHttpInfo($transfer); + list($response) = $this->transferWithHttpInfo($transfer); + return $response; } /** @@ -1287,7 +1288,7 @@ public function transfer($transfer) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \GateApi\Model\TransactionID, HTTP status code, HTTP response headers (array of strings) */ public function transferWithHttpInfo($transfer) { @@ -1317,7 +1318,19 @@ public function transferWithHttpInfo($transfer) ); } - return [null, $statusCode, $response->getHeaders()]; + $returnType = '\GateApi\Model\TransactionID'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } /** @@ -1352,14 +1365,25 @@ function ($response) { */ public function transferAsyncWithHttpInfo($transfer) { - $returnType = ''; + $returnType = '\GateApi\Model\TransactionID'; $request = $this->transferRequest($transfer); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -1410,11 +1434,11 @@ protected function transferRequest($transfer) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], + ['application/json'], ['application/json'] ); } @@ -3033,6 +3057,548 @@ protected function listSubAccountFuturesBalancesRequest($associative_array) ); } + /** + * Operation listSubAccountCrossMarginBalances + * + * Query subaccount's cross_margin account info + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\SubAccountCrossMarginBalance[] + */ + public function listSubAccountCrossMarginBalances($associative_array) + { + list($response) = $this->listSubAccountCrossMarginBalancesWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listSubAccountCrossMarginBalancesWithHttpInfo + * + * Query subaccount's cross_margin account info + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\SubAccountCrossMarginBalance[], HTTP status code, HTTP response headers (array of strings) + */ + public function listSubAccountCrossMarginBalancesWithHttpInfo($associative_array) + { + $request = $this->listSubAccountCrossMarginBalancesRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\SubAccountCrossMarginBalance[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listSubAccountCrossMarginBalancesAsync + * + * Query subaccount's cross_margin account info + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSubAccountCrossMarginBalancesAsync($associative_array) + { + return $this->listSubAccountCrossMarginBalancesAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listSubAccountCrossMarginBalancesAsyncWithHttpInfo + * + * Query subaccount's cross_margin account info + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSubAccountCrossMarginBalancesAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\SubAccountCrossMarginBalance[]'; + $request = $this->listSubAccountCrossMarginBalancesRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listSubAccountCrossMarginBalances' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listSubAccountCrossMarginBalancesRequest($associative_array) + { + // unbox the parameters from the associative array + $sub_uid = array_key_exists('sub_uid', $associative_array) ? $associative_array['sub_uid'] : null; + + + $resourcePath = '/wallet/sub_account_cross_margin_balances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($sub_uid !== null) { + if('form' === 'form' && is_array($sub_uid)) { + foreach($sub_uid as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['sub_uid'] = $sub_uid; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listSavedAddress + * + * Query saved address + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Currency (required) + * @param string $chain Chain name (optional, default to '') + * @param string $limit Maximum number returned, 100 at most (optional, default to '50') + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\SavedAddress[] + */ + public function listSavedAddress($associative_array) + { + list($response) = $this->listSavedAddressWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listSavedAddressWithHttpInfo + * + * Query saved address + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Currency (required) + * @param string $chain Chain name (optional, default to '') + * @param string $limit Maximum number returned, 100 at most (optional, default to '50') + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\SavedAddress[], HTTP status code, HTTP response headers (array of strings) + */ + public function listSavedAddressWithHttpInfo($associative_array) + { + $request = $this->listSavedAddressRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\SavedAddress[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listSavedAddressAsync + * + * Query saved address + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Currency (required) + * @param string $chain Chain name (optional, default to '') + * @param string $limit Maximum number returned, 100 at most (optional, default to '50') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSavedAddressAsync($associative_array) + { + return $this->listSavedAddressAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listSavedAddressAsyncWithHttpInfo + * + * Query saved address + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Currency (required) + * @param string $chain Chain name (optional, default to '') + * @param string $limit Maximum number returned, 100 at most (optional, default to '50') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSavedAddressAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\SavedAddress[]'; + $request = $this->listSavedAddressRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listSavedAddress' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Currency (required) + * @param string $chain Chain name (optional, default to '') + * @param string $limit Maximum number returned, 100 at most (optional, default to '50') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listSavedAddressRequest($associative_array) + { + // unbox the parameters from the associative array + $currency = array_key_exists('currency', $associative_array) ? $associative_array['currency'] : null; + $chain = array_key_exists('chain', $associative_array) ? $associative_array['chain'] : ''; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : '50'; + + // verify the required parameter 'currency' is set + if ($currency === null || (is_array($currency) && count($currency) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $currency when calling listSavedAddress' + ); + } + + $resourcePath = '/wallet/saved_address'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($currency !== null) { + if('form' === 'form' && is_array($currency)) { + foreach($currency as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency'] = $currency; + } + } + + // query params + if ($chain !== null) { + if('form' === 'form' && is_array($chain)) { + foreach($chain as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['chain'] = $chain; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getTradeFee * diff --git a/src/Configuration.php b/src/Configuration.php index 6474eaa..6fddf14 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.25.1/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.26.0/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.25.1' . PHP_EOL; - $report .= ' SDK Package Version: 5.25.1' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.26.0' . PHP_EOL; + $report .= ' SDK Package Version: 5.26.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/MarginCurrencyPair.php b/src/Model/MarginCurrencyPair.php index b43d848..4fdb985 100644 --- a/src/Model/MarginCurrencyPair.php +++ b/src/Model/MarginCurrencyPair.php @@ -60,7 +60,8 @@ class MarginCurrencyPair implements ModelInterface, ArrayAccess 'leverage' => 'int', 'min_base_amount' => 'string', 'min_quote_amount' => 'string', - 'max_quote_amount' => 'string' + 'max_quote_amount' => 'string', + 'status' => 'int' ]; /** @@ -75,7 +76,8 @@ class MarginCurrencyPair implements ModelInterface, ArrayAccess 'leverage' => null, 'min_base_amount' => null, 'min_quote_amount' => null, - 'max_quote_amount' => null + 'max_quote_amount' => null, + 'status' => 'int32' ]; /** @@ -111,7 +113,8 @@ public static function openAPIFormats() 'leverage' => 'leverage', 'min_base_amount' => 'min_base_amount', 'min_quote_amount' => 'min_quote_amount', - 'max_quote_amount' => 'max_quote_amount' + 'max_quote_amount' => 'max_quote_amount', + 'status' => 'status' ]; /** @@ -126,7 +129,8 @@ public static function openAPIFormats() 'leverage' => 'setLeverage', 'min_base_amount' => 'setMinBaseAmount', 'min_quote_amount' => 'setMinQuoteAmount', - 'max_quote_amount' => 'setMaxQuoteAmount' + 'max_quote_amount' => 'setMaxQuoteAmount', + 'status' => 'setStatus' ]; /** @@ -141,7 +145,8 @@ public static function openAPIFormats() 'leverage' => 'getLeverage', 'min_base_amount' => 'getMinBaseAmount', 'min_quote_amount' => 'getMinQuoteAmount', - 'max_quote_amount' => 'getMaxQuoteAmount' + 'max_quote_amount' => 'getMaxQuoteAmount', + 'status' => 'getStatus' ]; /** @@ -211,6 +216,7 @@ public function __construct(array $data = null) $this->container['min_base_amount'] = isset($data['min_base_amount']) ? $data['min_base_amount'] : null; $this->container['min_quote_amount'] = isset($data['min_quote_amount']) ? $data['min_quote_amount'] : null; $this->container['max_quote_amount'] = isset($data['max_quote_amount']) ? $data['max_quote_amount'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; } /** @@ -404,6 +410,30 @@ public function setMaxQuoteAmount($max_quote_amount) return $this; } + + /** + * Gets status + * + * @return int|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int|null $status Currency pair status - `0`: disabled - `1`: enabled + * + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/SavedAddress.php b/src/Model/SavedAddress.php new file mode 100644 index 0000000..0234ca6 --- /dev/null +++ b/src/Model/SavedAddress.php @@ -0,0 +1,455 @@ + 'string', + 'chain' => 'string', + 'address' => 'string', + 'name' => 'string', + 'tag' => 'string', + 'verified' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'chain' => null, + 'address' => null, + 'name' => null, + 'tag' => null, + 'verified' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'chain' => 'chain', + 'address' => 'address', + 'name' => 'name', + 'tag' => 'tag', + 'verified' => 'verified' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'chain' => 'setChain', + 'address' => 'setAddress', + 'name' => 'setName', + 'tag' => 'setTag', + 'verified' => 'setVerified' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'chain' => 'getChain', + 'address' => 'getAddress', + 'name' => 'getName', + 'tag' => 'getTag', + 'verified' => 'getVerified' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['chain'] = isset($data['chain']) ? $data['chain'] : null; + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['verified'] = isset($data['verified']) ? $data['verified'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency Currency + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets chain + * + * @return string|null + */ + public function getChain() + { + return $this->container['chain']; + } + + /** + * Sets chain + * + * @param string|null $chain Chain name + * + * @return $this + */ + public function setChain($chain) + { + $this->container['chain'] = $chain; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address Address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets tag + * + * @return string|null + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string|null $tag Tag + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets verified + * + * @return string|null + */ + public function getVerified() + { + return $this->container['verified']; + } + + /** + * Sets verified + * + * @param string|null $verified Whether to pass the verification 0-unverified, 1-verified + * + * @return $this + */ + public function setVerified($verified) + { + $this->container['verified'] = $verified; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SpotPricePutOrder.php b/src/Model/SpotPricePutOrder.php index d627b69..9bdd40f 100644 --- a/src/Model/SpotPricePutOrder.php +++ b/src/Model/SpotPricePutOrder.php @@ -184,6 +184,7 @@ public function getModelName() const SIDE_SELL = 'sell'; const ACCOUNT_NORMAL = 'normal'; const ACCOUNT_MARGIN = 'margin'; + const ACCOUNT_CROSS_MARGIN = 'cross_margin'; const TIME_IN_FORCE_GTC = 'gtc'; const TIME_IN_FORCE_IOC = 'ioc'; @@ -212,6 +213,7 @@ public function getAccountAllowableValues() return [ self::ACCOUNT_NORMAL, self::ACCOUNT_MARGIN, + self::ACCOUNT_CROSS_MARGIN, ]; } @@ -430,7 +432,7 @@ public function getAccount() /** * Sets account * - * @param string $account Trading type - normal: spot trading - margin: margin trading + * @param string $account Trading account type. Portfolio margin account must set to `cross_margin` - normal: spot trading - margin: margin trading - cross_margin: cross_margin trading * * @return $this */ diff --git a/src/Model/SubAccountCrossMarginBalance.php b/src/Model/SubAccountCrossMarginBalance.php new file mode 100644 index 0000000..c4ca7ba --- /dev/null +++ b/src/Model/SubAccountCrossMarginBalance.php @@ -0,0 +1,335 @@ + 'string', + 'available' => '\GateApi\Model\SubCrossMarginAccount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'uid' => null, + 'available' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'uid' => 'uid', + 'available' => 'available' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'uid' => 'setUid', + 'available' => 'setAvailable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'uid' => 'getUid', + 'available' => 'getAvailable' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['uid'] = isset($data['uid']) ? $data['uid'] : null; + $this->container['available'] = isset($data['available']) ? $data['available'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uid + * + * @return string|null + */ + public function getUid() + { + return $this->container['uid']; + } + + /** + * Sets uid + * + * @param string|null $uid User ID + * + * @return $this + */ + public function setUid($uid) + { + $this->container['uid'] = $uid; + + return $this; + } + + /** + * Gets available + * + * @return \GateApi\Model\SubCrossMarginAccount|null + */ + public function getAvailable() + { + return $this->container['available']; + } + + /** + * Sets available + * + * @param \GateApi\Model\SubCrossMarginAccount|null $available 账户余额信息 + * + * @return $this + */ + public function setAvailable($available) + { + $this->container['available'] = $available; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SubCrossMarginAccount.php b/src/Model/SubCrossMarginAccount.php new file mode 100644 index 0000000..99b7b15 --- /dev/null +++ b/src/Model/SubCrossMarginAccount.php @@ -0,0 +1,755 @@ + 'int', + 'locked' => 'bool', + 'balances' => 'map[string,\GateApi\Model\CrossMarginBalance]', + 'total' => 'string', + 'borrowed' => 'string', + 'borrowed_net' => 'string', + 'net' => 'string', + 'leverage' => 'string', + 'interest' => 'string', + 'risk' => 'string', + 'total_initial_margin' => 'string', + 'total_margin_balance' => 'string', + 'total_maintenance_margin' => 'string', + 'total_initial_margin_rate' => 'string', + 'total_maintenance_margin_rate' => 'string', + 'total_available_margin' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'user_id' => 'int64', + 'locked' => null, + 'balances' => null, + 'total' => null, + 'borrowed' => null, + 'borrowed_net' => null, + 'net' => null, + 'leverage' => null, + 'interest' => null, + 'risk' => null, + 'total_initial_margin' => null, + 'total_margin_balance' => null, + 'total_maintenance_margin' => null, + 'total_initial_margin_rate' => null, + 'total_maintenance_margin_rate' => null, + 'total_available_margin' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'locked' => 'locked', + 'balances' => 'balances', + 'total' => 'total', + 'borrowed' => 'borrowed', + 'borrowed_net' => 'borrowed_net', + 'net' => 'net', + 'leverage' => 'leverage', + 'interest' => 'interest', + 'risk' => 'risk', + 'total_initial_margin' => 'total_initial_margin', + 'total_margin_balance' => 'total_margin_balance', + 'total_maintenance_margin' => 'total_maintenance_margin', + 'total_initial_margin_rate' => 'total_initial_margin_rate', + 'total_maintenance_margin_rate' => 'total_maintenance_margin_rate', + 'total_available_margin' => 'total_available_margin' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'locked' => 'setLocked', + 'balances' => 'setBalances', + 'total' => 'setTotal', + 'borrowed' => 'setBorrowed', + 'borrowed_net' => 'setBorrowedNet', + 'net' => 'setNet', + 'leverage' => 'setLeverage', + 'interest' => 'setInterest', + 'risk' => 'setRisk', + 'total_initial_margin' => 'setTotalInitialMargin', + 'total_margin_balance' => 'setTotalMarginBalance', + 'total_maintenance_margin' => 'setTotalMaintenanceMargin', + 'total_initial_margin_rate' => 'setTotalInitialMarginRate', + 'total_maintenance_margin_rate' => 'setTotalMaintenanceMarginRate', + 'total_available_margin' => 'setTotalAvailableMargin' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'locked' => 'getLocked', + 'balances' => 'getBalances', + 'total' => 'getTotal', + 'borrowed' => 'getBorrowed', + 'borrowed_net' => 'getBorrowedNet', + 'net' => 'getNet', + 'leverage' => 'getLeverage', + 'interest' => 'getInterest', + 'risk' => 'getRisk', + 'total_initial_margin' => 'getTotalInitialMargin', + 'total_margin_balance' => 'getTotalMarginBalance', + 'total_maintenance_margin' => 'getTotalMaintenanceMargin', + 'total_initial_margin_rate' => 'getTotalInitialMarginRate', + 'total_maintenance_margin_rate' => 'getTotalMaintenanceMarginRate', + 'total_available_margin' => 'getTotalAvailableMargin' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = isset($data['user_id']) ? $data['user_id'] : null; + $this->container['locked'] = isset($data['locked']) ? $data['locked'] : null; + $this->container['balances'] = isset($data['balances']) ? $data['balances'] : null; + $this->container['total'] = isset($data['total']) ? $data['total'] : null; + $this->container['borrowed'] = isset($data['borrowed']) ? $data['borrowed'] : null; + $this->container['borrowed_net'] = isset($data['borrowed_net']) ? $data['borrowed_net'] : null; + $this->container['net'] = isset($data['net']) ? $data['net'] : null; + $this->container['leverage'] = isset($data['leverage']) ? $data['leverage'] : null; + $this->container['interest'] = isset($data['interest']) ? $data['interest'] : null; + $this->container['risk'] = isset($data['risk']) ? $data['risk'] : null; + $this->container['total_initial_margin'] = isset($data['total_initial_margin']) ? $data['total_initial_margin'] : null; + $this->container['total_margin_balance'] = isset($data['total_margin_balance']) ? $data['total_margin_balance'] : null; + $this->container['total_maintenance_margin'] = isset($data['total_maintenance_margin']) ? $data['total_maintenance_margin'] : null; + $this->container['total_initial_margin_rate'] = isset($data['total_initial_margin_rate']) ? $data['total_initial_margin_rate'] : null; + $this->container['total_maintenance_margin_rate'] = isset($data['total_maintenance_margin_rate']) ? $data['total_maintenance_margin_rate'] : null; + $this->container['total_available_margin'] = isset($data['total_available_margin']) ? $data['total_available_margin'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id User ID of the cross margin account. 0 means that the subaccount has not yet opened a cross margin account + * + * @return $this + */ + public function setUserId($user_id) + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets locked + * + * @return bool|null + */ + public function getLocked() + { + return $this->container['locked']; + } + + /** + * Sets locked + * + * @param bool|null $locked Whether account is locked + * + * @return $this + */ + public function setLocked($locked) + { + $this->container['locked'] = $locked; + + return $this; + } + + /** + * Gets balances + * + * @return map[string,\GateApi\Model\CrossMarginBalance]|null + */ + public function getBalances() + { + return $this->container['balances']; + } + + /** + * Sets balances + * + * @param map[string,\GateApi\Model\CrossMarginBalance]|null $balances balances + * + * @return $this + */ + public function setBalances($balances) + { + $this->container['balances'] = $balances; + + return $this; + } + + /** + * Gets total + * + * @return string|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param string|null $total Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` + * + * @return $this + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets borrowed + * + * @return string|null + */ + public function getBorrowed() + { + return $this->container['borrowed']; + } + + /** + * Sets borrowed + * + * @param string|null $borrowed Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` + * + * @return $this + */ + public function setBorrowed($borrowed) + { + $this->container['borrowed'] = $borrowed; + + return $this; + } + + /** + * Gets borrowed_net + * + * @return string|null + */ + public function getBorrowedNet() + { + return $this->container['borrowed_net']; + } + + /** + * Sets borrowed_net + * + * @param string|null $borrowed_net Total borrowed value in USDT * borrowed factor + * + * @return $this + */ + public function setBorrowedNet($borrowed_net) + { + $this->container['borrowed_net'] = $borrowed_net; + + return $this; + } + + /** + * Gets net + * + * @return string|null + */ + public function getNet() + { + return $this->container['net']; + } + + /** + * Sets net + * + * @param string|null $net Total net assets in USDT + * + * @return $this + */ + public function setNet($net) + { + $this->container['net'] = $net; + + return $this; + } + + /** + * Gets leverage + * + * @return string|null + */ + public function getLeverage() + { + return $this->container['leverage']; + } + + /** + * Sets leverage + * + * @param string|null $leverage Position leverage + * + * @return $this + */ + public function setLeverage($leverage) + { + $this->container['leverage'] = $leverage; + + return $this; + } + + /** + * Gets interest + * + * @return string|null + */ + public function getInterest() + { + return $this->container['interest']; + } + + /** + * Sets interest + * + * @param string|null $interest Total unpaid interests in USDT, i.e., the sum of all currencies' `interest*price*discount` + * + * @return $this + */ + public function setInterest($interest) + { + $this->container['interest'] = $interest; + + return $this; + } + + /** + * Gets risk + * + * @return string|null + */ + public function getRisk() + { + return $this->container['risk']; + } + + /** + * Sets risk + * + * @param string|null $risk Risk rate. When it belows 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` + * + * @return $this + */ + public function setRisk($risk) + { + $this->container['risk'] = $risk; + + return $this; + } + + /** + * Gets total_initial_margin + * + * @return string|null + */ + public function getTotalInitialMargin() + { + return $this->container['total_initial_margin']; + } + + /** + * Sets total_initial_margin + * + * @param string|null $total_initial_margin Total initial margin + * + * @return $this + */ + public function setTotalInitialMargin($total_initial_margin) + { + $this->container['total_initial_margin'] = $total_initial_margin; + + return $this; + } + + /** + * Gets total_margin_balance + * + * @return string|null + */ + public function getTotalMarginBalance() + { + return $this->container['total_margin_balance']; + } + + /** + * Sets total_margin_balance + * + * @param string|null $total_margin_balance Total margin balance + * + * @return $this + */ + public function setTotalMarginBalance($total_margin_balance) + { + $this->container['total_margin_balance'] = $total_margin_balance; + + return $this; + } + + /** + * Gets total_maintenance_margin + * + * @return string|null + */ + public function getTotalMaintenanceMargin() + { + return $this->container['total_maintenance_margin']; + } + + /** + * Sets total_maintenance_margin + * + * @param string|null $total_maintenance_margin Total maintenance margin + * + * @return $this + */ + public function setTotalMaintenanceMargin($total_maintenance_margin) + { + $this->container['total_maintenance_margin'] = $total_maintenance_margin; + + return $this; + } + + /** + * Gets total_initial_margin_rate + * + * @return string|null + */ + public function getTotalInitialMarginRate() + { + return $this->container['total_initial_margin_rate']; + } + + /** + * Sets total_initial_margin_rate + * + * @param string|null $total_initial_margin_rate Total initial margin rate + * + * @return $this + */ + public function setTotalInitialMarginRate($total_initial_margin_rate) + { + $this->container['total_initial_margin_rate'] = $total_initial_margin_rate; + + return $this; + } + + /** + * Gets total_maintenance_margin_rate + * + * @return string|null + */ + public function getTotalMaintenanceMarginRate() + { + return $this->container['total_maintenance_margin_rate']; + } + + /** + * Sets total_maintenance_margin_rate + * + * @param string|null $total_maintenance_margin_rate Total maintenance margin rate + * + * @return $this + */ + public function setTotalMaintenanceMarginRate($total_maintenance_margin_rate) + { + $this->container['total_maintenance_margin_rate'] = $total_maintenance_margin_rate; + + return $this; + } + + /** + * Gets total_available_margin + * + * @return string|null + */ + public function getTotalAvailableMargin() + { + return $this->container['total_available_margin']; + } + + /** + * Sets total_available_margin + * + * @param string|null $total_available_margin Total available margin + * + * @return $this + */ + public function setTotalAvailableMargin($total_available_margin) + { + $this->container['total_available_margin'] = $total_available_margin; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TransactionID.php b/src/Model/TransactionID.php new file mode 100644 index 0000000..4e6ef97 --- /dev/null +++ b/src/Model/TransactionID.php @@ -0,0 +1,305 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'tx_id' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tx_id' => 'tx_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tx_id' => 'setTxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tx_id' => 'getTxId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['tx_id'] = isset($data['tx_id']) ? $data['tx_id'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets tx_id + * + * @return int|null + */ + public function getTxId() + { + return $this->container['tx_id']; + } + + /** + * Sets tx_id + * + * @param int|null $tx_id Order id + * + * @return $this + */ + public function setTxId($tx_id) + { + $this->container['tx_id'] = $tx_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + From b1469cfdf1e5764da293592f4c82b6275df80da0 Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Thu, 1 Dec 2022 18:22:34 +0800 Subject: [PATCH 16/17] release 5.34.0 --- README.md | 42 +- composer.json | 2 +- composer.lock | 270 +- docs/Api/DeliveryApi.md | 4 +- docs/Api/FuturesApi.md | 229 +- docs/Api/OptionsApi.md | 84 +- docs/Api/SpotApi.md | 85 +- docs/Api/SubAccountApi.md | 623 +++++ docs/Api/WalletApi.md | 84 +- docs/Model/ApiV4KeyPerm.md | 10 + docs/Model/BatchFuturesOrder.md | 34 + docs/Model/CountdownCancelAllFuturesTask.md | 10 + docs/Model/CountdownCancelAllSpotTask.md | 10 + docs/Model/FuturesAccount.md | 2 +- docs/Model/FuturesCandlestick.md | 10 +- docs/Model/FuturesOrder.md | 2 +- docs/Model/FuturesOrderAmendment.md | 2 +- docs/Model/FuturesOrderBookItem.md | 2 +- docs/Model/FuturesPremiumIndex.md | 13 + docs/Model/FuturesTicker.md | 2 + docs/Model/FuturesTrade.md | 2 +- docs/Model/LedgerRecord.md | 4 +- docs/Model/OptionsAccountBook.md | 4 +- docs/Model/OptionsCandlestick.md | 14 + docs/Model/OptionsContract.md | 8 +- docs/Model/OptionsMySettlements.md | 12 +- docs/Model/OptionsMyTrade.md | 6 +- docs/Model/OptionsOrder.md | 5 +- docs/Model/OptionsPosition.md | 10 +- docs/Model/OptionsPositionClose.md | 2 +- docs/Model/OptionsPositionCloseOrder.md | 11 + docs/Model/OptionsSettlement.md | 10 +- docs/Model/OptionsTicker.md | 6 +- docs/Model/OptionsUnderlying.md | 2 +- docs/Model/OptionsUnderlyingTicker.md | 2 +- docs/Model/Order.md | 10 +- docs/Model/SubAccount.md | 15 + docs/Model/SubAccountKey.md | 16 + docs/Model/SubAccountToSubAccount.md | 15 + docs/Model/TriggerTime.md | 9 + src/Api/DeliveryApi.php | 8 +- src/Api/FuturesApi.php | 1094 +++++++- src/Api/OptionsApi.php | 202 +- src/Api/SpotApi.php | 288 ++- src/Api/SubAccountApi.php | 2523 +++++++++++++++++++ src/Api/WalletApi.php | 278 +- src/Configuration.php | 6 +- src/Model/ApiV4KeyPerm.php | 375 +++ src/Model/BatchFuturesOrder.php | 1200 +++++++++ src/Model/Contract.php | 2 +- src/Model/CountdownCancelAllFuturesTask.php | 339 +++ src/Model/CountdownCancelAllSpotTask.php | 339 +++ src/Model/FuturesAccount.php | 2 +- src/Model/FuturesCandlestick.php | 10 +- src/Model/FuturesOrder.php | 4 +- src/Model/FuturesOrderAmendment.php | 2 +- src/Model/FuturesOrderBookItem.php | 2 +- src/Model/FuturesPremiumIndex.php | 426 ++++ src/Model/FuturesTicker.php | 70 +- src/Model/FuturesTrade.php | 2 +- src/Model/LedgerRecord.php | 7 +- src/Model/OptionsAccountBook.php | 4 +- src/Model/OptionsCandlestick.php | 456 ++++ src/Model/OptionsContract.php | 10 +- src/Model/OptionsMySettlements.php | 12 +- src/Model/OptionsMyTrade.php | 6 +- src/Model/OptionsOrder.php | 44 +- src/Model/OptionsPosition.php | 16 +- src/Model/OptionsPositionClose.php | 2 +- src/Model/OptionsPositionCloseOrder.php | 366 +++ src/Model/OptionsSettlement.php | 10 +- src/Model/OptionsTicker.php | 6 +- src/Model/OptionsUnderlying.php | 2 +- src/Model/OptionsUnderlyingTicker.php | 2 +- src/Model/Order.php | 75 +- src/Model/SubAccount.php | 488 ++++ src/Model/SubAccountKey.php | 515 ++++ src/Model/SubAccountToSubAccount.php | 571 +++++ src/Model/TriggerTime.php | 305 +++ 79 files changed, 11125 insertions(+), 627 deletions(-) create mode 100644 docs/Api/SubAccountApi.md create mode 100644 docs/Model/ApiV4KeyPerm.md create mode 100644 docs/Model/BatchFuturesOrder.md create mode 100644 docs/Model/CountdownCancelAllFuturesTask.md create mode 100644 docs/Model/CountdownCancelAllSpotTask.md create mode 100644 docs/Model/FuturesPremiumIndex.md create mode 100644 docs/Model/OptionsCandlestick.md create mode 100644 docs/Model/OptionsPositionCloseOrder.md create mode 100644 docs/Model/SubAccount.md create mode 100644 docs/Model/SubAccountKey.md create mode 100644 docs/Model/SubAccountToSubAccount.md create mode 100644 docs/Model/TriggerTime.md create mode 100644 src/Api/SubAccountApi.php create mode 100644 src/Model/ApiV4KeyPerm.php create mode 100644 src/Model/BatchFuturesOrder.php create mode 100644 src/Model/CountdownCancelAllFuturesTask.php create mode 100644 src/Model/CountdownCancelAllSpotTask.php create mode 100644 src/Model/FuturesPremiumIndex.php create mode 100644 src/Model/OptionsCandlestick.php create mode 100644 src/Model/OptionsPositionCloseOrder.php create mode 100644 src/Model/SubAccount.php create mode 100644 src/Model/SubAccountKey.php create mode 100644 src/Model/SubAccountToSubAccount.php create mode 100644 src/Model/TriggerTime.php diff --git a/README.md b/README.md index de2db6b..d13ce4b 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.26.0 -- Package version: 5.26.0 +- API version: 4.34.0 +- Package version: 5.34.0 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) @@ -122,7 +122,7 @@ Class | Method | HTTP request | Description *DeliveryApi* | [**listPriceTriggeredDeliveryOrders**](docs/Api/DeliveryApi.md#listpricetriggereddeliveryorders) | **GET** /delivery/{settle}/price_orders | List all auto orders *DeliveryApi* | [**createPriceTriggeredDeliveryOrder**](docs/Api/DeliveryApi.md#createpricetriggereddeliveryorder) | **POST** /delivery/{settle}/price_orders | Create a price-triggered order *DeliveryApi* | [**cancelPriceTriggeredDeliveryOrderList**](docs/Api/DeliveryApi.md#cancelpricetriggereddeliveryorderlist) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders -*DeliveryApi* | [**getPriceTriggeredDeliveryOrder**](docs/Api/DeliveryApi.md#getpricetriggereddeliveryorder) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a single order +*DeliveryApi* | [**getPriceTriggeredDeliveryOrder**](docs/Api/DeliveryApi.md#getpricetriggereddeliveryorder) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a price-triggered order *DeliveryApi* | [**cancelPriceTriggeredDeliveryOrder**](docs/Api/DeliveryApi.md#cancelpricetriggereddeliveryorder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order *FlashSwapApi* | [**listFlashSwapCurrencies**](docs/Api/FlashSwapApi.md#listflashswapcurrencies) | **GET** /flash_swap/currencies | List all supported currencies in flash swap *FlashSwapApi* | [**listFlashSwapOrders**](docs/Api/FlashSwapApi.md#listflashswaporders) | **GET** /flash_swap/orders | List all flash swap orders @@ -134,6 +134,7 @@ Class | Method | HTTP request | Description *FuturesApi* | [**listFuturesOrderBook**](docs/Api/FuturesApi.md#listfuturesorderbook) | **GET** /futures/{settle}/order_book | Futures order book *FuturesApi* | [**listFuturesTrades**](docs/Api/FuturesApi.md#listfuturestrades) | **GET** /futures/{settle}/trades | Futures trading history *FuturesApi* | [**listFuturesCandlesticks**](docs/Api/FuturesApi.md#listfuturescandlesticks) | **GET** /futures/{settle}/candlesticks | Get futures candlesticks +*FuturesApi* | [**listFuturesPremiumIndex**](docs/Api/FuturesApi.md#listfuturespremiumindex) | **GET** /futures/{settle}/premium_index | Premium Index K-Line *FuturesApi* | [**listFuturesTickers**](docs/Api/FuturesApi.md#listfuturestickers) | **GET** /futures/{settle}/tickers | List futures tickers *FuturesApi* | [**listFuturesFundingRateHistory**](docs/Api/FuturesApi.md#listfuturesfundingratehistory) | **GET** /futures/{settle}/funding_rate | Funding rate history *FuturesApi* | [**listFuturesInsuranceLedger**](docs/Api/FuturesApi.md#listfuturesinsuranceledger) | **GET** /futures/{settle}/insurance | Futures insurance balance history @@ -155,16 +156,18 @@ Class | Method | HTTP request | Description *FuturesApi* | [**listFuturesOrders**](docs/Api/FuturesApi.md#listfuturesorders) | **GET** /futures/{settle}/orders | List futures orders *FuturesApi* | [**createFuturesOrder**](docs/Api/FuturesApi.md#createfuturesorder) | **POST** /futures/{settle}/orders | Create a futures order *FuturesApi* | [**cancelFuturesOrders**](docs/Api/FuturesApi.md#cancelfuturesorders) | **DELETE** /futures/{settle}/orders | Cancel all `open` orders matched +*FuturesApi* | [**createBatchFuturesOrder**](docs/Api/FuturesApi.md#createbatchfuturesorder) | **POST** /futures/{settle}/batch_orders | Create a batch of futures orders *FuturesApi* | [**getFuturesOrder**](docs/Api/FuturesApi.md#getfuturesorder) | **GET** /futures/{settle}/orders/{order_id} | Get a single order *FuturesApi* | [**amendFuturesOrder**](docs/Api/FuturesApi.md#amendfuturesorder) | **PUT** /futures/{settle}/orders/{order_id} | Amend an order *FuturesApi* | [**cancelFuturesOrder**](docs/Api/FuturesApi.md#cancelfuturesorder) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel a single order *FuturesApi* | [**getMyTrades**](docs/Api/FuturesApi.md#getmytrades) | **GET** /futures/{settle}/my_trades | List personal trading history *FuturesApi* | [**listPositionClose**](docs/Api/FuturesApi.md#listpositionclose) | **GET** /futures/{settle}/position_close | List position close history *FuturesApi* | [**listLiquidates**](docs/Api/FuturesApi.md#listliquidates) | **GET** /futures/{settle}/liquidates | List liquidation history +*FuturesApi* | [**countdownCancelAllFutures**](docs/Api/FuturesApi.md#countdowncancelallfutures) | **POST** /futures/{settle}/countdown_cancel_all | Countdown cancel orders *FuturesApi* | [**listPriceTriggeredOrders**](docs/Api/FuturesApi.md#listpricetriggeredorders) | **GET** /futures/{settle}/price_orders | List all auto orders *FuturesApi* | [**createPriceTriggeredOrder**](docs/Api/FuturesApi.md#createpricetriggeredorder) | **POST** /futures/{settle}/price_orders | Create a price-triggered order *FuturesApi* | [**cancelPriceTriggeredOrderList**](docs/Api/FuturesApi.md#cancelpricetriggeredorderlist) | **DELETE** /futures/{settle}/price_orders | Cancel all open orders -*FuturesApi* | [**getPriceTriggeredOrder**](docs/Api/FuturesApi.md#getpricetriggeredorder) | **GET** /futures/{settle}/price_orders/{order_id} | Get a single order +*FuturesApi* | [**getPriceTriggeredOrder**](docs/Api/FuturesApi.md#getpricetriggeredorder) | **GET** /futures/{settle}/price_orders/{order_id} | Get a price-triggered order *FuturesApi* | [**cancelPriceTriggeredOrder**](docs/Api/FuturesApi.md#cancelpricetriggeredorder) | **DELETE** /futures/{settle}/price_orders/{order_id} | cancel a price-triggered order *MarginApi* | [**listMarginCurrencyPairs**](docs/Api/MarginApi.md#listmargincurrencypairs) | **GET** /margin/currency_pairs | List all supported currency pairs supported in margin trading *MarginApi* | [**getMarginCurrencyPair**](docs/Api/MarginApi.md#getmargincurrencypair) | **GET** /margin/currency_pairs/{currency_pair} | Query one single margin currency pair @@ -205,10 +208,10 @@ Class | Method | HTTP request | Description *OptionsApi* | [**listOptionsSettlements**](docs/Api/OptionsApi.md#listoptionssettlements) | **GET** /options/settlements | List settlement history *OptionsApi* | [**getOptionsSettlement**](docs/Api/OptionsApi.md#getoptionssettlement) | **GET** /options/settlements/{contract} | Get specified contract's settlement *OptionsApi* | [**listMyOptionsSettlements**](docs/Api/OptionsApi.md#listmyoptionssettlements) | **GET** /options/my_settlements | List my options settlements -*OptionsApi* | [**listOptionsOrderBook**](docs/Api/OptionsApi.md#listoptionsorderbook) | **GET** /options/order_book | Futures order book +*OptionsApi* | [**listOptionsOrderBook**](docs/Api/OptionsApi.md#listoptionsorderbook) | **GET** /options/order_book | Options order book *OptionsApi* | [**listOptionsTickers**](docs/Api/OptionsApi.md#listoptionstickers) | **GET** /options/tickers | List tickers of options contracts *OptionsApi* | [**listOptionsUnderlyingTickers**](docs/Api/OptionsApi.md#listoptionsunderlyingtickers) | **GET** /options/underlying/tickers/{underlying} | Get underlying ticker -*OptionsApi* | [**listOptionsCandlesticks**](docs/Api/OptionsApi.md#listoptionscandlesticks) | **GET** /options/candlesticks | Get futures candlesticks +*OptionsApi* | [**listOptionsCandlesticks**](docs/Api/OptionsApi.md#listoptionscandlesticks) | **GET** /options/candlesticks | Get options candlesticks *OptionsApi* | [**listOptionsUnderlyingCandlesticks**](docs/Api/OptionsApi.md#listoptionsunderlyingcandlesticks) | **GET** /options/underlying/candlesticks | Mark price candlesticks of an underlying *OptionsApi* | [**listOptionsTrades**](docs/Api/OptionsApi.md#listoptionstrades) | **GET** /options/trades | Options trade history *OptionsApi* | [**listOptionsAccount**](docs/Api/OptionsApi.md#listoptionsaccount) | **GET** /options/accounts | List options account @@ -216,7 +219,7 @@ Class | Method | HTTP request | Description *OptionsApi* | [**listOptionsPositions**](docs/Api/OptionsApi.md#listoptionspositions) | **GET** /options/positions | List user's positions of specified underlying *OptionsApi* | [**getOptionsPosition**](docs/Api/OptionsApi.md#getoptionsposition) | **GET** /options/positions/{contract} | Get specified contract position *OptionsApi* | [**listOptionsPositionClose**](docs/Api/OptionsApi.md#listoptionspositionclose) | **GET** /options/position_close | List user's liquidation history of specified underlying -*OptionsApi* | [**listOptionsOrders**](docs/Api/OptionsApi.md#listoptionsorders) | **GET** /options/orders | List futures orders +*OptionsApi* | [**listOptionsOrders**](docs/Api/OptionsApi.md#listoptionsorders) | **GET** /options/orders | List options orders *OptionsApi* | [**createOptionsOrder**](docs/Api/OptionsApi.md#createoptionsorder) | **POST** /options/orders | Create an options order *OptionsApi* | [**cancelOptionsOrders**](docs/Api/OptionsApi.md#canceloptionsorders) | **DELETE** /options/orders | Cancel all `open` orders matched *OptionsApi* | [**getOptionsOrder**](docs/Api/OptionsApi.md#getoptionsorder) | **GET** /options/orders/{order_id} | Get a single order @@ -243,11 +246,22 @@ Class | Method | HTTP request | Description *SpotApi* | [**cancelOrder**](docs/Api/SpotApi.md#cancelorder) | **DELETE** /spot/orders/{order_id} | Cancel a single order *SpotApi* | [**listMyTrades**](docs/Api/SpotApi.md#listmytrades) | **GET** /spot/my_trades | List personal trading history *SpotApi* | [**getSystemTime**](docs/Api/SpotApi.md#getsystemtime) | **GET** /spot/time | Get server current time +*SpotApi* | [**countdownCancelAllSpot**](docs/Api/SpotApi.md#countdowncancelallspot) | **POST** /spot/countdown_cancel_all | Countdown cancel orders *SpotApi* | [**listSpotPriceTriggeredOrders**](docs/Api/SpotApi.md#listspotpricetriggeredorders) | **GET** /spot/price_orders | Retrieve running auto order list *SpotApi* | [**createSpotPriceTriggeredOrder**](docs/Api/SpotApi.md#createspotpricetriggeredorder) | **POST** /spot/price_orders | Create a price-triggered order *SpotApi* | [**cancelSpotPriceTriggeredOrderList**](docs/Api/SpotApi.md#cancelspotpricetriggeredorderlist) | **DELETE** /spot/price_orders | Cancel all open orders -*SpotApi* | [**getSpotPriceTriggeredOrder**](docs/Api/SpotApi.md#getspotpricetriggeredorder) | **GET** /spot/price_orders/{order_id} | Get a single order +*SpotApi* | [**getSpotPriceTriggeredOrder**](docs/Api/SpotApi.md#getspotpricetriggeredorder) | **GET** /spot/price_orders/{order_id} | Get a price-triggered order *SpotApi* | [**cancelSpotPriceTriggeredOrder**](docs/Api/SpotApi.md#cancelspotpricetriggeredorder) | **DELETE** /spot/price_orders/{order_id} | cancel a price-triggered order +*SubAccountApi* | [**listSubAccounts**](docs/Api/SubAccountApi.md#listsubaccounts) | **GET** /sub_accounts | List sub-accounts +*SubAccountApi* | [**createSubAccounts**](docs/Api/SubAccountApi.md#createsubaccounts) | **POST** /sub_accounts | Create a new sub-account +*SubAccountApi* | [**getSubAccount**](docs/Api/SubAccountApi.md#getsubaccount) | **GET** /sub_accounts/{user_id} | Get the sub-account +*SubAccountApi* | [**listSubAccountKeys**](docs/Api/SubAccountApi.md#listsubaccountkeys) | **GET** /sub_accounts/{user_id}/keys | List all API Key of the sub-account +*SubAccountApi* | [**createSubAccountKeys**](docs/Api/SubAccountApi.md#createsubaccountkeys) | **POST** /sub_accounts/{user_id}/keys | Create API Key of the sub-account +*SubAccountApi* | [**getSubAccountKey**](docs/Api/SubAccountApi.md#getsubaccountkey) | **GET** /sub_accounts/{user_id}/keys/{key} | Get the API Key of the sub-account +*SubAccountApi* | [**updateSubAccountKeys**](docs/Api/SubAccountApi.md#updatesubaccountkeys) | **PUT** /sub_accounts/{user_id}/keys/{key} | Update API key of the sub-account +*SubAccountApi* | [**deleteSubAccountKeys**](docs/Api/SubAccountApi.md#deletesubaccountkeys) | **DELETE** /sub_accounts/{user_id}/keys/{key} | Delete API key of the sub-account +*SubAccountApi* | [**lockSubAccount**](docs/Api/SubAccountApi.md#locksubaccount) | **POST** /sub_accounts/{user_id}/lock | Lock the sub-account +*SubAccountApi* | [**unlockSubAccount**](docs/Api/SubAccountApi.md#unlocksubaccount) | **POST** /sub_accounts/{user_id}/unlock | Unlock the sub-account *WalletApi* | [**listCurrencyChains**](docs/Api/WalletApi.md#listcurrencychains) | **GET** /wallet/currency_chains | List chains supported for specified currency *WalletApi* | [**getDepositAddress**](docs/Api/WalletApi.md#getdepositaddress) | **GET** /wallet/deposit_address | Generate currency deposit address *WalletApi* | [**listWithdrawals**](docs/Api/WalletApi.md#listwithdrawals) | **GET** /wallet/withdrawals | Retrieve withdrawal records @@ -255,6 +269,7 @@ Class | Method | HTTP request | Description *WalletApi* | [**transfer**](docs/Api/WalletApi.md#transfer) | **POST** /wallet/transfers | Transfer between trading accounts *WalletApi* | [**listSubAccountTransfers**](docs/Api/WalletApi.md#listsubaccounttransfers) | **GET** /wallet/sub_account_transfers | Retrieve transfer records between main and sub accounts *WalletApi* | [**transferWithSubAccount**](docs/Api/WalletApi.md#transferwithsubaccount) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts +*WalletApi* | [**subAccountToSubAccount**](docs/Api/WalletApi.md#subaccounttosubaccount) | **POST** /wallet/sub_account_to_sub_account | Sub-account transfers to sub-account *WalletApi* | [**listWithdrawStatus**](docs/Api/WalletApi.md#listwithdrawstatus) | **GET** /wallet/withdraw_status | Retrieve withdrawal status *WalletApi* | [**listSubAccountBalances**](docs/Api/WalletApi.md#listsubaccountbalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances *WalletApi* | [**listSubAccountMarginBalances**](docs/Api/WalletApi.md#listsubaccountmarginbalances) | **GET** /wallet/sub_account_margin_balances | Query sub accounts' margin balances @@ -270,12 +285,16 @@ Class | Method | HTTP request | Description ## Documentation For Models - [AccountBalance](docs/Model/AccountBalance.md) + - [ApiV4KeyPerm](docs/Model/ApiV4KeyPerm.md) - [AutoRepaySetting](docs/Model/AutoRepaySetting.md) + - [BatchFuturesOrder](docs/Model/BatchFuturesOrder.md) - [BatchOrder](docs/Model/BatchOrder.md) - [CancelOrder](docs/Model/CancelOrder.md) - [CancelOrderResult](docs/Model/CancelOrderResult.md) - [Contract](docs/Model/Contract.md) - [ContractStat](docs/Model/ContractStat.md) + - [CountdownCancelAllFuturesTask](docs/Model/CountdownCancelAllFuturesTask.md) + - [CountdownCancelAllSpotTask](docs/Model/CountdownCancelAllSpotTask.md) - [CrossMarginAccount](docs/Model/CrossMarginAccount.md) - [CrossMarginAccountBook](docs/Model/CrossMarginAccountBook.md) - [CrossMarginBalance](docs/Model/CrossMarginBalance.md) @@ -309,6 +328,7 @@ Class | Method | HTTP request | Description - [FuturesOrderAmendment](docs/Model/FuturesOrderAmendment.md) - [FuturesOrderBook](docs/Model/FuturesOrderBook.md) - [FuturesOrderBookItem](docs/Model/FuturesOrderBookItem.md) + - [FuturesPremiumIndex](docs/Model/FuturesPremiumIndex.md) - [FuturesPriceTrigger](docs/Model/FuturesPriceTrigger.md) - [FuturesPriceTriggeredOrder](docs/Model/FuturesPriceTriggeredOrder.md) - [FuturesTicker](docs/Model/FuturesTicker.md) @@ -331,12 +351,14 @@ Class | Method | HTTP request | Description - [OpenOrders](docs/Model/OpenOrders.md) - [OptionsAccount](docs/Model/OptionsAccount.md) - [OptionsAccountBook](docs/Model/OptionsAccountBook.md) + - [OptionsCandlestick](docs/Model/OptionsCandlestick.md) - [OptionsContract](docs/Model/OptionsContract.md) - [OptionsMySettlements](docs/Model/OptionsMySettlements.md) - [OptionsMyTrade](docs/Model/OptionsMyTrade.md) - [OptionsOrder](docs/Model/OptionsOrder.md) - [OptionsPosition](docs/Model/OptionsPosition.md) - [OptionsPositionClose](docs/Model/OptionsPositionClose.md) + - [OptionsPositionCloseOrder](docs/Model/OptionsPositionCloseOrder.md) - [OptionsSettlement](docs/Model/OptionsSettlement.md) - [OptionsTicker](docs/Model/OptionsTicker.md) - [OptionsUnderlying](docs/Model/OptionsUnderlying.md) @@ -353,10 +375,13 @@ Class | Method | HTTP request | Description - [SpotPricePutOrder](docs/Model/SpotPricePutOrder.md) - [SpotPriceTrigger](docs/Model/SpotPriceTrigger.md) - [SpotPriceTriggeredOrder](docs/Model/SpotPriceTriggeredOrder.md) + - [SubAccount](docs/Model/SubAccount.md) - [SubAccountBalance](docs/Model/SubAccountBalance.md) - [SubAccountCrossMarginBalance](docs/Model/SubAccountCrossMarginBalance.md) - [SubAccountFuturesBalance](docs/Model/SubAccountFuturesBalance.md) + - [SubAccountKey](docs/Model/SubAccountKey.md) - [SubAccountMarginBalance](docs/Model/SubAccountMarginBalance.md) + - [SubAccountToSubAccount](docs/Model/SubAccountToSubAccount.md) - [SubAccountTransfer](docs/Model/SubAccountTransfer.md) - [SubCrossMarginAccount](docs/Model/SubCrossMarginAccount.md) - [SystemTime](docs/Model/SystemTime.md) @@ -367,6 +392,7 @@ Class | Method | HTTP request | Description - [TransactionID](docs/Model/TransactionID.md) - [Transfer](docs/Model/Transfer.md) - [TriggerOrderResponse](docs/Model/TriggerOrderResponse.md) + - [TriggerTime](docs/Model/TriggerTime.md) - [WithdrawStatus](docs/Model/WithdrawStatus.md) diff --git a/composer.json b/composer.json index bf59e0e..1d070ab 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.26.0", + "version": "5.34.0", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index 30a8b55..f5a11ed 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "466eff280a740e0d485beaf696a15b83", + "content-hash": "cd455e0d8a77e0dfea9ca46e05e26094", "packages": [ { "name": "guzzlehttp/guzzle", @@ -123,16 +123,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.5.1", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + "reference": "b94b2807d85443f9719887892882d0329d1e2598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", + "reference": "b94b2807d85443f9719887892882d0329d1e2598", "shasum": "" }, "require": { @@ -187,7 +187,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" + "source": "https://github.com/guzzle/promises/tree/1.5.2" }, "funding": [ { @@ -203,7 +203,7 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:56:57+00:00" + "time": "2022-08-28T14:55:35+00:00" }, { "name": "guzzlehttp/psr7", @@ -414,16 +414,16 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8" + "reference": "639084e360537a19f9ee352433b84ce831f3d2da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/59a8d271f00dd0e4c2e518104cc7963f655a1aa8", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", + "reference": "639084e360537a19f9ee352433b84ce831f3d2da", "shasum": "" }, "require": { @@ -437,7 +437,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -481,7 +481,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" }, "funding": [ { @@ -497,20 +497,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", "shasum": "" }, "require": { @@ -522,7 +522,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -565,7 +565,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" }, "funding": [ { @@ -581,20 +581,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2" + "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/bf44a9fd41feaac72b074de600314a93e2ae78e2", - "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", + "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", "shasum": "" }, "require": { @@ -603,7 +603,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -641,7 +641,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0" }, "funding": [ { @@ -657,7 +657,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" } ], "packages-dev": [ @@ -1429,6 +1429,7 @@ "issues": "https://github.com/PHP-CS-Fixer/diff/issues", "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" }, + "abandoned": true, "time": "2020-10-14T08:39:05+00:00" }, { @@ -1543,25 +1544,30 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.1", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", + "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { @@ -1587,27 +1593,27 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" }, - "time": "2022-03-15T21:29:03+00:00" + "time": "2022-10-14T12:47:21+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be8cac52a0827776ff9ccda8c381ac5b71aeb359", + "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.*", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" @@ -1654,9 +1660,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.16.0" }, - "time": "2021-12-08T12:19:24+00:00" + "time": "2022-11-29T15:06:56+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2291,16 +2297,16 @@ }, { "name": "sebastian/comparator", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" + "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dc7ceb4a24aede938c7af2a9ed1de09609ca770", + "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770", "shasum": "" }, "require": { @@ -2353,7 +2359,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.5" }, "funding": [ { @@ -2361,7 +2367,7 @@ "type": "github" } ], - "time": "2020-11-30T08:04:30+00:00" + "time": "2022-09-14T12:31:48+00:00" }, { "name": "sebastian/diff", @@ -2494,16 +2500,16 @@ }, { "name": "sebastian/exporter", - "version": "3.1.4", + "version": "3.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" + "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6", + "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6", "shasum": "" }, "require": { @@ -2559,7 +2565,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.5" }, "funding": [ { @@ -2567,7 +2573,7 @@ "type": "github" } ], - "time": "2021-11-11T13:51:24+00:00" + "time": "2022-09-14T06:00:17+00:00" }, { "name": "sebastian/global-state", @@ -2956,16 +2962,16 @@ }, { "name": "symfony/console", - "version": "v5.4.10", + "version": "v5.4.16", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000" + "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/4d671ab4ddac94ee439ea73649c69d9d200b5000", - "reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000", + "url": "https://api.github.com/repos/symfony/console/zipball/8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", + "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", "shasum": "" }, "require": { @@ -3035,7 +3041,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.10" + "source": "https://github.com/symfony/console/tree/v5.4.16" }, "funding": [ { @@ -3051,7 +3057,7 @@ "type": "tidelift" } ], - "time": "2022-06-26T13:00:04+00:00" + "time": "2022-11-25T14:09:27+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3286,16 +3292,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.9", + "version": "v5.4.13", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba" + "reference": "ac09569844a9109a5966b9438fc29113ce77cf51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/36a017fa4cce1eff1b8e8129ff53513abcef05ba", - "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/ac09569844a9109a5966b9438fc29113ce77cf51", + "reference": "ac09569844a9109a5966b9438fc29113ce77cf51", "shasum": "" }, "require": { @@ -3330,7 +3336,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.9" + "source": "https://github.com/symfony/filesystem/tree/v5.4.13" }, "funding": [ { @@ -3346,20 +3352,20 @@ "type": "tidelift" } ], - "time": "2022-05-20T13:55:35+00:00" + "time": "2022-09-21T19:53:16+00:00" }, { "name": "symfony/finder", - "version": "v5.4.8", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9" + "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9b630f3427f3ebe7cd346c277a1408b00249dad9", - "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9", + "url": "https://api.github.com/repos/symfony/finder/zipball/7872a66f57caffa2916a584db1aa7f12adc76f8c", + "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c", "shasum": "" }, "require": { @@ -3393,7 +3399,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.8" + "source": "https://github.com/symfony/finder/tree/v5.4.11" }, "funding": [ { @@ -3409,20 +3415,20 @@ "type": "tidelift" } ], - "time": "2022-04-15T08:07:45+00:00" + "time": "2022-07-29T07:37:50+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.3", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8" + "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc1147cb11af1b43f503ac18f31aa3bec213aba8", - "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/54f14e36aa73cb8f7261d7686691fd4d75ea2690", + "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690", "shasum": "" }, "require": { @@ -3462,7 +3468,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.3" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.11" }, "funding": [ { @@ -3478,20 +3484,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-07-20T13:00:38+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { @@ -3506,7 +3512,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3544,7 +3550,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" }, "funding": [ { @@ -3560,20 +3566,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", "shasum": "" }, "require": { @@ -3585,7 +3591,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3625,7 +3631,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" }, "funding": [ { @@ -3641,20 +3647,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { @@ -3669,7 +3675,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3708,7 +3714,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" }, "funding": [ { @@ -3724,7 +3730,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php70", @@ -3796,16 +3802,16 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", "shasum": "" }, "require": { @@ -3814,7 +3820,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3855,7 +3861,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" }, "funding": [ { @@ -3871,20 +3877,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", "shasum": "" }, "require": { @@ -3893,7 +3899,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3938,7 +3944,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" }, "funding": [ { @@ -3954,20 +3960,20 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/process", - "version": "v5.4.8", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3" + "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", - "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", + "url": "https://api.github.com/repos/symfony/process/zipball/6e75fe6874cbc7e4773d049616ab450eff537bf1", + "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1", "shasum": "" }, "require": { @@ -4000,7 +4006,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.8" + "source": "https://github.com/symfony/process/tree/v5.4.11" }, "funding": [ { @@ -4016,7 +4022,7 @@ "type": "tidelift" } ], - "time": "2022-04-08T05:07:18+00:00" + "time": "2022-06-27T16:58:25+00:00" }, { "name": "symfony/service-contracts", @@ -4103,16 +4109,16 @@ }, { "name": "symfony/stopwatch", - "version": "v5.4.5", + "version": "v5.4.13", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30" + "reference": "6df7a3effde34d81717bbef4591e5ffe32226d69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", - "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6df7a3effde34d81717bbef4591e5ffe32226d69", + "reference": "6df7a3effde34d81717bbef4591e5ffe32226d69", "shasum": "" }, "require": { @@ -4145,7 +4151,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.5" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.13" }, "funding": [ { @@ -4161,20 +4167,20 @@ "type": "tidelift" } ], - "time": "2022-02-18T16:06:09+00:00" + "time": "2022-09-28T13:19:49+00:00" }, { "name": "symfony/string", - "version": "v5.4.10", + "version": "v5.4.15", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "4432bc7df82a554b3e413a8570ce2fea90e94097" + "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/4432bc7df82a554b3e413a8570ce2fea90e94097", - "reference": "4432bc7df82a554b3e413a8570ce2fea90e94097", + "url": "https://api.github.com/repos/symfony/string/zipball/571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", + "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", "shasum": "" }, "require": { @@ -4231,7 +4237,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.10" + "source": "https://github.com/symfony/string/tree/v5.4.15" }, "funding": [ { @@ -4247,7 +4253,7 @@ "type": "tidelift" } ], - "time": "2022-06-26T15:57:47+00:00" + "time": "2022-10-05T15:16:54+00:00" }, { "name": "theseer/tokenizer", diff --git a/docs/Api/DeliveryApi.md b/docs/Api/DeliveryApi.md index 66448cd..d54f991 100644 --- a/docs/Api/DeliveryApi.md +++ b/docs/Api/DeliveryApi.md @@ -30,7 +30,7 @@ Method | HTTP request | Description [**listPriceTriggeredDeliveryOrders**](DeliveryApi.md#listPriceTriggeredDeliveryOrders) | **GET** /delivery/{settle}/price_orders | List all auto orders [**createPriceTriggeredDeliveryOrder**](DeliveryApi.md#createPriceTriggeredDeliveryOrder) | **POST** /delivery/{settle}/price_orders | Create a price-triggered order [**cancelPriceTriggeredDeliveryOrderList**](DeliveryApi.md#cancelPriceTriggeredDeliveryOrderList) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders -[**getPriceTriggeredDeliveryOrder**](DeliveryApi.md#getPriceTriggeredDeliveryOrder) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a single order +[**getPriceTriggeredDeliveryOrder**](DeliveryApi.md#getPriceTriggeredDeliveryOrder) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a price-triggered order [**cancelPriceTriggeredDeliveryOrder**](DeliveryApi.md#cancelPriceTriggeredDeliveryOrder) | **DELETE** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order @@ -1724,7 +1724,7 @@ Name | Type | Description | Notes > \GateApi\Model\FuturesPriceTriggeredOrder getPriceTriggeredDeliveryOrder($settle, $order_id) -Get a single order +Get a price-triggered order ### Example diff --git a/docs/Api/FuturesApi.md b/docs/Api/FuturesApi.md index 52a5138..a93b6b0 100644 --- a/docs/Api/FuturesApi.md +++ b/docs/Api/FuturesApi.md @@ -9,6 +9,7 @@ Method | HTTP request | Description [**listFuturesOrderBook**](FuturesApi.md#listFuturesOrderBook) | **GET** /futures/{settle}/order_book | Futures order book [**listFuturesTrades**](FuturesApi.md#listFuturesTrades) | **GET** /futures/{settle}/trades | Futures trading history [**listFuturesCandlesticks**](FuturesApi.md#listFuturesCandlesticks) | **GET** /futures/{settle}/candlesticks | Get futures candlesticks +[**listFuturesPremiumIndex**](FuturesApi.md#listFuturesPremiumIndex) | **GET** /futures/{settle}/premium_index | Premium Index K-Line [**listFuturesTickers**](FuturesApi.md#listFuturesTickers) | **GET** /futures/{settle}/tickers | List futures tickers [**listFuturesFundingRateHistory**](FuturesApi.md#listFuturesFundingRateHistory) | **GET** /futures/{settle}/funding_rate | Funding rate history [**listFuturesInsuranceLedger**](FuturesApi.md#listFuturesInsuranceLedger) | **GET** /futures/{settle}/insurance | Futures insurance balance history @@ -30,16 +31,18 @@ Method | HTTP request | Description [**listFuturesOrders**](FuturesApi.md#listFuturesOrders) | **GET** /futures/{settle}/orders | List futures orders [**createFuturesOrder**](FuturesApi.md#createFuturesOrder) | **POST** /futures/{settle}/orders | Create a futures order [**cancelFuturesOrders**](FuturesApi.md#cancelFuturesOrders) | **DELETE** /futures/{settle}/orders | Cancel all `open` orders matched +[**createBatchFuturesOrder**](FuturesApi.md#createBatchFuturesOrder) | **POST** /futures/{settle}/batch_orders | Create a batch of futures orders [**getFuturesOrder**](FuturesApi.md#getFuturesOrder) | **GET** /futures/{settle}/orders/{order_id} | Get a single order [**amendFuturesOrder**](FuturesApi.md#amendFuturesOrder) | **PUT** /futures/{settle}/orders/{order_id} | Amend an order [**cancelFuturesOrder**](FuturesApi.md#cancelFuturesOrder) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel a single order [**getMyTrades**](FuturesApi.md#getMyTrades) | **GET** /futures/{settle}/my_trades | List personal trading history [**listPositionClose**](FuturesApi.md#listPositionClose) | **GET** /futures/{settle}/position_close | List position close history [**listLiquidates**](FuturesApi.md#listLiquidates) | **GET** /futures/{settle}/liquidates | List liquidation history +[**countdownCancelAllFutures**](FuturesApi.md#countdownCancelAllFutures) | **POST** /futures/{settle}/countdown_cancel_all | Countdown cancel orders [**listPriceTriggeredOrders**](FuturesApi.md#listPriceTriggeredOrders) | **GET** /futures/{settle}/price_orders | List all auto orders [**createPriceTriggeredOrder**](FuturesApi.md#createPriceTriggeredOrder) | **POST** /futures/{settle}/price_orders | Create a price-triggered order [**cancelPriceTriggeredOrderList**](FuturesApi.md#cancelPriceTriggeredOrderList) | **DELETE** /futures/{settle}/price_orders | Cancel all open orders -[**getPriceTriggeredOrder**](FuturesApi.md#getPriceTriggeredOrder) | **GET** /futures/{settle}/price_orders/{order_id} | Get a single order +[**getPriceTriggeredOrder**](FuturesApi.md#getPriceTriggeredOrder) | **GET** /futures/{settle}/price_orders/{order_id} | Get a price-triggered order [**cancelPriceTriggeredOrder**](FuturesApi.md#cancelPriceTriggeredOrder) | **DELETE** /futures/{settle}/price_orders/{order_id} | cancel a price-triggered order @@ -227,7 +230,7 @@ No authorization required ## listFuturesTrades -> \GateApi\Model\FuturesTrade[] listFuturesTrades($settle, $contract, $limit, $last_id, $from, $to) +> \GateApi\Model\FuturesTrade[] listFuturesTrades($settle, $contract, $limit, $offset, $last_id, $from, $to) Futures trading history @@ -246,6 +249,7 @@ $apiInstance = new GateApi\Api\FuturesApi( $associate_array['settle'] = 'usdt'; // string | Settle currency $associate_array['contract'] = 'BTC_USDT'; // string | Futures contract $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['last_id'] = '12345'; // string | Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range $associate_array['from'] = 1546905600; // int | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. $associate_array['to'] = 1546935600; // int | Specify end time in Unix seconds, default to current time @@ -271,6 +275,7 @@ Name | Type | Description | Notes **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **last_id** | **string**| Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range | [optional] **from** | **int**| Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. | [optional] **to** | **int**| Specify end time in Unix seconds, default to current time | [optional] @@ -363,6 +368,76 @@ No authorization required [[Back to README]](../../README.md) +## listFuturesPremiumIndex + +> \GateApi\Model\FuturesPremiumIndex[] listFuturesPremiumIndex($settle, $contract, $from, $to, $limit, $interval) + +Premium Index K-Line + +Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval + +### Example + +```php +listFuturesPremiumIndex($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FuturesApi->listFuturesPremiumIndex: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **string**| Settle currency | + **contract** | **string**| Futures contract | + **from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] + **to** | **int**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] + **limit** | **int**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] + **interval** | **string**| Interval time between data points | [optional] [default to '5m'] + +### Return type + +[**\GateApi\Model\FuturesPremiumIndex[]**](../Model/FuturesPremiumIndex.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listFuturesTickers > \GateApi\Model\FuturesTicker[] listFuturesTickers($settle, $contract) @@ -1507,7 +1582,7 @@ Name | Type | Description | Notes ## listFuturesOrders -> \GateApi\Model\FuturesOrder[] listFuturesOrders($settle, $contract, $status, $limit, $offset, $last_id, $count_total) +> \GateApi\Model\FuturesOrder[] listFuturesOrders($settle, $contract, $status, $limit, $offset, $last_id) List futures orders @@ -1535,7 +1610,6 @@ $associate_array['status'] = 'open'; // string | Only list the orders with this $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['last_id'] = '12345'; // string | Specify list staring point using the `id` of last record in previous list-query results -$associate_array['count_total'] = 0; // int | Whether to return total number matched. Default to 0(no return) try { $result = $apiInstance->listFuturesOrders($associate_array); @@ -1561,7 +1635,6 @@ Name | Type | Description | Notes **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **last_id** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] - **count_total** | **int**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] ### Return type @@ -1711,6 +1784,70 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## createBatchFuturesOrder + +> \GateApi\Model\BatchFuturesOrder[] createBatchFuturesOrder($settle, $futures_order) + +Create a batch of futures orders + +- Up to 10 orders per request - If any of the order's parameters are missing or in the wrong format, all of them will not be executed, and a http status 400 error will be returned directly - If the parameters are checked and passed, all are executed. Even if there is a business logic error in the middle (such as insufficient funds), it will not affect other execution orders - The returned result is in array format, and the order corresponds to the orders in the request body - In the returned result, the `succeeded` field of type bool indicates whether the execution was successful or not - If the execution is successful, the normal order content is included; if the execution fails, the `label` field is included to indicate the cause of the error - In the rate limiting, each order is counted individually + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\FuturesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$settle = 'usdt'; // string | Settle currency +$futures_order = array(new \GateApi\Model\FuturesOrder()); // \GateApi\Model\FuturesOrder[] | + +try { + $result = $apiInstance->createBatchFuturesOrder($settle, $futures_order); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FuturesApi->createBatchFuturesOrder: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **string**| Settle currency | + **futures_order** | [**\GateApi\Model\FuturesOrder[]**](../Model/FuturesOrder.md)| | + +### Return type + +[**\GateApi\Model\BatchFuturesOrder[]**](../Model/BatchFuturesOrder.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## getFuturesOrder > \GateApi\Model\FuturesOrder getFuturesOrder($settle, $order_id) @@ -1736,7 +1873,7 @@ $apiInstance = new GateApi\Api\FuturesApi( $config ); $settle = 'usdt'; // string | Settle currency -$order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +$order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. try { $result = $apiInstance->getFuturesOrder($settle, $order_id); @@ -1755,7 +1892,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | + **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. | ### Return type @@ -1798,7 +1935,7 @@ $apiInstance = new GateApi\Api\FuturesApi( $config ); $settle = 'usdt'; // string | Settle currency -$order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +$order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. $futures_order_amendment = new \GateApi\Model\FuturesOrderAmendment(); // \GateApi\Model\FuturesOrderAmendment | try { @@ -1818,7 +1955,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | + **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. | **futures_order_amendment** | [**\GateApi\Model\FuturesOrderAmendment**](../Model/FuturesOrderAmendment.md)| | ### Return type @@ -1862,7 +1999,7 @@ $apiInstance = new GateApi\Api\FuturesApi( $config ); $settle = 'usdt'; // string | Settle currency -$order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +$order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. try { $result = $apiInstance->cancelFuturesOrder($settle, $order_id); @@ -1881,7 +2018,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **string**| Settle currency | - **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | + **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. | ### Return type @@ -1903,7 +2040,7 @@ Name | Type | Description | Notes ## getMyTrades -> \GateApi\Model\MyFuturesTrade[] getMyTrades($settle, $contract, $order, $limit, $offset, $last_id, $count_total) +> \GateApi\Model\MyFuturesTrade[] getMyTrades($settle, $contract, $order, $limit, $offset, $last_id) List personal trading history @@ -1929,7 +2066,6 @@ $associate_array['order'] = 12345; // int | Futures order ID, return related dat $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['last_id'] = '12345'; // string | Specify list staring point using the `id` of last record in previous list-query results -$associate_array['count_total'] = 0; // int | Whether to return total number matched. Default to 0(no return) try { $result = $apiInstance->getMyTrades($associate_array); @@ -1955,7 +2091,6 @@ Name | Type | Description | Notes **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **last_id** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] - **count_total** | **int**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] ### Return type @@ -2115,6 +2250,70 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## countdownCancelAllFutures + +> \GateApi\Model\TriggerTime countdownCancelAllFutures($settle, $countdown_cancel_all_futures_task) + +Countdown cancel orders + +When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown`timeout` is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified `market` will be automatically cancelled, if no `market` is specified, all market pending orders will be cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the cacnel function will be cancelled. + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\FuturesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$settle = 'usdt'; // string | Settle currency +$countdown_cancel_all_futures_task = new \GateApi\Model\CountdownCancelAllFuturesTask(); // \GateApi\Model\CountdownCancelAllFuturesTask | + +try { + $result = $apiInstance->countdownCancelAllFutures($settle, $countdown_cancel_all_futures_task); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FuturesApi->countdownCancelAllFutures: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **string**| Settle currency | + **countdown_cancel_all_futures_task** | [**\GateApi\Model\CountdownCancelAllFuturesTask**](../Model/CountdownCancelAllFuturesTask.md)| | + +### Return type + +[**\GateApi\Model\TriggerTime**](../Model/TriggerTime.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listPriceTriggeredOrders > \GateApi\Model\FuturesPriceTriggeredOrder[] listPriceTriggeredOrders($settle, $status, $contract, $limit, $offset) @@ -2313,7 +2512,7 @@ Name | Type | Description | Notes > \GateApi\Model\FuturesPriceTriggeredOrder getPriceTriggeredOrder($settle, $order_id) -Get a single order +Get a price-triggered order ### Example diff --git a/docs/Api/OptionsApi.md b/docs/Api/OptionsApi.md index f13fb2f..021bb87 100644 --- a/docs/Api/OptionsApi.md +++ b/docs/Api/OptionsApi.md @@ -11,10 +11,10 @@ Method | HTTP request | Description [**listOptionsSettlements**](OptionsApi.md#listOptionsSettlements) | **GET** /options/settlements | List settlement history [**getOptionsSettlement**](OptionsApi.md#getOptionsSettlement) | **GET** /options/settlements/{contract} | Get specified contract's settlement [**listMyOptionsSettlements**](OptionsApi.md#listMyOptionsSettlements) | **GET** /options/my_settlements | List my options settlements -[**listOptionsOrderBook**](OptionsApi.md#listOptionsOrderBook) | **GET** /options/order_book | Futures order book +[**listOptionsOrderBook**](OptionsApi.md#listOptionsOrderBook) | **GET** /options/order_book | Options order book [**listOptionsTickers**](OptionsApi.md#listOptionsTickers) | **GET** /options/tickers | List tickers of options contracts [**listOptionsUnderlyingTickers**](OptionsApi.md#listOptionsUnderlyingTickers) | **GET** /options/underlying/tickers/{underlying} | Get underlying ticker -[**listOptionsCandlesticks**](OptionsApi.md#listOptionsCandlesticks) | **GET** /options/candlesticks | Get futures candlesticks +[**listOptionsCandlesticks**](OptionsApi.md#listOptionsCandlesticks) | **GET** /options/candlesticks | Get options candlesticks [**listOptionsUnderlyingCandlesticks**](OptionsApi.md#listOptionsUnderlyingCandlesticks) | **GET** /options/underlying/candlesticks | Mark price candlesticks of an underlying [**listOptionsTrades**](OptionsApi.md#listOptionsTrades) | **GET** /options/trades | Options trade history [**listOptionsAccount**](OptionsApi.md#listOptionsAccount) | **GET** /options/accounts | List options account @@ -22,7 +22,7 @@ Method | HTTP request | Description [**listOptionsPositions**](OptionsApi.md#listOptionsPositions) | **GET** /options/positions | List user's positions of specified underlying [**getOptionsPosition**](OptionsApi.md#getOptionsPosition) | **GET** /options/positions/{contract} | Get specified contract position [**listOptionsPositionClose**](OptionsApi.md#listOptionsPositionClose) | **GET** /options/position_close | List user's liquidation history of specified underlying -[**listOptionsOrders**](OptionsApi.md#listOptionsOrders) | **GET** /options/orders | List futures orders +[**listOptionsOrders**](OptionsApi.md#listOptionsOrders) | **GET** /options/orders | List options orders [**createOptionsOrder**](OptionsApi.md#createOptionsOrder) | **POST** /options/orders | Create an options order [**cancelOptionsOrders**](OptionsApi.md#cancelOptionsOrders) | **DELETE** /options/orders | Cancel all `open` orders matched [**getOptionsOrder**](OptionsApi.md#getOptionsOrder) | **GET** /options/orders/{order_id} | Get a single order @@ -100,7 +100,7 @@ $apiInstance = new GateApi\Api\OptionsApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$underlying = 'BTC_USDT'; // string | Underlying +$underlying = 'BTC_USDT'; // string | Underlying (Obtained by listing underlying endpoint) try { $result = $apiInstance->listOptionsExpirations($underlying); @@ -118,7 +118,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | ### Return type @@ -156,7 +156,7 @@ $apiInstance = new GateApi\Api\OptionsApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying +$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying (Obtained by listing underlying endpoint) $associate_array['expiration'] = 1636588800; // int | Unix timestamp of the expiration time try { @@ -177,7 +177,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | **expiration** | **int**| Unix timestamp of the expiration time | [optional] ### Return type @@ -272,7 +272,7 @@ $apiInstance = new GateApi\Api\OptionsApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying +$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying (Obtained by listing underlying endpoint) $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['from'] = 1547706332; // int | Start timestamp @@ -296,7 +296,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **from** | **int**| Start timestamp | [optional] @@ -339,7 +339,7 @@ $apiInstance = new GateApi\Api\OptionsApi( new GuzzleHttp\Client() ); $contract = 'BTC_USDT-20211130-65000-C'; // string | -$underlying = 'BTC_USDT'; // string | Underlying +$underlying = 'BTC_USDT'; // string | Underlying (Obtained by listing underlying endpoint) $at = 56; // int | try { @@ -359,7 +359,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **string**| | - **underlying** | **string**| Underlying | + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | **at** | **int**| | ### Return type @@ -402,8 +402,8 @@ $apiInstance = new GateApi\Api\OptionsApi( new GuzzleHttp\Client(), $config ); -$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying -$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Contract name +$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying (Obtained by listing underlying endpoint) +$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Options contract name $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['from'] = 1547706332; // int | Start timestamp @@ -427,8 +427,8 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | - **contract** | **string**| Contract name | [optional] + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | + **contract** | **string**| Options contract name | [optional] **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **from** | **int**| Start timestamp | [optional] @@ -456,7 +456,7 @@ Name | Type | Description | Notes > \GateApi\Model\FuturesOrderBook listOptionsOrderBook($contract, $interval, $limit, $with_id) -Futures order book +Options order book Bids will be sorted by price from high to low, while asks sorted reversely @@ -472,7 +472,7 @@ $apiInstance = new GateApi\Api\OptionsApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$associate_array['contract'] = 'BTC_USDT'; // string | Futures contract +$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Options contract name $associate_array['interval'] = '0'; // string | Order depth. 0 means no aggregation is applied. default to 0 $associate_array['limit'] = 10; // int | Maximum number of order depth data in asks or bids $associate_array['with_id'] = false; // bool | Whether the order book update ID will be returned. This ID increases by 1 on every order book update @@ -495,7 +495,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **contract** | **string**| Futures contract | + **contract** | **string**| Options contract name | **interval** | **string**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0'] **limit** | **int**| Maximum number of order depth data in asks or bids | [optional] [default to 10] **with_id** | **bool**| Whether the order book update ID will be returned. This ID increases by 1 on every order book update | [optional] [default to false] @@ -536,7 +536,7 @@ $apiInstance = new GateApi\Api\OptionsApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$underlying = 'BTC_USDT'; // string | Underlying +$underlying = 'BTC_USDT'; // string | Underlying (Obtained by listing underlying endpoint) try { $result = $apiInstance->listOptionsTickers($underlying); @@ -554,7 +554,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | ### Return type @@ -632,9 +632,9 @@ No authorization required ## listOptionsCandlesticks -> \GateApi\Model\FuturesCandlestick[] listOptionsCandlesticks($contract, $limit, $from, $to, $interval) +> \GateApi\Model\OptionsCandlestick[] listOptionsCandlesticks($contract, $limit, $from, $to, $interval) -Get futures candlesticks +Get options candlesticks ### Example @@ -648,7 +648,7 @@ $apiInstance = new GateApi\Api\OptionsApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$associate_array['contract'] = 'BTC_USDT'; // string | Futures contract +$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Options contract name $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['from'] = 1547706332; // int | Start timestamp $associate_array['to'] = 1547706332; // int | End timestamp @@ -672,7 +672,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **contract** | **string**| Futures contract | + **contract** | **string**| Options contract name | **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **from** | **int**| Start timestamp | [optional] **to** | **int**| End timestamp | [optional] @@ -680,7 +680,7 @@ Name | Type | Description | Notes ### Return type -[**\GateApi\Model\FuturesCandlestick[]**](../Model/FuturesCandlestick.md) +[**\GateApi\Model\OptionsCandlestick[]**](../Model/OptionsCandlestick.md) ### Authorization @@ -714,7 +714,7 @@ $apiInstance = new GateApi\Api\OptionsApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying +$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying (Obtained by listing underlying endpoint) $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['from'] = 1547706332; // int | Start timestamp $associate_array['to'] = 1547706332; // int | End timestamp @@ -738,7 +738,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **from** | **int**| Start timestamp | [optional] **to** | **int**| End timestamp | [optional] @@ -780,7 +780,7 @@ $apiInstance = new GateApi\Api\OptionsApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Contract name +$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Options contract name $associate_array['type'] = '1546935600'; // string | `C` is call, while `P` is put $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 @@ -805,7 +805,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **contract** | **string**| Contract name | [optional] + **contract** | **string**| Options contract name | [optional] **type** | **string**| `C` is call, while `P` is put | [optional] **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] @@ -1100,8 +1100,8 @@ $apiInstance = new GateApi\Api\OptionsApi( new GuzzleHttp\Client(), $config ); -$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying -$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Contract name +$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying (Obtained by listing underlying endpoint) +$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Options contract name try { $result = $apiInstance->listOptionsPositionClose($associate_array); @@ -1121,8 +1121,8 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | - **contract** | **string**| Contract name | [optional] + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | + **contract** | **string**| Options contract name | [optional] ### Return type @@ -1146,7 +1146,7 @@ Name | Type | Description | Notes > \GateApi\Model\OptionsOrder[] listOptionsOrders($status, $contract, $underlying, $limit, $offset, $from, $to) -List futures orders +List options orders ### Example @@ -1165,7 +1165,7 @@ $apiInstance = new GateApi\Api\OptionsApi( $config ); $associate_array['status'] = 'open'; // string | Only list the orders with this status -$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Contract name +$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Options contract name $associate_array['underlying'] = 'BTC_USDT'; // string | Underlying $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 @@ -1191,7 +1191,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | **string**| Only list the orders with this status | - **contract** | **string**| Contract name | [optional] + **contract** | **string**| Options contract name | [optional] **underlying** | **string**| Underlying | [optional] **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] @@ -1298,7 +1298,7 @@ $apiInstance = new GateApi\Api\OptionsApi( new GuzzleHttp\Client(), $config ); -$contract = 'BTC_USDT-20210916-5000-C'; // string | Contract name +$contract = 'BTC_USDT-20210916-5000-C'; // string | Options contract name $underlying = 'BTC_USDT'; // string | Underlying $side = 'ask'; // string | All bids or asks. Both included if not specified @@ -1318,7 +1318,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **contract** | **string**| Contract name | [optional] + **contract** | **string**| Options contract name | [optional] **underlying** | **string**| Underlying | [optional] **side** | **string**| All bids or asks. Both included if not specified | [optional] @@ -1482,8 +1482,8 @@ $apiInstance = new GateApi\Api\OptionsApi( new GuzzleHttp\Client(), $config ); -$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying -$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Contract name +$associate_array['underlying'] = 'BTC_USDT'; // string | Underlying (Obtained by listing underlying endpoint) +$associate_array['contract'] = 'BTC_USDT-20210916-5000-C'; // string | Options contract name $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['offset'] = 0; // int | List offset, starting from 0 $associate_array['from'] = 1547706332; // int | Start timestamp @@ -1507,8 +1507,8 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **underlying** | **string**| Underlying | - **contract** | **string**| Contract name | [optional] + **underlying** | **string**| Underlying (Obtained by listing underlying endpoint) | + **contract** | **string**| Options contract name | [optional] **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] **from** | **int**| Start timestamp | [optional] diff --git a/docs/Api/SpotApi.md b/docs/Api/SpotApi.md index f64df6d..3c60ff3 100644 --- a/docs/Api/SpotApi.md +++ b/docs/Api/SpotApi.md @@ -25,10 +25,11 @@ Method | HTTP request | Description [**cancelOrder**](SpotApi.md#cancelOrder) | **DELETE** /spot/orders/{order_id} | Cancel a single order [**listMyTrades**](SpotApi.md#listMyTrades) | **GET** /spot/my_trades | List personal trading history [**getSystemTime**](SpotApi.md#getSystemTime) | **GET** /spot/time | Get server current time +[**countdownCancelAllSpot**](SpotApi.md#countdownCancelAllSpot) | **POST** /spot/countdown_cancel_all | Countdown cancel orders [**listSpotPriceTriggeredOrders**](SpotApi.md#listSpotPriceTriggeredOrders) | **GET** /spot/price_orders | Retrieve running auto order list [**createSpotPriceTriggeredOrder**](SpotApi.md#createSpotPriceTriggeredOrder) | **POST** /spot/price_orders | Create a price-triggered order [**cancelSpotPriceTriggeredOrderList**](SpotApi.md#cancelSpotPriceTriggeredOrderList) | **DELETE** /spot/price_orders | Cancel all open orders -[**getSpotPriceTriggeredOrder**](SpotApi.md#getSpotPriceTriggeredOrder) | **GET** /spot/price_orders/{order_id} | Get a single order +[**getSpotPriceTriggeredOrder**](SpotApi.md#getSpotPriceTriggeredOrder) | **GET** /spot/price_orders/{order_id} | Get a price-triggered order [**cancelSpotPriceTriggeredOrder**](SpotApi.md#cancelSpotPriceTriggeredOrder) | **DELETE** /spot/price_orders/{order_id} | cancel a price-triggered order @@ -399,7 +400,7 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client() ); $associate_array['currency_pair'] = 'BTC_USDT'; // string | Currency pair -$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list. Default: 100, Minimum: 1, Maximum: 1000 $associate_array['last_id'] = '12345'; // string | Specify list staring point using the `id` of last record in previous list-query results $associate_array['reverse'] = false; // bool | Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. $associate_array['from'] = 1627706330; // int | Start timestamp of the query @@ -425,7 +426,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **string**| Currency pair | - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **limit** | **int**| Maximum number of records to be returned in a single list. Default: 100, Minimum: 1, Maximum: 1000 | [optional] [default to 100] **last_id** | **string**| Specify list staring point using the `id` of last record in previous list-query results | [optional] **reverse** | **bool**| Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. | [optional] [default to false] **from** | **int**| Start timestamp of the query | [optional] @@ -1128,7 +1129,7 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client(), $config ); -$order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +$order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. $currency_pair = 'BTC_USDT'; // string | Currency pair $account = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only @@ -1148,7 +1149,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | + **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. | **currency_pair** | **string**| Currency pair | **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] @@ -1194,7 +1195,7 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client(), $config ); -$order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +$order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. $currency_pair = 'BTC_USDT'; // string | Currency pair $account = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only @@ -1214,7 +1215,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | + **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. | **currency_pair** | **string**| Currency pair | **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] @@ -1242,7 +1243,7 @@ Name | Type | Description | Notes List personal trading history -Spot and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range Time range parameters are handled as order finish time. +Spot and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range. If you don't specify `from` and/or `to` parameters, only the last 7 days of data will be retured. The range of `from` and `to` is not alloed to exceed 30 days. Time range parameters are handled as order finish time. ### Example @@ -1260,7 +1261,7 @@ $apiInstance = new GateApi\Api\SpotApi( new GuzzleHttp\Client(), $config ); -$associate_array['currency_pair'] = 'BTC_USDT'; // string | Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. +$associate_array['currency_pair'] = 'BTC_USDT'; // string | Retrieve results with specified currency pair $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list $associate_array['page'] = 1; // int | Page number $associate_array['order_id'] = '12345'; // string | Filter trades with specified order ID. `currency_pair` is also required if this field is present @@ -1286,7 +1287,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency_pair** | **string**| Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. | + **currency_pair** | **string**| Retrieve results with specified currency pair | [optional] **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **page** | **int**| Page number | [optional] [default to 1] **order_id** | **string**| Filter trades with specified order ID. `currency_pair` is also required if this field is present | [optional] @@ -1364,6 +1365,68 @@ No authorization required [[Back to README]](../../README.md) +## countdownCancelAllSpot + +> \GateApi\Model\TriggerTime countdownCancelAllSpot($countdown_cancel_all_spot_task) + +Countdown cancel orders + +When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown`timeout` is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified `market` will be automatically cancelled, if no `market` is specified, all market pending orders will be cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the cacnel function will be cancelled. + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SpotApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$countdown_cancel_all_spot_task = new \GateApi\Model\CountdownCancelAllSpotTask(); // \GateApi\Model\CountdownCancelAllSpotTask | + +try { + $result = $apiInstance->countdownCancelAllSpot($countdown_cancel_all_spot_task); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SpotApi->countdownCancelAllSpot: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **countdown_cancel_all_spot_task** | [**\GateApi\Model\CountdownCancelAllSpotTask**](../Model/CountdownCancelAllSpotTask.md)| | + +### Return type + +[**\GateApi\Model\TriggerTime**](../Model/TriggerTime.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listSpotPriceTriggeredOrders > \GateApi\Model\SpotPriceTriggeredOrder[] listSpotPriceTriggeredOrders($status, $market, $account, $limit, $offset) @@ -1560,7 +1623,7 @@ Name | Type | Description | Notes > \GateApi\Model\SpotPriceTriggeredOrder getSpotPriceTriggeredOrder($order_id) -Get a single order +Get a price-triggered order ### Example diff --git a/docs/Api/SubAccountApi.md b/docs/Api/SubAccountApi.md new file mode 100644 index 0000000..20f189d --- /dev/null +++ b/docs/Api/SubAccountApi.md @@ -0,0 +1,623 @@ +# GateApi\SubAccountApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**listSubAccounts**](SubAccountApi.md#listSubAccounts) | **GET** /sub_accounts | List sub-accounts +[**createSubAccounts**](SubAccountApi.md#createSubAccounts) | **POST** /sub_accounts | Create a new sub-account +[**getSubAccount**](SubAccountApi.md#getSubAccount) | **GET** /sub_accounts/{user_id} | Get the sub-account +[**listSubAccountKeys**](SubAccountApi.md#listSubAccountKeys) | **GET** /sub_accounts/{user_id}/keys | List all API Key of the sub-account +[**createSubAccountKeys**](SubAccountApi.md#createSubAccountKeys) | **POST** /sub_accounts/{user_id}/keys | Create API Key of the sub-account +[**getSubAccountKey**](SubAccountApi.md#getSubAccountKey) | **GET** /sub_accounts/{user_id}/keys/{key} | Get the API Key of the sub-account +[**updateSubAccountKeys**](SubAccountApi.md#updateSubAccountKeys) | **PUT** /sub_accounts/{user_id}/keys/{key} | Update API key of the sub-account +[**deleteSubAccountKeys**](SubAccountApi.md#deleteSubAccountKeys) | **DELETE** /sub_accounts/{user_id}/keys/{key} | Delete API key of the sub-account +[**lockSubAccount**](SubAccountApi.md#lockSubAccount) | **POST** /sub_accounts/{user_id}/lock | Lock the sub-account +[**unlockSubAccount**](SubAccountApi.md#unlockSubAccount) | **POST** /sub_accounts/{user_id}/unlock | Unlock the sub-account + + +## listSubAccounts + +> \GateApi\Model\SubAccount[] listSubAccounts() + +List sub-accounts + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SubAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->listSubAccounts(); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SubAccountApi->listSubAccounts: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\GateApi\Model\SubAccount[]**](../Model/SubAccount.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## createSubAccounts + +> \GateApi\Model\SubAccount createSubAccounts($sub_account) + +Create a new sub-account + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SubAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$sub_account = new \GateApi\Model\SubAccount(); // \GateApi\Model\SubAccount | + +try { + $result = $apiInstance->createSubAccounts($sub_account); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SubAccountApi->createSubAccounts: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sub_account** | [**\GateApi\Model\SubAccount**](../Model/SubAccount.md)| | + +### Return type + +[**\GateApi\Model\SubAccount**](../Model/SubAccount.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## getSubAccount + +> \GateApi\Model\SubAccount getSubAccount($user_id) + +Get the sub-account + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SubAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$user_id = 56; // int | Sub-account user id + +try { + $result = $apiInstance->getSubAccount($user_id); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SubAccountApi->getSubAccount: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user id | + +### Return type + +[**\GateApi\Model\SubAccount**](../Model/SubAccount.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listSubAccountKeys + +> \GateApi\Model\SubAccountKey[] listSubAccountKeys($user_id) + +List all API Key of the sub-account + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SubAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$user_id = 56; // int | Sub-account user id + +try { + $result = $apiInstance->listSubAccountKeys($user_id); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SubAccountApi->listSubAccountKeys: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user id | + +### Return type + +[**\GateApi\Model\SubAccountKey[]**](../Model/SubAccountKey.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## createSubAccountKeys + +> \GateApi\Model\SubAccountKey[] createSubAccountKeys($user_id, $sub_account_key) + +Create API Key of the sub-account + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SubAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$user_id = 56; // int | Sub-account user id +$sub_account_key = new \GateApi\Model\SubAccountKey(); // \GateApi\Model\SubAccountKey | + +try { + $result = $apiInstance->createSubAccountKeys($user_id, $sub_account_key); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SubAccountApi->createSubAccountKeys: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user id | + **sub_account_key** | [**\GateApi\Model\SubAccountKey**](../Model/SubAccountKey.md)| | + +### Return type + +[**\GateApi\Model\SubAccountKey[]**](../Model/SubAccountKey.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## getSubAccountKey + +> \GateApi\Model\SubAccountKey getSubAccountKey($user_id, $key) + +Get the API Key of the sub-account + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SubAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$user_id = 56; // int | Sub-account user id +$key = 'key_example'; // string | The API Key of the sub-account + +try { + $result = $apiInstance->getSubAccountKey($user_id, $key); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SubAccountApi->getSubAccountKey: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user id | + **key** | **string**| The API Key of the sub-account | + +### Return type + +[**\GateApi\Model\SubAccountKey**](../Model/SubAccountKey.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## updateSubAccountKeys + +> updateSubAccountKeys($user_id, $key, $sub_account_key) + +Update API key of the sub-account + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SubAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$user_id = 56; // int | Sub-account user id +$key = 'key_example'; // string | The API Key of the sub-account +$sub_account_key = new \GateApi\Model\SubAccountKey(); // \GateApi\Model\SubAccountKey | + +try { + $apiInstance->updateSubAccountKeys($user_id, $key, $sub_account_key); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SubAccountApi->updateSubAccountKeys: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user id | + **key** | **string**| The API Key of the sub-account | + **sub_account_key** | [**\GateApi\Model\SubAccountKey**](../Model/SubAccountKey.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## deleteSubAccountKeys + +> deleteSubAccountKeys($user_id, $key) + +Delete API key of the sub-account + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SubAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$user_id = 56; // int | Sub-account user id +$key = 'key_example'; // string | The API Key of the sub-account + +try { + $apiInstance->deleteSubAccountKeys($user_id, $key); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SubAccountApi->deleteSubAccountKeys: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user id | + **key** | **string**| The API Key of the sub-account | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## lockSubAccount + +> lockSubAccount($user_id, $body) + +Lock the sub-account + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SubAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$user_id = 56; // int | The user id of the sub-account +$body = new \stdClass; // object | + +try { + $apiInstance->lockSubAccount($user_id, $body); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SubAccountApi->lockSubAccount: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| The user id of the sub-account | + **body** | **object**| | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## unlockSubAccount + +> unlockSubAccount($user_id, $body) + +Unlock the sub-account + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SubAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$user_id = 56; // int | The user id of the sub-account +$body = new \stdClass; // object | + +try { + $apiInstance->unlockSubAccount($user_id, $body); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SubAccountApi->unlockSubAccount: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| The user id of the sub-account | + **body** | **object**| | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Api/WalletApi.md b/docs/Api/WalletApi.md index c0dd9be..dd9a8c1 100644 --- a/docs/Api/WalletApi.md +++ b/docs/Api/WalletApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**transfer**](WalletApi.md#transfer) | **POST** /wallet/transfers | Transfer between trading accounts [**listSubAccountTransfers**](WalletApi.md#listSubAccountTransfers) | **GET** /wallet/sub_account_transfers | Retrieve transfer records between main and sub accounts [**transferWithSubAccount**](WalletApi.md#transferWithSubAccount) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts +[**subAccountToSubAccount**](WalletApi.md#subAccountToSubAccount) | **POST** /wallet/sub_account_to_sub_account | Sub-account transfers to sub-account [**listWithdrawStatus**](WalletApi.md#listWithdrawStatus) | **GET** /wallet/withdraw_status | Retrieve withdrawal status [**listSubAccountBalances**](WalletApi.md#listSubAccountBalances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances [**listSubAccountMarginBalances**](WalletApi.md#listSubAccountMarginBalances) | **GET** /wallet/sub_account_margin_balances | Query sub accounts' margin balances @@ -367,7 +368,7 @@ $apiInstance = new GateApi\Api\WalletApi( new GuzzleHttp\Client(), $config ); -$associate_array['sub_uid'] = '10003'; // string | Sub account user ID. Return records related to all sub accounts if not specified +$associate_array['sub_uid'] = '10003'; // string | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts $associate_array['from'] = 1602120000; // int | Time range beginning, default to 7 days before current time $associate_array['to'] = 1602123600; // int | Time range ending, default to current time $associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list @@ -391,7 +392,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sub_uid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] + **sub_uid** | **string**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] **from** | **int**| Time range beginning, default to 7 days before current time | [optional] **to** | **int**| Time range ending, default to current time | [optional] **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] @@ -476,6 +477,65 @@ void (empty response body) [[Back to README]](../../README.md) +## subAccountToSubAccount + +> subAccountToSubAccount($sub_account_to_sub_account) + +Sub-account transfers to sub-account + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\WalletApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$sub_account_to_sub_account = new \GateApi\Model\SubAccountToSubAccount(); // \GateApi\Model\SubAccountToSubAccount | + +try { + $apiInstance->subAccountToSubAccount($sub_account_to_sub_account); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling WalletApi->subAccountToSubAccount: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sub_account_to_sub_account** | [**\GateApi\Model\SubAccountToSubAccount**](../Model/SubAccountToSubAccount.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listWithdrawStatus > \GateApi\Model\WithdrawStatus[] listWithdrawStatus($currency) @@ -560,7 +620,7 @@ $apiInstance = new GateApi\Api\WalletApi( new GuzzleHttp\Client(), $config ); -$associate_array['sub_uid'] = '10003'; // string | Sub account user ID. Return records related to all sub accounts if not specified +$associate_array['sub_uid'] = '10003'; // string | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts try { $result = $apiInstance->listSubAccountBalances($associate_array); @@ -580,7 +640,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sub_uid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] + **sub_uid** | **string**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] ### Return type @@ -622,7 +682,7 @@ $apiInstance = new GateApi\Api\WalletApi( new GuzzleHttp\Client(), $config ); -$associate_array['sub_uid'] = '10003'; // string | Sub account user ID. Return records related to all sub accounts if not specified +$associate_array['sub_uid'] = '10003'; // string | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts try { $result = $apiInstance->listSubAccountMarginBalances($associate_array); @@ -642,7 +702,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sub_uid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] + **sub_uid** | **string**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] ### Return type @@ -684,7 +744,7 @@ $apiInstance = new GateApi\Api\WalletApi( new GuzzleHttp\Client(), $config ); -$associate_array['sub_uid'] = '10003'; // string | Sub account user ID. Return records related to all sub accounts if not specified +$associate_array['sub_uid'] = '10003'; // string | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts $associate_array['settle'] = 'usdt'; // string | Query only balances of specified settle currency try { @@ -705,7 +765,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sub_uid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] + **sub_uid** | **string**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] **settle** | **string**| Query only balances of specified settle currency | [optional] ### Return type @@ -748,7 +808,7 @@ $apiInstance = new GateApi\Api\WalletApi( new GuzzleHttp\Client(), $config ); -$associate_array['sub_uid'] = '10003'; // string | Sub account user ID. Return records related to all sub accounts if not specified +$associate_array['sub_uid'] = '10003'; // string | User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts try { $result = $apiInstance->listSubAccountCrossMarginBalances($associate_array); @@ -768,7 +828,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sub_uid** | **string**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] + **sub_uid** | **string**| User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts | [optional] ### Return type @@ -856,7 +916,7 @@ Name | Type | Description | Notes ## getTradeFee -> \GateApi\Model\TradeFee getTradeFee($currency_pair) +> \GateApi\Model\TradeFee getTradeFee($currency_pair, $settle) Retrieve personal trading fee @@ -877,6 +937,7 @@ $apiInstance = new GateApi\Api\WalletApi( $config ); $associate_array['currency_pair'] = 'BTC_USDT'; // string | Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs +$associate_array['settle'] = 'BTC'; // string | Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. try { $result = $apiInstance->getTradeFee($associate_array); @@ -897,6 +958,7 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **string**| Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs | [optional] + **settle** | **string**| Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. | [optional] ### Return type diff --git a/docs/Model/ApiV4KeyPerm.md b/docs/Model/ApiV4KeyPerm.md new file mode 100644 index 0000000..b9f3dc6 --- /dev/null +++ b/docs/Model/ApiV4KeyPerm.md @@ -0,0 +1,10 @@ +# # ApiV4KeyPerm + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options | [optional] +**read_only** | **bool** | read only | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BatchFuturesOrder.md b/docs/Model/BatchFuturesOrder.md new file mode 100644 index 0000000..cf2f153 --- /dev/null +++ b/docs/Model/BatchFuturesOrder.md @@ -0,0 +1,34 @@ +# # BatchFuturesOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**succeeded** | **bool** | Whether the batch of orders succeeded | [optional] +**label** | **string** | Error label, only exists if execution fails | [optional] +**detail** | **string** | Error detail, only present if execution failed and details need to be given | [optional] +**id** | **int** | Futures order ID | [optional] [readonly] +**user** | **int** | User ID | [optional] [readonly] +**create_time** | **double** | Creation time of order | [optional] [readonly] +**finish_time** | **double** | Order finished time. Not returned if order is open | [optional] [readonly] +**finish_as** | **string** | How the order was finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set- position_closed: cancelled because of position close | [optional] [readonly] +**status** | **string** | Order status - `open`: waiting to be traded - `finished`: finished | [optional] [readonly] +**contract** | **string** | Futures contract | [optional] +**size** | **int** | Order size. Specify positive number to make a bid, and negative number to ask | [optional] +**iceberg** | **int** | Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size | [optional] +**price** | **string** | Order price. 0 for market order with `tif` set as `ioc` | [optional] +**close** | **bool** | Set as `true` to close the position, with `size` set to 0 | [optional] [default to false] +**is_close** | **bool** | Is the order to close position | [optional] [readonly] +**reduce_only** | **bool** | Set as `true` to be reduce-only order | [optional] [default to false] +**is_reduce_only** | **bool** | Is the order reduce-only | [optional] [readonly] +**is_liq** | **bool** | Is the order for liquidation | [optional] [readonly] +**tif** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none | [optional] [default to 'gtc'] +**left** | **int** | Size left to be traded | [optional] [readonly] +**fill_price** | **string** | Fill price of the order | [optional] [readonly] +**text** | **string** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance | [optional] +**tkfr** | **string** | Taker fee | [optional] [readonly] +**mkfr** | **string** | Maker fee | [optional] [readonly] +**refu** | **int** | Reference user ID | [optional] [readonly] +**auto_size** | **string** | Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CountdownCancelAllFuturesTask.md b/docs/Model/CountdownCancelAllFuturesTask.md new file mode 100644 index 0000000..7bbb0cd --- /dev/null +++ b/docs/Model/CountdownCancelAllFuturesTask.md @@ -0,0 +1,10 @@ +# # CountdownCancelAllFuturesTask + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timeout** | **int** | Countdown time, in seconds At least 5 seconds, 0 means cancel the countdown | +**contract** | **string** | Futures contract | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CountdownCancelAllSpotTask.md b/docs/Model/CountdownCancelAllSpotTask.md new file mode 100644 index 0000000..bb07ac2 --- /dev/null +++ b/docs/Model/CountdownCancelAllSpotTask.md @@ -0,0 +1,10 @@ +# # CountdownCancelAllSpotTask + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timeout** | **int** | Countdown time, in seconds At least 5 seconds, 0 means cancel the countdown | +**currency_pair** | **string** | Currency pair | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesAccount.md b/docs/Model/FuturesAccount.md index 808f568..30fe7fa 100644 --- a/docs/Model/FuturesAccount.md +++ b/docs/Model/FuturesAccount.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total** | **string** | total = position_margin + order_margin + available | [optional] +**total** | **string** | total is the balance after the user's accumulated deposit, withdraw, profit and loss (including realized profit and loss, fund, fee and referral rebate), excluding unrealized profit and loss. total = SUM(history_dnw, history_pnl, history_fee, history_refr, history_fund) | [optional] **unrealised_pnl** | **string** | Unrealized PNL | [optional] **position_margin** | **string** | Position margin | [optional] **order_margin** | **string** | Order margin of unfinished orders | [optional] diff --git a/docs/Model/FuturesCandlestick.md b/docs/Model/FuturesCandlestick.md index 65d26f0..298ba54 100644 --- a/docs/Model/FuturesCandlestick.md +++ b/docs/Model/FuturesCandlestick.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **t** | **double** | Unix timestamp in seconds | [optional] -**v** | **int** | size volume. Only returned if `contract` is not prefixed | [optional] -**c** | **string** | Close price | [optional] -**h** | **string** | Highest price | [optional] -**l** | **string** | Lowest price | [optional] -**o** | **string** | Open price | [optional] +**v** | **int** | size volume (contract size). Only returned if `contract` is not prefixed | [optional] +**c** | **string** | Close price (quote currency) | [optional] +**h** | **string** | Highest price (quote currency) | [optional] +**l** | **string** | Lowest price (quote currency) | [optional] +**o** | **string** | Open price (quote currency) | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesOrder.md b/docs/Model/FuturesOrder.md index 49aba07..b4afdf4 100644 --- a/docs/Model/FuturesOrder.md +++ b/docs/Model/FuturesOrder.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes **reduce_only** | **bool** | Set as `true` to be reduce-only order | [optional] [default to false] **is_reduce_only** | **bool** | Is the order reduce-only | [optional] [readonly] **is_liq** | **bool** | Is the order for liquidation | [optional] [readonly] -**tif** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only | [optional] [default to 'gtc'] +**tif** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none | [optional] [default to 'gtc'] **left** | **int** | Size left to be traded | [optional] [readonly] **fill_price** | **string** | Fill price of the order | [optional] [readonly] **text** | **string** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance | [optional] diff --git a/docs/Model/FuturesOrderAmendment.md b/docs/Model/FuturesOrderAmendment.md index 9a92e22..b2eb6eb 100644 --- a/docs/Model/FuturesOrderAmendment.md +++ b/docs/Model/FuturesOrderAmendment.md @@ -5,6 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **size** | **int** | New order size, including filled part. - If new size is less than or equal to filled size, the order will be cancelled. - Order side must be identical to the original one. - Close order size cannot be changed. - For reduce only orders, increasing size may leads to other reduce only orders being cancelled. - If price is not changed, decreasing size will not change its precedence in order book, while increasing will move it to the last at current price. | [optional] -**price** | **string** | New order price. New price cannot take any orders | [optional] +**price** | **string** | New order price. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesOrderBookItem.md b/docs/Model/FuturesOrderBookItem.md index ed8bd38..749564e 100644 --- a/docs/Model/FuturesOrderBookItem.md +++ b/docs/Model/FuturesOrderBookItem.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**p** | **string** | Price | [optional] +**p** | **string** | Price (quote currency) | [optional] **s** | **int** | Size | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesPremiumIndex.md b/docs/Model/FuturesPremiumIndex.md new file mode 100644 index 0000000..df94c3c --- /dev/null +++ b/docs/Model/FuturesPremiumIndex.md @@ -0,0 +1,13 @@ +# # FuturesPremiumIndex + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **double** | Unix timestamp in seconds | [optional] +**c** | **string** | Close price | [optional] +**h** | **string** | Highest price | [optional] +**l** | **string** | Lowest price` | [optional] +**o** | **string** | Open price | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesTicker.md b/docs/Model/FuturesTicker.md index 545a732..0b32a71 100644 --- a/docs/Model/FuturesTicker.md +++ b/docs/Model/FuturesTicker.md @@ -21,5 +21,7 @@ Name | Type | Description | Notes **funding_rate_indicative** | **string** | Indicative Funding rate in next period | [optional] **index_price** | **string** | Index price | [optional] **quanto_base_rate** | **string** | Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types | [optional] +**basis_rate** | **string** | Basis rate | [optional] +**basis_value** | **string** | Basis value | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesTrade.md b/docs/Model/FuturesTrade.md index 4d6b116..057d5b4 100644 --- a/docs/Model/FuturesTrade.md +++ b/docs/Model/FuturesTrade.md @@ -9,6 +9,6 @@ Name | Type | Description | Notes **create_time_ms** | **double** | Trading time, with milliseconds set to 3 decimal places. | [optional] **contract** | **string** | Futures contract | [optional] **size** | **int** | Trading size | [optional] -**price** | **string** | Trading price | [optional] +**price** | **string** | Trading price (quote currency) | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LedgerRecord.md b/docs/Model/LedgerRecord.md index e662336..d50e937 100644 --- a/docs/Model/LedgerRecord.md +++ b/docs/Model/LedgerRecord.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **address** | **string** | Withdrawal address. Required for withdrawals | [optional] **memo** | **string** | Additional remarks with regards to the withdrawal | [optional] **status** | **string** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending - DMOVE: required manual approval - SPLITPEND: the order is automatically split due to large amount | [optional] [readonly] -**chain** | **string** | Name of the chain used in withdrawals | [optional] -**fee** | **string** | Fee | [optional] +**chain** | **string** | Name of the chain used in withdrawals | +**fee** | **string** | Fee | [optional] [readonly] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsAccountBook.md b/docs/Model/OptionsAccountBook.md index e208de0..0605d9a 100644 --- a/docs/Model/OptionsAccountBook.md +++ b/docs/Model/OptionsAccountBook.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **double** | Change time | [optional] -**change** | **string** | Amount changed | [optional] -**balance** | **string** | Account total balance after change | [optional] +**change** | **string** | Amount changed (USDT) | [optional] +**balance** | **string** | Account total balance after change (USDT) | [optional] **type** | **string** | Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] **text** | **string** | custom text | [optional] diff --git a/docs/Model/OptionsCandlestick.md b/docs/Model/OptionsCandlestick.md new file mode 100644 index 0000000..6b5f48e --- /dev/null +++ b/docs/Model/OptionsCandlestick.md @@ -0,0 +1,14 @@ +# # OptionsCandlestick + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **double** | Unix timestamp in seconds | [optional] +**v** | **int** | size volume (contract size). Only returned if `contract` is not prefixed | [optional] +**c** | **string** | Close price (quote currency, unit: underlying corresponding option price) | [optional] +**h** | **string** | Highest price (quote currency, unit: underlying corresponding option price) | [optional] +**l** | **string** | Lowest price (quote currency, unit: underlying corresponding option price) | [optional] +**o** | **string** | Open price (quote currency, unit: underlying corresponding option price) | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsContract.md b/docs/Model/OptionsContract.md index efe3fd7..8853096 100644 --- a/docs/Model/OptionsContract.md +++ b/docs/Model/OptionsContract.md @@ -4,17 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | Futures contract | [optional] +**name** | **string** | Options contract name | [optional] **tag** | **string** | tag | [optional] **create_time** | **double** | Creation time | [optional] **expiration_time** | **double** | Expiration time | [optional] **is_call** | **bool** | `true` means call options, while `false` is put options | [optional] **multiplier** | **string** | Multiplier used in converting from invoicing to settlement currency | [optional] **underlying** | **string** | Underlying | [optional] -**underlying_price** | **string** | Underlying price | [optional] +**underlying_price** | **string** | Underlying price (quote currency) | [optional] **last_price** | **string** | Last trading price | [optional] -**mark_price** | **string** | Current mark price | [optional] -**index_price** | **string** | Current index price | [optional] +**mark_price** | **string** | Current mark price (quote currency) | [optional] +**index_price** | **string** | Current index price (quote currency) | [optional] **maker_fee_rate** | **string** | Maker fee rate, where negative means rebate | [optional] **taker_fee_rate** | **string** | Taker fee rate | [optional] **order_price_round** | **string** | Minimum order price increment | [optional] diff --git a/docs/Model/OptionsMySettlements.md b/docs/Model/OptionsMySettlements.md index d52305f..cd2baab 100644 --- a/docs/Model/OptionsMySettlements.md +++ b/docs/Model/OptionsMySettlements.md @@ -6,12 +6,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **double** | Settlement time | [optional] **underlying** | **string** | Underlying | [optional] -**contract** | **string** | Futures contract | [optional] -**strike_price** | **string** | Strike price | [optional] -**settle_price** | **string** | settlement price | [optional] +**contract** | **string** | Options contract name | [optional] +**strike_price** | **string** | Strike price (quote currency) | [optional] +**settle_price** | **string** | Settlement price (quote currency) | [optional] **size** | **int** | Size | [optional] -**settle_profit** | **string** | Settlement profit | [optional] -**fee** | **string** | Fee | [optional] -**realised_pnl** | **string** | The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. | [optional] +**settle_profit** | **string** | Settlement profit (quote currency) | [optional] +**fee** | **string** | Fee (quote currency) | [optional] +**realised_pnl** | **string** | The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. (quote currency) | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsMyTrade.md b/docs/Model/OptionsMyTrade.md index d70ac06..55ca567 100644 --- a/docs/Model/OptionsMyTrade.md +++ b/docs/Model/OptionsMyTrade.md @@ -6,11 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Trade ID | [optional] **create_time** | **double** | Trading time | [optional] -**contract** | **string** | Futures contract | [optional] +**contract** | **string** | Options contract name | [optional] **order_id** | **int** | Order ID related | [optional] **size** | **int** | Trading size | [optional] -**price** | **string** | Trading price | [optional] -**underlying_price** | **string** | Underlying price | [optional] +**price** | **string** | Trading price (quote currency) | [optional] +**underlying_price** | **string** | Underlying price (quote currency) | [optional] **role** | **string** | Trade role. Available values are `taker` and `maker` | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsOrder.md b/docs/Model/OptionsOrder.md index ff7cd1c..ec4b464 100644 --- a/docs/Model/OptionsOrder.md +++ b/docs/Model/OptionsOrder.md @@ -13,18 +13,19 @@ Name | Type | Description | Notes **contract** | **string** | Contract name | **size** | **int** | Order size. Specify positive number to make a bid, and negative number to ask | **iceberg** | **int** | Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size | [optional] -**price** | **string** | Order price. 0 for market order with `tif` set as `ioc` | [optional] +**price** | **string** | Order price. 0 for market order with `tif` set as `ioc` (USDT) | [optional] **close** | **bool** | Set as `true` to close the position, with `size` set to 0 | [optional] [default to false] **is_close** | **bool** | Is the order to close position | [optional] [readonly] **reduce_only** | **bool** | Set as `true` to be reduce-only order | [optional] [default to false] **is_reduce_only** | **bool** | Is the order reduce-only | [optional] [readonly] **is_liq** | **bool** | Is the order for liquidation | [optional] [readonly] -**tif** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only | [optional] [default to 'gtc'] +**tif** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee | [optional] [default to 'gtc'] **left** | **int** | Size left to be traded | [optional] [readonly] **fill_price** | **string** | Fill price of the order | [optional] [readonly] **text** | **string** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance | [optional] **tkfr** | **string** | Taker fee | [optional] [readonly] **mkfr** | **string** | Maker fee | [optional] [readonly] **refu** | **int** | Reference user ID | [optional] [readonly] +**refr** | **string** | Referrer rebate | [optional] [readonly] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsPosition.md b/docs/Model/OptionsPosition.md index a96e93b..d5901fe 100644 --- a/docs/Model/OptionsPosition.md +++ b/docs/Model/OptionsPosition.md @@ -5,13 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **user** | **int** | User ID | [optional] [readonly] -**contract** | **string** | Futures contract | [optional] [readonly] -**size** | **int** | Position size | [optional] [readonly] -**entry_price** | **string** | Entry price | [optional] [readonly] -**mark_price** | **string** | Current mark price | [optional] [readonly] +**contract** | **string** | Options contract name | [optional] [readonly] +**size** | **int** | Position size (contract size) | [optional] [readonly] +**entry_price** | **string** | Entry size (quote currency) | [optional] [readonly] +**mark_price** | **string** | Current mark price (quote currency) | [optional] [readonly] **realised_pnl** | **string** | Realized PNL | [optional] [readonly] **unrealised_pnl** | **string** | Unrealized PNL | [optional] [readonly] **pending_orders** | **int** | Current open orders | [optional] [readonly] -**close_order** | [**\GateApi\Model\PositionCloseOrder**](PositionCloseOrder.md) | | [optional] +**close_order** | [**\GateApi\Model\OptionsPositionCloseOrder**](OptionsPositionCloseOrder.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsPositionClose.md b/docs/Model/OptionsPositionClose.md index 6afe84b..d3c1425 100644 --- a/docs/Model/OptionsPositionClose.md +++ b/docs/Model/OptionsPositionClose.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **double** | Position close time | [optional] [readonly] -**contract** | **string** | Futures contract | [optional] [readonly] +**contract** | **string** | Options contract name | [optional] [readonly] **side** | **string** | Position side, long or short | [optional] [readonly] **pnl** | **string** | PNL | [optional] [readonly] **text** | **string** | Text of close order | [optional] [readonly] diff --git a/docs/Model/OptionsPositionCloseOrder.md b/docs/Model/OptionsPositionCloseOrder.md new file mode 100644 index 0000000..73cf7df --- /dev/null +++ b/docs/Model/OptionsPositionCloseOrder.md @@ -0,0 +1,11 @@ +# # OptionsPositionCloseOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Close order ID | [optional] +**price** | **string** | Close order price (quote currency) | [optional] +**is_liq** | **bool** | Is the close order from liquidation | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsSettlement.md b/docs/Model/OptionsSettlement.md index d001fd7..f765d61 100644 --- a/docs/Model/OptionsSettlement.md +++ b/docs/Model/OptionsSettlement.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **double** | Last changed time of configuration | [optional] -**contract** | **string** | Contract name | [optional] -**profit** | **string** | Settlement profit per size | [optional] -**fee** | **string** | Settlement fee per size | [optional] -**strike_price** | **string** | Strike price | [optional] -**settle_price** | **string** | settlement price | [optional] +**contract** | **string** | Options contract name | [optional] +**profit** | **string** | Settlement profit per size (quote currency) | [optional] +**fee** | **string** | Settlement fee per size (quote currency) | [optional] +**strike_price** | **string** | Strike price (quote currency) | [optional] +**settle_price** | **string** | Settlement price (quote currency) | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsTicker.md b/docs/Model/OptionsTicker.md index c6be267..8c9f43c 100644 --- a/docs/Model/OptionsTicker.md +++ b/docs/Model/OptionsTicker.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Options contract name | [optional] -**last_price** | **string** | Last trading price | [optional] -**mark_price** | **string** | Current mark price | [optional] -**index_price** | **string** | Current index price | [optional] +**last_price** | **string** | Last trading price (quote currency) | [optional] +**mark_price** | **string** | Current mark price (quote currency) | [optional] +**index_price** | **string** | Current index price (quote currency) | [optional] **ask1_size** | **int** | Best ask size | [optional] **ask1_price** | **string** | Best ask price | [optional] **bid1_size** | **int** | Best bid size | [optional] diff --git a/docs/Model/OptionsUnderlying.md b/docs/Model/OptionsUnderlying.md index 02e9341..b14c71e 100644 --- a/docs/Model/OptionsUnderlying.md +++ b/docs/Model/OptionsUnderlying.md @@ -5,6 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Underlying name | [optional] -**index_price** | **string** | Spot index price | [optional] +**index_price** | **string** | Spot index price (quote currency) | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsUnderlyingTicker.md b/docs/Model/OptionsUnderlyingTicker.md index 3bafe11..74416c0 100644 --- a/docs/Model/OptionsUnderlyingTicker.md +++ b/docs/Model/OptionsUnderlyingTicker.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **trade_put** | **int** | Total put options trades amount in last 24h | [optional] **trade_call** | **int** | Total call options trades amount in last 24h | [optional] -**index_price** | **string** | Index price | [optional] +**index_price** | **string** | Index price (quote currency) | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Order.md b/docs/Model/Order.md index a4979a4..9ec662b 100644 --- a/docs/Model/Order.md +++ b/docs/Model/Order.md @@ -12,12 +12,12 @@ Name | Type | Description | Notes **update_time_ms** | **int** | Last modification time of order (in milliseconds) | [optional] [readonly] **status** | **string** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] **currency_pair** | **string** | Currency pair | -**type** | **string** | Order type. limit - limit order | [optional] [default to 'limit'] +**type** | **string** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] **account** | **string** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account. Portfolio margin account must set to `cross-margin` | [optional] [default to 'spot'] **side** | **string** | Order side | -**amount** | **string** | Trade amount | -**price** | **string** | Order price | -**time_in_force** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none | [optional] [default to 'gtc'] +**amount** | **string** | When `type` is limit, it refers to base currency. For instance, `BTC_USDT` means `BTC` When `type` is `market`, it refers to different currency according to `side` - `side` : `buy` means quote currency, `BTC_USDT` means `USDT` - `side` : `sell` means base currency,`BTC_USDT` means `BTC` | +**price** | **string** | Price can't be empty when `type`= `limit` | [optional] +**time_in_force** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none Only `ioc` and `fok` are supported when `type`=`market` | [optional] [default to 'gtc'] **iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional] **auto_borrow** | **bool** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional] **auto_repay** | **bool** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. | [optional] @@ -28,6 +28,8 @@ Name | Type | Description | Notes **fee_currency** | **string** | Fee currency unit | [optional] [readonly] **point_fee** | **string** | Points used to deduct fee | [optional] [readonly] **gt_fee** | **string** | GT used to deduct fee | [optional] [readonly] +**gt_maker_fee** | **string** | GT used to deduct maker fee | [optional] [readonly] +**gt_taker_fee** | **string** | GT used to deduct taker fee | [optional] [readonly] **gt_discount** | **bool** | Whether GT fee discount is used | [optional] [readonly] **rebated_fee** | **string** | Rebated fee | [optional] [readonly] **rebated_fee_currency** | **string** | Rebated fee currency unit | [optional] [readonly] diff --git a/docs/Model/SubAccount.md b/docs/Model/SubAccount.md new file mode 100644 index 0000000..0b60cf1 --- /dev/null +++ b/docs/Model/SubAccount.md @@ -0,0 +1,15 @@ +# # SubAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**remark** | **string** | custom text | [optional] +**login_name** | **string** | Sub-account login name: Only letters, numbers and underscores are supported, and cannot contain other illegal characters | +**password** | **string** | The sub-account's password. (Default: the same as main account's password) | [optional] +**email** | **string** | The sub-account's email address. (Default: the same as main account's email address) | [optional] +**state** | **int** | State: 1-normal, 2-locked\" | [optional] [readonly] +**user_id** | **int** | The user id of the sub-account | [optional] [readonly] +**create_time** | **int** | Created time | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubAccountKey.md b/docs/Model/SubAccountKey.md new file mode 100644 index 0000000..916d946 --- /dev/null +++ b/docs/Model/SubAccountKey.md @@ -0,0 +1,16 @@ +# # SubAccountKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **string** | User ID | [optional] [readonly] +**name** | **string** | API key name | [optional] +**perms** | [**\GateApi\Model\ApiV4KeyPerm[]**](ApiV4KeyPerm.md) | | [optional] +**ip_whitelist** | **string[]** | ip white list (list will be removed if no value is passed) | [optional] +**key** | **string** | API Key | [optional] [readonly] +**state** | **int** | State 1 - normal 2 - locked 3 - frozen | [optional] [readonly] +**created_at** | **string** | Creation time | [optional] [readonly] +**updated_at** | **string** | Last update time | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubAccountToSubAccount.md b/docs/Model/SubAccountToSubAccount.md new file mode 100644 index 0000000..801fcb5 --- /dev/null +++ b/docs/Model/SubAccountToSubAccount.md @@ -0,0 +1,15 @@ +# # SubAccountToSubAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **string** | Transfer currency name | +**sub_account_type** | **string** | Transfer from the account. (deprecate, use `sub_account_from_type` and `sub_account_to_type` instead) | [optional] +**sub_account_from** | **string** | Transfer from the user id of the sub-account | +**sub_account_from_type** | **string** | Transfer from the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account | +**sub_account_to** | **string** | Transfer to the user id of the sub-account | +**sub_account_to_type** | **string** | Transfer to the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account | +**amount** | **string** | Transfer amount | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TriggerTime.md b/docs/Model/TriggerTime.md new file mode 100644 index 0000000..268d84f --- /dev/null +++ b/docs/Model/TriggerTime.md @@ -0,0 +1,9 @@ +# # TriggerTime + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**trigger_time** | **int** | Timestamp of the end of the countdown, in milliseconds | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/DeliveryApi.php b/src/Api/DeliveryApi.php index 60a7548..ad2b5d2 100644 --- a/src/Api/DeliveryApi.php +++ b/src/Api/DeliveryApi.php @@ -7699,7 +7699,7 @@ protected function cancelPriceTriggeredDeliveryOrderListRequest($settle, $contra /** * Operation getPriceTriggeredDeliveryOrder * - * Get a single order + * Get a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) @@ -7717,7 +7717,7 @@ public function getPriceTriggeredDeliveryOrder($settle, $order_id) /** * Operation getPriceTriggeredDeliveryOrderWithHttpInfo * - * Get a single order + * Get a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) @@ -7772,7 +7772,7 @@ public function getPriceTriggeredDeliveryOrderWithHttpInfo($settle, $order_id) /** * Operation getPriceTriggeredDeliveryOrderAsync * - * Get a single order + * Get a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) @@ -7793,7 +7793,7 @@ function ($response) { /** * Operation getPriceTriggeredDeliveryOrderAsyncWithHttpInfo * - * Get a single order + * Get a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) diff --git a/src/Api/FuturesApi.php b/src/Api/FuturesApi.php index fc73ab9..259564d 100644 --- a/src/Api/FuturesApi.php +++ b/src/Api/FuturesApi.php @@ -952,6 +952,7 @@ protected function listFuturesOrderBookRequest($associative_array) * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) @@ -976,6 +977,7 @@ public function listFuturesTrades($associative_array) * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) @@ -1037,6 +1039,7 @@ public function listFuturesTradesWithHttpInfo($associative_array) * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) @@ -1064,6 +1067,7 @@ function ($response) { * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) @@ -1118,6 +1122,7 @@ function ($exception) { * @param string $settle Settle currency (required) * @param string $contract Futures contract (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) * @param string $last_id Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) * @param int $from Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) * @param int $to Specify end time in Unix seconds, default to current time (optional) @@ -1131,6 +1136,7 @@ protected function listFuturesTradesRequest($associative_array) $settle = array_key_exists('settle', $associative_array) ? $associative_array['settle'] : null; $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; $last_id = array_key_exists('last_id', $associative_array) ? $associative_array['last_id'] : null; $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; @@ -1154,6 +1160,10 @@ protected function listFuturesTradesRequest($associative_array) throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listFuturesTrades, must be bigger than or equal to 1.'); } + if ($offset !== null && $offset < 0) { + throw new \InvalidArgumentException('invalid value for "$offset" when calling FuturesApi.listFuturesTrades, must be bigger than or equal to 0.'); + } + $resourcePath = '/futures/{settle}/trades'; $formParams = []; @@ -1186,6 +1196,18 @@ protected function listFuturesTradesRequest($associative_array) } } + // query params + if ($offset !== null) { + if('form' === 'form' && is_array($offset)) { + foreach($offset as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['offset'] = $offset; + } + } + // query params if ($last_id !== null) { if('form' === 'form' && is_array($last_id)) { @@ -1464,7 +1486,357 @@ function ($exception) { } /** - * Create request for operation 'listFuturesCandlesticks' + * Create request for operation 'listFuturesCandlesticks' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) + * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param string $interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional, default to '5m') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listFuturesCandlesticksRequest($associative_array) + { + // unbox the parameters from the associative array + $settle = array_key_exists('settle', $associative_array) ? $associative_array['settle'] : null; + $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $interval = array_key_exists('interval', $associative_array) ? $associative_array['interval'] : '5m'; + + // verify the required parameter 'settle' is set + if ($settle === null || (is_array($settle) && count($settle) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $settle when calling listFuturesCandlesticks' + ); + } + // verify the required parameter 'contract' is set + if ($contract === null || (is_array($contract) && count($contract) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contract when calling listFuturesCandlesticks' + ); + } + if ($limit !== null && $limit > 2000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listFuturesCandlesticks, must be smaller than or equal to 2000.'); + } + + + $resourcePath = '/futures/{settle}/candlesticks'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($contract !== null) { + if('form' === 'form' && is_array($contract)) { + foreach($contract as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contract'] = $contract; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($interval !== null) { + if('form' === 'form' && is_array($interval)) { + foreach($interval as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['interval'] = $interval; + } + } + + // path params + if ($settle !== null) { + $resourcePath = str_replace( + '{' . 'settle' . '}', + ObjectSerializer::toPathValue($settle), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listFuturesPremiumIndex + * + * Premium Index K-Line + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) + * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FuturesPremiumIndex[] + */ + public function listFuturesPremiumIndex($associative_array) + { + list($response) = $this->listFuturesPremiumIndexWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listFuturesPremiumIndexWithHttpInfo + * + * Premium Index K-Line + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) + * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FuturesPremiumIndex[], HTTP status code, HTTP response headers (array of strings) + */ + public function listFuturesPremiumIndexWithHttpInfo($associative_array) + { + $request = $this->listFuturesPremiumIndexRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FuturesPremiumIndex[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listFuturesPremiumIndexAsync + * + * Premium Index K-Line + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) + * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFuturesPremiumIndexAsync($associative_array) + { + return $this->listFuturesPremiumIndexAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listFuturesPremiumIndexAsyncWithHttpInfo + * + * Premium Index K-Line + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) + * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) + * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) + * @param string $interval Interval time between data points (optional, default to '5m') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFuturesPremiumIndexAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\FuturesPremiumIndex[]'; + $request = $this->listFuturesPremiumIndexRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listFuturesPremiumIndex' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1473,12 +1845,12 @@ function ($exception) { * @param int $from Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) * @param int $to End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) * @param int $limit Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional, default to 100) - * @param string $interval Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional, default to '5m') + * @param string $interval Interval time between data points (optional, default to '5m') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listFuturesCandlesticksRequest($associative_array) + protected function listFuturesPremiumIndexRequest($associative_array) { // unbox the parameters from the associative array $settle = array_key_exists('settle', $associative_array) ? $associative_array['settle'] : null; @@ -1491,21 +1863,21 @@ protected function listFuturesCandlesticksRequest($associative_array) // verify the required parameter 'settle' is set if ($settle === null || (is_array($settle) && count($settle) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $settle when calling listFuturesCandlesticks' + 'Missing the required parameter $settle when calling listFuturesPremiumIndex' ); } // verify the required parameter 'contract' is set if ($contract === null || (is_array($contract) && count($contract) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $contract when calling listFuturesCandlesticks' + 'Missing the required parameter $contract when calling listFuturesPremiumIndex' ); } if ($limit !== null && $limit > 2000) { - throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listFuturesCandlesticks, must be smaller than or equal to 2000.'); + throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listFuturesPremiumIndex, must be smaller than or equal to 2000.'); } - $resourcePath = '/futures/{settle}/candlesticks'; + $resourcePath = '/futures/{settle}/premium_index'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6765,13 +7137,12 @@ protected function updateDualModePositionRiskLimitRequest($settle, $contract, $r * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract (required) - * @param string $status Only list the orders with this status (required) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) - * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param string $status Only list the orders with this status (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -6790,13 +7161,12 @@ public function listFuturesOrders($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract (required) - * @param string $status Only list the orders with this status (required) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) - * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param string $status Only list the orders with this status (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -6852,13 +7222,12 @@ public function listFuturesOrdersWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract (required) - * @param string $status Only list the orders with this status (required) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) - * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param string $status Only list the orders with this status (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -6880,13 +7249,12 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract (required) - * @param string $status Only list the orders with this status (required) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) - * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param string $status Only list the orders with this status (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -6935,13 +7303,12 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract (required) - * @param string $status Only list the orders with this status (required) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) - * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract (required) + * @param string $status Only list the orders with this status (required) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -6955,7 +7322,6 @@ protected function listFuturesOrdersRequest($associative_array) $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; $last_id = array_key_exists('last_id', $associative_array) ? $associative_array['last_id'] : null; - $count_total = array_key_exists('count_total', $associative_array) ? $associative_array['count_total'] : 0; // verify the required parameter 'settle' is set if ($settle === null || (is_array($settle) && count($settle) === 0)) { @@ -7054,18 +7420,6 @@ protected function listFuturesOrdersRequest($associative_array) } } - // query params - if ($count_total !== null) { - if('form' === 'form' && is_array($count_total)) { - foreach($count_total as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['count_total'] = $count_total; - } - } - // path params if ($settle !== null) { $resourcePath = str_replace( @@ -7619,7 +7973,261 @@ protected function cancelFuturesOrdersRequest($settle, $contract, $side = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('DELETE', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createBatchFuturesOrder + * + * Create a batch of futures orders + * + * @param string $settle Settle currency (required) + * @param \GateApi\Model\FuturesOrder[] $futures_order futures_order (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\BatchFuturesOrder[] + */ + public function createBatchFuturesOrder($settle, $futures_order) + { + list($response) = $this->createBatchFuturesOrderWithHttpInfo($settle, $futures_order); + return $response; + } + + /** + * Operation createBatchFuturesOrderWithHttpInfo + * + * Create a batch of futures orders + * + * @param string $settle Settle currency (required) + * @param \GateApi\Model\FuturesOrder[] $futures_order (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\BatchFuturesOrder[], HTTP status code, HTTP response headers (array of strings) + */ + public function createBatchFuturesOrderWithHttpInfo($settle, $futures_order) + { + $request = $this->createBatchFuturesOrderRequest($settle, $futures_order); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\BatchFuturesOrder[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation createBatchFuturesOrderAsync + * + * Create a batch of futures orders + * + * @param string $settle Settle currency (required) + * @param \GateApi\Model\FuturesOrder[] $futures_order (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createBatchFuturesOrderAsync($settle, $futures_order) + { + return $this->createBatchFuturesOrderAsyncWithHttpInfo($settle, $futures_order) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createBatchFuturesOrderAsyncWithHttpInfo + * + * Create a batch of futures orders + * + * @param string $settle Settle currency (required) + * @param \GateApi\Model\FuturesOrder[] $futures_order (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createBatchFuturesOrderAsyncWithHttpInfo($settle, $futures_order) + { + $returnType = '\GateApi\Model\BatchFuturesOrder[]'; + $request = $this->createBatchFuturesOrderRequest($settle, $futures_order); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createBatchFuturesOrder' + * + * @param string $settle Settle currency (required) + * @param \GateApi\Model\FuturesOrder[] $futures_order (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createBatchFuturesOrderRequest($settle, $futures_order) + { + // verify the required parameter 'settle' is set + if ($settle === null || (is_array($settle) && count($settle) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $settle when calling createBatchFuturesOrder' + ); + } + // verify the required parameter 'futures_order' is set + if ($futures_order === null || (is_array($futures_order) && count($futures_order) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $futures_order when calling createBatchFuturesOrder' + ); + } + + $resourcePath = '/futures/{settle}/batch_orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($settle !== null) { + $resourcePath = str_replace( + '{' . 'settle' . '}', + ObjectSerializer::toPathValue($settle), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($futures_order)) { + $_tempBody = $futures_order; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] ); } @@ -7653,7 +8261,7 @@ protected function cancelFuturesOrdersRequest($settle, $contract, $side = null) } // this endpoint requires Gate APIv4 authentication - $signHeaders = $this->config->buildSignHeaders('DELETE', $resourcePath, $queryParams, $httpBody); + $signHeaders = $this->config->buildSignHeaders('POST', $resourcePath, $queryParams, $httpBody); $headers = array_merge($headers, $signHeaders); $defaultHeaders = []; @@ -7669,7 +8277,7 @@ protected function cancelFuturesOrdersRequest($settle, $contract, $side = null) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7682,7 +8290,7 @@ protected function cancelFuturesOrdersRequest($settle, $contract, $side = null) * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -7700,7 +8308,7 @@ public function getFuturesOrder($settle, $order_id) * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -7755,7 +8363,7 @@ public function getFuturesOrderWithHttpInfo($settle, $order_id) * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -7776,7 +8384,7 @@ function ($response) { * Get a single order * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -7824,7 +8432,7 @@ function ($exception) { * Create request for operation 'getFuturesOrder' * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -7942,7 +8550,7 @@ protected function getFuturesOrderRequest($settle, $order_id) * Amend an order * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * @param \GateApi\Model\FuturesOrderAmendment $futures_order_amendment futures_order_amendment (required) * * @throws \GateApi\ApiException on non-2xx response @@ -7961,7 +8569,7 @@ public function amendFuturesOrder($settle, $order_id, $futures_order_amendment) * Amend an order * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * @param \GateApi\Model\FuturesOrderAmendment $futures_order_amendment (required) * * @throws \GateApi\ApiException on non-2xx response @@ -8017,7 +8625,7 @@ public function amendFuturesOrderWithHttpInfo($settle, $order_id, $futures_order * Amend an order * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * @param \GateApi\Model\FuturesOrderAmendment $futures_order_amendment (required) * * @throws \InvalidArgumentException @@ -8039,7 +8647,7 @@ function ($response) { * Amend an order * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * @param \GateApi\Model\FuturesOrderAmendment $futures_order_amendment (required) * * @throws \InvalidArgumentException @@ -8088,7 +8696,7 @@ function ($exception) { * Create request for operation 'amendFuturesOrder' * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * @param \GateApi\Model\FuturesOrderAmendment $futures_order_amendment (required) * * @throws \InvalidArgumentException @@ -8216,7 +8824,7 @@ protected function amendFuturesOrderRequest($settle, $order_id, $futures_order_a * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -8234,7 +8842,7 @@ public function cancelFuturesOrder($settle, $order_id) * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -8289,7 +8897,7 @@ public function cancelFuturesOrderWithHttpInfo($settle, $order_id) * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -8310,7 +8918,7 @@ function ($response) { * Cancel a single order * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -8358,7 +8966,7 @@ function ($exception) { * Create request for operation 'cancelFuturesOrder' * * @param string $settle Settle currency (required) - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -8477,13 +9085,12 @@ protected function cancelFuturesOrderRequest($settle, $order_id) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) - * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $order Futures order ID, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -8502,13 +9109,12 @@ public function getMyTrades($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) - * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $order Futures order ID, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -8564,13 +9170,12 @@ public function getMyTradesWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) - * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $order Futures order ID, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -8592,13 +9197,12 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) - * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $order Futures order ID, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -8647,13 +9251,12 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $settle Settle currency (required) - * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $order Futures order ID, return related data only if specified (optional) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) - * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) - * @param int $count_total Whether to return total number matched. Default to 0(no return) (optional, default to 0) + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $order Futures order ID, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -8667,7 +9270,6 @@ protected function getMyTradesRequest($associative_array) $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; $last_id = array_key_exists('last_id', $associative_array) ? $associative_array['last_id'] : null; - $count_total = array_key_exists('count_total', $associative_array) ? $associative_array['count_total'] : 0; // verify the required parameter 'settle' is set if ($settle === null || (is_array($settle) && count($settle) === 0)) { @@ -8754,18 +9356,6 @@ protected function getMyTradesRequest($associative_array) } } - // query params - if ($count_total !== null) { - if('form' === 'form' && is_array($count_total)) { - foreach($count_total as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['count_total'] = $count_total; - } - } - // path params if ($settle !== null) { $resourcePath = str_replace( @@ -9510,6 +10100,260 @@ protected function listLiquidatesRequest($associative_array) ); } + /** + * Operation countdownCancelAllFutures + * + * Countdown cancel orders + * + * @param string $settle Settle currency (required) + * @param \GateApi\Model\CountdownCancelAllFuturesTask $countdown_cancel_all_futures_task countdown_cancel_all_futures_task (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\TriggerTime + */ + public function countdownCancelAllFutures($settle, $countdown_cancel_all_futures_task) + { + list($response) = $this->countdownCancelAllFuturesWithHttpInfo($settle, $countdown_cancel_all_futures_task); + return $response; + } + + /** + * Operation countdownCancelAllFuturesWithHttpInfo + * + * Countdown cancel orders + * + * @param string $settle Settle currency (required) + * @param \GateApi\Model\CountdownCancelAllFuturesTask $countdown_cancel_all_futures_task (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\TriggerTime, HTTP status code, HTTP response headers (array of strings) + */ + public function countdownCancelAllFuturesWithHttpInfo($settle, $countdown_cancel_all_futures_task) + { + $request = $this->countdownCancelAllFuturesRequest($settle, $countdown_cancel_all_futures_task); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\TriggerTime'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation countdownCancelAllFuturesAsync + * + * Countdown cancel orders + * + * @param string $settle Settle currency (required) + * @param \GateApi\Model\CountdownCancelAllFuturesTask $countdown_cancel_all_futures_task (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function countdownCancelAllFuturesAsync($settle, $countdown_cancel_all_futures_task) + { + return $this->countdownCancelAllFuturesAsyncWithHttpInfo($settle, $countdown_cancel_all_futures_task) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation countdownCancelAllFuturesAsyncWithHttpInfo + * + * Countdown cancel orders + * + * @param string $settle Settle currency (required) + * @param \GateApi\Model\CountdownCancelAllFuturesTask $countdown_cancel_all_futures_task (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function countdownCancelAllFuturesAsyncWithHttpInfo($settle, $countdown_cancel_all_futures_task) + { + $returnType = '\GateApi\Model\TriggerTime'; + $request = $this->countdownCancelAllFuturesRequest($settle, $countdown_cancel_all_futures_task); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'countdownCancelAllFutures' + * + * @param string $settle Settle currency (required) + * @param \GateApi\Model\CountdownCancelAllFuturesTask $countdown_cancel_all_futures_task (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function countdownCancelAllFuturesRequest($settle, $countdown_cancel_all_futures_task) + { + // verify the required parameter 'settle' is set + if ($settle === null || (is_array($settle) && count($settle) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $settle when calling countdownCancelAllFutures' + ); + } + // verify the required parameter 'countdown_cancel_all_futures_task' is set + if ($countdown_cancel_all_futures_task === null || (is_array($countdown_cancel_all_futures_task) && count($countdown_cancel_all_futures_task) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $countdown_cancel_all_futures_task when calling countdownCancelAllFutures' + ); + } + + $resourcePath = '/futures/{settle}/countdown_cancel_all'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($settle !== null) { + $resourcePath = str_replace( + '{' . 'settle' . '}', + ObjectSerializer::toPathValue($settle), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($countdown_cancel_all_futures_task)) { + $_tempBody = $countdown_cancel_all_futures_task; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('POST', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listPriceTriggeredOrders * @@ -10372,7 +11216,7 @@ protected function cancelPriceTriggeredOrderListRequest($settle, $contract) /** * Operation getPriceTriggeredOrder * - * Get a single order + * Get a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) @@ -10390,7 +11234,7 @@ public function getPriceTriggeredOrder($settle, $order_id) /** * Operation getPriceTriggeredOrderWithHttpInfo * - * Get a single order + * Get a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) @@ -10445,7 +11289,7 @@ public function getPriceTriggeredOrderWithHttpInfo($settle, $order_id) /** * Operation getPriceTriggeredOrderAsync * - * Get a single order + * Get a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) @@ -10466,7 +11310,7 @@ function ($response) { /** * Operation getPriceTriggeredOrderAsyncWithHttpInfo * - * Get a single order + * Get a price-triggered order * * @param string $settle Settle currency (required) * @param string $order_id Retrieve the data of the order with the specified ID (required) diff --git a/src/Api/OptionsApi.php b/src/Api/OptionsApi.php index 40232e1..5169566 100644 --- a/src/Api/OptionsApi.php +++ b/src/Api/OptionsApi.php @@ -330,7 +330,7 @@ protected function listOptionsUnderlyingsRequest() * * List all expiration times * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -347,7 +347,7 @@ public function listOptionsExpirations($underlying) * * List all expiration times * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -401,7 +401,7 @@ public function listOptionsExpirationsWithHttpInfo($underlying) * * List all expiration times * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -421,7 +421,7 @@ function ($response) { * * List all expiration times * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -468,7 +468,7 @@ function ($exception) { /** * Create request for operation 'listOptionsExpirations' * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -572,7 +572,7 @@ protected function listOptionsExpirationsRequest($underlying) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $expiration Unix timestamp of the expiration time (optional) * * @throws \GateApi\ApiException on non-2xx response @@ -592,7 +592,7 @@ public function listOptionsContracts($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $expiration Unix timestamp of the expiration time (optional) * * @throws \GateApi\ApiException on non-2xx response @@ -649,7 +649,7 @@ public function listOptionsContractsWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $expiration Unix timestamp of the expiration time (optional) * * @throws \InvalidArgumentException @@ -672,7 +672,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $expiration Unix timestamp of the expiration time (optional) * * @throws \InvalidArgumentException @@ -722,7 +722,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $expiration Unix timestamp of the expiration time (optional) * * @throws \InvalidArgumentException @@ -1080,7 +1080,7 @@ protected function getOptionsContractRequest($contract) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -1103,7 +1103,7 @@ public function listOptionsSettlements($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -1163,7 +1163,7 @@ public function listOptionsSettlementsWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -1189,7 +1189,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -1242,7 +1242,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -1415,7 +1415,7 @@ protected function listOptionsSettlementsRequest($associative_array) * Get specified contract's settlement * * @param string $contract contract (required) - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $at at (required) * * @throws \GateApi\ApiException on non-2xx response @@ -1434,7 +1434,7 @@ public function getOptionsSettlement($contract, $underlying, $at) * Get specified contract's settlement * * @param string $contract (required) - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $at (required) * * @throws \GateApi\ApiException on non-2xx response @@ -1490,7 +1490,7 @@ public function getOptionsSettlementWithHttpInfo($contract, $underlying, $at) * Get specified contract's settlement * * @param string $contract (required) - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $at (required) * * @throws \InvalidArgumentException @@ -1512,7 +1512,7 @@ function ($response) { * Get specified contract's settlement * * @param string $contract (required) - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $at (required) * * @throws \InvalidArgumentException @@ -1561,7 +1561,7 @@ function ($exception) { * Create request for operation 'getOptionsSettlement' * * @param string $contract (required) - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $at (required) * * @throws \InvalidArgumentException @@ -1699,8 +1699,8 @@ protected function getOptionsSettlementRequest($contract, $underlying, $at) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -1723,8 +1723,8 @@ public function listMyOptionsSettlements($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -1784,8 +1784,8 @@ public function listMyOptionsSettlementsWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -1811,8 +1811,8 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -1865,8 +1865,8 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -2052,11 +2052,11 @@ protected function listMyOptionsSettlementsRequest($associative_array) /** * Operation listOptionsOrderBook * - * Futures order book + * Options order book * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Futures contract (required) + * @param string $contract Options contract name (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) @@ -2074,11 +2074,11 @@ public function listOptionsOrderBook($associative_array) /** * Operation listOptionsOrderBookWithHttpInfo * - * Futures order book + * Options order book * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Futures contract (required) + * @param string $contract Options contract name (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) @@ -2133,11 +2133,11 @@ public function listOptionsOrderBookWithHttpInfo($associative_array) /** * Operation listOptionsOrderBookAsync * - * Futures order book + * Options order book * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Futures contract (required) + * @param string $contract Options contract name (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) @@ -2158,11 +2158,11 @@ function ($response) { /** * Operation listOptionsOrderBookAsyncWithHttpInfo * - * Futures order book + * Options order book * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Futures contract (required) + * @param string $contract Options contract name (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) @@ -2214,7 +2214,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Futures contract (required) + * @param string $contract Options contract name (required) * @param string $interval Order depth. 0 means no aggregation is applied. default to 0 (optional, default to '0') * @param int $limit Maximum number of order depth data in asks or bids (optional, default to 10) * @param bool $with_id Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional, default to false) @@ -2368,7 +2368,7 @@ protected function listOptionsOrderBookRequest($associative_array) * * List tickers of options contracts * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2385,7 +2385,7 @@ public function listOptionsTickers($underlying) * * List tickers of options contracts * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2439,7 +2439,7 @@ public function listOptionsTickersWithHttpInfo($underlying) * * List tickers of options contracts * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2459,7 +2459,7 @@ function ($response) { * * List tickers of options contracts * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2506,7 +2506,7 @@ function ($exception) { /** * Create request for operation 'listOptionsTickers' * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2843,11 +2843,11 @@ protected function listOptionsUnderlyingTickersRequest($underlying) /** * Operation listOptionsCandlesticks * - * Get futures candlesticks + * Get options candlesticks * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Futures contract (required) + * @param string $contract Options contract name (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -2855,7 +2855,7 @@ protected function listOptionsUnderlyingTickersRequest($underlying) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \GateApi\Model\FuturesCandlestick[] + * @return \GateApi\Model\OptionsCandlestick[] */ public function listOptionsCandlesticks($associative_array) { @@ -2866,11 +2866,11 @@ public function listOptionsCandlesticks($associative_array) /** * Operation listOptionsCandlesticksWithHttpInfo * - * Get futures candlesticks + * Get options candlesticks * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Futures contract (required) + * @param string $contract Options contract name (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -2878,7 +2878,7 @@ public function listOptionsCandlesticks($associative_array) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \GateApi\Model\FuturesCandlestick[], HTTP status code, HTTP response headers (array of strings) + * @return array of \GateApi\Model\OptionsCandlestick[], HTTP status code, HTTP response headers (array of strings) */ public function listOptionsCandlesticksWithHttpInfo($associative_array) { @@ -2908,7 +2908,7 @@ public function listOptionsCandlesticksWithHttpInfo($associative_array) ); } - $returnType = '\GateApi\Model\FuturesCandlestick[]'; + $returnType = '\GateApi\Model\OptionsCandlestick[]'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -2926,11 +2926,11 @@ public function listOptionsCandlesticksWithHttpInfo($associative_array) /** * Operation listOptionsCandlesticksAsync * - * Get futures candlesticks + * Get options candlesticks * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Futures contract (required) + * @param string $contract Options contract name (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -2952,11 +2952,11 @@ function ($response) { /** * Operation listOptionsCandlesticksAsyncWithHttpInfo * - * Get futures candlesticks + * Get options candlesticks * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Futures contract (required) + * @param string $contract Options contract name (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -2967,7 +2967,7 @@ function ($response) { */ public function listOptionsCandlesticksAsyncWithHttpInfo($associative_array) { - $returnType = '\GateApi\Model\FuturesCandlestick[]'; + $returnType = '\GateApi\Model\OptionsCandlestick[]'; $request = $this->listOptionsCandlesticksRequest($associative_array); return $this->client @@ -3009,7 +3009,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Futures contract (required) + * @param string $contract Options contract name (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -3179,7 +3179,7 @@ protected function listOptionsCandlesticksRequest($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -3202,7 +3202,7 @@ public function listOptionsUnderlyingCandlesticks($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -3262,7 +3262,7 @@ public function listOptionsUnderlyingCandlesticksWithHttpInfo($associative_array * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -3288,7 +3288,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -3341,7 +3341,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) @@ -3511,7 +3511,7 @@ protected function listOptionsUnderlyingCandlesticksRequest($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $type `C` is call, while `P` is put (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) @@ -3535,7 +3535,7 @@ public function listOptionsTrades($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $type `C` is call, while `P` is put (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) @@ -3596,7 +3596,7 @@ public function listOptionsTradesWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $type `C` is call, while `P` is put (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) @@ -3623,7 +3623,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $type `C` is call, while `P` is put (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) @@ -3677,7 +3677,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $type `C` is call, while `P` is put (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) @@ -4897,8 +4897,8 @@ protected function getOptionsPositionRequest($contract) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -4917,8 +4917,8 @@ public function listOptionsPositionClose($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -4974,8 +4974,8 @@ public function listOptionsPositionCloseWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -4997,8 +4997,8 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -5047,8 +5047,8 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -5167,12 +5167,12 @@ protected function listOptionsPositionCloseRequest($associative_array) /** * Operation listOptionsOrders * - * List futures orders + * List options orders * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $status Only list the orders with this status (required) - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $underlying Underlying (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) @@ -5192,12 +5192,12 @@ public function listOptionsOrders($associative_array) /** * Operation listOptionsOrdersWithHttpInfo * - * List futures orders + * List options orders * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $status Only list the orders with this status (required) - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $underlying Underlying (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) @@ -5254,12 +5254,12 @@ public function listOptionsOrdersWithHttpInfo($associative_array) /** * Operation listOptionsOrdersAsync * - * List futures orders + * List options orders * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $status Only list the orders with this status (required) - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $underlying Underlying (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) @@ -5282,12 +5282,12 @@ function ($response) { /** * Operation listOptionsOrdersAsyncWithHttpInfo * - * List futures orders + * List options orders * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $status Only list the orders with this status (required) - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $underlying Underlying (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) @@ -5342,7 +5342,7 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $status Only list the orders with this status (required) - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $underlying Underlying (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) @@ -5778,7 +5778,7 @@ protected function createOptionsOrderRequest($options_order) * * Cancel all `open` orders matched * - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $underlying Underlying (optional) * @param string $side All bids or asks. Both included if not specified (optional) * @@ -5797,7 +5797,7 @@ public function cancelOptionsOrders($contract = null, $underlying = null, $side * * Cancel all `open` orders matched * - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $underlying Underlying (optional) * @param string $side All bids or asks. Both included if not specified (optional) * @@ -5853,7 +5853,7 @@ public function cancelOptionsOrdersWithHttpInfo($contract = null, $underlying = * * Cancel all `open` orders matched * - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $underlying Underlying (optional) * @param string $side All bids or asks. Both included if not specified (optional) * @@ -5875,7 +5875,7 @@ function ($response) { * * Cancel all `open` orders matched * - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $underlying Underlying (optional) * @param string $side All bids or asks. Both included if not specified (optional) * @@ -5924,7 +5924,7 @@ function ($exception) { /** * Create request for operation 'cancelOptionsOrders' * - * @param string $contract Contract name (optional) + * @param string $contract Options contract name (optional) * @param string $underlying Underlying (optional) * @param string $side All bids or asks. Both included if not specified (optional) * @@ -6531,8 +6531,8 @@ protected function cancelOptionsOrderRequest($order_id) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -6555,8 +6555,8 @@ public function listMyOptionsTrades($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -6616,8 +6616,8 @@ public function listMyOptionsTradesWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -6643,8 +6643,8 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) @@ -6697,8 +6697,8 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $underlying Underlying (required) - * @param string $contract Contract name (optional) + * @param string $underlying Underlying (Obtained by listing underlying endpoint) (required) + * @param string $contract Options contract name (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) diff --git a/src/Api/SpotApi.php b/src/Api/SpotApi.php index 6765dd7..d488135 100644 --- a/src/Api/SpotApi.php +++ b/src/Api/SpotApi.php @@ -1595,7 +1595,7 @@ protected function listOrderBookRequest($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list. Default: 100, Minimum: 1, Maximum: 1000 (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param bool $reverse Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * @param int $from Start timestamp of the query (optional) @@ -1620,7 +1620,7 @@ public function listTrades($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list. Default: 100, Minimum: 1, Maximum: 1000 (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param bool $reverse Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * @param int $from Start timestamp of the query (optional) @@ -1682,7 +1682,7 @@ public function listTradesWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list. Default: 100, Minimum: 1, Maximum: 1000 (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param bool $reverse Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * @param int $from Start timestamp of the query (optional) @@ -1710,7 +1710,7 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list. Default: 100, Minimum: 1, Maximum: 1000 (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param bool $reverse Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * @param int $from Start timestamp of the query (optional) @@ -1765,7 +1765,7 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Currency pair (required) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $limit Maximum number of records to be returned in a single list. Default: 100, Minimum: 1, Maximum: 1000 (optional, default to 100) * @param string $last_id Specify list staring point using the `id` of last record in previous list-query results (optional) * @param bool $reverse Whether the id of records to be retrieved should be less than the last_id specified. Default to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional, default to false) * @param int $from Start timestamp of the query (optional) @@ -4707,7 +4707,7 @@ protected function cancelBatchOrdersRequest($cancel_order) * * Get a single order * - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @@ -4726,7 +4726,7 @@ public function getOrder($order_id, $currency_pair, $account = null) * * Get a single order * - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @@ -4782,7 +4782,7 @@ public function getOrderWithHttpInfo($order_id, $currency_pair, $account = null) * * Get a single order * - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @@ -4804,7 +4804,7 @@ function ($response) { * * Get a single order * - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @@ -4853,7 +4853,7 @@ function ($exception) { /** * Create request for operation 'getOrder' * - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @@ -4987,7 +4987,7 @@ protected function getOrderRequest($order_id, $currency_pair, $account = null) * * Cancel a single order * - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @@ -5006,7 +5006,7 @@ public function cancelOrder($order_id, $currency_pair, $account = null) * * Cancel a single order * - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @@ -5062,7 +5062,7 @@ public function cancelOrderWithHttpInfo($order_id, $currency_pair, $account = nu * * Cancel a single order * - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @@ -5084,7 +5084,7 @@ function ($response) { * * Cancel a single order * - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @@ -5133,7 +5133,7 @@ function ($exception) { /** * Create request for operation 'cancelOrder' * - * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) * @param string $currency_pair Currency pair (required) * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) * @@ -5269,7 +5269,7 @@ protected function cancelOrderRequest($order_id, $currency_pair, $account = null * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) + * @param string $currency_pair Retrieve results with specified currency pair (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) @@ -5294,7 +5294,7 @@ public function listMyTrades($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) + * @param string $currency_pair Retrieve results with specified currency pair (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) @@ -5356,7 +5356,7 @@ public function listMyTradesWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) + * @param string $currency_pair Retrieve results with specified currency pair (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) @@ -5384,7 +5384,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) + * @param string $currency_pair Retrieve results with specified currency pair (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) @@ -5439,7 +5439,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $currency_pair Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) + * @param string $currency_pair Retrieve results with specified currency pair (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) * @param int $page Page number (optional, default to 1) * @param string $order_id Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) @@ -5461,12 +5461,6 @@ protected function listMyTradesRequest($associative_array) $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; - // verify the required parameter 'currency_pair' is set - if ($currency_pair === null || (is_array($currency_pair) && count($currency_pair) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $currency_pair when calling listMyTrades' - ); - } if ($limit !== null && $limit > 1000) { throw new \InvalidArgumentException('invalid value for "$limit" when calling SpotApi.listMyTrades, must be smaller than or equal to 1000.'); } @@ -5849,6 +5843,240 @@ protected function getSystemTimeRequest() ); } + /** + * Operation countdownCancelAllSpot + * + * Countdown cancel orders + * + * @param \GateApi\Model\CountdownCancelAllSpotTask $countdown_cancel_all_spot_task countdown_cancel_all_spot_task (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\TriggerTime + */ + public function countdownCancelAllSpot($countdown_cancel_all_spot_task) + { + list($response) = $this->countdownCancelAllSpotWithHttpInfo($countdown_cancel_all_spot_task); + return $response; + } + + /** + * Operation countdownCancelAllSpotWithHttpInfo + * + * Countdown cancel orders + * + * @param \GateApi\Model\CountdownCancelAllSpotTask $countdown_cancel_all_spot_task (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\TriggerTime, HTTP status code, HTTP response headers (array of strings) + */ + public function countdownCancelAllSpotWithHttpInfo($countdown_cancel_all_spot_task) + { + $request = $this->countdownCancelAllSpotRequest($countdown_cancel_all_spot_task); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\TriggerTime'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation countdownCancelAllSpotAsync + * + * Countdown cancel orders + * + * @param \GateApi\Model\CountdownCancelAllSpotTask $countdown_cancel_all_spot_task (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function countdownCancelAllSpotAsync($countdown_cancel_all_spot_task) + { + return $this->countdownCancelAllSpotAsyncWithHttpInfo($countdown_cancel_all_spot_task) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation countdownCancelAllSpotAsyncWithHttpInfo + * + * Countdown cancel orders + * + * @param \GateApi\Model\CountdownCancelAllSpotTask $countdown_cancel_all_spot_task (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function countdownCancelAllSpotAsyncWithHttpInfo($countdown_cancel_all_spot_task) + { + $returnType = '\GateApi\Model\TriggerTime'; + $request = $this->countdownCancelAllSpotRequest($countdown_cancel_all_spot_task); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'countdownCancelAllSpot' + * + * @param \GateApi\Model\CountdownCancelAllSpotTask $countdown_cancel_all_spot_task (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function countdownCancelAllSpotRequest($countdown_cancel_all_spot_task) + { + // verify the required parameter 'countdown_cancel_all_spot_task' is set + if ($countdown_cancel_all_spot_task === null || (is_array($countdown_cancel_all_spot_task) && count($countdown_cancel_all_spot_task) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $countdown_cancel_all_spot_task when calling countdownCancelAllSpot' + ); + } + + $resourcePath = '/spot/countdown_cancel_all'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + if (isset($countdown_cancel_all_spot_task)) { + $_tempBody = $countdown_cancel_all_spot_task; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('POST', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listSpotPriceTriggeredOrders * @@ -6679,7 +6907,7 @@ protected function cancelSpotPriceTriggeredOrderListRequest($market = null, $acc /** * Operation getSpotPriceTriggeredOrder * - * Get a single order + * Get a price-triggered order * * @param string $order_id Retrieve the data of the order with the specified ID (required) * @@ -6696,7 +6924,7 @@ public function getSpotPriceTriggeredOrder($order_id) /** * Operation getSpotPriceTriggeredOrderWithHttpInfo * - * Get a single order + * Get a price-triggered order * * @param string $order_id Retrieve the data of the order with the specified ID (required) * @@ -6750,7 +6978,7 @@ public function getSpotPriceTriggeredOrderWithHttpInfo($order_id) /** * Operation getSpotPriceTriggeredOrderAsync * - * Get a single order + * Get a price-triggered order * * @param string $order_id Retrieve the data of the order with the specified ID (required) * @@ -6770,7 +6998,7 @@ function ($response) { /** * Operation getSpotPriceTriggeredOrderAsyncWithHttpInfo * - * Get a single order + * Get a price-triggered order * * @param string $order_id Retrieve the data of the order with the specified ID (required) * diff --git a/src/Api/SubAccountApi.php b/src/Api/SubAccountApi.php new file mode 100644 index 0000000..53af93d --- /dev/null +++ b/src/Api/SubAccountApi.php @@ -0,0 +1,2523 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $host_index; + } + + /** + * Set the host index + * + * @param int Host index (required) + */ + public function setHostIndex($host_index) + { + $this->hostIndex = $host_index; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listSubAccounts + * + * List sub-accounts + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\SubAccount[] + */ + public function listSubAccounts() + { + list($response) = $this->listSubAccountsWithHttpInfo(); + return $response; + } + + /** + * Operation listSubAccountsWithHttpInfo + * + * List sub-accounts + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\SubAccount[], HTTP status code, HTTP response headers (array of strings) + */ + public function listSubAccountsWithHttpInfo() + { + $request = $this->listSubAccountsRequest(); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\SubAccount[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listSubAccountsAsync + * + * List sub-accounts + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSubAccountsAsync() + { + return $this->listSubAccountsAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listSubAccountsAsyncWithHttpInfo + * + * List sub-accounts + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSubAccountsAsyncWithHttpInfo() + { + $returnType = '\GateApi\Model\SubAccount[]'; + $request = $this->listSubAccountsRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listSubAccounts' + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listSubAccountsRequest() + { + + $resourcePath = '/sub_accounts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createSubAccounts + * + * Create a new sub-account + * + * @param \GateApi\Model\SubAccount $sub_account sub_account (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\SubAccount + */ + public function createSubAccounts($sub_account) + { + list($response) = $this->createSubAccountsWithHttpInfo($sub_account); + return $response; + } + + /** + * Operation createSubAccountsWithHttpInfo + * + * Create a new sub-account + * + * @param \GateApi\Model\SubAccount $sub_account (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\SubAccount, HTTP status code, HTTP response headers (array of strings) + */ + public function createSubAccountsWithHttpInfo($sub_account) + { + $request = $this->createSubAccountsRequest($sub_account); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\SubAccount'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation createSubAccountsAsync + * + * Create a new sub-account + * + * @param \GateApi\Model\SubAccount $sub_account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSubAccountsAsync($sub_account) + { + return $this->createSubAccountsAsyncWithHttpInfo($sub_account) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createSubAccountsAsyncWithHttpInfo + * + * Create a new sub-account + * + * @param \GateApi\Model\SubAccount $sub_account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSubAccountsAsyncWithHttpInfo($sub_account) + { + $returnType = '\GateApi\Model\SubAccount'; + $request = $this->createSubAccountsRequest($sub_account); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createSubAccounts' + * + * @param \GateApi\Model\SubAccount $sub_account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createSubAccountsRequest($sub_account) + { + // verify the required parameter 'sub_account' is set + if ($sub_account === null || (is_array($sub_account) && count($sub_account) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sub_account when calling createSubAccounts' + ); + } + + $resourcePath = '/sub_accounts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + if (isset($sub_account)) { + $_tempBody = $sub_account; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('POST', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSubAccount + * + * Get the sub-account + * + * @param int $user_id Sub-account user id (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\SubAccount + */ + public function getSubAccount($user_id) + { + list($response) = $this->getSubAccountWithHttpInfo($user_id); + return $response; + } + + /** + * Operation getSubAccountWithHttpInfo + * + * Get the sub-account + * + * @param int $user_id Sub-account user id (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\SubAccount, HTTP status code, HTTP response headers (array of strings) + */ + public function getSubAccountWithHttpInfo($user_id) + { + $request = $this->getSubAccountRequest($user_id); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\SubAccount'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getSubAccountAsync + * + * Get the sub-account + * + * @param int $user_id Sub-account user id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSubAccountAsync($user_id) + { + return $this->getSubAccountAsyncWithHttpInfo($user_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSubAccountAsyncWithHttpInfo + * + * Get the sub-account + * + * @param int $user_id Sub-account user id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSubAccountAsyncWithHttpInfo($user_id) + { + $returnType = '\GateApi\Model\SubAccount'; + $request = $this->getSubAccountRequest($user_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSubAccount' + * + * @param int $user_id Sub-account user id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getSubAccountRequest($user_id) + { + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_id when calling getSubAccount' + ); + } + + $resourcePath = '/sub_accounts/{user_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($user_id !== null) { + $resourcePath = str_replace( + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listSubAccountKeys + * + * List all API Key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\SubAccountKey[] + */ + public function listSubAccountKeys($user_id) + { + list($response) = $this->listSubAccountKeysWithHttpInfo($user_id); + return $response; + } + + /** + * Operation listSubAccountKeysWithHttpInfo + * + * List all API Key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\SubAccountKey[], HTTP status code, HTTP response headers (array of strings) + */ + public function listSubAccountKeysWithHttpInfo($user_id) + { + $request = $this->listSubAccountKeysRequest($user_id); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\SubAccountKey[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listSubAccountKeysAsync + * + * List all API Key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSubAccountKeysAsync($user_id) + { + return $this->listSubAccountKeysAsyncWithHttpInfo($user_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listSubAccountKeysAsyncWithHttpInfo + * + * List all API Key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSubAccountKeysAsyncWithHttpInfo($user_id) + { + $returnType = '\GateApi\Model\SubAccountKey[]'; + $request = $this->listSubAccountKeysRequest($user_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listSubAccountKeys' + * + * @param int $user_id Sub-account user id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listSubAccountKeysRequest($user_id) + { + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_id when calling listSubAccountKeys' + ); + } + + $resourcePath = '/sub_accounts/{user_id}/keys'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($user_id !== null) { + $resourcePath = str_replace( + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createSubAccountKeys + * + * Create API Key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param \GateApi\Model\SubAccountKey $sub_account_key sub_account_key (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\SubAccountKey[] + */ + public function createSubAccountKeys($user_id, $sub_account_key) + { + list($response) = $this->createSubAccountKeysWithHttpInfo($user_id, $sub_account_key); + return $response; + } + + /** + * Operation createSubAccountKeysWithHttpInfo + * + * Create API Key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param \GateApi\Model\SubAccountKey $sub_account_key (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\SubAccountKey[], HTTP status code, HTTP response headers (array of strings) + */ + public function createSubAccountKeysWithHttpInfo($user_id, $sub_account_key) + { + $request = $this->createSubAccountKeysRequest($user_id, $sub_account_key); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\SubAccountKey[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation createSubAccountKeysAsync + * + * Create API Key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param \GateApi\Model\SubAccountKey $sub_account_key (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSubAccountKeysAsync($user_id, $sub_account_key) + { + return $this->createSubAccountKeysAsyncWithHttpInfo($user_id, $sub_account_key) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createSubAccountKeysAsyncWithHttpInfo + * + * Create API Key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param \GateApi\Model\SubAccountKey $sub_account_key (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSubAccountKeysAsyncWithHttpInfo($user_id, $sub_account_key) + { + $returnType = '\GateApi\Model\SubAccountKey[]'; + $request = $this->createSubAccountKeysRequest($user_id, $sub_account_key); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createSubAccountKeys' + * + * @param int $user_id Sub-account user id (required) + * @param \GateApi\Model\SubAccountKey $sub_account_key (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createSubAccountKeysRequest($user_id, $sub_account_key) + { + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_id when calling createSubAccountKeys' + ); + } + // verify the required parameter 'sub_account_key' is set + if ($sub_account_key === null || (is_array($sub_account_key) && count($sub_account_key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sub_account_key when calling createSubAccountKeys' + ); + } + + $resourcePath = '/sub_accounts/{user_id}/keys'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($user_id !== null) { + $resourcePath = str_replace( + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($sub_account_key)) { + $_tempBody = $sub_account_key; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('POST', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSubAccountKey + * + * Get the API Key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\SubAccountKey + */ + public function getSubAccountKey($user_id, $key) + { + list($response) = $this->getSubAccountKeyWithHttpInfo($user_id, $key); + return $response; + } + + /** + * Operation getSubAccountKeyWithHttpInfo + * + * Get the API Key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\SubAccountKey, HTTP status code, HTTP response headers (array of strings) + */ + public function getSubAccountKeyWithHttpInfo($user_id, $key) + { + $request = $this->getSubAccountKeyRequest($user_id, $key); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\SubAccountKey'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getSubAccountKeyAsync + * + * Get the API Key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSubAccountKeyAsync($user_id, $key) + { + return $this->getSubAccountKeyAsyncWithHttpInfo($user_id, $key) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSubAccountKeyAsyncWithHttpInfo + * + * Get the API Key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSubAccountKeyAsyncWithHttpInfo($user_id, $key) + { + $returnType = '\GateApi\Model\SubAccountKey'; + $request = $this->getSubAccountKeyRequest($user_id, $key); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSubAccountKey' + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getSubAccountKeyRequest($user_id, $key) + { + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_id when calling getSubAccountKey' + ); + } + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling getSubAccountKey' + ); + } + + $resourcePath = '/sub_accounts/{user_id}/keys/{key}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($user_id !== null) { + $resourcePath = str_replace( + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), + $resourcePath + ); + } + + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSubAccountKeys + * + * Update API key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * @param \GateApi\Model\SubAccountKey $sub_account_key sub_account_key (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateSubAccountKeys($user_id, $key, $sub_account_key) + { + $this->updateSubAccountKeysWithHttpInfo($user_id, $key, $sub_account_key); + } + + /** + * Operation updateSubAccountKeysWithHttpInfo + * + * Update API key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * @param \GateApi\Model\SubAccountKey $sub_account_key (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSubAccountKeysWithHttpInfo($user_id, $key, $sub_account_key) + { + $request = $this->updateSubAccountKeysRequest($user_id, $key, $sub_account_key); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + return [null, $statusCode, $response->getHeaders()]; + } + + /** + * Operation updateSubAccountKeysAsync + * + * Update API key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * @param \GateApi\Model\SubAccountKey $sub_account_key (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSubAccountKeysAsync($user_id, $key, $sub_account_key) + { + return $this->updateSubAccountKeysAsyncWithHttpInfo($user_id, $key, $sub_account_key) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSubAccountKeysAsyncWithHttpInfo + * + * Update API key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * @param \GateApi\Model\SubAccountKey $sub_account_key (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSubAccountKeysAsyncWithHttpInfo($user_id, $key, $sub_account_key) + { + $returnType = ''; + $request = $this->updateSubAccountKeysRequest($user_id, $key, $sub_account_key); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSubAccountKeys' + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * @param \GateApi\Model\SubAccountKey $sub_account_key (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateSubAccountKeysRequest($user_id, $key, $sub_account_key) + { + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_id when calling updateSubAccountKeys' + ); + } + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling updateSubAccountKeys' + ); + } + // verify the required parameter 'sub_account_key' is set + if ($sub_account_key === null || (is_array($sub_account_key) && count($sub_account_key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sub_account_key when calling updateSubAccountKeys' + ); + } + + $resourcePath = '/sub_accounts/{user_id}/keys/{key}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($user_id !== null) { + $resourcePath = str_replace( + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), + $resourcePath + ); + } + + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($sub_account_key)) { + $_tempBody = $sub_account_key; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('PUT', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteSubAccountKeys + * + * Delete API key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteSubAccountKeys($user_id, $key) + { + $this->deleteSubAccountKeysWithHttpInfo($user_id, $key); + } + + /** + * Operation deleteSubAccountKeysWithHttpInfo + * + * Delete API key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteSubAccountKeysWithHttpInfo($user_id, $key) + { + $request = $this->deleteSubAccountKeysRequest($user_id, $key); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + return [null, $statusCode, $response->getHeaders()]; + } + + /** + * Operation deleteSubAccountKeysAsync + * + * Delete API key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSubAccountKeysAsync($user_id, $key) + { + return $this->deleteSubAccountKeysAsyncWithHttpInfo($user_id, $key) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteSubAccountKeysAsyncWithHttpInfo + * + * Delete API key of the sub-account + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSubAccountKeysAsyncWithHttpInfo($user_id, $key) + { + $returnType = ''; + $request = $this->deleteSubAccountKeysRequest($user_id, $key); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteSubAccountKeys' + * + * @param int $user_id Sub-account user id (required) + * @param string $key The API Key of the sub-account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteSubAccountKeysRequest($user_id, $key) + { + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_id when calling deleteSubAccountKeys' + ); + } + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling deleteSubAccountKeys' + ); + } + + $resourcePath = '/sub_accounts/{user_id}/keys/{key}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($user_id !== null) { + $resourcePath = str_replace( + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), + $resourcePath + ); + } + + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('DELETE', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation lockSubAccount + * + * Lock the sub-account + * + * @param int $user_id The user id of the sub-account (required) + * @param object $body body (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function lockSubAccount($user_id, $body) + { + $this->lockSubAccountWithHttpInfo($user_id, $body); + } + + /** + * Operation lockSubAccountWithHttpInfo + * + * Lock the sub-account + * + * @param int $user_id The user id of the sub-account (required) + * @param object $body (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function lockSubAccountWithHttpInfo($user_id, $body) + { + $request = $this->lockSubAccountRequest($user_id, $body); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + return [null, $statusCode, $response->getHeaders()]; + } + + /** + * Operation lockSubAccountAsync + * + * Lock the sub-account + * + * @param int $user_id The user id of the sub-account (required) + * @param object $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function lockSubAccountAsync($user_id, $body) + { + return $this->lockSubAccountAsyncWithHttpInfo($user_id, $body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation lockSubAccountAsyncWithHttpInfo + * + * Lock the sub-account + * + * @param int $user_id The user id of the sub-account (required) + * @param object $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function lockSubAccountAsyncWithHttpInfo($user_id, $body) + { + $returnType = ''; + $request = $this->lockSubAccountRequest($user_id, $body); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'lockSubAccount' + * + * @param int $user_id The user id of the sub-account (required) + * @param object $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function lockSubAccountRequest($user_id, $body) + { + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_id when calling lockSubAccount' + ); + } + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling lockSubAccount' + ); + } + + $resourcePath = '/sub_accounts/{user_id}/lock'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($user_id !== null) { + $resourcePath = str_replace( + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('POST', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation unlockSubAccount + * + * Unlock the sub-account + * + * @param int $user_id The user id of the sub-account (required) + * @param object $body body (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function unlockSubAccount($user_id, $body) + { + $this->unlockSubAccountWithHttpInfo($user_id, $body); + } + + /** + * Operation unlockSubAccountWithHttpInfo + * + * Unlock the sub-account + * + * @param int $user_id The user id of the sub-account (required) + * @param object $body (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function unlockSubAccountWithHttpInfo($user_id, $body) + { + $request = $this->unlockSubAccountRequest($user_id, $body); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + return [null, $statusCode, $response->getHeaders()]; + } + + /** + * Operation unlockSubAccountAsync + * + * Unlock the sub-account + * + * @param int $user_id The user id of the sub-account (required) + * @param object $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function unlockSubAccountAsync($user_id, $body) + { + return $this->unlockSubAccountAsyncWithHttpInfo($user_id, $body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation unlockSubAccountAsyncWithHttpInfo + * + * Unlock the sub-account + * + * @param int $user_id The user id of the sub-account (required) + * @param object $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function unlockSubAccountAsyncWithHttpInfo($user_id, $body) + { + $returnType = ''; + $request = $this->unlockSubAccountRequest($user_id, $body); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'unlockSubAccount' + * + * @param int $user_id The user id of the sub-account (required) + * @param object $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function unlockSubAccountRequest($user_id, $body) + { + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_id when calling unlockSubAccount' + ); + } + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling unlockSubAccount' + ); + } + + $resourcePath = '/sub_accounts/{user_id}/unlock'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($user_id !== null) { + $resourcePath = str_replace( + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('POST', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/WalletApi.php b/src/Api/WalletApi.php index 6f1c0f2..6e15404 100644 --- a/src/Api/WalletApi.php +++ b/src/Api/WalletApi.php @@ -1503,7 +1503,7 @@ protected function transferRequest($transfer) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -1526,7 +1526,7 @@ public function listSubAccountTransfers($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -1586,7 +1586,7 @@ public function listSubAccountTransfersWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -1612,7 +1612,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -1665,7 +1665,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * @param int $from Time range beginning, default to 7 days before current time (optional) * @param int $to Time range ending, default to current time (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) @@ -2039,6 +2039,216 @@ protected function transferWithSubAccountRequest($sub_account_transfer) ); } + /** + * Operation subAccountToSubAccount + * + * Sub-account transfers to sub-account + * + * @param \GateApi\Model\SubAccountToSubAccount $sub_account_to_sub_account sub_account_to_sub_account (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function subAccountToSubAccount($sub_account_to_sub_account) + { + $this->subAccountToSubAccountWithHttpInfo($sub_account_to_sub_account); + } + + /** + * Operation subAccountToSubAccountWithHttpInfo + * + * Sub-account transfers to sub-account + * + * @param \GateApi\Model\SubAccountToSubAccount $sub_account_to_sub_account (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function subAccountToSubAccountWithHttpInfo($sub_account_to_sub_account) + { + $request = $this->subAccountToSubAccountRequest($sub_account_to_sub_account); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + return [null, $statusCode, $response->getHeaders()]; + } + + /** + * Operation subAccountToSubAccountAsync + * + * Sub-account transfers to sub-account + * + * @param \GateApi\Model\SubAccountToSubAccount $sub_account_to_sub_account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subAccountToSubAccountAsync($sub_account_to_sub_account) + { + return $this->subAccountToSubAccountAsyncWithHttpInfo($sub_account_to_sub_account) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation subAccountToSubAccountAsyncWithHttpInfo + * + * Sub-account transfers to sub-account + * + * @param \GateApi\Model\SubAccountToSubAccount $sub_account_to_sub_account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subAccountToSubAccountAsyncWithHttpInfo($sub_account_to_sub_account) + { + $returnType = ''; + $request = $this->subAccountToSubAccountRequest($sub_account_to_sub_account); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'subAccountToSubAccount' + * + * @param \GateApi\Model\SubAccountToSubAccount $sub_account_to_sub_account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function subAccountToSubAccountRequest($sub_account_to_sub_account) + { + // verify the required parameter 'sub_account_to_sub_account' is set + if ($sub_account_to_sub_account === null || (is_array($sub_account_to_sub_account) && count($sub_account_to_sub_account) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sub_account_to_sub_account when calling subAccountToSubAccount' + ); + } + + $resourcePath = '/wallet/sub_account_to_sub_account'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // body params + $_tempBody = null; + if (isset($sub_account_to_sub_account)) { + $_tempBody = $sub_account_to_sub_account; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('POST', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listWithdrawStatus * @@ -2296,7 +2506,7 @@ protected function listWithdrawStatusRequest($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2315,7 +2525,7 @@ public function listSubAccountBalances($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2371,7 +2581,7 @@ public function listSubAccountBalancesWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2393,7 +2603,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2442,7 +2652,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2546,7 +2756,7 @@ protected function listSubAccountBalancesRequest($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2565,7 +2775,7 @@ public function listSubAccountMarginBalances($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2621,7 +2831,7 @@ public function listSubAccountMarginBalancesWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2643,7 +2853,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2692,7 +2902,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2796,7 +3006,7 @@ protected function listSubAccountMarginBalancesRequest($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * @param string $settle Query only balances of specified settle currency (optional) * * @throws \GateApi\ApiException on non-2xx response @@ -2816,7 +3026,7 @@ public function listSubAccountFuturesBalances($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * @param string $settle Query only balances of specified settle currency (optional) * * @throws \GateApi\ApiException on non-2xx response @@ -2873,7 +3083,7 @@ public function listSubAccountFuturesBalancesWithHttpInfo($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * @param string $settle Query only balances of specified settle currency (optional) * * @throws \InvalidArgumentException @@ -2896,7 +3106,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * @param string $settle Query only balances of specified settle currency (optional) * * @throws \InvalidArgumentException @@ -2946,7 +3156,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * @param string $settle Query only balances of specified settle currency (optional) * * @throws \InvalidArgumentException @@ -3064,7 +3274,7 @@ protected function listSubAccountFuturesBalancesRequest($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3083,7 +3293,7 @@ public function listSubAccountCrossMarginBalances($associative_array) * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3139,7 +3349,7 @@ public function listSubAccountCrossMarginBalancesWithHttpInfo($associative_array * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3161,7 +3371,7 @@ function ($response) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3210,7 +3420,7 @@ function ($exception) { * * Note: the input parameter is an associative array with the keys listed as the parameter name below * - * @param string $sub_uid Sub account user ID. Return records related to all sub accounts if not specified (optional) + * @param string $sub_uid User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -3607,6 +3817,7 @@ protected function listSavedAddressRequest($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) + * @param string $settle Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3626,6 +3837,7 @@ public function getTradeFee($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) + * @param string $settle Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3682,6 +3894,7 @@ public function getTradeFeeWithHttpInfo($associative_array) * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) + * @param string $settle Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3704,6 +3917,7 @@ function ($response) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) + * @param string $settle Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3753,6 +3967,7 @@ function ($exception) { * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $currency_pair Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) + * @param string $settle Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -3761,6 +3976,7 @@ protected function getTradeFeeRequest($associative_array) { // unbox the parameters from the associative array $currency_pair = array_key_exists('currency_pair', $associative_array) ? $associative_array['currency_pair'] : null; + $settle = array_key_exists('settle', $associative_array) ? $associative_array['settle'] : null; $resourcePath = '/wallet/fee'; @@ -3782,6 +3998,18 @@ protected function getTradeFeeRequest($associative_array) } } + // query params + if ($settle !== null) { + if('form' === 'form' && is_array($settle)) { + foreach($settle as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['settle'] = $settle; + } + } + // body params $_tempBody = null; diff --git a/src/Configuration.php b/src/Configuration.php index 6fddf14..85214b6 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.26.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.34.0/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.26.0' . PHP_EOL; - $report .= ' SDK Package Version: 5.26.0' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.34.0' . PHP_EOL; + $report .= ' SDK Package Version: 5.34.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/ApiV4KeyPerm.php b/src/Model/ApiV4KeyPerm.php new file mode 100644 index 0000000..450fcf5 --- /dev/null +++ b/src/Model/ApiV4KeyPerm.php @@ -0,0 +1,375 @@ + 'string', + 'read_only' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'read_only' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'read_only' => 'read_only' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'read_only' => 'setReadOnly' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'read_only' => 'getReadOnly' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const NAME_WALLET = 'wallet'; + const NAME_SPOT = 'spot'; + const NAME_FUTURES = 'futures'; + const NAME_DELIVERY = 'delivery'; + const NAME_EARN = 'earn'; + const NAME_OPTIONS = 'options'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNameAllowableValues() + { + return [ + self::NAME_WALLET, + self::NAME_SPOT, + self::NAME_FUTURES, + self::NAME_DELIVERY, + self::NAME_EARN, + self::NAME_OPTIONS, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['read_only'] = isset($data['read_only']) ? $data['read_only'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getNameAllowableValues(); + if (!is_null($this->container['name']) && !in_array($this->container['name'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'name', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options + * + * @return $this + */ + public function setName($name) + { + $allowedValues = $this->getNameAllowableValues(); + if (!is_null($name) && !in_array($name, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'name', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets read_only + * + * @return bool|null + */ + public function getReadOnly() + { + return $this->container['read_only']; + } + + /** + * Sets read_only + * + * @param bool|null $read_only read only + * + * @return $this + */ + public function setReadOnly($read_only) + { + $this->container['read_only'] = $read_only; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/BatchFuturesOrder.php b/src/Model/BatchFuturesOrder.php new file mode 100644 index 0000000..100e380 --- /dev/null +++ b/src/Model/BatchFuturesOrder.php @@ -0,0 +1,1200 @@ + 'bool', + 'label' => 'string', + 'detail' => 'string', + 'id' => 'int', + 'user' => 'int', + 'create_time' => 'double', + 'finish_time' => 'double', + 'finish_as' => 'string', + 'status' => 'string', + 'contract' => 'string', + 'size' => 'int', + 'iceberg' => 'int', + 'price' => 'string', + 'close' => 'bool', + 'is_close' => 'bool', + 'reduce_only' => 'bool', + 'is_reduce_only' => 'bool', + 'is_liq' => 'bool', + 'tif' => 'string', + 'left' => 'int', + 'fill_price' => 'string', + 'text' => 'string', + 'tkfr' => 'string', + 'mkfr' => 'string', + 'refu' => 'int', + 'auto_size' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'succeeded' => null, + 'label' => null, + 'detail' => null, + 'id' => 'int64', + 'user' => null, + 'create_time' => 'double', + 'finish_time' => 'double', + 'finish_as' => null, + 'status' => null, + 'contract' => null, + 'size' => 'int64', + 'iceberg' => 'int64', + 'price' => null, + 'close' => null, + 'is_close' => null, + 'reduce_only' => null, + 'is_reduce_only' => null, + 'is_liq' => null, + 'tif' => null, + 'left' => 'int64', + 'fill_price' => null, + 'text' => null, + 'tkfr' => null, + 'mkfr' => null, + 'refu' => null, + 'auto_size' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'succeeded' => 'succeeded', + 'label' => 'label', + 'detail' => 'detail', + 'id' => 'id', + 'user' => 'user', + 'create_time' => 'create_time', + 'finish_time' => 'finish_time', + 'finish_as' => 'finish_as', + 'status' => 'status', + 'contract' => 'contract', + 'size' => 'size', + 'iceberg' => 'iceberg', + 'price' => 'price', + 'close' => 'close', + 'is_close' => 'is_close', + 'reduce_only' => 'reduce_only', + 'is_reduce_only' => 'is_reduce_only', + 'is_liq' => 'is_liq', + 'tif' => 'tif', + 'left' => 'left', + 'fill_price' => 'fill_price', + 'text' => 'text', + 'tkfr' => 'tkfr', + 'mkfr' => 'mkfr', + 'refu' => 'refu', + 'auto_size' => 'auto_size' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'succeeded' => 'setSucceeded', + 'label' => 'setLabel', + 'detail' => 'setDetail', + 'id' => 'setId', + 'user' => 'setUser', + 'create_time' => 'setCreateTime', + 'finish_time' => 'setFinishTime', + 'finish_as' => 'setFinishAs', + 'status' => 'setStatus', + 'contract' => 'setContract', + 'size' => 'setSize', + 'iceberg' => 'setIceberg', + 'price' => 'setPrice', + 'close' => 'setClose', + 'is_close' => 'setIsClose', + 'reduce_only' => 'setReduceOnly', + 'is_reduce_only' => 'setIsReduceOnly', + 'is_liq' => 'setIsLiq', + 'tif' => 'setTif', + 'left' => 'setLeft', + 'fill_price' => 'setFillPrice', + 'text' => 'setText', + 'tkfr' => 'setTkfr', + 'mkfr' => 'setMkfr', + 'refu' => 'setRefu', + 'auto_size' => 'setAutoSize' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'succeeded' => 'getSucceeded', + 'label' => 'getLabel', + 'detail' => 'getDetail', + 'id' => 'getId', + 'user' => 'getUser', + 'create_time' => 'getCreateTime', + 'finish_time' => 'getFinishTime', + 'finish_as' => 'getFinishAs', + 'status' => 'getStatus', + 'contract' => 'getContract', + 'size' => 'getSize', + 'iceberg' => 'getIceberg', + 'price' => 'getPrice', + 'close' => 'getClose', + 'is_close' => 'getIsClose', + 'reduce_only' => 'getReduceOnly', + 'is_reduce_only' => 'getIsReduceOnly', + 'is_liq' => 'getIsLiq', + 'tif' => 'getTif', + 'left' => 'getLeft', + 'fill_price' => 'getFillPrice', + 'text' => 'getText', + 'tkfr' => 'getTkfr', + 'mkfr' => 'getMkfr', + 'refu' => 'getRefu', + 'auto_size' => 'getAutoSize' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const FINISH_AS_FILLED = 'filled'; + const FINISH_AS_CANCELLED = 'cancelled'; + const FINISH_AS_LIQUIDATED = 'liquidated'; + const FINISH_AS_IOC = 'ioc'; + const FINISH_AS_AUTO_DELEVERAGED = 'auto_deleveraged'; + const FINISH_AS_REDUCE_ONLY = 'reduce_only'; + const FINISH_AS_POSITION_CLOSED = 'position_closed'; + const FINISH_AS_REDUCE_OUT = 'reduce_out'; + const STATUS_OPEN = 'open'; + const STATUS_FINISHED = 'finished'; + const TIF_GTC = 'gtc'; + const TIF_IOC = 'ioc'; + const TIF_POC = 'poc'; + const TIF_FOK = 'fok'; + const AUTO_SIZE_LONG = 'close_long'; + const AUTO_SIZE_SHORT = 'close_short'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFinishAsAllowableValues() + { + return [ + self::FINISH_AS_FILLED, + self::FINISH_AS_CANCELLED, + self::FINISH_AS_LIQUIDATED, + self::FINISH_AS_IOC, + self::FINISH_AS_AUTO_DELEVERAGED, + self::FINISH_AS_REDUCE_ONLY, + self::FINISH_AS_POSITION_CLOSED, + self::FINISH_AS_REDUCE_OUT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_OPEN, + self::STATUS_FINISHED, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTifAllowableValues() + { + return [ + self::TIF_GTC, + self::TIF_IOC, + self::TIF_POC, + self::TIF_FOK, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAutoSizeAllowableValues() + { + return [ + self::AUTO_SIZE_LONG, + self::AUTO_SIZE_SHORT, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['succeeded'] = isset($data['succeeded']) ? $data['succeeded'] : null; + $this->container['label'] = isset($data['label']) ? $data['label'] : null; + $this->container['detail'] = isset($data['detail']) ? $data['detail'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['user'] = isset($data['user']) ? $data['user'] : null; + $this->container['create_time'] = isset($data['create_time']) ? $data['create_time'] : null; + $this->container['finish_time'] = isset($data['finish_time']) ? $data['finish_time'] : null; + $this->container['finish_as'] = isset($data['finish_as']) ? $data['finish_as'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['contract'] = isset($data['contract']) ? $data['contract'] : null; + $this->container['size'] = isset($data['size']) ? $data['size'] : null; + $this->container['iceberg'] = isset($data['iceberg']) ? $data['iceberg'] : null; + $this->container['price'] = isset($data['price']) ? $data['price'] : null; + $this->container['close'] = isset($data['close']) ? $data['close'] : false; + $this->container['is_close'] = isset($data['is_close']) ? $data['is_close'] : null; + $this->container['reduce_only'] = isset($data['reduce_only']) ? $data['reduce_only'] : false; + $this->container['is_reduce_only'] = isset($data['is_reduce_only']) ? $data['is_reduce_only'] : null; + $this->container['is_liq'] = isset($data['is_liq']) ? $data['is_liq'] : null; + $this->container['tif'] = isset($data['tif']) ? $data['tif'] : 'gtc'; + $this->container['left'] = isset($data['left']) ? $data['left'] : null; + $this->container['fill_price'] = isset($data['fill_price']) ? $data['fill_price'] : null; + $this->container['text'] = isset($data['text']) ? $data['text'] : null; + $this->container['tkfr'] = isset($data['tkfr']) ? $data['tkfr'] : null; + $this->container['mkfr'] = isset($data['mkfr']) ? $data['mkfr'] : null; + $this->container['refu'] = isset($data['refu']) ? $data['refu'] : null; + $this->container['auto_size'] = isset($data['auto_size']) ? $data['auto_size'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFinishAsAllowableValues(); + if (!is_null($this->container['finish_as']) && !in_array($this->container['finish_as'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'finish_as', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTifAllowableValues(); + if (!is_null($this->container['tif']) && !in_array($this->container['tif'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'tif', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getAutoSizeAllowableValues(); + if (!is_null($this->container['auto_size']) && !in_array($this->container['auto_size'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'auto_size', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets succeeded + * + * @return bool|null + */ + public function getSucceeded() + { + return $this->container['succeeded']; + } + + /** + * Sets succeeded + * + * @param bool|null $succeeded Whether the batch of orders succeeded + * + * @return $this + */ + public function setSucceeded($succeeded) + { + $this->container['succeeded'] = $succeeded; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label Error label, only exists if execution fails + * + * @return $this + */ + public function setLabel($label) + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets detail + * + * @return string|null + */ + public function getDetail() + { + return $this->container['detail']; + } + + /** + * Sets detail + * + * @param string|null $detail Error detail, only present if execution failed and details need to be given + * + * @return $this + */ + public function setDetail($detail) + { + $this->container['detail'] = $detail; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id Futures order ID + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets user + * + * @return int|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param int|null $user User ID + * + * @return $this + */ + public function setUser($user) + { + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets create_time + * + * @return double|null + */ + public function getCreateTime() + { + return $this->container['create_time']; + } + + /** + * Sets create_time + * + * @param double|null $create_time Creation time of order + * + * @return $this + */ + public function setCreateTime($create_time) + { + $this->container['create_time'] = $create_time; + + return $this; + } + + /** + * Gets finish_time + * + * @return double|null + */ + public function getFinishTime() + { + return $this->container['finish_time']; + } + + /** + * Sets finish_time + * + * @param double|null $finish_time Order finished time. Not returned if order is open + * + * @return $this + */ + public function setFinishTime($finish_time) + { + $this->container['finish_time'] = $finish_time; + + return $this; + } + + /** + * Gets finish_as + * + * @return string|null + */ + public function getFinishAs() + { + return $this->container['finish_as']; + } + + /** + * Sets finish_as + * + * @param string|null $finish_as How the order was finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set- position_closed: cancelled because of position close + * + * @return $this + */ + public function setFinishAs($finish_as) + { + $allowedValues = $this->getFinishAsAllowableValues(); + if (!is_null($finish_as) && !in_array($finish_as, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'finish_as', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['finish_as'] = $finish_as; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Order status - `open`: waiting to be traded - `finished`: finished + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets contract + * + * @return string|null + */ + public function getContract() + { + return $this->container['contract']; + } + + /** + * Sets contract + * + * @param string|null $contract Futures contract + * + * @return $this + */ + public function setContract($contract) + { + $this->container['contract'] = $contract; + + return $this; + } + + /** + * Gets size + * + * @return int|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int|null $size Order size. Specify positive number to make a bid, and negative number to ask + * + * @return $this + */ + public function setSize($size) + { + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets iceberg + * + * @return int|null + */ + public function getIceberg() + { + return $this->container['iceberg']; + } + + /** + * Sets iceberg + * + * @param int|null $iceberg Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size + * + * @return $this + */ + public function setIceberg($iceberg) + { + $this->container['iceberg'] = $iceberg; + + return $this; + } + + /** + * Gets price + * + * @return string|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param string|null $price Order price. 0 for market order with `tif` set as `ioc` + * + * @return $this + */ + public function setPrice($price) + { + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets close + * + * @return bool|null + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param bool|null $close Set as `true` to close the position, with `size` set to 0 + * + * @return $this + */ + public function setClose($close) + { + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets is_close + * + * @return bool|null + */ + public function getIsClose() + { + return $this->container['is_close']; + } + + /** + * Sets is_close + * + * @param bool|null $is_close Is the order to close position + * + * @return $this + */ + public function setIsClose($is_close) + { + $this->container['is_close'] = $is_close; + + return $this; + } + + /** + * Gets reduce_only + * + * @return bool|null + */ + public function getReduceOnly() + { + return $this->container['reduce_only']; + } + + /** + * Sets reduce_only + * + * @param bool|null $reduce_only Set as `true` to be reduce-only order + * + * @return $this + */ + public function setReduceOnly($reduce_only) + { + $this->container['reduce_only'] = $reduce_only; + + return $this; + } + + /** + * Gets is_reduce_only + * + * @return bool|null + */ + public function getIsReduceOnly() + { + return $this->container['is_reduce_only']; + } + + /** + * Sets is_reduce_only + * + * @param bool|null $is_reduce_only Is the order reduce-only + * + * @return $this + */ + public function setIsReduceOnly($is_reduce_only) + { + $this->container['is_reduce_only'] = $is_reduce_only; + + return $this; + } + + /** + * Gets is_liq + * + * @return bool|null + */ + public function getIsLiq() + { + return $this->container['is_liq']; + } + + /** + * Sets is_liq + * + * @param bool|null $is_liq Is the order for liquidation + * + * @return $this + */ + public function setIsLiq($is_liq) + { + $this->container['is_liq'] = $is_liq; + + return $this; + } + + /** + * Gets tif + * + * @return string|null + */ + public function getTif() + { + return $this->container['tif']; + } + + /** + * Sets tif + * + * @param string|null $tif Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none + * + * @return $this + */ + public function setTif($tif) + { + $allowedValues = $this->getTifAllowableValues(); + if (!is_null($tif) && !in_array($tif, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'tif', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['tif'] = $tif; + + return $this; + } + + /** + * Gets left + * + * @return int|null + */ + public function getLeft() + { + return $this->container['left']; + } + + /** + * Sets left + * + * @param int|null $left Size left to be traded + * + * @return $this + */ + public function setLeft($left) + { + $this->container['left'] = $left; + + return $this; + } + + /** + * Gets fill_price + * + * @return string|null + */ + public function getFillPrice() + { + return $this->container['fill_price']; + } + + /** + * Sets fill_price + * + * @param string|null $fill_price Fill price of the order + * + * @return $this + */ + public function setFillPrice($fill_price) + { + $this->container['fill_price'] = $fill_price; + + return $this; + } + + /** + * Gets text + * + * @return string|null + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string|null $text User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance + * + * @return $this + */ + public function setText($text) + { + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets tkfr + * + * @return string|null + */ + public function getTkfr() + { + return $this->container['tkfr']; + } + + /** + * Sets tkfr + * + * @param string|null $tkfr Taker fee + * + * @return $this + */ + public function setTkfr($tkfr) + { + $this->container['tkfr'] = $tkfr; + + return $this; + } + + /** + * Gets mkfr + * + * @return string|null + */ + public function getMkfr() + { + return $this->container['mkfr']; + } + + /** + * Sets mkfr + * + * @param string|null $mkfr Maker fee + * + * @return $this + */ + public function setMkfr($mkfr) + { + $this->container['mkfr'] = $mkfr; + + return $this; + } + + /** + * Gets refu + * + * @return int|null + */ + public function getRefu() + { + return $this->container['refu']; + } + + /** + * Sets refu + * + * @param int|null $refu Reference user ID + * + * @return $this + */ + public function setRefu($refu) + { + $this->container['refu'] = $refu; + + return $this; + } + + /** + * Gets auto_size + * + * @return string|null + */ + public function getAutoSize() + { + return $this->container['auto_size']; + } + + /** + * Sets auto_size + * + * @param string|null $auto_size Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 + * + * @return $this + */ + public function setAutoSize($auto_size) + { + $allowedValues = $this->getAutoSizeAllowableValues(); + if (!is_null($auto_size) && !in_array($auto_size, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'auto_size', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['auto_size'] = $auto_size; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Contract.php b/src/Model/Contract.php index 935507d..f736a71 100644 --- a/src/Model/Contract.php +++ b/src/Model/Contract.php @@ -33,7 +33,7 @@ * Contract Class Doc Comment * * @category Class - * @description Contract detail. USD value per contract: - USDT settled contracts: `quanto_multiplier x token price` - BTC settled contracts:`quanto_multiplier x BTC price x token price` + * @description Futures contract details * @package GateApi * @author GateIO * @link https://www.gate.io diff --git a/src/Model/CountdownCancelAllFuturesTask.php b/src/Model/CountdownCancelAllFuturesTask.php new file mode 100644 index 0000000..9823c90 --- /dev/null +++ b/src/Model/CountdownCancelAllFuturesTask.php @@ -0,0 +1,339 @@ + 'int', + 'contract' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'timeout' => 'int32', + 'contract' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'timeout' => 'timeout', + 'contract' => 'contract' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'timeout' => 'setTimeout', + 'contract' => 'setContract' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'timeout' => 'getTimeout', + 'contract' => 'getContract' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['timeout'] = isset($data['timeout']) ? $data['timeout'] : null; + $this->container['contract'] = isset($data['contract']) ? $data['contract'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['timeout'] === null) { + $invalidProperties[] = "'timeout' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets timeout + * + * @return int + */ + public function getTimeout() + { + return $this->container['timeout']; + } + + /** + * Sets timeout + * + * @param int $timeout Countdown time, in seconds At least 5 seconds, 0 means cancel the countdown + * + * @return $this + */ + public function setTimeout($timeout) + { + $this->container['timeout'] = $timeout; + + return $this; + } + + /** + * Gets contract + * + * @return string|null + */ + public function getContract() + { + return $this->container['contract']; + } + + /** + * Sets contract + * + * @param string|null $contract Futures contract + * + * @return $this + */ + public function setContract($contract) + { + $this->container['contract'] = $contract; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CountdownCancelAllSpotTask.php b/src/Model/CountdownCancelAllSpotTask.php new file mode 100644 index 0000000..28f1ae0 --- /dev/null +++ b/src/Model/CountdownCancelAllSpotTask.php @@ -0,0 +1,339 @@ + 'int', + 'currency_pair' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'timeout' => 'int32', + 'currency_pair' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'timeout' => 'timeout', + 'currency_pair' => 'currency_pair' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'timeout' => 'setTimeout', + 'currency_pair' => 'setCurrencyPair' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'timeout' => 'getTimeout', + 'currency_pair' => 'getCurrencyPair' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['timeout'] = isset($data['timeout']) ? $data['timeout'] : null; + $this->container['currency_pair'] = isset($data['currency_pair']) ? $data['currency_pair'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['timeout'] === null) { + $invalidProperties[] = "'timeout' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets timeout + * + * @return int + */ + public function getTimeout() + { + return $this->container['timeout']; + } + + /** + * Sets timeout + * + * @param int $timeout Countdown time, in seconds At least 5 seconds, 0 means cancel the countdown + * + * @return $this + */ + public function setTimeout($timeout) + { + $this->container['timeout'] = $timeout; + + return $this; + } + + /** + * Gets currency_pair + * + * @return string|null + */ + public function getCurrencyPair() + { + return $this->container['currency_pair']; + } + + /** + * Sets currency_pair + * + * @param string|null $currency_pair Currency pair + * + * @return $this + */ + public function setCurrencyPair($currency_pair) + { + $this->container['currency_pair'] = $currency_pair; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FuturesAccount.php b/src/Model/FuturesAccount.php index 6e762e8..3df49d6 100644 --- a/src/Model/FuturesAccount.php +++ b/src/Model/FuturesAccount.php @@ -286,7 +286,7 @@ public function getTotal() /** * Sets total * - * @param string|null $total total = position_margin + order_margin + available + * @param string|null $total total is the balance after the user's accumulated deposit, withdraw, profit and loss (including realized profit and loss, fund, fee and referral rebate), excluding unrealized profit and loss. total = SUM(history_dnw, history_pnl, history_fee, history_refr, history_fund) * * @return $this */ diff --git a/src/Model/FuturesCandlestick.php b/src/Model/FuturesCandlestick.php index bfd519a..37d735a 100644 --- a/src/Model/FuturesCandlestick.php +++ b/src/Model/FuturesCandlestick.php @@ -269,7 +269,7 @@ public function getV() /** * Sets v * - * @param int|null $v size volume. Only returned if `contract` is not prefixed + * @param int|null $v size volume (contract size). Only returned if `contract` is not prefixed * * @return $this */ @@ -293,7 +293,7 @@ public function getC() /** * Sets c * - * @param string|null $c Close price + * @param string|null $c Close price (quote currency) * * @return $this */ @@ -317,7 +317,7 @@ public function getH() /** * Sets h * - * @param string|null $h Highest price + * @param string|null $h Highest price (quote currency) * * @return $this */ @@ -341,7 +341,7 @@ public function getL() /** * Sets l * - * @param string|null $l Lowest price + * @param string|null $l Lowest price (quote currency) * * @return $this */ @@ -365,7 +365,7 @@ public function getO() /** * Sets o * - * @param string|null $o Open price + * @param string|null $o Open price (quote currency) * * @return $this */ diff --git a/src/Model/FuturesOrder.php b/src/Model/FuturesOrder.php index a49904d..442a004 100644 --- a/src/Model/FuturesOrder.php +++ b/src/Model/FuturesOrder.php @@ -279,6 +279,7 @@ public function getModelName() const TIF_GTC = 'gtc'; const TIF_IOC = 'ioc'; const TIF_POC = 'poc'; + const TIF_FOK = 'fok'; const AUTO_SIZE_LONG = 'close_long'; const AUTO_SIZE_SHORT = 'close_short'; @@ -327,6 +328,7 @@ public function getTifAllowableValues() self::TIF_GTC, self::TIF_IOC, self::TIF_POC, + self::TIF_FOK, ]; } @@ -837,7 +839,7 @@ public function getTif() /** * Sets tif * - * @param string|null $tif Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only + * @param string|null $tif Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none * * @return $this */ diff --git a/src/Model/FuturesOrderAmendment.php b/src/Model/FuturesOrderAmendment.php index 7f57e26..d98772d 100644 --- a/src/Model/FuturesOrderAmendment.php +++ b/src/Model/FuturesOrderAmendment.php @@ -244,7 +244,7 @@ public function getPrice() /** * Sets price * - * @param string|null $price New order price. New price cannot take any orders + * @param string|null $price New order price. * * @return $this */ diff --git a/src/Model/FuturesOrderBookItem.php b/src/Model/FuturesOrderBookItem.php index b51ccc9..18ee2a3 100644 --- a/src/Model/FuturesOrderBookItem.php +++ b/src/Model/FuturesOrderBookItem.php @@ -220,7 +220,7 @@ public function getP() /** * Sets p * - * @param string|null $p Price + * @param string|null $p Price (quote currency) * * @return $this */ diff --git a/src/Model/FuturesPremiumIndex.php b/src/Model/FuturesPremiumIndex.php new file mode 100644 index 0000000..4c1724f --- /dev/null +++ b/src/Model/FuturesPremiumIndex.php @@ -0,0 +1,426 @@ + 'double', + 'c' => 'string', + 'h' => 'string', + 'l' => 'string', + 'o' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 't' => 'double', + 'c' => null, + 'h' => null, + 'l' => null, + 'o' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 't' => 't', + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'o' => 'o' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 't' => 'setT', + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'o' => 'setO' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 't' => 'getT', + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'o' => 'getO' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['t'] = isset($data['t']) ? $data['t'] : null; + $this->container['c'] = isset($data['c']) ? $data['c'] : null; + $this->container['h'] = isset($data['h']) ? $data['h'] : null; + $this->container['l'] = isset($data['l']) ? $data['l'] : null; + $this->container['o'] = isset($data['o']) ? $data['o'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets t + * + * @return double|null + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param double|null $t Unix timestamp in seconds + * + * @return $this + */ + public function setT($t) + { + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets c + * + * @return string|null + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param string|null $c Close price + * + * @return $this + */ + public function setC($c) + { + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return string|null + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param string|null $h Highest price + * + * @return $this + */ + public function setH($h) + { + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return string|null + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param string|null $l Lowest price` + * + * @return $this + */ + public function setL($l) + { + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets o + * + * @return string|null + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param string|null $o Open price + * + * @return $this + */ + public function setO($o) + { + $this->container['o'] = $o; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FuturesTicker.php b/src/Model/FuturesTicker.php index b96448b..89c530f 100644 --- a/src/Model/FuturesTicker.php +++ b/src/Model/FuturesTicker.php @@ -70,7 +70,9 @@ class FuturesTicker implements ModelInterface, ArrayAccess 'funding_rate' => 'string', 'funding_rate_indicative' => 'string', 'index_price' => 'string', - 'quanto_base_rate' => 'string' + 'quanto_base_rate' => 'string', + 'basis_rate' => 'string', + 'basis_value' => 'string' ]; /** @@ -95,7 +97,9 @@ class FuturesTicker implements ModelInterface, ArrayAccess 'funding_rate' => null, 'funding_rate_indicative' => null, 'index_price' => null, - 'quanto_base_rate' => null + 'quanto_base_rate' => null, + 'basis_rate' => null, + 'basis_value' => null ]; /** @@ -141,7 +145,9 @@ public static function openAPIFormats() 'funding_rate' => 'funding_rate', 'funding_rate_indicative' => 'funding_rate_indicative', 'index_price' => 'index_price', - 'quanto_base_rate' => 'quanto_base_rate' + 'quanto_base_rate' => 'quanto_base_rate', + 'basis_rate' => 'basis_rate', + 'basis_value' => 'basis_value' ]; /** @@ -166,7 +172,9 @@ public static function openAPIFormats() 'funding_rate' => 'setFundingRate', 'funding_rate_indicative' => 'setFundingRateIndicative', 'index_price' => 'setIndexPrice', - 'quanto_base_rate' => 'setQuantoBaseRate' + 'quanto_base_rate' => 'setQuantoBaseRate', + 'basis_rate' => 'setBasisRate', + 'basis_value' => 'setBasisValue' ]; /** @@ -191,7 +199,9 @@ public static function openAPIFormats() 'funding_rate' => 'getFundingRate', 'funding_rate_indicative' => 'getFundingRateIndicative', 'index_price' => 'getIndexPrice', - 'quanto_base_rate' => 'getQuantoBaseRate' + 'quanto_base_rate' => 'getQuantoBaseRate', + 'basis_rate' => 'getBasisRate', + 'basis_value' => 'getBasisValue' ]; /** @@ -271,6 +281,8 @@ public function __construct(array $data = null) $this->container['funding_rate_indicative'] = isset($data['funding_rate_indicative']) ? $data['funding_rate_indicative'] : null; $this->container['index_price'] = isset($data['index_price']) ? $data['index_price'] : null; $this->container['quanto_base_rate'] = isset($data['quanto_base_rate']) ? $data['quanto_base_rate'] : null; + $this->container['basis_rate'] = isset($data['basis_rate']) ? $data['basis_rate'] : null; + $this->container['basis_value'] = isset($data['basis_value']) ? $data['basis_value'] : null; } /** @@ -704,6 +716,54 @@ public function setQuantoBaseRate($quanto_base_rate) return $this; } + + /** + * Gets basis_rate + * + * @return string|null + */ + public function getBasisRate() + { + return $this->container['basis_rate']; + } + + /** + * Sets basis_rate + * + * @param string|null $basis_rate Basis rate + * + * @return $this + */ + public function setBasisRate($basis_rate) + { + $this->container['basis_rate'] = $basis_rate; + + return $this; + } + + /** + * Gets basis_value + * + * @return string|null + */ + public function getBasisValue() + { + return $this->container['basis_value']; + } + + /** + * Sets basis_value + * + * @param string|null $basis_value Basis value + * + * @return $this + */ + public function setBasisValue($basis_value) + { + $this->container['basis_value'] = $basis_value; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/FuturesTrade.php b/src/Model/FuturesTrade.php index b242a53..d5c80cd 100644 --- a/src/Model/FuturesTrade.php +++ b/src/Model/FuturesTrade.php @@ -364,7 +364,7 @@ public function getPrice() /** * Sets price * - * @param string|null $price Trading price + * @param string|null $price Trading price (quote currency) * * @return $this */ diff --git a/src/Model/LedgerRecord.php b/src/Model/LedgerRecord.php index 5b8a4aa..8ac3263 100644 --- a/src/Model/LedgerRecord.php +++ b/src/Model/LedgerRecord.php @@ -291,6 +291,9 @@ public function listInvalidProperties() ); } + if ($this->container['chain'] === null) { + $invalidProperties[] = "'chain' can't be null"; + } return $invalidProperties; } @@ -510,7 +513,7 @@ public function setStatus($status) /** * Gets chain * - * @return string|null + * @return string */ public function getChain() { @@ -520,7 +523,7 @@ public function getChain() /** * Sets chain * - * @param string|null $chain Name of the chain used in withdrawals + * @param string $chain Name of the chain used in withdrawals * * @return $this */ diff --git a/src/Model/OptionsAccountBook.php b/src/Model/OptionsAccountBook.php index 55437a8..d7c4ca6 100644 --- a/src/Model/OptionsAccountBook.php +++ b/src/Model/OptionsAccountBook.php @@ -262,7 +262,7 @@ public function getChange() /** * Sets change * - * @param string|null $change Amount changed + * @param string|null $change Amount changed (USDT) * * @return $this */ @@ -286,7 +286,7 @@ public function getBalance() /** * Sets balance * - * @param string|null $balance Account total balance after change + * @param string|null $balance Account total balance after change (USDT) * * @return $this */ diff --git a/src/Model/OptionsCandlestick.php b/src/Model/OptionsCandlestick.php new file mode 100644 index 0000000..ddf7e65 --- /dev/null +++ b/src/Model/OptionsCandlestick.php @@ -0,0 +1,456 @@ + 'double', + 'v' => 'int', + 'c' => 'string', + 'h' => 'string', + 'l' => 'string', + 'o' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 't' => 'double', + 'v' => 'int64', + 'c' => null, + 'h' => null, + 'l' => null, + 'o' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 't' => 't', + 'v' => 'v', + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'o' => 'o' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 't' => 'setT', + 'v' => 'setV', + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'o' => 'setO' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 't' => 'getT', + 'v' => 'getV', + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'o' => 'getO' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['t'] = isset($data['t']) ? $data['t'] : null; + $this->container['v'] = isset($data['v']) ? $data['v'] : null; + $this->container['c'] = isset($data['c']) ? $data['c'] : null; + $this->container['h'] = isset($data['h']) ? $data['h'] : null; + $this->container['l'] = isset($data['l']) ? $data['l'] : null; + $this->container['o'] = isset($data['o']) ? $data['o'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets t + * + * @return double|null + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param double|null $t Unix timestamp in seconds + * + * @return $this + */ + public function setT($t) + { + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return int|null + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param int|null $v size volume (contract size). Only returned if `contract` is not prefixed + * + * @return $this + */ + public function setV($v) + { + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets c + * + * @return string|null + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param string|null $c Close price (quote currency, unit: underlying corresponding option price) + * + * @return $this + */ + public function setC($c) + { + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return string|null + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param string|null $h Highest price (quote currency, unit: underlying corresponding option price) + * + * @return $this + */ + public function setH($h) + { + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return string|null + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param string|null $l Lowest price (quote currency, unit: underlying corresponding option price) + * + * @return $this + */ + public function setL($l) + { + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets o + * + * @return string|null + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param string|null $o Open price (quote currency, unit: underlying corresponding option price) + * + * @return $this + */ + public function setO($o) + { + $this->container['o'] = $o; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OptionsContract.php b/src/Model/OptionsContract.php index 8f17367..39fd393 100644 --- a/src/Model/OptionsContract.php +++ b/src/Model/OptionsContract.php @@ -33,7 +33,7 @@ * OptionsContract Class Doc Comment * * @category Class - * @description Futures contract details + * @description Options contract detail * @package GateApi * @author GateIO * @link https://www.gate.io @@ -359,7 +359,7 @@ public function getName() /** * Sets name * - * @param string|null $name Futures contract + * @param string|null $name Options contract name * * @return $this */ @@ -527,7 +527,7 @@ public function getUnderlyingPrice() /** * Sets underlying_price * - * @param string|null $underlying_price Underlying price + * @param string|null $underlying_price Underlying price (quote currency) * * @return $this */ @@ -575,7 +575,7 @@ public function getMarkPrice() /** * Sets mark_price * - * @param string|null $mark_price Current mark price + * @param string|null $mark_price Current mark price (quote currency) * * @return $this */ @@ -599,7 +599,7 @@ public function getIndexPrice() /** * Sets index_price * - * @param string|null $index_price Current index price + * @param string|null $index_price Current index price (quote currency) * * @return $this */ diff --git a/src/Model/OptionsMySettlements.php b/src/Model/OptionsMySettlements.php index 803c8dd..644cfaf 100644 --- a/src/Model/OptionsMySettlements.php +++ b/src/Model/OptionsMySettlements.php @@ -310,7 +310,7 @@ public function getContract() /** * Sets contract * - * @param string|null $contract Futures contract + * @param string|null $contract Options contract name * * @return $this */ @@ -334,7 +334,7 @@ public function getStrikePrice() /** * Sets strike_price * - * @param string|null $strike_price Strike price + * @param string|null $strike_price Strike price (quote currency) * * @return $this */ @@ -358,7 +358,7 @@ public function getSettlePrice() /** * Sets settle_price * - * @param string|null $settle_price settlement price + * @param string|null $settle_price Settlement price (quote currency) * * @return $this */ @@ -406,7 +406,7 @@ public function getSettleProfit() /** * Sets settle_profit * - * @param string|null $settle_profit Settlement profit + * @param string|null $settle_profit Settlement profit (quote currency) * * @return $this */ @@ -430,7 +430,7 @@ public function getFee() /** * Sets fee * - * @param string|null $fee Fee + * @param string|null $fee Fee (quote currency) * * @return $this */ @@ -454,7 +454,7 @@ public function getRealisedPnl() /** * Sets realised_pnl * - * @param string|null $realised_pnl The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. + * @param string|null $realised_pnl The accumulated profit and loss of opening a position, including premium, fee, settlement profit, etc. (quote currency) * * @return $this */ diff --git a/src/Model/OptionsMyTrade.php b/src/Model/OptionsMyTrade.php index 1bd2f4e..e767f96 100644 --- a/src/Model/OptionsMyTrade.php +++ b/src/Model/OptionsMyTrade.php @@ -327,7 +327,7 @@ public function getContract() /** * Sets contract * - * @param string|null $contract Futures contract + * @param string|null $contract Options contract name * * @return $this */ @@ -399,7 +399,7 @@ public function getPrice() /** * Sets price * - * @param string|null $price Trading price + * @param string|null $price Trading price (quote currency) * * @return $this */ @@ -423,7 +423,7 @@ public function getUnderlyingPrice() /** * Sets underlying_price * - * @param string|null $underlying_price Underlying price + * @param string|null $underlying_price Underlying price (quote currency) * * @return $this */ diff --git a/src/Model/OptionsOrder.php b/src/Model/OptionsOrder.php index 0800fc1..b8f4c16 100644 --- a/src/Model/OptionsOrder.php +++ b/src/Model/OptionsOrder.php @@ -76,7 +76,8 @@ class OptionsOrder implements ModelInterface, ArrayAccess 'text' => 'string', 'tkfr' => 'string', 'mkfr' => 'string', - 'refu' => 'int' + 'refu' => 'int', + 'refr' => 'string' ]; /** @@ -106,7 +107,8 @@ class OptionsOrder implements ModelInterface, ArrayAccess 'text' => null, 'tkfr' => null, 'mkfr' => null, - 'refu' => null + 'refu' => null, + 'refr' => null ]; /** @@ -157,7 +159,8 @@ public static function openAPIFormats() 'text' => 'text', 'tkfr' => 'tkfr', 'mkfr' => 'mkfr', - 'refu' => 'refu' + 'refu' => 'refu', + 'refr' => 'refr' ]; /** @@ -187,7 +190,8 @@ public static function openAPIFormats() 'text' => 'setText', 'tkfr' => 'setTkfr', 'mkfr' => 'setMkfr', - 'refu' => 'setRefu' + 'refu' => 'setRefu', + 'refr' => 'setRefr' ]; /** @@ -217,7 +221,8 @@ public static function openAPIFormats() 'text' => 'getText', 'tkfr' => 'getTkfr', 'mkfr' => 'getMkfr', - 'refu' => 'getRefu' + 'refu' => 'getRefu', + 'refr' => 'getRefr' ]; /** @@ -361,6 +366,7 @@ public function __construct(array $data = null) $this->container['tkfr'] = isset($data['tkfr']) ? $data['tkfr'] : null; $this->container['mkfr'] = isset($data['mkfr']) ? $data['mkfr'] : null; $this->container['refu'] = isset($data['refu']) ? $data['refu'] : null; + $this->container['refr'] = isset($data['refr']) ? $data['refr'] : null; } /** @@ -664,7 +670,7 @@ public function getPrice() /** * Sets price * - * @param string|null $price Order price. 0 for market order with `tif` set as `ioc` + * @param string|null $price Order price. 0 for market order with `tif` set as `ioc` (USDT) * * @return $this */ @@ -808,7 +814,7 @@ public function getTif() /** * Sets tif * - * @param string|null $tif Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only + * @param string|null $tif Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee * * @return $this */ @@ -971,6 +977,30 @@ public function setRefu($refu) return $this; } + + /** + * Gets refr + * + * @return string|null + */ + public function getRefr() + { + return $this->container['refr']; + } + + /** + * Sets refr + * + * @param string|null $refr Referrer rebate + * + * @return $this + */ + public function setRefr($refr) + { + $this->container['refr'] = $refr; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/OptionsPosition.php b/src/Model/OptionsPosition.php index 324974b..02e4b0b 100644 --- a/src/Model/OptionsPosition.php +++ b/src/Model/OptionsPosition.php @@ -33,7 +33,7 @@ * OptionsPosition Class Doc Comment * * @category Class - * @description Futures position details + * @description Options position information * @package GateApi * @author GateIO * @link https://www.gate.io @@ -63,7 +63,7 @@ class OptionsPosition implements ModelInterface, ArrayAccess 'realised_pnl' => 'string', 'unrealised_pnl' => 'string', 'pending_orders' => 'int', - 'close_order' => '\GateApi\Model\PositionCloseOrder' + 'close_order' => '\GateApi\Model\OptionsPositionCloseOrder' ]; /** @@ -287,7 +287,7 @@ public function getContract() /** * Sets contract * - * @param string|null $contract Futures contract + * @param string|null $contract Options contract name * * @return $this */ @@ -311,7 +311,7 @@ public function getSize() /** * Sets size * - * @param int|null $size Position size + * @param int|null $size Position size (contract size) * * @return $this */ @@ -335,7 +335,7 @@ public function getEntryPrice() /** * Sets entry_price * - * @param string|null $entry_price Entry price + * @param string|null $entry_price Entry size (quote currency) * * @return $this */ @@ -359,7 +359,7 @@ public function getMarkPrice() /** * Sets mark_price * - * @param string|null $mark_price Current mark price + * @param string|null $mark_price Current mark price (quote currency) * * @return $this */ @@ -445,7 +445,7 @@ public function setPendingOrders($pending_orders) /** * Gets close_order * - * @return \GateApi\Model\PositionCloseOrder|null + * @return \GateApi\Model\OptionsPositionCloseOrder|null */ public function getCloseOrder() { @@ -455,7 +455,7 @@ public function getCloseOrder() /** * Sets close_order * - * @param \GateApi\Model\PositionCloseOrder|null $close_order close_order + * @param \GateApi\Model\OptionsPositionCloseOrder|null $close_order close_order * * @return $this */ diff --git a/src/Model/OptionsPositionClose.php b/src/Model/OptionsPositionClose.php index 17b8610..c7fcde3 100644 --- a/src/Model/OptionsPositionClose.php +++ b/src/Model/OptionsPositionClose.php @@ -291,7 +291,7 @@ public function getContract() /** * Sets contract * - * @param string|null $contract Futures contract + * @param string|null $contract Options contract name * * @return $this */ diff --git a/src/Model/OptionsPositionCloseOrder.php b/src/Model/OptionsPositionCloseOrder.php new file mode 100644 index 0000000..2e081ec --- /dev/null +++ b/src/Model/OptionsPositionCloseOrder.php @@ -0,0 +1,366 @@ + 'int', + 'price' => 'string', + 'is_liq' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'price' => null, + 'is_liq' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'price' => 'price', + 'is_liq' => 'is_liq' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'price' => 'setPrice', + 'is_liq' => 'setIsLiq' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'price' => 'getPrice', + 'is_liq' => 'getIsLiq' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['price'] = isset($data['price']) ? $data['price'] : null; + $this->container['is_liq'] = isset($data['is_liq']) ? $data['is_liq'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id Close order ID + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets price + * + * @return string|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param string|null $price Close order price (quote currency) + * + * @return $this + */ + public function setPrice($price) + { + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets is_liq + * + * @return bool|null + */ + public function getIsLiq() + { + return $this->container['is_liq']; + } + + /** + * Sets is_liq + * + * @param bool|null $is_liq Is the close order from liquidation + * + * @return $this + */ + public function setIsLiq($is_liq) + { + $this->container['is_liq'] = $is_liq; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OptionsSettlement.php b/src/Model/OptionsSettlement.php index 76e2a2a..e487601 100644 --- a/src/Model/OptionsSettlement.php +++ b/src/Model/OptionsSettlement.php @@ -268,7 +268,7 @@ public function getContract() /** * Sets contract * - * @param string|null $contract Contract name + * @param string|null $contract Options contract name * * @return $this */ @@ -292,7 +292,7 @@ public function getProfit() /** * Sets profit * - * @param string|null $profit Settlement profit per size + * @param string|null $profit Settlement profit per size (quote currency) * * @return $this */ @@ -316,7 +316,7 @@ public function getFee() /** * Sets fee * - * @param string|null $fee Settlement fee per size + * @param string|null $fee Settlement fee per size (quote currency) * * @return $this */ @@ -340,7 +340,7 @@ public function getStrikePrice() /** * Sets strike_price * - * @param string|null $strike_price Strike price + * @param string|null $strike_price Strike price (quote currency) * * @return $this */ @@ -364,7 +364,7 @@ public function getSettlePrice() /** * Sets settle_price * - * @param string|null $settle_price settlement price + * @param string|null $settle_price Settlement price (quote currency) * * @return $this */ diff --git a/src/Model/OptionsTicker.php b/src/Model/OptionsTicker.php index 4a113d7..973c11e 100644 --- a/src/Model/OptionsTicker.php +++ b/src/Model/OptionsTicker.php @@ -341,7 +341,7 @@ public function getLastPrice() /** * Sets last_price * - * @param string|null $last_price Last trading price + * @param string|null $last_price Last trading price (quote currency) * * @return $this */ @@ -365,7 +365,7 @@ public function getMarkPrice() /** * Sets mark_price * - * @param string|null $mark_price Current mark price + * @param string|null $mark_price Current mark price (quote currency) * * @return $this */ @@ -389,7 +389,7 @@ public function getIndexPrice() /** * Sets index_price * - * @param string|null $index_price Current index price + * @param string|null $index_price Current index price (quote currency) * * @return $this */ diff --git a/src/Model/OptionsUnderlying.php b/src/Model/OptionsUnderlying.php index d55eeca..52a342a 100644 --- a/src/Model/OptionsUnderlying.php +++ b/src/Model/OptionsUnderlying.php @@ -244,7 +244,7 @@ public function getIndexPrice() /** * Sets index_price * - * @param string|null $index_price Spot index price + * @param string|null $index_price Spot index price (quote currency) * * @return $this */ diff --git a/src/Model/OptionsUnderlyingTicker.php b/src/Model/OptionsUnderlyingTicker.php index 9bce887..a9c673f 100644 --- a/src/Model/OptionsUnderlyingTicker.php +++ b/src/Model/OptionsUnderlyingTicker.php @@ -275,7 +275,7 @@ public function getIndexPrice() /** * Sets index_price * - * @param string|null $index_price Index price + * @param string|null $index_price Index price (quote currency) * * @return $this */ diff --git a/src/Model/Order.php b/src/Model/Order.php index ccaa786..74c0bae 100644 --- a/src/Model/Order.php +++ b/src/Model/Order.php @@ -79,6 +79,8 @@ class Order implements ModelInterface, ArrayAccess 'fee_currency' => 'string', 'point_fee' => 'string', 'gt_fee' => 'string', + 'gt_maker_fee' => 'string', + 'gt_taker_fee' => 'string', 'gt_discount' => 'bool', 'rebated_fee' => 'string', 'rebated_fee_currency' => 'string' @@ -114,6 +116,8 @@ class Order implements ModelInterface, ArrayAccess 'fee_currency' => null, 'point_fee' => null, 'gt_fee' => null, + 'gt_maker_fee' => null, + 'gt_taker_fee' => null, 'gt_discount' => null, 'rebated_fee' => null, 'rebated_fee_currency' => null @@ -170,6 +174,8 @@ public static function openAPIFormats() 'fee_currency' => 'fee_currency', 'point_fee' => 'point_fee', 'gt_fee' => 'gt_fee', + 'gt_maker_fee' => 'gt_maker_fee', + 'gt_taker_fee' => 'gt_taker_fee', 'gt_discount' => 'gt_discount', 'rebated_fee' => 'rebated_fee', 'rebated_fee_currency' => 'rebated_fee_currency' @@ -205,6 +211,8 @@ public static function openAPIFormats() 'fee_currency' => 'setFeeCurrency', 'point_fee' => 'setPointFee', 'gt_fee' => 'setGtFee', + 'gt_maker_fee' => 'setGtMakerFee', + 'gt_taker_fee' => 'setGtTakerFee', 'gt_discount' => 'setGtDiscount', 'rebated_fee' => 'setRebatedFee', 'rebated_fee_currency' => 'setRebatedFeeCurrency' @@ -240,6 +248,8 @@ public static function openAPIFormats() 'fee_currency' => 'getFeeCurrency', 'point_fee' => 'getPointFee', 'gt_fee' => 'getGtFee', + 'gt_maker_fee' => 'getGtMakerFee', + 'gt_taker_fee' => 'getGtTakerFee', 'gt_discount' => 'getGtDiscount', 'rebated_fee' => 'getRebatedFee', 'rebated_fee_currency' => 'getRebatedFeeCurrency' @@ -290,6 +300,7 @@ public function getModelName() const STATUS_CLOSED = 'closed'; const STATUS_CANCELLED = 'cancelled'; const TYPE_LIMIT = 'limit'; + const TYPE_MARKET = 'market'; const ACCOUNT_SPOT = 'spot'; const ACCOUNT_MARGIN = 'margin'; const ACCOUNT_CROSS_MARGIN = 'cross_margin'; @@ -325,6 +336,7 @@ public function getTypeAllowableValues() { return [ self::TYPE_LIMIT, + self::TYPE_MARKET, ]; } @@ -410,6 +422,8 @@ public function __construct(array $data = null) $this->container['fee_currency'] = isset($data['fee_currency']) ? $data['fee_currency'] : null; $this->container['point_fee'] = isset($data['point_fee']) ? $data['point_fee'] : null; $this->container['gt_fee'] = isset($data['gt_fee']) ? $data['gt_fee'] : null; + $this->container['gt_maker_fee'] = isset($data['gt_maker_fee']) ? $data['gt_maker_fee'] : null; + $this->container['gt_taker_fee'] = isset($data['gt_taker_fee']) ? $data['gt_taker_fee'] : null; $this->container['gt_discount'] = isset($data['gt_discount']) ? $data['gt_discount'] : null; $this->container['rebated_fee'] = isset($data['rebated_fee']) ? $data['rebated_fee'] : null; $this->container['rebated_fee_currency'] = isset($data['rebated_fee_currency']) ? $data['rebated_fee_currency'] : null; @@ -465,9 +479,6 @@ public function listInvalidProperties() if ($this->container['amount'] === null) { $invalidProperties[] = "'amount' can't be null"; } - if ($this->container['price'] === null) { - $invalidProperties[] = "'price' can't be null"; - } $allowedValues = $this->getTimeInForceAllowableValues(); if (!is_null($this->container['time_in_force']) && !in_array($this->container['time_in_force'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -705,7 +716,7 @@ public function getType() /** * Sets type * - * @param string|null $type Order type. limit - limit order + * @param string|null $type Order Type - limit : Limit Order - market : Market Order * * @return $this */ @@ -804,7 +815,7 @@ public function getAmount() /** * Sets amount * - * @param string $amount Trade amount + * @param string $amount When `type` is limit, it refers to base currency. For instance, `BTC_USDT` means `BTC` When `type` is `market`, it refers to different currency according to `side` - `side` : `buy` means quote currency, `BTC_USDT` means `USDT` - `side` : `sell` means base currency,`BTC_USDT` means `BTC` * * @return $this */ @@ -818,7 +829,7 @@ public function setAmount($amount) /** * Gets price * - * @return string + * @return string|null */ public function getPrice() { @@ -828,7 +839,7 @@ public function getPrice() /** * Sets price * - * @param string $price Order price + * @param string|null $price Price can't be empty when `type`= `limit` * * @return $this */ @@ -852,7 +863,7 @@ public function getTimeInForce() /** * Sets time_in_force * - * @param string|null $time_in_force Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none + * @param string|null $time_in_force Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none Only `ioc` and `fok` are supported when `type`=`market` * * @return $this */ @@ -1112,6 +1123,54 @@ public function setGtFee($gt_fee) return $this; } + /** + * Gets gt_maker_fee + * + * @return string|null + */ + public function getGtMakerFee() + { + return $this->container['gt_maker_fee']; + } + + /** + * Sets gt_maker_fee + * + * @param string|null $gt_maker_fee GT used to deduct maker fee + * + * @return $this + */ + public function setGtMakerFee($gt_maker_fee) + { + $this->container['gt_maker_fee'] = $gt_maker_fee; + + return $this; + } + + /** + * Gets gt_taker_fee + * + * @return string|null + */ + public function getGtTakerFee() + { + return $this->container['gt_taker_fee']; + } + + /** + * Sets gt_taker_fee + * + * @param string|null $gt_taker_fee GT used to deduct taker fee + * + * @return $this + */ + public function setGtTakerFee($gt_taker_fee) + { + $this->container['gt_taker_fee'] = $gt_taker_fee; + + return $this; + } + /** * Gets gt_discount * diff --git a/src/Model/SubAccount.php b/src/Model/SubAccount.php new file mode 100644 index 0000000..f636810 --- /dev/null +++ b/src/Model/SubAccount.php @@ -0,0 +1,488 @@ + 'string', + 'login_name' => 'string', + 'password' => 'string', + 'email' => 'string', + 'state' => 'int', + 'user_id' => 'int', + 'create_time' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'remark' => null, + 'login_name' => null, + 'password' => null, + 'email' => null, + 'state' => 'int32', + 'user_id' => 'int64', + 'create_time' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'remark' => 'remark', + 'login_name' => 'login_name', + 'password' => 'password', + 'email' => 'email', + 'state' => 'state', + 'user_id' => 'user_id', + 'create_time' => 'create_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'remark' => 'setRemark', + 'login_name' => 'setLoginName', + 'password' => 'setPassword', + 'email' => 'setEmail', + 'state' => 'setState', + 'user_id' => 'setUserId', + 'create_time' => 'setCreateTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'remark' => 'getRemark', + 'login_name' => 'getLoginName', + 'password' => 'getPassword', + 'email' => 'getEmail', + 'state' => 'getState', + 'user_id' => 'getUserId', + 'create_time' => 'getCreateTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['remark'] = isset($data['remark']) ? $data['remark'] : null; + $this->container['login_name'] = isset($data['login_name']) ? $data['login_name'] : null; + $this->container['password'] = isset($data['password']) ? $data['password'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['user_id'] = isset($data['user_id']) ? $data['user_id'] : null; + $this->container['create_time'] = isset($data['create_time']) ? $data['create_time'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['login_name'] === null) { + $invalidProperties[] = "'login_name' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets remark + * + * @return string|null + */ + public function getRemark() + { + return $this->container['remark']; + } + + /** + * Sets remark + * + * @param string|null $remark custom text + * + * @return $this + */ + public function setRemark($remark) + { + $this->container['remark'] = $remark; + + return $this; + } + + /** + * Gets login_name + * + * @return string + */ + public function getLoginName() + { + return $this->container['login_name']; + } + + /** + * Sets login_name + * + * @param string $login_name Sub-account login name: Only letters, numbers and underscores are supported, and cannot contain other illegal characters + * + * @return $this + */ + public function setLoginName($login_name) + { + $this->container['login_name'] = $login_name; + + return $this; + } + + /** + * Gets password + * + * @return string|null + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string|null $password The sub-account's password. (Default: the same as main account's password) + * + * @return $this + */ + public function setPassword($password) + { + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The sub-account's email address. (Default: the same as main account's email address) + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets state + * + * @return int|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param int|null $state State: 1-normal, 2-locked\" + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The user id of the sub-account + * + * @return $this + */ + public function setUserId($user_id) + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets create_time + * + * @return int|null + */ + public function getCreateTime() + { + return $this->container['create_time']; + } + + /** + * Sets create_time + * + * @param int|null $create_time Created time + * + * @return $this + */ + public function setCreateTime($create_time) + { + $this->container['create_time'] = $create_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SubAccountKey.php b/src/Model/SubAccountKey.php new file mode 100644 index 0000000..5bbc16d --- /dev/null +++ b/src/Model/SubAccountKey.php @@ -0,0 +1,515 @@ + 'string', + 'name' => 'string', + 'perms' => '\GateApi\Model\ApiV4KeyPerm[]', + 'ip_whitelist' => 'string[]', + 'key' => 'string', + 'state' => 'int', + 'created_at' => 'string', + 'updated_at' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'name' => null, + 'perms' => null, + 'ip_whitelist' => null, + 'key' => null, + 'state' => 'int32', + 'created_at' => null, + 'updated_at' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'name' => 'name', + 'perms' => 'perms', + 'ip_whitelist' => 'ip_whitelist', + 'key' => 'key', + 'state' => 'state', + 'created_at' => 'created_at', + 'updated_at' => 'updated_at' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'name' => 'setName', + 'perms' => 'setPerms', + 'ip_whitelist' => 'setIpWhitelist', + 'key' => 'setKey', + 'state' => 'setState', + 'created_at' => 'setCreatedAt', + 'updated_at' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'name' => 'getName', + 'perms' => 'getPerms', + 'ip_whitelist' => 'getIpWhitelist', + 'key' => 'getKey', + 'state' => 'getState', + 'created_at' => 'getCreatedAt', + 'updated_at' => 'getUpdatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = isset($data['user_id']) ? $data['user_id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['perms'] = isset($data['perms']) ? $data['perms'] : null; + $this->container['ip_whitelist'] = isset($data['ip_whitelist']) ? $data['ip_whitelist'] : null; + $this->container['key'] = isset($data['key']) ? $data['key'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['created_at'] = isset($data['created_at']) ? $data['created_at'] : null; + $this->container['updated_at'] = isset($data['updated_at']) ? $data['updated_at'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return string|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param string|null $user_id User ID + * + * @return $this + */ + public function setUserId($user_id) + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name API key name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets perms + * + * @return \GateApi\Model\ApiV4KeyPerm[]|null + */ + public function getPerms() + { + return $this->container['perms']; + } + + /** + * Sets perms + * + * @param \GateApi\Model\ApiV4KeyPerm[]|null $perms perms + * + * @return $this + */ + public function setPerms($perms) + { + $this->container['perms'] = $perms; + + return $this; + } + + /** + * Gets ip_whitelist + * + * @return string[]|null + */ + public function getIpWhitelist() + { + return $this->container['ip_whitelist']; + } + + /** + * Sets ip_whitelist + * + * @param string[]|null $ip_whitelist ip white list (list will be removed if no value is passed) + * + * @return $this + */ + public function setIpWhitelist($ip_whitelist) + { + $this->container['ip_whitelist'] = $ip_whitelist; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key API Key + * + * @return $this + */ + public function setKey($key) + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets state + * + * @return int|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param int|null $state State 1 - normal 2 - locked 3 - frozen + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets created_at + * + * @return string|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param string|null $created_at Creation time + * + * @return $this + */ + public function setCreatedAt($created_at) + { + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets updated_at + * + * @return string|null + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param string|null $updated_at Last update time + * + * @return $this + */ + public function setUpdatedAt($updated_at) + { + $this->container['updated_at'] = $updated_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SubAccountToSubAccount.php b/src/Model/SubAccountToSubAccount.php new file mode 100644 index 0000000..bb8191c --- /dev/null +++ b/src/Model/SubAccountToSubAccount.php @@ -0,0 +1,571 @@ + 'string', + 'sub_account_type' => 'string', + 'sub_account_from' => 'string', + 'sub_account_from_type' => 'string', + 'sub_account_to' => 'string', + 'sub_account_to_type' => 'string', + 'amount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'sub_account_type' => null, + 'sub_account_from' => null, + 'sub_account_from_type' => null, + 'sub_account_to' => null, + 'sub_account_to_type' => null, + 'amount' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'sub_account_type' => 'sub_account_type', + 'sub_account_from' => 'sub_account_from', + 'sub_account_from_type' => 'sub_account_from_type', + 'sub_account_to' => 'sub_account_to', + 'sub_account_to_type' => 'sub_account_to_type', + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'sub_account_type' => 'setSubAccountType', + 'sub_account_from' => 'setSubAccountFrom', + 'sub_account_from_type' => 'setSubAccountFromType', + 'sub_account_to' => 'setSubAccountTo', + 'sub_account_to_type' => 'setSubAccountToType', + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'sub_account_type' => 'getSubAccountType', + 'sub_account_from' => 'getSubAccountFrom', + 'sub_account_from_type' => 'getSubAccountFromType', + 'sub_account_to' => 'getSubAccountTo', + 'sub_account_to_type' => 'getSubAccountToType', + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const SUB_ACCOUNT_FROM_TYPE_SPOT = 'spot'; + const SUB_ACCOUNT_FROM_TYPE_FUTURES = 'futures'; + const SUB_ACCOUNT_FROM_TYPE_CROSS_MARGIN = 'cross_margin'; + const SUB_ACCOUNT_TO_TYPE_SPOT = 'spot'; + const SUB_ACCOUNT_TO_TYPE_FUTURES = 'futures'; + const SUB_ACCOUNT_TO_TYPE_CROSS_MARGIN = 'cross_margin'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSubAccountFromTypeAllowableValues() + { + return [ + self::SUB_ACCOUNT_FROM_TYPE_SPOT, + self::SUB_ACCOUNT_FROM_TYPE_FUTURES, + self::SUB_ACCOUNT_FROM_TYPE_CROSS_MARGIN, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSubAccountToTypeAllowableValues() + { + return [ + self::SUB_ACCOUNT_TO_TYPE_SPOT, + self::SUB_ACCOUNT_TO_TYPE_FUTURES, + self::SUB_ACCOUNT_TO_TYPE_CROSS_MARGIN, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['sub_account_type'] = isset($data['sub_account_type']) ? $data['sub_account_type'] : null; + $this->container['sub_account_from'] = isset($data['sub_account_from']) ? $data['sub_account_from'] : null; + $this->container['sub_account_from_type'] = isset($data['sub_account_from_type']) ? $data['sub_account_from_type'] : null; + $this->container['sub_account_to'] = isset($data['sub_account_to']) ? $data['sub_account_to'] : null; + $this->container['sub_account_to_type'] = isset($data['sub_account_to_type']) ? $data['sub_account_to_type'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['sub_account_from'] === null) { + $invalidProperties[] = "'sub_account_from' can't be null"; + } + if ($this->container['sub_account_from_type'] === null) { + $invalidProperties[] = "'sub_account_from_type' can't be null"; + } + $allowedValues = $this->getSubAccountFromTypeAllowableValues(); + if (!is_null($this->container['sub_account_from_type']) && !in_array($this->container['sub_account_from_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'sub_account_from_type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['sub_account_to'] === null) { + $invalidProperties[] = "'sub_account_to' can't be null"; + } + if ($this->container['sub_account_to_type'] === null) { + $invalidProperties[] = "'sub_account_to_type' can't be null"; + } + $allowedValues = $this->getSubAccountToTypeAllowableValues(); + if (!is_null($this->container['sub_account_to_type']) && !in_array($this->container['sub_account_to_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'sub_account_to_type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency Transfer currency name + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets sub_account_type + * + * @return string|null + */ + public function getSubAccountType() + { + return $this->container['sub_account_type']; + } + + /** + * Sets sub_account_type + * + * @param string|null $sub_account_type Transfer from the account. (deprecate, use `sub_account_from_type` and `sub_account_to_type` instead) + * + * @return $this + */ + public function setSubAccountType($sub_account_type) + { + $this->container['sub_account_type'] = $sub_account_type; + + return $this; + } + + /** + * Gets sub_account_from + * + * @return string + */ + public function getSubAccountFrom() + { + return $this->container['sub_account_from']; + } + + /** + * Sets sub_account_from + * + * @param string $sub_account_from Transfer from the user id of the sub-account + * + * @return $this + */ + public function setSubAccountFrom($sub_account_from) + { + $this->container['sub_account_from'] = $sub_account_from; + + return $this; + } + + /** + * Gets sub_account_from_type + * + * @return string + */ + public function getSubAccountFromType() + { + return $this->container['sub_account_from_type']; + } + + /** + * Sets sub_account_from_type + * + * @param string $sub_account_from_type Transfer from the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account + * + * @return $this + */ + public function setSubAccountFromType($sub_account_from_type) + { + $allowedValues = $this->getSubAccountFromTypeAllowableValues(); + if (!in_array($sub_account_from_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'sub_account_from_type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['sub_account_from_type'] = $sub_account_from_type; + + return $this; + } + + /** + * Gets sub_account_to + * + * @return string + */ + public function getSubAccountTo() + { + return $this->container['sub_account_to']; + } + + /** + * Sets sub_account_to + * + * @param string $sub_account_to Transfer to the user id of the sub-account + * + * @return $this + */ + public function setSubAccountTo($sub_account_to) + { + $this->container['sub_account_to'] = $sub_account_to; + + return $this; + } + + /** + * Gets sub_account_to_type + * + * @return string + */ + public function getSubAccountToType() + { + return $this->container['sub_account_to_type']; + } + + /** + * Sets sub_account_to_type + * + * @param string $sub_account_to_type Transfer to the account. `spot` - spot account, `futures` - perpetual contract account, `cross_margin` - cross margin account + * + * @return $this + */ + public function setSubAccountToType($sub_account_to_type) + { + $allowedValues = $this->getSubAccountToTypeAllowableValues(); + if (!in_array($sub_account_to_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'sub_account_to_type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['sub_account_to_type'] = $sub_account_to_type; + + return $this; + } + + /** + * Gets amount + * + * @return string + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string $amount Transfer amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TriggerTime.php b/src/Model/TriggerTime.php new file mode 100644 index 0000000..c05c59f --- /dev/null +++ b/src/Model/TriggerTime.php @@ -0,0 +1,305 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'trigger_time' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'trigger_time' => 'triggerTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'trigger_time' => 'setTriggerTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'trigger_time' => 'getTriggerTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['trigger_time'] = isset($data['trigger_time']) ? $data['trigger_time'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets trigger_time + * + * @return int|null + */ + public function getTriggerTime() + { + return $this->container['trigger_time']; + } + + /** + * Sets trigger_time + * + * @param int|null $trigger_time Timestamp of the end of the countdown, in milliseconds + * + * @return $this + */ + public function setTriggerTime($trigger_time) + { + $this->container['trigger_time'] = $trigger_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + From 555c7a5e05daede387028a23be552027a1fa61dc Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Fri, 3 Mar 2023 12:16:09 +0800 Subject: [PATCH 17/17] release 5.40.0 --- README.md | 21 +- composer.json | 2 +- composer.lock | 230 ++++--- docs/Api/FuturesApi.md | 142 +++++ docs/Api/MarginApi.md | 4 +- docs/Api/RebateApi.md | 157 +++++ docs/Api/SpotApi.md | 134 +++- docs/Api/SubAccountApi.md | 16 +- docs/Model/AgencyCommission.md | 14 + docs/Model/AgencyCommissionHistory.md | 11 + docs/Model/AgencyTransaction.md | 17 + docs/Model/AgencyTransactionHistory.md | 11 + docs/Model/BatchOrder.md | 4 +- docs/Model/Contract.md | 2 + docs/Model/CrossMarginAccount.md | 1 + docs/Model/CrossMarginAccountBook.md | 2 +- docs/Model/CrossMarginCurrency.md | 2 +- docs/Model/FundingBookItem.md | 2 +- docs/Model/FuturesAccount.md | 2 +- docs/Model/FuturesAutoDeleverage.md | 18 + docs/Model/FuturesCandlestick.md | 1 + docs/Model/LedgerRecord.md | 1 + docs/Model/Loan.md | 2 +- docs/Model/Order.md | 7 +- docs/Model/OrderPatch.md | 10 + docs/Model/SpotFee.md | 17 + docs/Model/SubAccount.md | 1 + src/Api/FuturesApi.php | 842 ++++++++++++++++++++++--- src/Api/MarginApi.php | 8 +- src/Api/RebateApi.php | 836 ++++++++++++++++++++++++ src/Api/SpotApi.php | 545 +++++++++++++++- src/Api/SubAccountApi.php | 88 +-- src/Configuration.php | 6 +- src/Model/AgencyCommission.php | 455 +++++++++++++ src/Model/AgencyCommissionHistory.php | 365 +++++++++++ src/Model/AgencyTransaction.php | 545 ++++++++++++++++ src/Model/AgencyTransactionHistory.php | 365 +++++++++++ src/Model/BatchOrder.php | 6 +- src/Model/Contract.php | 70 +- src/Model/CrossMarginAccount.php | 40 +- src/Model/CrossMarginAccountBook.php | 4 +- src/Model/CrossMarginCurrency.php | 2 +- src/Model/FundingBookItem.php | 2 +- src/Model/FuturesAccount.php | 2 +- src/Model/FuturesAutoDeleverage.php | 575 +++++++++++++++++ src/Model/FuturesCandlestick.php | 40 +- src/Model/LedgerRecord.php | 30 + src/Model/Loan.php | 2 +- src/Model/Order.php | 36 +- src/Model/OrderPatch.php | 336 ++++++++++ src/Model/SpotFee.php | 545 ++++++++++++++++ src/Model/SubAccount.php | 30 + 52 files changed, 6307 insertions(+), 299 deletions(-) create mode 100644 docs/Api/RebateApi.md create mode 100644 docs/Model/AgencyCommission.md create mode 100644 docs/Model/AgencyCommissionHistory.md create mode 100644 docs/Model/AgencyTransaction.md create mode 100644 docs/Model/AgencyTransactionHistory.md create mode 100644 docs/Model/FuturesAutoDeleverage.md create mode 100644 docs/Model/OrderPatch.md create mode 100644 docs/Model/SpotFee.md create mode 100644 src/Api/RebateApi.php create mode 100644 src/Model/AgencyCommission.php create mode 100644 src/Model/AgencyCommissionHistory.php create mode 100644 src/Model/AgencyTransaction.php create mode 100644 src/Model/AgencyTransactionHistory.php create mode 100644 src/Model/FuturesAutoDeleverage.php create mode 100644 src/Model/OrderPatch.php create mode 100644 src/Model/SpotFee.php diff --git a/README.md b/README.md index d13ce4b..fd1eccd 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.34.0 -- Package version: 5.34.0 +- API version: 4.40.0 +- Package version: 5.40.0 - Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) @@ -161,8 +161,10 @@ Class | Method | HTTP request | Description *FuturesApi* | [**amendFuturesOrder**](docs/Api/FuturesApi.md#amendfuturesorder) | **PUT** /futures/{settle}/orders/{order_id} | Amend an order *FuturesApi* | [**cancelFuturesOrder**](docs/Api/FuturesApi.md#cancelfuturesorder) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel a single order *FuturesApi* | [**getMyTrades**](docs/Api/FuturesApi.md#getmytrades) | **GET** /futures/{settle}/my_trades | List personal trading history +*FuturesApi* | [**getMyTradesWithTimeRange**](docs/Api/FuturesApi.md#getmytradeswithtimerange) | **GET** /futures/{settle}/my_trades_timerange | List personal trading history by time range *FuturesApi* | [**listPositionClose**](docs/Api/FuturesApi.md#listpositionclose) | **GET** /futures/{settle}/position_close | List position close history *FuturesApi* | [**listLiquidates**](docs/Api/FuturesApi.md#listliquidates) | **GET** /futures/{settle}/liquidates | List liquidation history +*FuturesApi* | [**listAutoDeleverages**](docs/Api/FuturesApi.md#listautodeleverages) | **GET** /futures/{settle}/auto_deleverages | List Auto-Deleveraging History *FuturesApi* | [**countdownCancelAllFutures**](docs/Api/FuturesApi.md#countdowncancelallfutures) | **POST** /futures/{settle}/countdown_cancel_all | Countdown cancel orders *FuturesApi* | [**listPriceTriggeredOrders**](docs/Api/FuturesApi.md#listpricetriggeredorders) | **GET** /futures/{settle}/price_orders | List all auto orders *FuturesApi* | [**createPriceTriggeredOrder**](docs/Api/FuturesApi.md#createpricetriggeredorder) | **POST** /futures/{settle}/price_orders | Create a price-triggered order @@ -198,7 +200,7 @@ Class | Method | HTTP request | Description *MarginApi* | [**createCrossMarginLoan**](docs/Api/MarginApi.md#createcrossmarginloan) | **POST** /margin/cross/loans | Create a cross margin borrow loan *MarginApi* | [**getCrossMarginLoan**](docs/Api/MarginApi.md#getcrossmarginloan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail *MarginApi* | [**listCrossMarginRepayments**](docs/Api/MarginApi.md#listcrossmarginrepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments -*MarginApi* | [**repayCrossMarginLoan**](docs/Api/MarginApi.md#repaycrossmarginloan) | **POST** /margin/cross/repayments | When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first +*MarginApi* | [**repayCrossMarginLoan**](docs/Api/MarginApi.md#repaycrossmarginloan) | **POST** /margin/cross/repayments | Cross margin repayments *MarginApi* | [**getCrossMarginTransferable**](docs/Api/MarginApi.md#getcrossmargintransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency *MarginApi* | [**getCrossMarginBorrowable**](docs/Api/MarginApi.md#getcrossmarginborrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency *OptionsApi* | [**listOptionsUnderlyings**](docs/Api/OptionsApi.md#listoptionsunderlyings) | **GET** /options/underlyings | List all underlyings @@ -225,15 +227,18 @@ Class | Method | HTTP request | Description *OptionsApi* | [**getOptionsOrder**](docs/Api/OptionsApi.md#getoptionsorder) | **GET** /options/orders/{order_id} | Get a single order *OptionsApi* | [**cancelOptionsOrder**](docs/Api/OptionsApi.md#canceloptionsorder) | **DELETE** /options/orders/{order_id} | Cancel a single order *OptionsApi* | [**listMyOptionsTrades**](docs/Api/OptionsApi.md#listmyoptionstrades) | **GET** /options/my_trades | List personal trading history +*RebateApi* | [**agencyTransactionHistory**](docs/Api/RebateApi.md#agencytransactionhistory) | **GET** /rebate/agency/transaction_history | The broker obtains the transaction history of the recommended user +*RebateApi* | [**agencyCommissionsHistory**](docs/Api/RebateApi.md#agencycommissionshistory) | **GET** /rebate/agency/commission_history | The broker obtains the commission history of the recommended user *SpotApi* | [**listCurrencies**](docs/Api/SpotApi.md#listcurrencies) | **GET** /spot/currencies | List all currencies' details *SpotApi* | [**getCurrency**](docs/Api/SpotApi.md#getcurrency) | **GET** /spot/currencies/{currency} | Get details of a specific currency *SpotApi* | [**listCurrencyPairs**](docs/Api/SpotApi.md#listcurrencypairs) | **GET** /spot/currency_pairs | List all currency pairs supported -*SpotApi* | [**getCurrencyPair**](docs/Api/SpotApi.md#getcurrencypair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc order +*SpotApi* | [**getCurrencyPair**](docs/Api/SpotApi.md#getcurrencypair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc currency pair *SpotApi* | [**listTickers**](docs/Api/SpotApi.md#listtickers) | **GET** /spot/tickers | Retrieve ticker information *SpotApi* | [**listOrderBook**](docs/Api/SpotApi.md#listorderbook) | **GET** /spot/order_book | Retrieve order book *SpotApi* | [**listTrades**](docs/Api/SpotApi.md#listtrades) | **GET** /spot/trades | Retrieve market trades *SpotApi* | [**listCandlesticks**](docs/Api/SpotApi.md#listcandlesticks) | **GET** /spot/candlesticks | Market candlesticks *SpotApi* | [**getFee**](docs/Api/SpotApi.md#getfee) | **GET** /spot/fee | Query user trading fee rates +*SpotApi* | [**getBatchSpotFee**](docs/Api/SpotApi.md#getbatchspotfee) | **GET** /spot/batch_fee | Query a batch of user trading fee rates *SpotApi* | [**listSpotAccounts**](docs/Api/SpotApi.md#listspotaccounts) | **GET** /spot/accounts | List spot accounts *SpotApi* | [**createBatchOrders**](docs/Api/SpotApi.md#createbatchorders) | **POST** /spot/batch_orders | Create a batch of orders *SpotApi* | [**listAllOpenOrders**](docs/Api/SpotApi.md#listallopenorders) | **GET** /spot/open_orders | List all open orders @@ -244,6 +249,7 @@ Class | Method | HTTP request | Description *SpotApi* | [**cancelBatchOrders**](docs/Api/SpotApi.md#cancelbatchorders) | **POST** /spot/cancel_batch_orders | Cancel a batch of orders with an ID list *SpotApi* | [**getOrder**](docs/Api/SpotApi.md#getorder) | **GET** /spot/orders/{order_id} | Get a single order *SpotApi* | [**cancelOrder**](docs/Api/SpotApi.md#cancelorder) | **DELETE** /spot/orders/{order_id} | Cancel a single order +*SpotApi* | [**amendOrder**](docs/Api/SpotApi.md#amendorder) | **PATCH** /spot/orders/{order_id} | Amend an order *SpotApi* | [**listMyTrades**](docs/Api/SpotApi.md#listmytrades) | **GET** /spot/my_trades | List personal trading history *SpotApi* | [**getSystemTime**](docs/Api/SpotApi.md#getsystemtime) | **GET** /spot/time | Get server current time *SpotApi* | [**countdownCancelAllSpot**](docs/Api/SpotApi.md#countdowncancelallspot) | **POST** /spot/countdown_cancel_all | Countdown cancel orders @@ -285,6 +291,10 @@ Class | Method | HTTP request | Description ## Documentation For Models - [AccountBalance](docs/Model/AccountBalance.md) + - [AgencyCommission](docs/Model/AgencyCommission.md) + - [AgencyCommissionHistory](docs/Model/AgencyCommissionHistory.md) + - [AgencyTransaction](docs/Model/AgencyTransaction.md) + - [AgencyTransactionHistory](docs/Model/AgencyTransactionHistory.md) - [ApiV4KeyPerm](docs/Model/ApiV4KeyPerm.md) - [AutoRepaySetting](docs/Model/AutoRepaySetting.md) - [BatchFuturesOrder](docs/Model/BatchFuturesOrder.md) @@ -320,6 +330,7 @@ Class | Method | HTTP request | Description - [FuturesAccount](docs/Model/FuturesAccount.md) - [FuturesAccountBook](docs/Model/FuturesAccountBook.md) - [FuturesAccountHistory](docs/Model/FuturesAccountHistory.md) + - [FuturesAutoDeleverage](docs/Model/FuturesAutoDeleverage.md) - [FuturesCandlestick](docs/Model/FuturesCandlestick.md) - [FuturesIndexConstituents](docs/Model/FuturesIndexConstituents.md) - [FuturesInitialOrder](docs/Model/FuturesInitialOrder.md) @@ -365,6 +376,7 @@ Class | Method | HTTP request | Description - [OptionsUnderlyingTicker](docs/Model/OptionsUnderlyingTicker.md) - [Order](docs/Model/Order.md) - [OrderBook](docs/Model/OrderBook.md) + - [OrderPatch](docs/Model/OrderPatch.md) - [Position](docs/Model/Position.md) - [PositionClose](docs/Model/PositionClose.md) - [PositionCloseOrder](docs/Model/PositionCloseOrder.md) @@ -372,6 +384,7 @@ Class | Method | HTTP request | Description - [Repayment](docs/Model/Repayment.md) - [SavedAddress](docs/Model/SavedAddress.md) - [SpotAccount](docs/Model/SpotAccount.md) + - [SpotFee](docs/Model/SpotFee.md) - [SpotPricePutOrder](docs/Model/SpotPricePutOrder.md) - [SpotPriceTrigger](docs/Model/SpotPriceTrigger.md) - [SpotPriceTriggeredOrder](docs/Model/SpotPriceTriggeredOrder.md) diff --git a/composer.json b/composer.json index 1d070ab..fa9a2ec 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gateio/gateapi-php", - "version": "5.34.0", + "version": "5.40.0", "description": "Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.", "keywords": [ "gate", diff --git a/composer.lock b/composer.lock index f5a11ed..03966bc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cd455e0d8a77e0dfea9ca46e05e26094", + "content-hash": "27d781340b451b2d0c53c529f5417336", "packages": [ { "name": "guzzlehttp/guzzle", @@ -881,32 +881,35 @@ }, { "name": "doctrine/annotations", - "version": "1.13.3", + "version": "1.14.3", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0" + "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", + "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", "shasum": "" }, "require": { - "doctrine/lexer": "1.*", + "doctrine/lexer": "^1 || ^2", "ext-tokenizer": "*", "php": "^7.1 || ^8.0", "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2", + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6", "vimeo/psalm": "^4.10" }, + "suggest": { + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + }, "type": "library", "autoload": { "psr-4": { @@ -948,36 +951,79 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.3" + "source": "https://github.com/doctrine/annotations/tree/1.14.3" }, - "time": "2022-07-02T10:48:51+00:00" + "time": "2023-02-01T09:20:38+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + }, + "time": "2022-05-02T15:47:09+00:00" }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -1004,7 +1050,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -1020,35 +1066,37 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "doctrine/lexer", - "version": "1.2.3", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" + "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", + "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", "shasum": "" }, "require": { + "doctrine/deprecations": "^1.0", "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9.0", + "doctrine/coding-standard": "^9 || ^10", "phpstan/phpstan": "^1.3", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^4.11 || ^5.0" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "Doctrine\\Common\\Lexer\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1080,7 +1128,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" + "source": "https://github.com/doctrine/lexer/tree/2.1.0" }, "funding": [ { @@ -1096,7 +1144,7 @@ "type": "tidelift" } ], - "time": "2022-02-28T11:07:21+00:00" + "time": "2022-12-14T08:49:07+00:00" }, { "name": "friendsofphp/php-cs-fixer", @@ -1599,20 +1647,20 @@ }, { "name": "phpspec/prophecy", - "version": "v1.16.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359" + "reference": "15873c65b207b07765dbc3c95d20fdf4a320cbe2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be8cac52a0827776ff9ccda8c381ac5b71aeb359", - "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/15873c65b207b07765dbc3c95d20fdf4a320cbe2", + "reference": "15873c65b207b07765dbc3c95d20fdf4a320cbe2", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2", + "doctrine/instantiator": "^1.2 || ^2.0", "php": "^7.2 || 8.0.* || 8.1.* || 8.2.*", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", @@ -1620,6 +1668,7 @@ }, "require-dev": { "phpspec/phpspec": "^6.0 || ^7.0", + "phpstan/phpstan": "^1.9", "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", @@ -1660,9 +1709,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.16.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.17.0" }, - "time": "2022-11-29T15:06:56+00:00" + "time": "2023-02-02T15:41:36+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2906,16 +2955,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -2951,27 +3000,28 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-06-18T07:21:10+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { "name": "symfony/console", - "version": "v5.4.16", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef" + "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", - "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", + "url": "https://api.github.com/repos/symfony/console/zipball/c77433ddc6cdc689caf48065d9ea22ca0853fbd9", + "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9", "shasum": "" }, "require": { @@ -3041,7 +3091,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.16" + "source": "https://github.com/symfony/console/tree/v5.4.21" }, "funding": [ { @@ -3057,7 +3107,7 @@ "type": "tidelift" } ], - "time": "2022-11-25T14:09:27+00:00" + "time": "2023-02-25T16:59:41+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3128,16 +3178,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.4.9", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc" + "reference": "f0ae1383a8285dfc6752b8d8602790953118ff5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", - "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f0ae1383a8285dfc6752b8d8602790953118ff5a", + "reference": "f0ae1383a8285dfc6752b8d8602790953118ff5a", "shasum": "" }, "require": { @@ -3193,7 +3243,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.9" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.21" }, "funding": [ { @@ -3209,7 +3259,7 @@ "type": "tidelift" } ], - "time": "2022-05-05T16:45:39+00:00" + "time": "2023-02-14T08:03:56+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -3292,16 +3342,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.13", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "ac09569844a9109a5966b9438fc29113ce77cf51" + "reference": "e75960b1bbfd2b8c9e483e0d74811d555ca3de9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/ac09569844a9109a5966b9438fc29113ce77cf51", - "reference": "ac09569844a9109a5966b9438fc29113ce77cf51", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e75960b1bbfd2b8c9e483e0d74811d555ca3de9f", + "reference": "e75960b1bbfd2b8c9e483e0d74811d555ca3de9f", "shasum": "" }, "require": { @@ -3336,7 +3386,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.13" + "source": "https://github.com/symfony/filesystem/tree/v5.4.21" }, "funding": [ { @@ -3352,20 +3402,20 @@ "type": "tidelift" } ], - "time": "2022-09-21T19:53:16+00:00" + "time": "2023-02-14T08:03:56+00:00" }, { "name": "symfony/finder", - "version": "v5.4.11", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c" + "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/7872a66f57caffa2916a584db1aa7f12adc76f8c", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c", + "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", + "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", "shasum": "" }, "require": { @@ -3399,7 +3449,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.11" + "source": "https://github.com/symfony/finder/tree/v5.4.21" }, "funding": [ { @@ -3415,20 +3465,20 @@ "type": "tidelift" } ], - "time": "2022-07-29T07:37:50+00:00" + "time": "2023-02-16T09:33:00+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.11", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690" + "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/54f14e36aa73cb8f7261d7686691fd4d75ea2690", - "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", + "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", "shasum": "" }, "require": { @@ -3468,7 +3518,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.11" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.21" }, "funding": [ { @@ -3484,7 +3534,7 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:00:38+00:00" + "time": "2023-02-14T08:03:56+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3964,16 +4014,16 @@ }, { "name": "symfony/process", - "version": "v5.4.11", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1" + "reference": "d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/6e75fe6874cbc7e4773d049616ab450eff537bf1", - "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1", + "url": "https://api.github.com/repos/symfony/process/zipball/d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd", + "reference": "d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd", "shasum": "" }, "require": { @@ -4006,7 +4056,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.11" + "source": "https://github.com/symfony/process/tree/v5.4.21" }, "funding": [ { @@ -4022,7 +4072,7 @@ "type": "tidelift" } ], - "time": "2022-06-27T16:58:25+00:00" + "time": "2023-02-21T19:46:44+00:00" }, { "name": "symfony/service-contracts", @@ -4109,16 +4159,16 @@ }, { "name": "symfony/stopwatch", - "version": "v5.4.13", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "6df7a3effde34d81717bbef4591e5ffe32226d69" + "reference": "f83692cd869a6f2391691d40a01e8acb89e76fee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6df7a3effde34d81717bbef4591e5ffe32226d69", - "reference": "6df7a3effde34d81717bbef4591e5ffe32226d69", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f83692cd869a6f2391691d40a01e8acb89e76fee", + "reference": "f83692cd869a6f2391691d40a01e8acb89e76fee", "shasum": "" }, "require": { @@ -4151,7 +4201,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.13" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.21" }, "funding": [ { @@ -4167,20 +4217,20 @@ "type": "tidelift" } ], - "time": "2022-09-28T13:19:49+00:00" + "time": "2023-02-14T08:03:56+00:00" }, { "name": "symfony/string", - "version": "v5.4.15", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed" + "reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", - "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", + "url": "https://api.github.com/repos/symfony/string/zipball/edac10d167b78b1d90f46a80320d632de0bd9f2f", + "reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f", "shasum": "" }, "require": { @@ -4237,7 +4287,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.15" + "source": "https://github.com/symfony/string/tree/v5.4.21" }, "funding": [ { @@ -4253,7 +4303,7 @@ "type": "tidelift" } ], - "time": "2022-10-05T15:16:54+00:00" + "time": "2023-02-22T08:00:55+00:00" }, { "name": "theseer/tokenizer", diff --git a/docs/Api/FuturesApi.md b/docs/Api/FuturesApi.md index a93b6b0..0299125 100644 --- a/docs/Api/FuturesApi.md +++ b/docs/Api/FuturesApi.md @@ -36,8 +36,10 @@ Method | HTTP request | Description [**amendFuturesOrder**](FuturesApi.md#amendFuturesOrder) | **PUT** /futures/{settle}/orders/{order_id} | Amend an order [**cancelFuturesOrder**](FuturesApi.md#cancelFuturesOrder) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel a single order [**getMyTrades**](FuturesApi.md#getMyTrades) | **GET** /futures/{settle}/my_trades | List personal trading history +[**getMyTradesWithTimeRange**](FuturesApi.md#getMyTradesWithTimeRange) | **GET** /futures/{settle}/my_trades_timerange | List personal trading history by time range [**listPositionClose**](FuturesApi.md#listPositionClose) | **GET** /futures/{settle}/position_close | List position close history [**listLiquidates**](FuturesApi.md#listLiquidates) | **GET** /futures/{settle}/liquidates | List liquidation history +[**listAutoDeleverages**](FuturesApi.md#listAutoDeleverages) | **GET** /futures/{settle}/auto_deleverages | List Auto-Deleveraging History [**countdownCancelAllFutures**](FuturesApi.md#countdownCancelAllFutures) | **POST** /futures/{settle}/countdown_cancel_all | Countdown cancel orders [**listPriceTriggeredOrders**](FuturesApi.md#listPriceTriggeredOrders) | **GET** /futures/{settle}/price_orders | List all auto orders [**createPriceTriggeredOrder**](FuturesApi.md#createPriceTriggeredOrder) | **POST** /futures/{settle}/price_orders | Create a price-triggered order @@ -2110,6 +2112,78 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## getMyTradesWithTimeRange + +> \GateApi\Model\MyFuturesTrade[] getMyTradesWithTimeRange($settle, $contract, $from, $to, $limit, $offset) + +List personal trading history by time range + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\FuturesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['settle'] = 'usdt'; // string | Settle currency +$associate_array['contract'] = 'BTC_USDT'; // string | Futures contract, return related data only if specified +$associate_array['from'] = 1547706332; // int | Start timestamp +$associate_array['to'] = 1547706332; // int | End timestamp +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['offset'] = 0; // int | List offset, starting from 0 + +try { + $result = $apiInstance->getMyTradesWithTimeRange($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FuturesApi->getMyTradesWithTimeRange: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **string**| Settle currency | + **contract** | **string**| Futures contract, return related data only if specified | [optional] + **from** | **int**| Start timestamp | [optional] + **to** | **int**| End timestamp | [optional] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + +### Return type + +[**\GateApi\Model\MyFuturesTrade[]**](../Model/MyFuturesTrade.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listPositionClose > \GateApi\Model\PositionClose[] listPositionClose($settle, $contract, $limit, $offset, $from, $to) @@ -2250,6 +2324,74 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## listAutoDeleverages + +> \GateApi\Model\FuturesAutoDeleverage[] listAutoDeleverages($settle, $contract, $limit, $at) + +List Auto-Deleveraging History + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\FuturesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['settle'] = 'usdt'; // string | Settle currency +$associate_array['contract'] = 'BTC_USDT'; // string | Futures contract, return related data only if specified +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['at'] = 0; // int | Specify an auto-deleveraging timestamp + +try { + $result = $apiInstance->listAutoDeleverages($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FuturesApi->listAutoDeleverages: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **string**| Settle currency | + **contract** | **string**| Futures contract, return related data only if specified | [optional] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **at** | **int**| Specify an auto-deleveraging timestamp | [optional] [default to 0] + +### Return type + +[**\GateApi\Model\FuturesAutoDeleverage[]**](../Model/FuturesAutoDeleverage.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## countdownCancelAllFutures > \GateApi\Model\TriggerTime countdownCancelAllFutures($settle, $countdown_cancel_all_futures_task) diff --git a/docs/Api/MarginApi.md b/docs/Api/MarginApi.md index cb6da97..9f24104 100644 --- a/docs/Api/MarginApi.md +++ b/docs/Api/MarginApi.md @@ -33,7 +33,7 @@ Method | HTTP request | Description [**createCrossMarginLoan**](MarginApi.md#createCrossMarginLoan) | **POST** /margin/cross/loans | Create a cross margin borrow loan [**getCrossMarginLoan**](MarginApi.md#getCrossMarginLoan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail [**listCrossMarginRepayments**](MarginApi.md#listCrossMarginRepayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments -[**repayCrossMarginLoan**](MarginApi.md#repayCrossMarginLoan) | **POST** /margin/cross/repayments | When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first +[**repayCrossMarginLoan**](MarginApi.md#repayCrossMarginLoan) | **POST** /margin/cross/repayments | Cross margin repayments [**getCrossMarginTransferable**](MarginApi.md#getCrossMarginTransferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency [**getCrossMarginBorrowable**](MarginApi.md#getCrossMarginBorrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency @@ -1856,6 +1856,8 @@ Name | Type | Description | Notes > \GateApi\Model\CrossMarginLoan[] repayCrossMarginLoan($cross_margin_repay_request) +Cross margin repayments + When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first ### Example diff --git a/docs/Api/RebateApi.md b/docs/Api/RebateApi.md new file mode 100644 index 0000000..6eb17c0 --- /dev/null +++ b/docs/Api/RebateApi.md @@ -0,0 +1,157 @@ +# GateApi\RebateApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**agencyTransactionHistory**](RebateApi.md#agencyTransactionHistory) | **GET** /rebate/agency/transaction_history | The broker obtains the transaction history of the recommended user +[**agencyCommissionsHistory**](RebateApi.md#agencyCommissionsHistory) | **GET** /rebate/agency/commission_history | The broker obtains the commission history of the recommended user + + +## agencyTransactionHistory + +> \GateApi\Model\AgencyTransactionHistory[] agencyTransactionHistory($currency_pair, $user_id, $from, $to, $limit, $offset) + +The broker obtains the transaction history of the recommended user + +Record time range cannot exceed 30 days + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\RebateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['currency_pair'] = 'BTC_USDT'; // string | Specify the currency pair, if not specified, return all currency pairs +$associate_array['user_id'] = '10003'; // string | User ID. If not specified, all user records will be returned +$associate_array['from'] = 1602120000; // int | Time range beginning, default to 7 days before current time +$associate_array['to'] = 1602123600; // int | Time range ending, default to current time +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['offset'] = 0; // int | List offset, starting from 0 + +try { + $result = $apiInstance->agencyTransactionHistory($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling RebateApi->agencyTransactionHistory: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency_pair** | **string**| Specify the currency pair, if not specified, return all currency pairs | [optional] + **user_id** | **string**| User ID. If not specified, all user records will be returned | [optional] + **from** | **int**| Time range beginning, default to 7 days before current time | [optional] + **to** | **int**| Time range ending, default to current time | [optional] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + +### Return type + +[**\GateApi\Model\AgencyTransactionHistory[]**](../Model/AgencyTransactionHistory.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## agencyCommissionsHistory + +> \GateApi\Model\AgencyCommissionHistory[] agencyCommissionsHistory($currency, $user_id, $from, $to, $limit, $offset) + +The broker obtains the commission history of the recommended user + +Record time range cannot exceed 30 days + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\RebateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['currency'] = 'BTC'; // string | Filter by currency. Return all currency records if not specified +$associate_array['user_id'] = '10003'; // string | User ID. If not specified, all user records will be returned +$associate_array['from'] = 1602120000; // int | Time range beginning, default to 7 days before current time +$associate_array['to'] = 1602123600; // int | Time range ending, default to current time +$associate_array['limit'] = 100; // int | Maximum number of records to be returned in a single list +$associate_array['offset'] = 0; // int | List offset, starting from 0 + +try { + $result = $apiInstance->agencyCommissionsHistory($associate_array); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling RebateApi->agencyCommissionsHistory: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **string**| Filter by currency. Return all currency records if not specified | [optional] + **user_id** | **string**| User ID. If not specified, all user records will be returned | [optional] + **from** | **int**| Time range beginning, default to 7 days before current time | [optional] + **to** | **int**| Time range ending, default to current time | [optional] + **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + +### Return type + +[**\GateApi\Model\AgencyCommissionHistory[]**](../Model/AgencyCommissionHistory.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Api/SpotApi.md b/docs/Api/SpotApi.md index 3c60ff3..b95d58b 100644 --- a/docs/Api/SpotApi.md +++ b/docs/Api/SpotApi.md @@ -7,12 +7,13 @@ Method | HTTP request | Description [**listCurrencies**](SpotApi.md#listCurrencies) | **GET** /spot/currencies | List all currencies' details [**getCurrency**](SpotApi.md#getCurrency) | **GET** /spot/currencies/{currency} | Get details of a specific currency [**listCurrencyPairs**](SpotApi.md#listCurrencyPairs) | **GET** /spot/currency_pairs | List all currency pairs supported -[**getCurrencyPair**](SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc order +[**getCurrencyPair**](SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc currency pair [**listTickers**](SpotApi.md#listTickers) | **GET** /spot/tickers | Retrieve ticker information [**listOrderBook**](SpotApi.md#listOrderBook) | **GET** /spot/order_book | Retrieve order book [**listTrades**](SpotApi.md#listTrades) | **GET** /spot/trades | Retrieve market trades [**listCandlesticks**](SpotApi.md#listCandlesticks) | **GET** /spot/candlesticks | Market candlesticks [**getFee**](SpotApi.md#getFee) | **GET** /spot/fee | Query user trading fee rates +[**getBatchSpotFee**](SpotApi.md#getBatchSpotFee) | **GET** /spot/batch_fee | Query a batch of user trading fee rates [**listSpotAccounts**](SpotApi.md#listSpotAccounts) | **GET** /spot/accounts | List spot accounts [**createBatchOrders**](SpotApi.md#createBatchOrders) | **POST** /spot/batch_orders | Create a batch of orders [**listAllOpenOrders**](SpotApi.md#listAllOpenOrders) | **GET** /spot/open_orders | List all open orders @@ -23,6 +24,7 @@ Method | HTTP request | Description [**cancelBatchOrders**](SpotApi.md#cancelBatchOrders) | **POST** /spot/cancel_batch_orders | Cancel a batch of orders with an ID list [**getOrder**](SpotApi.md#getOrder) | **GET** /spot/orders/{order_id} | Get a single order [**cancelOrder**](SpotApi.md#cancelOrder) | **DELETE** /spot/orders/{order_id} | Cancel a single order +[**amendOrder**](SpotApi.md#amendOrder) | **PATCH** /spot/orders/{order_id} | Amend an order [**listMyTrades**](SpotApi.md#listMyTrades) | **GET** /spot/my_trades | List personal trading history [**getSystemTime**](SpotApi.md#getSystemTime) | **GET** /spot/time | Get server current time [**countdownCancelAllSpot**](SpotApi.md#countdownCancelAllSpot) | **POST** /spot/countdown_cancel_all | Countdown cancel orders @@ -199,7 +201,7 @@ No authorization required > \GateApi\Model\CurrencyPair getCurrencyPair($currency_pair) -Get details of a specifc order +Get details of a specifc currency pair ### Example @@ -583,6 +585,66 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## getBatchSpotFee + +> map[string,\GateApi\Model\SpotFee] getBatchSpotFee($currency_pairs) + +Query a batch of user trading fee rates + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SpotApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$currency_pairs = 'BTC_USDT,ETH_USDT'; // string | A request can only query up to 50 currency pairs + +try { + $result = $apiInstance->getBatchSpotFee($currency_pairs); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SpotApi->getBatchSpotFee: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency_pairs** | **string**| A request can only query up to 50 currency pairs | + +### Return type + +[**map[string,\GateApi\Model\SpotFee]**](../Model/SpotFee.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listSpotAccounts > \GateApi\Model\SpotAccount[] listSpotAccounts($currency) @@ -1237,6 +1299,74 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## amendOrder + +> \GateApi\Model\Order amendOrder($order_id, $currency_pair, $order_patch, $account) + +Amend an order + +By default, the orders of spot and margin account are updated. If you need to modify orders of the `cross-margin` account, you must specify account as `cross_margin`. For portfolio margin account, only `cross_margin` account is supported. Currently, only supports modification of `price` or `amount` fields. Regarding rate limiting: modify order and create order sharing rate limiting rules. Regarding matching priority: only modifying the amount does not affect the priority. If the price is modified, the priority will be adjusted to the last of the new price. Note: If the modified amount is less than the fill amount, the order will be cancelled. + +### Example + +```php +setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET'); + + +$apiInstance = new GateApi\Api\SpotApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$order_id = '12345'; // string | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. +$currency_pair = 'BTC_USDT'; // string | Currency pair +$order_patch = new \GateApi\Model\OrderPatch(); // \GateApi\Model\OrderPatch | +$account = 'cross_margin'; // string | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only + +try { + $result = $apiInstance->amendOrder($order_id, $currency_pair, $order_patch, $account); + print_r($result); +} catch (GateApi\GateApiException $e) { + echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling SpotApi->amendOrder: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. | + **currency_pair** | **string**| Currency pair | + **order_patch** | [**\GateApi\Model\OrderPatch**](../Model/OrderPatch.md)| | + **account** | **string**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional] + +### Return type + +[**\GateApi\Model\Order**](../Model/Order.md) + +### Authorization + +[apiv4](../../README.md#apiv4) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listMyTrades > \GateApi\Model\Trade[] listMyTrades($currency_pair, $limit, $page, $order_id, $account, $from, $to) diff --git a/docs/Api/SubAccountApi.md b/docs/Api/SubAccountApi.md index 20f189d..3633599 100644 --- a/docs/Api/SubAccountApi.md +++ b/docs/Api/SubAccountApi.md @@ -502,7 +502,7 @@ void (empty response body) ## lockSubAccount -> lockSubAccount($user_id, $body) +> lockSubAccount($user_id) Lock the sub-account @@ -523,10 +523,9 @@ $apiInstance = new GateApi\Api\SubAccountApi( $config ); $user_id = 56; // int | The user id of the sub-account -$body = new \stdClass; // object | try { - $apiInstance->lockSubAccount($user_id, $body); + $apiInstance->lockSubAccount($user_id); } catch (GateApi\GateApiException $e) { echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; } catch (Exception $e) { @@ -541,7 +540,6 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **int**| The user id of the sub-account | - **body** | **object**| | ### Return type @@ -553,7 +551,7 @@ void (empty response body) ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -563,7 +561,7 @@ void (empty response body) ## unlockSubAccount -> unlockSubAccount($user_id, $body) +> unlockSubAccount($user_id) Unlock the sub-account @@ -584,10 +582,9 @@ $apiInstance = new GateApi\Api\SubAccountApi( $config ); $user_id = 56; // int | The user id of the sub-account -$body = new \stdClass; // object | try { - $apiInstance->unlockSubAccount($user_id, $body); + $apiInstance->unlockSubAccount($user_id); } catch (GateApi\GateApiException $e) { echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL; } catch (Exception $e) { @@ -602,7 +599,6 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **int**| The user id of the sub-account | - **body** | **object**| | ### Return type @@ -614,7 +610,7 @@ void (empty response body) ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) diff --git a/docs/Model/AgencyCommission.md b/docs/Model/AgencyCommission.md new file mode 100644 index 0000000..d3f9b81 --- /dev/null +++ b/docs/Model/AgencyCommission.md @@ -0,0 +1,14 @@ +# # AgencyCommission + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commission_time** | **int** | Commission Time. (unix timestamp) | [optional] +**user_id** | **int** | User ID | [optional] +**group_name** | **string** | Group name | [optional] +**commission_amount** | **string** | Commission Amount | [optional] +**commission_asset** | **string** | Commission Asset | [optional] +**source** | **string** | Source. SPOT - SPOT Rebate, FUTURES - Futures Rebate | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AgencyCommissionHistory.md b/docs/Model/AgencyCommissionHistory.md new file mode 100644 index 0000000..7490723 --- /dev/null +++ b/docs/Model/AgencyCommissionHistory.md @@ -0,0 +1,11 @@ +# # AgencyCommissionHistory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_pair** | **string** | Currency pair | [optional] +**total** | **int** | Total | [optional] +**list** | [**\GateApi\Model\AgencyCommission[]**](AgencyCommission.md) | List of comission history | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AgencyTransaction.md b/docs/Model/AgencyTransaction.md new file mode 100644 index 0000000..b653bcc --- /dev/null +++ b/docs/Model/AgencyTransaction.md @@ -0,0 +1,17 @@ +# # AgencyTransaction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transaction_time** | **int** | Transaction Time. (unix timestamp) | [optional] +**user_id** | **int** | User ID | [optional] +**group_name** | **string** | Group name | [optional] +**fee** | **string** | Fee | [optional] +**fee_asset** | **string** | Fee currency | [optional] +**currency_pair** | **string** | Currency pair | [optional] +**amount** | **string** | Commission Amount | [optional] +**amount_asset** | **string** | Commission Asset | [optional] +**source** | **string** | Source. SPOT - SPOT Rebate, FUTURES - Futures Rebate | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AgencyTransactionHistory.md b/docs/Model/AgencyTransactionHistory.md new file mode 100644 index 0000000..e332f9e --- /dev/null +++ b/docs/Model/AgencyTransactionHistory.md @@ -0,0 +1,11 @@ +# # AgencyTransactionHistory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_pair** | **string** | Currency pair | [optional] +**total** | **int** | Total | [optional] +**list** | [**\GateApi\Model\AgencyTransaction[]**](AgencyTransaction.md) | List of transaction history | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BatchOrder.md b/docs/Model/BatchOrder.md index 0a70556..f39d1f2 100644 --- a/docs/Model/BatchOrder.md +++ b/docs/Model/BatchOrder.md @@ -15,13 +15,13 @@ Name | Type | Description | Notes **update_time_ms** | **int** | Last modification time of order (in milliseconds) | [optional] [readonly] **status** | **string** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] **currency_pair** | **string** | Currency pair | [optional] -**type** | **string** | Order type. limit - limit order | [optional] [default to 'limit'] +**type** | **string** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] **account** | **string** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account | [optional] [default to 'spot'] **side** | **string** | Order side | [optional] **amount** | **string** | Trade amount | [optional] **price** | **string** | Order price | [optional] **time_in_force** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none | [optional] [default to 'gtc'] -**iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional] +**iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported. | [optional] **auto_borrow** | **bool** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional] **auto_repay** | **bool** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. | [optional] **left** | **string** | Amount left to fill | [optional] [readonly] diff --git a/docs/Model/Contract.md b/docs/Model/Contract.md index 13350fe..260e25f 100644 --- a/docs/Model/Contract.md +++ b/docs/Model/Contract.md @@ -36,5 +36,7 @@ Name | Type | Description | Notes **config_change_time** | **double** | Last changed time of configuration | [optional] **in_delisting** | **bool** | Contract is delisting | [optional] **orders_limit** | **int** | Maximum number of open orders | [optional] +**enable_bonus** | **bool** | Whether bouns is enabled | [optional] +**enable_credit** | **bool** | Whether portfolio margin account is enabled | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CrossMarginAccount.md b/docs/Model/CrossMarginAccount.md index df81b8e..a76f4cb 100644 --- a/docs/Model/CrossMarginAccount.md +++ b/docs/Model/CrossMarginAccount.md @@ -17,5 +17,6 @@ Name | Type | Description | Notes **total_initial_margin_rate** | **string** | Total initial margin rate | [optional] **total_maintenance_margin_rate** | **string** | Total maintenance margin rate | [optional] **total_available_margin** | **string** | Total available margin | [optional] +**portfolio_margin_total** | **string** | Total amount of the portfolio margin account | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CrossMarginAccountBook.md b/docs/Model/CrossMarginAccountBook.md index fa7fb67..291130e 100644 --- a/docs/Model/CrossMarginAccountBook.md +++ b/docs/Model/CrossMarginAccountBook.md @@ -9,6 +9,6 @@ Name | Type | Description | Notes **currency** | **string** | Currency changed | [optional] **change** | **string** | Amount changed. Positive value means transferring in, while negative out | [optional] **balance** | **string** | Balance after change | [optional] -**type** | **string** | Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type | [optional] +**type** | **string** | Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - interest: interest - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CrossMarginCurrency.md b/docs/Model/CrossMarginCurrency.md index c6eeef1..2d62162 100644 --- a/docs/Model/CrossMarginCurrency.md +++ b/docs/Model/CrossMarginCurrency.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Currency name | [optional] -**rate** | **string** | Loan rate | [optional] +**rate** | **string** | Minimum lending rate (hourly rate) | [optional] **prec** | **string** | Currency precision | [optional] **discount** | **string** | Currency value discount, which is used in total value calculation | [optional] **min_borrow_amount** | **string** | Minimum currency borrow amount. Unit is currency itself | [optional] diff --git a/docs/Model/FundingBookItem.md b/docs/Model/FundingBookItem.md index 3932191..2fc1673 100644 --- a/docs/Model/FundingBookItem.md +++ b/docs/Model/FundingBookItem.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**rate** | **string** | Loan rate | [optional] +**rate** | **string** | Loan rate (daily rate) | [optional] **amount** | **string** | Borrowable amount | [optional] **days** | **int** | The number of days till the loan repayment's dateline | [optional] diff --git a/docs/Model/FuturesAccount.md b/docs/Model/FuturesAccount.md index 30fe7fa..3e5daa8 100644 --- a/docs/Model/FuturesAccount.md +++ b/docs/Model/FuturesAccount.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **unrealised_pnl** | **string** | Unrealized PNL | [optional] **position_margin** | **string** | Position margin | [optional] **order_margin** | **string** | Order margin of unfinished orders | [optional] -**available** | **string** | The available balance for transferring or trading | [optional] +**available** | **string** | The available balance for transferring or trading(including bonus. Bonus can't be be withdrawn. The transfer amount needs to deduct the bonus) | [optional] **point** | **string** | POINT amount | [optional] **currency** | **string** | Settle currency | [optional] **in_dual_mode** | **bool** | Whether dual mode is enabled | [optional] diff --git a/docs/Model/FuturesAutoDeleverage.md b/docs/Model/FuturesAutoDeleverage.md new file mode 100644 index 0000000..8a3c3de --- /dev/null +++ b/docs/Model/FuturesAutoDeleverage.md @@ -0,0 +1,18 @@ +# # FuturesAutoDeleverage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **int** | Automatic deleveraging time | [optional] [readonly] +**user** | **int** | User ID | [optional] [readonly] +**order_id** | **int** | Order ID. Order IDs before 2023-02-20 are null | [optional] [readonly] +**contract** | **string** | Futures contract | [optional] [readonly] +**leverage** | **string** | Position leverage | [optional] [readonly] +**cross_leverage_limit** | **string** | Cross margin leverage(valid only when `leverage` is 0) | [optional] [readonly] +**entry_price** | **string** | Average entry price | [optional] [readonly] +**fill_price** | **string** | Average fill price | [optional] [readonly] +**trade_size** | **int** | Trading size | [optional] [readonly] +**position_size** | **int** | Positions after auto-deleveraging | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FuturesCandlestick.md b/docs/Model/FuturesCandlestick.md index 298ba54..2fe3111 100644 --- a/docs/Model/FuturesCandlestick.md +++ b/docs/Model/FuturesCandlestick.md @@ -10,5 +10,6 @@ Name | Type | Description | Notes **h** | **string** | Highest price (quote currency) | [optional] **l** | **string** | Lowest price (quote currency) | [optional] **o** | **string** | Open price (quote currency) | [optional] +**sum** | **string** | Trading volume (unit: Quote currency) | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LedgerRecord.md b/docs/Model/LedgerRecord.md index d50e937..492848e 100644 --- a/docs/Model/LedgerRecord.md +++ b/docs/Model/LedgerRecord.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | Record ID | [optional] [readonly] **txid** | **string** | Hash record of the withdrawal | [optional] [readonly] +**withdraw_order_id** | **string** | Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional] **timestamp** | **string** | Operation time | [optional] [readonly] **amount** | **string** | Currency amount | **currency** | **string** | Currency name | diff --git a/docs/Model/Loan.md b/docs/Model/Loan.md index 5b6386d..b17fd40 100644 --- a/docs/Model/Loan.md +++ b/docs/Model/Loan.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **status** | **string** | Loan status open - not fully loaned loaned - all loaned out for lending loan; loaned in for borrowing side finished - loan is finished, either being all repaid or cancelled by the lender auto_repaid - automatically repaid by the system | [optional] [readonly] **side** | **string** | Loan side | **currency** | **string** | Loan currency | -**rate** | **string** | Loan rate. Only rates in [0.0002, 0.002] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set | [optional] +**rate** | **string** | Loan rate. Only rates in [0.0001, 0.01] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set | [optional] **amount** | **string** | Loan amount | **days** | **int** | Loan days. Only 10 is supported for now | [optional] **auto_renew** | **bool** | Whether to auto renew the loan upon expiration | [optional] [default to false] diff --git a/docs/Model/Order.md b/docs/Model/Order.md index 9ec662b..b68f49c 100644 --- a/docs/Model/Order.md +++ b/docs/Model/Order.md @@ -5,25 +5,26 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | Order ID | [optional] [readonly] -**text** | **string** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional] +**text** | **string** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 | [optional] **create_time** | **string** | Creation time of order | [optional] [readonly] **update_time** | **string** | Last modification time of order | [optional] [readonly] **create_time_ms** | **int** | Creation time of order (in milliseconds) | [optional] [readonly] **update_time_ms** | **int** | Last modification time of order (in milliseconds) | [optional] [readonly] **status** | **string** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] **currency_pair** | **string** | Currency pair | -**type** | **string** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] +**type** | **string** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] **account** | **string** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account. Portfolio margin account must set to `cross-margin` | [optional] [default to 'spot'] **side** | **string** | Order side | **amount** | **string** | When `type` is limit, it refers to base currency. For instance, `BTC_USDT` means `BTC` When `type` is `market`, it refers to different currency according to `side` - `side` : `buy` means quote currency, `BTC_USDT` means `USDT` - `side` : `sell` means base currency,`BTC_USDT` means `BTC` | **price** | **string** | Price can't be empty when `type`= `limit` | [optional] **time_in_force** | **string** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none Only `ioc` and `fok` are supported when `type`=`market` | [optional] [default to 'gtc'] -**iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional] +**iceberg** | **string** | Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported. | [optional] **auto_borrow** | **bool** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional] **auto_repay** | **bool** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. | [optional] **left** | **string** | Amount left to fill | [optional] [readonly] **fill_price** | **string** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional] [readonly] **filled_total** | **string** | Total filled in quote currency | [optional] [readonly] +**avg_deal_price** | **string** | Average fill price | [optional] [readonly] **fee** | **string** | Fee deducted | [optional] [readonly] **fee_currency** | **string** | Fee currency unit | [optional] [readonly] **point_fee** | **string** | Points used to deduct fee | [optional] [readonly] diff --git a/docs/Model/OrderPatch.md b/docs/Model/OrderPatch.md new file mode 100644 index 0000000..94f2c25 --- /dev/null +++ b/docs/Model/OrderPatch.md @@ -0,0 +1,10 @@ +# # OrderPatch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **string** | New order amount. `amount` and `price` must specify one of them | [optional] +**price** | **string** | New order price. `amount` and `Price` must specify one of them\" | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpotFee.md b/docs/Model/SpotFee.md new file mode 100644 index 0000000..a330400 --- /dev/null +++ b/docs/Model/SpotFee.md @@ -0,0 +1,17 @@ +# # SpotFee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | User ID | [optional] +**taker_fee** | **string** | taker fee rate | [optional] +**maker_fee** | **string** | maker fee rate | [optional] +**gt_discount** | **bool** | If GT deduction is enabled | [optional] +**gt_taker_fee** | **string** | Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional] +**gt_maker_fee** | **string** | Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional] +**loan_fee** | **string** | Loan fee rate of margin lending | [optional] +**point_type** | **string** | Point type. 0 - Initial version. 1 - new version since 202009 | [optional] +**currency_pair** | **string** | Currency pair | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubAccount.md b/docs/Model/SubAccount.md index 0b60cf1..d60ea2b 100644 --- a/docs/Model/SubAccount.md +++ b/docs/Model/SubAccount.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **password** | **string** | The sub-account's password. (Default: the same as main account's password) | [optional] **email** | **string** | The sub-account's email address. (Default: the same as main account's email address) | [optional] **state** | **int** | State: 1-normal, 2-locked\" | [optional] [readonly] +**type** | **int** | Type: 1-Sub-account | [optional] **user_id** | **int** | The user id of the sub-account | [optional] [readonly] **create_time** | **int** | Created time | [optional] [readonly] diff --git a/src/Api/FuturesApi.php b/src/Api/FuturesApi.php index 259564d..5350314 100644 --- a/src/Api/FuturesApi.php +++ b/src/Api/FuturesApi.php @@ -9433,50 +9433,50 @@ protected function getMyTradesRequest($associative_array) } /** - * Operation listPositionClose + * Operation getMyTradesWithTimeRange * - * List position close history + * List personal trading history by time range * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \GateApi\Model\PositionClose[] + * @return \GateApi\Model\MyFuturesTrade[] */ - public function listPositionClose($associative_array) + public function getMyTradesWithTimeRange($associative_array) { - list($response) = $this->listPositionCloseWithHttpInfo($associative_array); + list($response) = $this->getMyTradesWithTimeRangeWithHttpInfo($associative_array); return $response; } /** - * Operation listPositionCloseWithHttpInfo + * Operation getMyTradesWithTimeRangeWithHttpInfo * - * List position close history + * List personal trading history by time range * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \GateApi\Model\PositionClose[], HTTP status code, HTTP response headers (array of strings) + * @return array of \GateApi\Model\MyFuturesTrade[], HTTP status code, HTTP response headers (array of strings) */ - public function listPositionCloseWithHttpInfo($associative_array) + public function getMyTradesWithTimeRangeWithHttpInfo($associative_array) { - $request = $this->listPositionCloseRequest($associative_array); + $request = $this->getMyTradesWithTimeRangeRequest($associative_array); $options = $this->createHttpClientOption(); try { @@ -9502,7 +9502,7 @@ public function listPositionCloseWithHttpInfo($associative_array) ); } - $returnType = '\GateApi\Model\PositionClose[]'; + $returnType = '\GateApi\Model\MyFuturesTrade[]'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -9518,25 +9518,25 @@ public function listPositionCloseWithHttpInfo($associative_array) } /** - * Operation listPositionCloseAsync + * Operation getMyTradesWithTimeRangeAsync * - * List position close history + * List personal trading history by time range * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listPositionCloseAsync($associative_array) + public function getMyTradesWithTimeRangeAsync($associative_array) { - return $this->listPositionCloseAsyncWithHttpInfo($associative_array) + return $this->getMyTradesWithTimeRangeAsyncWithHttpInfo($associative_array) ->then( function ($response) { return $response[0]; @@ -9545,26 +9545,26 @@ function ($response) { } /** - * Operation listPositionCloseAsyncWithHttpInfo + * Operation getMyTradesWithTimeRangeAsyncWithHttpInfo * - * List position close history + * List personal trading history by time range * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listPositionCloseAsyncWithHttpInfo($associative_array) + public function getMyTradesWithTimeRangeAsyncWithHttpInfo($associative_array) { - $returnType = '\GateApi\Model\PositionClose[]'; - $request = $this->listPositionCloseRequest($associative_array); + $returnType = '\GateApi\Model\MyFuturesTrade[]'; + $request = $this->getMyTradesWithTimeRangeRequest($associative_array); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9601,49 +9601,49 @@ function ($exception) { } /** - * Create request for operation 'listPositionClose' + * Create request for operation 'getMyTradesWithTimeRange' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) - * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $offset List offset, starting from 0 (optional, default to 0) * @param int $from Start timestamp (optional) * @param int $to End timestamp (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listPositionCloseRequest($associative_array) + protected function getMyTradesWithTimeRangeRequest($associative_array) { // unbox the parameters from the associative array $settle = array_key_exists('settle', $associative_array) ? $associative_array['settle'] : null; $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; - $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; - $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; // verify the required parameter 'settle' is set if ($settle === null || (is_array($settle) && count($settle) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $settle when calling listPositionClose' + 'Missing the required parameter $settle when calling getMyTradesWithTimeRange' ); } if ($limit !== null && $limit > 1000) { - throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listPositionClose, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.getMyTradesWithTimeRange, must be smaller than or equal to 1000.'); } if ($limit !== null && $limit < 1) { - throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listPositionClose, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.getMyTradesWithTimeRange, must be bigger than or equal to 1.'); } if ($offset !== null && $offset < 0) { - throw new \InvalidArgumentException('invalid value for "$offset" when calling FuturesApi.listPositionClose, must be bigger than or equal to 0.'); + throw new \InvalidArgumentException('invalid value for "$offset" when calling FuturesApi.getMyTradesWithTimeRange, must be bigger than or equal to 0.'); } - $resourcePath = '/futures/{settle}/position_close'; + $resourcePath = '/futures/{settle}/my_trades_timerange'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9663,50 +9663,50 @@ protected function listPositionCloseRequest($associative_array) } // query params - if ($limit !== null) { - if('form' === 'form' && is_array($limit)) { - foreach($limit as $key => $value) { + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { $queryParams[$key] = $value; } } else { - $queryParams['limit'] = $limit; + $queryParams['from'] = $from; } } // query params - if ($offset !== null) { - if('form' === 'form' && is_array($offset)) { - foreach($offset as $key => $value) { + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { $queryParams[$key] = $value; } } else { - $queryParams['offset'] = $offset; + $queryParams['to'] = $to; } } // query params - if ($from !== null) { - if('form' === 'form' && is_array($from)) { - foreach($from as $key => $value) { + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { $queryParams[$key] = $value; } } else { - $queryParams['from'] = $from; + $queryParams['limit'] = $limit; } } // query params - if ($to !== null) { - if('form' === 'form' && is_array($to)) { - foreach($to as $key => $value) { + if ($offset !== null) { + if('form' === 'form' && is_array($offset)) { + foreach($offset as $key => $value) { $queryParams[$key] = $value; } } else { - $queryParams['to'] = $to; + $queryParams['offset'] = $offset; } } @@ -9787,46 +9787,50 @@ protected function listPositionCloseRequest($associative_array) } /** - * Operation listLiquidates + * Operation listPositionClose * - * List liquidation history + * List position close history * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $at Specify a liquidation timestamp (optional, default to 0) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \GateApi\Model\FuturesLiquidate[] + * @return \GateApi\Model\PositionClose[] */ - public function listLiquidates($associative_array) + public function listPositionClose($associative_array) { - list($response) = $this->listLiquidatesWithHttpInfo($associative_array); + list($response) = $this->listPositionCloseWithHttpInfo($associative_array); return $response; } /** - * Operation listLiquidatesWithHttpInfo + * Operation listPositionCloseWithHttpInfo * - * List liquidation history + * List position close history * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $at Specify a liquidation timestamp (optional, default to 0) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \GateApi\Model\FuturesLiquidate[], HTTP status code, HTTP response headers (array of strings) + * @return array of \GateApi\Model\PositionClose[], HTTP status code, HTTP response headers (array of strings) */ - public function listLiquidatesWithHttpInfo($associative_array) + public function listPositionCloseWithHttpInfo($associative_array) { - $request = $this->listLiquidatesRequest($associative_array); + $request = $this->listPositionCloseRequest($associative_array); $options = $this->createHttpClientOption(); try { @@ -9852,7 +9856,7 @@ public function listLiquidatesWithHttpInfo($associative_array) ); } - $returnType = '\GateApi\Model\FuturesLiquidate[]'; + $returnType = '\GateApi\Model\PositionClose[]'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -9868,23 +9872,25 @@ public function listLiquidatesWithHttpInfo($associative_array) } /** - * Operation listLiquidatesAsync + * Operation listPositionCloseAsync * - * List liquidation history + * List position close history * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $at Specify a liquidation timestamp (optional, default to 0) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listLiquidatesAsync($associative_array) + public function listPositionCloseAsync($associative_array) { - return $this->listLiquidatesAsyncWithHttpInfo($associative_array) + return $this->listPositionCloseAsyncWithHttpInfo($associative_array) ->then( function ($response) { return $response[0]; @@ -9893,24 +9899,26 @@ function ($response) { } /** - * Operation listLiquidatesAsyncWithHttpInfo + * Operation listPositionCloseAsyncWithHttpInfo * - * List liquidation history + * List position close history * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $at Specify a liquidation timestamp (optional, default to 0) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listLiquidatesAsyncWithHttpInfo($associative_array) + public function listPositionCloseAsyncWithHttpInfo($associative_array) { - $returnType = '\GateApi\Model\FuturesLiquidate[]'; - $request = $this->listLiquidatesRequest($associative_array); + $returnType = '\GateApi\Model\PositionClose[]'; + $request = $this->listPositionCloseRequest($associative_array); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9947,41 +9955,701 @@ function ($exception) { } /** - * Create request for operation 'listLiquidates' + * Create request for operation 'listPositionClose' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * * @param string $settle Settle currency (required) * @param string $contract Futures contract, return related data only if specified (optional) * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) - * @param int $at Specify a liquidation timestamp (optional, default to 0) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * @param int $from Start timestamp (optional) + * @param int $to End timestamp (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listLiquidatesRequest($associative_array) + protected function listPositionCloseRequest($associative_array) { // unbox the parameters from the associative array $settle = array_key_exists('settle', $associative_array) ? $associative_array['settle'] : null; $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; - $at = array_key_exists('at', $associative_array) ? $associative_array['at'] : 0; + $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; // verify the required parameter 'settle' is set if ($settle === null || (is_array($settle) && count($settle) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $settle when calling listLiquidates' + 'Missing the required parameter $settle when calling listPositionClose' ); } if ($limit !== null && $limit > 1000) { - throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listLiquidates, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listPositionClose, must be smaller than or equal to 1000.'); } if ($limit !== null && $limit < 1) { - throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listLiquidates, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listPositionClose, must be bigger than or equal to 1.'); + } + + if ($offset !== null && $offset < 0) { + throw new \InvalidArgumentException('invalid value for "$offset" when calling FuturesApi.listPositionClose, must be bigger than or equal to 0.'); } - $resourcePath = '/futures/{settle}/liquidates'; + $resourcePath = '/futures/{settle}/position_close'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($contract !== null) { + if('form' === 'form' && is_array($contract)) { + foreach($contract as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contract'] = $contract; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($offset !== null) { + if('form' === 'form' && is_array($offset)) { + foreach($offset as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['offset'] = $offset; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // path params + if ($settle !== null) { + $resourcePath = str_replace( + '{' . 'settle' . '}', + ObjectSerializer::toPathValue($settle), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listLiquidates + * + * List liquidation history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $at Specify a liquidation timestamp (optional, default to 0) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FuturesLiquidate[] + */ + public function listLiquidates($associative_array) + { + list($response) = $this->listLiquidatesWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listLiquidatesWithHttpInfo + * + * List liquidation history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $at Specify a liquidation timestamp (optional, default to 0) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FuturesLiquidate[], HTTP status code, HTTP response headers (array of strings) + */ + public function listLiquidatesWithHttpInfo($associative_array) + { + $request = $this->listLiquidatesRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FuturesLiquidate[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listLiquidatesAsync + * + * List liquidation history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $at Specify a liquidation timestamp (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listLiquidatesAsync($associative_array) + { + return $this->listLiquidatesAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listLiquidatesAsyncWithHttpInfo + * + * List liquidation history + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $at Specify a liquidation timestamp (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listLiquidatesAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\FuturesLiquidate[]'; + $request = $this->listLiquidatesRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listLiquidates' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $at Specify a liquidation timestamp (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listLiquidatesRequest($associative_array) + { + // unbox the parameters from the associative array + $settle = array_key_exists('settle', $associative_array) ? $associative_array['settle'] : null; + $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $at = array_key_exists('at', $associative_array) ? $associative_array['at'] : 0; + + // verify the required parameter 'settle' is set + if ($settle === null || (is_array($settle) && count($settle) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $settle when calling listLiquidates' + ); + } + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listLiquidates, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listLiquidates, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/futures/{settle}/liquidates'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($contract !== null) { + if('form' === 'form' && is_array($contract)) { + foreach($contract as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contract'] = $contract; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($at !== null) { + if('form' === 'form' && is_array($at)) { + foreach($at as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['at'] = $at; + } + } + + // path params + if ($settle !== null) { + $resourcePath = str_replace( + '{' . 'settle' . '}', + ObjectSerializer::toPathValue($settle), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listAutoDeleverages + * + * List Auto-Deleveraging History + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $at Specify an auto-deleveraging timestamp (optional, default to 0) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\FuturesAutoDeleverage[] + */ + public function listAutoDeleverages($associative_array) + { + list($response) = $this->listAutoDeleveragesWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listAutoDeleveragesWithHttpInfo + * + * List Auto-Deleveraging History + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $at Specify an auto-deleveraging timestamp (optional, default to 0) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\FuturesAutoDeleverage[], HTTP status code, HTTP response headers (array of strings) + */ + public function listAutoDeleveragesWithHttpInfo($associative_array) + { + $request = $this->listAutoDeleveragesRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\FuturesAutoDeleverage[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation listAutoDeleveragesAsync + * + * List Auto-Deleveraging History + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $at Specify an auto-deleveraging timestamp (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listAutoDeleveragesAsync($associative_array) + { + return $this->listAutoDeleveragesAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listAutoDeleveragesAsyncWithHttpInfo + * + * List Auto-Deleveraging History + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $at Specify an auto-deleveraging timestamp (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listAutoDeleveragesAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\FuturesAutoDeleverage[]'; + $request = $this->listAutoDeleveragesRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listAutoDeleverages' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $settle Settle currency (required) + * @param string $contract Futures contract, return related data only if specified (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $at Specify an auto-deleveraging timestamp (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listAutoDeleveragesRequest($associative_array) + { + // unbox the parameters from the associative array + $settle = array_key_exists('settle', $associative_array) ? $associative_array['settle'] : null; + $contract = array_key_exists('contract', $associative_array) ? $associative_array['contract'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $at = array_key_exists('at', $associative_array) ? $associative_array['at'] : 0; + + // verify the required parameter 'settle' is set + if ($settle === null || (is_array($settle) && count($settle) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $settle when calling listAutoDeleverages' + ); + } + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listAutoDeleverages, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FuturesApi.listAutoDeleverages, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/futures/{settle}/auto_deleverages'; $formParams = []; $queryParams = []; $headerParams = []; diff --git a/src/Api/MarginApi.php b/src/Api/MarginApi.php index 3cfbf0f..7ee0a90 100644 --- a/src/Api/MarginApi.php +++ b/src/Api/MarginApi.php @@ -7834,7 +7834,7 @@ protected function listCrossMarginRepaymentsRequest($associative_array) /** * Operation repayCrossMarginLoan * - * When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first + * Cross margin repayments * * @param \GateApi\Model\CrossMarginRepayRequest $cross_margin_repay_request cross_margin_repay_request (required) * @@ -7851,7 +7851,7 @@ public function repayCrossMarginLoan($cross_margin_repay_request) /** * Operation repayCrossMarginLoanWithHttpInfo * - * When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first + * Cross margin repayments * * @param \GateApi\Model\CrossMarginRepayRequest $cross_margin_repay_request (required) * @@ -7905,7 +7905,7 @@ public function repayCrossMarginLoanWithHttpInfo($cross_margin_repay_request) /** * Operation repayCrossMarginLoanAsync * - * When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first + * Cross margin repayments * * @param \GateApi\Model\CrossMarginRepayRequest $cross_margin_repay_request (required) * @@ -7925,7 +7925,7 @@ function ($response) { /** * Operation repayCrossMarginLoanAsyncWithHttpInfo * - * When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first + * Cross margin repayments * * @param \GateApi\Model\CrossMarginRepayRequest $cross_margin_repay_request (required) * diff --git a/src/Api/RebateApi.php b/src/Api/RebateApi.php new file mode 100644 index 0000000..387dcb5 --- /dev/null +++ b/src/Api/RebateApi.php @@ -0,0 +1,836 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $host_index; + } + + /** + * Set the host index + * + * @param int Host index (required) + */ + public function setHostIndex($host_index) + { + $this->hostIndex = $host_index; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation agencyTransactionHistory + * + * The broker obtains the transaction history of the recommended user + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency_pair Specify the currency pair, if not specified, return all currency pairs (optional) + * @param string $user_id User ID. If not specified, all user records will be returned (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\AgencyTransactionHistory[] + */ + public function agencyTransactionHistory($associative_array) + { + list($response) = $this->agencyTransactionHistoryWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation agencyTransactionHistoryWithHttpInfo + * + * The broker obtains the transaction history of the recommended user + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency_pair Specify the currency pair, if not specified, return all currency pairs (optional) + * @param string $user_id User ID. If not specified, all user records will be returned (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\AgencyTransactionHistory[], HTTP status code, HTTP response headers (array of strings) + */ + public function agencyTransactionHistoryWithHttpInfo($associative_array) + { + $request = $this->agencyTransactionHistoryRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\AgencyTransactionHistory[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation agencyTransactionHistoryAsync + * + * The broker obtains the transaction history of the recommended user + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency_pair Specify the currency pair, if not specified, return all currency pairs (optional) + * @param string $user_id User ID. If not specified, all user records will be returned (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function agencyTransactionHistoryAsync($associative_array) + { + return $this->agencyTransactionHistoryAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation agencyTransactionHistoryAsyncWithHttpInfo + * + * The broker obtains the transaction history of the recommended user + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency_pair Specify the currency pair, if not specified, return all currency pairs (optional) + * @param string $user_id User ID. If not specified, all user records will be returned (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function agencyTransactionHistoryAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\AgencyTransactionHistory[]'; + $request = $this->agencyTransactionHistoryRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'agencyTransactionHistory' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency_pair Specify the currency pair, if not specified, return all currency pairs (optional) + * @param string $user_id User ID. If not specified, all user records will be returned (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function agencyTransactionHistoryRequest($associative_array) + { + // unbox the parameters from the associative array + $currency_pair = array_key_exists('currency_pair', $associative_array) ? $associative_array['currency_pair'] : null; + $user_id = array_key_exists('user_id', $associative_array) ? $associative_array['user_id'] : null; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling RebateApi.agencyTransactionHistory, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling RebateApi.agencyTransactionHistory, must be bigger than or equal to 1.'); + } + + if ($offset !== null && $offset < 0) { + throw new \InvalidArgumentException('invalid value for "$offset" when calling RebateApi.agencyTransactionHistory, must be bigger than or equal to 0.'); + } + + + $resourcePath = '/rebate/agency/transaction_history'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($currency_pair !== null) { + if('form' === 'form' && is_array($currency_pair)) { + foreach($currency_pair as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency_pair'] = $currency_pair; + } + } + + // query params + if ($user_id !== null) { + if('form' === 'form' && is_array($user_id)) { + foreach($user_id as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['user_id'] = $user_id; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($offset !== null) { + if('form' === 'form' && is_array($offset)) { + foreach($offset as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['offset'] = $offset; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation agencyCommissionsHistory + * + * The broker obtains the commission history of the recommended user + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Filter by currency. Return all currency records if not specified (optional) + * @param string $user_id User ID. If not specified, all user records will be returned (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\AgencyCommissionHistory[] + */ + public function agencyCommissionsHistory($associative_array) + { + list($response) = $this->agencyCommissionsHistoryWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation agencyCommissionsHistoryWithHttpInfo + * + * The broker obtains the commission history of the recommended user + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Filter by currency. Return all currency records if not specified (optional) + * @param string $user_id User ID. If not specified, all user records will be returned (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\AgencyCommissionHistory[], HTTP status code, HTTP response headers (array of strings) + */ + public function agencyCommissionsHistoryWithHttpInfo($associative_array) + { + $request = $this->agencyCommissionsHistoryRequest($associative_array); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\AgencyCommissionHistory[]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation agencyCommissionsHistoryAsync + * + * The broker obtains the commission history of the recommended user + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Filter by currency. Return all currency records if not specified (optional) + * @param string $user_id User ID. If not specified, all user records will be returned (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function agencyCommissionsHistoryAsync($associative_array) + { + return $this->agencyCommissionsHistoryAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation agencyCommissionsHistoryAsyncWithHttpInfo + * + * The broker obtains the commission history of the recommended user + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Filter by currency. Return all currency records if not specified (optional) + * @param string $user_id User ID. If not specified, all user records will be returned (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function agencyCommissionsHistoryAsyncWithHttpInfo($associative_array) + { + $returnType = '\GateApi\Model\AgencyCommissionHistory[]'; + $request = $this->agencyCommissionsHistoryRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'agencyCommissionsHistory' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $currency Filter by currency. Return all currency records if not specified (optional) + * @param string $user_id User ID. If not specified, all user records will be returned (optional) + * @param int $from Time range beginning, default to 7 days before current time (optional) + * @param int $to Time range ending, default to current time (optional) + * @param int $limit Maximum number of records to be returned in a single list (optional, default to 100) + * @param int $offset List offset, starting from 0 (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function agencyCommissionsHistoryRequest($associative_array) + { + // unbox the parameters from the associative array + $currency = array_key_exists('currency', $associative_array) ? $associative_array['currency'] : null; + $user_id = array_key_exists('user_id', $associative_array) ? $associative_array['user_id'] : null; + $from = array_key_exists('from', $associative_array) ? $associative_array['from'] : null; + $to = array_key_exists('to', $associative_array) ? $associative_array['to'] : null; + $limit = array_key_exists('limit', $associative_array) ? $associative_array['limit'] : 100; + $offset = array_key_exists('offset', $associative_array) ? $associative_array['offset'] : 0; + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling RebateApi.agencyCommissionsHistory, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling RebateApi.agencyCommissionsHistory, must be bigger than or equal to 1.'); + } + + if ($offset !== null && $offset < 0) { + throw new \InvalidArgumentException('invalid value for "$offset" when calling RebateApi.agencyCommissionsHistory, must be bigger than or equal to 0.'); + } + + + $resourcePath = '/rebate/agency/commission_history'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($currency !== null) { + if('form' === 'form' && is_array($currency)) { + foreach($currency as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency'] = $currency; + } + } + + // query params + if ($user_id !== null) { + if('form' === 'form' && is_array($user_id)) { + foreach($user_id as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['user_id'] = $user_id; + } + } + + // query params + if ($from !== null) { + if('form' === 'form' && is_array($from)) { + foreach($from as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['from'] = $from; + } + } + + // query params + if ($to !== null) { + if('form' === 'form' && is_array($to)) { + foreach($to as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['to'] = $to; + } + } + + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + + // query params + if ($offset !== null) { + if('form' === 'form' && is_array($offset)) { + foreach($offset as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['offset'] = $offset; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/SpotApi.php b/src/Api/SpotApi.php index d488135..6acaedd 100644 --- a/src/Api/SpotApi.php +++ b/src/Api/SpotApi.php @@ -777,7 +777,7 @@ protected function listCurrencyPairsRequest() /** * Operation getCurrencyPair * - * Get details of a specifc order + * Get details of a specifc currency pair * * @param string $currency_pair Currency pair (required) * @@ -794,7 +794,7 @@ public function getCurrencyPair($currency_pair) /** * Operation getCurrencyPairWithHttpInfo * - * Get details of a specifc order + * Get details of a specifc currency pair * * @param string $currency_pair Currency pair (required) * @@ -848,7 +848,7 @@ public function getCurrencyPairWithHttpInfo($currency_pair) /** * Operation getCurrencyPairAsync * - * Get details of a specifc order + * Get details of a specifc currency pair * * @param string $currency_pair Currency pair (required) * @@ -868,7 +868,7 @@ function ($response) { /** * Operation getCurrencyPairAsyncWithHttpInfo * - * Get details of a specifc order + * Get details of a specifc currency pair * * @param string $currency_pair Currency pair (required) * @@ -2538,6 +2538,249 @@ protected function getFeeRequest($associative_array) ); } + /** + * Operation getBatchSpotFee + * + * Query a batch of user trading fee rates + * + * @param string $currency_pairs A request can only query up to 50 currency pairs (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return map[string,\GateApi\Model\SpotFee] + */ + public function getBatchSpotFee($currency_pairs) + { + list($response) = $this->getBatchSpotFeeWithHttpInfo($currency_pairs); + return $response; + } + + /** + * Operation getBatchSpotFeeWithHttpInfo + * + * Query a batch of user trading fee rates + * + * @param string $currency_pairs A request can only query up to 50 currency pairs (required) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of map[string,\GateApi\Model\SpotFee], HTTP status code, HTTP response headers (array of strings) + */ + public function getBatchSpotFeeWithHttpInfo($currency_pairs) + { + $request = $this->getBatchSpotFeeRequest($currency_pairs); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = 'map[string,\GateApi\Model\SpotFee]'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation getBatchSpotFeeAsync + * + * Query a batch of user trading fee rates + * + * @param string $currency_pairs A request can only query up to 50 currency pairs (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBatchSpotFeeAsync($currency_pairs) + { + return $this->getBatchSpotFeeAsyncWithHttpInfo($currency_pairs) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getBatchSpotFeeAsyncWithHttpInfo + * + * Query a batch of user trading fee rates + * + * @param string $currency_pairs A request can only query up to 50 currency pairs (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBatchSpotFeeAsyncWithHttpInfo($currency_pairs) + { + $returnType = 'map[string,\GateApi\Model\SpotFee]'; + $request = $this->getBatchSpotFeeRequest($currency_pairs); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getBatchSpotFee' + * + * @param string $currency_pairs A request can only query up to 50 currency pairs (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getBatchSpotFeeRequest($currency_pairs) + { + // verify the required parameter 'currency_pairs' is set + if ($currency_pairs === null || (is_array($currency_pairs) && count($currency_pairs) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $currency_pairs when calling getBatchSpotFee' + ); + } + + $resourcePath = '/spot/batch_fee'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($currency_pairs !== null) { + if('form' === 'form' && is_array($currency_pairs)) { + foreach($currency_pairs as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency_pairs'] = $currency_pairs; + } + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listSpotAccounts * @@ -5262,6 +5505,300 @@ protected function cancelOrderRequest($order_id, $currency_pair, $account = null ); } + /** + * Operation amendOrder + * + * Amend an order + * + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) + * @param string $currency_pair Currency pair (required) + * @param \GateApi\Model\OrderPatch $order_patch order_patch (required) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \GateApi\Model\Order + */ + public function amendOrder($order_id, $currency_pair, $order_patch, $account = null) + { + list($response) = $this->amendOrderWithHttpInfo($order_id, $currency_pair, $order_patch, $account); + return $response; + } + + /** + * Operation amendOrderWithHttpInfo + * + * Amend an order + * + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) + * @param string $currency_pair Currency pair (required) + * @param \GateApi\Model\OrderPatch $order_patch (required) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * + * @throws \GateApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \GateApi\Model\Order, HTTP status code, HTTP response headers (array of strings) + */ + public function amendOrderWithHttpInfo($order_id, $currency_pair, $order_patch, $account = null) + { + $request = $this->amendOrderRequest($order_id, $currency_pair, $order_patch, $account); + + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null; + if ($responseBody !== null) { + $gateError = json_decode($responseBody, true); + if ($gateError !== null && isset($gateError['label'])) { + throw new GateApiException( + $gateError, + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + } + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $responseBody + ); + } + + $returnType = '\GateApi\Model\Order'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + /** + * Operation amendOrderAsync + * + * Amend an order + * + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) + * @param string $currency_pair Currency pair (required) + * @param \GateApi\Model\OrderPatch $order_patch (required) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function amendOrderAsync($order_id, $currency_pair, $order_patch, $account = null) + { + return $this->amendOrderAsyncWithHttpInfo($order_id, $currency_pair, $order_patch, $account) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation amendOrderAsyncWithHttpInfo + * + * Amend an order + * + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) + * @param string $currency_pair Currency pair (required) + * @param \GateApi\Model\OrderPatch $order_patch (required) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function amendOrderAsyncWithHttpInfo($order_id, $currency_pair, $order_patch, $account = null) + { + $returnType = '\GateApi\Model\Order'; + $request = $this->amendOrderRequest($order_id, $currency_pair, $order_patch, $account); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'amendOrder' + * + * @param string $order_id Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. (required) + * @param string $currency_pair Currency pair (required) + * @param \GateApi\Model\OrderPatch $order_patch (required) + * @param string $account Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function amendOrderRequest($order_id, $currency_pair, $order_patch, $account = null) + { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling amendOrder' + ); + } + // verify the required parameter 'currency_pair' is set + if ($currency_pair === null || (is_array($currency_pair) && count($currency_pair) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $currency_pair when calling amendOrder' + ); + } + // verify the required parameter 'order_patch' is set + if ($order_patch === null || (is_array($order_patch) && count($order_patch) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_patch when calling amendOrder' + ); + } + + $resourcePath = '/spot/orders/{order_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($currency_pair !== null) { + if('form' === 'form' && is_array($currency_pair)) { + foreach($currency_pair as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['currency_pair'] = $currency_pair; + } + } + + // query params + if ($account !== null) { + if('form' === 'form' && is_array($account)) { + foreach($account as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['account'] = $account; + } + } + + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'order_id' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($order_patch)) { + $_tempBody = $order_patch; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Gate APIv4 authentication + $signHeaders = $this->config->buildSignHeaders('PATCH', $resourcePath, $queryParams, $httpBody); + $headers = array_merge($headers, $signHeaders); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listMyTrades * diff --git a/src/Api/SubAccountApi.php b/src/Api/SubAccountApi.php index 53af93d..3473c09 100644 --- a/src/Api/SubAccountApi.php +++ b/src/Api/SubAccountApi.php @@ -2047,16 +2047,15 @@ protected function deleteSubAccountKeysRequest($user_id, $key) * * Lock the sub-account * - * @param int $user_id The user id of the sub-account (required) - * @param object $body body (required) + * @param int $user_id The user id of the sub-account (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function lockSubAccount($user_id, $body) + public function lockSubAccount($user_id) { - $this->lockSubAccountWithHttpInfo($user_id, $body); + $this->lockSubAccountWithHttpInfo($user_id); } /** @@ -2064,16 +2063,15 @@ public function lockSubAccount($user_id, $body) * * Lock the sub-account * - * @param int $user_id The user id of the sub-account (required) - * @param object $body (required) + * @param int $user_id The user id of the sub-account (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function lockSubAccountWithHttpInfo($user_id, $body) + public function lockSubAccountWithHttpInfo($user_id) { - $request = $this->lockSubAccountRequest($user_id, $body); + $request = $this->lockSubAccountRequest($user_id); $options = $this->createHttpClientOption(); try { @@ -2107,15 +2105,14 @@ public function lockSubAccountWithHttpInfo($user_id, $body) * * Lock the sub-account * - * @param int $user_id The user id of the sub-account (required) - * @param object $body (required) + * @param int $user_id The user id of the sub-account (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function lockSubAccountAsync($user_id, $body) + public function lockSubAccountAsync($user_id) { - return $this->lockSubAccountAsyncWithHttpInfo($user_id, $body) + return $this->lockSubAccountAsyncWithHttpInfo($user_id) ->then( function ($response) { return $response[0]; @@ -2128,16 +2125,15 @@ function ($response) { * * Lock the sub-account * - * @param int $user_id The user id of the sub-account (required) - * @param object $body (required) + * @param int $user_id The user id of the sub-account (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function lockSubAccountAsyncWithHttpInfo($user_id, $body) + public function lockSubAccountAsyncWithHttpInfo($user_id) { $returnType = ''; - $request = $this->lockSubAccountRequest($user_id, $body); + $request = $this->lockSubAccountRequest($user_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2165,13 +2161,12 @@ function ($exception) { /** * Create request for operation 'lockSubAccount' * - * @param int $user_id The user id of the sub-account (required) - * @param object $body (required) + * @param int $user_id The user id of the sub-account (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function lockSubAccountRequest($user_id, $body) + protected function lockSubAccountRequest($user_id) { // verify the required parameter 'user_id' is set if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { @@ -2179,12 +2174,6 @@ protected function lockSubAccountRequest($user_id, $body) 'Missing the required parameter $user_id when calling lockSubAccount' ); } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling lockSubAccount' - ); - } $resourcePath = '/sub_accounts/{user_id}/lock'; $formParams = []; @@ -2204,9 +2193,6 @@ protected function lockSubAccountRequest($user_id, $body) // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2215,7 +2201,7 @@ protected function lockSubAccountRequest($user_id, $body) } else { $headers = $this->headerSelector->selectHeaders( [], - ['application/json'] + [] ); } @@ -2277,16 +2263,15 @@ protected function lockSubAccountRequest($user_id, $body) * * Unlock the sub-account * - * @param int $user_id The user id of the sub-account (required) - * @param object $body body (required) + * @param int $user_id The user id of the sub-account (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function unlockSubAccount($user_id, $body) + public function unlockSubAccount($user_id) { - $this->unlockSubAccountWithHttpInfo($user_id, $body); + $this->unlockSubAccountWithHttpInfo($user_id); } /** @@ -2294,16 +2279,15 @@ public function unlockSubAccount($user_id, $body) * * Unlock the sub-account * - * @param int $user_id The user id of the sub-account (required) - * @param object $body (required) + * @param int $user_id The user id of the sub-account (required) * * @throws \GateApi\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function unlockSubAccountWithHttpInfo($user_id, $body) + public function unlockSubAccountWithHttpInfo($user_id) { - $request = $this->unlockSubAccountRequest($user_id, $body); + $request = $this->unlockSubAccountRequest($user_id); $options = $this->createHttpClientOption(); try { @@ -2337,15 +2321,14 @@ public function unlockSubAccountWithHttpInfo($user_id, $body) * * Unlock the sub-account * - * @param int $user_id The user id of the sub-account (required) - * @param object $body (required) + * @param int $user_id The user id of the sub-account (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function unlockSubAccountAsync($user_id, $body) + public function unlockSubAccountAsync($user_id) { - return $this->unlockSubAccountAsyncWithHttpInfo($user_id, $body) + return $this->unlockSubAccountAsyncWithHttpInfo($user_id) ->then( function ($response) { return $response[0]; @@ -2358,16 +2341,15 @@ function ($response) { * * Unlock the sub-account * - * @param int $user_id The user id of the sub-account (required) - * @param object $body (required) + * @param int $user_id The user id of the sub-account (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function unlockSubAccountAsyncWithHttpInfo($user_id, $body) + public function unlockSubAccountAsyncWithHttpInfo($user_id) { $returnType = ''; - $request = $this->unlockSubAccountRequest($user_id, $body); + $request = $this->unlockSubAccountRequest($user_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2395,13 +2377,12 @@ function ($exception) { /** * Create request for operation 'unlockSubAccount' * - * @param int $user_id The user id of the sub-account (required) - * @param object $body (required) + * @param int $user_id The user id of the sub-account (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function unlockSubAccountRequest($user_id, $body) + protected function unlockSubAccountRequest($user_id) { // verify the required parameter 'user_id' is set if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { @@ -2409,12 +2390,6 @@ protected function unlockSubAccountRequest($user_id, $body) 'Missing the required parameter $user_id when calling unlockSubAccount' ); } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling unlockSubAccount' - ); - } $resourcePath = '/sub_accounts/{user_id}/unlock'; $formParams = []; @@ -2434,9 +2409,6 @@ protected function unlockSubAccountRequest($user_id, $body) // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2445,7 +2417,7 @@ protected function unlockSubAccountRequest($user_id, $body) } else { $headers = $this->headerSelector->selectHeaders( [], - ['application/json'] + [] ); } diff --git a/src/Configuration.php b/src/Configuration.php index 85214b6..d79cc16 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -71,7 +71,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.34.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.40.0/PHP'; /** * Debug switch (default set to false) @@ -387,8 +387,8 @@ public static function toDebugReport() $report = 'PHP SDK (GateApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.34.0' . PHP_EOL; - $report .= ' SDK Package Version: 5.34.0' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.40.0' . PHP_EOL; + $report .= ' SDK Package Version: 5.40.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/AgencyCommission.php b/src/Model/AgencyCommission.php new file mode 100644 index 0000000..0fd9190 --- /dev/null +++ b/src/Model/AgencyCommission.php @@ -0,0 +1,455 @@ + 'int', + 'user_id' => 'int', + 'group_name' => 'string', + 'commission_amount' => 'string', + 'commission_asset' => 'string', + 'source' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'commission_time' => 'int64', + 'user_id' => 'int64', + 'group_name' => null, + 'commission_amount' => null, + 'commission_asset' => null, + 'source' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'commission_time' => 'commission_time', + 'user_id' => 'user_id', + 'group_name' => 'group_name', + 'commission_amount' => 'commission_amount', + 'commission_asset' => 'commission_asset', + 'source' => 'source' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'commission_time' => 'setCommissionTime', + 'user_id' => 'setUserId', + 'group_name' => 'setGroupName', + 'commission_amount' => 'setCommissionAmount', + 'commission_asset' => 'setCommissionAsset', + 'source' => 'setSource' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'commission_time' => 'getCommissionTime', + 'user_id' => 'getUserId', + 'group_name' => 'getGroupName', + 'commission_amount' => 'getCommissionAmount', + 'commission_asset' => 'getCommissionAsset', + 'source' => 'getSource' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['commission_time'] = isset($data['commission_time']) ? $data['commission_time'] : null; + $this->container['user_id'] = isset($data['user_id']) ? $data['user_id'] : null; + $this->container['group_name'] = isset($data['group_name']) ? $data['group_name'] : null; + $this->container['commission_amount'] = isset($data['commission_amount']) ? $data['commission_amount'] : null; + $this->container['commission_asset'] = isset($data['commission_asset']) ? $data['commission_asset'] : null; + $this->container['source'] = isset($data['source']) ? $data['source'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets commission_time + * + * @return int|null + */ + public function getCommissionTime() + { + return $this->container['commission_time']; + } + + /** + * Sets commission_time + * + * @param int|null $commission_time Commission Time. (unix timestamp) + * + * @return $this + */ + public function setCommissionTime($commission_time) + { + $this->container['commission_time'] = $commission_time; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id User ID + * + * @return $this + */ + public function setUserId($user_id) + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets group_name + * + * @return string|null + */ + public function getGroupName() + { + return $this->container['group_name']; + } + + /** + * Sets group_name + * + * @param string|null $group_name Group name + * + * @return $this + */ + public function setGroupName($group_name) + { + $this->container['group_name'] = $group_name; + + return $this; + } + + /** + * Gets commission_amount + * + * @return string|null + */ + public function getCommissionAmount() + { + return $this->container['commission_amount']; + } + + /** + * Sets commission_amount + * + * @param string|null $commission_amount Commission Amount + * + * @return $this + */ + public function setCommissionAmount($commission_amount) + { + $this->container['commission_amount'] = $commission_amount; + + return $this; + } + + /** + * Gets commission_asset + * + * @return string|null + */ + public function getCommissionAsset() + { + return $this->container['commission_asset']; + } + + /** + * Sets commission_asset + * + * @param string|null $commission_asset Commission Asset + * + * @return $this + */ + public function setCommissionAsset($commission_asset) + { + $this->container['commission_asset'] = $commission_asset; + + return $this; + } + + /** + * Gets source + * + * @return string|null + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param string|null $source Source. SPOT - SPOT Rebate, FUTURES - Futures Rebate + * + * @return $this + */ + public function setSource($source) + { + $this->container['source'] = $source; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AgencyCommissionHistory.php b/src/Model/AgencyCommissionHistory.php new file mode 100644 index 0000000..7f2d22e --- /dev/null +++ b/src/Model/AgencyCommissionHistory.php @@ -0,0 +1,365 @@ + 'string', + 'total' => 'int', + 'list' => '\GateApi\Model\AgencyCommission[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'currency_pair' => null, + 'total' => 'int64', + 'list' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency_pair' => 'currency_pair', + 'total' => 'total', + 'list' => 'list' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency_pair' => 'setCurrencyPair', + 'total' => 'setTotal', + 'list' => 'setList' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency_pair' => 'getCurrencyPair', + 'total' => 'getTotal', + 'list' => 'getList' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency_pair'] = isset($data['currency_pair']) ? $data['currency_pair'] : null; + $this->container['total'] = isset($data['total']) ? $data['total'] : null; + $this->container['list'] = isset($data['list']) ? $data['list'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency_pair + * + * @return string|null + */ + public function getCurrencyPair() + { + return $this->container['currency_pair']; + } + + /** + * Sets currency_pair + * + * @param string|null $currency_pair Currency pair + * + * @return $this + */ + public function setCurrencyPair($currency_pair) + { + $this->container['currency_pair'] = $currency_pair; + + return $this; + } + + /** + * Gets total + * + * @return int|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int|null $total Total + * + * @return $this + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets list + * + * @return \GateApi\Model\AgencyCommission[]|null + */ + public function getList() + { + return $this->container['list']; + } + + /** + * Sets list + * + * @param \GateApi\Model\AgencyCommission[]|null $list List of comission history + * + * @return $this + */ + public function setList($list) + { + $this->container['list'] = $list; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AgencyTransaction.php b/src/Model/AgencyTransaction.php new file mode 100644 index 0000000..1444169 --- /dev/null +++ b/src/Model/AgencyTransaction.php @@ -0,0 +1,545 @@ + 'int', + 'user_id' => 'int', + 'group_name' => 'string', + 'fee' => 'string', + 'fee_asset' => 'string', + 'currency_pair' => 'string', + 'amount' => 'string', + 'amount_asset' => 'string', + 'source' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'transaction_time' => 'int64', + 'user_id' => 'int64', + 'group_name' => null, + 'fee' => null, + 'fee_asset' => null, + 'currency_pair' => null, + 'amount' => null, + 'amount_asset' => null, + 'source' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'transaction_time' => 'transaction_time', + 'user_id' => 'user_id', + 'group_name' => 'group_name', + 'fee' => 'fee', + 'fee_asset' => 'fee_asset', + 'currency_pair' => 'currency_pair', + 'amount' => 'amount', + 'amount_asset' => 'amount_asset', + 'source' => 'source' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transaction_time' => 'setTransactionTime', + 'user_id' => 'setUserId', + 'group_name' => 'setGroupName', + 'fee' => 'setFee', + 'fee_asset' => 'setFeeAsset', + 'currency_pair' => 'setCurrencyPair', + 'amount' => 'setAmount', + 'amount_asset' => 'setAmountAsset', + 'source' => 'setSource' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transaction_time' => 'getTransactionTime', + 'user_id' => 'getUserId', + 'group_name' => 'getGroupName', + 'fee' => 'getFee', + 'fee_asset' => 'getFeeAsset', + 'currency_pair' => 'getCurrencyPair', + 'amount' => 'getAmount', + 'amount_asset' => 'getAmountAsset', + 'source' => 'getSource' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['transaction_time'] = isset($data['transaction_time']) ? $data['transaction_time'] : null; + $this->container['user_id'] = isset($data['user_id']) ? $data['user_id'] : null; + $this->container['group_name'] = isset($data['group_name']) ? $data['group_name'] : null; + $this->container['fee'] = isset($data['fee']) ? $data['fee'] : null; + $this->container['fee_asset'] = isset($data['fee_asset']) ? $data['fee_asset'] : null; + $this->container['currency_pair'] = isset($data['currency_pair']) ? $data['currency_pair'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['amount_asset'] = isset($data['amount_asset']) ? $data['amount_asset'] : null; + $this->container['source'] = isset($data['source']) ? $data['source'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets transaction_time + * + * @return int|null + */ + public function getTransactionTime() + { + return $this->container['transaction_time']; + } + + /** + * Sets transaction_time + * + * @param int|null $transaction_time Transaction Time. (unix timestamp) + * + * @return $this + */ + public function setTransactionTime($transaction_time) + { + $this->container['transaction_time'] = $transaction_time; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id User ID + * + * @return $this + */ + public function setUserId($user_id) + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets group_name + * + * @return string|null + */ + public function getGroupName() + { + return $this->container['group_name']; + } + + /** + * Sets group_name + * + * @param string|null $group_name Group name + * + * @return $this + */ + public function setGroupName($group_name) + { + $this->container['group_name'] = $group_name; + + return $this; + } + + /** + * Gets fee + * + * @return string|null + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param string|null $fee Fee + * + * @return $this + */ + public function setFee($fee) + { + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets fee_asset + * + * @return string|null + */ + public function getFeeAsset() + { + return $this->container['fee_asset']; + } + + /** + * Sets fee_asset + * + * @param string|null $fee_asset Fee currency + * + * @return $this + */ + public function setFeeAsset($fee_asset) + { + $this->container['fee_asset'] = $fee_asset; + + return $this; + } + + /** + * Gets currency_pair + * + * @return string|null + */ + public function getCurrencyPair() + { + return $this->container['currency_pair']; + } + + /** + * Sets currency_pair + * + * @param string|null $currency_pair Currency pair + * + * @return $this + */ + public function setCurrencyPair($currency_pair) + { + $this->container['currency_pair'] = $currency_pair; + + return $this; + } + + /** + * Gets amount + * + * @return string|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string|null $amount Commission Amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets amount_asset + * + * @return string|null + */ + public function getAmountAsset() + { + return $this->container['amount_asset']; + } + + /** + * Sets amount_asset + * + * @param string|null $amount_asset Commission Asset + * + * @return $this + */ + public function setAmountAsset($amount_asset) + { + $this->container['amount_asset'] = $amount_asset; + + return $this; + } + + /** + * Gets source + * + * @return string|null + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param string|null $source Source. SPOT - SPOT Rebate, FUTURES - Futures Rebate + * + * @return $this + */ + public function setSource($source) + { + $this->container['source'] = $source; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AgencyTransactionHistory.php b/src/Model/AgencyTransactionHistory.php new file mode 100644 index 0000000..0956b56 --- /dev/null +++ b/src/Model/AgencyTransactionHistory.php @@ -0,0 +1,365 @@ + 'string', + 'total' => 'int', + 'list' => '\GateApi\Model\AgencyTransaction[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'currency_pair' => null, + 'total' => 'int64', + 'list' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency_pair' => 'currency_pair', + 'total' => 'total', + 'list' => 'list' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency_pair' => 'setCurrencyPair', + 'total' => 'setTotal', + 'list' => 'setList' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency_pair' => 'getCurrencyPair', + 'total' => 'getTotal', + 'list' => 'getList' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency_pair'] = isset($data['currency_pair']) ? $data['currency_pair'] : null; + $this->container['total'] = isset($data['total']) ? $data['total'] : null; + $this->container['list'] = isset($data['list']) ? $data['list'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency_pair + * + * @return string|null + */ + public function getCurrencyPair() + { + return $this->container['currency_pair']; + } + + /** + * Sets currency_pair + * + * @param string|null $currency_pair Currency pair + * + * @return $this + */ + public function setCurrencyPair($currency_pair) + { + $this->container['currency_pair'] = $currency_pair; + + return $this; + } + + /** + * Gets total + * + * @return int|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int|null $total Total + * + * @return $this + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets list + * + * @return \GateApi\Model\AgencyTransaction[]|null + */ + public function getList() + { + return $this->container['list']; + } + + /** + * Sets list + * + * @param \GateApi\Model\AgencyTransaction[]|null $list List of transaction history + * + * @return $this + */ + public function setList($list) + { + $this->container['list'] = $list; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/BatchOrder.php b/src/Model/BatchOrder.php index 740d46e..f4386b3 100644 --- a/src/Model/BatchOrder.php +++ b/src/Model/BatchOrder.php @@ -305,6 +305,7 @@ public function getModelName() const STATUS_CLOSED = 'closed'; const STATUS_CANCELLED = 'cancelled'; const TYPE_LIMIT = 'limit'; + const TYPE_MARKET = 'market'; const ACCOUNT_SPOT = 'spot'; const ACCOUNT_MARGIN = 'margin'; const ACCOUNT_CROSS_MARGIN = 'cross_margin'; @@ -340,6 +341,7 @@ public function getTypeAllowableValues() { return [ self::TYPE_LIMIT, + self::TYPE_MARKET, ]; } @@ -783,7 +785,7 @@ public function getType() /** * Sets type * - * @param string|null $type Order type. limit - limit order + * @param string|null $type Order Type - limit : Limit Order - market : Market Order * * @return $this */ @@ -963,7 +965,7 @@ public function getIceberg() /** * Sets iceberg * - * @param string|null $iceberg Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely + * @param string|null $iceberg Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported. * * @return $this */ diff --git a/src/Model/Contract.php b/src/Model/Contract.php index f736a71..d476363 100644 --- a/src/Model/Contract.php +++ b/src/Model/Contract.php @@ -86,7 +86,9 @@ class Contract implements ModelInterface, ArrayAccess 'position_size' => 'int', 'config_change_time' => 'double', 'in_delisting' => 'bool', - 'orders_limit' => 'int' + 'orders_limit' => 'int', + 'enable_bonus' => 'bool', + 'enable_credit' => 'bool' ]; /** @@ -126,7 +128,9 @@ class Contract implements ModelInterface, ArrayAccess 'position_size' => 'int64', 'config_change_time' => 'double', 'in_delisting' => null, - 'orders_limit' => null + 'orders_limit' => null, + 'enable_bonus' => null, + 'enable_credit' => null ]; /** @@ -187,7 +191,9 @@ public static function openAPIFormats() 'position_size' => 'position_size', 'config_change_time' => 'config_change_time', 'in_delisting' => 'in_delisting', - 'orders_limit' => 'orders_limit' + 'orders_limit' => 'orders_limit', + 'enable_bonus' => 'enable_bonus', + 'enable_credit' => 'enable_credit' ]; /** @@ -227,7 +233,9 @@ public static function openAPIFormats() 'position_size' => 'setPositionSize', 'config_change_time' => 'setConfigChangeTime', 'in_delisting' => 'setInDelisting', - 'orders_limit' => 'setOrdersLimit' + 'orders_limit' => 'setOrdersLimit', + 'enable_bonus' => 'setEnableBonus', + 'enable_credit' => 'setEnableCredit' ]; /** @@ -267,7 +275,9 @@ public static function openAPIFormats() 'position_size' => 'getPositionSize', 'config_change_time' => 'getConfigChangeTime', 'in_delisting' => 'getInDelisting', - 'orders_limit' => 'getOrdersLimit' + 'orders_limit' => 'getOrdersLimit', + 'enable_bonus' => 'getEnableBonus', + 'enable_credit' => 'getEnableCredit' ]; /** @@ -392,6 +402,8 @@ public function __construct(array $data = null) $this->container['config_change_time'] = isset($data['config_change_time']) ? $data['config_change_time'] : null; $this->container['in_delisting'] = isset($data['in_delisting']) ? $data['in_delisting'] : null; $this->container['orders_limit'] = isset($data['orders_limit']) ? $data['orders_limit'] : null; + $this->container['enable_bonus'] = isset($data['enable_bonus']) ? $data['enable_bonus'] : null; + $this->container['enable_credit'] = isset($data['enable_credit']) ? $data['enable_credit'] : null; } /** @@ -1219,6 +1231,54 @@ public function setOrdersLimit($orders_limit) return $this; } + + /** + * Gets enable_bonus + * + * @return bool|null + */ + public function getEnableBonus() + { + return $this->container['enable_bonus']; + } + + /** + * Sets enable_bonus + * + * @param bool|null $enable_bonus Whether bouns is enabled + * + * @return $this + */ + public function setEnableBonus($enable_bonus) + { + $this->container['enable_bonus'] = $enable_bonus; + + return $this; + } + + /** + * Gets enable_credit + * + * @return bool|null + */ + public function getEnableCredit() + { + return $this->container['enable_credit']; + } + + /** + * Sets enable_credit + * + * @param bool|null $enable_credit Whether portfolio margin account is enabled + * + * @return $this + */ + public function setEnableCredit($enable_credit) + { + $this->container['enable_credit'] = $enable_credit; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/CrossMarginAccount.php b/src/Model/CrossMarginAccount.php index dde090a..68dd964 100644 --- a/src/Model/CrossMarginAccount.php +++ b/src/Model/CrossMarginAccount.php @@ -66,7 +66,8 @@ class CrossMarginAccount implements ModelInterface, ArrayAccess 'total_maintenance_margin' => 'string', 'total_initial_margin_rate' => 'string', 'total_maintenance_margin_rate' => 'string', - 'total_available_margin' => 'string' + 'total_available_margin' => 'string', + 'portfolio_margin_total' => 'string' ]; /** @@ -87,7 +88,8 @@ class CrossMarginAccount implements ModelInterface, ArrayAccess 'total_maintenance_margin' => null, 'total_initial_margin_rate' => null, 'total_maintenance_margin_rate' => null, - 'total_available_margin' => null + 'total_available_margin' => null, + 'portfolio_margin_total' => null ]; /** @@ -129,7 +131,8 @@ public static function openAPIFormats() 'total_maintenance_margin' => 'total_maintenance_margin', 'total_initial_margin_rate' => 'total_initial_margin_rate', 'total_maintenance_margin_rate' => 'total_maintenance_margin_rate', - 'total_available_margin' => 'total_available_margin' + 'total_available_margin' => 'total_available_margin', + 'portfolio_margin_total' => 'portfolio_margin_total' ]; /** @@ -150,7 +153,8 @@ public static function openAPIFormats() 'total_maintenance_margin' => 'setTotalMaintenanceMargin', 'total_initial_margin_rate' => 'setTotalInitialMarginRate', 'total_maintenance_margin_rate' => 'setTotalMaintenanceMarginRate', - 'total_available_margin' => 'setTotalAvailableMargin' + 'total_available_margin' => 'setTotalAvailableMargin', + 'portfolio_margin_total' => 'setPortfolioMarginTotal' ]; /** @@ -171,7 +175,8 @@ public static function openAPIFormats() 'total_maintenance_margin' => 'getTotalMaintenanceMargin', 'total_initial_margin_rate' => 'getTotalInitialMarginRate', 'total_maintenance_margin_rate' => 'getTotalMaintenanceMarginRate', - 'total_available_margin' => 'getTotalAvailableMargin' + 'total_available_margin' => 'getTotalAvailableMargin', + 'portfolio_margin_total' => 'getPortfolioMarginTotal' ]; /** @@ -247,6 +252,7 @@ public function __construct(array $data = null) $this->container['total_initial_margin_rate'] = isset($data['total_initial_margin_rate']) ? $data['total_initial_margin_rate'] : null; $this->container['total_maintenance_margin_rate'] = isset($data['total_maintenance_margin_rate']) ? $data['total_maintenance_margin_rate'] : null; $this->container['total_available_margin'] = isset($data['total_available_margin']) ? $data['total_available_margin'] : null; + $this->container['portfolio_margin_total'] = isset($data['portfolio_margin_total']) ? $data['portfolio_margin_total'] : null; } /** @@ -584,6 +590,30 @@ public function setTotalAvailableMargin($total_available_margin) return $this; } + + /** + * Gets portfolio_margin_total + * + * @return string|null + */ + public function getPortfolioMarginTotal() + { + return $this->container['portfolio_margin_total']; + } + + /** + * Sets portfolio_margin_total + * + * @param string|null $portfolio_margin_total Total amount of the portfolio margin account + * + * @return $this + */ + public function setPortfolioMarginTotal($portfolio_margin_total) + { + $this->container['portfolio_margin_total'] = $portfolio_margin_total; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/CrossMarginAccountBook.php b/src/Model/CrossMarginAccountBook.php index 0036105..a6a1b67 100644 --- a/src/Model/CrossMarginAccountBook.php +++ b/src/Model/CrossMarginAccountBook.php @@ -184,6 +184,7 @@ public function getModelName() const TYPE_OUT = 'out'; const TYPE_REPAY = 'repay'; const TYPE_BORROW = 'borrow'; + const TYPE_INTEREST = 'interest'; const TYPE_NEW_ORDER = 'new_order'; const TYPE_ORDER_FILL = 'order_fill'; const TYPE_REFERRAL_FEE = 'referral_fee'; @@ -204,6 +205,7 @@ public function getTypeAllowableValues() self::TYPE_OUT, self::TYPE_REPAY, self::TYPE_BORROW, + self::TYPE_INTEREST, self::TYPE_NEW_ORDER, self::TYPE_ORDER_FILL, self::TYPE_REFERRAL_FEE, @@ -401,7 +403,7 @@ public function getType() /** * Sets type * - * @param string|null $type Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type + * @param string|null $type Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - interest: interest - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type * * @return $this */ diff --git a/src/Model/CrossMarginCurrency.php b/src/Model/CrossMarginCurrency.php index e79a424..1c970bf 100644 --- a/src/Model/CrossMarginCurrency.php +++ b/src/Model/CrossMarginCurrency.php @@ -286,7 +286,7 @@ public function getRate() /** * Sets rate * - * @param string|null $rate Loan rate + * @param string|null $rate Minimum lending rate (hourly rate) * * @return $this */ diff --git a/src/Model/FundingBookItem.php b/src/Model/FundingBookItem.php index 5c1698b..0ccb2d7 100644 --- a/src/Model/FundingBookItem.php +++ b/src/Model/FundingBookItem.php @@ -226,7 +226,7 @@ public function getRate() /** * Sets rate * - * @param string|null $rate Loan rate + * @param string|null $rate Loan rate (daily rate) * * @return $this */ diff --git a/src/Model/FuturesAccount.php b/src/Model/FuturesAccount.php index 3df49d6..9e172d9 100644 --- a/src/Model/FuturesAccount.php +++ b/src/Model/FuturesAccount.php @@ -382,7 +382,7 @@ public function getAvailable() /** * Sets available * - * @param string|null $available The available balance for transferring or trading + * @param string|null $available The available balance for transferring or trading(including bonus. Bonus can't be be withdrawn. The transfer amount needs to deduct the bonus) * * @return $this */ diff --git a/src/Model/FuturesAutoDeleverage.php b/src/Model/FuturesAutoDeleverage.php new file mode 100644 index 0000000..86ce12e --- /dev/null +++ b/src/Model/FuturesAutoDeleverage.php @@ -0,0 +1,575 @@ + 'int', + 'user' => 'int', + 'order_id' => 'int', + 'contract' => 'string', + 'leverage' => 'string', + 'cross_leverage_limit' => 'string', + 'entry_price' => 'string', + 'fill_price' => 'string', + 'trade_size' => 'int', + 'position_size' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'time' => 'int64', + 'user' => 'int64', + 'order_id' => 'int64', + 'contract' => null, + 'leverage' => null, + 'cross_leverage_limit' => null, + 'entry_price' => null, + 'fill_price' => null, + 'trade_size' => 'int64', + 'position_size' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'time' => 'time', + 'user' => 'user', + 'order_id' => 'order_id', + 'contract' => 'contract', + 'leverage' => 'leverage', + 'cross_leverage_limit' => 'cross_leverage_limit', + 'entry_price' => 'entry_price', + 'fill_price' => 'fill_price', + 'trade_size' => 'trade_size', + 'position_size' => 'position_size' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'time' => 'setTime', + 'user' => 'setUser', + 'order_id' => 'setOrderId', + 'contract' => 'setContract', + 'leverage' => 'setLeverage', + 'cross_leverage_limit' => 'setCrossLeverageLimit', + 'entry_price' => 'setEntryPrice', + 'fill_price' => 'setFillPrice', + 'trade_size' => 'setTradeSize', + 'position_size' => 'setPositionSize' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'time' => 'getTime', + 'user' => 'getUser', + 'order_id' => 'getOrderId', + 'contract' => 'getContract', + 'leverage' => 'getLeverage', + 'cross_leverage_limit' => 'getCrossLeverageLimit', + 'entry_price' => 'getEntryPrice', + 'fill_price' => 'getFillPrice', + 'trade_size' => 'getTradeSize', + 'position_size' => 'getPositionSize' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['user'] = isset($data['user']) ? $data['user'] : null; + $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null; + $this->container['contract'] = isset($data['contract']) ? $data['contract'] : null; + $this->container['leverage'] = isset($data['leverage']) ? $data['leverage'] : null; + $this->container['cross_leverage_limit'] = isset($data['cross_leverage_limit']) ? $data['cross_leverage_limit'] : null; + $this->container['entry_price'] = isset($data['entry_price']) ? $data['entry_price'] : null; + $this->container['fill_price'] = isset($data['fill_price']) ? $data['fill_price'] : null; + $this->container['trade_size'] = isset($data['trade_size']) ? $data['trade_size'] : null; + $this->container['position_size'] = isset($data['position_size']) ? $data['position_size'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets time + * + * @return int|null + */ + public function getTime() + { + return $this->container['time']; + } + + /** + * Sets time + * + * @param int|null $time Automatic deleveraging time + * + * @return $this + */ + public function setTime($time) + { + $this->container['time'] = $time; + + return $this; + } + + /** + * Gets user + * + * @return int|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param int|null $user User ID + * + * @return $this + */ + public function setUser($user) + { + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets order_id + * + * @return int|null + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param int|null $order_id Order ID. Order IDs before 2023-02-20 are null + * + * @return $this + */ + public function setOrderId($order_id) + { + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets contract + * + * @return string|null + */ + public function getContract() + { + return $this->container['contract']; + } + + /** + * Sets contract + * + * @param string|null $contract Futures contract + * + * @return $this + */ + public function setContract($contract) + { + $this->container['contract'] = $contract; + + return $this; + } + + /** + * Gets leverage + * + * @return string|null + */ + public function getLeverage() + { + return $this->container['leverage']; + } + + /** + * Sets leverage + * + * @param string|null $leverage Position leverage + * + * @return $this + */ + public function setLeverage($leverage) + { + $this->container['leverage'] = $leverage; + + return $this; + } + + /** + * Gets cross_leverage_limit + * + * @return string|null + */ + public function getCrossLeverageLimit() + { + return $this->container['cross_leverage_limit']; + } + + /** + * Sets cross_leverage_limit + * + * @param string|null $cross_leverage_limit Cross margin leverage(valid only when `leverage` is 0) + * + * @return $this + */ + public function setCrossLeverageLimit($cross_leverage_limit) + { + $this->container['cross_leverage_limit'] = $cross_leverage_limit; + + return $this; + } + + /** + * Gets entry_price + * + * @return string|null + */ + public function getEntryPrice() + { + return $this->container['entry_price']; + } + + /** + * Sets entry_price + * + * @param string|null $entry_price Average entry price + * + * @return $this + */ + public function setEntryPrice($entry_price) + { + $this->container['entry_price'] = $entry_price; + + return $this; + } + + /** + * Gets fill_price + * + * @return string|null + */ + public function getFillPrice() + { + return $this->container['fill_price']; + } + + /** + * Sets fill_price + * + * @param string|null $fill_price Average fill price + * + * @return $this + */ + public function setFillPrice($fill_price) + { + $this->container['fill_price'] = $fill_price; + + return $this; + } + + /** + * Gets trade_size + * + * @return int|null + */ + public function getTradeSize() + { + return $this->container['trade_size']; + } + + /** + * Sets trade_size + * + * @param int|null $trade_size Trading size + * + * @return $this + */ + public function setTradeSize($trade_size) + { + $this->container['trade_size'] = $trade_size; + + return $this; + } + + /** + * Gets position_size + * + * @return int|null + */ + public function getPositionSize() + { + return $this->container['position_size']; + } + + /** + * Sets position_size + * + * @param int|null $position_size Positions after auto-deleveraging + * + * @return $this + */ + public function setPositionSize($position_size) + { + $this->container['position_size'] = $position_size; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FuturesCandlestick.php b/src/Model/FuturesCandlestick.php index 37d735a..4482be3 100644 --- a/src/Model/FuturesCandlestick.php +++ b/src/Model/FuturesCandlestick.php @@ -60,7 +60,8 @@ class FuturesCandlestick implements ModelInterface, ArrayAccess 'c' => 'string', 'h' => 'string', 'l' => 'string', - 'o' => 'string' + 'o' => 'string', + 'sum' => 'string' ]; /** @@ -74,7 +75,8 @@ class FuturesCandlestick implements ModelInterface, ArrayAccess 'c' => null, 'h' => null, 'l' => null, - 'o' => null + 'o' => null, + 'sum' => null ]; /** @@ -109,7 +111,8 @@ public static function openAPIFormats() 'c' => 'c', 'h' => 'h', 'l' => 'l', - 'o' => 'o' + 'o' => 'o', + 'sum' => 'sum' ]; /** @@ -123,7 +126,8 @@ public static function openAPIFormats() 'c' => 'setC', 'h' => 'setH', 'l' => 'setL', - 'o' => 'setO' + 'o' => 'setO', + 'sum' => 'setSum' ]; /** @@ -137,7 +141,8 @@ public static function openAPIFormats() 'c' => 'getC', 'h' => 'getH', 'l' => 'getL', - 'o' => 'getO' + 'o' => 'getO', + 'sum' => 'getSum' ]; /** @@ -206,6 +211,7 @@ public function __construct(array $data = null) $this->container['h'] = isset($data['h']) ? $data['h'] : null; $this->container['l'] = isset($data['l']) ? $data['l'] : null; $this->container['o'] = isset($data['o']) ? $data['o'] : null; + $this->container['sum'] = isset($data['sum']) ? $data['sum'] : null; } /** @@ -375,6 +381,30 @@ public function setO($o) return $this; } + + /** + * Gets sum + * + * @return string|null + */ + public function getSum() + { + return $this->container['sum']; + } + + /** + * Sets sum + * + * @param string|null $sum Trading volume (unit: Quote currency) + * + * @return $this + */ + public function setSum($sum) + { + $this->container['sum'] = $sum; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/LedgerRecord.php b/src/Model/LedgerRecord.php index 8ac3263..0e9a670 100644 --- a/src/Model/LedgerRecord.php +++ b/src/Model/LedgerRecord.php @@ -56,6 +56,7 @@ class LedgerRecord implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'id' => 'string', 'txid' => 'string', + 'withdraw_order_id' => 'string', 'timestamp' => 'string', 'amount' => 'string', 'currency' => 'string', @@ -74,6 +75,7 @@ class LedgerRecord implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'id' => null, 'txid' => null, + 'withdraw_order_id' => null, 'timestamp' => null, 'amount' => null, 'currency' => null, @@ -113,6 +115,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'id' => 'id', 'txid' => 'txid', + 'withdraw_order_id' => 'withdraw_order_id', 'timestamp' => 'timestamp', 'amount' => 'amount', 'currency' => 'currency', @@ -131,6 +134,7 @@ public static function openAPIFormats() protected static $setters = [ 'id' => 'setId', 'txid' => 'setTxid', + 'withdraw_order_id' => 'setWithdrawOrderId', 'timestamp' => 'setTimestamp', 'amount' => 'setAmount', 'currency' => 'setCurrency', @@ -149,6 +153,7 @@ public static function openAPIFormats() protected static $getters = [ 'id' => 'getId', 'txid' => 'getTxid', + 'withdraw_order_id' => 'getWithdrawOrderId', 'timestamp' => 'getTimestamp', 'amount' => 'getAmount', 'currency' => 'getCurrency', @@ -258,6 +263,7 @@ public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['txid'] = isset($data['txid']) ? $data['txid'] : null; + $this->container['withdraw_order_id'] = isset($data['withdraw_order_id']) ? $data['withdraw_order_id'] : null; $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; @@ -357,6 +363,30 @@ public function setTxid($txid) return $this; } + /** + * Gets withdraw_order_id + * + * @return string|null + */ + public function getWithdrawOrderId() + { + return $this->container['withdraw_order_id']; + } + + /** + * Sets withdraw_order_id + * + * @param string|null $withdraw_order_id Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) + * + * @return $this + */ + public function setWithdrawOrderId($withdraw_order_id) + { + $this->container['withdraw_order_id'] = $withdraw_order_id; + + return $this; + } + /** * Gets timestamp * diff --git a/src/Model/Loan.php b/src/Model/Loan.php index a6e89dc..455d39a 100644 --- a/src/Model/Loan.php +++ b/src/Model/Loan.php @@ -538,7 +538,7 @@ public function getRate() /** * Sets rate * - * @param string|null $rate Loan rate. Only rates in [0.0002, 0.002] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set + * @param string|null $rate Loan rate. Only rates in [0.0001, 0.01] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set * * @return $this */ diff --git a/src/Model/Order.php b/src/Model/Order.php index 74c0bae..9d051a3 100644 --- a/src/Model/Order.php +++ b/src/Model/Order.php @@ -75,6 +75,7 @@ class Order implements ModelInterface, ArrayAccess 'left' => 'string', 'fill_price' => 'string', 'filled_total' => 'string', + 'avg_deal_price' => 'string', 'fee' => 'string', 'fee_currency' => 'string', 'point_fee' => 'string', @@ -112,6 +113,7 @@ class Order implements ModelInterface, ArrayAccess 'left' => null, 'fill_price' => null, 'filled_total' => null, + 'avg_deal_price' => null, 'fee' => null, 'fee_currency' => null, 'point_fee' => null, @@ -170,6 +172,7 @@ public static function openAPIFormats() 'left' => 'left', 'fill_price' => 'fill_price', 'filled_total' => 'filled_total', + 'avg_deal_price' => 'avg_deal_price', 'fee' => 'fee', 'fee_currency' => 'fee_currency', 'point_fee' => 'point_fee', @@ -207,6 +210,7 @@ public static function openAPIFormats() 'left' => 'setLeft', 'fill_price' => 'setFillPrice', 'filled_total' => 'setFilledTotal', + 'avg_deal_price' => 'setAvgDealPrice', 'fee' => 'setFee', 'fee_currency' => 'setFeeCurrency', 'point_fee' => 'setPointFee', @@ -244,6 +248,7 @@ public static function openAPIFormats() 'left' => 'getLeft', 'fill_price' => 'getFillPrice', 'filled_total' => 'getFilledTotal', + 'avg_deal_price' => 'getAvgDealPrice', 'fee' => 'getFee', 'fee_currency' => 'getFeeCurrency', 'point_fee' => 'getPointFee', @@ -418,6 +423,7 @@ public function __construct(array $data = null) $this->container['left'] = isset($data['left']) ? $data['left'] : null; $this->container['fill_price'] = isset($data['fill_price']) ? $data['fill_price'] : null; $this->container['filled_total'] = isset($data['filled_total']) ? $data['filled_total'] : null; + $this->container['avg_deal_price'] = isset($data['avg_deal_price']) ? $data['avg_deal_price'] : null; $this->container['fee'] = isset($data['fee']) ? $data['fee'] : null; $this->container['fee_currency'] = isset($data['fee_currency']) ? $data['fee_currency'] : null; $this->container['point_fee'] = isset($data['point_fee']) ? $data['point_fee'] : null; @@ -539,7 +545,7 @@ public function getText() /** * Sets text * - * @param string|null $text User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) + * @param string|null $text User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 * * @return $this */ @@ -716,7 +722,7 @@ public function getType() /** * Sets type * - * @param string|null $type Order Type - limit : Limit Order - market : Market Order + * @param string|null $type Order Type - limit : Limit Order - market : Market Order * * @return $this */ @@ -896,7 +902,7 @@ public function getIceberg() /** * Sets iceberg * - * @param string|null $iceberg Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely + * @param string|null $iceberg Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported. * * @return $this */ @@ -1027,6 +1033,30 @@ public function setFilledTotal($filled_total) return $this; } + /** + * Gets avg_deal_price + * + * @return string|null + */ + public function getAvgDealPrice() + { + return $this->container['avg_deal_price']; + } + + /** + * Sets avg_deal_price + * + * @param string|null $avg_deal_price Average fill price + * + * @return $this + */ + public function setAvgDealPrice($avg_deal_price) + { + $this->container['avg_deal_price'] = $avg_deal_price; + + return $this; + } + /** * Gets fee * diff --git a/src/Model/OrderPatch.php b/src/Model/OrderPatch.php new file mode 100644 index 0000000..43df2cf --- /dev/null +++ b/src/Model/OrderPatch.php @@ -0,0 +1,336 @@ + 'string', + 'price' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'price' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'price' => 'price' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'price' => 'setPrice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'price' => 'getPrice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['price'] = isset($data['price']) ? $data['price'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return string|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string|null $amount New order amount. `amount` and `price` must specify one of them + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets price + * + * @return string|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param string|null $price New order price. `amount` and `Price` must specify one of them\" + * + * @return $this + */ + public function setPrice($price) + { + $this->container['price'] = $price; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SpotFee.php b/src/Model/SpotFee.php new file mode 100644 index 0000000..94262b8 --- /dev/null +++ b/src/Model/SpotFee.php @@ -0,0 +1,545 @@ + 'int', + 'taker_fee' => 'string', + 'maker_fee' => 'string', + 'gt_discount' => 'bool', + 'gt_taker_fee' => 'string', + 'gt_maker_fee' => 'string', + 'loan_fee' => 'string', + 'point_type' => 'string', + 'currency_pair' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'user_id' => 'int64', + 'taker_fee' => null, + 'maker_fee' => null, + 'gt_discount' => null, + 'gt_taker_fee' => null, + 'gt_maker_fee' => null, + 'loan_fee' => null, + 'point_type' => null, + 'currency_pair' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'taker_fee' => 'taker_fee', + 'maker_fee' => 'maker_fee', + 'gt_discount' => 'gt_discount', + 'gt_taker_fee' => 'gt_taker_fee', + 'gt_maker_fee' => 'gt_maker_fee', + 'loan_fee' => 'loan_fee', + 'point_type' => 'point_type', + 'currency_pair' => 'currency_pair' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'taker_fee' => 'setTakerFee', + 'maker_fee' => 'setMakerFee', + 'gt_discount' => 'setGtDiscount', + 'gt_taker_fee' => 'setGtTakerFee', + 'gt_maker_fee' => 'setGtMakerFee', + 'loan_fee' => 'setLoanFee', + 'point_type' => 'setPointType', + 'currency_pair' => 'setCurrencyPair' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'taker_fee' => 'getTakerFee', + 'maker_fee' => 'getMakerFee', + 'gt_discount' => 'getGtDiscount', + 'gt_taker_fee' => 'getGtTakerFee', + 'gt_maker_fee' => 'getGtMakerFee', + 'loan_fee' => 'getLoanFee', + 'point_type' => 'getPointType', + 'currency_pair' => 'getCurrencyPair' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = isset($data['user_id']) ? $data['user_id'] : null; + $this->container['taker_fee'] = isset($data['taker_fee']) ? $data['taker_fee'] : null; + $this->container['maker_fee'] = isset($data['maker_fee']) ? $data['maker_fee'] : null; + $this->container['gt_discount'] = isset($data['gt_discount']) ? $data['gt_discount'] : null; + $this->container['gt_taker_fee'] = isset($data['gt_taker_fee']) ? $data['gt_taker_fee'] : null; + $this->container['gt_maker_fee'] = isset($data['gt_maker_fee']) ? $data['gt_maker_fee'] : null; + $this->container['loan_fee'] = isset($data['loan_fee']) ? $data['loan_fee'] : null; + $this->container['point_type'] = isset($data['point_type']) ? $data['point_type'] : null; + $this->container['currency_pair'] = isset($data['currency_pair']) ? $data['currency_pair'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id User ID + * + * @return $this + */ + public function setUserId($user_id) + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets taker_fee + * + * @return string|null + */ + public function getTakerFee() + { + return $this->container['taker_fee']; + } + + /** + * Sets taker_fee + * + * @param string|null $taker_fee taker fee rate + * + * @return $this + */ + public function setTakerFee($taker_fee) + { + $this->container['taker_fee'] = $taker_fee; + + return $this; + } + + /** + * Gets maker_fee + * + * @return string|null + */ + public function getMakerFee() + { + return $this->container['maker_fee']; + } + + /** + * Sets maker_fee + * + * @param string|null $maker_fee maker fee rate + * + * @return $this + */ + public function setMakerFee($maker_fee) + { + $this->container['maker_fee'] = $maker_fee; + + return $this; + } + + /** + * Gets gt_discount + * + * @return bool|null + */ + public function getGtDiscount() + { + return $this->container['gt_discount']; + } + + /** + * Sets gt_discount + * + * @param bool|null $gt_discount If GT deduction is enabled + * + * @return $this + */ + public function setGtDiscount($gt_discount) + { + $this->container['gt_discount'] = $gt_discount; + + return $this; + } + + /** + * Gets gt_taker_fee + * + * @return string|null + */ + public function getGtTakerFee() + { + return $this->container['gt_taker_fee']; + } + + /** + * Sets gt_taker_fee + * + * @param string|null $gt_taker_fee Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled + * + * @return $this + */ + public function setGtTakerFee($gt_taker_fee) + { + $this->container['gt_taker_fee'] = $gt_taker_fee; + + return $this; + } + + /** + * Gets gt_maker_fee + * + * @return string|null + */ + public function getGtMakerFee() + { + return $this->container['gt_maker_fee']; + } + + /** + * Sets gt_maker_fee + * + * @param string|null $gt_maker_fee Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled + * + * @return $this + */ + public function setGtMakerFee($gt_maker_fee) + { + $this->container['gt_maker_fee'] = $gt_maker_fee; + + return $this; + } + + /** + * Gets loan_fee + * + * @return string|null + */ + public function getLoanFee() + { + return $this->container['loan_fee']; + } + + /** + * Sets loan_fee + * + * @param string|null $loan_fee Loan fee rate of margin lending + * + * @return $this + */ + public function setLoanFee($loan_fee) + { + $this->container['loan_fee'] = $loan_fee; + + return $this; + } + + /** + * Gets point_type + * + * @return string|null + */ + public function getPointType() + { + return $this->container['point_type']; + } + + /** + * Sets point_type + * + * @param string|null $point_type Point type. 0 - Initial version. 1 - new version since 202009 + * + * @return $this + */ + public function setPointType($point_type) + { + $this->container['point_type'] = $point_type; + + return $this; + } + + /** + * Gets currency_pair + * + * @return string|null + */ + public function getCurrencyPair() + { + return $this->container['currency_pair']; + } + + /** + * Sets currency_pair + * + * @param string|null $currency_pair Currency pair + * + * @return $this + */ + public function setCurrencyPair($currency_pair) + { + $this->container['currency_pair'] = $currency_pair; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SubAccount.php b/src/Model/SubAccount.php index f636810..b22cd66 100644 --- a/src/Model/SubAccount.php +++ b/src/Model/SubAccount.php @@ -59,6 +59,7 @@ class SubAccount implements ModelInterface, ArrayAccess 'password' => 'string', 'email' => 'string', 'state' => 'int', + 'type' => 'int', 'user_id' => 'int', 'create_time' => 'int' ]; @@ -74,6 +75,7 @@ class SubAccount implements ModelInterface, ArrayAccess 'password' => null, 'email' => null, 'state' => 'int32', + 'type' => 'int32', 'user_id' => 'int64', 'create_time' => 'int64' ]; @@ -110,6 +112,7 @@ public static function openAPIFormats() 'password' => 'password', 'email' => 'email', 'state' => 'state', + 'type' => 'type', 'user_id' => 'user_id', 'create_time' => 'create_time' ]; @@ -125,6 +128,7 @@ public static function openAPIFormats() 'password' => 'setPassword', 'email' => 'setEmail', 'state' => 'setState', + 'type' => 'setType', 'user_id' => 'setUserId', 'create_time' => 'setCreateTime' ]; @@ -140,6 +144,7 @@ public static function openAPIFormats() 'password' => 'getPassword', 'email' => 'getEmail', 'state' => 'getState', + 'type' => 'getType', 'user_id' => 'getUserId', 'create_time' => 'getCreateTime' ]; @@ -209,6 +214,7 @@ public function __construct(array $data = null) $this->container['password'] = isset($data['password']) ? $data['password'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; $this->container['user_id'] = isset($data['user_id']) ? $data['user_id'] : null; $this->container['create_time'] = isset($data['create_time']) ? $data['create_time'] : null; } @@ -360,6 +366,30 @@ public function setState($state) return $this; } + /** + * Gets type + * + * @return int|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param int|null $type Type: 1-Sub-account + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** * Gets user_id *