@binance/c2c 5.0.4 → 6.0.1

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/README.md CHANGED
@@ -176,6 +176,19 @@ Please ensure that all tests pass if you're making a direct contribution. Submit
176
176
 
177
177
  Thank you for your contributions!
178
178
 
179
+ ## Disclaimer
180
+
181
+ This SDK is provided by Binance on an "as is" and "as available" basis for use at your own risk. Binance makes no representations or warranties of any kind, whether express or implied, as to the operation of the SDK, its accuracy, reliability, completeness, or fitness for any particular purpose.
182
+
183
+ To the fullest extent permitted by law, Binance shall not be liable for any losses, damages, or expenses of any kind arising from or in connection with your use of, or inability to use, this SDK, including but not limited to any financial losses resulting from errors, bugs, interruptions, or inaccuracies in the SDK.
184
+
185
+ Your use of this SDK to access the Binance Platform is subject to the Binance API Key Terms and the Binance Terms of Use, which shall prevail in the event of any conflict with this disclaimer. You are solely responsible for any orders or transactions executed through the Binance Platform using this SDK.
186
+
187
+ This SDK is not intended to constitute investment advice or a recommendation to buy, sell, or hold any digital asset. You should independently evaluate and verify all information before acting.
188
+
189
+ - [Binance Terms of Use](https://www.binance.com/en/terms)
190
+ - [Binance API Key Terms](https://www.binance.com/en/about-legal/terms-binance-api)
191
+
179
192
  ## Licence
180
193
 
181
194
  This project is licensed under the MIT License. See the [LICENCE](./LICENCE) file for details.
package/dist/index.d.mts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { BadRequestError, C2C_REST_API_PROD_URL, ConfigurationRestAPI, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, RestApiResponse, ServerError, TooManyRequestsError, UnauthorizedError } from "@binance/common";
2
2
 
3
- //#region src/rest-api/types/get-c2-ctrade-history-response.d.ts
3
+ //#region src/rest-api/types/get-c2-ctrade-history-response-data-inner.d.ts
4
4
 
5
5
  /**
6
- * Binance C2C REST API
6
+ * C2C REST API
7
7
  *
8
- * OpenAPI Specification for the Binance C2C REST API
8
+ * Query fiat transaction history via the C2C REST API.
9
9
  *
10
10
  * The version of the OpenAPI document: 1.0.0
11
11
  *
@@ -17,216 +17,266 @@ import { BadRequestError, C2C_REST_API_PROD_URL, ConfigurationRestAPI, Connector
17
17
  /**
18
18
  *
19
19
  * @export
20
- * @interface GetC2CTradeHistoryResponse
20
+ * @interface GetC2CTradeHistoryResponseDataInner
21
21
  */
22
- interface GetC2CTradeHistoryResponse {
22
+ interface GetC2CTradeHistoryResponseDataInner {
23
23
  /**
24
24
  *
25
25
  * @type {string}
26
- * @memberof GetC2CTradeHistoryResponse
26
+ * @memberof GetC2CTradeHistoryResponseDataInner
27
27
  */
28
28
  orderNumber?: string;
29
29
  /**
30
30
  *
31
31
  * @type {string}
32
- * @memberof GetC2CTradeHistoryResponse
32
+ * @memberof GetC2CTradeHistoryResponseDataInner
33
33
  */
34
34
  advNo?: string;
35
35
  /**
36
36
  *
37
37
  * @type {string}
38
- * @memberof GetC2CTradeHistoryResponse
38
+ * @memberof GetC2CTradeHistoryResponseDataInner
39
39
  */
40
40
  tradeType?: string;
41
41
  /**
42
42
  *
43
43
  * @type {string}
44
- * @memberof GetC2CTradeHistoryResponse
44
+ * @memberof GetC2CTradeHistoryResponseDataInner
45
45
  */
46
46
  asset?: string;
47
47
  /**
48
48
  *
49
49
  * @type {string}
50
- * @memberof GetC2CTradeHistoryResponse
50
+ * @memberof GetC2CTradeHistoryResponseDataInner
51
51
  */
52
52
  fiat?: string;
53
53
  /**
54
54
  *
55
55
  * @type {string}
56
- * @memberof GetC2CTradeHistoryResponse
56
+ * @memberof GetC2CTradeHistoryResponseDataInner
57
57
  */
58
58
  fiatSymbol?: string;
59
59
  /**
60
- *
60
+ * Quantity (in Crypto)
61
61
  * @type {string}
62
- * @memberof GetC2CTradeHistoryResponse
62
+ * @memberof GetC2CTradeHistoryResponseDataInner
63
63
  */
64
64
  amount?: string;
65
65
  /**
66
- *
66
+ * Total order amount in fiat
67
67
  * @type {string}
68
- * @memberof GetC2CTradeHistoryResponse
68
+ * @memberof GetC2CTradeHistoryResponseDataInner
69
69
  */
70
70
  totalPrice?: string;
71
71
  /**
72
- *
72
+ * Unit Price (in Fiat)
73
73
  * @type {string}
74
- * @memberof GetC2CTradeHistoryResponse
74
+ * @memberof GetC2CTradeHistoryResponseDataInner
75
75
  */
76
76
  unitPrice?: string;
77
77
  /**
78
78
  *
79
79
  * @type {string}
80
- * @memberof GetC2CTradeHistoryResponse
80
+ * @memberof GetC2CTradeHistoryResponseDataInner
81
81
  */
82
82
  orderStatus?: string;
83
83
  /**
84
- *
84
+ * Order creation timestamp in milliseconds
85
85
  * @type {number | bigint}
86
- * @memberof GetC2CTradeHistoryResponse
86
+ * @memberof GetC2CTradeHistoryResponseDataInner
87
87
  */
88
88
  createTime?: number | bigint;
89
89
  /**
90
- *
90
+ * Transaction Fee (in Crypto)
91
91
  * @type {string}
92
- * @memberof GetC2CTradeHistoryResponse
92
+ * @memberof GetC2CTradeHistoryResponseDataInner
93
93
  */
94
94
  commission?: string;
95
95
  /**
96
- *
96
+ * Counterparty nickname
97
97
  * @type {string}
98
- * @memberof GetC2CTradeHistoryResponse
98
+ * @memberof GetC2CTradeHistoryResponseDataInner
99
+ */
100
+ counterPartNickName?: string;
101
+ /**
102
+ * Identifier of the payment method
103
+ * @type {string}
104
+ * @memberof GetC2CTradeHistoryResponseDataInner
105
+ */
106
+ payMethodName?: string;
107
+ /**
108
+ * KYC verification status. 0: not required, 1: not verified, 2: verified
109
+ * @type {number | bigint}
110
+ * @memberof GetC2CTradeHistoryResponseDataInner
111
+ */
112
+ additionalKycVerify?: number | bigint;
113
+ /**
114
+ * Taker commission rate
115
+ * @type {string}
116
+ * @memberof GetC2CTradeHistoryResponseDataInner
99
117
  */
100
118
  takerCommissionRate?: string;
101
119
  /**
102
- *
120
+ * Taker commission amount
103
121
  * @type {string}
104
- * @memberof GetC2CTradeHistoryResponse
122
+ * @memberof GetC2CTradeHistoryResponseDataInner
105
123
  */
106
124
  takerCommission?: string;
107
125
  /**
108
- *
126
+ * Taker trade amount
109
127
  * @type {string}
110
- * @memberof GetC2CTradeHistoryResponse
128
+ * @memberof GetC2CTradeHistoryResponseDataInner
111
129
  */
112
130
  takerAmount?: string;
113
131
  /**
114
132
  *
115
133
  * @type {string}
134
+ * @memberof GetC2CTradeHistoryResponseDataInner
135
+ */
136
+ advertisementRole?: string;
137
+ }
138
+ //#endregion
139
+ //#region src/rest-api/types/get-c2-ctrade-history-response.d.ts
140
+
141
+ /**
142
+ *
143
+ * @export
144
+ * @interface GetC2CTradeHistoryResponse
145
+ */
146
+ interface GetC2CTradeHistoryResponse {
147
+ /**
148
+ * API response code. \"000000\" indicates success.
149
+ * @type {string}
116
150
  * @memberof GetC2CTradeHistoryResponse
117
151
  */
118
- counterPartNickName?: string;
152
+ code?: string;
119
153
  /**
120
- *
154
+ * Response message.
121
155
  * @type {string}
122
156
  * @memberof GetC2CTradeHistoryResponse
123
157
  */
124
- payMethodName?: string;
158
+ message?: string;
125
159
  /**
126
160
  *
161
+ * @type {Array<GetC2CTradeHistoryResponseDataInner>}
162
+ * @memberof GetC2CTradeHistoryResponse
163
+ */
164
+ data?: Array<GetC2CTradeHistoryResponseDataInner>;
165
+ /**
166
+ * Total number of records
127
167
  * @type {number | bigint}
128
168
  * @memberof GetC2CTradeHistoryResponse
129
169
  */
130
- additionalKycVerify?: number | bigint;
170
+ total?: number | bigint;
171
+ /**
172
+ * Whether request is successful
173
+ * @type {boolean}
174
+ * @memberof GetC2CTradeHistoryResponse
175
+ */
176
+ success?: boolean;
131
177
  }
132
178
  //#endregion
133
- //#region src/rest-api/modules/c2-capi.d.ts
179
+ //#region src/rest-api/modules/api.d.ts
134
180
 
135
181
  /**
136
- * C2CApi - interface
137
- * @interface C2CApi
182
+ * Api - interface
183
+ * @interface Api
138
184
  */
139
- interface C2CApiInterface {
185
+ interface ApiInterface {
140
186
  /**
141
187
  * Get C2C Trade History
142
188
  *
143
- * The max interval between startTimestamp and endTimestamp is 30 days.
144
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
145
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
189
+ * Weight(IP): 1
190
+ *
191
+ * Security Type: USER_DATA
146
192
  *
147
- * Weight: 1
193
+ * Notes:
194
+ * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.
195
+ * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.
196
+ * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.
148
197
  *
149
198
  * @summary Get C2C Trade History (USER_DATA)
150
199
  * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
151
200
  *
152
201
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
153
- * @memberof C2CApiInterface
202
+ * @memberof ApiInterface
154
203
  */
155
204
  getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
156
205
  }
157
206
  /**
158
- * Request parameters for getC2CTradeHistory operation in C2CApi.
207
+ * Request parameters for getC2CTradeHistory operation in Api.
159
208
  * @interface GetC2CTradeHistoryRequest
160
209
  */
161
210
  interface GetC2CTradeHistoryRequest {
162
211
  /**
163
- * BUY, SELL
164
- * @type {string}
165
- * @memberof C2CApiGetC2CTradeHistory
212
+ * Trade side filter
213
+ * @type {'BUY' | 'SELL'}
214
+ * @memberof ApiGetC2CTradeHistory
166
215
  */
167
- readonly tradeType?: string;
216
+ readonly tradeType?: GetC2CTradeHistoryTradeTypeEnum;
168
217
  /**
169
218
  *
170
219
  * @type {number | bigint}
171
- * @memberof C2CApiGetC2CTradeHistory
220
+ * @memberof ApiGetC2CTradeHistory
172
221
  */
173
222
  readonly startTimestamp?: number | bigint;
174
223
  /**
175
224
  *
176
225
  * @type {number | bigint}
177
- * @memberof C2CApiGetC2CTradeHistory
226
+ * @memberof ApiGetC2CTradeHistory
178
227
  */
179
228
  readonly endTimestamp?: number | bigint;
180
229
  /**
181
- * Default 1
230
+ * Page number
182
231
  * @type {number | bigint}
183
- * @memberof C2CApiGetC2CTradeHistory
232
+ * @memberof ApiGetC2CTradeHistory
184
233
  */
185
234
  readonly page?: number | bigint;
186
235
  /**
187
- * default 100, max 100
236
+ * Number of records per page
188
237
  * @type {number | bigint}
189
- * @memberof C2CApiGetC2CTradeHistory
238
+ * @memberof ApiGetC2CTradeHistory
190
239
  */
191
240
  readonly rows?: number | bigint;
192
- /**
193
- *
194
- * @type {number | bigint}
195
- * @memberof C2CApiGetC2CTradeHistory
196
- */
197
- readonly recvWindow?: number | bigint;
198
241
  }
199
242
  /**
200
- * C2CApi - object-oriented interface
201
- * @class C2CApi
243
+ * Api - object-oriented interface
244
+ * @class Api
202
245
  */
203
- declare class C2CApi implements C2CApiInterface {
246
+ declare class Api implements ApiInterface {
204
247
  private readonly configuration;
205
248
  private localVarAxiosParamCreator;
206
249
  constructor(configuration: ConfigurationRestAPI);
207
250
  /**
208
251
  * Get C2C Trade History
209
252
  *
210
- * The max interval between startTimestamp and endTimestamp is 30 days.
211
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
212
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
253
+ * Weight(IP): 1
254
+ *
255
+ * Security Type: USER_DATA
213
256
  *
214
- * Weight: 1
257
+ * Notes:
258
+ * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.
259
+ * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.
260
+ * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.
215
261
  *
216
262
  * @summary Get C2C Trade History (USER_DATA)
217
263
  * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
218
264
  * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
219
265
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
220
- * @memberof C2CApi
221
- * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
266
+ * @memberof Api
267
+ * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}
222
268
  */
223
269
  getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
224
270
  }
271
+ declare enum GetC2CTradeHistoryTradeTypeEnum {
272
+ BUY = "BUY",
273
+ SELL = "SELL",
274
+ }
225
275
  //#endregion
226
276
  //#region src/rest-api/rest-api.d.ts
227
277
  declare class RestAPI {
228
278
  private configuration;
229
- private c2CApi;
279
+ private api;
230
280
  constructor(configuration: ConfigurationRestAPI);
231
281
  /**
232
282
  * Generic function to send a request.
@@ -251,23 +301,26 @@ declare class RestAPI {
251
301
  /**
252
302
  * Get C2C Trade History
253
303
  *
254
- * The max interval between startTimestamp and endTimestamp is 30 days.
255
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
256
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
304
+ * Weight(IP): 1
305
+ *
306
+ * Security Type: USER_DATA
257
307
  *
258
- * Weight: 1
308
+ * Notes:
309
+ * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.
310
+ * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.
311
+ * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.
259
312
  *
260
313
  * @summary Get C2C Trade History (USER_DATA)
261
314
  * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
262
315
  *
263
316
  * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
264
317
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
265
- * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
318
+ * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}
266
319
  */
267
320
  getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
268
321
  }
269
322
  declare namespace index_d_exports {
270
- export { C2CApi, C2CApiInterface, GetC2CTradeHistoryRequest, GetC2CTradeHistoryResponse, RestAPI };
323
+ export { Api, ApiInterface, GetC2CTradeHistoryRequest, GetC2CTradeHistoryResponse, GetC2CTradeHistoryResponseDataInner, GetC2CTradeHistoryTradeTypeEnum, RestAPI };
271
324
  }
272
325
  //#endregion
273
326
  //#region src/c2c.d.ts
package/dist/index.d.ts CHANGED
@@ -3,11 +3,11 @@ import { BadRequestError, C2C_REST_API_PROD_URL, ConfigurationRestAPI, Connector
3
3
  //#region rolldown:runtime
4
4
 
5
5
  //#endregion
6
- //#region src/rest-api/types/get-c2-ctrade-history-response.d.ts
6
+ //#region src/rest-api/types/get-c2-ctrade-history-response-data-inner.d.ts
7
7
  /**
8
- * Binance C2C REST API
8
+ * C2C REST API
9
9
  *
10
- * OpenAPI Specification for the Binance C2C REST API
10
+ * Query fiat transaction history via the C2C REST API.
11
11
  *
12
12
  * The version of the OpenAPI document: 1.0.0
13
13
  *
@@ -19,215 +19,264 @@ import { BadRequestError, C2C_REST_API_PROD_URL, ConfigurationRestAPI, Connector
19
19
  /**
20
20
  *
21
21
  * @export
22
- * @interface GetC2CTradeHistoryResponse
22
+ * @interface GetC2CTradeHistoryResponseDataInner
23
23
  */
24
- interface GetC2CTradeHistoryResponse {
24
+ interface GetC2CTradeHistoryResponseDataInner {
25
25
  /**
26
26
  *
27
27
  * @type {string}
28
- * @memberof GetC2CTradeHistoryResponse
28
+ * @memberof GetC2CTradeHistoryResponseDataInner
29
29
  */
30
30
  orderNumber?: string;
31
31
  /**
32
32
  *
33
33
  * @type {string}
34
- * @memberof GetC2CTradeHistoryResponse
34
+ * @memberof GetC2CTradeHistoryResponseDataInner
35
35
  */
36
36
  advNo?: string;
37
37
  /**
38
38
  *
39
39
  * @type {string}
40
- * @memberof GetC2CTradeHistoryResponse
40
+ * @memberof GetC2CTradeHistoryResponseDataInner
41
41
  */
42
42
  tradeType?: string;
43
43
  /**
44
44
  *
45
45
  * @type {string}
46
- * @memberof GetC2CTradeHistoryResponse
46
+ * @memberof GetC2CTradeHistoryResponseDataInner
47
47
  */
48
48
  asset?: string;
49
49
  /**
50
50
  *
51
51
  * @type {string}
52
- * @memberof GetC2CTradeHistoryResponse
52
+ * @memberof GetC2CTradeHistoryResponseDataInner
53
53
  */
54
54
  fiat?: string;
55
55
  /**
56
56
  *
57
57
  * @type {string}
58
- * @memberof GetC2CTradeHistoryResponse
58
+ * @memberof GetC2CTradeHistoryResponseDataInner
59
59
  */
60
60
  fiatSymbol?: string;
61
61
  /**
62
- *
62
+ * Quantity (in Crypto)
63
63
  * @type {string}
64
- * @memberof GetC2CTradeHistoryResponse
64
+ * @memberof GetC2CTradeHistoryResponseDataInner
65
65
  */
66
66
  amount?: string;
67
67
  /**
68
- *
68
+ * Total order amount in fiat
69
69
  * @type {string}
70
- * @memberof GetC2CTradeHistoryResponse
70
+ * @memberof GetC2CTradeHistoryResponseDataInner
71
71
  */
72
72
  totalPrice?: string;
73
73
  /**
74
- *
74
+ * Unit Price (in Fiat)
75
75
  * @type {string}
76
- * @memberof GetC2CTradeHistoryResponse
76
+ * @memberof GetC2CTradeHistoryResponseDataInner
77
77
  */
78
78
  unitPrice?: string;
79
79
  /**
80
80
  *
81
81
  * @type {string}
82
- * @memberof GetC2CTradeHistoryResponse
82
+ * @memberof GetC2CTradeHistoryResponseDataInner
83
83
  */
84
84
  orderStatus?: string;
85
85
  /**
86
- *
86
+ * Order creation timestamp in milliseconds
87
87
  * @type {number | bigint}
88
- * @memberof GetC2CTradeHistoryResponse
88
+ * @memberof GetC2CTradeHistoryResponseDataInner
89
89
  */
90
90
  createTime?: number | bigint;
91
91
  /**
92
- *
92
+ * Transaction Fee (in Crypto)
93
93
  * @type {string}
94
- * @memberof GetC2CTradeHistoryResponse
94
+ * @memberof GetC2CTradeHistoryResponseDataInner
95
95
  */
96
96
  commission?: string;
97
97
  /**
98
- *
98
+ * Counterparty nickname
99
99
  * @type {string}
100
- * @memberof GetC2CTradeHistoryResponse
100
+ * @memberof GetC2CTradeHistoryResponseDataInner
101
+ */
102
+ counterPartNickName?: string;
103
+ /**
104
+ * Identifier of the payment method
105
+ * @type {string}
106
+ * @memberof GetC2CTradeHistoryResponseDataInner
107
+ */
108
+ payMethodName?: string;
109
+ /**
110
+ * KYC verification status. 0: not required, 1: not verified, 2: verified
111
+ * @type {number | bigint}
112
+ * @memberof GetC2CTradeHistoryResponseDataInner
113
+ */
114
+ additionalKycVerify?: number | bigint;
115
+ /**
116
+ * Taker commission rate
117
+ * @type {string}
118
+ * @memberof GetC2CTradeHistoryResponseDataInner
101
119
  */
102
120
  takerCommissionRate?: string;
103
121
  /**
104
- *
122
+ * Taker commission amount
105
123
  * @type {string}
106
- * @memberof GetC2CTradeHistoryResponse
124
+ * @memberof GetC2CTradeHistoryResponseDataInner
107
125
  */
108
126
  takerCommission?: string;
109
127
  /**
110
- *
128
+ * Taker trade amount
111
129
  * @type {string}
112
- * @memberof GetC2CTradeHistoryResponse
130
+ * @memberof GetC2CTradeHistoryResponseDataInner
113
131
  */
114
132
  takerAmount?: string;
115
133
  /**
116
134
  *
117
135
  * @type {string}
136
+ * @memberof GetC2CTradeHistoryResponseDataInner
137
+ */
138
+ advertisementRole?: string;
139
+ }
140
+ //#endregion
141
+ //#region src/rest-api/types/get-c2-ctrade-history-response.d.ts
142
+ /**
143
+ *
144
+ * @export
145
+ * @interface GetC2CTradeHistoryResponse
146
+ */
147
+ interface GetC2CTradeHistoryResponse {
148
+ /**
149
+ * API response code. \"000000\" indicates success.
150
+ * @type {string}
118
151
  * @memberof GetC2CTradeHistoryResponse
119
152
  */
120
- counterPartNickName?: string;
153
+ code?: string;
121
154
  /**
122
- *
155
+ * Response message.
123
156
  * @type {string}
124
157
  * @memberof GetC2CTradeHistoryResponse
125
158
  */
126
- payMethodName?: string;
159
+ message?: string;
127
160
  /**
128
161
  *
162
+ * @type {Array<GetC2CTradeHistoryResponseDataInner>}
163
+ * @memberof GetC2CTradeHistoryResponse
164
+ */
165
+ data?: Array<GetC2CTradeHistoryResponseDataInner>;
166
+ /**
167
+ * Total number of records
129
168
  * @type {number | bigint}
130
169
  * @memberof GetC2CTradeHistoryResponse
131
170
  */
132
- additionalKycVerify?: number | bigint;
171
+ total?: number | bigint;
172
+ /**
173
+ * Whether request is successful
174
+ * @type {boolean}
175
+ * @memberof GetC2CTradeHistoryResponse
176
+ */
177
+ success?: boolean;
133
178
  }
134
179
  //#endregion
135
- //#region src/rest-api/modules/c2-capi.d.ts
180
+ //#region src/rest-api/modules/api.d.ts
136
181
  /**
137
- * C2CApi - interface
138
- * @interface C2CApi
182
+ * Api - interface
183
+ * @interface Api
139
184
  */
140
- interface C2CApiInterface {
185
+ interface ApiInterface {
141
186
  /**
142
187
  * Get C2C Trade History
143
188
  *
144
- * The max interval between startTimestamp and endTimestamp is 30 days.
145
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
146
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
189
+ * Weight(IP): 1
190
+ *
191
+ * Security Type: USER_DATA
147
192
  *
148
- * Weight: 1
193
+ * Notes:
194
+ * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.
195
+ * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.
196
+ * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.
149
197
  *
150
198
  * @summary Get C2C Trade History (USER_DATA)
151
199
  * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
152
200
  *
153
201
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
154
- * @memberof C2CApiInterface
202
+ * @memberof ApiInterface
155
203
  */
156
204
  getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
157
205
  }
158
206
  /**
159
- * Request parameters for getC2CTradeHistory operation in C2CApi.
207
+ * Request parameters for getC2CTradeHistory operation in Api.
160
208
  * @interface GetC2CTradeHistoryRequest
161
209
  */
162
210
  interface GetC2CTradeHistoryRequest {
163
211
  /**
164
- * BUY, SELL
165
- * @type {string}
166
- * @memberof C2CApiGetC2CTradeHistory
212
+ * Trade side filter
213
+ * @type {'BUY' | 'SELL'}
214
+ * @memberof ApiGetC2CTradeHistory
167
215
  */
168
- readonly tradeType?: string;
216
+ readonly tradeType?: GetC2CTradeHistoryTradeTypeEnum;
169
217
  /**
170
218
  *
171
219
  * @type {number | bigint}
172
- * @memberof C2CApiGetC2CTradeHistory
220
+ * @memberof ApiGetC2CTradeHistory
173
221
  */
174
222
  readonly startTimestamp?: number | bigint;
175
223
  /**
176
224
  *
177
225
  * @type {number | bigint}
178
- * @memberof C2CApiGetC2CTradeHistory
226
+ * @memberof ApiGetC2CTradeHistory
179
227
  */
180
228
  readonly endTimestamp?: number | bigint;
181
229
  /**
182
- * Default 1
230
+ * Page number
183
231
  * @type {number | bigint}
184
- * @memberof C2CApiGetC2CTradeHistory
232
+ * @memberof ApiGetC2CTradeHistory
185
233
  */
186
234
  readonly page?: number | bigint;
187
235
  /**
188
- * default 100, max 100
236
+ * Number of records per page
189
237
  * @type {number | bigint}
190
- * @memberof C2CApiGetC2CTradeHistory
238
+ * @memberof ApiGetC2CTradeHistory
191
239
  */
192
240
  readonly rows?: number | bigint;
193
- /**
194
- *
195
- * @type {number | bigint}
196
- * @memberof C2CApiGetC2CTradeHistory
197
- */
198
- readonly recvWindow?: number | bigint;
199
241
  }
200
242
  /**
201
- * C2CApi - object-oriented interface
202
- * @class C2CApi
243
+ * Api - object-oriented interface
244
+ * @class Api
203
245
  */
204
- declare class C2CApi implements C2CApiInterface {
246
+ declare class Api implements ApiInterface {
205
247
  private readonly configuration;
206
248
  private localVarAxiosParamCreator;
207
249
  constructor(configuration: ConfigurationRestAPI);
208
250
  /**
209
251
  * Get C2C Trade History
210
252
  *
211
- * The max interval between startTimestamp and endTimestamp is 30 days.
212
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
213
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
253
+ * Weight(IP): 1
254
+ *
255
+ * Security Type: USER_DATA
214
256
  *
215
- * Weight: 1
257
+ * Notes:
258
+ * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.
259
+ * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.
260
+ * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.
216
261
  *
217
262
  * @summary Get C2C Trade History (USER_DATA)
218
263
  * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
219
264
  * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
220
265
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
221
- * @memberof C2CApi
222
- * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
266
+ * @memberof Api
267
+ * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}
223
268
  */
224
269
  getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
225
270
  }
271
+ declare enum GetC2CTradeHistoryTradeTypeEnum {
272
+ BUY = "BUY",
273
+ SELL = "SELL",
274
+ }
226
275
  //#endregion
227
276
  //#region src/rest-api/rest-api.d.ts
228
277
  declare class RestAPI {
229
278
  private configuration;
230
- private c2CApi;
279
+ private api;
231
280
  constructor(configuration: ConfigurationRestAPI);
232
281
  /**
233
282
  * Generic function to send a request.
@@ -252,23 +301,26 @@ declare class RestAPI {
252
301
  /**
253
302
  * Get C2C Trade History
254
303
  *
255
- * The max interval between startTimestamp and endTimestamp is 30 days.
256
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
257
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
304
+ * Weight(IP): 1
305
+ *
306
+ * Security Type: USER_DATA
258
307
  *
259
- * Weight: 1
308
+ * Notes:
309
+ * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.
310
+ * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.
311
+ * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.
260
312
  *
261
313
  * @summary Get C2C Trade History (USER_DATA)
262
314
  * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
263
315
  *
264
316
  * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
265
317
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
266
- * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
318
+ * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}
267
319
  */
268
320
  getC2CTradeHistory(requestParameters?: GetC2CTradeHistoryRequest): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;
269
321
  }
270
322
  declare namespace index_d_exports {
271
- export { C2CApi, C2CApiInterface, GetC2CTradeHistoryRequest, GetC2CTradeHistoryResponse, RestAPI };
323
+ export { Api, ApiInterface, GetC2CTradeHistoryRequest, GetC2CTradeHistoryResponse, GetC2CTradeHistoryResponseDataInner, GetC2CTradeHistoryTradeTypeEnum, RestAPI };
272
324
  }
273
325
  //#endregion
274
326
  //#region src/c2c.d.ts
package/dist/index.js CHANGED
@@ -14,14 +14,14 @@ let __binance_common = require("@binance/common");
14
14
 
15
15
  //#region package.json
16
16
  var name = "@binance/c2c";
17
- var version = "5.0.4";
17
+ var version = "6.0.1";
18
18
 
19
19
  //#endregion
20
- //#region src/rest-api/modules/c2-capi.ts
20
+ //#region src/rest-api/modules/api.ts
21
21
  /**
22
- * Binance C2C REST API
22
+ * C2C REST API
23
23
  *
24
- * OpenAPI Specification for the Binance C2C REST API
24
+ * Query fiat transaction history via the C2C REST API.
25
25
  *
26
26
  * The version of the OpenAPI document: 1.0.0
27
27
  *
@@ -31,10 +31,10 @@ var version = "5.0.4";
31
31
  * Do not edit the class manually.
32
32
  */
33
33
  /**
34
- * C2CApi - axios parameter creator
34
+ * Api - axios parameter creator
35
35
  */
36
- const C2CApiAxiosParamCreator = function(configuration) {
37
- return { getC2CTradeHistory: async (tradeType, startTimestamp, endTimestamp, page, rows, recvWindow) => {
36
+ const ApiAxiosParamCreator = function(configuration) {
37
+ return { getC2CTradeHistory: async (tradeType, startTimestamp, endTimestamp, page, rows) => {
38
38
  const localVarQueryParameter = {};
39
39
  const localVarBodyParameter = {};
40
40
  const localVarHeaderParameter = {};
@@ -43,7 +43,6 @@ const C2CApiAxiosParamCreator = function(configuration) {
43
43
  if (endTimestamp !== void 0 && endTimestamp !== null) localVarQueryParameter["endTimestamp"] = endTimestamp;
44
44
  if (page !== void 0 && page !== null) localVarQueryParameter["page"] = page;
45
45
  if (rows !== void 0 && rows !== null) localVarQueryParameter["rows"] = rows;
46
- if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
47
46
  let _timeUnit;
48
47
  if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
49
48
  return {
@@ -57,42 +56,50 @@ const C2CApiAxiosParamCreator = function(configuration) {
57
56
  } };
58
57
  };
59
58
  /**
60
- * C2CApi - object-oriented interface
61
- * @class C2CApi
59
+ * Api - object-oriented interface
60
+ * @class Api
62
61
  */
63
- var C2CApi = class {
62
+ var Api = class {
64
63
  constructor(configuration) {
65
64
  this.configuration = configuration;
66
- this.localVarAxiosParamCreator = C2CApiAxiosParamCreator(configuration);
65
+ this.localVarAxiosParamCreator = ApiAxiosParamCreator(configuration);
67
66
  }
68
67
  /**
69
68
  * Get C2C Trade History
70
69
  *
71
- * The max interval between startTimestamp and endTimestamp is 30 days.
72
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
73
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
70
+ * Weight(IP): 1
74
71
  *
75
- * Weight: 1
72
+ * Security Type: USER_DATA
73
+ *
74
+ * Notes:
75
+ * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.
76
+ * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.
77
+ * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.
76
78
  *
77
79
  * @summary Get C2C Trade History (USER_DATA)
78
80
  * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
79
81
  * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
80
82
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
81
- * @memberof C2CApi
82
- * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
83
+ * @memberof Api
84
+ * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}
83
85
  */
84
86
  async getC2CTradeHistory(requestParameters = {}) {
85
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(requestParameters?.tradeType, requestParameters?.startTimestamp, requestParameters?.endTimestamp, requestParameters?.page, requestParameters?.rows, requestParameters?.recvWindow);
86
- return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
87
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(requestParameters?.tradeType, requestParameters?.startTimestamp, requestParameters?.endTimestamp, requestParameters?.page, requestParameters?.rows);
88
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: false });
87
89
  }
88
90
  };
91
+ let GetC2CTradeHistoryTradeTypeEnum = /* @__PURE__ */ function(GetC2CTradeHistoryTradeTypeEnum$1) {
92
+ GetC2CTradeHistoryTradeTypeEnum$1["BUY"] = "BUY";
93
+ GetC2CTradeHistoryTradeTypeEnum$1["SELL"] = "SELL";
94
+ return GetC2CTradeHistoryTradeTypeEnum$1;
95
+ }({});
89
96
 
90
97
  //#endregion
91
98
  //#region src/rest-api/rest-api.ts
92
99
  /**
93
- * Binance C2C REST API
100
+ * C2C REST API
94
101
  *
95
- * OpenAPI Specification for the Binance C2C REST API
102
+ * Query fiat transaction history via the C2C REST API.
96
103
  *
97
104
  * The version of the OpenAPI document: 1.0.0
98
105
  *
@@ -104,7 +111,7 @@ var C2CApi = class {
104
111
  var RestAPI = class {
105
112
  constructor(configuration) {
106
113
  this.configuration = configuration;
107
- this.c2CApi = new C2CApi(configuration);
114
+ this.api = new Api(configuration);
108
115
  }
109
116
  /**
110
117
  * Generic function to send a request.
@@ -133,28 +140,32 @@ var RestAPI = class {
133
140
  /**
134
141
  * Get C2C Trade History
135
142
  *
136
- * The max interval between startTimestamp and endTimestamp is 30 days.
137
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
138
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
143
+ * Weight(IP): 1
144
+ *
145
+ * Security Type: USER_DATA
139
146
  *
140
- * Weight: 1
147
+ * Notes:
148
+ * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.
149
+ * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.
150
+ * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.
141
151
  *
142
152
  * @summary Get C2C Trade History (USER_DATA)
143
153
  * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
144
154
  *
145
155
  * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
146
156
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
147
- * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
157
+ * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}
148
158
  */
149
159
  getC2CTradeHistory(requestParameters = {}) {
150
- return this.c2CApi.getC2CTradeHistory(requestParameters);
160
+ return this.api.getC2CTradeHistory(requestParameters);
151
161
  }
152
162
  };
153
163
 
154
164
  //#endregion
155
165
  //#region src/rest-api/index.ts
156
166
  var rest_api_exports = /* @__PURE__ */ __export({
157
- C2CApi: () => C2CApi,
167
+ Api: () => Api,
168
+ GetC2CTradeHistoryTradeTypeEnum: () => GetC2CTradeHistoryTradeTypeEnum,
158
169
  RestAPI: () => RestAPI
159
170
  });
160
171
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","C2C_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/c2-capi.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/c2c.ts"],"sourcesContent":["{\n \"name\": \"@binance/c2c\",\n \"description\": \"Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.\",\n \"version\": \"5.0.4\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"C2C\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.1\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance C2C REST API\n *\n * OpenAPI Specification for the Binance C2C REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetC2CTradeHistoryResponse } from '../types';\n\n/**\n * C2CApi - axios parameter creator\n */\nconst C2CApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {string} [tradeType] BUY, SELL\n * @param {number | bigint} [startTimestamp]\n * @param {number | bigint} [endTimestamp]\n * @param {number | bigint} [page] Default 1\n * @param {number | bigint} [rows] default 100, max 100\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n tradeType?: string,\n startTimestamp?: number | bigint,\n endTimestamp?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (tradeType !== undefined && tradeType !== null) {\n localVarQueryParameter['tradeType'] = tradeType;\n }\n if (startTimestamp !== undefined && startTimestamp !== null) {\n localVarQueryParameter['startTimestamp'] = startTimestamp;\n }\n if (endTimestamp !== undefined && endTimestamp !== null) {\n localVarQueryParameter['endTimestamp'] = endTimestamp;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/c2c/orderMatch/listUserOrderHistory',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * C2CApi - interface\n * @interface C2CApi\n */\nexport interface C2CApiInterface {\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof C2CApiInterface\n */\n getC2CTradeHistory(\n requestParameters?: GetC2CTradeHistoryRequest\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;\n}\n\n/**\n * Request parameters for getC2CTradeHistory operation in C2CApi.\n * @interface GetC2CTradeHistoryRequest\n */\nexport interface GetC2CTradeHistoryRequest {\n /**\n * BUY, SELL\n * @type {string}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly tradeType?: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly startTimestamp?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly endTimestamp?: number | bigint;\n\n /**\n * Default 1\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 100\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * C2CApi - object-oriented interface\n * @class C2CApi\n */\nexport class C2CApi implements C2CApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = C2CApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof C2CApi\n * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}\n */\n public async getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(\n requestParameters?.tradeType,\n requestParameters?.startTimestamp,\n requestParameters?.endTimestamp,\n requestParameters?.page,\n requestParameters?.rows,\n requestParameters?.recvWindow\n );\n return sendRequest<GetC2CTradeHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance C2C REST API\n *\n * OpenAPI Specification for the Binance C2C REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { C2CApi } from './modules/c2-capi';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/c2-capi';\n\nimport type { GetC2CTradeHistoryResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private c2CApi: C2CApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.c2CApi = new C2CApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}\n */\n getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n return this.c2CApi.getC2CTradeHistory(requestParameters);\n }\n}\n","/**\n * Binance C2C REST API\n *\n * OpenAPI Specification for the Binance C2C REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, C2C_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationC2C {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class C2C {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationC2C) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || C2C_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACsBf,MAAM,0BAA0B,SAAU,eAAqC;AAC3E,QAAO,EAoBH,oBAAoB,OAChB,WACA,gBACA,cACA,MACA,MACA,eACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;EACzD,MAAMC,0BAAmD,EAAE;AAE3D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,mBAAmB,UAAa,mBAAmB,KACnD,wBAAuB,oBAAoB;AAE/C,MAAI,iBAAiB,UAAa,iBAAiB,KAC/C,wBAAuB,kBAAkB;AAE7C,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;EAG3C,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;GACd,UAAU;GACb;IAER;;;;;;AAgFL,IAAa,SAAb,MAA+C;CAI3C,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,wBAAwB,cAAc;;;;;;;;;;;;;;;;;;CAmB3E,MAAa,mBACT,oBAA+C,EAAE,EACG;EACpD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,mBAC3D,mBAAmB,WACnB,mBAAmB,gBACnB,mBAAmB,cACnB,mBAAmB,MACnB,mBAAmB,MACnB,mBAAmB,WACtB;AACD,2CACI,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,cAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;AClMT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,SAAS,IAAI,OAAO,cAAc;;;;;;;;;;;CAY3C,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;CAmBL,mBACI,oBAA+C,EAAE,EACG;AACpD,SAAO,KAAK,OAAO,mBAAmB,kBAAkB;;;;;;;;;;;;;AE7FhE,IAAa,MAAb,MAAiB;CAGb,YAAY,QAA0B;EAClC,MAAM,iDAA2B,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAIC,sCACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
1
+ {"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","C2C_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/c2c.ts"],"sourcesContent":["{\n \"name\": \"@binance/c2c\",\n \"description\": \"Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.\",\n \"version\": \"6.0.1\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"C2C\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.5.8\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.5\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the C2C REST API.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetC2CTradeHistoryResponse } from '../types';\n\n/**\n * Api - axios parameter creator\n */\nconst ApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryTradeTypeEnum} [tradeType] Trade side filter\n * @param {number | bigint} [startTimestamp]\n * @param {number | bigint} [endTimestamp]\n * @param {number | bigint} [page] Page number\n * @param {number | bigint} [rows] Number of records per page\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n tradeType?: GetC2CTradeHistoryTradeTypeEnum,\n startTimestamp?: number | bigint,\n endTimestamp?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (tradeType !== undefined && tradeType !== null) {\n localVarQueryParameter['tradeType'] = tradeType;\n }\n if (startTimestamp !== undefined && startTimestamp !== null) {\n localVarQueryParameter['startTimestamp'] = startTimestamp;\n }\n if (endTimestamp !== undefined && endTimestamp !== null) {\n localVarQueryParameter['endTimestamp'] = endTimestamp;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/c2c/orderMatch/listUserOrderHistory',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * Api - interface\n * @interface Api\n */\nexport interface ApiInterface {\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof ApiInterface\n */\n getC2CTradeHistory(\n requestParameters?: GetC2CTradeHistoryRequest\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;\n}\n\n/**\n * Request parameters for getC2CTradeHistory operation in Api.\n * @interface GetC2CTradeHistoryRequest\n */\nexport interface GetC2CTradeHistoryRequest {\n /**\n * Trade side filter\n * @type {'BUY' | 'SELL'}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly tradeType?: GetC2CTradeHistoryTradeTypeEnum;\n\n /**\n *\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly startTimestamp?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly endTimestamp?: number | bigint;\n\n /**\n * Page number\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly page?: number | bigint;\n\n /**\n * Number of records per page\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly rows?: number | bigint;\n}\n\n/**\n * Api - object-oriented interface\n * @class Api\n */\nexport class Api implements ApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = ApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof Api\n * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}\n */\n public async getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(\n requestParameters?.tradeType,\n requestParameters?.startTimestamp,\n requestParameters?.endTimestamp,\n requestParameters?.page,\n requestParameters?.rows\n );\n return sendRequest<GetC2CTradeHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n}\n\nexport enum GetC2CTradeHistoryTradeTypeEnum {\n BUY = 'BUY',\n SELL = 'SELL',\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the C2C REST API.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { Api } from './modules/api';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/api';\n\nimport type { GetC2CTradeHistoryResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private api: Api;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.api = new Api(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}\n */\n getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n return this.api.getC2CTradeHistory(requestParameters);\n }\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the C2C REST API.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, C2C_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationC2C {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class C2C {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationC2C) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || C2C_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACqBf,MAAM,uBAAuB,SAAU,eAAqC;AACxE,QAAO,EAsBH,oBAAoB,OAChB,WACA,gBACA,cACA,MACA,SACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;EACzD,MAAMC,0BAAmD,EAAE;AAE3D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,mBAAmB,UAAa,mBAAmB,KACnD,wBAAuB,oBAAoB;AAE/C,MAAI,iBAAiB,UAAa,iBAAiB,KAC/C,wBAAuB,kBAAkB;AAE7C,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;EAGrC,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;GACd,UAAU;GACb;IAER;;;;;;AA4EL,IAAa,MAAb,MAAyC;CAIrC,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,qBAAqB,cAAc;;;;;;;;;;;;;;;;;;;;;CAsBxE,MAAa,mBACT,oBAA+C,EAAE,EACG;EACpD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,mBAC3D,mBAAmB,WACnB,mBAAmB,gBACnB,mBAAmB,cACnB,mBAAmB,MACnB,mBAAmB,KACtB;AACD,2CACI,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,cAClB,mBAAmB,UACnB,EAAE,UAAU,OAAO,CACtB;;;AAIT,IAAY,8FAAL;AACH;AACA;;;;;;;;;;;;;;;;;;ACnMJ,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,MAAM,IAAI,IAAI,cAAc;;;;;;;;;;;CAYrC,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;;;CAsBL,mBACI,oBAA+C,EAAE,EACG;AACpD,SAAO,KAAK,IAAI,mBAAmB,kBAAkB;;;;;;;;;;;;;;AEhG7D,IAAa,MAAb,MAAiB;CAGb,YAAY,QAA0B;EAClC,MAAM,iDAA2B,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAIC,sCACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
package/dist/index.mjs CHANGED
@@ -3,14 +3,14 @@ import { BadRequestError, C2C_REST_API_PROD_URL, C2C_REST_API_PROD_URL as C2C_RE
3
3
 
4
4
  //#region package.json
5
5
  var name = "@binance/c2c";
6
- var version = "5.0.4";
6
+ var version = "6.0.1";
7
7
 
8
8
  //#endregion
9
- //#region src/rest-api/modules/c2-capi.ts
9
+ //#region src/rest-api/modules/api.ts
10
10
  /**
11
- * Binance C2C REST API
11
+ * C2C REST API
12
12
  *
13
- * OpenAPI Specification for the Binance C2C REST API
13
+ * Query fiat transaction history via the C2C REST API.
14
14
  *
15
15
  * The version of the OpenAPI document: 1.0.0
16
16
  *
@@ -20,10 +20,10 @@ var version = "5.0.4";
20
20
  * Do not edit the class manually.
21
21
  */
22
22
  /**
23
- * C2CApi - axios parameter creator
23
+ * Api - axios parameter creator
24
24
  */
25
- const C2CApiAxiosParamCreator = function(configuration) {
26
- return { getC2CTradeHistory: async (tradeType, startTimestamp, endTimestamp, page, rows, recvWindow) => {
25
+ const ApiAxiosParamCreator = function(configuration) {
26
+ return { getC2CTradeHistory: async (tradeType, startTimestamp, endTimestamp, page, rows) => {
27
27
  const localVarQueryParameter = {};
28
28
  const localVarBodyParameter = {};
29
29
  const localVarHeaderParameter = {};
@@ -32,7 +32,6 @@ const C2CApiAxiosParamCreator = function(configuration) {
32
32
  if (endTimestamp !== void 0 && endTimestamp !== null) localVarQueryParameter["endTimestamp"] = endTimestamp;
33
33
  if (page !== void 0 && page !== null) localVarQueryParameter["page"] = page;
34
34
  if (rows !== void 0 && rows !== null) localVarQueryParameter["rows"] = rows;
35
- if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
36
35
  let _timeUnit;
37
36
  if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
38
37
  return {
@@ -46,42 +45,50 @@ const C2CApiAxiosParamCreator = function(configuration) {
46
45
  } };
47
46
  };
48
47
  /**
49
- * C2CApi - object-oriented interface
50
- * @class C2CApi
48
+ * Api - object-oriented interface
49
+ * @class Api
51
50
  */
52
- var C2CApi = class {
51
+ var Api = class {
53
52
  constructor(configuration) {
54
53
  this.configuration = configuration;
55
- this.localVarAxiosParamCreator = C2CApiAxiosParamCreator(configuration);
54
+ this.localVarAxiosParamCreator = ApiAxiosParamCreator(configuration);
56
55
  }
57
56
  /**
58
57
  * Get C2C Trade History
59
58
  *
60
- * The max interval between startTimestamp and endTimestamp is 30 days.
61
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
62
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
59
+ * Weight(IP): 1
63
60
  *
64
- * Weight: 1
61
+ * Security Type: USER_DATA
62
+ *
63
+ * Notes:
64
+ * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.
65
+ * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.
66
+ * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.
65
67
  *
66
68
  * @summary Get C2C Trade History (USER_DATA)
67
69
  * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
68
70
  * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
69
71
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
70
- * @memberof C2CApi
71
- * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
72
+ * @memberof Api
73
+ * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}
72
74
  */
73
75
  async getC2CTradeHistory(requestParameters = {}) {
74
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(requestParameters?.tradeType, requestParameters?.startTimestamp, requestParameters?.endTimestamp, requestParameters?.page, requestParameters?.rows, requestParameters?.recvWindow);
75
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
76
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(requestParameters?.tradeType, requestParameters?.startTimestamp, requestParameters?.endTimestamp, requestParameters?.page, requestParameters?.rows);
77
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: false });
76
78
  }
77
79
  };
80
+ let GetC2CTradeHistoryTradeTypeEnum = /* @__PURE__ */ function(GetC2CTradeHistoryTradeTypeEnum$1) {
81
+ GetC2CTradeHistoryTradeTypeEnum$1["BUY"] = "BUY";
82
+ GetC2CTradeHistoryTradeTypeEnum$1["SELL"] = "SELL";
83
+ return GetC2CTradeHistoryTradeTypeEnum$1;
84
+ }({});
78
85
 
79
86
  //#endregion
80
87
  //#region src/rest-api/rest-api.ts
81
88
  /**
82
- * Binance C2C REST API
89
+ * C2C REST API
83
90
  *
84
- * OpenAPI Specification for the Binance C2C REST API
91
+ * Query fiat transaction history via the C2C REST API.
85
92
  *
86
93
  * The version of the OpenAPI document: 1.0.0
87
94
  *
@@ -93,7 +100,7 @@ var C2CApi = class {
93
100
  var RestAPI = class {
94
101
  constructor(configuration) {
95
102
  this.configuration = configuration;
96
- this.c2CApi = new C2CApi(configuration);
103
+ this.api = new Api(configuration);
97
104
  }
98
105
  /**
99
106
  * Generic function to send a request.
@@ -122,28 +129,32 @@ var RestAPI = class {
122
129
  /**
123
130
  * Get C2C Trade History
124
131
  *
125
- * The max interval between startTimestamp and endTimestamp is 30 days.
126
- * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.
127
- * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder
132
+ * Weight(IP): 1
133
+ *
134
+ * Security Type: USER_DATA
128
135
  *
129
- * Weight: 1
136
+ * Notes:
137
+ * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.
138
+ * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.
139
+ * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.
130
140
  *
131
141
  * @summary Get C2C Trade History (USER_DATA)
132
142
  * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.
133
143
  *
134
144
  * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}
135
145
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
136
- * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}
146
+ * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}
137
147
  */
138
148
  getC2CTradeHistory(requestParameters = {}) {
139
- return this.c2CApi.getC2CTradeHistory(requestParameters);
149
+ return this.api.getC2CTradeHistory(requestParameters);
140
150
  }
141
151
  };
142
152
 
143
153
  //#endregion
144
154
  //#region src/rest-api/index.ts
145
155
  var rest_api_exports = /* @__PURE__ */ __export({
146
- C2CApi: () => C2CApi,
156
+ Api: () => Api,
157
+ GetC2CTradeHistoryTradeTypeEnum: () => GetC2CTradeHistoryTradeTypeEnum,
147
158
  RestAPI: () => RestAPI
148
159
  });
149
160
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","C2C_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/c2-capi.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/c2c.ts"],"sourcesContent":["{\n \"name\": \"@binance/c2c\",\n \"description\": \"Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.\",\n \"version\": \"5.0.4\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"C2C\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.1\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance C2C REST API\n *\n * OpenAPI Specification for the Binance C2C REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetC2CTradeHistoryResponse } from '../types';\n\n/**\n * C2CApi - axios parameter creator\n */\nconst C2CApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {string} [tradeType] BUY, SELL\n * @param {number | bigint} [startTimestamp]\n * @param {number | bigint} [endTimestamp]\n * @param {number | bigint} [page] Default 1\n * @param {number | bigint} [rows] default 100, max 100\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n tradeType?: string,\n startTimestamp?: number | bigint,\n endTimestamp?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (tradeType !== undefined && tradeType !== null) {\n localVarQueryParameter['tradeType'] = tradeType;\n }\n if (startTimestamp !== undefined && startTimestamp !== null) {\n localVarQueryParameter['startTimestamp'] = startTimestamp;\n }\n if (endTimestamp !== undefined && endTimestamp !== null) {\n localVarQueryParameter['endTimestamp'] = endTimestamp;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/c2c/orderMatch/listUserOrderHistory',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * C2CApi - interface\n * @interface C2CApi\n */\nexport interface C2CApiInterface {\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof C2CApiInterface\n */\n getC2CTradeHistory(\n requestParameters?: GetC2CTradeHistoryRequest\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;\n}\n\n/**\n * Request parameters for getC2CTradeHistory operation in C2CApi.\n * @interface GetC2CTradeHistoryRequest\n */\nexport interface GetC2CTradeHistoryRequest {\n /**\n * BUY, SELL\n * @type {string}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly tradeType?: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly startTimestamp?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly endTimestamp?: number | bigint;\n\n /**\n * Default 1\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 100\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof C2CApiGetC2CTradeHistory\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * C2CApi - object-oriented interface\n * @class C2CApi\n */\nexport class C2CApi implements C2CApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = C2CApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof C2CApi\n * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}\n */\n public async getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(\n requestParameters?.tradeType,\n requestParameters?.startTimestamp,\n requestParameters?.endTimestamp,\n requestParameters?.page,\n requestParameters?.rows,\n requestParameters?.recvWindow\n );\n return sendRequest<GetC2CTradeHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance C2C REST API\n *\n * OpenAPI Specification for the Binance C2C REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { C2CApi } from './modules/c2-capi';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/c2-capi';\n\nimport type { GetC2CTradeHistoryResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private c2CApi: C2CApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.c2CApi = new C2CApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get C2C Trade History\n *\n * The max interval between startTimestamp and endTimestamp is 30 days.\n * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned.\n * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder\n *\n * Weight: 1\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History Binance API Documentation}\n */\n getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n return this.c2CApi.getC2CTradeHistory(requestParameters);\n }\n}\n","/**\n * Binance C2C REST API\n *\n * OpenAPI Specification for the Binance C2C REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, C2C_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationC2C {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class C2C {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationC2C) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || C2C_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACsBf,MAAM,0BAA0B,SAAU,eAAqC;AAC3E,QAAO,EAoBH,oBAAoB,OAChB,WACA,gBACA,cACA,MACA,MACA,eACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;EACzD,MAAMC,0BAAmD,EAAE;AAE3D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,mBAAmB,UAAa,mBAAmB,KACnD,wBAAuB,oBAAoB;AAE/C,MAAI,iBAAiB,UAAa,iBAAiB,KAC/C,wBAAuB,kBAAkB;AAE7C,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;EAG3C,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;GACd,UAAU;GACb;IAER;;;;;;AAgFL,IAAa,SAAb,MAA+C;CAI3C,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,wBAAwB,cAAc;;;;;;;;;;;;;;;;;;CAmB3E,MAAa,mBACT,oBAA+C,EAAE,EACG;EACpD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,mBAC3D,mBAAmB,WACnB,mBAAmB,gBACnB,mBAAmB,cACnB,mBAAmB,MACnB,mBAAmB,MACnB,mBAAmB,WACtB;AACD,SAAO,YACH,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,cAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;AClMT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,SAAS,IAAI,OAAO,cAAc;;;;;;;;;;;CAY3C,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;CAmBL,mBACI,oBAA+C,EAAE,EACG;AACpD,SAAO,KAAK,OAAO,mBAAmB,kBAAkB;;;;;;;;;;;;;AE7FhE,IAAa,MAAb,MAAiB;CAGb,YAAY,QAA0B;EAClC,MAAM,YAAY,eAAe,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAI,qBACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
1
+ {"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","C2C_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/c2c.ts"],"sourcesContent":["{\n \"name\": \"@binance/c2c\",\n \"description\": \"Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.\",\n \"version\": \"6.0.1\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"C2C\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.5.8\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.5\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the C2C REST API.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetC2CTradeHistoryResponse } from '../types';\n\n/**\n * Api - axios parameter creator\n */\nconst ApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryTradeTypeEnum} [tradeType] Trade side filter\n * @param {number | bigint} [startTimestamp]\n * @param {number | bigint} [endTimestamp]\n * @param {number | bigint} [page] Page number\n * @param {number | bigint} [rows] Number of records per page\n *\n * @throws {RequiredError}\n */\n getC2CTradeHistory: async (\n tradeType?: GetC2CTradeHistoryTradeTypeEnum,\n startTimestamp?: number | bigint,\n endTimestamp?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (tradeType !== undefined && tradeType !== null) {\n localVarQueryParameter['tradeType'] = tradeType;\n }\n if (startTimestamp !== undefined && startTimestamp !== null) {\n localVarQueryParameter['startTimestamp'] = startTimestamp;\n }\n if (endTimestamp !== undefined && endTimestamp !== null) {\n localVarQueryParameter['endTimestamp'] = endTimestamp;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/c2c/orderMatch/listUserOrderHistory',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * Api - interface\n * @interface Api\n */\nexport interface ApiInterface {\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof ApiInterface\n */\n getC2CTradeHistory(\n requestParameters?: GetC2CTradeHistoryRequest\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>>;\n}\n\n/**\n * Request parameters for getC2CTradeHistory operation in Api.\n * @interface GetC2CTradeHistoryRequest\n */\nexport interface GetC2CTradeHistoryRequest {\n /**\n * Trade side filter\n * @type {'BUY' | 'SELL'}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly tradeType?: GetC2CTradeHistoryTradeTypeEnum;\n\n /**\n *\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly startTimestamp?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly endTimestamp?: number | bigint;\n\n /**\n * Page number\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly page?: number | bigint;\n\n /**\n * Number of records per page\n * @type {number | bigint}\n * @memberof ApiGetC2CTradeHistory\n */\n readonly rows?: number | bigint;\n}\n\n/**\n * Api - object-oriented interface\n * @class Api\n */\nexport class Api implements ApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = ApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof Api\n * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}\n */\n public async getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getC2CTradeHistory(\n requestParameters?.tradeType,\n requestParameters?.startTimestamp,\n requestParameters?.endTimestamp,\n requestParameters?.page,\n requestParameters?.rows\n );\n return sendRequest<GetC2CTradeHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n}\n\nexport enum GetC2CTradeHistoryTradeTypeEnum {\n BUY = 'BUY',\n SELL = 'SELL',\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the C2C REST API.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { Api } from './modules/api';\n\nimport type { GetC2CTradeHistoryRequest } from './modules/api';\n\nimport type { GetC2CTradeHistoryResponse } from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private api: Api;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.api = new Api(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get C2C Trade History\n *\n * Weight(IP): 1\n *\n * Security Type: USER_DATA\n *\n * Notes:\n * - The max interval between `startTimestamp` and `endTimestamp` is 30 days.\n * - If `startTimestamp` and `endTimestamp` are not sent, the recent 30 days' data is returned.\n * - You can only view data from the past 6 months. For all C2C orders, check `https://c2c.binance.com/en/fiatOrder`.\n *\n * @summary Get C2C Trade History (USER_DATA)\n * @param {GetC2CTradeHistoryRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetC2CTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-c2-c/api/rest-api/~#get-c2-ctrade-history Binance API Documentation}\n */\n getC2CTradeHistory(\n requestParameters: GetC2CTradeHistoryRequest = {}\n ): Promise<RestApiResponse<GetC2CTradeHistoryResponse>> {\n return this.api.getC2CTradeHistory(requestParameters);\n }\n}\n","/**\n * C2C REST API\n *\n * Query fiat transaction history via the C2C REST API.\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, C2C_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationC2C {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class C2C {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationC2C) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || C2C_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACqBf,MAAM,uBAAuB,SAAU,eAAqC;AACxE,QAAO,EAsBH,oBAAoB,OAChB,WACA,gBACA,cACA,MACA,SACuB;EACvB,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;EACzD,MAAMC,0BAAmD,EAAE;AAE3D,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,mBAAmB,UAAa,mBAAmB,KACnD,wBAAuB,oBAAoB;AAE/C,MAAI,iBAAiB,UAAa,iBAAiB,KAC/C,wBAAuB,kBAAkB;AAE7C,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;AAErC,MAAI,SAAS,UAAa,SAAS,KAC/B,wBAAuB,UAAU;EAGrC,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,cAAc;GACd,UAAU;GACb;IAER;;;;;;AA4EL,IAAa,MAAb,MAAyC;CAIrC,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,qBAAqB,cAAc;;;;;;;;;;;;;;;;;;;;;CAsBxE,MAAa,mBACT,oBAA+C,EAAE,EACG;EACpD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,mBAC3D,mBAAmB,WACnB,mBAAmB,gBACnB,mBAAmB,cACnB,mBAAmB,MACnB,mBAAmB,KACtB;AACD,SAAO,YACH,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,cAClB,mBAAmB,UACnB,EAAE,UAAU,OAAO,CACtB;;;AAIT,IAAY,8FAAL;AACH;AACA;;;;;;;;;;;;;;;;;;ACnMJ,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,MAAM,IAAI,IAAI,cAAc;;;;;;;;;;;CAYrC,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;;;CAsBL,mBACI,oBAA+C,EAAE,EACG;AACpD,SAAO,KAAK,IAAI,mBAAmB,kBAAkB;;;;;;;;;;;;;;AEhG7D,IAAa,MAAb,MAAiB;CAGb,YAAY,QAA0B;EAClC,MAAM,YAAY,eAAe,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAI,qBACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@binance/c2c",
3
3
  "description": "Official Binance C2C Connector - A lightweight library that provides a convenient interface to Binance's C2C REST API.",
4
- "version": "5.0.4",
4
+ "version": "6.0.1",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -47,7 +47,7 @@
47
47
  "@types/node": "^20.17.24",
48
48
  "eslint": "8.57.0",
49
49
  "jest": "^29.6.4",
50
- "json-with-bigint": "^3.4.4",
50
+ "json-with-bigint": "^3.5.8",
51
51
  "prettier": "^3.3.3",
52
52
  "ts-jest": "^29.1.1",
53
53
  "ts-node": "^10.9.1",
@@ -56,7 +56,7 @@
56
56
  "typescript-eslint": "^8.24.0"
57
57
  },
58
58
  "dependencies": {
59
- "@binance/common": "2.4.1",
59
+ "@binance/common": "2.4.5",
60
60
  "axios": "^1.7.4"
61
61
  }
62
62
  }