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
3 changes: 3 additions & 0 deletions clients/algo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.2.2 - 2026-04-30
- Update `binance/common` module to version `2.4.2`.

## 1.2.1 - 2025-08-07
- Update `binance/common` module to version `2.0.0`.
- Add `Content-Type` header only if there is a body.
Expand Down
6 changes: 3 additions & 3 deletions clients/algo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>binance-algo</artifactId>
<name>algo</name>
<version>1.2.1</version>
<version>1.2.2</version>
<packaging>jar</packaging>

<parent>
<groupId>io.github.binance</groupId>
<artifactId>binance-connector-java-clients</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>

<build>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-common</artifactId>
<version>2.0.0</version>
<version>2.4.2</version>
</dependency>
</dependencies>
</project>
3 changes: 3 additions & 0 deletions clients/alpha/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.0.1 - 2026-04-30
- Update `binance/common` module to version `2.4.2`.

## 1.0.0 - 2026-01-20

- Initial release
6 changes: 3 additions & 3 deletions clients/alpha/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>binance-alpha</artifactId>
<name>alpha</name>
<version>1.0.0</version>
<version>1.0.1</version>
<packaging>jar</packaging>

<parent>
<groupId>io.github.binance</groupId>
<artifactId>binance-connector-java-clients</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>

<build>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-common</artifactId>
<version>2.3.1</version>
<version>2.4.2</version>
</dependency>
</dependencies>
</project>
3 changes: 3 additions & 0 deletions clients/c2c/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.0.1 - 2026-04-30
- Update `binance/common` module to version `2.4.2`.

## 2.0.0 - 2025-12-16

### Changed (6)
Expand Down
6 changes: 3 additions & 3 deletions clients/c2c/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>binance-c2c</artifactId>
<name>c2c</name>
<version>2.0.0</version>
<version>2.0.1</version>
<packaging>jar</packaging>

<parent>
<groupId>io.github.binance</groupId>
<artifactId>binance-connector-java-clients</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>

<build>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-common</artifactId>
<version>2.2.1</version>
<version>2.4.2</version>
</dependency>
</dependencies>
</project>
4 changes: 2 additions & 2 deletions clients/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>io.github.binance</groupId>
<artifactId>binance-connector-java-clients</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>

<artifactId>binance-common</artifactId>
<name>common</name>
<version>2.4.1</version>
<version>2.4.2</version>
<packaging>jar</packaging>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.binance.connector.client.common.sign.PrivateKey;
import com.binance.connector.client.common.sign.SignatureGenerator;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand All @@ -18,7 +19,7 @@ public SignatureGenerator getSignatureGenerator(SignatureConfiguration configura
byte[] privateKeyContent;
// check if it is the private key content, or path to private key
if (hasPrivateKeyHeader(privateKeyConfig)) {
privateKeyContent = privateKeyConfig.getBytes();
privateKeyContent = privateKeyConfig.getBytes(StandardCharsets.UTF_8);
} else {
Path path = Paths.get(privateKeyConfig);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import org.apache.commons.codec.binary.Hex;
import org.bouncycastle.crypto.CryptoException;

import java.nio.charset.StandardCharsets;

public class HmacSignatureGenerator implements SignatureGenerator {
private static final String HMAC_SHA256 = "HmacSHA256";
private final String apiSecret;
Expand All @@ -16,14 +18,14 @@ public HmacSignatureGenerator(String apiSecret) {

@Override
public byte[] sign(String input) throws CryptoException {
return sign(input.getBytes());
return sign(input.getBytes(StandardCharsets.UTF_8));
}

@Override
public byte[] sign(byte[] input) throws CryptoException {
byte[] hmacSha256;
try {
SecretKeySpec secretKeySpec = new SecretKeySpec(apiSecret.getBytes(), HMAC_SHA256);
SecretKeySpec secretKeySpec = new SecretKeySpec(apiSecret.getBytes(StandardCharsets.UTF_8), HMAC_SHA256);
Mac mac = Mac.getInstance(HMAC_SHA256);
mac.init(secretKeySpec);
hmacSha256 = mac.doFinal(input);
Expand All @@ -35,7 +37,7 @@ public byte[] sign(byte[] input) throws CryptoException {

@Override
public String signAsString(String input) throws CryptoException {
return signAsString(input.getBytes());
return signAsString(input.getBytes(StandardCharsets.UTF_8));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.binance.connector.client.common.ApiException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.security.Security;
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.Base64;
Expand Down Expand Up @@ -62,7 +63,7 @@ public void init(byte[] keyContent, String password) throws ApiException {
try {
Security.addProvider(new BouncyCastleProvider());
PKCS8EncryptedPrivateKeyInfo pkcs8EncryptedPrivateKeyInfo =
new PKCS8EncryptedPrivateKeyInfo(Base64.getDecoder().decode(s.getBytes()));
new PKCS8EncryptedPrivateKeyInfo(Base64.getDecoder().decode(s.getBytes(StandardCharsets.UTF_8)));
// Decrypt encrypted key
JcaPEMKeyConverter jcaPEMKeyConverter = new JcaPEMKeyConverter();
InputDecryptorProvider inputDecryptorProvider =
Expand All @@ -84,17 +85,17 @@ public void init(byte[] keyContent, String password) throws ApiException {
}

public byte[] sign(String input) throws CryptoException {
return sign(input.getBytes());
return sign(input.getBytes(StandardCharsets.UTF_8));
}

public byte[] sign(byte[] input) throws CryptoException {
public synchronized byte[] sign(byte[] input) throws CryptoException {
signer.update(input, 0, input.length);
byte[] generateSignature = signer.generateSignature();
return Base64.getEncoder().encode(generateSignature);
}

public String signAsString(String input) throws CryptoException {
return signAsString(input.getBytes());
return signAsString(input.getBytes(StandardCharsets.UTF_8));
}

public String signAsString(byte[] input) throws CryptoException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Hex;

import java.nio.charset.StandardCharsets;

public final class HmacSignatureGenerator {
private static final String HMAC_SHA256 = "HmacSHA256";
private final String apiSecret;
Expand All @@ -16,10 +18,10 @@ public HmacSignatureGenerator(String apiSecret) {
public String getSignature(String data) {
byte[] hmacSha256;
try {
SecretKeySpec secretKeySpec = new SecretKeySpec(apiSecret.getBytes(), HMAC_SHA256);
SecretKeySpec secretKeySpec = new SecretKeySpec(apiSecret.getBytes(StandardCharsets.UTF_8), HMAC_SHA256);
Mac mac = Mac.getInstance(HMAC_SHA256);
mac.init(secretKeySpec);
hmacSha256 = mac.doFinal(data.getBytes());
hmacSha256 = mac.doFinal(data.getBytes(StandardCharsets.UTF_8));
} catch (Exception e) {
throw new RuntimeException("Failed to calculate hmac-sha256", e);
}
Expand Down
3 changes: 3 additions & 0 deletions clients/convert/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.0.1 - 2026-04-30
- Update `binance/common` module to version `2.4.2`.|

## 2.0.0 - 2026-02-12

### Changed (1)
Expand Down
6 changes: 3 additions & 3 deletions clients/convert/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>binance-convert</artifactId>
<name>convert</name>
<version>2.0.0</version>
<version>2.0.1</version>
<packaging>jar</packaging>

<parent>
<groupId>io.github.binance</groupId>
<artifactId>binance-connector-java-clients</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>

<build>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-common</artifactId>
<version>2.3.1</version>
<version>2.4.2</version>
</dependency>
</dependencies>
</project>
3 changes: 3 additions & 0 deletions clients/copy-trading/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.2.2 - 2026-04-30
- Update `binance/common` module to version `2.4.2`.|

## 1.2.1 - 2025-08-07
- Update `binance/common` module to version `2.0.0`.
- Add `Content-Type` header only if there is a body.
Expand Down
6 changes: 3 additions & 3 deletions clients/copy-trading/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>binance-copy-trading</artifactId>
<name>copy-trading</name>
<version>1.2.1</version>
<version>1.2.2</version>
<packaging>jar</packaging>

<parent>
<groupId>io.github.binance</groupId>
<artifactId>binance-connector-java-clients</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>

<build>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-common</artifactId>
<version>2.0.0</version>
<version>2.4.2</version>
</dependency>
</dependencies>
</project>
3 changes: 3 additions & 0 deletions clients/crypto-loan/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 4.0.1 - 2026-04-30
- Update `binance/common` module to version `2.4.2`.

## 4.0.0 - 2026-02-12

### Added (1)
Expand Down
6 changes: 3 additions & 3 deletions clients/crypto-loan/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>binance-crypto-loan</artifactId>
<name>crypto-loan</name>
<version>4.0.0</version>
<version>4.0.1</version>
<packaging>jar</packaging>

<parent>
<groupId>io.github.binance</groupId>
<artifactId>binance-connector-java-clients</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>

<build>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-common</artifactId>
<version>2.3.1</version>
<version>2.4.2</version>
</dependency>
</dependencies>
</project>
3 changes: 3 additions & 0 deletions clients/derivatives-trading-coin-futures/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 7.0.1 - 2026-04-30
- Update `binance/common` module to version `2.4.2`.

## 7.0.0 - 2026-03-18

### Changed (1)
Expand Down
6 changes: 3 additions & 3 deletions clients/derivatives-trading-coin-futures/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>binance-derivatives-trading-coin-futures</artifactId>
<name>derivatives-trading-coin-futures</name>
<version>7.0.0</version>
<version>7.0.1</version>
<packaging>jar</packaging>

<parent>
<groupId>io.github.binance</groupId>
<artifactId>binance-connector-java-clients</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>

<build>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-common</artifactId>
<version>2.4.1</version>
<version>2.4.2</version>
</dependency>
</dependencies>
</project>
3 changes: 3 additions & 0 deletions clients/derivatives-trading-options/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 7.0.1 - 2026-04-30
- Update `binance/common` module to version `2.4.2`.

## 6.0.0 - 2026-03-18

### Changed (1)
Expand Down
Loading
Loading