Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clients/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

<artifactId>binance-common</artifactId>
<name>common</name>
<version>2.2.1</version>
<version>2.3.1</version>
<packaging>jar</packaging>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.eclipse.jetty.client.ProxyConfiguration;
import org.eclipse.jetty.client.api.Authentication;

public class WebSocketClientConfiguration extends ClientConfiguration {
public class WebSocketClientConfiguration extends ClientConfiguration implements Cloneable {
/** Base URL */
protected String url = "wss://ws-api.binance.com:443/ws-api/v3";

Expand Down Expand Up @@ -105,4 +105,13 @@ public Long getMessageMaxSize() {
public void setMessageMaxSize(Long messageMaxSize) {
this.messageMaxSize = messageMaxSize;
}

@Override
public Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.binance.connector.client.common.websocket.service;

import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import com.google.gson.TypeAdapter;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import org.apache.commons.lang3.StringUtils;

import java.io.IOException;

public class RequestIdModifierFactory implements TypeAdapterFactory {
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!RequestWrapperDTO.class.isAssignableFrom(type.getRawType())) return null;

final TypeAdapter<T> delegate = gson.getDelegateAdapter(this, type);
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);

return new TypeAdapter<T>() {
@Override
public void write(JsonWriter out, T value) throws IOException {
JsonElement tree = delegate.toJsonTree(value);
if (tree.isJsonObject()) {
JsonObject jo = tree.getAsJsonObject();
if (jo.has("id")) {
String id = jo.get("id").getAsString();
if (StringUtils.isNumeric(id)) {
jo.add("id", new JsonPrimitive(Long.parseLong(id)));
}
}
}
elementAdapter.write(out, tree);
}

@Override
public T read(JsonReader in) throws IOException {
return delegate.read(in);
}
}.nullSafe();
}
}
195 changes: 0 additions & 195 deletions clients/derivatives-trading-options/docs/AccountApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ All URIs are relative to *https://eapi.binance.com*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**accountFundingFlow**](AccountApi.md#accountFundingFlow) | **GET** /eapi/v1/bill | Account Funding Flow (USER_DATA) |
| [**getDownloadIdForOptionTransactionHistory**](AccountApi.md#getDownloadIdForOptionTransactionHistory) | **GET** /eapi/v1/income/asyn | Get Download Id For Option Transaction History (USER_DATA) |
| [**getOptionTransactionHistoryDownloadLinkById**](AccountApi.md#getOptionTransactionHistoryDownloadLinkById) | **GET** /eapi/v1/income/asyn/id | Get Option Transaction History Download Link by Id (USER_DATA) |
| [**optionAccountInformation**](AccountApi.md#optionAccountInformation) | **GET** /eapi/v1/account | Option Account Information(TRADE) |
| [**optionMarginAccountInformation**](AccountApi.md#optionMarginAccountInformation) | **GET** /eapi/v1/marginAccount | Option Margin Account Information (USER_DATA) |


Expand Down Expand Up @@ -83,198 +80,6 @@ No authorization required
|-------------|-------------|------------------|
| **200** | Account Funding Flow | - |

<a id="getDownloadIdForOptionTransactionHistory"></a>
# **getDownloadIdForOptionTransactionHistory**
> GetDownloadIdForOptionTransactionHistoryResponse getDownloadIdForOptionTransactionHistory(startTime, endTime, recvWindow)

Get Download Id For Option Transaction History (USER_DATA)

Get download id for option transaction history * Request Limitation is 5 times per month, shared by &gt; front end download page and rest api * The time between &#x60;startTime&#x60; and &#x60;endTime&#x60; can not be longer than 1 year Weight: 5

### Example
```java
// Import classes:
import com.binance.connector.client.derivatives_trading_options.ApiClient;
import com.binance.connector.client.derivatives_trading_options.ApiException;
import com.binance.connector.client.derivatives_trading_options.Configuration;
import com.binance.connector.client.derivatives_trading_options.models.*;
import com.binance.connector.client.derivatives_trading_options.rest.api.AccountApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://eapi.binance.com");

AccountApi apiInstance = new AccountApi(defaultClient);
Long startTime = 56L; // Long | Timestamp in ms
Long endTime = 56L; // Long | Timestamp in ms
Long recvWindow = 56L; // Long |
try {
GetDownloadIdForOptionTransactionHistoryResponse result = apiInstance.getDownloadIdForOptionTransactionHistory(startTime, endTime, recvWindow);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#getDownloadIdForOptionTransactionHistory");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```

### Parameters

| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **startTime** | **Long**| Timestamp in ms | |
| **endTime** | **Long**| Timestamp in ms | |
| **recvWindow** | **Long**| | [optional] |

### Return type

[**GetDownloadIdForOptionTransactionHistoryResponse**](GetDownloadIdForOptionTransactionHistoryResponse.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Get Download Id For Option Transaction History | - |

<a id="getOptionTransactionHistoryDownloadLinkById"></a>
# **getOptionTransactionHistoryDownloadLinkById**
> GetOptionTransactionHistoryDownloadLinkByIdResponse getOptionTransactionHistoryDownloadLinkById(downloadId, recvWindow)

Get Option Transaction History Download Link by Id (USER_DATA)

Get option transaction history download Link by Id * Download link expiration: 24h Weight: 5

### Example
```java
// Import classes:
import com.binance.connector.client.derivatives_trading_options.ApiClient;
import com.binance.connector.client.derivatives_trading_options.ApiException;
import com.binance.connector.client.derivatives_trading_options.Configuration;
import com.binance.connector.client.derivatives_trading_options.models.*;
import com.binance.connector.client.derivatives_trading_options.rest.api.AccountApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://eapi.binance.com");

AccountApi apiInstance = new AccountApi(defaultClient);
String downloadId = "downloadId_example"; // String | get by download id api
Long recvWindow = 56L; // Long |
try {
GetOptionTransactionHistoryDownloadLinkByIdResponse result = apiInstance.getOptionTransactionHistoryDownloadLinkById(downloadId, recvWindow);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#getOptionTransactionHistoryDownloadLinkById");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```

### Parameters

| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **downloadId** | **String**| get by download id api | |
| **recvWindow** | **Long**| | [optional] |

### Return type

[**GetOptionTransactionHistoryDownloadLinkByIdResponse**](GetOptionTransactionHistoryDownloadLinkByIdResponse.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Get Option Transaction History Download Link by Id | - |

<a id="optionAccountInformation"></a>
# **optionAccountInformation**
> OptionAccountInformationResponse optionAccountInformation(recvWindow)

Option Account Information(TRADE)

Get current account information. Weight: 3

### Example
```java
// Import classes:
import com.binance.connector.client.derivatives_trading_options.ApiClient;
import com.binance.connector.client.derivatives_trading_options.ApiException;
import com.binance.connector.client.derivatives_trading_options.Configuration;
import com.binance.connector.client.derivatives_trading_options.models.*;
import com.binance.connector.client.derivatives_trading_options.rest.api.AccountApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://eapi.binance.com");

AccountApi apiInstance = new AccountApi(defaultClient);
Long recvWindow = 56L; // Long |
try {
OptionAccountInformationResponse result = apiInstance.optionAccountInformation(recvWindow);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#optionAccountInformation");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```

### Parameters

| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **recvWindow** | **Long**| | [optional] |

### Return type

[**OptionAccountInformationResponse**](OptionAccountInformationResponse.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Option Account Information | - |

<a id="optionMarginAccountInformation"></a>
# **optionMarginAccountInformation**
> OptionMarginAccountInformationResponse optionMarginAccountInformation(recvWindow)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
|**realizedProfit** | **String** | | [optional] |
|**side** | **String** | | [optional] |
|**type** | **String** | | [optional] |
|**volatility** | **String** | | [optional] |
|**liquidity** | **String** | | [optional] |
|**quoteAsset** | **String** | | [optional] |
|**time** | **Long** | | [optional] |
|**priceScale** | **Long** | | [optional] |
|**quantityScale** | **Long** | | [optional] |
|**optionSide** | **String** | | [optional] |
|**quoteAsset** | **String** | | [optional] |



17 changes: 0 additions & 17 deletions clients/derivatives-trading-options/docs/AccountUpdate.md

This file was deleted.

19 changes: 0 additions & 19 deletions clients/derivatives-trading-options/docs/AccountUpdateBInner.md

This file was deleted.

17 changes: 0 additions & 17 deletions clients/derivatives-trading-options/docs/AccountUpdateGInner.md

This file was deleted.

17 changes: 17 additions & 0 deletions clients/derivatives-trading-options/docs/BalancePositionUpdate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


# BalancePositionUpdate


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**E** | **Long** | | [optional] |
|**T** | **Long** | | [optional] |
|**mLowerCase** | **String** | | [optional] |
|**B** | [**List&lt;BalancePositionUpdateBInner&gt;**](BalancePositionUpdateBInner.md) | | [optional] |
|**P** | [**List&lt;BalancePositionUpdatePInner&gt;**](BalancePositionUpdatePInner.md) | | [optional] |



Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


# BalancePositionUpdateBInner


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**aLowerCase** | **String** | | [optional] |
|**bLowerCase** | **String** | | [optional] |
|**bc** | **String** | | [optional] |



Loading
Loading