@binance/fiat 1.0.0

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 ADDED
@@ -0,0 +1,343 @@
1
+ "use strict";
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 });
9
+ };
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
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_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_REST_API_TESTNET_URL: () => import_common4.FIAT_REST_API_TESTNET_URL,
27
+ Fiat: () => Fiat,
28
+ FiatRestAPI: () => rest_api_exports,
29
+ ForbiddenError: () => import_common4.ForbiddenError,
30
+ NetworkError: () => import_common4.NetworkError,
31
+ NotFoundError: () => import_common4.NotFoundError,
32
+ RateLimitBanError: () => import_common4.RateLimitBanError,
33
+ RequiredError: () => import_common4.RequiredError,
34
+ ServerError: () => import_common4.ServerError,
35
+ TooManyRequestsError: () => import_common4.TooManyRequestsError,
36
+ UnauthorizedError: () => import_common4.UnauthorizedError
37
+ });
38
+ module.exports = __toCommonJS(src_exports);
39
+
40
+ // src/fiat.ts
41
+ var import_os = require("os");
42
+ var import_common3 = require("@binance/common");
43
+
44
+ // package.json
45
+ var name = "@binance/fiat";
46
+ var version = "1.0.0";
47
+
48
+ // src/rest-api/index.ts
49
+ var rest_api_exports = {};
50
+ __export(rest_api_exports, {
51
+ FiatApi: () => FiatApi,
52
+ RestAPI: () => RestAPI
53
+ });
54
+
55
+ // src/rest-api/modules/fiat-api.ts
56
+ var import_common = require("@binance/common");
57
+ var FiatApiAxiosParamCreator = function(configuration) {
58
+ return {
59
+ /**
60
+ * Get Fiat Deposit/Withdraw History
61
+ *
62
+ * If beginTime and endTime are not sent, the recent 30-day data will be returned.
63
+ *
64
+ * Weight: 90000
65
+ *
66
+ * @summary Get Fiat Deposit/Withdraw History (USER_DATA)
67
+ * @param {string} transactionType 0-buy,1-sell
68
+ * @param {number} [beginTime]
69
+ * @param {number} [endTime]
70
+ * @param {number} [page] default 1
71
+ * @param {number} [rows] default 100, max 500
72
+ * @param {number} [recvWindow]
73
+ *
74
+ * @throws {RequiredError}
75
+ */
76
+ getFiatDepositWithdrawHistory: async (transactionType, beginTime, endTime, page, rows, recvWindow) => {
77
+ (0, import_common.assertParamExists)("getFiatDepositWithdrawHistory", "transactionType", transactionType);
78
+ const localVarQueryParameter = {};
79
+ if (transactionType !== void 0 && transactionType !== null) {
80
+ localVarQueryParameter["transactionType"] = transactionType;
81
+ }
82
+ if (beginTime !== void 0 && beginTime !== null) {
83
+ localVarQueryParameter["beginTime"] = beginTime;
84
+ }
85
+ if (endTime !== void 0 && endTime !== null) {
86
+ localVarQueryParameter["endTime"] = endTime;
87
+ }
88
+ if (page !== void 0 && page !== null) {
89
+ localVarQueryParameter["page"] = page;
90
+ }
91
+ if (rows !== void 0 && rows !== null) {
92
+ localVarQueryParameter["rows"] = rows;
93
+ }
94
+ if (recvWindow !== void 0 && recvWindow !== null) {
95
+ localVarQueryParameter["recvWindow"] = recvWindow;
96
+ }
97
+ let _timeUnit;
98
+ if ("timeUnit" in configuration)
99
+ _timeUnit = configuration.timeUnit;
100
+ return {
101
+ endpoint: "/sapi/v1/fiat/orders",
102
+ method: "GET",
103
+ params: localVarQueryParameter,
104
+ timeUnit: _timeUnit
105
+ };
106
+ },
107
+ /**
108
+ * Get Fiat Deposit/Withdraw History
109
+ *
110
+ * If beginTime and endTime are not sent, the recent 30-day data will be returned.
111
+ * paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:
112
+ * Cash Balance
113
+ * Credit Card
114
+ * Online Banking
115
+ * Bank Transfer
116
+ *
117
+ * Weight: 1
118
+ *
119
+ * @summary Get Fiat Payments History (USER_DATA)
120
+ * @param {string} transactionType 0-buy,1-sell
121
+ * @param {number} [beginTime]
122
+ * @param {number} [endTime]
123
+ * @param {number} [page] default 1
124
+ * @param {number} [rows] default 100, max 500
125
+ * @param {number} [recvWindow]
126
+ *
127
+ * @throws {RequiredError}
128
+ */
129
+ getFiatPaymentsHistory: async (transactionType, beginTime, endTime, page, rows, recvWindow) => {
130
+ (0, import_common.assertParamExists)("getFiatPaymentsHistory", "transactionType", transactionType);
131
+ const localVarQueryParameter = {};
132
+ if (transactionType !== void 0 && transactionType !== null) {
133
+ localVarQueryParameter["transactionType"] = transactionType;
134
+ }
135
+ if (beginTime !== void 0 && beginTime !== null) {
136
+ localVarQueryParameter["beginTime"] = beginTime;
137
+ }
138
+ if (endTime !== void 0 && endTime !== null) {
139
+ localVarQueryParameter["endTime"] = endTime;
140
+ }
141
+ if (page !== void 0 && page !== null) {
142
+ localVarQueryParameter["page"] = page;
143
+ }
144
+ if (rows !== void 0 && rows !== null) {
145
+ localVarQueryParameter["rows"] = rows;
146
+ }
147
+ if (recvWindow !== void 0 && recvWindow !== null) {
148
+ localVarQueryParameter["recvWindow"] = recvWindow;
149
+ }
150
+ let _timeUnit;
151
+ if ("timeUnit" in configuration)
152
+ _timeUnit = configuration.timeUnit;
153
+ return {
154
+ endpoint: "/sapi/v1/fiat/payments",
155
+ method: "GET",
156
+ params: localVarQueryParameter,
157
+ timeUnit: _timeUnit
158
+ };
159
+ }
160
+ };
161
+ };
162
+ var FiatApi = class {
163
+ constructor(configuration) {
164
+ this.configuration = configuration;
165
+ this.localVarAxiosParamCreator = FiatApiAxiosParamCreator(configuration);
166
+ }
167
+ /**
168
+ * Get Fiat Deposit/Withdraw History
169
+ *
170
+ * If beginTime and endTime are not sent, the recent 30-day data will be returned.
171
+ *
172
+ * Weight: 90000
173
+ *
174
+ * @summary Get Fiat Deposit/Withdraw History (USER_DATA)
175
+ * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.
176
+ * @returns {Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>}
177
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
178
+ * @memberof FiatApi
179
+ * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History Binance API Documentation}
180
+ */
181
+ async getFiatDepositWithdrawHistory(requestParameters) {
182
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFiatDepositWithdrawHistory(
183
+ requestParameters?.transactionType,
184
+ requestParameters?.beginTime,
185
+ requestParameters?.endTime,
186
+ requestParameters?.page,
187
+ requestParameters?.rows,
188
+ requestParameters?.recvWindow
189
+ );
190
+ return (0, import_common.sendRequest)(
191
+ this.configuration,
192
+ localVarAxiosArgs.endpoint,
193
+ localVarAxiosArgs.method,
194
+ localVarAxiosArgs.params,
195
+ localVarAxiosArgs?.timeUnit,
196
+ { isSigned: true }
197
+ );
198
+ }
199
+ /**
200
+ * Get Fiat Deposit/Withdraw History
201
+ *
202
+ * If beginTime and endTime are not sent, the recent 30-day data will be returned.
203
+ * paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:
204
+ * Cash Balance
205
+ * Credit Card
206
+ * Online Banking
207
+ * Bank Transfer
208
+ *
209
+ * Weight: 1
210
+ *
211
+ * @summary Get Fiat Payments History (USER_DATA)
212
+ * @param {GetFiatPaymentsHistoryRequest} requestParameters Request parameters.
213
+ * @returns {Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>}
214
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
215
+ * @memberof FiatApi
216
+ * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History Binance API Documentation}
217
+ */
218
+ async getFiatPaymentsHistory(requestParameters) {
219
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFiatPaymentsHistory(
220
+ requestParameters?.transactionType,
221
+ requestParameters?.beginTime,
222
+ requestParameters?.endTime,
223
+ requestParameters?.page,
224
+ requestParameters?.rows,
225
+ requestParameters?.recvWindow
226
+ );
227
+ return (0, import_common.sendRequest)(
228
+ this.configuration,
229
+ localVarAxiosArgs.endpoint,
230
+ localVarAxiosArgs.method,
231
+ localVarAxiosArgs.params,
232
+ localVarAxiosArgs?.timeUnit,
233
+ { isSigned: true }
234
+ );
235
+ }
236
+ };
237
+
238
+ // src/rest-api/rest-api.ts
239
+ var import_common2 = require("@binance/common");
240
+ var RestAPI = class {
241
+ constructor(configuration) {
242
+ this.configuration = configuration;
243
+ this.fiatApi = new FiatApi(configuration);
244
+ }
245
+ /**
246
+ * Generic function to send a request.
247
+ * @param endpoint - The API endpoint to call.
248
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
249
+ * @param params - Query parameters for the request.
250
+ *
251
+ * @returns A promise resolving to the response data object.
252
+ */
253
+ sendRequest(endpoint, method, params = {}) {
254
+ return (0, import_common2.sendRequest)(this.configuration, endpoint, method, params, void 0);
255
+ }
256
+ /**
257
+ * Generic function to send a signed request.
258
+ * @param endpoint - The API endpoint to call.
259
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
260
+ * @param params - Query parameters for the request.
261
+ *
262
+ * @returns A promise resolving to the response data object.
263
+ */
264
+ sendSignedRequest(endpoint, method, params = {}) {
265
+ return (0, import_common2.sendRequest)(this.configuration, endpoint, method, params, void 0, {
266
+ isSigned: true
267
+ });
268
+ }
269
+ /**
270
+ * Get Fiat Deposit/Withdraw History
271
+ *
272
+ * If beginTime and endTime are not sent, the recent 30-day data will be returned.
273
+ *
274
+ * Weight: 90000
275
+ *
276
+ * @summary Get Fiat Deposit/Withdraw History (USER_DATA)
277
+ * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.
278
+ * @returns {Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>}
279
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
280
+ * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History Binance API Documentation}
281
+ */
282
+ getFiatDepositWithdrawHistory(requestParameters) {
283
+ return this.fiatApi.getFiatDepositWithdrawHistory(requestParameters);
284
+ }
285
+ /**
286
+ * Get Fiat Deposit/Withdraw History
287
+ *
288
+ * If beginTime and endTime are not sent, the recent 30-day data will be returned.
289
+ * paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:
290
+ * Cash Balance
291
+ * Credit Card
292
+ * Online Banking
293
+ * Bank Transfer
294
+ *
295
+ * Weight: 1
296
+ *
297
+ * @summary Get Fiat Payments History (USER_DATA)
298
+ * @param {GetFiatPaymentsHistoryRequest} requestParameters Request parameters.
299
+ * @returns {Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>}
300
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
301
+ * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History Binance API Documentation}
302
+ */
303
+ getFiatPaymentsHistory(requestParameters) {
304
+ return this.fiatApi.getFiatPaymentsHistory(requestParameters);
305
+ }
306
+ };
307
+
308
+ // src/fiat.ts
309
+ var Fiat = class {
310
+ constructor(config) {
311
+ if (config?.configurationRestAPI) {
312
+ const configRestAPI = new import_common3.ConfigurationRestAPI(config.configurationRestAPI);
313
+ configRestAPI.basePath = configRestAPI.basePath || import_common3.FIAT_REST_API_PROD_URL;
314
+ configRestAPI.baseOptions = configRestAPI.baseOptions || {};
315
+ configRestAPI.baseOptions.headers = {
316
+ ...configRestAPI.baseOptions.headers || {},
317
+ "User-Agent": `${name}/${version} (Node.js/${process.version}; ${(0, import_os.platform)()}; ${(0, import_os.arch)()})`
318
+ };
319
+ this.restAPI = new RestAPI(configRestAPI);
320
+ }
321
+ }
322
+ };
323
+
324
+ // src/index.ts
325
+ var import_common4 = require("@binance/common");
326
+ // Annotate the CommonJS export names for ESM import in node:
327
+ 0 && (module.exports = {
328
+ BadRequestError,
329
+ ConnectorClientError,
330
+ FIAT_REST_API_PROD_URL,
331
+ FIAT_REST_API_TESTNET_URL,
332
+ Fiat,
333
+ FiatRestAPI,
334
+ ForbiddenError,
335
+ NetworkError,
336
+ NotFoundError,
337
+ RateLimitBanError,
338
+ RequiredError,
339
+ ServerError,
340
+ TooManyRequestsError,
341
+ UnauthorizedError
342
+ });
343
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/fiat.ts","../package.json","../src/rest-api/index.ts","../src/rest-api/modules/fiat-api.ts","../src/rest-api/rest-api.ts"],"sourcesContent":["export { Fiat, ConfigurationFiat } from './fiat';\nexport * as FiatRestAPI from './rest-api';\n\nexport {\n FIAT_REST_API_PROD_URL,\n FIAT_REST_API_TESTNET_URL,\n ConnectorClientError,\n RequiredError,\n UnauthorizedError,\n ForbiddenError,\n TooManyRequestsError,\n RateLimitBanError,\n ServerError,\n NetworkError,\n NotFoundError,\n BadRequestError,\n} from '@binance/common';\n","import { platform, arch } from 'os';\nimport { ConfigurationRestAPI, FIAT_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationFiat {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Fiat {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationFiat) {\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(config.configurationRestAPI);\n configRestAPI.basePath = configRestAPI.basePath || FIAT_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': `${name}/${version} (Node.js/${process.version}; ${platform()}; ${arch()})`,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n","{\n \"name\": \"@binance/fiat\",\n \"description\": \"Official Binance Fiat Connector - A lightweight library that provides a convenient interface to Binance's Fiat REST API.\",\n \"version\": \"1.0.0\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"tsup\",\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 \"Fiat\",\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 \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsup\": \"^7.2.0\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"1.0.0\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Public Fiat REST API\n *\n * OpenAPI Specification for the Binance Public Fiat 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","/**\n * Binance Public Fiat REST API\n *\n * OpenAPI Specification for the Binance Public Fiat 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 assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n GetFiatDepositWithdrawHistoryResponse,\n GetFiatPaymentsHistoryResponse,\n} from '../types';\n\n/**\n * FiatApi - axios parameter creator\n */\nconst FiatApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get Fiat Deposit/Withdraw History\n *\n * If beginTime and endTime are not sent, the recent 30-day data will be returned.\n *\n * Weight: 90000\n *\n * @summary Get Fiat Deposit/Withdraw History (USER_DATA)\n * @param {string} transactionType 0-buy,1-sell\n * @param {number} [beginTime]\n * @param {number} [endTime]\n * @param {number} [page] default 1\n * @param {number} [rows] default 100, max 500\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFiatDepositWithdrawHistory: async (\n transactionType: string,\n beginTime?: number,\n endTime?: number,\n page?: number,\n rows?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'transactionType' is not null or undefined\n assertParamExists('getFiatDepositWithdrawHistory', 'transactionType', transactionType);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (transactionType !== undefined && transactionType !== null) {\n localVarQueryParameter['transactionType'] = transactionType;\n }\n\n if (beginTime !== undefined && beginTime !== null) {\n localVarQueryParameter['beginTime'] = beginTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\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/fiat/orders',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Fiat Deposit/Withdraw History\n *\n * If beginTime and endTime are not sent, the recent 30-day data will be returned.\n * paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:\n * Cash Balance\n * Credit Card\n * Online Banking\n * Bank Transfer\n *\n * Weight: 1\n *\n * @summary Get Fiat Payments History (USER_DATA)\n * @param {string} transactionType 0-buy,1-sell\n * @param {number} [beginTime]\n * @param {number} [endTime]\n * @param {number} [page] default 1\n * @param {number} [rows] default 100, max 500\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFiatPaymentsHistory: async (\n transactionType: string,\n beginTime?: number,\n endTime?: number,\n page?: number,\n rows?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'transactionType' is not null or undefined\n assertParamExists('getFiatPaymentsHistory', 'transactionType', transactionType);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (transactionType !== undefined && transactionType !== null) {\n localVarQueryParameter['transactionType'] = transactionType;\n }\n\n if (beginTime !== undefined && beginTime !== null) {\n localVarQueryParameter['beginTime'] = beginTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\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/fiat/payments',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * FiatApi - interface\n * @interface FiatApi\n */\nexport interface FiatApiInterface {\n /**\n * Get Fiat Deposit/Withdraw History\n *\n * If beginTime and endTime are not sent, the recent 30-day data will be returned.\n *\n * Weight: 90000\n *\n * @summary Get Fiat Deposit/Withdraw History (USER_DATA)\n * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n getFiatDepositWithdrawHistory(\n requestParameters: GetFiatDepositWithdrawHistoryRequest\n ): Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>;\n /**\n * Get Fiat Deposit/Withdraw History\n *\n * If beginTime and endTime are not sent, the recent 30-day data will be returned.\n * paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:\n * Cash Balance\n * Credit Card\n * Online Banking\n * Bank Transfer\n *\n * Weight: 1\n *\n * @summary Get Fiat Payments History (USER_DATA)\n * @param {GetFiatPaymentsHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n getFiatPaymentsHistory(\n requestParameters: GetFiatPaymentsHistoryRequest\n ): Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>;\n}\n\n/**\n * Request parameters for getFiatDepositWithdrawHistory operation in FiatApi.\n * @interface GetFiatDepositWithdrawHistoryRequest\n */\nexport interface GetFiatDepositWithdrawHistoryRequest {\n /**\n * 0-buy,1-sell\n * @type {string}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly transactionType: string;\n\n /**\n *\n * @type {number}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly beginTime?: number;\n\n /**\n *\n * @type {number}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly endTime?: number;\n\n /**\n * default 1\n * @type {number}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly page?: number;\n\n /**\n * default 100, max 500\n * @type {number}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly rows?: number;\n\n /**\n *\n * @type {number}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getFiatPaymentsHistory operation in FiatApi.\n * @interface GetFiatPaymentsHistoryRequest\n */\nexport interface GetFiatPaymentsHistoryRequest {\n /**\n * 0-buy,1-sell\n * @type {string}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly transactionType: string;\n\n /**\n *\n * @type {number}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly beginTime?: number;\n\n /**\n *\n * @type {number}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly endTime?: number;\n\n /**\n * default 1\n * @type {number}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly page?: number;\n\n /**\n * default 100, max 500\n * @type {number}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly rows?: number;\n\n /**\n *\n * @type {number}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly recvWindow?: number;\n}\n\n/**\n * FiatApi - object-oriented interface\n * @class FiatApi\n */\nexport class FiatApi implements FiatApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = FiatApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get Fiat Deposit/Withdraw History\n *\n * If beginTime and endTime are not sent, the recent 30-day data will be returned.\n *\n * Weight: 90000\n *\n * @summary Get Fiat Deposit/Withdraw History (USER_DATA)\n * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApi\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History Binance API Documentation}\n */\n public async getFiatDepositWithdrawHistory(\n requestParameters: GetFiatDepositWithdrawHistoryRequest\n ): Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.getFiatDepositWithdrawHistory(\n requestParameters?.transactionType,\n requestParameters?.beginTime,\n requestParameters?.endTime,\n requestParameters?.page,\n requestParameters?.rows,\n requestParameters?.recvWindow\n );\n return sendRequest<GetFiatDepositWithdrawHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Fiat Deposit/Withdraw History\n *\n * If beginTime and endTime are not sent, the recent 30-day data will be returned.\n * paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:\n * Cash Balance\n * Credit Card\n * Online Banking\n * Bank Transfer\n *\n * Weight: 1\n *\n * @summary Get Fiat Payments History (USER_DATA)\n * @param {GetFiatPaymentsHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApi\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History Binance API Documentation}\n */\n public async getFiatPaymentsHistory(\n requestParameters: GetFiatPaymentsHistoryRequest\n ): Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFiatPaymentsHistory(\n requestParameters?.transactionType,\n requestParameters?.beginTime,\n requestParameters?.endTime,\n requestParameters?.page,\n requestParameters?.rows,\n requestParameters?.recvWindow\n );\n return sendRequest<GetFiatPaymentsHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Public Fiat REST API\n *\n * OpenAPI Specification for the Binance Public Fiat 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 { FiatApi } from './modules/fiat-api';\n\nimport type {\n GetFiatDepositWithdrawHistoryRequest,\n GetFiatPaymentsHistoryRequest,\n} from './modules/fiat-api';\n\nimport type {\n GetFiatDepositWithdrawHistoryResponse,\n GetFiatPaymentsHistoryResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private fiatApi: FiatApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.fiatApi = new FiatApi(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 params - Query 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 params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined);\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 params - Query 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 params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined, {\n isSigned: true,\n });\n }\n\n /**\n * Get Fiat Deposit/Withdraw History\n *\n * If beginTime and endTime are not sent, the recent 30-day data will be returned.\n *\n * Weight: 90000\n *\n * @summary Get Fiat Deposit/Withdraw History (USER_DATA)\n * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History Binance API Documentation}\n */\n getFiatDepositWithdrawHistory(\n requestParameters: GetFiatDepositWithdrawHistoryRequest\n ): Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>> {\n return this.fiatApi.getFiatDepositWithdrawHistory(requestParameters);\n }\n\n /**\n * Get Fiat Deposit/Withdraw History\n *\n * If beginTime and endTime are not sent, the recent 30-day data will be returned.\n * paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:\n * Cash Balance\n * Credit Card\n * Online Banking\n * Bank Transfer\n *\n * Weight: 1\n *\n * @summary Get Fiat Payments History (USER_DATA)\n * @param {GetFiatPaymentsHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History Binance API Documentation}\n */\n getFiatPaymentsHistory(\n requestParameters: GetFiatPaymentsHistoryRequest\n ): Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>> {\n return this.fiatApi.getFiatPaymentsHistory(requestParameters);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,gBAA+B;AAC/B,IAAAA,iBAA6D;;;ACAzD,WAAQ;AAER,cAAW;;;ACHf;AAAA;AAAA;AAAA;AAAA;;;ACaA,oBAOO;AASP,IAAM,2BAA2B,SAAU,eAAqC;AAC5E,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAkBH,+BAA+B,OAC3B,iBACA,WACA,SACA,MACA,MACA,eACuB;AAEvB,2CAAkB,iCAAiC,mBAAmB,eAAe;AAErF,YAAM,yBAAkD,CAAC;AAEzD,UAAI,oBAAoB,UAAa,oBAAoB,MAAM;AAC3D,+BAAuB,iBAAiB,IAAI;AAAA,MAChD;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