All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.binance.connector.client.impl.spot.Savings Maven / Gradle / Ivy

package com.binance.connector.client.impl.spot;

import com.binance.connector.client.enums.HttpMethod;
import com.binance.connector.client.utils.HmacSignatureGenerator;
import com.binance.connector.client.utils.ParameterChecker;
import com.binance.connector.client.utils.RequestHandler;
import com.binance.connector.client.utils.SignatureGenerator;
import java.util.LinkedHashMap;

/**
 * 

Savings Endpoints

* All endpoints under the * Savings Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. */ public class Savings { private final String baseUrl; private final RequestHandler requestHandler; private final boolean showLimitUsage; public Savings(String baseUrl, String apiKey, String secretKey, boolean showLimitUsage) { this.baseUrl = baseUrl; this.requestHandler = new RequestHandler(apiKey, new HmacSignatureGenerator(secretKey)); this.showLimitUsage = showLimitUsage; } public Savings(String baseUrl, String apiKey, SignatureGenerator signatureGenerator, boolean showLimitUsage) { this.baseUrl = baseUrl; this.requestHandler = new RequestHandler(apiKey, signatureGenerator); this.showLimitUsage = showLimitUsage; } private final String FLEXIBLE_PRODUCT = "/sapi/v1/lending/daily/product/list"; /** * GET /sapi/v1/lending/daily/product/list *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* status -- optional/enum -- "ALL", "SUBSCRIBABLE", "UNSUBSCRIBABLE"; Default: "ALL"
* featured -- optional/string -- "ALL", "TRUE"; Default: "ALL"
* current -- optional/long -- Current query page. Default: 1, Min: 1
* size -- optional/long -- Default: 50, Max: 100
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#get-flexible-product-list-user_data */ public String flexibleProducts(LinkedHashMap parameters) { return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_PRODUCT, parameters, HttpMethod.GET, showLimitUsage); } private final String PURCHASE_QUOTA = "/sapi/v1/lending/daily/userLeftQuota"; /** * GET /sapi/v1/lending/daily/userLeftQuota *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* productId -- mandatory/string
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#get-left-daily-purchase-quota-of-flexible-product-user_data */ public String purchaseQuotaFlexible(LinkedHashMap parameters) { ParameterChecker.checkParameter(parameters, "productId", String.class); return requestHandler.sendSignedRequest(baseUrl, PURCHASE_QUOTA, parameters, HttpMethod.GET, showLimitUsage); } private final String PURCHASE_PRODUCT = "/sapi/v1/lending/daily/purchase"; /** * POST /sapi/v1/lending/daily/purchase *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* productId -- mandatory/string
* amount -- mandatory/decimal
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#purchase-flexible-product-user_data */ public String purchaseFlexibleProduct(LinkedHashMap parameters) { ParameterChecker.checkParameter(parameters, "productId", String.class); ParameterChecker.checkRequiredParameter(parameters, "amount"); return requestHandler.sendSignedRequest(baseUrl, PURCHASE_PRODUCT, parameters, HttpMethod.POST, showLimitUsage); } private final String DAILY_REDEMPTION_QUOTA = "/sapi/v1/lending/daily/userRedemptionQuota"; /** * GET /sapi/v1/lending/daily/userRedemptionQuota *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* productId -- mandatory/string
* type -- mandatory/enum -- "FAST", "NORMAL"
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#get-left-daily-redemption-quota-of-flexible-product-user_data */ public String dailyRedemptionQuota(LinkedHashMap parameters) { ParameterChecker.checkParameter(parameters, "productId", String.class); ParameterChecker.checkParameter(parameters, "type", String.class); return requestHandler.sendSignedRequest(baseUrl, DAILY_REDEMPTION_QUOTA, parameters, HttpMethod.GET, showLimitUsage); } private final String REDEEM_PRODUCT = "/sapi/v1/lending/daily/redeem"; /** * POST /sapi/v1/lending/daily/redeem *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* productId -- mandatory/string
* amount -- mandatory/decimal
* type -- mandatory/enum -- "FAST", "NORMAL"
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#redeem-flexible-product-user_data */ public String redeemFlexibleProduct(LinkedHashMap parameters) { ParameterChecker.checkParameter(parameters, "productId", String.class); ParameterChecker.checkRequiredParameter(parameters, "amount"); ParameterChecker.checkParameter(parameters, "type", String.class); return requestHandler.sendSignedRequest(baseUrl, REDEEM_PRODUCT, parameters, HttpMethod.POST, showLimitUsage); } private final String PRODUCT_POSTION = "/sapi/v1/lending/daily/token/position"; /** * GET /sapi/v1/lending/daily/token/position *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* asset -- optional/string
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#get-flexible-product-position-user_data */ public String flexibleProductPosition(LinkedHashMap parameters) { return requestHandler.sendSignedRequest(baseUrl, PRODUCT_POSTION, parameters, HttpMethod.GET, showLimitUsage); } private final String ACTIVITY_PROJECT = "/sapi/v1/lending/project/list"; /** * GET /sapi/v1/lending/project/list *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* asset -- optional/string
* type -- mandatory/enum -- "ACTIVITY", "CUSTOMIZED_FIXED"
* status -- optional/enum -- "ALL", "SUBSCRIBABLE", "UNSUBSCRIBABLE"; default "ALL"
* isSortAsc -- optional/boolean -- default "true"
* sortBy -- optional/enum -- "START_TIME", "LOT_SIZE", "INTEREST_RATE", "DURATION"; default "START_TIME"
* current -- optional/long -- Currently querying page. Start from 1. Default:1
* size -- optional/long -- Default:10, Max:100
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#get-fixed-and-activity-project-list-user_data */ public String projectList(LinkedHashMap parameters) { ParameterChecker.checkParameter(parameters, "type", String.class); return requestHandler.sendSignedRequest(baseUrl, ACTIVITY_PROJECT, parameters, HttpMethod.GET, showLimitUsage); } private final String PURCHASE_ACTIVITY = "/sapi/v1/lending/customizedFixed/purchase"; /** * POST /sapi/v1/lending/customizedFixed/purchase *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* projectId -- mandatory/string
* lot -- mandatory/long
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#purchase-fixed-activity-project-user_data */ public String purchaseProject(LinkedHashMap parameters) { ParameterChecker.checkParameter(parameters, "projectId", String.class); ParameterChecker.checkParameter(parameters, "lot", Long.class); return requestHandler.sendSignedRequest(baseUrl, PURCHASE_ACTIVITY, parameters, HttpMethod.POST, showLimitUsage); } private final String PROJECT_POSITION = "/sapi/v1/lending/project/position/list"; /** * GET /sapi/v1/lending/project/position/list *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* asset -- optional/string
* projectId -- optional/string
* status -- optional/enum -- "HOLDING", "REDEEMED"
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#get-fixed-activity-project-position-user_data */ public String projectPosition(LinkedHashMap parameters) { return requestHandler.sendSignedRequest(baseUrl, PROJECT_POSITION, parameters, HttpMethod.GET, showLimitUsage); } private final String LENDING_ACCOUNT = "/sapi/v1/lending/union/account"; /** * GET /sapi/v1/lending/union/account *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#lending-account-user_data */ public String lendingAccount(LinkedHashMap parameters) { return requestHandler.sendSignedRequest(baseUrl, LENDING_ACCOUNT, parameters, HttpMethod.GET, showLimitUsage); } private final String PURCHASE_RECORD = "/sapi/v1/lending/union/purchaseRecord"; /** * GET /sapi/v1/lending/union/purchaseRecord *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* lendingType -- mandatory/enum -- "DAILY" for flexible, "ACTIVITY" for activity, "CUSTOMIZED_FIXED" for fixed
* asset -- optional/string
* startTime -- optional/long
* endTime -- optional/long
* current -- optional/long -- Currently querying page. Start from 1. Default:1
* size -- optional/long -- Default:10, Max:100
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#get-purchase-record-user_data */ public String purchaseRecord(LinkedHashMap parameters) { ParameterChecker.checkParameter(parameters, "lendingType", String.class); return requestHandler.sendSignedRequest(baseUrl, PURCHASE_RECORD, parameters, HttpMethod.GET, showLimitUsage); } private final String REDEMPTION_RECORD = "/sapi/v1/lending/union/redemptionRecord"; /** * GET /sapi/v1/lending/union/redemptionRecord *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* lendingType -- mandatory/enum -- "DAILY" for flexible, "ACTIVITY" for activity, "CUSTOMIZED_FIXED" for fixed
* asset -- optional/string
* startTime -- optional/long
* endTime -- optional/long
* current -- optional/long -- Currently querying page. Start from 1. Default:1
* size -- optional/long -- Default:10, Max:100
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#get-redemption-record-user_data */ public String redemptionRecord(LinkedHashMap parameters) { ParameterChecker.checkParameter(parameters, "lendingType", String.class); return requestHandler.sendSignedRequest(baseUrl, REDEMPTION_RECORD, parameters, HttpMethod.GET, showLimitUsage); } private final String INTEREST_HISTORY = "/sapi/v1/lending/union/interestHistory"; /** * GET /sapi/v1/lending/union/interestHistory *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* lendingType -- mandatory/enum -- "DAILY" for flexible, "ACTIVITY" for activity, "CUSTOMIZED_FIXED" for fixed
* asset -- optional/string
* startTime -- optional/long
* endTime -- optional/long
* current -- optional/long -- Currently querying page. Start from 1. Default:1
* size -- optional/long -- Default:10, Max:100
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#get-interest-history-user_data-2 */ public String interestHistory(LinkedHashMap parameters) { ParameterChecker.checkParameter(parameters, "lendingType", String.class); return requestHandler.sendSignedRequest(baseUrl, INTEREST_HISTORY, parameters, HttpMethod.GET, showLimitUsage); } private final String CHANGE_TO_DAILY_POSITION = "/sapi/v1/lending/positionChanged"; /** * POST /sapi/v1/lending/positionChanged *
* @param * parameters LinkedHashedMap of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

* projectId -- mandatory/string
* lot -- mandatory/long
* positionId -- optional/long -- for fixed position
* recvWindow -- optional/long
* @return String * @see * https://binance-docs.github.io/apidocs/spot/en/#change-fixed-activity-position-to-daily-position-user_data */ public String changeToDailyPosition(LinkedHashMap parameters) { ParameterChecker.checkParameter(parameters, "projectId", String.class); ParameterChecker.checkParameter(parameters, "lot", Long.class); return requestHandler.sendSignedRequest(baseUrl, CHANGE_TO_DAILY_POSITION, parameters, HttpMethod.POST, showLimitUsage); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy