@binance/fiat 6.0.15 → 6.0.16
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 +18 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ let __binance_common = require("@binance/common");
|
|
|
14
14
|
|
|
15
15
|
//#region package.json
|
|
16
16
|
var name = "@binance/fiat";
|
|
17
|
-
var version = "6.0.
|
|
17
|
+
var version = "6.0.16";
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/rest-api/modules/fiat-api.ts
|
|
@@ -41,6 +41,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
41
41
|
(0, __binance_common.assertParamExists)("deposit", "amount", amount);
|
|
42
42
|
const localVarQueryParameter = {};
|
|
43
43
|
const localVarBodyParameter = {};
|
|
44
|
+
const localVarHeaderParameter = {};
|
|
44
45
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
45
46
|
if (currency !== void 0 && currency !== null) localVarBodyParameter["currency"] = currency;
|
|
46
47
|
if (apiPaymentMethod !== void 0 && apiPaymentMethod !== null) localVarBodyParameter["apiPaymentMethod"] = apiPaymentMethod;
|
|
@@ -53,6 +54,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
53
54
|
method: "POST",
|
|
54
55
|
queryParams: localVarQueryParameter,
|
|
55
56
|
bodyParams: localVarBodyParameter,
|
|
57
|
+
headerParams: localVarHeaderParameter,
|
|
56
58
|
timeUnit: _timeUnit
|
|
57
59
|
};
|
|
58
60
|
},
|
|
@@ -63,6 +65,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
63
65
|
(0, __binance_common.assertParamExists)("fiatWithdraw", "accountInfo", accountInfo);
|
|
64
66
|
const localVarQueryParameter = {};
|
|
65
67
|
const localVarBodyParameter = {};
|
|
68
|
+
const localVarHeaderParameter = {};
|
|
66
69
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
67
70
|
if (currency !== void 0 && currency !== null) localVarBodyParameter["currency"] = currency;
|
|
68
71
|
if (apiPaymentMethod !== void 0 && apiPaymentMethod !== null) localVarBodyParameter["apiPaymentMethod"] = apiPaymentMethod;
|
|
@@ -76,6 +79,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
76
79
|
method: "POST",
|
|
77
80
|
queryParams: localVarQueryParameter,
|
|
78
81
|
bodyParams: localVarBodyParameter,
|
|
82
|
+
headerParams: localVarHeaderParameter,
|
|
79
83
|
timeUnit: _timeUnit
|
|
80
84
|
};
|
|
81
85
|
},
|
|
@@ -83,6 +87,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
83
87
|
(0, __binance_common.assertParamExists)("getFiatDepositWithdrawHistory", "transactionType", transactionType);
|
|
84
88
|
const localVarQueryParameter = {};
|
|
85
89
|
const localVarBodyParameter = {};
|
|
90
|
+
const localVarHeaderParameter = {};
|
|
86
91
|
if (transactionType !== void 0 && transactionType !== null) localVarQueryParameter["transactionType"] = transactionType;
|
|
87
92
|
if (beginTime !== void 0 && beginTime !== null) localVarQueryParameter["beginTime"] = beginTime;
|
|
88
93
|
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
|
|
@@ -96,6 +101,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
96
101
|
method: "GET",
|
|
97
102
|
queryParams: localVarQueryParameter,
|
|
98
103
|
bodyParams: localVarBodyParameter,
|
|
104
|
+
headerParams: localVarHeaderParameter,
|
|
99
105
|
timeUnit: _timeUnit
|
|
100
106
|
};
|
|
101
107
|
},
|
|
@@ -103,6 +109,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
103
109
|
(0, __binance_common.assertParamExists)("getFiatPaymentsHistory", "transactionType", transactionType);
|
|
104
110
|
const localVarQueryParameter = {};
|
|
105
111
|
const localVarBodyParameter = {};
|
|
112
|
+
const localVarHeaderParameter = {};
|
|
106
113
|
if (transactionType !== void 0 && transactionType !== null) localVarQueryParameter["transactionType"] = transactionType;
|
|
107
114
|
if (beginTime !== void 0 && beginTime !== null) localVarQueryParameter["beginTime"] = beginTime;
|
|
108
115
|
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
|
|
@@ -116,6 +123,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
116
123
|
method: "GET",
|
|
117
124
|
queryParams: localVarQueryParameter,
|
|
118
125
|
bodyParams: localVarBodyParameter,
|
|
126
|
+
headerParams: localVarHeaderParameter,
|
|
119
127
|
timeUnit: _timeUnit
|
|
120
128
|
};
|
|
121
129
|
},
|
|
@@ -123,6 +131,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
123
131
|
(0, __binance_common.assertParamExists)("getOrderDetail", "orderNo", orderNo);
|
|
124
132
|
const localVarQueryParameter = {};
|
|
125
133
|
const localVarBodyParameter = {};
|
|
134
|
+
const localVarHeaderParameter = {};
|
|
126
135
|
if (orderNo !== void 0 && orderNo !== null) localVarQueryParameter["orderNo"] = orderNo;
|
|
127
136
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
128
137
|
let _timeUnit;
|
|
@@ -132,6 +141,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
132
141
|
method: "GET",
|
|
133
142
|
queryParams: localVarQueryParameter,
|
|
134
143
|
bodyParams: localVarBodyParameter,
|
|
144
|
+
headerParams: localVarHeaderParameter,
|
|
135
145
|
timeUnit: _timeUnit
|
|
136
146
|
};
|
|
137
147
|
}
|
|
@@ -166,7 +176,7 @@ var FiatApi = class {
|
|
|
166
176
|
*/
|
|
167
177
|
async deposit(requestParameters) {
|
|
168
178
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.deposit(requestParameters?.currency, requestParameters?.apiPaymentMethod, requestParameters?.amount, requestParameters?.recvWindow, requestParameters?.ext);
|
|
169
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
179
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
170
180
|
}
|
|
171
181
|
/**
|
|
172
182
|
* Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.
|
|
@@ -188,7 +198,7 @@ var FiatApi = class {
|
|
|
188
198
|
*/
|
|
189
199
|
async fiatWithdraw(requestParameters) {
|
|
190
200
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.fiatWithdraw(requestParameters?.currency, requestParameters?.apiPaymentMethod, requestParameters?.amount, requestParameters?.accountInfo, requestParameters?.recvWindow, requestParameters?.ext);
|
|
191
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
201
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
192
202
|
}
|
|
193
203
|
/**
|
|
194
204
|
* Get Fiat Deposit/Withdraw History
|
|
@@ -206,7 +216,7 @@ var FiatApi = class {
|
|
|
206
216
|
*/
|
|
207
217
|
async getFiatDepositWithdrawHistory(requestParameters) {
|
|
208
218
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFiatDepositWithdrawHistory(requestParameters?.transactionType, requestParameters?.beginTime, requestParameters?.endTime, requestParameters?.page, requestParameters?.rows, requestParameters?.recvWindow);
|
|
209
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
219
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
210
220
|
}
|
|
211
221
|
/**
|
|
212
222
|
* Get Fiat Deposit/Withdraw History
|
|
@@ -229,7 +239,7 @@ var FiatApi = class {
|
|
|
229
239
|
*/
|
|
230
240
|
async getFiatPaymentsHistory(requestParameters) {
|
|
231
241
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFiatPaymentsHistory(requestParameters?.transactionType, requestParameters?.beginTime, requestParameters?.endTime, requestParameters?.page, requestParameters?.rows, requestParameters?.recvWindow);
|
|
232
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
242
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
233
243
|
}
|
|
234
244
|
/**
|
|
235
245
|
* Get Order Detail
|
|
@@ -247,7 +257,7 @@ var FiatApi = class {
|
|
|
247
257
|
*/
|
|
248
258
|
async getOrderDetail(requestParameters) {
|
|
249
259
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOrderDetail(requestParameters?.orderNo, requestParameters?.recvWindow);
|
|
250
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
260
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
251
261
|
}
|
|
252
262
|
};
|
|
253
263
|
|
|
@@ -280,7 +290,7 @@ var RestAPI = class {
|
|
|
280
290
|
* @returns A promise resolving to the response data object.
|
|
281
291
|
*/
|
|
282
292
|
sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
|
|
283
|
-
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
|
|
293
|
+
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0, void 0);
|
|
284
294
|
}
|
|
285
295
|
/**
|
|
286
296
|
* Generic function to send a signed request.
|
|
@@ -292,7 +302,7 @@ var RestAPI = class {
|
|
|
292
302
|
* @returns A promise resolving to the response data object.
|
|
293
303
|
*/
|
|
294
304
|
sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
|
|
295
|
-
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
|
|
305
|
+
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0, void 0, { isSigned: true });
|
|
296
306
|
}
|
|
297
307
|
/**
|
|
298
308
|
* Submit deposit request, in this version, we only support BRL deposit via pix.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","FIAT_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/fiat-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/fiat.ts"],"sourcesContent":["{\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\": \"6.0.15\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"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 \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.3.14\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Fiat REST API\n *\n * OpenAPI Specification for the Binance 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 AccountInfo,\n DepositResponse,\n FiatWithdrawResponse,\n GetFiatDepositWithdrawHistoryResponse,\n GetFiatPaymentsHistoryResponse,\n GetOrderDetailResponse,\n} from '../types';\n\n/**\n * FiatApi - axios parameter creator\n */\nconst FiatApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {string} currency\n * @param {string} apiPaymentMethod\n * @param {number | bigint} amount\n * @param {number | bigint} [recvWindow]\n * @param {object} [ext]\n *\n * @throws {RequiredError}\n */\n deposit: async (\n currency: string,\n apiPaymentMethod: string,\n amount: number | bigint,\n recvWindow?: number | bigint,\n ext?: object\n ): Promise<RequestArgs> => {\n // verify required parameter 'currency' is not null or undefined\n assertParamExists('deposit', 'currency', currency);\n // verify required parameter 'apiPaymentMethod' is not null or undefined\n assertParamExists('deposit', 'apiPaymentMethod', apiPaymentMethod);\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('deposit', 'amount', amount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n if (currency !== undefined && currency !== null) {\n localVarBodyParameter['currency'] = currency;\n }\n\n if (apiPaymentMethod !== undefined && apiPaymentMethod !== null) {\n localVarBodyParameter['apiPaymentMethod'] = apiPaymentMethod;\n }\n\n if (amount !== undefined && amount !== null) {\n localVarBodyParameter['amount'] = amount;\n }\n\n if (ext !== undefined && ext !== null) {\n localVarBodyParameter['ext'] = ext;\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/deposit',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {string} currency\n * @param {string} apiPaymentMethod\n * @param {number | bigint} amount\n * @param {AccountInfo} accountInfo\n * @param {number | bigint} [recvWindow]\n * @param {object} [ext]\n *\n * @throws {RequiredError}\n */\n fiatWithdraw: async (\n currency: string,\n apiPaymentMethod: string,\n amount: number | bigint,\n accountInfo: AccountInfo,\n recvWindow?: number | bigint,\n ext?: object\n ): Promise<RequestArgs> => {\n // verify required parameter 'currency' is not null or undefined\n assertParamExists('fiatWithdraw', 'currency', currency);\n // verify required parameter 'apiPaymentMethod' is not null or undefined\n assertParamExists('fiatWithdraw', 'apiPaymentMethod', apiPaymentMethod);\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('fiatWithdraw', 'amount', amount);\n // verify required parameter 'accountInfo' is not null or undefined\n assertParamExists('fiatWithdraw', 'accountInfo', accountInfo);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n if (currency !== undefined && currency !== null) {\n localVarBodyParameter['currency'] = currency;\n }\n\n if (apiPaymentMethod !== undefined && apiPaymentMethod !== null) {\n localVarBodyParameter['apiPaymentMethod'] = apiPaymentMethod;\n }\n\n if (amount !== undefined && amount !== null) {\n localVarBodyParameter['amount'] = amount;\n }\n\n if (accountInfo !== undefined && accountInfo !== null) {\n localVarBodyParameter['accountInfo'] = accountInfo;\n }\n\n if (ext !== undefined && ext !== null) {\n localVarBodyParameter['ext'] = ext;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v2/fiat/withdraw',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\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 *\n * Weight: 45000\n *\n * @summary Get Fiat Deposit/Withdraw History (USER_DATA)\n * @param {string} transactionType 0-buy,1-sell\n * @param {number | bigint} [beginTime]\n * @param {number | bigint} [endTime]\n * @param {number | bigint} [page] default 1\n * @param {number | bigint} [rows] default 100, max 500\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFiatDepositWithdrawHistory: async (\n transactionType: string,\n beginTime?: number | bigint,\n endTime?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\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 const localVarBodyParameter: Record<string, unknown> = {};\n\n if (transactionType !== undefined && transactionType !== null) {\n localVarQueryParameter['transactionType'] = transactionType;\n }\n if (beginTime !== undefined && beginTime !== null) {\n localVarQueryParameter['beginTime'] = beginTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/fiat/orders',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\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 | bigint} [beginTime]\n * @param {number | bigint} [endTime]\n * @param {number | bigint} [page] default 1\n * @param {number | bigint} [rows] default 100, max 500\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFiatPaymentsHistory: async (\n transactionType: string,\n beginTime?: number | bigint,\n endTime?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\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 const localVarBodyParameter: Record<string, unknown> = {};\n\n if (transactionType !== undefined && transactionType !== null) {\n localVarQueryParameter['transactionType'] = transactionType;\n }\n if (beginTime !== undefined && beginTime !== null) {\n localVarQueryParameter['beginTime'] = beginTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/fiat/payments',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {string} orderNo order id retrieved from the api call of withdrawal\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getOrderDetail: async (\n orderNo: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'orderNo' is not null or undefined\n assertParamExists('getOrderDetail', 'orderNo', orderNo);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (orderNo !== undefined && orderNo !== null) {\n localVarQueryParameter['orderNo'] = orderNo;\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/get-order-detail',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * FiatApi - interface\n * @interface FiatApi\n */\nexport interface FiatApiInterface {\n /**\n * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {DepositRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n deposit(requestParameters: DepositRequest): Promise<RestApiResponse<DepositResponse>>;\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {FiatWithdrawRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n fiatWithdraw(\n requestParameters: FiatWithdrawRequest\n ): Promise<RestApiResponse<FiatWithdrawResponse>>;\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: 45000\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 * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {GetOrderDetailRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n getOrderDetail(\n requestParameters: GetOrderDetailRequest\n ): Promise<RestApiResponse<GetOrderDetailResponse>>;\n}\n\n/**\n * Request parameters for deposit operation in FiatApi.\n * @interface DepositRequest\n */\nexport interface DepositRequest {\n /**\n *\n * @type {string}\n * @memberof FiatApiDeposit\n */\n readonly currency: string;\n\n /**\n *\n * @type {string}\n * @memberof FiatApiDeposit\n */\n readonly apiPaymentMethod: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiDeposit\n */\n readonly amount: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiDeposit\n */\n readonly recvWindow?: number | bigint;\n\n /**\n *\n * @type {object}\n * @memberof FiatApiDeposit\n */\n readonly ext?: object;\n}\n\n/**\n * Request parameters for fiatWithdraw operation in FiatApi.\n * @interface FiatWithdrawRequest\n */\nexport interface FiatWithdrawRequest {\n /**\n *\n * @type {string}\n * @memberof FiatApiFiatWithdraw\n */\n readonly currency: string;\n\n /**\n *\n * @type {string}\n * @memberof FiatApiFiatWithdraw\n */\n readonly apiPaymentMethod: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiFiatWithdraw\n */\n readonly amount: number | bigint;\n\n /**\n *\n * @type {AccountInfo}\n * @memberof FiatApiFiatWithdraw\n */\n readonly accountInfo: AccountInfo;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiFiatWithdraw\n */\n readonly recvWindow?: number | bigint;\n\n /**\n *\n * @type {object}\n * @memberof FiatApiFiatWithdraw\n */\n readonly ext?: object;\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 | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly beginTime?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly endTime?: number | bigint;\n\n /**\n * default 1\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 500\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly recvWindow?: number | bigint;\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 | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly beginTime?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly endTime?: number | bigint;\n\n /**\n * default 1\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 500\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for getOrderDetail operation in FiatApi.\n * @interface GetOrderDetailRequest\n */\nexport interface GetOrderDetailRequest {\n /**\n * order id retrieved from the api call of withdrawal\n * @type {string}\n * @memberof FiatApiGetOrderDetail\n */\n readonly orderNo: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetOrderDetail\n */\n readonly recvWindow?: number | bigint;\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 * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {DepositRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<DepositResponse>>}\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/Fiat-Deposit Binance API Documentation}\n */\n public async deposit(\n requestParameters: DepositRequest\n ): Promise<RestApiResponse<DepositResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.deposit(\n requestParameters?.currency,\n requestParameters?.apiPaymentMethod,\n requestParameters?.amount,\n requestParameters?.recvWindow,\n requestParameters?.ext\n );\n return sendRequest<DepositResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {FiatWithdrawRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<FiatWithdrawResponse>>}\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/Fiat-Withdraw Binance API Documentation}\n */\n public async fiatWithdraw(\n requestParameters: FiatWithdrawRequest\n ): Promise<RestApiResponse<FiatWithdrawResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.fiatWithdraw(\n requestParameters?.currency,\n requestParameters?.apiPaymentMethod,\n requestParameters?.amount,\n requestParameters?.accountInfo,\n requestParameters?.recvWindow,\n requestParameters?.ext\n );\n return sendRequest<FiatWithdrawResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\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 *\n * Weight: 45000\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.queryParams,\n localVarAxiosArgs.bodyParams,\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.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {GetOrderDetailRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetOrderDetailResponse>>}\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-Order-Detail Binance API Documentation}\n */\n public async getOrderDetail(\n requestParameters: GetOrderDetailRequest\n ): Promise<RestApiResponse<GetOrderDetailResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOrderDetail(\n requestParameters?.orderNo,\n requestParameters?.recvWindow\n );\n return sendRequest<GetOrderDetailResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Fiat REST API\n *\n * OpenAPI Specification for the Binance 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 DepositRequest,\n FiatWithdrawRequest,\n GetFiatDepositWithdrawHistoryRequest,\n GetFiatPaymentsHistoryRequest,\n GetOrderDetailRequest,\n} from './modules/fiat-api';\n\nimport type {\n DepositResponse,\n FiatWithdrawResponse,\n GetFiatDepositWithdrawHistoryResponse,\n GetFiatPaymentsHistoryResponse,\n GetOrderDetailResponse,\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 queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {DepositRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<DepositResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Fiat-Deposit Binance API Documentation}\n */\n deposit(requestParameters: DepositRequest): Promise<RestApiResponse<DepositResponse>> {\n return this.fiatApi.deposit(requestParameters);\n }\n\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {FiatWithdrawRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<FiatWithdrawResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Fiat-Withdraw Binance API Documentation}\n */\n fiatWithdraw(\n requestParameters: FiatWithdrawRequest\n ): Promise<RestApiResponse<FiatWithdrawResponse>> {\n return this.fiatApi.fiatWithdraw(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 *\n * Weight: 45000\n *\n * @summary Get Fiat Deposit/Withdraw History (USER_DATA)\n * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.\n *\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 *\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 /**\n * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {GetOrderDetailRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetOrderDetailResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Order-Detail Binance API Documentation}\n */\n getOrderDetail(\n requestParameters: GetOrderDetailRequest\n ): Promise<RestApiResponse<GetOrderDetailResponse>> {\n return this.fiatApi.getOrderDetail(requestParameters);\n }\n}\n","/**\n * Binance Fiat REST API\n *\n * OpenAPI Specification for the Binance 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","import { buildUserAgent, 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 const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || FIAT_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;AC8Bf,MAAM,2BAA2B,SAAU,eAAqC;AAC5E,QAAO;EAqBH,SAAS,OACL,UACA,kBACA,QAC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,KAAK,QAAQ,aAAa,kBAAkB;;;;;;;;;;;;;;;;CAiBvD,8BACI,mBAC+D;AAC/D,SAAO,KAAK,QAAQ,8BAA8B,kBAAkB;;;;;;;;;;;;;;;;;;;;;CAsBxE,uBACI,mBACwD;AACxD,SAAO,KAAK,QAAQ,uBAAuB,kBAAkB;;;;;;;;;;;;;;;;CAiBjE,eACI,mBACgD;AAChD,SAAO,KAAK,QAAQ,eAAe,kBAAkB;;;;;;;;;;;;;AEhM7D,IAAa,OAAb,MAAkB;CAGd,YAAY,QAA2B;EACnC,MAAM,iDAA2B,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAIC,sCACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","FIAT_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/fiat-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/fiat.ts"],"sourcesContent":["{\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\": \"6.0.16\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"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 \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.0\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Fiat REST API\n *\n * OpenAPI Specification for the Binance 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 AccountInfo,\n DepositResponse,\n FiatWithdrawResponse,\n GetFiatDepositWithdrawHistoryResponse,\n GetFiatPaymentsHistoryResponse,\n GetOrderDetailResponse,\n} from '../types';\n\n/**\n * FiatApi - axios parameter creator\n */\nconst FiatApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {string} currency\n * @param {string} apiPaymentMethod\n * @param {number | bigint} amount\n * @param {number | bigint} [recvWindow]\n * @param {object} [ext]\n *\n * @throws {RequiredError}\n */\n deposit: async (\n currency: string,\n apiPaymentMethod: string,\n amount: number | bigint,\n recvWindow?: number | bigint,\n ext?: object\n ): Promise<RequestArgs> => {\n // verify required parameter 'currency' is not null or undefined\n assertParamExists('deposit', 'currency', currency);\n // verify required parameter 'apiPaymentMethod' is not null or undefined\n assertParamExists('deposit', 'apiPaymentMethod', apiPaymentMethod);\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('deposit', 'amount', amount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n if (currency !== undefined && currency !== null) {\n localVarBodyParameter['currency'] = currency;\n }\n\n if (apiPaymentMethod !== undefined && apiPaymentMethod !== null) {\n localVarBodyParameter['apiPaymentMethod'] = apiPaymentMethod;\n }\n\n if (amount !== undefined && amount !== null) {\n localVarBodyParameter['amount'] = amount;\n }\n\n if (ext !== undefined && ext !== null) {\n localVarBodyParameter['ext'] = ext;\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/deposit',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {string} currency\n * @param {string} apiPaymentMethod\n * @param {number | bigint} amount\n * @param {AccountInfo} accountInfo\n * @param {number | bigint} [recvWindow]\n * @param {object} [ext]\n *\n * @throws {RequiredError}\n */\n fiatWithdraw: async (\n currency: string,\n apiPaymentMethod: string,\n amount: number | bigint,\n accountInfo: AccountInfo,\n recvWindow?: number | bigint,\n ext?: object\n ): Promise<RequestArgs> => {\n // verify required parameter 'currency' is not null or undefined\n assertParamExists('fiatWithdraw', 'currency', currency);\n // verify required parameter 'apiPaymentMethod' is not null or undefined\n assertParamExists('fiatWithdraw', 'apiPaymentMethod', apiPaymentMethod);\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('fiatWithdraw', 'amount', amount);\n // verify required parameter 'accountInfo' is not null or undefined\n assertParamExists('fiatWithdraw', 'accountInfo', accountInfo);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n if (currency !== undefined && currency !== null) {\n localVarBodyParameter['currency'] = currency;\n }\n\n if (apiPaymentMethod !== undefined && apiPaymentMethod !== null) {\n localVarBodyParameter['apiPaymentMethod'] = apiPaymentMethod;\n }\n\n if (amount !== undefined && amount !== null) {\n localVarBodyParameter['amount'] = amount;\n }\n\n if (accountInfo !== undefined && accountInfo !== null) {\n localVarBodyParameter['accountInfo'] = accountInfo;\n }\n\n if (ext !== undefined && ext !== null) {\n localVarBodyParameter['ext'] = ext;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v2/fiat/withdraw',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\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 *\n * Weight: 45000\n *\n * @summary Get Fiat Deposit/Withdraw History (USER_DATA)\n * @param {string} transactionType 0-buy,1-sell\n * @param {number | bigint} [beginTime]\n * @param {number | bigint} [endTime]\n * @param {number | bigint} [page] default 1\n * @param {number | bigint} [rows] default 100, max 500\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFiatDepositWithdrawHistory: async (\n transactionType: string,\n beginTime?: number | bigint,\n endTime?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\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 const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (transactionType !== undefined && transactionType !== null) {\n localVarQueryParameter['transactionType'] = transactionType;\n }\n if (beginTime !== undefined && beginTime !== null) {\n localVarQueryParameter['beginTime'] = beginTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/fiat/orders',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\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 | bigint} [beginTime]\n * @param {number | bigint} [endTime]\n * @param {number | bigint} [page] default 1\n * @param {number | bigint} [rows] default 100, max 500\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFiatPaymentsHistory: async (\n transactionType: string,\n beginTime?: number | bigint,\n endTime?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\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 const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (transactionType !== undefined && transactionType !== null) {\n localVarQueryParameter['transactionType'] = transactionType;\n }\n if (beginTime !== undefined && beginTime !== null) {\n localVarQueryParameter['beginTime'] = beginTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/fiat/payments',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {string} orderNo order id retrieved from the api call of withdrawal\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getOrderDetail: async (\n orderNo: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'orderNo' is not null or undefined\n assertParamExists('getOrderDetail', 'orderNo', orderNo);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (orderNo !== undefined && orderNo !== null) {\n localVarQueryParameter['orderNo'] = orderNo;\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/get-order-detail',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * FiatApi - interface\n * @interface FiatApi\n */\nexport interface FiatApiInterface {\n /**\n * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {DepositRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n deposit(requestParameters: DepositRequest): Promise<RestApiResponse<DepositResponse>>;\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {FiatWithdrawRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n fiatWithdraw(\n requestParameters: FiatWithdrawRequest\n ): Promise<RestApiResponse<FiatWithdrawResponse>>;\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: 45000\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 * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {GetOrderDetailRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n getOrderDetail(\n requestParameters: GetOrderDetailRequest\n ): Promise<RestApiResponse<GetOrderDetailResponse>>;\n}\n\n/**\n * Request parameters for deposit operation in FiatApi.\n * @interface DepositRequest\n */\nexport interface DepositRequest {\n /**\n *\n * @type {string}\n * @memberof FiatApiDeposit\n */\n readonly currency: string;\n\n /**\n *\n * @type {string}\n * @memberof FiatApiDeposit\n */\n readonly apiPaymentMethod: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiDeposit\n */\n readonly amount: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiDeposit\n */\n readonly recvWindow?: number | bigint;\n\n /**\n *\n * @type {object}\n * @memberof FiatApiDeposit\n */\n readonly ext?: object;\n}\n\n/**\n * Request parameters for fiatWithdraw operation in FiatApi.\n * @interface FiatWithdrawRequest\n */\nexport interface FiatWithdrawRequest {\n /**\n *\n * @type {string}\n * @memberof FiatApiFiatWithdraw\n */\n readonly currency: string;\n\n /**\n *\n * @type {string}\n * @memberof FiatApiFiatWithdraw\n */\n readonly apiPaymentMethod: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiFiatWithdraw\n */\n readonly amount: number | bigint;\n\n /**\n *\n * @type {AccountInfo}\n * @memberof FiatApiFiatWithdraw\n */\n readonly accountInfo: AccountInfo;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiFiatWithdraw\n */\n readonly recvWindow?: number | bigint;\n\n /**\n *\n * @type {object}\n * @memberof FiatApiFiatWithdraw\n */\n readonly ext?: object;\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 | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly beginTime?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly endTime?: number | bigint;\n\n /**\n * default 1\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 500\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly recvWindow?: number | bigint;\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 | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly beginTime?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly endTime?: number | bigint;\n\n /**\n * default 1\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 500\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for getOrderDetail operation in FiatApi.\n * @interface GetOrderDetailRequest\n */\nexport interface GetOrderDetailRequest {\n /**\n * order id retrieved from the api call of withdrawal\n * @type {string}\n * @memberof FiatApiGetOrderDetail\n */\n readonly orderNo: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetOrderDetail\n */\n readonly recvWindow?: number | bigint;\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 * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {DepositRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<DepositResponse>>}\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/Fiat-Deposit Binance API Documentation}\n */\n public async deposit(\n requestParameters: DepositRequest\n ): Promise<RestApiResponse<DepositResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.deposit(\n requestParameters?.currency,\n requestParameters?.apiPaymentMethod,\n requestParameters?.amount,\n requestParameters?.recvWindow,\n requestParameters?.ext\n );\n return sendRequest<DepositResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {FiatWithdrawRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<FiatWithdrawResponse>>}\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/Fiat-Withdraw Binance API Documentation}\n */\n public async fiatWithdraw(\n requestParameters: FiatWithdrawRequest\n ): Promise<RestApiResponse<FiatWithdrawResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.fiatWithdraw(\n requestParameters?.currency,\n requestParameters?.apiPaymentMethod,\n requestParameters?.amount,\n requestParameters?.accountInfo,\n requestParameters?.recvWindow,\n requestParameters?.ext\n );\n return sendRequest<FiatWithdrawResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * 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: 45000\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.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\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.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {GetOrderDetailRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetOrderDetailResponse>>}\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-Order-Detail Binance API Documentation}\n */\n public async getOrderDetail(\n requestParameters: GetOrderDetailRequest\n ): Promise<RestApiResponse<GetOrderDetailResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOrderDetail(\n requestParameters?.orderNo,\n requestParameters?.recvWindow\n );\n return sendRequest<GetOrderDetailResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Fiat REST API\n *\n * OpenAPI Specification for the Binance 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 DepositRequest,\n FiatWithdrawRequest,\n GetFiatDepositWithdrawHistoryRequest,\n GetFiatPaymentsHistoryRequest,\n GetOrderDetailRequest,\n} from './modules/fiat-api';\n\nimport type {\n DepositResponse,\n FiatWithdrawResponse,\n GetFiatDepositWithdrawHistoryResponse,\n GetFiatPaymentsHistoryResponse,\n GetOrderDetailResponse,\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 queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {DepositRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<DepositResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Fiat-Deposit Binance API Documentation}\n */\n deposit(requestParameters: DepositRequest): Promise<RestApiResponse<DepositResponse>> {\n return this.fiatApi.deposit(requestParameters);\n }\n\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {FiatWithdrawRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<FiatWithdrawResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Fiat-Withdraw Binance API Documentation}\n */\n fiatWithdraw(\n requestParameters: FiatWithdrawRequest\n ): Promise<RestApiResponse<FiatWithdrawResponse>> {\n return this.fiatApi.fiatWithdraw(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 *\n * Weight: 45000\n *\n * @summary Get Fiat Deposit/Withdraw History (USER_DATA)\n * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.\n *\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 *\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 /**\n * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {GetOrderDetailRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetOrderDetailResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Order-Detail Binance API Documentation}\n */\n getOrderDetail(\n requestParameters: GetOrderDetailRequest\n ): Promise<RestApiResponse<GetOrderDetailResponse>> {\n return this.fiatApi.getOrderDetail(requestParameters);\n }\n}\n","/**\n * Binance Fiat REST API\n *\n * OpenAPI Specification for the Binance 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","import { buildUserAgent, 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 const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || FIAT_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;AC8Bf,MAAM,2BAA2B,SAAU,eAAqC;AAC5E,QAAO;EAqBH,SAAS,OACL,UACA,kBACA,QACA,YACA,QACuB;AAEvB,2CAAkB,WAAW,YAAY,SAAS;AAElD,2CAAkB,WAAW,oB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AK,eACL,UACA,QACA,aACA,YACA,QACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;;CAqBL,QAAQ,mBAA8E;AAClF,SAAO,KAAK,QAAQ,QAAQ,kBAAkB;;;;;;;;;;;;;;;;;;;;CAqBlD,aACI,mBAC8C;AAC9C,SAAO,KAAK,QAAQ,aAAa,kBAAkB;;;;;;;;;;;;;;;;CAiBvD,8BACI,mBAC+D;AAC/D,SAAO,KAAK,QAAQ,8BAA8B,kBAAkB;;;;;;;;;;;;;;;;;;;;;CAsBxE,uBACI,mBACwD;AACxD,SAAO,KAAK,QAAQ,uBAAuB,kBAAkB;;;;;;;;;;;;;;;;CAiBjE,eACI,mBACgD;AAChD,SAAO,KAAK,QAAQ,eAAe,kBAAkB;;;;;;;;;;;;;AElM7D,IAAa,OAAb,MAAkB;CAGd,YAAY,QAA2B;EACnC,MAAM,iDAA2B,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAIC,sCACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { BadRequestError, ConfigurationRestAPI, ConnectorClientError, FIAT_REST_
|
|
|
3
3
|
|
|
4
4
|
//#region package.json
|
|
5
5
|
var name = "@binance/fiat";
|
|
6
|
-
var version = "6.0.
|
|
6
|
+
var version = "6.0.16";
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/rest-api/modules/fiat-api.ts
|
|
@@ -30,6 +30,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
30
30
|
assertParamExists("deposit", "amount", amount);
|
|
31
31
|
const localVarQueryParameter = {};
|
|
32
32
|
const localVarBodyParameter = {};
|
|
33
|
+
const localVarHeaderParameter = {};
|
|
33
34
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
34
35
|
if (currency !== void 0 && currency !== null) localVarBodyParameter["currency"] = currency;
|
|
35
36
|
if (apiPaymentMethod !== void 0 && apiPaymentMethod !== null) localVarBodyParameter["apiPaymentMethod"] = apiPaymentMethod;
|
|
@@ -42,6 +43,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
42
43
|
method: "POST",
|
|
43
44
|
queryParams: localVarQueryParameter,
|
|
44
45
|
bodyParams: localVarBodyParameter,
|
|
46
|
+
headerParams: localVarHeaderParameter,
|
|
45
47
|
timeUnit: _timeUnit
|
|
46
48
|
};
|
|
47
49
|
},
|
|
@@ -52,6 +54,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
52
54
|
assertParamExists("fiatWithdraw", "accountInfo", accountInfo);
|
|
53
55
|
const localVarQueryParameter = {};
|
|
54
56
|
const localVarBodyParameter = {};
|
|
57
|
+
const localVarHeaderParameter = {};
|
|
55
58
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
56
59
|
if (currency !== void 0 && currency !== null) localVarBodyParameter["currency"] = currency;
|
|
57
60
|
if (apiPaymentMethod !== void 0 && apiPaymentMethod !== null) localVarBodyParameter["apiPaymentMethod"] = apiPaymentMethod;
|
|
@@ -65,6 +68,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
65
68
|
method: "POST",
|
|
66
69
|
queryParams: localVarQueryParameter,
|
|
67
70
|
bodyParams: localVarBodyParameter,
|
|
71
|
+
headerParams: localVarHeaderParameter,
|
|
68
72
|
timeUnit: _timeUnit
|
|
69
73
|
};
|
|
70
74
|
},
|
|
@@ -72,6 +76,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
72
76
|
assertParamExists("getFiatDepositWithdrawHistory", "transactionType", transactionType);
|
|
73
77
|
const localVarQueryParameter = {};
|
|
74
78
|
const localVarBodyParameter = {};
|
|
79
|
+
const localVarHeaderParameter = {};
|
|
75
80
|
if (transactionType !== void 0 && transactionType !== null) localVarQueryParameter["transactionType"] = transactionType;
|
|
76
81
|
if (beginTime !== void 0 && beginTime !== null) localVarQueryParameter["beginTime"] = beginTime;
|
|
77
82
|
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
|
|
@@ -85,6 +90,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
85
90
|
method: "GET",
|
|
86
91
|
queryParams: localVarQueryParameter,
|
|
87
92
|
bodyParams: localVarBodyParameter,
|
|
93
|
+
headerParams: localVarHeaderParameter,
|
|
88
94
|
timeUnit: _timeUnit
|
|
89
95
|
};
|
|
90
96
|
},
|
|
@@ -92,6 +98,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
92
98
|
assertParamExists("getFiatPaymentsHistory", "transactionType", transactionType);
|
|
93
99
|
const localVarQueryParameter = {};
|
|
94
100
|
const localVarBodyParameter = {};
|
|
101
|
+
const localVarHeaderParameter = {};
|
|
95
102
|
if (transactionType !== void 0 && transactionType !== null) localVarQueryParameter["transactionType"] = transactionType;
|
|
96
103
|
if (beginTime !== void 0 && beginTime !== null) localVarQueryParameter["beginTime"] = beginTime;
|
|
97
104
|
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
|
|
@@ -105,6 +112,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
105
112
|
method: "GET",
|
|
106
113
|
queryParams: localVarQueryParameter,
|
|
107
114
|
bodyParams: localVarBodyParameter,
|
|
115
|
+
headerParams: localVarHeaderParameter,
|
|
108
116
|
timeUnit: _timeUnit
|
|
109
117
|
};
|
|
110
118
|
},
|
|
@@ -112,6 +120,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
112
120
|
assertParamExists("getOrderDetail", "orderNo", orderNo);
|
|
113
121
|
const localVarQueryParameter = {};
|
|
114
122
|
const localVarBodyParameter = {};
|
|
123
|
+
const localVarHeaderParameter = {};
|
|
115
124
|
if (orderNo !== void 0 && orderNo !== null) localVarQueryParameter["orderNo"] = orderNo;
|
|
116
125
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
117
126
|
let _timeUnit;
|
|
@@ -121,6 +130,7 @@ const FiatApiAxiosParamCreator = function(configuration) {
|
|
|
121
130
|
method: "GET",
|
|
122
131
|
queryParams: localVarQueryParameter,
|
|
123
132
|
bodyParams: localVarBodyParameter,
|
|
133
|
+
headerParams: localVarHeaderParameter,
|
|
124
134
|
timeUnit: _timeUnit
|
|
125
135
|
};
|
|
126
136
|
}
|
|
@@ -155,7 +165,7 @@ var FiatApi = class {
|
|
|
155
165
|
*/
|
|
156
166
|
async deposit(requestParameters) {
|
|
157
167
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.deposit(requestParameters?.currency, requestParameters?.apiPaymentMethod, requestParameters?.amount, requestParameters?.recvWindow, requestParameters?.ext);
|
|
158
|
-
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
168
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
159
169
|
}
|
|
160
170
|
/**
|
|
161
171
|
* Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.
|
|
@@ -177,7 +187,7 @@ var FiatApi = class {
|
|
|
177
187
|
*/
|
|
178
188
|
async fiatWithdraw(requestParameters) {
|
|
179
189
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.fiatWithdraw(requestParameters?.currency, requestParameters?.apiPaymentMethod, requestParameters?.amount, requestParameters?.accountInfo, requestParameters?.recvWindow, requestParameters?.ext);
|
|
180
|
-
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
190
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
181
191
|
}
|
|
182
192
|
/**
|
|
183
193
|
* Get Fiat Deposit/Withdraw History
|
|
@@ -195,7 +205,7 @@ var FiatApi = class {
|
|
|
195
205
|
*/
|
|
196
206
|
async getFiatDepositWithdrawHistory(requestParameters) {
|
|
197
207
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFiatDepositWithdrawHistory(requestParameters?.transactionType, requestParameters?.beginTime, requestParameters?.endTime, requestParameters?.page, requestParameters?.rows, requestParameters?.recvWindow);
|
|
198
|
-
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
208
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
199
209
|
}
|
|
200
210
|
/**
|
|
201
211
|
* Get Fiat Deposit/Withdraw History
|
|
@@ -218,7 +228,7 @@ var FiatApi = class {
|
|
|
218
228
|
*/
|
|
219
229
|
async getFiatPaymentsHistory(requestParameters) {
|
|
220
230
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFiatPaymentsHistory(requestParameters?.transactionType, requestParameters?.beginTime, requestParameters?.endTime, requestParameters?.page, requestParameters?.rows, requestParameters?.recvWindow);
|
|
221
|
-
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
231
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
222
232
|
}
|
|
223
233
|
/**
|
|
224
234
|
* Get Order Detail
|
|
@@ -236,7 +246,7 @@ var FiatApi = class {
|
|
|
236
246
|
*/
|
|
237
247
|
async getOrderDetail(requestParameters) {
|
|
238
248
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOrderDetail(requestParameters?.orderNo, requestParameters?.recvWindow);
|
|
239
|
-
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
249
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
240
250
|
}
|
|
241
251
|
};
|
|
242
252
|
|
|
@@ -269,7 +279,7 @@ var RestAPI = class {
|
|
|
269
279
|
* @returns A promise resolving to the response data object.
|
|
270
280
|
*/
|
|
271
281
|
sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
|
|
272
|
-
return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
|
|
282
|
+
return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0, void 0);
|
|
273
283
|
}
|
|
274
284
|
/**
|
|
275
285
|
* Generic function to send a signed request.
|
|
@@ -281,7 +291,7 @@ var RestAPI = class {
|
|
|
281
291
|
* @returns A promise resolving to the response data object.
|
|
282
292
|
*/
|
|
283
293
|
sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
|
|
284
|
-
return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
|
|
294
|
+
return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0, void 0, { isSigned: true });
|
|
285
295
|
}
|
|
286
296
|
/**
|
|
287
297
|
* Submit deposit request, in this version, we only support BRL deposit via pix.
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","FIAT_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/fiat-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/fiat.ts"],"sourcesContent":["{\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\": \"6.0.15\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"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 \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.3.14\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Fiat REST API\n *\n * OpenAPI Specification for the Binance 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 AccountInfo,\n DepositResponse,\n FiatWithdrawResponse,\n GetFiatDepositWithdrawHistoryResponse,\n GetFiatPaymentsHistoryResponse,\n GetOrderDetailResponse,\n} from '../types';\n\n/**\n * FiatApi - axios parameter creator\n */\nconst FiatApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {string} currency\n * @param {string} apiPaymentMethod\n * @param {number | bigint} amount\n * @param {number | bigint} [recvWindow]\n * @param {object} [ext]\n *\n * @throws {RequiredError}\n */\n deposit: async (\n currency: string,\n apiPaymentMethod: string,\n amount: number | bigint,\n recvWindow?: number | bigint,\n ext?: object\n ): Promise<RequestArgs> => {\n // verify required parameter 'currency' is not null or undefined\n assertParamExists('deposit', 'currency', currency);\n // verify required parameter 'apiPaymentMethod' is not null or undefined\n assertParamExists('deposit', 'apiPaymentMethod', apiPaymentMethod);\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('deposit', 'amount', amount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n if (currency !== undefined && currency !== null) {\n localVarBodyParameter['currency'] = currency;\n }\n\n if (apiPaymentMethod !== undefined && apiPaymentMethod !== null) {\n localVarBodyParameter['apiPaymentMethod'] = apiPaymentMethod;\n }\n\n if (amount !== undefined && amount !== null) {\n localVarBodyParameter['amount'] = amount;\n }\n\n if (ext !== undefined && ext !== null) {\n localVarBodyParameter['ext'] = ext;\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/deposit',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {string} currency\n * @param {string} apiPaymentMethod\n * @param {number | bigint} amount\n * @param {AccountInfo} accountInfo\n * @param {number | bigint} [recvWindow]\n * @param {object} [ext]\n *\n * @throws {RequiredError}\n */\n fiatWithdraw: async (\n currency: string,\n apiPaymentMethod: string,\n amount: number | bigint,\n accountInfo: AccountInfo,\n recvWindow?: number | bigint,\n ext?: object\n ): Promise<RequestArgs> => {\n // verify required parameter 'currency' is not null or undefined\n assertParamExists('fiatWithdraw', 'currency', currency);\n // verify required parameter 'apiPaymentMethod' is not null or undefined\n assertParamExists('fiatWithdraw', 'apiPaymentMethod', apiPaymentMethod);\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('fiatWithdraw', 'amount', amount);\n // verify required parameter 'accountInfo' is not null or undefined\n assertParamExists('fiatWithdraw', 'accountInfo', accountInfo);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n if (currency !== undefined && currency !== null) {\n localVarBodyParameter['currency'] = currency;\n }\n\n if (apiPaymentMethod !== undefined && apiPaymentMethod !== null) {\n localVarBodyParameter['apiPaymentMethod'] = apiPaymentMethod;\n }\n\n if (amount !== undefined && amount !== null) {\n localVarBodyParameter['amount'] = amount;\n }\n\n if (accountInfo !== undefined && accountInfo !== null) {\n localVarBodyParameter['accountInfo'] = accountInfo;\n }\n\n if (ext !== undefined && ext !== null) {\n localVarBodyParameter['ext'] = ext;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v2/fiat/withdraw',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\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 *\n * Weight: 45000\n *\n * @summary Get Fiat Deposit/Withdraw History (USER_DATA)\n * @param {string} transactionType 0-buy,1-sell\n * @param {number | bigint} [beginTime]\n * @param {number | bigint} [endTime]\n * @param {number | bigint} [page] default 1\n * @param {number | bigint} [rows] default 100, max 500\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFiatDepositWithdrawHistory: async (\n transactionType: string,\n beginTime?: number | bigint,\n endTime?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\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 const localVarBodyParameter: Record<string, unknown> = {};\n\n if (transactionType !== undefined && transactionType !== null) {\n localVarQueryParameter['transactionType'] = transactionType;\n }\n if (beginTime !== undefined && beginTime !== null) {\n localVarQueryParameter['beginTime'] = beginTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/fiat/orders',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\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 | bigint} [beginTime]\n * @param {number | bigint} [endTime]\n * @param {number | bigint} [page] default 1\n * @param {number | bigint} [rows] default 100, max 500\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFiatPaymentsHistory: async (\n transactionType: string,\n beginTime?: number | bigint,\n endTime?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\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 const localVarBodyParameter: Record<string, unknown> = {};\n\n if (transactionType !== undefined && transactionType !== null) {\n localVarQueryParameter['transactionType'] = transactionType;\n }\n if (beginTime !== undefined && beginTime !== null) {\n localVarQueryParameter['beginTime'] = beginTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/fiat/payments',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {string} orderNo order id retrieved from the api call of withdrawal\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getOrderDetail: async (\n orderNo: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'orderNo' is not null or undefined\n assertParamExists('getOrderDetail', 'orderNo', orderNo);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (orderNo !== undefined && orderNo !== null) {\n localVarQueryParameter['orderNo'] = orderNo;\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/get-order-detail',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * FiatApi - interface\n * @interface FiatApi\n */\nexport interface FiatApiInterface {\n /**\n * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {DepositRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n deposit(requestParameters: DepositRequest): Promise<RestApiResponse<DepositResponse>>;\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {FiatWithdrawRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n fiatWithdraw(\n requestParameters: FiatWithdrawRequest\n ): Promise<RestApiResponse<FiatWithdrawResponse>>;\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: 45000\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 * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {GetOrderDetailRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n getOrderDetail(\n requestParameters: GetOrderDetailRequest\n ): Promise<RestApiResponse<GetOrderDetailResponse>>;\n}\n\n/**\n * Request parameters for deposit operation in FiatApi.\n * @interface DepositRequest\n */\nexport interface DepositRequest {\n /**\n *\n * @type {string}\n * @memberof FiatApiDeposit\n */\n readonly currency: string;\n\n /**\n *\n * @type {string}\n * @memberof FiatApiDeposit\n */\n readonly apiPaymentMethod: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiDeposit\n */\n readonly amount: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiDeposit\n */\n readonly recvWindow?: number | bigint;\n\n /**\n *\n * @type {object}\n * @memberof FiatApiDeposit\n */\n readonly ext?: object;\n}\n\n/**\n * Request parameters for fiatWithdraw operation in FiatApi.\n * @interface FiatWithdrawRequest\n */\nexport interface FiatWithdrawRequest {\n /**\n *\n * @type {string}\n * @memberof FiatApiFiatWithdraw\n */\n readonly currency: string;\n\n /**\n *\n * @type {string}\n * @memberof FiatApiFiatWithdraw\n */\n readonly apiPaymentMethod: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiFiatWithdraw\n */\n readonly amount: number | bigint;\n\n /**\n *\n * @type {AccountInfo}\n * @memberof FiatApiFiatWithdraw\n */\n readonly accountInfo: AccountInfo;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiFiatWithdraw\n */\n readonly recvWindow?: number | bigint;\n\n /**\n *\n * @type {object}\n * @memberof FiatApiFiatWithdraw\n */\n readonly ext?: object;\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 | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly beginTime?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly endTime?: number | bigint;\n\n /**\n * default 1\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 500\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly recvWindow?: number | bigint;\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 | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly beginTime?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly endTime?: number | bigint;\n\n /**\n * default 1\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 500\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for getOrderDetail operation in FiatApi.\n * @interface GetOrderDetailRequest\n */\nexport interface GetOrderDetailRequest {\n /**\n * order id retrieved from the api call of withdrawal\n * @type {string}\n * @memberof FiatApiGetOrderDetail\n */\n readonly orderNo: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetOrderDetail\n */\n readonly recvWindow?: number | bigint;\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 * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {DepositRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<DepositResponse>>}\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/Fiat-Deposit Binance API Documentation}\n */\n public async deposit(\n requestParameters: DepositRequest\n ): Promise<RestApiResponse<DepositResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.deposit(\n requestParameters?.currency,\n requestParameters?.apiPaymentMethod,\n requestParameters?.amount,\n requestParameters?.recvWindow,\n requestParameters?.ext\n );\n return sendRequest<DepositResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {FiatWithdrawRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<FiatWithdrawResponse>>}\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/Fiat-Withdraw Binance API Documentation}\n */\n public async fiatWithdraw(\n requestParameters: FiatWithdrawRequest\n ): Promise<RestApiResponse<FiatWithdrawResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.fiatWithdraw(\n requestParameters?.currency,\n requestParameters?.apiPaymentMethod,\n requestParameters?.amount,\n requestParameters?.accountInfo,\n requestParameters?.recvWindow,\n requestParameters?.ext\n );\n return sendRequest<FiatWithdrawResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\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 *\n * Weight: 45000\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.queryParams,\n localVarAxiosArgs.bodyParams,\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.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {GetOrderDetailRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetOrderDetailResponse>>}\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-Order-Detail Binance API Documentation}\n */\n public async getOrderDetail(\n requestParameters: GetOrderDetailRequest\n ): Promise<RestApiResponse<GetOrderDetailResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOrderDetail(\n requestParameters?.orderNo,\n requestParameters?.recvWindow\n );\n return sendRequest<GetOrderDetailResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Fiat REST API\n *\n * OpenAPI Specification for the Binance 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 DepositRequest,\n FiatWithdrawRequest,\n GetFiatDepositWithdrawHistoryRequest,\n GetFiatPaymentsHistoryRequest,\n GetOrderDetailRequest,\n} from './modules/fiat-api';\n\nimport type {\n DepositResponse,\n FiatWithdrawResponse,\n GetFiatDepositWithdrawHistoryResponse,\n GetFiatPaymentsHistoryResponse,\n GetOrderDetailResponse,\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 queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {DepositRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<DepositResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Fiat-Deposit Binance API Documentation}\n */\n deposit(requestParameters: DepositRequest): Promise<RestApiResponse<DepositResponse>> {\n return this.fiatApi.deposit(requestParameters);\n }\n\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {FiatWithdrawRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<FiatWithdrawResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Fiat-Withdraw Binance API Documentation}\n */\n fiatWithdraw(\n requestParameters: FiatWithdrawRequest\n ): Promise<RestApiResponse<FiatWithdrawResponse>> {\n return this.fiatApi.fiatWithdraw(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 *\n * Weight: 45000\n *\n * @summary Get Fiat Deposit/Withdraw History (USER_DATA)\n * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.\n *\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 *\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 /**\n * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {GetOrderDetailRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetOrderDetailResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Order-Detail Binance API Documentation}\n */\n getOrderDetail(\n requestParameters: GetOrderDetailRequest\n ): Promise<RestApiResponse<GetOrderDetailResponse>> {\n return this.fiatApi.getOrderDetail(requestParameters);\n }\n}\n","/**\n * Binance Fiat REST API\n *\n * OpenAPI Specification for the Binance 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","import { buildUserAgent, 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 const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || FIAT_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;AC8Bf,MAAM,2BAA2B,SAAU,eAAqC;AAC5E,QAAO;EAqBH,SAAS,OACL,UACA,kBACA,QACA,YACA,QACuB;AAEvB,qBAAkB,WAAW,YAAY,SAAS;AAElD,qBAAkB,WAAW,oBAAoB,iBAAiB;AAElE,qBAAkB,WAAW,UAAU,OAAO;GAE9C,MAAMA,yBAAkD,EAAE;GAC1D,MAAMC,wBAAiD,EAAE;AAEzD,OAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;AAG3C,OAAI,aAAa,UAAa,aAAa,KACvC,uBAAsB,cAAc;AAGxC,OAAI,qBAAqB,UAAa,qBAAqB,KACvD,uBAAsB,sBAAsB;AAGhD,OAAI,WAAW,UAAa,WAAW,KACnC,uBAAsB,YAAY;AAGtC,OAAI,QAAQ,UAAa,QAAQ,KAC7B,uBAAsB,SAAS;GAGnC,IAAIC;AACJ,OAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,UAAO;IACH,UAAU;IACV,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,UAAU;IACb;;EAuBL,cAAc,OACV,UACA,kBACA,QACA,aACA,YACA,QACuB;AAEvB,qBAAkB,gBAAgB,YAAY,SAAS;AAEvD,qBAAkB,gBAAgB,oBAAoB,iBAAiB;AAEvE,qBAAkB,gBAAgB,UAAU,OAAO;AAEnD,qBAAkB,gBAAgB,eAAe,YAAY;GAE7D,MAAMF,yBAAkD,EAAE;GAC1D,MAA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;AACrB,OAAK,UAAU,IAAI,QAAQ,cAAc;;;;;;;;;;;CAY7C,YACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,SAAO,YACH,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;;CAqBL,QAAQ,mBAA8E;AAClF,SAAO,KAAK,QAAQ,QAAQ,kBAAkB;;;;;;;;;;;;;;;;;;;;CAqBlD,aACI,mBAC8C;AAC9C,SAAO,KAAK,QAAQ,aAAa,kBAAkB;;;;;;;;;;;;;;;;CAiBvD,8BACI,mBAC+D;AAC/D,SAAO,KAAK,QAAQ,8BAA8B,kBAAkB;;;;;;;;;;;;;;;;;;;;;CAsBxE,uBACI,mBACwD;AACxD,SAAO,KAAK,QAAQ,uBAAuB,kBAAkB;;;;;;;;;;;;;;;;CAiBjE,eACI,mBACgD;AAChD,SAAO,KAAK,QAAQ,eAAe,kBAAkB;;;;;;;;;;;;;AEhM7D,IAAa,OAAb,MAAkB;CAGd,YAAY,QAA2B;EACnC,MAAM,YAAY,eAAe,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAI,qBACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","localVarHeaderParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","FIAT_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/fiat-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/fiat.ts"],"sourcesContent":["{\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\": \"6.0.16\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"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 \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.4.0\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Fiat REST API\n *\n * OpenAPI Specification for the Binance 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 AccountInfo,\n DepositResponse,\n FiatWithdrawResponse,\n GetFiatDepositWithdrawHistoryResponse,\n GetFiatPaymentsHistoryResponse,\n GetOrderDetailResponse,\n} from '../types';\n\n/**\n * FiatApi - axios parameter creator\n */\nconst FiatApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {string} currency\n * @param {string} apiPaymentMethod\n * @param {number | bigint} amount\n * @param {number | bigint} [recvWindow]\n * @param {object} [ext]\n *\n * @throws {RequiredError}\n */\n deposit: async (\n currency: string,\n apiPaymentMethod: string,\n amount: number | bigint,\n recvWindow?: number | bigint,\n ext?: object\n ): Promise<RequestArgs> => {\n // verify required parameter 'currency' is not null or undefined\n assertParamExists('deposit', 'currency', currency);\n // verify required parameter 'apiPaymentMethod' is not null or undefined\n assertParamExists('deposit', 'apiPaymentMethod', apiPaymentMethod);\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('deposit', 'amount', amount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n if (currency !== undefined && currency !== null) {\n localVarBodyParameter['currency'] = currency;\n }\n\n if (apiPaymentMethod !== undefined && apiPaymentMethod !== null) {\n localVarBodyParameter['apiPaymentMethod'] = apiPaymentMethod;\n }\n\n if (amount !== undefined && amount !== null) {\n localVarBodyParameter['amount'] = amount;\n }\n\n if (ext !== undefined && ext !== null) {\n localVarBodyParameter['ext'] = ext;\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/deposit',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {string} currency\n * @param {string} apiPaymentMethod\n * @param {number | bigint} amount\n * @param {AccountInfo} accountInfo\n * @param {number | bigint} [recvWindow]\n * @param {object} [ext]\n *\n * @throws {RequiredError}\n */\n fiatWithdraw: async (\n currency: string,\n apiPaymentMethod: string,\n amount: number | bigint,\n accountInfo: AccountInfo,\n recvWindow?: number | bigint,\n ext?: object\n ): Promise<RequestArgs> => {\n // verify required parameter 'currency' is not null or undefined\n assertParamExists('fiatWithdraw', 'currency', currency);\n // verify required parameter 'apiPaymentMethod' is not null or undefined\n assertParamExists('fiatWithdraw', 'apiPaymentMethod', apiPaymentMethod);\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('fiatWithdraw', 'amount', amount);\n // verify required parameter 'accountInfo' is not null or undefined\n assertParamExists('fiatWithdraw', 'accountInfo', accountInfo);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n if (currency !== undefined && currency !== null) {\n localVarBodyParameter['currency'] = currency;\n }\n\n if (apiPaymentMethod !== undefined && apiPaymentMethod !== null) {\n localVarBodyParameter['apiPaymentMethod'] = apiPaymentMethod;\n }\n\n if (amount !== undefined && amount !== null) {\n localVarBodyParameter['amount'] = amount;\n }\n\n if (accountInfo !== undefined && accountInfo !== null) {\n localVarBodyParameter['accountInfo'] = accountInfo;\n }\n\n if (ext !== undefined && ext !== null) {\n localVarBodyParameter['ext'] = ext;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v2/fiat/withdraw',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\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 *\n * Weight: 45000\n *\n * @summary Get Fiat Deposit/Withdraw History (USER_DATA)\n * @param {string} transactionType 0-buy,1-sell\n * @param {number | bigint} [beginTime]\n * @param {number | bigint} [endTime]\n * @param {number | bigint} [page] default 1\n * @param {number | bigint} [rows] default 100, max 500\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFiatDepositWithdrawHistory: async (\n transactionType: string,\n beginTime?: number | bigint,\n endTime?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\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 const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (transactionType !== undefined && transactionType !== null) {\n localVarQueryParameter['transactionType'] = transactionType;\n }\n if (beginTime !== undefined && beginTime !== null) {\n localVarQueryParameter['beginTime'] = beginTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/fiat/orders',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\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 | bigint} [beginTime]\n * @param {number | bigint} [endTime]\n * @param {number | bigint} [page] default 1\n * @param {number | bigint} [rows] default 100, max 500\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFiatPaymentsHistory: async (\n transactionType: string,\n beginTime?: number | bigint,\n endTime?: number | bigint,\n page?: number | bigint,\n rows?: number | bigint,\n recvWindow?: number | bigint\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 const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (transactionType !== undefined && transactionType !== null) {\n localVarQueryParameter['transactionType'] = transactionType;\n }\n if (beginTime !== undefined && beginTime !== null) {\n localVarQueryParameter['beginTime'] = beginTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (page !== undefined && page !== null) {\n localVarQueryParameter['page'] = page;\n }\n if (rows !== undefined && rows !== null) {\n localVarQueryParameter['rows'] = rows;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/fiat/payments',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {string} orderNo order id retrieved from the api call of withdrawal\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getOrderDetail: async (\n orderNo: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'orderNo' is not null or undefined\n assertParamExists('getOrderDetail', 'orderNo', orderNo);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n const localVarHeaderParameter: Record<string, unknown> = {};\n\n if (orderNo !== undefined && orderNo !== null) {\n localVarQueryParameter['orderNo'] = orderNo;\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/get-order-detail',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n headerParams: localVarHeaderParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * FiatApi - interface\n * @interface FiatApi\n */\nexport interface FiatApiInterface {\n /**\n * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {DepositRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n deposit(requestParameters: DepositRequest): Promise<RestApiResponse<DepositResponse>>;\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {FiatWithdrawRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n fiatWithdraw(\n requestParameters: FiatWithdrawRequest\n ): Promise<RestApiResponse<FiatWithdrawResponse>>;\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: 45000\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 * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {GetOrderDetailRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FiatApiInterface\n */\n getOrderDetail(\n requestParameters: GetOrderDetailRequest\n ): Promise<RestApiResponse<GetOrderDetailResponse>>;\n}\n\n/**\n * Request parameters for deposit operation in FiatApi.\n * @interface DepositRequest\n */\nexport interface DepositRequest {\n /**\n *\n * @type {string}\n * @memberof FiatApiDeposit\n */\n readonly currency: string;\n\n /**\n *\n * @type {string}\n * @memberof FiatApiDeposit\n */\n readonly apiPaymentMethod: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiDeposit\n */\n readonly amount: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiDeposit\n */\n readonly recvWindow?: number | bigint;\n\n /**\n *\n * @type {object}\n * @memberof FiatApiDeposit\n */\n readonly ext?: object;\n}\n\n/**\n * Request parameters for fiatWithdraw operation in FiatApi.\n * @interface FiatWithdrawRequest\n */\nexport interface FiatWithdrawRequest {\n /**\n *\n * @type {string}\n * @memberof FiatApiFiatWithdraw\n */\n readonly currency: string;\n\n /**\n *\n * @type {string}\n * @memberof FiatApiFiatWithdraw\n */\n readonly apiPaymentMethod: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiFiatWithdraw\n */\n readonly amount: number | bigint;\n\n /**\n *\n * @type {AccountInfo}\n * @memberof FiatApiFiatWithdraw\n */\n readonly accountInfo: AccountInfo;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiFiatWithdraw\n */\n readonly recvWindow?: number | bigint;\n\n /**\n *\n * @type {object}\n * @memberof FiatApiFiatWithdraw\n */\n readonly ext?: object;\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 | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly beginTime?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly endTime?: number | bigint;\n\n /**\n * default 1\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 500\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatDepositWithdrawHistory\n */\n readonly recvWindow?: number | bigint;\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 | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly beginTime?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly endTime?: number | bigint;\n\n /**\n * default 1\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly page?: number | bigint;\n\n /**\n * default 100, max 500\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly rows?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetFiatPaymentsHistory\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for getOrderDetail operation in FiatApi.\n * @interface GetOrderDetailRequest\n */\nexport interface GetOrderDetailRequest {\n /**\n * order id retrieved from the api call of withdrawal\n * @type {string}\n * @memberof FiatApiGetOrderDetail\n */\n readonly orderNo: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof FiatApiGetOrderDetail\n */\n readonly recvWindow?: number | bigint;\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 * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {DepositRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<DepositResponse>>}\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/Fiat-Deposit Binance API Documentation}\n */\n public async deposit(\n requestParameters: DepositRequest\n ): Promise<RestApiResponse<DepositResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.deposit(\n requestParameters?.currency,\n requestParameters?.apiPaymentMethod,\n requestParameters?.amount,\n requestParameters?.recvWindow,\n requestParameters?.ext\n );\n return sendRequest<DepositResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {FiatWithdrawRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<FiatWithdrawResponse>>}\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/Fiat-Withdraw Binance API Documentation}\n */\n public async fiatWithdraw(\n requestParameters: FiatWithdrawRequest\n ): Promise<RestApiResponse<FiatWithdrawResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.fiatWithdraw(\n requestParameters?.currency,\n requestParameters?.apiPaymentMethod,\n requestParameters?.amount,\n requestParameters?.accountInfo,\n requestParameters?.recvWindow,\n requestParameters?.ext\n );\n return sendRequest<FiatWithdrawResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * 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: 45000\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.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\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.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {GetOrderDetailRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetOrderDetailResponse>>}\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-Order-Detail Binance API Documentation}\n */\n public async getOrderDetail(\n requestParameters: GetOrderDetailRequest\n ): Promise<RestApiResponse<GetOrderDetailResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOrderDetail(\n requestParameters?.orderNo,\n requestParameters?.recvWindow\n );\n return sendRequest<GetOrderDetailResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs.headerParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Fiat REST API\n *\n * OpenAPI Specification for the Binance 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 DepositRequest,\n FiatWithdrawRequest,\n GetFiatDepositWithdrawHistoryRequest,\n GetFiatPaymentsHistoryRequest,\n GetOrderDetailRequest,\n} from './modules/fiat-api';\n\nimport type {\n DepositResponse,\n FiatWithdrawResponse,\n GetFiatDepositWithdrawHistoryResponse,\n GetFiatPaymentsHistoryResponse,\n GetOrderDetailResponse,\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 queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Submit deposit request, in this version, we only support BRL deposit via pix.\n *\n *\n *\n * For BRL deposit via pix, you need to place an order before making a transfer from your bank.\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 45000\n *\n * @summary Deposit(TRADE)\n * @param {DepositRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<DepositResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Fiat-Deposit Binance API Documentation}\n */\n deposit(requestParameters: DepositRequest): Promise<RestApiResponse<DepositResponse>> {\n return this.fiatApi.deposit(requestParameters);\n }\n\n /**\n * Submit withdraw request, in this version, we support BRL,ARS,MXN withdrawal via bank_transfer.\n *\n * 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.\n *\n * Before calling this API, please ensure you have completed your KYC or KYB, activated your fiat service, and verified your destination bank account on our website.\n *\n * you need to bind your bank account on web/app before using the corresponding account number\n *\n * Weight: 45000\n *\n * @summary Fiat Withdraw(WITHDRAW)\n * @param {FiatWithdrawRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<FiatWithdrawResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Fiat-Withdraw Binance API Documentation}\n */\n fiatWithdraw(\n requestParameters: FiatWithdrawRequest\n ): Promise<RestApiResponse<FiatWithdrawResponse>> {\n return this.fiatApi.fiatWithdraw(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 *\n * Weight: 45000\n *\n * @summary Get Fiat Deposit/Withdraw History (USER_DATA)\n * @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.\n *\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 *\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 /**\n * Get Order Detail\n *\n * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.\n *\n * Weight: 1\n *\n * @summary Get Order Detail(USER_DATA)\n * @param {GetOrderDetailRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetOrderDetailResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Order-Detail Binance API Documentation}\n */\n getOrderDetail(\n requestParameters: GetOrderDetailRequest\n ): Promise<RestApiResponse<GetOrderDetailResponse>> {\n return this.fiatApi.getOrderDetail(requestParameters);\n }\n}\n","/**\n * Binance Fiat REST API\n *\n * OpenAPI Specification for the Binance 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","import { buildUserAgent, 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 const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || FIAT_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;AC8Bf,MAAM,2BAA2B,SAAU,eAAqC;AAC5E,QAAO;EAqBH,SAAS,OACL,UACA,kBACA,QACA,YACA,QACuB;AAEvB,qBAAkB,WAAW,YAAY,SAAS;AAElD,qBAAkB,WAAW,oBAAoB,iBAAiB;AAElE,qBAAkB,WAAW,UAAU,OAAO;GAE9C,MAAMA,yBAAkD,EAAE;GAC1D,MAAMC,wBAAiD,EAAE;GACzD,MAAMC,0BAAmD,EAAE;AAE3D,OAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;AAG3C,OAAI,aAAa,UAAa,aAAa,KACvC,uBAAsB,cAAc;AAGxC,OAAI,qBAAqB,UAAa,qBAAqB,KACvD,uBAAsB,sBAAsB;AAGhD,OAAI,WAAW,UAAa,WAAW,KACnC,uBAAsB,YAAY;AAGtC,OAAI,QAAQ,UAAa,QAAQ,KAC7B,uBAAsB,SAAS;GAGnC,IAAIC;AACJ,OAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,UAAO;IACH,UAAU;IACV,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,cAAc;IACd,UAAU;IACb;;EAuBL,cAAc,OACV,UACA,kBACA,QACA,aACA,YACA,QACuB;AAEvB,qBAAkB,gBAAgB,YAAY,SAAS;AAEvD,qBAAkB,gBAAgB,oBAAoB,iBAAiB;AAEvE,qBAAkB,gBAAgB,UAAU,OAAO;AAEnD,qBAAkB,gBAAgB,eAAe,YAAY;GAE7D,MAAMH,yBAAkD,EAAE;GAC1D,MAAMC,wBAAiD,EAAE;GAC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Ac,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@binance/fiat",
|
|
3
3
|
"description": "Official Binance Fiat Connector - A lightweight library that provides a convenient interface to Binance's Fiat REST API.",
|
|
4
|
-
"version": "6.0.
|
|
4
|
+
"version": "6.0.16",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"typescript-eslint": "^8.24.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@binance/common": "2.
|
|
59
|
+
"@binance/common": "2.4.0",
|
|
60
60
|
"axios": "^1.7.4"
|
|
61
61
|
}
|
|
62
62
|
}
|