com.binance.connector.client.impl.spot.NFT Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of binance-connector-java Show documentation
Show all versions of binance-connector-java Show documentation
lightweight connector to API
package com.binance.connector.client.impl.spot;
import java.util.Map;
import com.binance.connector.client.enums.HttpMethod;
import com.binance.connector.client.utils.ParameterChecker;
import com.binance.connector.client.utils.ProxyAuth;
import com.binance.connector.client.utils.RequestHandler;
import com.binance.connector.client.utils.signaturegenerator.HmacSignatureGenerator;
import com.binance.connector.client.utils.signaturegenerator.SignatureGenerator;
/**
* NFT Endpoints
* All endpoints under the
* NFT Endpoint
* section of the API documentation will be implemented in this class.
*
* Response will be returned in String format.
*/
public class NFT {
private final String baseUrl;
private final RequestHandler requestHandler;
private final boolean showLimitUsage;
public NFT(String baseUrl, String apiKey, String secretKey, boolean showLimitUsage, ProxyAuth proxy) {
this.baseUrl = baseUrl;
this.requestHandler = new RequestHandler(apiKey, new HmacSignatureGenerator(secretKey), proxy);
this.showLimitUsage = showLimitUsage;
}
public NFT(String baseUrl, String apiKey, SignatureGenerator signatureGenerator, boolean showLimitUsage, ProxyAuth proxy) {
this.baseUrl = baseUrl;
this.requestHandler = new RequestHandler(apiKey, signatureGenerator, proxy);
this.showLimitUsage = showLimitUsage;
}
private final String TRANSACTIONS = "/sapi/v1/nft/history/transactions";
/**
* GET /sapi/v1/pay/transactions
*
* @param
* parameters Map of String,Object pair
* where String is the name of the parameter and Object is the value of the parameter
*
* orderType -- mandatory/int -- 0: purchase order, 1: sell order, 2: royalty income,
* 3: primary market order, 4: mint fee
* startTime -- optional/long
* endTime -- optional/long
* limit -- optional/int -- Default 50, Max 50
* page -- optional/int -- Default 1
* recvWindow -- optional/long
* @return String
* @see
* https://binance-docs.github.io/apidocs/spot/en/#get-nft-transaction-history-user_data
*/
public String transactionsHistory(Map parameters) {
ParameterChecker.checkParameter(parameters, "orderType", Integer.class);
return requestHandler.sendSignedRequest(baseUrl, TRANSACTIONS, parameters, HttpMethod.GET, showLimitUsage);
}
private final String DEPOSIT = "/sapi/v1/nft/history/deposit";
/**
* GET /sapi/v1/nft/history/deposit
*
* @param
* parameters Map of String,Object pair
* where String is the name of the parameter and Object is the value of the parameter
*
* startTime -- optional/long
* endTime -- optional/long
* limit -- optional/int -- Default 50, Max 50
* page -- optional/int -- Default 1
* recvWindow -- optional/long
* @return String
* @see
* https://binance-docs.github.io/apidocs/spot/en/#get-nft-deposit-history-user_data
*/
public String depositHistory(Map parameters) {
return requestHandler.sendSignedRequest(baseUrl, DEPOSIT, parameters, HttpMethod.GET, showLimitUsage);
}
private final String WITHDRAW = "/sapi/v1/nft/history/withdraw";
/**
* GET /sapi/v1/nft/history/withdraw
*
* @param
* parameters Map of String,Object pair
* where String is the name of the parameter and Object is the value of the parameter
*
* startTime -- optional/long
* endTime -- optional/long
* limit -- optional/int -- Default 50, Max 50
* page -- optional/int -- Default 1
* recvWindow -- optional/long
* @return String
* @see
* https://binance-docs.github.io/apidocs/spot/en/#get-nft-withdraw-history-user_data
*/
public String withdrawHistory(Map parameters) {
return requestHandler.sendSignedRequest(baseUrl, WITHDRAW, parameters, HttpMethod.GET, showLimitUsage);
}
private final String GET_ASSET = "/sapi/v1/nft/user/getAsset";
/**
* GET /sapi/v1/nft/user/getAsset
*
* @param
* parameters Map of String,Object pair
* where String is the name of the parameter and Object is the value of the parameter
*
* limit -- optional/int -- Default 50, Max 50
* page -- optional/int -- Default 1
* recvWindow -- optional/long
* @return String
* @see
* https://binance-docs.github.io/apidocs/spot/en/#get-nft-asset-user_data
*/
public String getAsset(Map parameters) {
return requestHandler.sendSignedRequest(baseUrl, GET_ASSET, parameters, HttpMethod.GET, showLimitUsage);
}
}