@binance/c2c 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,9 @@
1
- import { RestApiResponse, ConfigurationRestAPI } from '@binance/common';
2
- export { BadRequestError, C2C_REST_API_PROD_URL, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError } from '@binance/common';
1
+ import { BadRequestError, C2C_REST_API_PROD_URL, ConfigurationRestAPI, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, RestApiResponse, ServerError, TooManyRequestsError, UnauthorizedError } from "@binance/common";
3
2
 
3
+ //#region rolldown:runtime
4
+
5
+ //#endregion
6
+ //#region src/rest-api/types/get-c2-ctrade-history-response-data-inner.d.ts
4
7
  /**
5
8
  * Binance C2C REST API
6
9
  *
@@ -19,332 +22,276 @@ export { BadRequestError, C2C_REST_API_PROD_URL, ConnectorClientError, Forbidden
19
22
  * @interface GetC2CTradeHistoryResponseDataInner
20
23
  */
21
24
  interface GetC2CTradeHistoryResponseDataInner {
22
- /**
23
- *
24
- * @type {string}
25
- * @memberof GetC2CTradeHistoryResponseDataInner
26
- */
27
- orderNumber?: string;
28
- /**
29
- *
30
- * @type {string}
31
- * @memberof GetC2CTradeHistoryResponseDataInner
32
- */
33
- advNo?: string;
34
- /**
35
- *
36
- * @type {string}
37
- * @memberof GetC2CTradeHistoryResponseDataInner
38
- */
39
- tradeType?: string;
40
- /**
41
- *
42
- * @type {string}
43
- * @memberof GetC2CTradeHistoryResponseDataInner
44
- */
45
- asset?: string;
46
- /**
47
- *
48
- * @type {string}
49
- * @memberof GetC2CTradeHistoryResponseDataInner
50
- */
51
- fiat?: string;
52
- /**
53
- *
54
- * @type {string}
55
- * @memberof GetC2CTradeHistoryResponseDataInner
56
- */
57
- fiatSymbol?: string;
58
- /**
59
- *
60
- * @type {string}
61
- * @memberof GetC2CTradeHistoryResponseDataInner
62
- */
63
- amount?: string;
64
- /**
65
- *
66
- * @type {string}
67
- * @memberof GetC2CTradeHistoryResponseDataInner
68
- */
69
- totalPrice?: string;
70
- /**
71
- *
72
- * @type {string}
73
- * @memberof GetC2CTradeHistoryResponseDataInner
74
- */
75
- unitPrice?: string;
76
- /**
77
- *
78
- * @type {string}
79
- * @memberof GetC2CTradeHistoryResponseDataInner
80
- */
81
- orderStatus?: string;
82
- /**
83
- *
84
- * @type {number | bigint}
85
- * @memberof GetC2CTradeHistoryResponseDataInner
86
- */
87
- createTime?: number | bigint;
88
- /**
89
- *
90
- * @type {string}
91
- * @memberof GetC2CTradeHistoryResponseDataInner
92
- */
93
- commission?: string;
94
- /**
95
- *
96
- * @type {string}
97
- * @memberof GetC2CTradeHistoryResponseDataInner
98
- */
99
- counterPartNickName?: string;
100
- /**
101
- *
102
- * @type {string}
103
- * @memberof GetC2CTradeHistoryResponseDataInner
104
- */
105
- advertisementRole?: string;
25
+ /**
26
+ *
27
+ * @type {string}
28
+ * @memberof GetC2CTradeHistoryResponseDataInner
29
+ */
30
+ orderNumber?: string;
31
+ /**
32
+ *
33
+ * @type {string}
34
+ * @memberof GetC2CTradeHistoryResponseDataInner
35
+ */
36
+ advNo?: string;
37
+ /**
38
+ *
39
+ * @type {string}
40
+ * @memberof GetC2CTradeHistoryResponseDataInner
41
+ */
42
+ tradeType?: string;
43
+ /**
44
+ *
45
+ * @type {string}
46
+ * @memberof GetC2CTradeHistoryResponseDataInner
47
+ */
48
+ asset?: string;
49
+ /**
50
+ *
51
+ * @type {string}
52
+ * @memberof GetC2CTradeHistoryResponseDataInner
53
+ */
54
+ fiat?: string;
55
+ /**
56
+ *
57
+ * @type {string}
58
+ * @memberof GetC2CTradeHistoryResponseDataInner
59
+ */
60
+ fiatSymbol?: string;
61
+ /**
62
+ *
63
+ * @type {string}
64
+ * @memberof GetC2CTradeHistoryResponseDataInner
65
+ */
66
+ amount?: string;
67
+ /**
68
+ *
69
+ * @type {string}
70
+ * @memberof GetC2CTradeHistoryResponseDataInner
71
+ */
72
+ totalPrice?: string;
73
+ /**
74
+ *
75
+ * @type {string}
76
+ * @memberof GetC2CTradeHistoryResponseDataInner
77
+ */
78
+ unitPrice?: string;
79
+ /**
80
+ *
81
+ * @type {string}
82
+ * @memberof GetC2CTradeHistoryResponseDataInner
83
+ */
84
+ orderStatus?: string;
85
+ /**
86
+ *
87
+ * @type {number | bigint}
88
+ * @memberof GetC2CTradeHistoryResponseDataInner
89
+ */
90
+ createTime?: number | bigint;
91
+ /**
92
+ *
93
+ * @type {string}
94
+ * @memberof GetC2CTradeHistoryResponseDataInner
95
+ */
96
+ commission?: string;
97
+ /**
98
+ *
99
+ * @type {string}
100
+ * @memberof GetC2CTradeHistoryResponseDataInner
101
+ */
102
+ counterPartNickName?: string;
103
+ /**
104
+ *
105
+ * @type {string}
106
+ * @memberof GetC2CTradeHistoryResponseDataInner
107
+ */
108
+ advertisementRole?: string;
106
109
  }
107
-
108
- /**
109
- * Binance C2C REST API
110
- *
111
- * OpenAPI Specification for the Binance C2C REST API
112
- *
113
- * The version of the OpenAPI document: 1.0.0
114
- *
115
- *
116
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
117
- * https://openapi-generator.tech
118
- * Do not edit the class manually.
119
- */
120
-
110
+ //#endregion
111
+ //#region src/rest-api/types/get-c2-ctrade-history-response.d.ts
121
112
  /**
122
113
  *
123
114
  * @export
124
115
  * @interface GetC2CTradeHistoryResponse
125
116
  */
126
117
  interface GetC2CTradeHistoryResponse {
127
- /**
128
- *
129
- * @type {string}
130
- * @memberof GetC2CTradeHistoryResponse
131
- */
132
- code?: string;
133
- /**
134
- *
135
- * @type {string}
136
- * @memberof GetC2CTradeHistoryResponse
137
- */
138
- message?: string;
139
- /**
140
- *
141
- * @type {Array<GetC2CTradeHistoryResponseDataInner>}
142
- * @memberof GetC2CTradeHistoryResponse
143
- */
144
- data?: Array<GetC2CTradeHistoryResponseDataInner>;
145
- /**
146
- *
147
- * @type {number | bigint}
148
- * @memberof GetC2CTradeHistoryResponse
149
- */
150
- total?: number | bigint;
151
- /**
152
- *
153
- * @type {boolean}
154
- * @memberof GetC2CTradeHistoryResponse
155
- */
156
- success?: boolean;
118
+ /**
119
+ *
120
+ * @type {string}
121
+ * @memberof GetC2CTradeHistoryResponse
122
+ */
123
+ code?: string;
124
+ /**
125
+ *
126
+ * @type {string}
127
+ * @memberof GetC2CTradeHistoryResponse
128
+ */
129
+ message?: string;
130
+ /**
131
+ *
132
+ * @type {Array<GetC2CTradeHistoryResponseDataInner>}
133
+ * @memberof GetC2CTradeHistoryResponse
134
+ */
135
+ data?: Array<GetC2CTradeHistoryResponseDataInner>;
136
+ /**
137
+ *
138
+ * @type {number | bigint}
139
+ * @memberof GetC2CTradeHistoryResponse
140
+ */
141
+ total?: number | bigint;
142
+ /**
143
+ *
144
+ * @type {boolean}
145
+ * @memberof GetC2CTradeHistoryResponse
146
+ */
147
+ success?: boolean;
157
148
  }
158
-
159
- /**
160
- * Binance C2C REST API
161
- *
162
- * OpenAPI Specification for the Binance C2C REST API
163
- *
164
- * The version of the OpenAPI document: 1.0.0
165
- *
166
- *
167
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
168
- * https://openapi-generator.tech
169
- * Do not edit the class manually.
170
- */
171
-
149
+ //#endregion
150
+ //#region src/rest-api/modules/c2-capi.d.ts
172
151
  /**
173
152
  * C2CApi - interface
174
153
  * @interface C2CApi
175
154
  */
176
155
  interface C2CApiInterface {
177
- /**
178
- * Get C2C Trade History
179
- *
180
- * The max interval between startTimestamp and endTimestamp is 30 days.
181
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
182
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
183
- *
184
- * Weight: 1
185
- *
186
- * @summary Get C2C Trade History (USER_DATA)
187
- * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
188
- *
189
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
190
- * @memberof C2CApiInterface
191
- */
192
- getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
156
+ /**
157
+ * Get C2C Trade History
158
+ *
159
+ * The max interval between startTimestamp and endTimestamp is 30 days.
160
+ * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
161
+ * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
162
+ *
163
+ * Weight: 1
164
+ *
165
+ * @summary Get C2C Trade History (USER_DATA)
166
+ * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
167
+ *
168
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
169
+ * @memberof C2CApiInterface
170
+ */
171
+ getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
193
172
  }
194
173
  /**
195
174
  * Request parameters for getC2CTradeHistory operation in C2CApi.
196
175
  * @interface GetC2CTradeHistoryRequest
197
176
  */
198
177
  interface GetC2CTradeHistoryRequest {
199
- /**
200
- * BUY, SELL
201
- * @type {string}
202
- * @memberof C2CApiGetC2CTradeHistory
203
- */
204
- readonly tradeType?: string;
205
- /**
206
- *
207
- * @type {number | bigint}
208
- * @memberof C2CApiGetC2CTradeHistory
209
- */
210
- readonly startTimestamp?: number | bigint;
211
- /**
212
- *
213
- * @type {number | bigint}
214
- * @memberof C2CApiGetC2CTradeHistory
215
- */
216
- readonly endTimestamp?: number | bigint;
217
- /**
218
- * Default 1
219
- * @type {number | bigint}
220
- * @memberof C2CApiGetC2CTradeHistory
221
- */
222
- readonly page?: number | bigint;
223
- /**
224
- * default 100, max 100
225
- * @type {number | bigint}
226
- * @memberof C2CApiGetC2CTradeHistory
227
- */
228
- readonly rows?: number | bigint;
229
- /**
230
- *
231
- * @type {number | bigint}
232
- * @memberof C2CApiGetC2CTradeHistory
233
- */
234
- readonly recvWindow?: number | bigint;
178
+ /**
179
+ * BUY, SELL
180
+ * @type {string}
181
+ * @memberof C2CApiGetC2CTradeHistory
182
+ */
183
+ readonly tradeType?: string;
184
+ /**
185
+ *
186
+ * @type {number | bigint}
187
+ * @memberof C2CApiGetC2CTradeHistory
188
+ */
189
+ readonly startTimestamp?: number | bigint;
190
+ /**
191
+ *
192
+ * @type {number | bigint}
193
+ * @memberof C2CApiGetC2CTradeHistory
194
+ */
195
+ readonly endTimestamp?: number | bigint;
196
+ /**
197
+ * Default 1
198
+ * @type {number | bigint}
199
+ * @memberof C2CApiGetC2CTradeHistory
200
+ */
201
+ readonly page?: number | bigint;
202
+ /**
203
+ * default 100, max 100
204
+ * @type {number | bigint}
205
+ * @memberof C2CApiGetC2CTradeHistory
206
+ */
207
+ readonly rows?: number | bigint;
208
+ /**
209
+ *
210
+ * @type {number | bigint}
211
+ * @memberof C2CApiGetC2CTradeHistory
212
+ */
213
+ readonly recvWindow?: number | bigint;
235
214
  }
236
215
  /**
237
216
  * C2CApi - object-oriented interface
238
217
  * @class C2CApi
239
218
  */
240
219
  declare class C2CApi implements C2CApiInterface {
241
- private readonly configuration;
242
- private localVarAxiosParamCreator;
243
- constructor(configuration: ConfigurationRestAPI);
244
- /**
245
- * Get C2C Trade History
246
- *
247
- * The max interval between startTimestamp and endTimestamp is 30 days.
248
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
249
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
250
- *
251
- * Weight: 1
252
- *
253
- * @summary Get C2C Trade History (USER_DATA)
254
- * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
255
- * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
256
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
257
- * @memberof C2CApi
258
- * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
259
- */
260
- getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
220
+ private readonly configuration;
221
+ private localVarAxiosParamCreator;
222
+ constructor(configuration: ConfigurationRestAPI);
223
+ /**
224
+ * Get C2C Trade History
225
+ *
226
+ * The max interval between startTimestamp and endTimestamp is 30 days.
227
+ * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
228
+ * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
229
+ *
230
+ * Weight: 1
231
+ *
232
+ * @summary Get C2C Trade History (USER_DATA)
233
+ * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
234
+ * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
235
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
236
+ * @memberof C2CApi
237
+ * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
238
+ */
239
+ getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
261
240
  }
262
-
263
- /**
264
- * Binance C2C REST API
265
- *
266
- * OpenAPI Specification for the Binance C2C REST API
267
- *
268
- * The version of the OpenAPI document: 1.0.0
269
- *
270
- *
271
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
272
- * https://openapi-generator.tech
273
- * Do not edit the class manually.
274
- */
275
-
241
+ //#endregion
242
+ //#region src/rest-api/rest-api.d.ts
276
243
  declare class RestAPI {
277
- private configuration;
278
- private c2CApi;
279
- constructor(configuration: ConfigurationRestAPI);
280
- /**
281
- * Generic function to send a request.
282
- * @param endpoint - The API endpoint to call.
283
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
284
- * @param params - Query parameters for the request.
285
- *
286
- * @returns A promise resolving to the response data object.
287
- */
288
- sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
289
- /**
290
- * Generic function to send a signed request.
291
- * @param endpoint - The API endpoint to call.
292
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
293
- * @param params - Query parameters for the request.
294
- *
295
- * @returns A promise resolving to the response data object.
296
- */
297
- sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
298
- /**
299
- * Get C2C Trade History
300
- *
301
- * The max interval between startTimestamp and endTimestamp is 30 days.
302
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
303
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
304
- *
305
- * Weight: 1
306
- *
307
- * @summary Get C2C Trade History (USER_DATA)
308
- * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
309
- *
310
- * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
311
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
312
- * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
313
- */
314
- getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
244
+ private configuration;
245
+ private c2CApi;
246
+ constructor(configuration: ConfigurationRestAPI);
247
+ /**
248
+ * Generic function to send a request.
249
+ * @param endpoint - The API endpoint to call.
250
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
251
+ * @param params - Query parameters for the request.
252
+ *
253
+ * @returns A promise resolving to the response data object.
254
+ */
255
+ sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
256
+ /**
257
+ * Generic function to send a signed request.
258
+ * @param endpoint - The API endpoint to call.
259
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
260
+ * @param params - Query parameters for the request.
261
+ *
262
+ * @returns A promise resolving to the response data object.
263
+ */
264
+ sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
265
+ /**
266
+ * Get C2C Trade History
267
+ *
268
+ * The max interval between startTimestamp and endTimestamp is 30 days.
269
+ * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
270
+ * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
271
+ *
272
+ * Weight: 1
273
+ *
274
+ * @summary Get C2C Trade History (USER_DATA)
275
+ * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
276
+ *
277
+ * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
278
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
279
+ * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
280
+ */
281
+ getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
315
282
  }
316
-
317
- /**
318
- * Binance C2C REST API
319
- *
320
- * OpenAPI Specification for the Binance C2C REST API
321
- *
322
- * The version of the OpenAPI document: 1.0.0
323
- *
324
- *
325
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
326
- * https://openapi-generator.tech
327
- * Do not edit the class manually.
328
- */
329
-
330
- type index_C2CApi = C2CApi;
331
- declare const index_C2CApi: typeof C2CApi;
332
- type index_C2CApiInterface = C2CApiInterface;
333
- type index_GetC2CTradeHistoryRequest = GetC2CTradeHistoryRequest;
334
- type index_GetC2CTradeHistoryResponse = GetC2CTradeHistoryResponse;
335
- type index_GetC2CTradeHistoryResponseDataInner = GetC2CTradeHistoryResponseDataInner;
336
- type index_RestAPI = RestAPI;
337
- declare const index_RestAPI: typeof RestAPI;
338
- declare namespace index {
339
- export { index_C2CApi as C2CApi, type index_C2CApiInterface as C2CApiInterface, type index_GetC2CTradeHistoryRequest as GetC2CTradeHistoryRequest, type index_GetC2CTradeHistoryResponse as GetC2CTradeHistoryResponse, type index_GetC2CTradeHistoryResponseDataInner as GetC2CTradeHistoryResponseDataInner, index_RestAPI as RestAPI };
283
+ declare namespace index_d_exports {
284
+ export { C2CApi, C2CApiInterface, GetC2CTradeHistoryRequest, GetC2CTradeHistoryResponse, GetC2CTradeHistoryResponseDataInner, RestAPI };
340
285
  }
341
-
286
+ //#endregion
287
+ //#region src/c2c.d.ts
342
288
  interface ConfigurationC2C {
343
- configurationRestAPI?: ConfigurationRestAPI;
289
+ configurationRestAPI?: ConfigurationRestAPI;
344
290
  }
345
291
  declare class C2C {
346
- restAPI: RestAPI;
347
- constructor(config: ConfigurationC2C);
292
+ restAPI: RestAPI;
293
+ constructor(config: ConfigurationC2C);
348
294
  }
349
-
350
- export { C2C, index as C2CRestAPI, type ConfigurationC2C };
295
+ //#endregion
296
+ export { BadRequestError, C2C, index_d_exports as C2CRestAPI, C2C_REST_API_PROD_URL, type ConfigurationC2C, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
297
+ //# sourceMappingURL=index.d.ts.map