@binance/pay 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,338 +1,325 @@
1
- "use strict";
1
+ //#region rolldown:runtime
2
2
  var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name2 in all)
8
- __defProp(target, name2, { get: all[name2], enumerable: true });
3
+ var __export = (all) => {
4
+ let target = {};
5
+ for (var name$1 in all) __defProp(target, name$1, {
6
+ get: all[name$1],
7
+ enumerable: true
8
+ });
9
+ return target;
9
10
  };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
11
 
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- BadRequestError: () => import_common4.BadRequestError,
24
- ConnectorClientError: () => import_common4.ConnectorClientError,
25
- ForbiddenError: () => import_common4.ForbiddenError,
26
- NetworkError: () => import_common4.NetworkError,
27
- NotFoundError: () => import_common4.NotFoundError,
28
- PAY_REST_API_PROD_URL: () => import_common4.PAY_REST_API_PROD_URL,
29
- Pay: () => Pay,
30
- PayRestAPI: () => rest_api_exports,
31
- RateLimitBanError: () => import_common4.RateLimitBanError,
32
- RequiredError: () => import_common4.RequiredError,
33
- ServerError: () => import_common4.ServerError,
34
- TooManyRequestsError: () => import_common4.TooManyRequestsError,
35
- UnauthorizedError: () => import_common4.UnauthorizedError
36
- });
37
- module.exports = __toCommonJS(index_exports);
12
+ //#endregion
13
+ let __binance_common = require("@binance/common");
38
14
 
39
- // src/pay.ts
40
- var import_common3 = require("@binance/common");
41
-
42
- // package.json
15
+ //#region package.json
43
16
  var name = "@binance/pay";
44
- var version = "5.0.1";
45
-
46
- // src/rest-api/index.ts
47
- var rest_api_exports = {};
48
- __export(rest_api_exports, {
49
- PayApi: () => PayApi,
50
- RestAPI: () => RestAPI
51
- });
17
+ var version = "5.0.2";
52
18
 
53
- // src/rest-api/modules/pay-api.ts
54
- var import_common = require("@binance/common");
55
- var PayApiAxiosParamCreator = function(configuration) {
56
- return {
57
- /**
58
- * Get Pay Trade History
59
- *
60
- * If startTime and endTime are not sent, the recent 90 days' data will be returned.
61
- * The max interval between startTime and endTime is 90 days.
62
- * Support for querying orders within the last 18 months.
63
- * For payerInfo and receiverInfo,there are different return values in different orderTypes.
64
- * Sender's perspective when orderType is C2C
65
- * payerInfo : binanceId
66
- * receiverInfo : name, binanceId/accountId/email/countryCode/phoneNumber/mobileCode (based on user input)
67
- * Receiver's perspective when orderType is C2C
68
- * payerInfo : name
69
- * receiverInfo : binanceId
70
- * Sender's perspective when orderType is CRYPTO_BOX
71
- * payerInfo : binanceId
72
- * receiverInfo : name(the value is always "Crypto Box")
73
- * Receiver's perspective when orderType is CRYPTO_BOX
74
- * payerInfo : name
75
- * receiverInfo : binanceId
76
- * Sender's perspective when orderType is PAY
77
- * payerInfo : binanceId
78
- * receiverInfo : name
79
- * Receiver's perspective when orderType is PAY
80
- * payerInfo : name
81
- * receiverInfo : binanceId, name
82
- * Sender's perspective when orderType is PAY_REFUND
83
- * payerInfo : binanceId, name
84
- * receiverInfo : name, accountId
85
- * Receiver's perspective when orderType is PAY_REFUND
86
- * payerInfo : name
87
- * receiverInfo : binanceId
88
- * Sender's perspective when orderType is PAYOUT
89
- * payerInfo : binanceId, name
90
- * receiverInfo : name, accountId
91
- * Receiver's perspective when orderType is PAYOUT
92
- * payerInfo : name
93
- * receiverInfo : binanceId
94
- * Receiver's perspective when orderType is CRYPTO_BOX_RF
95
- * payerInfo : name(the value is always "Crypto Box")
96
- * receiverInfo : binanceId
97
- * Sender's perspective when orderType is REMITTANCE
98
- * payerInfo : binanceId
99
- * receiverInfo : name, institutionName, cardNumber, digitalWalletId
100
- *
101
- * Weight: 3000
102
- *
103
- * @summary Get Pay Trade History
104
- * @param {number | bigint} [startTime]
105
- * @param {number | bigint} [endTime]
106
- * @param {number | bigint} [limit] default 100, max 100
107
- * @param {number | bigint} [recvWindow]
108
- *
109
- * @throws {RequiredError}
110
- */
111
- getPayTradeHistory: async (startTime, endTime, limit, recvWindow) => {
112
- const localVarQueryParameter = {};
113
- if (startTime !== void 0 && startTime !== null) {
114
- localVarQueryParameter["startTime"] = startTime;
115
- }
116
- if (endTime !== void 0 && endTime !== null) {
117
- localVarQueryParameter["endTime"] = endTime;
118
- }
119
- if (limit !== void 0 && limit !== null) {
120
- localVarQueryParameter["limit"] = limit;
121
- }
122
- if (recvWindow !== void 0 && recvWindow !== null) {
123
- localVarQueryParameter["recvWindow"] = recvWindow;
124
- }
125
- let _timeUnit;
126
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
127
- return {
128
- endpoint: "/sapi/v1/pay/transactions",
129
- method: "GET",
130
- params: localVarQueryParameter,
131
- timeUnit: _timeUnit
132
- };
133
- }
134
- };
19
+ //#endregion
20
+ //#region src/rest-api/modules/pay-api.ts
21
+ /**
22
+ * Binance Pay REST API
23
+ *
24
+ * OpenAPI Specification for the Binance Pay REST API
25
+ *
26
+ * The version of the OpenAPI document: 1.0.0
27
+ *
28
+ *
29
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
30
+ * https://openapi-generator.tech
31
+ * Do not edit the class manually.
32
+ */
33
+ /**
34
+ * PayApi - axios parameter creator
35
+ */
36
+ const PayApiAxiosParamCreator = function(configuration) {
37
+ return { getPayTradeHistory: async (startTime, endTime, limit, recvWindow) => {
38
+ const localVarQueryParameter = {};
39
+ if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
40
+ if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
41
+ if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
42
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
43
+ let _timeUnit;
44
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
45
+ return {
46
+ endpoint: "/sapi/v1/pay/transactions",
47
+ method: "GET",
48
+ params: localVarQueryParameter,
49
+ timeUnit: _timeUnit
50
+ };
51
+ } };
135
52
  };
53
+ /**
54
+ * PayApi - object-oriented interface
55
+ * @class PayApi
56
+ */
136
57
  var PayApi = class {
137
- constructor(configuration) {
138
- this.configuration = configuration;
139
- this.localVarAxiosParamCreator = PayApiAxiosParamCreator(configuration);
140
- }
141
- /**
142
- * Get Pay Trade History
143
- *
144
- * If startTime and endTime are not sent, the recent 90 days' data will be returned.
145
- * The max interval between startTime and endTime is 90 days.
146
- * Support for querying orders within the last 18 months.
147
- * For payerInfo and receiverInfo,there are different return values in different orderTypes.
148
- * Sender's perspective when orderType is C2C
149
- * payerInfo : binanceId
150
- * receiverInfo : name, binanceId/accountId/email/countryCode/phoneNumber/mobileCode (based on user input)
151
- * Receiver's perspective when orderType is C2C
152
- * payerInfo : name
153
- * receiverInfo : binanceId
154
- * Sender's perspective when orderType is CRYPTO_BOX
155
- * payerInfo : binanceId
156
- * receiverInfo : name(the value is always "Crypto Box")
157
- * Receiver's perspective when orderType is CRYPTO_BOX
158
- * payerInfo : name
159
- * receiverInfo : binanceId
160
- * Sender's perspective when orderType is PAY
161
- * payerInfo : binanceId
162
- * receiverInfo : name
163
- * Receiver's perspective when orderType is PAY
164
- * payerInfo : name
165
- * receiverInfo : binanceId, name
166
- * Sender's perspective when orderType is PAY_REFUND
167
- * payerInfo : binanceId, name
168
- * receiverInfo : name, accountId
169
- * Receiver's perspective when orderType is PAY_REFUND
170
- * payerInfo : name
171
- * receiverInfo : binanceId
172
- * Sender's perspective when orderType is PAYOUT
173
- * payerInfo : binanceId, name
174
- * receiverInfo : name, accountId
175
- * Receiver's perspective when orderType is PAYOUT
176
- * payerInfo : name
177
- * receiverInfo : binanceId
178
- * Receiver's perspective when orderType is CRYPTO_BOX_RF
179
- * payerInfo : name(the value is always "Crypto Box")
180
- * receiverInfo : binanceId
181
- * Sender's perspective when orderType is REMITTANCE
182
- * payerInfo : binanceId
183
- * receiverInfo : name, institutionName, cardNumber, digitalWalletId
184
- *
185
- * Weight: 3000
186
- *
187
- * @summary Get Pay Trade History
188
- * @param {GetPayTradeHistoryRequest} requestParameters Request parameters.
189
- * @returns {Promise<RestApiResponse<GetPayTradeHistoryResponse>>}
190
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
191
- * @memberof PayApi
192
- * @see {@link https://developers.binance.com/docs/pay/rest-api/Get-Pay-Trade-History Binance API Documentation}
193
- */
194
- async getPayTradeHistory(requestParameters = {}) {
195
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getPayTradeHistory(
196
- requestParameters?.startTime,
197
- requestParameters?.endTime,
198
- requestParameters?.limit,
199
- requestParameters?.recvWindow
200
- );
201
- return (0, import_common.sendRequest)(
202
- this.configuration,
203
- localVarAxiosArgs.endpoint,
204
- localVarAxiosArgs.method,
205
- localVarAxiosArgs.params,
206
- localVarAxiosArgs?.timeUnit,
207
- { isSigned: true }
208
- );
209
- }
58
+ constructor(configuration) {
59
+ this.configuration = configuration;
60
+ this.localVarAxiosParamCreator = PayApiAxiosParamCreator(configuration);
61
+ }
62
+ /**
63
+ * Get Pay Trade History
64
+ *
65
+ * If startTime and endTime are not sent, the recent 90 days' data will be returned.
66
+ * The max interval between startTime and endTime is 90 days.
67
+ * Support for querying orders within the last 18 months.
68
+ * For payerInfo and receiverInfo,there are different return values in different orderTypes.
69
+ * Sender's perspective when orderType is C2C
70
+ * payerInfo : binanceId
71
+ * receiverInfo : name, binanceId/accountId/email/countryCode/phoneNumber/mobileCode (based on user input)
72
+ * Receiver's perspective when orderType is C2C
73
+ * payerInfo : name
74
+ * receiverInfo : binanceId
75
+ * Sender's perspective when orderType is CRYPTO_BOX
76
+ * payerInfo : binanceId
77
+ * receiverInfo : name(the value is always "Crypto Box")
78
+ * Receiver's perspective when orderType is CRYPTO_BOX
79
+ * payerInfo : name
80
+ * receiverInfo : binanceId
81
+ * Sender's perspective when orderType is PAY
82
+ * payerInfo : binanceId
83
+ * receiverInfo : name
84
+ * Receiver's perspective when orderType is PAY
85
+ * payerInfo : name
86
+ * receiverInfo : binanceId, name
87
+ * Sender's perspective when orderType is PAY_REFUND
88
+ * payerInfo : binanceId, name
89
+ * receiverInfo : name, accountId
90
+ * Receiver's perspective when orderType is PAY_REFUND
91
+ * payerInfo : name
92
+ * receiverInfo : binanceId
93
+ * Sender's perspective when orderType is PAYOUT
94
+ * payerInfo : binanceId, name
95
+ * receiverInfo : name, accountId
96
+ * Receiver's perspective when orderType is PAYOUT
97
+ * payerInfo : name
98
+ * receiverInfo : binanceId
99
+ * Receiver's perspective when orderType is CRYPTO_BOX_RF
100
+ * payerInfo : name(the value is always "Crypto Box")
101
+ * receiverInfo : binanceId
102
+ * Sender's perspective when orderType is REMITTANCE
103
+ * payerInfo : binanceId
104
+ * receiverInfo : name, institutionName, cardNumber, digitalWalletId
105
+ *
106
+ * Weight: 3000
107
+ *
108
+ * @summary Get Pay Trade History
109
+ * @param {GetPayTradeHistoryRequest} requestParameters Request parameters.
110
+ * @returns {Promise<RestApiResponse<GetPayTradeHistoryResponse>>}
111
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
112
+ * @memberof PayApi
113
+ * @see {@link https://developers.binance.com/docs/pay/rest-api/Get-Pay-Trade-History Binance API Documentation}
114
+ */
115
+ async getPayTradeHistory(requestParameters = {}) {
116
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getPayTradeHistory(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.limit, requestParameters?.recvWindow);
117
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
118
+ }
210
119
  };
211
120
 
212
- // src/rest-api/rest-api.ts
213
- var import_common2 = require("@binance/common");
121
+ //#endregion
122
+ //#region src/rest-api/rest-api.ts
123
+ /**
124
+ * Binance Pay REST API
125
+ *
126
+ * OpenAPI Specification for the Binance Pay REST API
127
+ *
128
+ * The version of the OpenAPI document: 1.0.0
129
+ *
130
+ *
131
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
132
+ * https://openapi-generator.tech
133
+ * Do not edit the class manually.
134
+ */
214
135
  var RestAPI = class {
215
- constructor(configuration) {
216
- this.configuration = configuration;
217
- this.payApi = new PayApi(configuration);
218
- }
219
- /**
220
- * Generic function to send a request.
221
- * @param endpoint - The API endpoint to call.
222
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
223
- * @param params - Query parameters for the request.
224
- *
225
- * @returns A promise resolving to the response data object.
226
- */
227
- sendRequest(endpoint, method, params = {}) {
228
- return (0, import_common2.sendRequest)(this.configuration, endpoint, method, params, void 0);
229
- }
230
- /**
231
- * Generic function to send a signed request.
232
- * @param endpoint - The API endpoint to call.
233
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
234
- * @param params - Query parameters for the request.
235
- *
236
- * @returns A promise resolving to the response data object.
237
- */
238
- sendSignedRequest(endpoint, method, params = {}) {
239
- return (0, import_common2.sendRequest)(this.configuration, endpoint, method, params, void 0, {
240
- isSigned: true
241
- });
242
- }
243
- /**
244
- * Get Pay Trade History
245
- *
246
- * If startTime and endTime are not sent, the recent 90 days' data will be returned.
247
- * The max interval between startTime and endTime is 90 days.
248
- * Support for querying orders within the last 18 months.
249
- * For payerInfo and receiverInfo,there are different return values in different orderTypes.
250
- * Sender's perspective when orderType is C2C
251
- * payerInfo : binanceId
252
- * receiverInfo : name, binanceId/accountId/email/countryCode/phoneNumber/mobileCode (based on user input)
253
- * Receiver's perspective when orderType is C2C
254
- * payerInfo : name
255
- * receiverInfo : binanceId
256
- * Sender's perspective when orderType is CRYPTO_BOX
257
- * payerInfo : binanceId
258
- * receiverInfo : name(the value is always "Crypto Box")
259
- * Receiver's perspective when orderType is CRYPTO_BOX
260
- * payerInfo : name
261
- * receiverInfo : binanceId
262
- * Sender's perspective when orderType is PAY
263
- * payerInfo : binanceId
264
- * receiverInfo : name
265
- * Receiver's perspective when orderType is PAY
266
- * payerInfo : name
267
- * receiverInfo : binanceId, name
268
- * Sender's perspective when orderType is PAY_REFUND
269
- * payerInfo : binanceId, name
270
- * receiverInfo : name, accountId
271
- * Receiver's perspective when orderType is PAY_REFUND
272
- * payerInfo : name
273
- * receiverInfo : binanceId
274
- * Sender's perspective when orderType is PAYOUT
275
- * payerInfo : binanceId, name
276
- * receiverInfo : name, accountId
277
- * Receiver's perspective when orderType is PAYOUT
278
- * payerInfo : name
279
- * receiverInfo : binanceId
280
- * Receiver's perspective when orderType is CRYPTO_BOX_RF
281
- * payerInfo : name(the value is always "Crypto Box")
282
- * receiverInfo : binanceId
283
- * Sender's perspective when orderType is REMITTANCE
284
- * payerInfo : binanceId
285
- * receiverInfo : name, institutionName, cardNumber, digitalWalletId
286
- *
287
- * Weight: 3000
288
- *
289
- * @summary Get Pay Trade History
290
- * @param {GetPayTradeHistoryRequest} requestParameters Request parameters.
291
- *
292
- * @returns {Promise<RestApiResponse<GetPayTradeHistoryResponse>>}
293
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
294
- * @see {@link https://developers.binance.com/docs/pay/rest-api/Get-Pay-Trade-History Binance API Documentation}
295
- */
296
- getPayTradeHistory(requestParameters = {}) {
297
- return this.payApi.getPayTradeHistory(requestParameters);
298
- }
136
+ constructor(configuration) {
137
+ this.configuration = configuration;
138
+ this.payApi = new PayApi(configuration);
139
+ }
140
+ /**
141
+ * Generic function to send a request.
142
+ * @param endpoint - The API endpoint to call.
143
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
144
+ * @param params - Query parameters for the request.
145
+ *
146
+ * @returns A promise resolving to the response data object.
147
+ */
148
+ sendRequest(endpoint, method, params = {}) {
149
+ return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, params, void 0);
150
+ }
151
+ /**
152
+ * Generic function to send a signed request.
153
+ * @param endpoint - The API endpoint to call.
154
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
155
+ * @param params - Query parameters for the request.
156
+ *
157
+ * @returns A promise resolving to the response data object.
158
+ */
159
+ sendSignedRequest(endpoint, method, params = {}) {
160
+ return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, params, void 0, { isSigned: true });
161
+ }
162
+ /**
163
+ * Get Pay Trade History
164
+ *
165
+ * If startTime and endTime are not sent, the recent 90 days' data will be returned.
166
+ * The max interval between startTime and endTime is 90 days.
167
+ * Support for querying orders within the last 18 months.
168
+ * For payerInfo and receiverInfo,there are different return values in different orderTypes.
169
+ * Sender's perspective when orderType is C2C
170
+ * payerInfo : binanceId
171
+ * receiverInfo : name, binanceId/accountId/email/countryCode/phoneNumber/mobileCode (based on user input)
172
+ * Receiver's perspective when orderType is C2C
173
+ * payerInfo : name
174
+ * receiverInfo : binanceId
175
+ * Sender's perspective when orderType is CRYPTO_BOX
176
+ * payerInfo : binanceId
177
+ * receiverInfo : name(the value is always "Crypto Box")
178
+ * Receiver's perspective when orderType is CRYPTO_BOX
179
+ * payerInfo : name
180
+ * receiverInfo : binanceId
181
+ * Sender's perspective when orderType is PAY
182
+ * payerInfo : binanceId
183
+ * receiverInfo : name
184
+ * Receiver's perspective when orderType is PAY
185
+ * payerInfo : name
186
+ * receiverInfo : binanceId, name
187
+ * Sender's perspective when orderType is PAY_REFUND
188
+ * payerInfo : binanceId, name
189
+ * receiverInfo : name, accountId
190
+ * Receiver's perspective when orderType is PAY_REFUND
191
+ * payerInfo : name
192
+ * receiverInfo : binanceId
193
+ * Sender's perspective when orderType is PAYOUT
194
+ * payerInfo : binanceId, name
195
+ * receiverInfo : name, accountId
196
+ * Receiver's perspective when orderType is PAYOUT
197
+ * payerInfo : name
198
+ * receiverInfo : binanceId
199
+ * Receiver's perspective when orderType is CRYPTO_BOX_RF
200
+ * payerInfo : name(the value is always "Crypto Box")
201
+ * receiverInfo : binanceId
202
+ * Sender's perspective when orderType is REMITTANCE
203
+ * payerInfo : binanceId
204
+ * receiverInfo : name, institutionName, cardNumber, digitalWalletId
205
+ *
206
+ * Weight: 3000
207
+ *
208
+ * @summary Get Pay Trade History
209
+ * @param {GetPayTradeHistoryRequest} requestParameters Request parameters.
210
+ *
211
+ * @returns {Promise<RestApiResponse<GetPayTradeHistoryResponse>>}
212
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
213
+ * @see {@link https://developers.binance.com/docs/pay/rest-api/Get-Pay-Trade-History Binance API Documentation}
214
+ */
215
+ getPayTradeHistory(requestParameters = {}) {
216
+ return this.payApi.getPayTradeHistory(requestParameters);
217
+ }
299
218
  };
300
219
 
301
- // src/pay.ts
220
+ //#endregion
221
+ //#region src/rest-api/index.ts
222
+ var rest_api_exports = /* @__PURE__ */ __export({
223
+ PayApi: () => PayApi,
224
+ RestAPI: () => RestAPI
225
+ });
226
+
227
+ //#endregion
228
+ //#region src/pay.ts
302
229
  var Pay = class {
303
- constructor(config) {
304
- const userAgent = (0, import_common3.buildUserAgent)(name, version);
305
- if (config?.configurationRestAPI) {
306
- const configRestAPI = new import_common3.ConfigurationRestAPI(
307
- config.configurationRestAPI
308
- );
309
- configRestAPI.basePath = configRestAPI.basePath || import_common3.PAY_REST_API_PROD_URL;
310
- configRestAPI.baseOptions = configRestAPI.baseOptions || {};
311
- configRestAPI.baseOptions.headers = {
312
- ...configRestAPI.baseOptions.headers || {},
313
- "User-Agent": userAgent
314
- };
315
- this.restAPI = new RestAPI(configRestAPI);
316
- }
317
- }
230
+ constructor(config) {
231
+ const userAgent = (0, __binance_common.buildUserAgent)(name, version);
232
+ if (config?.configurationRestAPI) {
233
+ const configRestAPI = new __binance_common.ConfigurationRestAPI(config.configurationRestAPI);
234
+ configRestAPI.basePath = configRestAPI.basePath || __binance_common.PAY_REST_API_PROD_URL;
235
+ configRestAPI.baseOptions = configRestAPI.baseOptions || {};
236
+ configRestAPI.baseOptions.headers = {
237
+ ...configRestAPI.baseOptions.headers || {},
238
+ "User-Agent": userAgent
239
+ };
240
+ this.restAPI = new RestAPI(configRestAPI);
241
+ }
242
+ }
318
243
  };
319
244
 
320
- // src/index.ts
321
- var import_common4 = require("@binance/common");
322
- // Annotate the CommonJS export names for ESM import in node:
323
- 0 && (module.exports = {
324
- BadRequestError,
325
- ConnectorClientError,
326
- ForbiddenError,
327
- NetworkError,
328
- NotFoundError,
329
- PAY_REST_API_PROD_URL,
330
- Pay,
331
- PayRestAPI,
332
- RateLimitBanError,
333
- RequiredError,
334
- ServerError,
335
- TooManyRequestsError,
336
- UnauthorizedError
245
+ //#endregion
246
+ Object.defineProperty(exports, 'BadRequestError', {
247
+ enumerable: true,
248
+ get: function () {
249
+ return __binance_common.BadRequestError;
250
+ }
251
+ });
252
+ Object.defineProperty(exports, 'ConfigurationPay', {
253
+ enumerable: true,
254
+ get: function () {
255
+ return ConfigurationPay;
256
+ }
257
+ });
258
+ Object.defineProperty(exports, 'ConnectorClientError', {
259
+ enumerable: true,
260
+ get: function () {
261
+ return __binance_common.ConnectorClientError;
262
+ }
263
+ });
264
+ Object.defineProperty(exports, 'ForbiddenError', {
265
+ enumerable: true,
266
+ get: function () {
267
+ return __binance_common.ForbiddenError;
268
+ }
269
+ });
270
+ Object.defineProperty(exports, 'NetworkError', {
271
+ enumerable: true,
272
+ get: function () {
273
+ return __binance_common.NetworkError;
274
+ }
275
+ });
276
+ Object.defineProperty(exports, 'NotFoundError', {
277
+ enumerable: true,
278
+ get: function () {
279
+ return __binance_common.NotFoundError;
280
+ }
281
+ });
282
+ Object.defineProperty(exports, 'PAY_REST_API_PROD_URL', {
283
+ enumerable: true,
284
+ get: function () {
285
+ return __binance_common.PAY_REST_API_PROD_URL;
286
+ }
287
+ });
288
+ exports.Pay = Pay;
289
+ Object.defineProperty(exports, 'PayRestAPI', {
290
+ enumerable: true,
291
+ get: function () {
292
+ return rest_api_exports;
293
+ }
294
+ });
295
+ Object.defineProperty(exports, 'RateLimitBanError', {
296
+ enumerable: true,
297
+ get: function () {
298
+ return __binance_common.RateLimitBanError;
299
+ }
300
+ });
301
+ Object.defineProperty(exports, 'RequiredError', {
302
+ enumerable: true,
303
+ get: function () {
304
+ return __binance_common.RequiredError;
305
+ }
306
+ });
307
+ Object.defineProperty(exports, 'ServerError', {
308
+ enumerable: true,
309
+ get: function () {
310
+ return __binance_common.ServerError;
311
+ }
312
+ });
313
+ Object.defineProperty(exports, 'TooManyRequestsError', {
314
+ enumerable: true,
315
+ get: function () {
316
+ return __binance_common.TooManyRequestsError;
317
+ }
318
+ });
319
+ Object.defineProperty(exports, 'UnauthorizedError', {
320
+ enumerable: true,
321
+ get: function () {
322
+ return __binance_common.UnauthorizedError;
323
+ }
337
324
  });
338
325
  //# sourceMappingURL=index.js.map