/swagger-gen/javascript/docs/ExecutionApi.md

https://github.com/bybit-exchange/api-connectors · Markdown · 157 lines · 118 code · 39 blank · 0 comment · 0 complexity · 749af1a0e1362d9dbca5f267263914f9 MD5 · raw file

  1. # BybitApi.ExecutionApi
  2. All URIs are relative to *https://api.bybit.com*
  3. Method | HTTP request | Description
  4. ------------- | ------------- | -------------
  5. [**executionGetTrades**](ExecutionApi.md#executionGetTrades) | **GET** /v2/private/execution/list | Get users trade records.
  6. [**positionsClosePnlRecords**](ExecutionApi.md#positionsClosePnlRecords) | **GET** /v2/private/trade/closed-pnl/list | Get user's closed profit and loss records
  7. <a name="executionGetTrades"></a>
  8. # **executionGetTrades**
  9. > Object executionGetTrades(opts)
  10. Get users trade records.
  11. ### Example
  12. ```javascript
  13. var BybitApi = require('bybit_api');
  14. var defaultClient = BybitApi.ApiClient.instance;
  15. // Configure API key authorization: apiKey
  16. var apiKey = defaultClient.authentications['apiKey'];
  17. apiKey.apiKey = 'YOUR API KEY';
  18. // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
  19. //apiKey.apiKeyPrefix = 'Token';
  20. // Configure API key authorization: apiSignature
  21. var apiSignature = defaultClient.authentications['apiSignature'];
  22. apiSignature.apiKey = 'YOUR API KEY';
  23. // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
  24. //apiSignature.apiKeyPrefix = 'Token';
  25. // Configure API key authorization: timestamp
  26. var timestamp = defaultClient.authentications['timestamp'];
  27. timestamp.apiKey = 'YOUR API KEY';
  28. // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
  29. //timestamp.apiKeyPrefix = 'Token';
  30. var apiInstance = new BybitApi.ExecutionApi();
  31. var opts = {
  32. 'orderId': "orderId_example", // String | OrderID. If not provided, will return user’s trading records.
  33. 'symbol': "symbol_example", // String | Contract type. If order_id not provided, symbol is required.
  34. 'startTime': "startTime_example", // String | Start timestamp point for result.
  35. 'page': "page_example", // String | Page. Default getting first page data.
  36. 'limit': "limit_example" // String | Limit for data size per page, max size is 50. Default as showing 20 pieces of data per page.
  37. };
  38. var callback = function(error, data, response) {
  39. if (error) {
  40. console.error(error);
  41. } else {
  42. console.log('API called successfully. Returned data: ' + data);
  43. }
  44. };
  45. apiInstance.executionGetTrades(opts, callback);
  46. ```
  47. ### Parameters
  48. Name | Type | Description | Notes
  49. ------------- | ------------- | ------------- | -------------
  50. **orderId** | **String**| OrderID. If not provided, will return users trading records. | [optional]
  51. **symbol** | **String**| Contract type. If order_id not provided, symbol is required. | [optional]
  52. **startTime** | **String**| Start timestamp point for result. | [optional]
  53. **page** | **String**| Page. Default getting first page data. | [optional]
  54. **limit** | **String**| Limit for data size per page, max size is 50. Default as showing 20 pieces of data per page. | [optional]
  55. ### Return type
  56. **Object**
  57. ### Authorization
  58. [apiKey](../README.md#apiKey), [apiSignature](../README.md#apiSignature), [timestamp](../README.md#timestamp)
  59. ### HTTP request headers
  60. - **Content-Type**: application/json, application/x-www-form-urlencoded
  61. - **Accept**: application/json
  62. <a name="positionsClosePnlRecords"></a>
  63. # **positionsClosePnlRecords**
  64. > Object positionsClosePnlRecords(symbol, opts)
  65. Get user&#39;s closed profit and loss records
  66. ### Example
  67. ```javascript
  68. var BybitApi = require('bybit_api');
  69. var defaultClient = BybitApi.ApiClient.instance;
  70. // Configure API key authorization: apiKey
  71. var apiKey = defaultClient.authentications['apiKey'];
  72. apiKey.apiKey = 'YOUR API KEY';
  73. // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
  74. //apiKey.apiKeyPrefix = 'Token';
  75. // Configure API key authorization: apiSignature
  76. var apiSignature = defaultClient.authentications['apiSignature'];
  77. apiSignature.apiKey = 'YOUR API KEY';
  78. // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
  79. //apiSignature.apiKeyPrefix = 'Token';
  80. // Configure API key authorization: timestamp
  81. var timestamp = defaultClient.authentications['timestamp'];
  82. timestamp.apiKey = 'YOUR API KEY';
  83. // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
  84. //timestamp.apiKeyPrefix = 'Token';
  85. var apiInstance = new BybitApi.ExecutionApi();
  86. var symbol = "symbol_example"; // String | Contract type
  87. var opts = {
  88. 'startTime': 56, // Number | Start timestamp point for result, in second
  89. 'endTime': 56, // Number | End timestamp point for result, in second
  90. 'execType': "execType_example", // String | Execution type
  91. 'page': 56, // Number | Page. By default, gets first page of data. Maximum of 50 pages
  92. 'limit': 56 // Number | Limit for data size per page, max size is 50. Default as showing 20 pieces of data per page.
  93. };
  94. var callback = function(error, data, response) {
  95. if (error) {
  96. console.error(error);
  97. } else {
  98. console.log('API called successfully. Returned data: ' + data);
  99. }
  100. };
  101. apiInstance.positionsClosePnlRecords(symbol, opts, callback);
  102. ```
  103. ### Parameters
  104. Name | Type | Description | Notes
  105. ------------- | ------------- | ------------- | -------------
  106. **symbol** | **String**| Contract type |
  107. **startTime** | **Number**| Start timestamp point for result, in second | [optional]
  108. **endTime** | **Number**| End timestamp point for result, in second | [optional]
  109. **execType** | **String**| Execution type | [optional]
  110. **page** | **Number**| Page. By default, gets first page of data. Maximum of 50 pages | [optional]
  111. **limit** | **Number**| Limit for data size per page, max size is 50. Default as showing 20 pieces of data per page. | [optional]
  112. ### Return type
  113. **Object**
  114. ### Authorization
  115. [apiKey](../README.md#apiKey), [apiSignature](../README.md#apiSignature), [timestamp](../README.md#timestamp)
  116. ### HTTP request headers
  117. - **Content-Type**: application/json, application/x-www-form-urlencoded
  118. - **Accept**: application/json