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/web3-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<artifactId>binance-web3-common</artifactId>
<name>web3-common</name>
<version>1.0.0</version>
<version>1.1.0</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void applyToParams(
allParametersAsString += payload;
}

String preHash = timestamp + method + uri.getPath() + "?" + allParametersAsString;
String preHash = timestamp + method + uri.getPath() + (StringUtils.isNotEmpty(allParametersAsString) ? "?" + allParametersAsString : "");
try {
headerParams.put("X-OC-SIGN", Base64.getEncoder().encodeToString(generator.sign(preHash)));
} catch (CryptoException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
/*
* Binance Web3 API
* Cross-chain wallet, market, trading, transaction, and B402 payment APIs for the Binance Web3 API platform.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package com.binance.connector.client.web3.common.dtos;

import com.google.gson.annotations.SerializedName;
import jakarta.validation.Valid;

import java.util.Objects;

/** GetWebSocketAuthTokenResponse */
public class GetWebSocketAuthTokenResponse {
public static final String SERIALIZED_NAME_CODE = "code";

@SerializedName(SERIALIZED_NAME_CODE)
@jakarta.annotation.Nullable
private Integer code;

public static final String SERIALIZED_NAME_MSG = "msg";

@SerializedName(SERIALIZED_NAME_MSG)
@jakarta.annotation.Nullable
private String msg;

public static final String SERIALIZED_NAME_DATA = "data";

@SerializedName(SERIALIZED_NAME_DATA)
@jakarta.annotation.Nullable
private GetWebSocketAuthTokenResponseData data;

public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp";

@SerializedName(SERIALIZED_NAME_TIMESTAMP)
@jakarta.annotation.Nullable
private Long timestamp;

public static final String SERIALIZED_NAME_SUCCESS = "success";

@SerializedName(SERIALIZED_NAME_SUCCESS)
@jakarta.annotation.Nullable
private Boolean success;

public GetWebSocketAuthTokenResponse() {}

public GetWebSocketAuthTokenResponse code(@jakarta.annotation.Nullable Integer code) {
this.code = code;
return this;
}

/**
* Response code. 0 indicates success.
*
* @return code
*/
@jakarta.annotation.Nullable
public Integer getCode() {
return code;
}

public void setCode(@jakarta.annotation.Nullable Integer code) {
this.code = code;
}

public GetWebSocketAuthTokenResponse msg(@jakarta.annotation.Nullable String msg) {
this.msg = msg;
return this;
}

/**
* Response message.
*
* @return msg
*/
@jakarta.annotation.Nullable
public String getMsg() {
return msg;
}

public void setMsg(@jakarta.annotation.Nullable String msg) {
this.msg = msg;
}

public GetWebSocketAuthTokenResponse data(
@jakarta.annotation.Nullable GetWebSocketAuthTokenResponseData data) {
this.data = data;
return this;
}

/**
* Get data
*
* @return data
*/
@jakarta.annotation.Nullable
@Valid
public GetWebSocketAuthTokenResponseData getData() {
return data;
}

public void setData(@jakarta.annotation.Nullable GetWebSocketAuthTokenResponseData data) {
this.data = data;
}

public GetWebSocketAuthTokenResponse timestamp(@jakarta.annotation.Nullable Long timestamp) {
this.timestamp = timestamp;
return this;
}

/**
* Server timestamp in milliseconds.
*
* @return timestamp
*/
@jakarta.annotation.Nullable
public Long getTimestamp() {
return timestamp;
}

public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) {
this.timestamp = timestamp;
}

public GetWebSocketAuthTokenResponse success(@jakarta.annotation.Nullable Boolean success) {
this.success = success;
return this;
}

/**
* Whether the request was successful.
*
* @return success
*/
@jakarta.annotation.Nullable
public Boolean getSuccess() {
return success;
}

public void setSuccess(@jakarta.annotation.Nullable Boolean success) {
this.success = success;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetWebSocketAuthTokenResponse getWebSocketAuthTokenResponse =
(GetWebSocketAuthTokenResponse) o;
return Objects.equals(this.code, getWebSocketAuthTokenResponse.code)
&& Objects.equals(this.msg, getWebSocketAuthTokenResponse.msg)
&& Objects.equals(this.data, getWebSocketAuthTokenResponse.data)
&& Objects.equals(this.timestamp, getWebSocketAuthTokenResponse.timestamp)
&& Objects.equals(this.success, getWebSocketAuthTokenResponse.success);
}

@Override
public int hashCode() {
return Objects.hash(code, msg, data, timestamp, success);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* Binance Web3 API
* Cross-chain wallet, market, trading, transaction, and B402 payment APIs for the Binance Web3 API platform.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package com.binance.connector.client.web3.common.dtos;

import com.google.gson.annotations.SerializedName;

import java.util.Objects;

/** GetWebSocketAuthTokenResponseData */
public class GetWebSocketAuthTokenResponseData {
public static final String SERIALIZED_NAME_TOKEN = "token";

@SerializedName(SERIALIZED_NAME_TOKEN)
@jakarta.annotation.Nullable
private String token;

public GetWebSocketAuthTokenResponseData() {}

public GetWebSocketAuthTokenResponseData token(@jakarta.annotation.Nullable String token) {
this.token = token;
return this;
}

/**
* WebSocket auth token (JWT).
*
* @return token
*/
@jakarta.annotation.Nullable
public String getToken() {
return token;
}

public void setToken(@jakarta.annotation.Nullable String token) {
this.token = token;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetWebSocketAuthTokenResponseData getWebSocketAuthTokenResponseData =
(GetWebSocketAuthTokenResponseData) o;
return Objects.equals(this.token, getWebSocketAuthTokenResponseData.token);
}

@Override
public int hashCode() {
return Objects.hash(token);
}
}
Loading
Loading