@binance/fiat 4.0.0 → 5.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/dist/index.mjs CHANGED
@@ -1,483 +1,226 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name2 in all)
4
- __defProp(target, name2, { get: all[name2], enumerable: true });
5
- };
6
-
7
- // src/fiat.ts
8
- import { buildUserAgent, ConfigurationRestAPI as ConfigurationRestAPI3, FIAT_REST_API_PROD_URL } from "@binance/common";
1
+ import { t as __export } from "./chunk.mjs";
2
+ import { BadRequestError, ConfigurationRestAPI, ConnectorClientError, FIAT_REST_API_PROD_URL, FIAT_REST_API_PROD_URL as FIAT_REST_API_PROD_URL$1, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError, assertParamExists, buildUserAgent, sendRequest } from "@binance/common";
9
3
 
10
- // package.json
4
+ //#region package.json
11
5
  var name = "@binance/fiat";
12
- var version = "4.0.0";
13
-
14
- // src/rest-api/index.ts
15
- var rest_api_exports = {};
16
- __export(rest_api_exports, {
17
- FiatApi: () => FiatApi,
18
- RestAPI: () => RestAPI
19
- });
6
+ var version = "5.0.1";
20
7
 
21
- // src/rest-api/modules/fiat-api.ts
22
- import {
23
- assertParamExists,
24
- sendRequest
25
- } from "@binance/common";
26
- var FiatApiAxiosParamCreator = function(configuration) {
27
- return {
28
- /**
29
- * Submit withdraw request, in this version, we only support BRL withdrawal via bank_transfer.
30
- *
31
- * You need to call this api first, and call query order detail api in a loop to get the status of the order until this order is successful.
32
- *
33
- * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.
34
- *
35
- * you need to bind your bank account on web/app before using the corresponding account number
36
- *
37
- * Weight: 45000
38
- *
39
- * @summary Fiat Withdraw(WITHDRAW)
40
- * @param {number | bigint} [recvWindow]
41
- *
42
- * @throws {RequiredError}
43
- */
44
- fiatWithdraw: async (recvWindow) => {
45
- const localVarQueryParameter = {};
46
- if (recvWindow !== void 0 && recvWindow !== null) {
47
- localVarQueryParameter["recvWindow"] = recvWindow;
48
- }
49
- let _timeUnit;
50
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
51
- return {
52
- endpoint: "/sapi/v2/fiat/withdraw",
53
- method: "GET",
54
- params: localVarQueryParameter,
55
- timeUnit: _timeUnit
56
- };
57
- },
58
- /**
59
- * Get Fiat Deposit/Withdraw History
60
- *
61
- * If beginTime and endTime are not sent, the recent 30-day data will be returned.
62
- *
63
- * Weight: 45000
64
- *
65
- * @summary Get Fiat Deposit/Withdraw History (USER_DATA)
66
- * @param {string} transactionType 0-buy,1-sell
67
- * @param {number | bigint} [beginTime]
68
- * @param {number | bigint} [endTime]
69
- * @param {number | bigint} [page] default 1
70
- * @param {number | bigint} [rows] default 100, max 500
71
- * @param {number | bigint} [recvWindow]
72
- *
73
- * @throws {RequiredError}
74
- */
75
- getFiatDepositWithdrawHistory: async (transactionType, beginTime, endTime, page, rows, recvWindow) => {
76
- assertParamExists("getFiatDepositWithdrawHistory", "transactionType", transactionType);
77
- const localVarQueryParameter = {};
78
- if (transactionType !== void 0 && transactionType !== null) {
79
- localVarQueryParameter["transactionType"] = transactionType;
80
- }
81
- if (beginTime !== void 0 && beginTime !== null) {
82
- localVarQueryParameter["beginTime"] = beginTime;
83
- }
84
- if (endTime !== void 0 && endTime !== null) {
85
- localVarQueryParameter["endTime"] = endTime;
86
- }
87
- if (page !== void 0 && page !== null) {
88
- localVarQueryParameter["page"] = page;
89
- }
90
- if (rows !== void 0 && rows !== null) {
91
- localVarQueryParameter["rows"] = rows;
92
- }
93
- if (recvWindow !== void 0 && recvWindow !== null) {
94
- localVarQueryParameter["recvWindow"] = recvWindow;
95
- }
96
- let _timeUnit;
97
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
98
- return {
99
- endpoint: "/sapi/v1/fiat/orders",
100
- method: "GET",
101
- params: localVarQueryParameter,
102
- timeUnit: _timeUnit
103
- };
104
- },
105
- /**
106
- * Get Fiat Deposit/Withdraw History
107
- *
108
- * If beginTime and endTime are not sent, the recent 30-day data will be returned.
109
- * paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:
110
- * Cash Balance
111
- * Credit Card
112
- * Online Banking
113
- * Bank Transfer
114
- *
115
- * Weight: 1
116
- *
117
- * @summary Get Fiat Payments History (USER_DATA)
118
- * @param {string} transactionType 0-buy,1-sell
119
- * @param {number | bigint} [beginTime]
120
- * @param {number | bigint} [endTime]
121
- * @param {number | bigint} [page] default 1
122
- * @param {number | bigint} [rows] default 100, max 500
123
- * @param {number | bigint} [recvWindow]
124
- *
125
- * @throws {RequiredError}
126
- */
127
- getFiatPaymentsHistory: async (transactionType, beginTime, endTime, page, rows, recvWindow) => {
128
- assertParamExists("getFiatPaymentsHistory", "transactionType", transactionType);
129
- const localVarQueryParameter = {};
130
- if (transactionType !== void 0 && transactionType !== null) {
131
- localVarQueryParameter["transactionType"] = transactionType;
132
- }
133
- if (beginTime !== void 0 && beginTime !== null) {
134
- localVarQueryParameter["beginTime"] = beginTime;
135
- }
136
- if (endTime !== void 0 && endTime !== null) {
137
- localVarQueryParameter["endTime"] = endTime;
138
- }
139
- if (page !== void 0 && page !== null) {
140
- localVarQueryParameter["page"] = page;
141
- }
142
- if (rows !== void 0 && rows !== null) {
143
- localVarQueryParameter["rows"] = rows;
144
- }
145
- if (recvWindow !== void 0 && recvWindow !== null) {
146
- localVarQueryParameter["recvWindow"] = recvWindow;
147
- }
148
- let _timeUnit;
149
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
150
- return {
151
- endpoint: "/sapi/v1/fiat/payments",
152
- method: "GET",
153
- params: localVarQueryParameter,
154
- timeUnit: _timeUnit
155
- };
156
- },
157
- /**
158
- * Get Order Detail
159
- *
160
- * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.
161
- *
162
- * Weight: 45000
163
- *
164
- * @summary Get Order Detail(USER_DATA)
165
- * @param {string} orderId order id retrieved from the api call of withdrawal
166
- * @param {number | bigint} [recvWindow]
167
- *
168
- * @throws {RequiredError}
169
- */
170
- getOrderDetail: async (orderId, recvWindow) => {
171
- assertParamExists("getOrderDetail", "orderId", orderId);
172
- const localVarQueryParameter = {};
173
- if (orderId !== void 0 && orderId !== null) {
174
- localVarQueryParameter["orderId"] = orderId;
175
- }
176
- if (recvWindow !== void 0 && recvWindow !== null) {
177
- localVarQueryParameter["recvWindow"] = recvWindow;
178
- }
179
- let _timeUnit;
180
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
181
- return {
182
- endpoint: "/sapi/v1/fiat/get-order-detail",
183
- method: "GET",
184
- params: localVarQueryParameter,
185
- timeUnit: _timeUnit
186
- };
187
- }
188
- };
8
+ //#endregion
9
+ //#region src/rest-api/modules/fiat-api.ts
10
+ /**
11
+ * Binance Fiat REST API
12
+ *
13
+ * OpenAPI Specification for the Binance Fiat REST API
14
+ *
15
+ * The version of the OpenAPI document: 1.0.0
16
+ *
17
+ *
18
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19
+ * https://openapi-generator.tech
20
+ * Do not edit the class manually.
21
+ */
22
+ /**
23
+ * FiatApi - axios parameter creator
24
+ */
25
+ const FiatApiAxiosParamCreator = function(configuration) {
26
+ return {
27
+ getFiatDepositWithdrawHistory: async (transactionType, beginTime, endTime, page, rows, recvWindow) => {
28
+ assertParamExists("getFiatDepositWithdrawHistory", "transactionType", transactionType);
29
+ const localVarQueryParameter = {};
30
+ if (transactionType !== void 0 && transactionType !== null) localVarQueryParameter["transactionType"] = transactionType;
31
+ if (beginTime !== void 0 && beginTime !== null) localVarQueryParameter["beginTime"] = beginTime;
32
+ if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
33
+ if (page !== void 0 && page !== null) localVarQueryParameter["page"] = page;
34
+ if (rows !== void 0 && rows !== null) localVarQueryParameter["rows"] = rows;
35
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
36
+ let _timeUnit;
37
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
38
+ return {
39
+ endpoint: "/sapi/v1/fiat/orders",
40
+ method: "GET",
41
+ params: localVarQueryParameter,
42
+ timeUnit: _timeUnit
43
+ };
44
+ },
45
+ getFiatPaymentsHistory: async (transactionType, beginTime, endTime, page, rows, recvWindow) => {
46
+ assertParamExists("getFiatPaymentsHistory", "transactionType", transactionType);
47
+ const localVarQueryParameter = {};
48
+ if (transactionType !== void 0 && transactionType !== null) localVarQueryParameter["transactionType"] = transactionType;
49
+ if (beginTime !== void 0 && beginTime !== null) localVarQueryParameter["beginTime"] = beginTime;
50
+ if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
51
+ if (page !== void 0 && page !== null) localVarQueryParameter["page"] = page;
52
+ if (rows !== void 0 && rows !== null) localVarQueryParameter["rows"] = rows;
53
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
54
+ let _timeUnit;
55
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
56
+ return {
57
+ endpoint: "/sapi/v1/fiat/payments",
58
+ method: "GET",
59
+ params: localVarQueryParameter,
60
+ timeUnit: _timeUnit
61
+ };
62
+ }
63
+ };
189
64
  };
65
+ /**
66
+ * FiatApi - object-oriented interface
67
+ * @class FiatApi
68
+ */
190
69
  var FiatApi = class {
191
- constructor(configuration) {
192
- this.configuration = configuration;
193
- this.localVarAxiosParamCreator = FiatApiAxiosParamCreator(configuration);
194
- }
195
- /**
196
- * Submit withdraw request, in this version, we only support BRL withdrawal via bank_transfer.
197
- *
198
- * You need to call this api first, and call query order detail api in a loop to get the status of the order until this order is successful.
199
- *
200
- * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.
201
- *
202
- * you need to bind your bank account on web/app before using the corresponding account number
203
- *
204
- * Weight: 45000
205
- *
206
- * @summary Fiat Withdraw(WITHDRAW)
207
- * @param {FiatWithdrawRequest} requestParameters Request parameters.
208
- * @returns {Promise<RestApiResponse<FiatWithdrawResponse>>}
209
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
210
- * @memberof FiatApi
211
- * @see {@link https://developers.binance.com/docs/fiat/rest-api/Fiat-Withdraw Binance API Documentation}
212
- */
213
- async fiatWithdraw(requestParameters = {}) {
214
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.fiatWithdraw(
215
- requestParameters?.recvWindow
216
- );
217
- return sendRequest(
218
- this.configuration,
219
- localVarAxiosArgs.endpoint,
220
- localVarAxiosArgs.method,
221
- localVarAxiosArgs.params,
222
- localVarAxiosArgs?.timeUnit,
223
- { isSigned: true }
224
- );
225
- }
226
- /**
227
- * Get Fiat Deposit/Withdraw History
228
- *
229
- * If beginTime and endTime are not sent, the recent 30-day data will be returned.
230
- *
231
- * Weight: 45000
232
- *
233
- * @summary Get Fiat Deposit/Withdraw History (USER_DATA)
234
- * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.
235
- * @returns {Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>}
236
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
237
- * @memberof FiatApi
238
- * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History Binance API Documentation}
239
- */
240
- async getFiatDepositWithdrawHistory(requestParameters) {
241
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFiatDepositWithdrawHistory(
242
- requestParameters?.transactionType,
243
- requestParameters?.beginTime,
244
- requestParameters?.endTime,
245
- requestParameters?.page,
246
- requestParameters?.rows,
247
- requestParameters?.recvWindow
248
- );
249
- return sendRequest(
250
- this.configuration,
251
- localVarAxiosArgs.endpoint,
252
- localVarAxiosArgs.method,
253
- localVarAxiosArgs.params,
254
- localVarAxiosArgs?.timeUnit,
255
- { isSigned: true }
256
- );
257
- }
258
- /**
259
- * Get Fiat Deposit/Withdraw History
260
- *
261
- * If beginTime and endTime are not sent, the recent 30-day data will be returned.
262
- * paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:
263
- * Cash Balance
264
- * Credit Card
265
- * Online Banking
266
- * Bank Transfer
267
- *
268
- * Weight: 1
269
- *
270
- * @summary Get Fiat Payments History (USER_DATA)
271
- * @param {GetFiatPaymentsHistoryRequest} requestParameters Request parameters.
272
- * @returns {Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>}
273
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
274
- * @memberof FiatApi
275
- * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History Binance API Documentation}
276
- */
277
- async getFiatPaymentsHistory(requestParameters) {
278
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFiatPaymentsHistory(
279
- requestParameters?.transactionType,
280
- requestParameters?.beginTime,
281
- requestParameters?.endTime,
282
- requestParameters?.page,
283
- requestParameters?.rows,
284
- requestParameters?.recvWindow
285
- );
286
- return sendRequest(
287
- this.configuration,
288
- localVarAxiosArgs.endpoint,
289
- localVarAxiosArgs.method,
290
- localVarAxiosArgs.params,
291
- localVarAxiosArgs?.timeUnit,
292
- { isSigned: true }
293
- );
294
- }
295
- /**
296
- * Get Order Detail
297
- *
298
- * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.
299
- *
300
- * Weight: 45000
301
- *
302
- * @summary Get Order Detail(USER_DATA)
303
- * @param {GetOrderDetailRequest} requestParameters Request parameters.
304
- * @returns {Promise<RestApiResponse<GetOrderDetailResponse>>}
305
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
306
- * @memberof FiatApi
307
- * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Order-Detail Binance API Documentation}
308
- */
309
- async getOrderDetail(requestParameters) {
310
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOrderDetail(
311
- requestParameters?.orderId,
312
- requestParameters?.recvWindow
313
- );
314
- return sendRequest(
315
- this.configuration,
316
- localVarAxiosArgs.endpoint,
317
- localVarAxiosArgs.method,
318
- localVarAxiosArgs.params,
319
- localVarAxiosArgs?.timeUnit,
320
- { isSigned: true }
321
- );
322
- }
70
+ constructor(configuration) {
71
+ this.configuration = configuration;
72
+ this.localVarAxiosParamCreator = FiatApiAxiosParamCreator(configuration);
73
+ }
74
+ /**
75
+ * Get Fiat Deposit/Withdraw History
76
+ *
77
+ * If beginTime and endTime are not sent, the recent 30-day data will be returned.
78
+ *
79
+ * Weight: 45000
80
+ *
81
+ * @summary Get Fiat Deposit/Withdraw History (USER_DATA)
82
+ * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.
83
+ * @returns {Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>}
84
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
85
+ * @memberof FiatApi
86
+ * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History Binance API Documentation}
87
+ */
88
+ async getFiatDepositWithdrawHistory(requestParameters) {
89
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFiatDepositWithdrawHistory(requestParameters?.transactionType, requestParameters?.beginTime, requestParameters?.endTime, requestParameters?.page, requestParameters?.rows, requestParameters?.recvWindow);
90
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
91
+ }
92
+ /**
93
+ * Get Fiat Deposit/Withdraw History
94
+ *
95
+ * If beginTime and endTime are not sent, the recent 30-day data will be returned.
96
+ * paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:
97
+ * Cash Balance
98
+ * Credit Card
99
+ * Online Banking
100
+ * Bank Transfer
101
+ *
102
+ * Weight: 1
103
+ *
104
+ * @summary Get Fiat Payments History (USER_DATA)
105
+ * @param {GetFiatPaymentsHistoryRequest} requestParameters Request parameters.
106
+ * @returns {Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>}
107
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
108
+ * @memberof FiatApi
109
+ * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History Binance API Documentation}
110
+ */
111
+ async getFiatPaymentsHistory(requestParameters) {
112
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFiatPaymentsHistory(requestParameters?.transactionType, requestParameters?.beginTime, requestParameters?.endTime, requestParameters?.page, requestParameters?.rows, requestParameters?.recvWindow);
113
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
114
+ }
323
115
  };
324
116
 
325
- // src/rest-api/rest-api.ts
326
- import { sendRequest as sendRequest2 } from "@binance/common";
117
+ //#endregion
118
+ //#region src/rest-api/rest-api.ts
119
+ /**
120
+ * Binance Fiat REST API
121
+ *
122
+ * OpenAPI Specification for the Binance Fiat REST API
123
+ *
124
+ * The version of the OpenAPI document: 1.0.0
125
+ *
126
+ *
127
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
128
+ * https://openapi-generator.tech
129
+ * Do not edit the class manually.
130
+ */
327
131
  var RestAPI = class {
328
- constructor(configuration) {
329
- this.configuration = configuration;
330
- this.fiatApi = new FiatApi(configuration);
331
- }
332
- /**
333
- * Generic function to send a request.
334
- * @param endpoint - The API endpoint to call.
335
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
336
- * @param params - Query parameters for the request.
337
- *
338
- * @returns A promise resolving to the response data object.
339
- */
340
- sendRequest(endpoint, method, params = {}) {
341
- return sendRequest2(this.configuration, endpoint, method, params, void 0);
342
- }
343
- /**
344
- * Generic function to send a signed request.
345
- * @param endpoint - The API endpoint to call.
346
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
347
- * @param params - Query parameters for the request.
348
- *
349
- * @returns A promise resolving to the response data object.
350
- */
351
- sendSignedRequest(endpoint, method, params = {}) {
352
- return sendRequest2(this.configuration, endpoint, method, params, void 0, {
353
- isSigned: true
354
- });
355
- }
356
- /**
357
- * Submit withdraw request, in this version, we only support BRL withdrawal via bank_transfer.
358
- *
359
- * You need to call this api first, and call query order detail api in a loop to get the status of the order until this order is successful.
360
- *
361
- * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.
362
- *
363
- * you need to bind your bank account on web/app before using the corresponding account number
364
- *
365
- * Weight: 45000
366
- *
367
- * @summary Fiat Withdraw(WITHDRAW)
368
- * @param {FiatWithdrawRequest} requestParameters Request parameters.
369
- *
370
- * @returns {Promise<RestApiResponse<FiatWithdrawResponse>>}
371
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
372
- * @see {@link https://developers.binance.com/docs/fiat/rest-api/Fiat-Withdraw Binance API Documentation}
373
- */
374
- fiatWithdraw(requestParameters = {}) {
375
- return this.fiatApi.fiatWithdraw(requestParameters);
376
- }
377
- /**
378
- * Get Fiat Deposit/Withdraw History
379
- *
380
- * If beginTime and endTime are not sent, the recent 30-day data will be returned.
381
- *
382
- * Weight: 45000
383
- *
384
- * @summary Get Fiat Deposit/Withdraw History (USER_DATA)
385
- * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.
386
- *
387
- * @returns {Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>}
388
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
389
- * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History Binance API Documentation}
390
- */
391
- getFiatDepositWithdrawHistory(requestParameters) {
392
- return this.fiatApi.getFiatDepositWithdrawHistory(requestParameters);
393
- }
394
- /**
395
- * Get Fiat Deposit/Withdraw History
396
- *
397
- * If beginTime and endTime are not sent, the recent 30-day data will be returned.
398
- * paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:
399
- * Cash Balance
400
- * Credit Card
401
- * Online Banking
402
- * Bank Transfer
403
- *
404
- * Weight: 1
405
- *
406
- * @summary Get Fiat Payments History (USER_DATA)
407
- * @param {GetFiatPaymentsHistoryRequest} requestParameters Request parameters.
408
- *
409
- * @returns {Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>}
410
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
411
- * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History Binance API Documentation}
412
- */
413
- getFiatPaymentsHistory(requestParameters) {
414
- return this.fiatApi.getFiatPaymentsHistory(requestParameters);
415
- }
416
- /**
417
- * Get Order Detail
418
- *
419
- * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.
420
- *
421
- * Weight: 45000
422
- *
423
- * @summary Get Order Detail(USER_DATA)
424
- * @param {GetOrderDetailRequest} requestParameters Request parameters.
425
- *
426
- * @returns {Promise<RestApiResponse<GetOrderDetailResponse>>}
427
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
428
- * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Order-Detail Binance API Documentation}
429
- */
430
- getOrderDetail(requestParameters) {
431
- return this.fiatApi.getOrderDetail(requestParameters);
432
- }
132
+ constructor(configuration) {
133
+ this.configuration = configuration;
134
+ this.fiatApi = new FiatApi(configuration);
135
+ }
136
+ /**
137
+ * Generic function to send a request.
138
+ * @param endpoint - The API endpoint to call.
139
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
140
+ * @param params - Query parameters for the request.
141
+ *
142
+ * @returns A promise resolving to the response data object.
143
+ */
144
+ sendRequest(endpoint, method, params = {}) {
145
+ return sendRequest(this.configuration, endpoint, method, params, void 0);
146
+ }
147
+ /**
148
+ * Generic function to send a signed request.
149
+ * @param endpoint - The API endpoint to call.
150
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
151
+ * @param params - Query parameters for the request.
152
+ *
153
+ * @returns A promise resolving to the response data object.
154
+ */
155
+ sendSignedRequest(endpoint, method, params = {}) {
156
+ return sendRequest(this.configuration, endpoint, method, params, void 0, { isSigned: true });
157
+ }
158
+ /**
159
+ * Get Fiat Deposit/Withdraw History
160
+ *
161
+ * If beginTime and endTime are not sent, the recent 30-day data will be returned.
162
+ *
163
+ * Weight: 45000
164
+ *
165
+ * @summary Get Fiat Deposit/Withdraw History (USER_DATA)
166
+ * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.
167
+ *
168
+ * @returns {Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>}
169
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
170
+ * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History Binance API Documentation}
171
+ */
172
+ getFiatDepositWithdrawHistory(requestParameters) {
173
+ return this.fiatApi.getFiatDepositWithdrawHistory(requestParameters);
174
+ }
175
+ /**
176
+ * Get Fiat Deposit/Withdraw History
177
+ *
178
+ * If beginTime and endTime are not sent, the recent 30-day data will be returned.
179
+ * paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:
180
+ * Cash Balance
181
+ * Credit Card
182
+ * Online Banking
183
+ * Bank Transfer
184
+ *
185
+ * Weight: 1
186
+ *
187
+ * @summary Get Fiat Payments History (USER_DATA)
188
+ * @param {GetFiatPaymentsHistoryRequest} requestParameters Request parameters.
189
+ *
190
+ * @returns {Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>}
191
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
192
+ * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History Binance API Documentation}
193
+ */
194
+ getFiatPaymentsHistory(requestParameters) {
195
+ return this.fiatApi.getFiatPaymentsHistory(requestParameters);
196
+ }
433
197
  };
434
198
 
435
- // src/fiat.ts
199
+ //#endregion
200
+ //#region src/rest-api/index.ts
201
+ var rest_api_exports = /* @__PURE__ */ __export({
202
+ FiatApi: () => FiatApi,
203
+ RestAPI: () => RestAPI
204
+ });
205
+
206
+ //#endregion
207
+ //#region src/fiat.ts
436
208
  var Fiat = class {
437
- constructor(config) {
438
- const userAgent = buildUserAgent(name, version);
439
- if (config?.configurationRestAPI) {
440
- const configRestAPI = new ConfigurationRestAPI3(
441
- config.configurationRestAPI
442
- );
443
- configRestAPI.basePath = configRestAPI.basePath || FIAT_REST_API_PROD_URL;
444
- configRestAPI.baseOptions = configRestAPI.baseOptions || {};
445
- configRestAPI.baseOptions.headers = {
446
- ...configRestAPI.baseOptions.headers || {},
447
- "User-Agent": userAgent
448
- };
449
- this.restAPI = new RestAPI(configRestAPI);
450
- }
451
- }
209
+ constructor(config) {
210
+ const userAgent = buildUserAgent(name, version);
211
+ if (config?.configurationRestAPI) {
212
+ const configRestAPI = new ConfigurationRestAPI(config.configurationRestAPI);
213
+ configRestAPI.basePath = configRestAPI.basePath || FIAT_REST_API_PROD_URL$1;
214
+ configRestAPI.baseOptions = configRestAPI.baseOptions || {};
215
+ configRestAPI.baseOptions.headers = {
216
+ ...configRestAPI.baseOptions.headers || {},
217
+ "User-Agent": userAgent
218
+ };
219
+ this.restAPI = new RestAPI(configRestAPI);
220
+ }
221
+ }
452
222
  };
453
223
 
454
- // src/index.ts
455
- import {
456
- FIAT_REST_API_PROD_URL as FIAT_REST_API_PROD_URL2,
457
- ConnectorClientError,
458
- RequiredError,
459
- UnauthorizedError,
460
- ForbiddenError,
461
- TooManyRequestsError,
462
- RateLimitBanError,
463
- ServerError,
464
- NetworkError,
465
- NotFoundError,
466
- BadRequestError
467
- } from "@binance/common";
468
- export {
469
- BadRequestError,
470
- ConnectorClientError,
471
- FIAT_REST_API_PROD_URL2 as FIAT_REST_API_PROD_URL,
472
- Fiat,
473
- rest_api_exports as FiatRestAPI,
474
- ForbiddenError,
475
- NetworkError,
476
- NotFoundError,
477
- RateLimitBanError,
478
- RequiredError,
479
- ServerError,
480
- TooManyRequestsError,
481
- UnauthorizedError
482
- };
224
+ //#endregion
225
+ export { BadRequestError, ConfigurationFiat, ConnectorClientError, FIAT_REST_API_PROD_URL, Fiat, rest_api_exports as FiatRestAPI, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
483
226
  //# sourceMappingURL=index.mjs.map