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