@@ -42,7 +42,7 @@ public class C2CApi {
4242
4343 private static final String USER_AGENT =
4444 String .format (
45- "binance-c2c/1.2.1 (Java/%s; %s; %s)" ,
45+ "binance-c2c/2.0.0 (Java/%s; %s; %s)" ,
4646 SystemUtil .getJavaVersion (), SystemUtil .getOs (), SystemUtil .getArch ());
4747 private static final boolean HAS_TIME_UNIT = false ;
4848
@@ -82,9 +82,11 @@ public void setCustomBaseUrl(String customBaseUrl) {
8282 /**
8383 * Build call for getC2CTradeHistory
8484 *
85- * @param startTime (optional)
86- * @param endTime (optional)
85+ * @param tradeType BUY, SELL (optional)
86+ * @param startTimestamp (optional)
87+ * @param endTimestamp (optional)
8788 * @param page Default 1 (optional)
89+ * @param rows default 100, max 100 (optional)
8890 * @param recvWindow (optional)
8991 * @return Call to execute
9092 * @throws ApiException If fail to serialize the request body object
@@ -99,7 +101,13 @@ public void setCustomBaseUrl(String customBaseUrl) {
99101 * Trade History (USER_DATA) Documentation</a>
100102 */
101103 private okhttp3 .Call getC2CTradeHistoryCall (
102- Long startTime , Long endTime , Long page , Long recvWindow ) throws ApiException {
104+ String tradeType ,
105+ Long startTimestamp ,
106+ Long endTimestamp ,
107+ Long page ,
108+ Long rows ,
109+ Long recvWindow )
110+ throws ApiException {
103111 String basePath = null ;
104112 // Operation Servers
105113 String [] localBasePaths = new String [] {};
@@ -124,18 +132,28 @@ private okhttp3.Call getC2CTradeHistoryCall(
124132 Map <String , String > localVarCookieParams = new HashMap <String , String >();
125133 Map <String , Object > localVarFormParams = new HashMap <String , Object >();
126134
127- if (startTime != null ) {
128- localVarQueryParams .addAll (localVarApiClient .parameterToPair ("startTime " , startTime ));
135+ if (tradeType != null ) {
136+ localVarQueryParams .addAll (localVarApiClient .parameterToPair ("tradeType " , tradeType ));
129137 }
130138
131- if (endTime != null ) {
132- localVarQueryParams .addAll (localVarApiClient .parameterToPair ("endTime" , endTime ));
139+ if (startTimestamp != null ) {
140+ localVarQueryParams .addAll (
141+ localVarApiClient .parameterToPair ("startTimestamp" , startTimestamp ));
142+ }
143+
144+ if (endTimestamp != null ) {
145+ localVarQueryParams .addAll (
146+ localVarApiClient .parameterToPair ("endTimestamp" , endTimestamp ));
133147 }
134148
135149 if (page != null ) {
136150 localVarQueryParams .addAll (localVarApiClient .parameterToPair ("page" , page ));
137151 }
138152
153+ if (rows != null ) {
154+ localVarQueryParams .addAll (localVarApiClient .parameterToPair ("rows" , rows ));
155+ }
156+
139157 if (recvWindow != null ) {
140158 localVarQueryParams .addAll (localVarApiClient .parameterToPair ("recvWindow" , recvWindow ));
141159 }
@@ -172,7 +190,13 @@ private okhttp3.Call getC2CTradeHistoryCall(
172190
173191 @ SuppressWarnings ("rawtypes" )
174192 private okhttp3 .Call getC2CTradeHistoryValidateBeforeCall (
175- Long startTime , Long endTime , Long page , Long recvWindow ) throws ApiException {
193+ String tradeType ,
194+ Long startTimestamp ,
195+ Long endTimestamp ,
196+ Long page ,
197+ Long rows ,
198+ Long recvWindow )
199+ throws ApiException {
176200 try {
177201 Validator validator =
178202 Validation .byDefaultProvider ()
@@ -182,11 +206,15 @@ private okhttp3.Call getC2CTradeHistoryValidateBeforeCall(
182206 .getValidator ();
183207 ExecutableValidator executableValidator = validator .forExecutables ();
184208
185- Object [] parameterValues = {startTime , endTime , page , recvWindow };
209+ Object [] parameterValues = {
210+ tradeType , startTimestamp , endTimestamp , page , rows , recvWindow
211+ };
186212 Method method =
187213 this .getClass ()
188214 .getMethod (
189215 "getC2CTradeHistory" ,
216+ String .class ,
217+ Long .class ,
190218 Long .class ,
191219 Long .class ,
192220 Long .class ,
@@ -195,7 +223,8 @@ private okhttp3.Call getC2CTradeHistoryValidateBeforeCall(
195223 executableValidator .validateParameters (this , method , parameterValues );
196224
197225 if (violations .size () == 0 ) {
198- return getC2CTradeHistoryCall (startTime , endTime , page , recvWindow );
226+ return getC2CTradeHistoryCall (
227+ tradeType , startTimestamp , endTimestamp , page , rows , recvWindow );
199228 } else {
200229 throw new ConstraintViolationException ((Set ) violations );
201230 }
@@ -209,14 +238,16 @@ private okhttp3.Call getC2CTradeHistoryValidateBeforeCall(
209238 }
210239
211240 /**
212- * Get C2C Trade History (USER_DATA) Get C2C Trade History * The max interval between startTime
213- * and endTime is 30 days. * If startTime and endTime are not sent, the recent 7 days' data
214- * will be returned. * The earliest startTime is supported on June 10, 2020 * Return up to 200
215- * records per request. Weight: 1
241+ * Get C2C Trade History (USER_DATA) Get C2C Trade History * The max interval between
242+ * startTimestamp and endTimestamp is 30 days. * If startTimestamp and endTimestamp are not
243+ * sent, the recent 30 days' data will be returned. * You can only view data from the past 6
244+ * months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder Weight: 1
216245 *
217- * @param startTime (optional)
218- * @param endTime (optional)
246+ * @param tradeType BUY, SELL (optional)
247+ * @param startTimestamp (optional)
248+ * @param endTimestamp (optional)
219249 * @param page Default 1 (optional)
250+ * @param rows default 100, max 100 (optional)
220251 * @param recvWindow (optional)
221252 * @return ApiResponse<GetC2CTradeHistoryResponse>
222253 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
@@ -232,9 +263,16 @@ private okhttp3.Call getC2CTradeHistoryValidateBeforeCall(
232263 * Trade History (USER_DATA) Documentation</a>
233264 */
234265 public ApiResponse <GetC2CTradeHistoryResponse > getC2CTradeHistory (
235- Long startTime , Long endTime , Long page , Long recvWindow ) throws ApiException {
266+ String tradeType ,
267+ Long startTimestamp ,
268+ Long endTimestamp ,
269+ Long page ,
270+ Long rows ,
271+ Long recvWindow )
272+ throws ApiException {
236273 okhttp3 .Call localVarCall =
237- getC2CTradeHistoryValidateBeforeCall (startTime , endTime , page , recvWindow );
274+ getC2CTradeHistoryValidateBeforeCall (
275+ tradeType , startTimestamp , endTimestamp , page , rows , recvWindow );
238276 java .lang .reflect .Type localVarReturnType =
239277 new TypeToken <GetC2CTradeHistoryResponse >() {}.getType ();
240278 return localVarApiClient .execute (localVarCall , localVarReturnType );
0 commit comments