com.binance.connector.client.impl.spot.Fiat 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;
/**
* Fiat Endpoints
* All endpoints under the
* Fiat Endpoint
* section of the API documentation will be implemented in this class.
*
* Response will be returned in String format.
*/
public class Fiat {
private final String baseUrl;
private final RequestHandler requestHandler;
private final boolean showLimitUsage;
public Fiat(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 Fiat(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 ORDERS = "/sapi/v1/fiat/orders";
/**
* GET /sapi/v1/fiat/orders
*
* @param
* parameters Map of String,Object pair
* where String is the name of the parameter and Object is the value of the parameter
*
* transactionType -- mandatory/string -- 0-deposit,1-withdraw
* beginTime -- optional/long
* endTime -- optional/long
* page -- optional/int -- default 1
* rows -- optional/int -- default 100, max 500
* recvWindow -- optional/long
* @return String
* @see
* https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
*/
public String orders(Map parameters) {
ParameterChecker.checkParameter(parameters, "transactionType", String.class);
return requestHandler.sendSignedRequest(baseUrl, ORDERS, parameters, HttpMethod.GET, showLimitUsage);
}
private final String PAYMENTS = "/sapi/v1/fiat/payments";
/**
* GET /sapi/v1/fiat/payments
*
* @param
* parameters Map of String,Object pair
* where String is the name of the parameter and Object is the value of the parameter
*
* transactionType -- mandatory/string -- 0-buy,1-sell
* beginTime -- optional/long
* endTime -- optional/long
* page -- optional/int -- default 1
* rows -- optional/int -- default 100, max 500
* recvWindow -- optional/long
* @return String
* @see
* https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History
*/
public String payments(Map parameters) {
ParameterChecker.checkParameter(parameters, "transactionType", String.class);
return requestHandler.sendSignedRequest(baseUrl, PAYMENTS, parameters, HttpMethod.GET, showLimitUsage);
}
}