@binance/giftcard 4.0.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -737,20 +737,22 @@ declare class RestAPI {
737
737
  * Generic function to send a request.
738
738
  * @param endpoint - The API endpoint to call.
739
739
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
740
- * @param params - Query parameters for the request.
740
+ * @param queryParams - Query parameters for the request.
741
+ * @param bodyParams - Body parameters for the request.
741
742
  *
742
743
  * @returns A promise resolving to the response data object.
743
744
  */
744
- sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
745
+ sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
745
746
  /**
746
747
  * Generic function to send a signed request.
747
748
  * @param endpoint - The API endpoint to call.
748
749
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
749
- * @param params - Query parameters for the request.
750
+ * @param queryParams - Query parameters for the request.
751
+ * @param bodyParams - Body parameters for the request.
750
752
  *
751
753
  * @returns A promise resolving to the response data object.
752
754
  */
753
- sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
755
+ sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
754
756
  /**
755
757
  * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.
756
758
  * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.
package/dist/index.d.ts CHANGED
@@ -737,20 +737,22 @@ declare class RestAPI {
737
737
  * Generic function to send a request.
738
738
  * @param endpoint - The API endpoint to call.
739
739
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
740
- * @param params - Query parameters for the request.
740
+ * @param queryParams - Query parameters for the request.
741
+ * @param bodyParams - Body parameters for the request.
741
742
  *
742
743
  * @returns A promise resolving to the response data object.
743
744
  */
744
- sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
745
+ sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
745
746
  /**
746
747
  * Generic function to send a signed request.
747
748
  * @param endpoint - The API endpoint to call.
748
749
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
749
- * @param params - Query parameters for the request.
750
+ * @param queryParams - Query parameters for the request.
751
+ * @param bodyParams - Body parameters for the request.
750
752
  *
751
753
  * @returns A promise resolving to the response data object.
752
754
  */
753
- sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
755
+ sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
754
756
  /**
755
757
  * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.
756
758
  * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.
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/giftcard";
17
- var version = "4.0.1";
17
+ var version = "4.1.0";
18
18
 
19
19
  //#endregion
20
20
  //#region src/rest-api/modules/market-data-api.ts
@@ -40,6 +40,7 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
40
40
  (0, __binance_common.assertParamExists)("createADualTokenGiftCard", "faceToken", faceToken);
41
41
  (0, __binance_common.assertParamExists)("createADualTokenGiftCard", "baseTokenAmount", baseTokenAmount);
42
42
  const localVarQueryParameter = {};
43
+ const localVarBodyParameter = {};
43
44
  if (baseToken !== void 0 && baseToken !== null) localVarQueryParameter["baseToken"] = baseToken;
44
45
  if (faceToken !== void 0 && faceToken !== null) localVarQueryParameter["faceToken"] = faceToken;
45
46
  if (baseTokenAmount !== void 0 && baseTokenAmount !== null) localVarQueryParameter["baseTokenAmount"] = baseTokenAmount;
@@ -49,7 +50,8 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
49
50
  return {
50
51
  endpoint: "/sapi/v1/giftcard/buyCode",
51
52
  method: "POST",
52
- params: localVarQueryParameter,
53
+ queryParams: localVarQueryParameter,
54
+ bodyParams: localVarBodyParameter,
53
55
  timeUnit: _timeUnit
54
56
  };
55
57
  },
@@ -57,6 +59,7 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
57
59
  (0, __binance_common.assertParamExists)("createASingleTokenGiftCard", "token", token);
58
60
  (0, __binance_common.assertParamExists)("createASingleTokenGiftCard", "amount", amount);
59
61
  const localVarQueryParameter = {};
62
+ const localVarBodyParameter = {};
60
63
  if (token !== void 0 && token !== null) localVarQueryParameter["token"] = token;
61
64
  if (amount !== void 0 && amount !== null) localVarQueryParameter["amount"] = amount;
62
65
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
@@ -65,25 +68,29 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
65
68
  return {
66
69
  endpoint: "/sapi/v1/giftcard/createCode",
67
70
  method: "POST",
68
- params: localVarQueryParameter,
71
+ queryParams: localVarQueryParameter,
72
+ bodyParams: localVarBodyParameter,
69
73
  timeUnit: _timeUnit
70
74
  };
71
75
  },
72
76
  fetchRsaPublicKey: async (recvWindow) => {
73
77
  const localVarQueryParameter = {};
78
+ const localVarBodyParameter = {};
74
79
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
75
80
  let _timeUnit;
76
81
  if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
77
82
  return {
78
83
  endpoint: "/sapi/v1/giftcard/cryptography/rsa-public-key",
79
84
  method: "GET",
80
- params: localVarQueryParameter,
85
+ queryParams: localVarQueryParameter,
86
+ bodyParams: localVarBodyParameter,
81
87
  timeUnit: _timeUnit
82
88
  };
83
89
  },
84
90
  fetchTokenLimit: async (baseToken, recvWindow) => {
85
91
  (0, __binance_common.assertParamExists)("fetchTokenLimit", "baseToken", baseToken);
86
92
  const localVarQueryParameter = {};
93
+ const localVarBodyParameter = {};
87
94
  if (baseToken !== void 0 && baseToken !== null) localVarQueryParameter["baseToken"] = baseToken;
88
95
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
89
96
  let _timeUnit;
@@ -91,13 +98,15 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
91
98
  return {
92
99
  endpoint: "/sapi/v1/giftcard/buyCode/token-limit",
93
100
  method: "GET",
94
- params: localVarQueryParameter,
101
+ queryParams: localVarQueryParameter,
102
+ bodyParams: localVarBodyParameter,
95
103
  timeUnit: _timeUnit
96
104
  };
97
105
  },
98
106
  redeemABinanceGiftCard: async (code, externalUid, recvWindow) => {
99
107
  (0, __binance_common.assertParamExists)("redeemABinanceGiftCard", "code", code);
100
108
  const localVarQueryParameter = {};
109
+ const localVarBodyParameter = {};
101
110
  if (code !== void 0 && code !== null) localVarQueryParameter["code"] = code;
102
111
  if (externalUid !== void 0 && externalUid !== null) localVarQueryParameter["externalUid"] = externalUid;
103
112
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
@@ -106,13 +115,15 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
106
115
  return {
107
116
  endpoint: "/sapi/v1/giftcard/redeemCode",
108
117
  method: "POST",
109
- params: localVarQueryParameter,
118
+ queryParams: localVarQueryParameter,
119
+ bodyParams: localVarBodyParameter,
110
120
  timeUnit: _timeUnit
111
121
  };
112
122
  },
113
123
  verifyBinanceGiftCardByGiftCardNumber: async (referenceNo, recvWindow) => {
114
124
  (0, __binance_common.assertParamExists)("verifyBinanceGiftCardByGiftCardNumber", "referenceNo", referenceNo);
115
125
  const localVarQueryParameter = {};
126
+ const localVarBodyParameter = {};
116
127
  if (referenceNo !== void 0 && referenceNo !== null) localVarQueryParameter["referenceNo"] = referenceNo;
117
128
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
118
129
  let _timeUnit;
@@ -120,7 +131,8 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
120
131
  return {
121
132
  endpoint: "/sapi/v1/giftcard/verify",
122
133
  method: "GET",
123
- params: localVarQueryParameter,
134
+ queryParams: localVarQueryParameter,
135
+ bodyParams: localVarBodyParameter,
124
136
  timeUnit: _timeUnit
125
137
  };
126
138
  }
@@ -157,7 +169,7 @@ var MarketDataApi = class {
157
169
  */
158
170
  async createADualTokenGiftCard(requestParameters) {
159
171
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.createADualTokenGiftCard(requestParameters?.baseToken, requestParameters?.faceToken, requestParameters?.baseTokenAmount, requestParameters?.recvWindow);
160
- return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
172
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
161
173
  }
162
174
  /**
163
175
  * This API is for creating a Binance Gift Card.
@@ -180,7 +192,7 @@ var MarketDataApi = class {
180
192
  */
181
193
  async createASingleTokenGiftCard(requestParameters) {
182
194
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.createASingleTokenGiftCard(requestParameters?.token, requestParameters?.amount, requestParameters?.recvWindow);
183
- return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
195
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
184
196
  }
185
197
  /**
186
198
  * This API is for fetching the RSA Public Key.
@@ -199,7 +211,7 @@ var MarketDataApi = class {
199
211
  */
200
212
  async fetchRsaPublicKey(requestParameters = {}) {
201
213
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchRsaPublicKey(requestParameters?.recvWindow);
202
- return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
214
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
203
215
  }
204
216
  /**
205
217
  * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.
@@ -215,7 +227,7 @@ var MarketDataApi = class {
215
227
  */
216
228
  async fetchTokenLimit(requestParameters) {
217
229
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchTokenLimit(requestParameters?.baseToken, requestParameters?.recvWindow);
218
- return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
230
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
219
231
  }
220
232
  /**
221
233
  * This API is for redeeming a Binance Gift Card
@@ -241,7 +253,7 @@ var MarketDataApi = class {
241
253
  */
242
254
  async redeemABinanceGiftCard(requestParameters) {
243
255
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.redeemABinanceGiftCard(requestParameters?.code, requestParameters?.externalUid, requestParameters?.recvWindow);
244
- return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
256
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
245
257
  }
246
258
  /**
247
259
  * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.
@@ -259,7 +271,7 @@ var MarketDataApi = class {
259
271
  */
260
272
  async verifyBinanceGiftCardByGiftCardNumber(requestParameters) {
261
273
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.verifyBinanceGiftCardByGiftCardNumber(requestParameters?.referenceNo, requestParameters?.recvWindow);
262
- return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
274
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
263
275
  }
264
276
  };
265
277
 
@@ -286,23 +298,25 @@ var RestAPI = class {
286
298
  * Generic function to send a request.
287
299
  * @param endpoint - The API endpoint to call.
288
300
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
289
- * @param params - Query parameters for the request.
301
+ * @param queryParams - Query parameters for the request.
302
+ * @param bodyParams - Body parameters for the request.
290
303
  *
291
304
  * @returns A promise resolving to the response data object.
292
305
  */
293
- sendRequest(endpoint, method, params = {}) {
294
- return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, params, void 0);
306
+ sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
307
+ return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
295
308
  }
296
309
  /**
297
310
  * Generic function to send a signed request.
298
311
  * @param endpoint - The API endpoint to call.
299
312
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
300
- * @param params - Query parameters for the request.
313
+ * @param queryParams - Query parameters for the request.
314
+ * @param bodyParams - Body parameters for the request.
301
315
  *
302
316
  * @returns A promise resolving to the response data object.
303
317
  */
304
- sendSignedRequest(endpoint, method, params = {}) {
305
- return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, params, void 0, { isSigned: true });
318
+ sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
319
+ return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
306
320
  }
307
321
  /**
308
322
  * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","GIFT_CARD_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/gift-card.ts"],"sourcesContent":["{\n \"name\": \"@binance/giftcard\",\n \"description\": \"Official Binance Gift Card Connector - A lightweight library that provides a convenient interface to Binance's Gift Card REST API.\",\n \"version\": \"4.0.1\",\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 \"Gift Card\",\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.0.1\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Gift Card REST API\n *\n * OpenAPI Specification for the Binance Gift Card 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 CreateADualTokenGiftCardResponse,\n CreateASingleTokenGiftCardResponse,\n FetchRsaPublicKeyResponse,\n FetchTokenLimitResponse,\n RedeemABinanceGiftCardResponse,\n VerifyBinanceGiftCardByGiftCardNumberResponse,\n} from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {string} baseToken The token you want to pay, example: BUSD\n * @param {string} faceToken The token you want to buy, example: BNB. If faceToken = baseToken, it's the same as createCode endpoint.\n * @param {number} baseTokenAmount The base token asset quantity, example : 1.002\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n createADualTokenGiftCard: async (\n baseToken: string,\n faceToken: string,\n baseTokenAmount: number,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'baseToken' is not null or undefined\n assertParamExists('createADualTokenGiftCard', 'baseToken', baseToken);\n // verify required parameter 'faceToken' is not null or undefined\n assertParamExists('createADualTokenGiftCard', 'faceToken', faceToken);\n // verify required parameter 'baseTokenAmount' is not null or undefined\n assertParamExists('createADualTokenGiftCard', 'baseTokenAmount', baseTokenAmount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (baseToken !== undefined && baseToken !== null) {\n localVarQueryParameter['baseToken'] = baseToken;\n }\n\n if (faceToken !== undefined && faceToken !== null) {\n localVarQueryParameter['faceToken'] = faceToken;\n }\n\n if (baseTokenAmount !== undefined && baseTokenAmount !== null) {\n localVarQueryParameter['baseTokenAmount'] = baseTokenAmount;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/giftcard/buyCode',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {string} token The token type contained in the Binance Gift Card\n * @param {number} amount The amount of the token contained in the Binance Gift Card\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n createASingleTokenGiftCard: async (\n token: string,\n amount: number,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'token' is not null or undefined\n assertParamExists('createASingleTokenGiftCard', 'token', token);\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('createASingleTokenGiftCard', 'amount', amount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (token !== undefined && token !== null) {\n localVarQueryParameter['token'] = token;\n }\n\n if (amount !== undefined && amount !== null) {\n localVarQueryParameter['amount'] = amount;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/giftcard/createCode',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n fetchRsaPublicKey: async (recvWindow?: number | bigint): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\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/giftcard/cryptography/rsa-public-key',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {string} baseToken The token you want to pay, example: BUSD\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n fetchTokenLimit: async (\n baseToken: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'baseToken' is not null or undefined\n assertParamExists('fetchTokenLimit', 'baseToken', baseToken);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (baseToken !== undefined && baseToken !== null) {\n localVarQueryParameter['baseToken'] = baseToken;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/giftcard/buyCode/token-limit',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {string} code Redemption code of Binance Gift Card to be redeemed, supports both Plaintext & Encrypted code.\n * @param {string} [externalUid] Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner's daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance Gift Cards on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters).\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n redeemABinanceGiftCard: async (\n code: string,\n externalUid?: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'code' is not null or undefined\n assertParamExists('redeemABinanceGiftCard', 'code', code);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (code !== undefined && code !== null) {\n localVarQueryParameter['code'] = code;\n }\n\n if (externalUid !== undefined && externalUid !== null) {\n localVarQueryParameter['externalUid'] = externalUid;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/giftcard/redeemCode',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {string} referenceNo Enter the Gift Card Number\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n verifyBinanceGiftCardByGiftCardNumber: async (\n referenceNo: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'referenceNo' is not null or undefined\n assertParamExists('verifyBinanceGiftCardByGiftCardNumber', 'referenceNo', referenceNo);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (referenceNo !== undefined && referenceNo !== null) {\n localVarQueryParameter['referenceNo'] = referenceNo;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/giftcard/verify',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n createADualTokenGiftCard(\n requestParameters: CreateADualTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>;\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n createASingleTokenGiftCard(\n requestParameters: CreateASingleTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>;\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n fetchRsaPublicKey(\n requestParameters?: FetchRsaPublicKeyRequest\n ): Promise<RestApiResponse<FetchRsaPublicKeyResponse>>;\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {FetchTokenLimitRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n fetchTokenLimit(\n requestParameters: FetchTokenLimitRequest\n ): Promise<RestApiResponse<FetchTokenLimitResponse>>;\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n redeemABinanceGiftCard(\n requestParameters: RedeemABinanceGiftCardRequest\n ): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>;\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n verifyBinanceGiftCardByGiftCardNumber(\n requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest\n ): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>;\n}\n\n/**\n * Request parameters for createADualTokenGiftCard operation in MarketDataApi.\n * @interface CreateADualTokenGiftCardRequest\n */\nexport interface CreateADualTokenGiftCardRequest {\n /**\n * The token you want to pay, example: BUSD\n * @type {string}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly baseToken: string;\n\n /**\n * The token you want to buy, example: BNB. If faceToken = baseToken, it's the same as createCode endpoint.\n * @type {string}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly faceToken: string;\n\n /**\n * The base token asset quantity, example : 1.002\n * @type {number}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly baseTokenAmount: number;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for createASingleTokenGiftCard operation in MarketDataApi.\n * @interface CreateASingleTokenGiftCardRequest\n */\nexport interface CreateASingleTokenGiftCardRequest {\n /**\n * The token type contained in the Binance Gift Card\n * @type {string}\n * @memberof MarketDataApiCreateASingleTokenGiftCard\n */\n readonly token: string;\n\n /**\n * The amount of the token contained in the Binance Gift Card\n * @type {number}\n * @memberof MarketDataApiCreateASingleTokenGiftCard\n */\n readonly amount: number;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiCreateASingleTokenGiftCard\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for fetchRsaPublicKey operation in MarketDataApi.\n * @interface FetchRsaPublicKeyRequest\n */\nexport interface FetchRsaPublicKeyRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiFetchRsaPublicKey\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for fetchTokenLimit operation in MarketDataApi.\n * @interface FetchTokenLimitRequest\n */\nexport interface FetchTokenLimitRequest {\n /**\n * The token you want to pay, example: BUSD\n * @type {string}\n * @memberof MarketDataApiFetchTokenLimit\n */\n readonly baseToken: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiFetchTokenLimit\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for redeemABinanceGiftCard operation in MarketDataApi.\n * @interface RedeemABinanceGiftCardRequest\n */\nexport interface RedeemABinanceGiftCardRequest {\n /**\n * Redemption code of Binance Gift Card to be redeemed, supports both Plaintext & Encrypted code.\n * @type {string}\n * @memberof MarketDataApiRedeemABinanceGiftCard\n */\n readonly code: string;\n\n /**\n * Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner's daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance Gift Cards on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters).\n * @type {string}\n * @memberof MarketDataApiRedeemABinanceGiftCard\n */\n readonly externalUid?: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiRedeemABinanceGiftCard\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for verifyBinanceGiftCardByGiftCardNumber operation in MarketDataApi.\n * @interface VerifyBinanceGiftCardByGiftCardNumberRequest\n */\nexport interface VerifyBinanceGiftCardByGiftCardNumberRequest {\n /**\n * Enter the Gift Card Number\n * @type {string}\n * @memberof MarketDataApiVerifyBinanceGiftCardByGiftCardNumber\n */\n readonly referenceNo: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiVerifyBinanceGiftCardByGiftCardNumber\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * MarketDataApi - object-oriented interface\n * @class MarketDataApi\n */\nexport class MarketDataApi implements MarketDataApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);\n }\n\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-dual-token-gift-card Binance API Documentation}\n */\n public async createADualTokenGiftCard(\n requestParameters: CreateADualTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.createADualTokenGiftCard(\n requestParameters?.baseToken,\n requestParameters?.faceToken,\n requestParameters?.baseTokenAmount,\n requestParameters?.recvWindow\n );\n return sendRequest<CreateADualTokenGiftCardResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card Binance API Documentation}\n */\n public async createASingleTokenGiftCard(\n requestParameters: CreateASingleTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.createASingleTokenGiftCard(\n requestParameters?.token,\n requestParameters?.amount,\n requestParameters?.recvWindow\n );\n return sendRequest<CreateASingleTokenGiftCardResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<FetchRsaPublicKeyResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-RSA-Public-Key Binance API Documentation}\n */\n public async fetchRsaPublicKey(\n requestParameters: FetchRsaPublicKeyRequest = {}\n ): Promise<RestApiResponse<FetchRsaPublicKeyResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchRsaPublicKey(\n requestParameters?.recvWindow\n );\n return sendRequest<FetchRsaPublicKeyResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {FetchTokenLimitRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<FetchTokenLimitResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-Token-Limit Binance API Documentation}\n */\n public async fetchTokenLimit(\n requestParameters: FetchTokenLimitRequest\n ): Promise<RestApiResponse<FetchTokenLimitResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchTokenLimit(\n requestParameters?.baseToken,\n requestParameters?.recvWindow\n );\n return sendRequest<FetchTokenLimitResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card Binance API Documentation}\n */\n public async redeemABinanceGiftCard(\n requestParameters: RedeemABinanceGiftCardRequest\n ): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.redeemABinanceGiftCard(\n requestParameters?.code,\n requestParameters?.externalUid,\n requestParameters?.recvWindow\n );\n return sendRequest<RedeemABinanceGiftCardResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number Binance API Documentation}\n */\n public async verifyBinanceGiftCardByGiftCardNumber(\n requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest\n ): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.verifyBinanceGiftCardByGiftCardNumber(\n requestParameters?.referenceNo,\n requestParameters?.recvWindow\n );\n return sendRequest<VerifyBinanceGiftCardByGiftCardNumberResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Gift Card REST API\n *\n * OpenAPI Specification for the Binance Gift Card 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 { MarketDataApi } from './modules/market-data-api';\n\nimport type {\n CreateADualTokenGiftCardRequest,\n CreateASingleTokenGiftCardRequest,\n FetchRsaPublicKeyRequest,\n FetchTokenLimitRequest,\n RedeemABinanceGiftCardRequest,\n VerifyBinanceGiftCardByGiftCardNumberRequest,\n} from './modules/market-data-api';\n\nimport type {\n CreateADualTokenGiftCardResponse,\n CreateASingleTokenGiftCardResponse,\n FetchRsaPublicKeyResponse,\n FetchTokenLimitResponse,\n RedeemABinanceGiftCardResponse,\n VerifyBinanceGiftCardByGiftCardNumberResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param params - Query parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined);\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param params - Query parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined, {\n isSigned: true,\n });\n }\n\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-dual-token-gift-card Binance API Documentation}\n */\n createADualTokenGiftCard(\n requestParameters: CreateADualTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>> {\n return this.marketDataApi.createADualTokenGiftCard(requestParameters);\n }\n\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card Binance API Documentation}\n */\n createASingleTokenGiftCard(\n requestParameters: CreateASingleTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>> {\n return this.marketDataApi.createASingleTokenGiftCard(requestParameters);\n }\n\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<FetchRsaPublicKeyResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-RSA-Public-Key Binance API Documentation}\n */\n fetchRsaPublicKey(\n requestParameters: FetchRsaPublicKeyRequest = {}\n ): Promise<RestApiResponse<FetchRsaPublicKeyResponse>> {\n return this.marketDataApi.fetchRsaPublicKey(requestParameters);\n }\n\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {FetchTokenLimitRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<FetchTokenLimitResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-Token-Limit Binance API Documentation}\n */\n fetchTokenLimit(\n requestParameters: FetchTokenLimitRequest\n ): Promise<RestApiResponse<FetchTokenLimitResponse>> {\n return this.marketDataApi.fetchTokenLimit(requestParameters);\n }\n\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card Binance API Documentation}\n */\n redeemABinanceGiftCard(\n requestParameters: RedeemABinanceGiftCardRequest\n ): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>> {\n return this.marketDataApi.redeemABinanceGiftCard(requestParameters);\n }\n\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number Binance API Documentation}\n */\n verifyBinanceGiftCardByGiftCardNumber(\n requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest\n ): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>> {\n return this.marketDataApi.verifyBinanceGiftCardByGiftCardNumber(requestParameters);\n }\n}\n","/**\n * Binance Gift Card REST API\n *\n * OpenAPI Specification for the Binance Gift Card 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, GIFT_CARD_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationGiftCard {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class GiftCard {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationGiftCard) {\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 || GIFT_CARD_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,iCAAiC,SAAU,eAAqC;AAClF,QAAO;EAsBH,0BAA0B,OACtB,WACA,WACA,iBACA,eACuB;AAEvB,2CAAkB,4BAA4B,aAAa,UAAU;AAErE,2CAAkB,4BAA4B,aAAa,UAAU;AAErE,2CAAkB,4BAA4B,mBAAmB,gBAAgB;GAEjF,MAAMA,yBAAkD,EAAE;AAE1D,OAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAG1C,OAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAG1C,OAAI,oBAAoB,UAAa,oBAAoB,KACrD,wBAAuB,qBAAqB;AAGhD,OAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;GAG3C,IAAIC;AACJ,OAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,UAAO;IACH,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,UAAU;IACb;;EAqBL,4BAA4B,OACxB,OACA,QACA,eACuB;AAEvB,2CAAkB,8BAA8B,SAAS,MAAM;AAE/D,2CAAkB,8BAA8B,UAAU,OAAO;GAEjE,MAAMD,yBAAkD,EAAE;AAE1D,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,kBAAkB,kBAAkB;;;;;;;;;;;;;;CAelE,gBACI,mBACiD;AACjD,SAAO,KAAK,cAAc,gBAAgB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;CAyBhE,uBACI,mBACwD;AACxD,SAAO,KAAK,cAAc,uBAAuB,kBAAkB;;;;;;;;;;;;;;;;CAiBvE,sCACI,mBACuE;AACvE,SAAO,KAAK,cAAc,sCAAsC,kBAAkB;;;;;;;;;;;;;AE5M1F,IAAa,WAAb,MAAsB;CAGlB,YAAY,QAA+B;EACvC,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>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","GIFT_CARD_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/gift-card.ts"],"sourcesContent":["{\n \"name\": \"@binance/giftcard\",\n \"description\": \"Official Binance Gift Card Connector - A lightweight library that provides a convenient interface to Binance's Gift Card REST API.\",\n \"version\": \"4.1.0\",\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 \"Gift Card\",\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.1.0\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Gift Card REST API\n *\n * OpenAPI Specification for the Binance Gift Card 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 CreateADualTokenGiftCardResponse,\n CreateASingleTokenGiftCardResponse,\n FetchRsaPublicKeyResponse,\n FetchTokenLimitResponse,\n RedeemABinanceGiftCardResponse,\n VerifyBinanceGiftCardByGiftCardNumberResponse,\n} from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {string} baseToken The token you want to pay, example: BUSD\n * @param {string} faceToken The token you want to buy, example: BNB. If faceToken = baseToken, it's the same as createCode endpoint.\n * @param {number} baseTokenAmount The base token asset quantity, example : 1.002\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n createADualTokenGiftCard: async (\n baseToken: string,\n faceToken: string,\n baseTokenAmount: number,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'baseToken' is not null or undefined\n assertParamExists('createADualTokenGiftCard', 'baseToken', baseToken);\n // verify required parameter 'faceToken' is not null or undefined\n assertParamExists('createADualTokenGiftCard', 'faceToken', faceToken);\n // verify required parameter 'baseTokenAmount' is not null or undefined\n assertParamExists('createADualTokenGiftCard', 'baseTokenAmount', baseTokenAmount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (baseToken !== undefined && baseToken !== null) {\n localVarQueryParameter['baseToken'] = baseToken;\n }\n if (faceToken !== undefined && faceToken !== null) {\n localVarQueryParameter['faceToken'] = faceToken;\n }\n if (baseTokenAmount !== undefined && baseTokenAmount !== null) {\n localVarQueryParameter['baseTokenAmount'] = baseTokenAmount;\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/giftcard/buyCode',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {string} token The token type contained in the Binance Gift Card\n * @param {number} amount The amount of the token contained in the Binance Gift Card\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n createASingleTokenGiftCard: async (\n token: string,\n amount: number,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'token' is not null or undefined\n assertParamExists('createASingleTokenGiftCard', 'token', token);\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('createASingleTokenGiftCard', 'amount', amount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (token !== undefined && token !== null) {\n localVarQueryParameter['token'] = token;\n }\n if (amount !== undefined && amount !== null) {\n localVarQueryParameter['amount'] = amount;\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/giftcard/createCode',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n fetchRsaPublicKey: async (recvWindow?: number | bigint): Promise<RequestArgs> => {\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 let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/giftcard/cryptography/rsa-public-key',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {string} baseToken The token you want to pay, example: BUSD\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n fetchTokenLimit: async (\n baseToken: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'baseToken' is not null or undefined\n assertParamExists('fetchTokenLimit', 'baseToken', baseToken);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (baseToken !== undefined && baseToken !== null) {\n localVarQueryParameter['baseToken'] = baseToken;\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/giftcard/buyCode/token-limit',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {string} code Redemption code of Binance Gift Card to be redeemed, supports both Plaintext & Encrypted code.\n * @param {string} [externalUid] Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner's daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance Gift Cards on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters).\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n redeemABinanceGiftCard: async (\n code: string,\n externalUid?: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'code' is not null or undefined\n assertParamExists('redeemABinanceGiftCard', 'code', code);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (code !== undefined && code !== null) {\n localVarQueryParameter['code'] = code;\n }\n if (externalUid !== undefined && externalUid !== null) {\n localVarQueryParameter['externalUid'] = externalUid;\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/giftcard/redeemCode',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {string} referenceNo Enter the Gift Card Number\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n verifyBinanceGiftCardByGiftCardNumber: async (\n referenceNo: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'referenceNo' is not null or undefined\n assertParamExists('verifyBinanceGiftCardByGiftCardNumber', 'referenceNo', referenceNo);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (referenceNo !== undefined && referenceNo !== null) {\n localVarQueryParameter['referenceNo'] = referenceNo;\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/giftcard/verify',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n createADualTokenGiftCard(\n requestParameters: CreateADualTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>;\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n createASingleTokenGiftCard(\n requestParameters: CreateASingleTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>;\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n fetchRsaPublicKey(\n requestParameters?: FetchRsaPublicKeyRequest\n ): Promise<RestApiResponse<FetchRsaPublicKeyResponse>>;\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {FetchTokenLimitRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n fetchTokenLimit(\n requestParameters: FetchTokenLimitRequest\n ): Promise<RestApiResponse<FetchTokenLimitResponse>>;\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n redeemABinanceGiftCard(\n requestParameters: RedeemABinanceGiftCardRequest\n ): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>;\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n verifyBinanceGiftCardByGiftCardNumber(\n requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest\n ): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>;\n}\n\n/**\n * Request parameters for createADualTokenGiftCard operation in MarketDataApi.\n * @interface CreateADualTokenGiftCardRequest\n */\nexport interface CreateADualTokenGiftCardRequest {\n /**\n * The token you want to pay, example: BUSD\n * @type {string}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly baseToken: string;\n\n /**\n * The token you want to buy, example: BNB. If faceToken = baseToken, it's the same as createCode endpoint.\n * @type {string}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly faceToken: string;\n\n /**\n * The base token asset quantity, example : 1.002\n * @type {number}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly baseTokenAmount: number;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for createASingleTokenGiftCard operation in MarketDataApi.\n * @interface CreateASingleTokenGiftCardRequest\n */\nexport interface CreateASingleTokenGiftCardRequest {\n /**\n * The token type contained in the Binance Gift Card\n * @type {string}\n * @memberof MarketDataApiCreateASingleTokenGiftCard\n */\n readonly token: string;\n\n /**\n * The amount of the token contained in the Binance Gift Card\n * @type {number}\n * @memberof MarketDataApiCreateASingleTokenGiftCard\n */\n readonly amount: number;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiCreateASingleTokenGiftCard\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for fetchRsaPublicKey operation in MarketDataApi.\n * @interface FetchRsaPublicKeyRequest\n */\nexport interface FetchRsaPublicKeyRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiFetchRsaPublicKey\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for fetchTokenLimit operation in MarketDataApi.\n * @interface FetchTokenLimitRequest\n */\nexport interface FetchTokenLimitRequest {\n /**\n * The token you want to pay, example: BUSD\n * @type {string}\n * @memberof MarketDataApiFetchTokenLimit\n */\n readonly baseToken: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiFetchTokenLimit\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for redeemABinanceGiftCard operation in MarketDataApi.\n * @interface RedeemABinanceGiftCardRequest\n */\nexport interface RedeemABinanceGiftCardRequest {\n /**\n * Redemption code of Binance Gift Card to be redeemed, supports both Plaintext & Encrypted code.\n * @type {string}\n * @memberof MarketDataApiRedeemABinanceGiftCard\n */\n readonly code: string;\n\n /**\n * Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner's daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance Gift Cards on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters).\n * @type {string}\n * @memberof MarketDataApiRedeemABinanceGiftCard\n */\n readonly externalUid?: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiRedeemABinanceGiftCard\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for verifyBinanceGiftCardByGiftCardNumber operation in MarketDataApi.\n * @interface VerifyBinanceGiftCardByGiftCardNumberRequest\n */\nexport interface VerifyBinanceGiftCardByGiftCardNumberRequest {\n /**\n * Enter the Gift Card Number\n * @type {string}\n * @memberof MarketDataApiVerifyBinanceGiftCardByGiftCardNumber\n */\n readonly referenceNo: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiVerifyBinanceGiftCardByGiftCardNumber\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * MarketDataApi - object-oriented interface\n * @class MarketDataApi\n */\nexport class MarketDataApi implements MarketDataApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);\n }\n\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-dual-token-gift-card Binance API Documentation}\n */\n public async createADualTokenGiftCard(\n requestParameters: CreateADualTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.createADualTokenGiftCard(\n requestParameters?.baseToken,\n requestParameters?.faceToken,\n requestParameters?.baseTokenAmount,\n requestParameters?.recvWindow\n );\n return sendRequest<CreateADualTokenGiftCardResponse>(\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 * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card Binance API Documentation}\n */\n public async createASingleTokenGiftCard(\n requestParameters: CreateASingleTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.createASingleTokenGiftCard(\n requestParameters?.token,\n requestParameters?.amount,\n requestParameters?.recvWindow\n );\n return sendRequest<CreateASingleTokenGiftCardResponse>(\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 * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<FetchRsaPublicKeyResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-RSA-Public-Key Binance API Documentation}\n */\n public async fetchRsaPublicKey(\n requestParameters: FetchRsaPublicKeyRequest = {}\n ): Promise<RestApiResponse<FetchRsaPublicKeyResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchRsaPublicKey(\n requestParameters?.recvWindow\n );\n return sendRequest<FetchRsaPublicKeyResponse>(\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 * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {FetchTokenLimitRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<FetchTokenLimitResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-Token-Limit Binance API Documentation}\n */\n public async fetchTokenLimit(\n requestParameters: FetchTokenLimitRequest\n ): Promise<RestApiResponse<FetchTokenLimitResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchTokenLimit(\n requestParameters?.baseToken,\n requestParameters?.recvWindow\n );\n return sendRequest<FetchTokenLimitResponse>(\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 * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card Binance API Documentation}\n */\n public async redeemABinanceGiftCard(\n requestParameters: RedeemABinanceGiftCardRequest\n ): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.redeemABinanceGiftCard(\n requestParameters?.code,\n requestParameters?.externalUid,\n requestParameters?.recvWindow\n );\n return sendRequest<RedeemABinanceGiftCardResponse>(\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 * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number Binance API Documentation}\n */\n public async verifyBinanceGiftCardByGiftCardNumber(\n requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest\n ): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.verifyBinanceGiftCardByGiftCardNumber(\n requestParameters?.referenceNo,\n requestParameters?.recvWindow\n );\n return sendRequest<VerifyBinanceGiftCardByGiftCardNumberResponse>(\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 Gift Card REST API\n *\n * OpenAPI Specification for the Binance Gift Card 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 { MarketDataApi } from './modules/market-data-api';\n\nimport type {\n CreateADualTokenGiftCardRequest,\n CreateASingleTokenGiftCardRequest,\n FetchRsaPublicKeyRequest,\n FetchTokenLimitRequest,\n RedeemABinanceGiftCardRequest,\n VerifyBinanceGiftCardByGiftCardNumberRequest,\n} from './modules/market-data-api';\n\nimport type {\n CreateADualTokenGiftCardResponse,\n CreateASingleTokenGiftCardResponse,\n FetchRsaPublicKeyResponse,\n FetchTokenLimitResponse,\n RedeemABinanceGiftCardResponse,\n VerifyBinanceGiftCardByGiftCardNumberResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(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 * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-dual-token-gift-card Binance API Documentation}\n */\n createADualTokenGiftCard(\n requestParameters: CreateADualTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>> {\n return this.marketDataApi.createADualTokenGiftCard(requestParameters);\n }\n\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card Binance API Documentation}\n */\n createASingleTokenGiftCard(\n requestParameters: CreateASingleTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>> {\n return this.marketDataApi.createASingleTokenGiftCard(requestParameters);\n }\n\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<FetchRsaPublicKeyResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-RSA-Public-Key Binance API Documentation}\n */\n fetchRsaPublicKey(\n requestParameters: FetchRsaPublicKeyRequest = {}\n ): Promise<RestApiResponse<FetchRsaPublicKeyResponse>> {\n return this.marketDataApi.fetchRsaPublicKey(requestParameters);\n }\n\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {FetchTokenLimitRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<FetchTokenLimitResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-Token-Limit Binance API Documentation}\n */\n fetchTokenLimit(\n requestParameters: FetchTokenLimitRequest\n ): Promise<RestApiResponse<FetchTokenLimitResponse>> {\n return this.marketDataApi.fetchTokenLimit(requestParameters);\n }\n\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card Binance API Documentation}\n */\n redeemABinanceGiftCard(\n requestParameters: RedeemABinanceGiftCardRequest\n ): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>> {\n return this.marketDataApi.redeemABinanceGiftCard(requestParameters);\n }\n\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number Binance API Documentation}\n */\n verifyBinanceGiftCardByGiftCardNumber(\n requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest\n ): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>> {\n return this.marketDataApi.verifyBinanceGiftCardByGiftCardNumber(requestParameters);\n }\n}\n","/**\n * Binance Gift Card REST API\n *\n * OpenAPI Specification for the Binance Gift Card 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, GIFT_CARD_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationGiftCard {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class GiftCard {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationGiftCard) {\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 || GIFT_CARD_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,iCAAiC,SAAU,eAAqC;AAClF,QAAO;EAsBH,0BAA0B,OACtB,WACA,WACA,iBACA,eACuB;AAEvB,2CAAkB,4BAA4B,aAAa,UAAU;AAErE,2CAAkB,4BAA4B,aAAa,UAAU;AAErE,2CAAkB,4BAA4B,mBAAmB,gBAAgB;GAEjF,MAAMA,yBAAkD,EAAE;GAC1D,MAAMC,wBAAiD,EAAE;AAEzD,OAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,OAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,OAAI,oBAAoB,UAAa,oBAAoB,KACrD,wBAAuB,qBAAqB;AAEhD,OAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;GAG3C,IAAIC;AACJ,OAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,UAAO;IACH,UAAU;IACV,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,UAAU;IACb;;EAqBL,4BAA4B,O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,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,OACH;;;;;;;;;;;CAYL,kBACI,UACA,QACA,cAAuC,EAAE,EACzC,aAAsC,EAAE,EACb;AAC3B,2CACI,KAAK,eACL,UACA,QACA,aACA,YACA,QACA,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;;;;;CAuBL,yBACI,mBAC0D;AAC1D,SAAO,KAAK,cAAc,yBAAyB,kBAAkB;;;;;;;;;;;;;;;;;;;;;CAsBzE,2BACI,mBAC4D;AAC5D,SAAO,KAAK,cAAc,2BAA2B,kBAAkB;;;;;;;;;;;;;;;;;CAkB3E,kBACI,oBAA8C,EAAE,EACG;AACnD,SAAO,KAAK,cAAc,kBAAkB,kBAAkB;;;;;;;;;;;;;;CAelE,gBACI,mBACiD;AACjD,SAAO,KAAK,cAAc,gBAAgB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;CAyBhE,uBACI,mBACwD;AACxD,SAAO,KAAK,cAAc,uBAAuB,kBAAkB;;;;;;;;;;;;;;;;CAiBvE,sCACI,mBACuE;AACvE,SAAO,KAAK,cAAc,sCAAsC,kBAAkB;;;;;;;;;;;;;AE7N1F,IAAa,WAAb,MAAsB;CAGlB,YAAY,QAA+B;EACvC,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, ForbiddenE
3
3
 
4
4
  //#region package.json
5
5
  var name = "@binance/giftcard";
6
- var version = "4.0.1";
6
+ var version = "4.1.0";
7
7
 
8
8
  //#endregion
9
9
  //#region src/rest-api/modules/market-data-api.ts
@@ -29,6 +29,7 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
29
29
  assertParamExists("createADualTokenGiftCard", "faceToken", faceToken);
30
30
  assertParamExists("createADualTokenGiftCard", "baseTokenAmount", baseTokenAmount);
31
31
  const localVarQueryParameter = {};
32
+ const localVarBodyParameter = {};
32
33
  if (baseToken !== void 0 && baseToken !== null) localVarQueryParameter["baseToken"] = baseToken;
33
34
  if (faceToken !== void 0 && faceToken !== null) localVarQueryParameter["faceToken"] = faceToken;
34
35
  if (baseTokenAmount !== void 0 && baseTokenAmount !== null) localVarQueryParameter["baseTokenAmount"] = baseTokenAmount;
@@ -38,7 +39,8 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
38
39
  return {
39
40
  endpoint: "/sapi/v1/giftcard/buyCode",
40
41
  method: "POST",
41
- params: localVarQueryParameter,
42
+ queryParams: localVarQueryParameter,
43
+ bodyParams: localVarBodyParameter,
42
44
  timeUnit: _timeUnit
43
45
  };
44
46
  },
@@ -46,6 +48,7 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
46
48
  assertParamExists("createASingleTokenGiftCard", "token", token);
47
49
  assertParamExists("createASingleTokenGiftCard", "amount", amount);
48
50
  const localVarQueryParameter = {};
51
+ const localVarBodyParameter = {};
49
52
  if (token !== void 0 && token !== null) localVarQueryParameter["token"] = token;
50
53
  if (amount !== void 0 && amount !== null) localVarQueryParameter["amount"] = amount;
51
54
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
@@ -54,25 +57,29 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
54
57
  return {
55
58
  endpoint: "/sapi/v1/giftcard/createCode",
56
59
  method: "POST",
57
- params: localVarQueryParameter,
60
+ queryParams: localVarQueryParameter,
61
+ bodyParams: localVarBodyParameter,
58
62
  timeUnit: _timeUnit
59
63
  };
60
64
  },
61
65
  fetchRsaPublicKey: async (recvWindow) => {
62
66
  const localVarQueryParameter = {};
67
+ const localVarBodyParameter = {};
63
68
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
64
69
  let _timeUnit;
65
70
  if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
66
71
  return {
67
72
  endpoint: "/sapi/v1/giftcard/cryptography/rsa-public-key",
68
73
  method: "GET",
69
- params: localVarQueryParameter,
74
+ queryParams: localVarQueryParameter,
75
+ bodyParams: localVarBodyParameter,
70
76
  timeUnit: _timeUnit
71
77
  };
72
78
  },
73
79
  fetchTokenLimit: async (baseToken, recvWindow) => {
74
80
  assertParamExists("fetchTokenLimit", "baseToken", baseToken);
75
81
  const localVarQueryParameter = {};
82
+ const localVarBodyParameter = {};
76
83
  if (baseToken !== void 0 && baseToken !== null) localVarQueryParameter["baseToken"] = baseToken;
77
84
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
78
85
  let _timeUnit;
@@ -80,13 +87,15 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
80
87
  return {
81
88
  endpoint: "/sapi/v1/giftcard/buyCode/token-limit",
82
89
  method: "GET",
83
- params: localVarQueryParameter,
90
+ queryParams: localVarQueryParameter,
91
+ bodyParams: localVarBodyParameter,
84
92
  timeUnit: _timeUnit
85
93
  };
86
94
  },
87
95
  redeemABinanceGiftCard: async (code, externalUid, recvWindow) => {
88
96
  assertParamExists("redeemABinanceGiftCard", "code", code);
89
97
  const localVarQueryParameter = {};
98
+ const localVarBodyParameter = {};
90
99
  if (code !== void 0 && code !== null) localVarQueryParameter["code"] = code;
91
100
  if (externalUid !== void 0 && externalUid !== null) localVarQueryParameter["externalUid"] = externalUid;
92
101
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
@@ -95,13 +104,15 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
95
104
  return {
96
105
  endpoint: "/sapi/v1/giftcard/redeemCode",
97
106
  method: "POST",
98
- params: localVarQueryParameter,
107
+ queryParams: localVarQueryParameter,
108
+ bodyParams: localVarBodyParameter,
99
109
  timeUnit: _timeUnit
100
110
  };
101
111
  },
102
112
  verifyBinanceGiftCardByGiftCardNumber: async (referenceNo, recvWindow) => {
103
113
  assertParamExists("verifyBinanceGiftCardByGiftCardNumber", "referenceNo", referenceNo);
104
114
  const localVarQueryParameter = {};
115
+ const localVarBodyParameter = {};
105
116
  if (referenceNo !== void 0 && referenceNo !== null) localVarQueryParameter["referenceNo"] = referenceNo;
106
117
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
107
118
  let _timeUnit;
@@ -109,7 +120,8 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
109
120
  return {
110
121
  endpoint: "/sapi/v1/giftcard/verify",
111
122
  method: "GET",
112
- params: localVarQueryParameter,
123
+ queryParams: localVarQueryParameter,
124
+ bodyParams: localVarBodyParameter,
113
125
  timeUnit: _timeUnit
114
126
  };
115
127
  }
@@ -146,7 +158,7 @@ var MarketDataApi = class {
146
158
  */
147
159
  async createADualTokenGiftCard(requestParameters) {
148
160
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.createADualTokenGiftCard(requestParameters?.baseToken, requestParameters?.faceToken, requestParameters?.baseTokenAmount, requestParameters?.recvWindow);
149
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
161
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
150
162
  }
151
163
  /**
152
164
  * This API is for creating a Binance Gift Card.
@@ -169,7 +181,7 @@ var MarketDataApi = class {
169
181
  */
170
182
  async createASingleTokenGiftCard(requestParameters) {
171
183
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.createASingleTokenGiftCard(requestParameters?.token, requestParameters?.amount, requestParameters?.recvWindow);
172
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
184
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
173
185
  }
174
186
  /**
175
187
  * This API is for fetching the RSA Public Key.
@@ -188,7 +200,7 @@ var MarketDataApi = class {
188
200
  */
189
201
  async fetchRsaPublicKey(requestParameters = {}) {
190
202
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchRsaPublicKey(requestParameters?.recvWindow);
191
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
203
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
192
204
  }
193
205
  /**
194
206
  * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.
@@ -204,7 +216,7 @@ var MarketDataApi = class {
204
216
  */
205
217
  async fetchTokenLimit(requestParameters) {
206
218
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchTokenLimit(requestParameters?.baseToken, requestParameters?.recvWindow);
207
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
219
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
208
220
  }
209
221
  /**
210
222
  * This API is for redeeming a Binance Gift Card
@@ -230,7 +242,7 @@ var MarketDataApi = class {
230
242
  */
231
243
  async redeemABinanceGiftCard(requestParameters) {
232
244
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.redeemABinanceGiftCard(requestParameters?.code, requestParameters?.externalUid, requestParameters?.recvWindow);
233
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
245
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
234
246
  }
235
247
  /**
236
248
  * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.
@@ -248,7 +260,7 @@ var MarketDataApi = class {
248
260
  */
249
261
  async verifyBinanceGiftCardByGiftCardNumber(requestParameters) {
250
262
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.verifyBinanceGiftCardByGiftCardNumber(requestParameters?.referenceNo, requestParameters?.recvWindow);
251
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
263
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
252
264
  }
253
265
  };
254
266
 
@@ -275,23 +287,25 @@ var RestAPI = class {
275
287
  * Generic function to send a request.
276
288
  * @param endpoint - The API endpoint to call.
277
289
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
278
- * @param params - Query parameters for the request.
290
+ * @param queryParams - Query parameters for the request.
291
+ * @param bodyParams - Body parameters for the request.
279
292
  *
280
293
  * @returns A promise resolving to the response data object.
281
294
  */
282
- sendRequest(endpoint, method, params = {}) {
283
- return sendRequest(this.configuration, endpoint, method, params, void 0);
295
+ sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
296
+ return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
284
297
  }
285
298
  /**
286
299
  * Generic function to send a signed request.
287
300
  * @param endpoint - The API endpoint to call.
288
301
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
289
- * @param params - Query parameters for the request.
302
+ * @param queryParams - Query parameters for the request.
303
+ * @param bodyParams - Body parameters for the request.
290
304
  *
291
305
  * @returns A promise resolving to the response data object.
292
306
  */
293
- sendSignedRequest(endpoint, method, params = {}) {
294
- return sendRequest(this.configuration, endpoint, method, params, void 0, { isSigned: true });
307
+ sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
308
+ return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
295
309
  }
296
310
  /**
297
311
  * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","GIFT_CARD_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/gift-card.ts"],"sourcesContent":["{\n \"name\": \"@binance/giftcard\",\n \"description\": \"Official Binance Gift Card Connector - A lightweight library that provides a convenient interface to Binance's Gift Card REST API.\",\n \"version\": \"4.0.1\",\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 \"Gift Card\",\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.0.1\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Gift Card REST API\n *\n * OpenAPI Specification for the Binance Gift Card 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 CreateADualTokenGiftCardResponse,\n CreateASingleTokenGiftCardResponse,\n FetchRsaPublicKeyResponse,\n FetchTokenLimitResponse,\n RedeemABinanceGiftCardResponse,\n VerifyBinanceGiftCardByGiftCardNumberResponse,\n} from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {string} baseToken The token you want to pay, example: BUSD\n * @param {string} faceToken The token you want to buy, example: BNB. If faceToken = baseToken, it's the same as createCode endpoint.\n * @param {number} baseTokenAmount The base token asset quantity, example : 1.002\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n createADualTokenGiftCard: async (\n baseToken: string,\n faceToken: string,\n baseTokenAmount: number,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'baseToken' is not null or undefined\n assertParamExists('createADualTokenGiftCard', 'baseToken', baseToken);\n // verify required parameter 'faceToken' is not null or undefined\n assertParamExists('createADualTokenGiftCard', 'faceToken', faceToken);\n // verify required parameter 'baseTokenAmount' is not null or undefined\n assertParamExists('createADualTokenGiftCard', 'baseTokenAmount', baseTokenAmount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (baseToken !== undefined && baseToken !== null) {\n localVarQueryParameter['baseToken'] = baseToken;\n }\n\n if (faceToken !== undefined && faceToken !== null) {\n localVarQueryParameter['faceToken'] = faceToken;\n }\n\n if (baseTokenAmount !== undefined && baseTokenAmount !== null) {\n localVarQueryParameter['baseTokenAmount'] = baseTokenAmount;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/giftcard/buyCode',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {string} token The token type contained in the Binance Gift Card\n * @param {number} amount The amount of the token contained in the Binance Gift Card\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n createASingleTokenGiftCard: async (\n token: string,\n amount: number,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'token' is not null or undefined\n assertParamExists('createASingleTokenGiftCard', 'token', token);\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('createASingleTokenGiftCard', 'amount', amount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (token !== undefined && token !== null) {\n localVarQueryParameter['token'] = token;\n }\n\n if (amount !== undefined && amount !== null) {\n localVarQueryParameter['amount'] = amount;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/giftcard/createCode',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n fetchRsaPublicKey: async (recvWindow?: number | bigint): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\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/giftcard/cryptography/rsa-public-key',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {string} baseToken The token you want to pay, example: BUSD\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n fetchTokenLimit: async (\n baseToken: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'baseToken' is not null or undefined\n assertParamExists('fetchTokenLimit', 'baseToken', baseToken);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (baseToken !== undefined && baseToken !== null) {\n localVarQueryParameter['baseToken'] = baseToken;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/giftcard/buyCode/token-limit',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {string} code Redemption code of Binance Gift Card to be redeemed, supports both Plaintext & Encrypted code.\n * @param {string} [externalUid] Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner's daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance Gift Cards on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters).\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n redeemABinanceGiftCard: async (\n code: string,\n externalUid?: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'code' is not null or undefined\n assertParamExists('redeemABinanceGiftCard', 'code', code);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (code !== undefined && code !== null) {\n localVarQueryParameter['code'] = code;\n }\n\n if (externalUid !== undefined && externalUid !== null) {\n localVarQueryParameter['externalUid'] = externalUid;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/giftcard/redeemCode',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {string} referenceNo Enter the Gift Card Number\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n verifyBinanceGiftCardByGiftCardNumber: async (\n referenceNo: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'referenceNo' is not null or undefined\n assertParamExists('verifyBinanceGiftCardByGiftCardNumber', 'referenceNo', referenceNo);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (referenceNo !== undefined && referenceNo !== null) {\n localVarQueryParameter['referenceNo'] = referenceNo;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/giftcard/verify',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n createADualTokenGiftCard(\n requestParameters: CreateADualTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>;\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n createASingleTokenGiftCard(\n requestParameters: CreateASingleTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>;\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n fetchRsaPublicKey(\n requestParameters?: FetchRsaPublicKeyRequest\n ): Promise<RestApiResponse<FetchRsaPublicKeyResponse>>;\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {FetchTokenLimitRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n fetchTokenLimit(\n requestParameters: FetchTokenLimitRequest\n ): Promise<RestApiResponse<FetchTokenLimitResponse>>;\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n redeemABinanceGiftCard(\n requestParameters: RedeemABinanceGiftCardRequest\n ): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>;\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n verifyBinanceGiftCardByGiftCardNumber(\n requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest\n ): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>;\n}\n\n/**\n * Request parameters for createADualTokenGiftCard operation in MarketDataApi.\n * @interface CreateADualTokenGiftCardRequest\n */\nexport interface CreateADualTokenGiftCardRequest {\n /**\n * The token you want to pay, example: BUSD\n * @type {string}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly baseToken: string;\n\n /**\n * The token you want to buy, example: BNB. If faceToken = baseToken, it's the same as createCode endpoint.\n * @type {string}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly faceToken: string;\n\n /**\n * The base token asset quantity, example : 1.002\n * @type {number}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly baseTokenAmount: number;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for createASingleTokenGiftCard operation in MarketDataApi.\n * @interface CreateASingleTokenGiftCardRequest\n */\nexport interface CreateASingleTokenGiftCardRequest {\n /**\n * The token type contained in the Binance Gift Card\n * @type {string}\n * @memberof MarketDataApiCreateASingleTokenGiftCard\n */\n readonly token: string;\n\n /**\n * The amount of the token contained in the Binance Gift Card\n * @type {number}\n * @memberof MarketDataApiCreateASingleTokenGiftCard\n */\n readonly amount: number;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiCreateASingleTokenGiftCard\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for fetchRsaPublicKey operation in MarketDataApi.\n * @interface FetchRsaPublicKeyRequest\n */\nexport interface FetchRsaPublicKeyRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiFetchRsaPublicKey\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for fetchTokenLimit operation in MarketDataApi.\n * @interface FetchTokenLimitRequest\n */\nexport interface FetchTokenLimitRequest {\n /**\n * The token you want to pay, example: BUSD\n * @type {string}\n * @memberof MarketDataApiFetchTokenLimit\n */\n readonly baseToken: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiFetchTokenLimit\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for redeemABinanceGiftCard operation in MarketDataApi.\n * @interface RedeemABinanceGiftCardRequest\n */\nexport interface RedeemABinanceGiftCardRequest {\n /**\n * Redemption code of Binance Gift Card to be redeemed, supports both Plaintext & Encrypted code.\n * @type {string}\n * @memberof MarketDataApiRedeemABinanceGiftCard\n */\n readonly code: string;\n\n /**\n * Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner's daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance Gift Cards on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters).\n * @type {string}\n * @memberof MarketDataApiRedeemABinanceGiftCard\n */\n readonly externalUid?: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiRedeemABinanceGiftCard\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for verifyBinanceGiftCardByGiftCardNumber operation in MarketDataApi.\n * @interface VerifyBinanceGiftCardByGiftCardNumberRequest\n */\nexport interface VerifyBinanceGiftCardByGiftCardNumberRequest {\n /**\n * Enter the Gift Card Number\n * @type {string}\n * @memberof MarketDataApiVerifyBinanceGiftCardByGiftCardNumber\n */\n readonly referenceNo: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiVerifyBinanceGiftCardByGiftCardNumber\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * MarketDataApi - object-oriented interface\n * @class MarketDataApi\n */\nexport class MarketDataApi implements MarketDataApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);\n }\n\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-dual-token-gift-card Binance API Documentation}\n */\n public async createADualTokenGiftCard(\n requestParameters: CreateADualTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.createADualTokenGiftCard(\n requestParameters?.baseToken,\n requestParameters?.faceToken,\n requestParameters?.baseTokenAmount,\n requestParameters?.recvWindow\n );\n return sendRequest<CreateADualTokenGiftCardResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card Binance API Documentation}\n */\n public async createASingleTokenGiftCard(\n requestParameters: CreateASingleTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.createASingleTokenGiftCard(\n requestParameters?.token,\n requestParameters?.amount,\n requestParameters?.recvWindow\n );\n return sendRequest<CreateASingleTokenGiftCardResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<FetchRsaPublicKeyResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-RSA-Public-Key Binance API Documentation}\n */\n public async fetchRsaPublicKey(\n requestParameters: FetchRsaPublicKeyRequest = {}\n ): Promise<RestApiResponse<FetchRsaPublicKeyResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchRsaPublicKey(\n requestParameters?.recvWindow\n );\n return sendRequest<FetchRsaPublicKeyResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {FetchTokenLimitRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<FetchTokenLimitResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-Token-Limit Binance API Documentation}\n */\n public async fetchTokenLimit(\n requestParameters: FetchTokenLimitRequest\n ): Promise<RestApiResponse<FetchTokenLimitResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchTokenLimit(\n requestParameters?.baseToken,\n requestParameters?.recvWindow\n );\n return sendRequest<FetchTokenLimitResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card Binance API Documentation}\n */\n public async redeemABinanceGiftCard(\n requestParameters: RedeemABinanceGiftCardRequest\n ): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.redeemABinanceGiftCard(\n requestParameters?.code,\n requestParameters?.externalUid,\n requestParameters?.recvWindow\n );\n return sendRequest<RedeemABinanceGiftCardResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number Binance API Documentation}\n */\n public async verifyBinanceGiftCardByGiftCardNumber(\n requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest\n ): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.verifyBinanceGiftCardByGiftCardNumber(\n requestParameters?.referenceNo,\n requestParameters?.recvWindow\n );\n return sendRequest<VerifyBinanceGiftCardByGiftCardNumberResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Gift Card REST API\n *\n * OpenAPI Specification for the Binance Gift Card 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 { MarketDataApi } from './modules/market-data-api';\n\nimport type {\n CreateADualTokenGiftCardRequest,\n CreateASingleTokenGiftCardRequest,\n FetchRsaPublicKeyRequest,\n FetchTokenLimitRequest,\n RedeemABinanceGiftCardRequest,\n VerifyBinanceGiftCardByGiftCardNumberRequest,\n} from './modules/market-data-api';\n\nimport type {\n CreateADualTokenGiftCardResponse,\n CreateASingleTokenGiftCardResponse,\n FetchRsaPublicKeyResponse,\n FetchTokenLimitResponse,\n RedeemABinanceGiftCardResponse,\n VerifyBinanceGiftCardByGiftCardNumberResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param params - Query parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined);\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param params - Query parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined, {\n isSigned: true,\n });\n }\n\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-dual-token-gift-card Binance API Documentation}\n */\n createADualTokenGiftCard(\n requestParameters: CreateADualTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>> {\n return this.marketDataApi.createADualTokenGiftCard(requestParameters);\n }\n\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card Binance API Documentation}\n */\n createASingleTokenGiftCard(\n requestParameters: CreateASingleTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>> {\n return this.marketDataApi.createASingleTokenGiftCard(requestParameters);\n }\n\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<FetchRsaPublicKeyResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-RSA-Public-Key Binance API Documentation}\n */\n fetchRsaPublicKey(\n requestParameters: FetchRsaPublicKeyRequest = {}\n ): Promise<RestApiResponse<FetchRsaPublicKeyResponse>> {\n return this.marketDataApi.fetchRsaPublicKey(requestParameters);\n }\n\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {FetchTokenLimitRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<FetchTokenLimitResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-Token-Limit Binance API Documentation}\n */\n fetchTokenLimit(\n requestParameters: FetchTokenLimitRequest\n ): Promise<RestApiResponse<FetchTokenLimitResponse>> {\n return this.marketDataApi.fetchTokenLimit(requestParameters);\n }\n\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card Binance API Documentation}\n */\n redeemABinanceGiftCard(\n requestParameters: RedeemABinanceGiftCardRequest\n ): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>> {\n return this.marketDataApi.redeemABinanceGiftCard(requestParameters);\n }\n\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number Binance API Documentation}\n */\n verifyBinanceGiftCardByGiftCardNumber(\n requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest\n ): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>> {\n return this.marketDataApi.verifyBinanceGiftCardByGiftCardNumber(requestParameters);\n }\n}\n","/**\n * Binance Gift Card REST API\n *\n * OpenAPI Specification for the Binance Gift Card 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, GIFT_CARD_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationGiftCard {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class GiftCard {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationGiftCard) {\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 || GIFT_CARD_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,iCAA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AAE;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>","_timeUnit: TimeUnit | undefined","GIFT_CARD_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/gift-card.ts"],"sourcesContent":["{\n \"name\": \"@binance/giftcard\",\n \"description\": \"Official Binance Gift Card Connector - A lightweight library that provides a convenient interface to Binance's Gift Card REST API.\",\n \"version\": \"4.1.0\",\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 \"Gift Card\",\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.1.0\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Gift Card REST API\n *\n * OpenAPI Specification for the Binance Gift Card 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 CreateADualTokenGiftCardResponse,\n CreateASingleTokenGiftCardResponse,\n FetchRsaPublicKeyResponse,\n FetchTokenLimitResponse,\n RedeemABinanceGiftCardResponse,\n VerifyBinanceGiftCardByGiftCardNumberResponse,\n} from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {string} baseToken The token you want to pay, example: BUSD\n * @param {string} faceToken The token you want to buy, example: BNB. If faceToken = baseToken, it's the same as createCode endpoint.\n * @param {number} baseTokenAmount The base token asset quantity, example : 1.002\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n createADualTokenGiftCard: async (\n baseToken: string,\n faceToken: string,\n baseTokenAmount: number,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'baseToken' is not null or undefined\n assertParamExists('createADualTokenGiftCard', 'baseToken', baseToken);\n // verify required parameter 'faceToken' is not null or undefined\n assertParamExists('createADualTokenGiftCard', 'faceToken', faceToken);\n // verify required parameter 'baseTokenAmount' is not null or undefined\n assertParamExists('createADualTokenGiftCard', 'baseTokenAmount', baseTokenAmount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (baseToken !== undefined && baseToken !== null) {\n localVarQueryParameter['baseToken'] = baseToken;\n }\n if (faceToken !== undefined && faceToken !== null) {\n localVarQueryParameter['faceToken'] = faceToken;\n }\n if (baseTokenAmount !== undefined && baseTokenAmount !== null) {\n localVarQueryParameter['baseTokenAmount'] = baseTokenAmount;\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/giftcard/buyCode',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {string} token The token type contained in the Binance Gift Card\n * @param {number} amount The amount of the token contained in the Binance Gift Card\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n createASingleTokenGiftCard: async (\n token: string,\n amount: number,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'token' is not null or undefined\n assertParamExists('createASingleTokenGiftCard', 'token', token);\n // verify required parameter 'amount' is not null or undefined\n assertParamExists('createASingleTokenGiftCard', 'amount', amount);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (token !== undefined && token !== null) {\n localVarQueryParameter['token'] = token;\n }\n if (amount !== undefined && amount !== null) {\n localVarQueryParameter['amount'] = amount;\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/giftcard/createCode',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n fetchRsaPublicKey: async (recvWindow?: number | bigint): Promise<RequestArgs> => {\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 let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/giftcard/cryptography/rsa-public-key',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {string} baseToken The token you want to pay, example: BUSD\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n fetchTokenLimit: async (\n baseToken: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'baseToken' is not null or undefined\n assertParamExists('fetchTokenLimit', 'baseToken', baseToken);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (baseToken !== undefined && baseToken !== null) {\n localVarQueryParameter['baseToken'] = baseToken;\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/giftcard/buyCode/token-limit',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {string} code Redemption code of Binance Gift Card to be redeemed, supports both Plaintext & Encrypted code.\n * @param {string} [externalUid] Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner's daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance Gift Cards on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters).\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n redeemABinanceGiftCard: async (\n code: string,\n externalUid?: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'code' is not null or undefined\n assertParamExists('redeemABinanceGiftCard', 'code', code);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (code !== undefined && code !== null) {\n localVarQueryParameter['code'] = code;\n }\n if (externalUid !== undefined && externalUid !== null) {\n localVarQueryParameter['externalUid'] = externalUid;\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/giftcard/redeemCode',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {string} referenceNo Enter the Gift Card Number\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n verifyBinanceGiftCardByGiftCardNumber: async (\n referenceNo: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'referenceNo' is not null or undefined\n assertParamExists('verifyBinanceGiftCardByGiftCardNumber', 'referenceNo', referenceNo);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (referenceNo !== undefined && referenceNo !== null) {\n localVarQueryParameter['referenceNo'] = referenceNo;\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/giftcard/verify',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n createADualTokenGiftCard(\n requestParameters: CreateADualTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>;\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n createASingleTokenGiftCard(\n requestParameters: CreateASingleTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>;\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n fetchRsaPublicKey(\n requestParameters?: FetchRsaPublicKeyRequest\n ): Promise<RestApiResponse<FetchRsaPublicKeyResponse>>;\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {FetchTokenLimitRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n fetchTokenLimit(\n requestParameters: FetchTokenLimitRequest\n ): Promise<RestApiResponse<FetchTokenLimitResponse>>;\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n redeemABinanceGiftCard(\n requestParameters: RedeemABinanceGiftCardRequest\n ): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>;\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n verifyBinanceGiftCardByGiftCardNumber(\n requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest\n ): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>;\n}\n\n/**\n * Request parameters for createADualTokenGiftCard operation in MarketDataApi.\n * @interface CreateADualTokenGiftCardRequest\n */\nexport interface CreateADualTokenGiftCardRequest {\n /**\n * The token you want to pay, example: BUSD\n * @type {string}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly baseToken: string;\n\n /**\n * The token you want to buy, example: BNB. If faceToken = baseToken, it's the same as createCode endpoint.\n * @type {string}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly faceToken: string;\n\n /**\n * The base token asset quantity, example : 1.002\n * @type {number}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly baseTokenAmount: number;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiCreateADualTokenGiftCard\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for createASingleTokenGiftCard operation in MarketDataApi.\n * @interface CreateASingleTokenGiftCardRequest\n */\nexport interface CreateASingleTokenGiftCardRequest {\n /**\n * The token type contained in the Binance Gift Card\n * @type {string}\n * @memberof MarketDataApiCreateASingleTokenGiftCard\n */\n readonly token: string;\n\n /**\n * The amount of the token contained in the Binance Gift Card\n * @type {number}\n * @memberof MarketDataApiCreateASingleTokenGiftCard\n */\n readonly amount: number;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiCreateASingleTokenGiftCard\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for fetchRsaPublicKey operation in MarketDataApi.\n * @interface FetchRsaPublicKeyRequest\n */\nexport interface FetchRsaPublicKeyRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiFetchRsaPublicKey\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for fetchTokenLimit operation in MarketDataApi.\n * @interface FetchTokenLimitRequest\n */\nexport interface FetchTokenLimitRequest {\n /**\n * The token you want to pay, example: BUSD\n * @type {string}\n * @memberof MarketDataApiFetchTokenLimit\n */\n readonly baseToken: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiFetchTokenLimit\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for redeemABinanceGiftCard operation in MarketDataApi.\n * @interface RedeemABinanceGiftCardRequest\n */\nexport interface RedeemABinanceGiftCardRequest {\n /**\n * Redemption code of Binance Gift Card to be redeemed, supports both Plaintext & Encrypted code.\n * @type {string}\n * @memberof MarketDataApiRedeemABinanceGiftCard\n */\n readonly code: string;\n\n /**\n * Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner's daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance Gift Cards on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters).\n * @type {string}\n * @memberof MarketDataApiRedeemABinanceGiftCard\n */\n readonly externalUid?: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiRedeemABinanceGiftCard\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for verifyBinanceGiftCardByGiftCardNumber operation in MarketDataApi.\n * @interface VerifyBinanceGiftCardByGiftCardNumberRequest\n */\nexport interface VerifyBinanceGiftCardByGiftCardNumberRequest {\n /**\n * Enter the Gift Card Number\n * @type {string}\n * @memberof MarketDataApiVerifyBinanceGiftCardByGiftCardNumber\n */\n readonly referenceNo: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof MarketDataApiVerifyBinanceGiftCardByGiftCardNumber\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * MarketDataApi - object-oriented interface\n * @class MarketDataApi\n */\nexport class MarketDataApi implements MarketDataApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);\n }\n\n /**\n * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-dual-token-gift-card Binance API Documentation}\n */\n public async createADualTokenGiftCard(\n requestParameters: CreateADualTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.createADualTokenGiftCard(\n requestParameters?.baseToken,\n requestParameters?.faceToken,\n requestParameters?.baseTokenAmount,\n requestParameters?.recvWindow\n );\n return sendRequest<CreateADualTokenGiftCardResponse>(\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 * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card Binance API Documentation}\n */\n public async createASingleTokenGiftCard(\n requestParameters: CreateASingleTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.createASingleTokenGiftCard(\n requestParameters?.token,\n requestParameters?.amount,\n requestParameters?.recvWindow\n );\n return sendRequest<CreateASingleTokenGiftCardResponse>(\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 * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<FetchRsaPublicKeyResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-RSA-Public-Key Binance API Documentation}\n */\n public async fetchRsaPublicKey(\n requestParameters: FetchRsaPublicKeyRequest = {}\n ): Promise<RestApiResponse<FetchRsaPublicKeyResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchRsaPublicKey(\n requestParameters?.recvWindow\n );\n return sendRequest<FetchRsaPublicKeyResponse>(\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 * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {FetchTokenLimitRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<FetchTokenLimitResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-Token-Limit Binance API Documentation}\n */\n public async fetchTokenLimit(\n requestParameters: FetchTokenLimitRequest\n ): Promise<RestApiResponse<FetchTokenLimitResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchTokenLimit(\n requestParameters?.baseToken,\n requestParameters?.recvWindow\n );\n return sendRequest<FetchTokenLimitResponse>(\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 * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card Binance API Documentation}\n */\n public async redeemABinanceGiftCard(\n requestParameters: RedeemABinanceGiftCardRequest\n ): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.redeemABinanceGiftCard(\n requestParameters?.code,\n requestParameters?.externalUid,\n requestParameters?.recvWindow\n );\n return sendRequest<RedeemABinanceGiftCardResponse>(\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 * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number Binance API Documentation}\n */\n public async verifyBinanceGiftCardByGiftCardNumber(\n requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest\n ): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.verifyBinanceGiftCardByGiftCardNumber(\n requestParameters?.referenceNo,\n requestParameters?.recvWindow\n );\n return sendRequest<VerifyBinanceGiftCardByGiftCardNumberResponse>(\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 Gift Card REST API\n *\n * OpenAPI Specification for the Binance Gift Card 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 { MarketDataApi } from './modules/market-data-api';\n\nimport type {\n CreateADualTokenGiftCardRequest,\n CreateASingleTokenGiftCardRequest,\n FetchRsaPublicKeyRequest,\n FetchTokenLimitRequest,\n RedeemABinanceGiftCardRequest,\n VerifyBinanceGiftCardByGiftCardNumberRequest,\n} from './modules/market-data-api';\n\nimport type {\n CreateADualTokenGiftCardResponse,\n CreateASingleTokenGiftCardResponse,\n FetchRsaPublicKeyResponse,\n FetchTokenLimitResponse,\n RedeemABinanceGiftCardResponse,\n VerifyBinanceGiftCardByGiftCardNumberResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(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 * * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.\n * Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your funding wallet.\n *\n *\n * To get started with, please make sure:\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need Enable Withdrawals for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)\n * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-dual-token-gift-card Binance API Documentation}\n */\n createADualTokenGiftCard(\n requestParameters: CreateADualTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>> {\n return this.marketDataApi.createADualTokenGiftCard(requestParameters);\n }\n\n /**\n * This API is for creating a Binance Gift Card.\n *\n * To get started with, please make sure:\n *\n * You have a Binance account\n * You have passed KYB\n * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet\n * You need `Enable Withdrawals` for the API Key which requests this endpoint.\n *\n * Weight: 1\n *\n * @summary Create a single-token gift card (USER_DATA)\n * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card Binance API Documentation}\n */\n createASingleTokenGiftCard(\n requestParameters: CreateASingleTokenGiftCardRequest\n ): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>> {\n return this.marketDataApi.createASingleTokenGiftCard(requestParameters);\n }\n\n /**\n * This API is for fetching the RSA Public Key.\n * This RSA Public key will be used to encrypt the card code.\n *\n **Please note that the RSA Public key fetched is valid only for the current day.**\n *\n * Weight: 1\n *\n * @summary Fetch RSA Public Key(USER_DATA)\n * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<FetchRsaPublicKeyResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-RSA-Public-Key Binance API Documentation}\n */\n fetchRsaPublicKey(\n requestParameters: FetchRsaPublicKeyRequest = {}\n ): Promise<RestApiResponse<FetchRsaPublicKeyResponse>> {\n return this.marketDataApi.fetchRsaPublicKey(requestParameters);\n }\n\n /**\n * This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.\n *\n * Weight: 1\n *\n * @summary Fetch Token Limit(USER_DATA)\n * @param {FetchTokenLimitRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<FetchTokenLimitResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-Token-Limit Binance API Documentation}\n */\n fetchTokenLimit(\n requestParameters: FetchTokenLimitRequest\n ): Promise<RestApiResponse<FetchTokenLimitResponse>> {\n return this.marketDataApi.fetchTokenLimit(requestParameters);\n }\n\n /**\n * This API is for redeeming a Binance Gift Card\n * Once redeemed, the coins will be deposited in your funding wallet.\n *\n * Parameter code can be sent in two formats:\n * Plaintext\n * Encrypted\n *\n * Sending code in Encrypted format provides more security than sending it as a plaintext. To send card code in encrypted format the following steps must be followed:\n * Fetch RSA public key from api stated below.\n * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`\n **A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:**\n *\n * Weight: 1\n *\n * @summary Redeem a Binance Gift Card(USER_DATA)\n * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card Binance API Documentation}\n */\n redeemABinanceGiftCard(\n requestParameters: RedeemABinanceGiftCardRequest\n ): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>> {\n return this.marketDataApi.redeemABinanceGiftCard(requestParameters);\n }\n\n /**\n * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.\n *\n **Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.**\n *\n * Weight: 1\n *\n * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)\n * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number Binance API Documentation}\n */\n verifyBinanceGiftCardByGiftCardNumber(\n requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest\n ): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>> {\n return this.marketDataApi.verifyBinanceGiftCardByGiftCardNumber(requestParameters);\n }\n}\n","/**\n * Binance Gift Card REST API\n *\n * OpenAPI Specification for the Binance Gift Card 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, GIFT_CARD_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationGiftCard {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class GiftCard {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationGiftCard) {\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 || GIFT_CARD_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this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D;AACjD,SAAO,KAAK,cAAc,gBAAgB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;CAyBhE,uBACI,mBACwD;AACxD,SAAO,KAAK,cAAc,uBAAuB,kBAAkB;;;;;;;;;;;;;;;;CAiBvE,sCACI,mBACuE;AACvE,SAAO,KAAK,cAAc,sCAAsC,kBAAkB;;;;;;;;;;;;;AE7N1F,IAAa,WAAb,MAAsB;CAGlB,YAAY,QAA+B;EACvC,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"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@binance/giftcard",
3
3
  "description": "Official Binance Gift Card Connector - A lightweight library that provides a convenient interface to Binance's Gift Card REST API.",
4
- "version": "4.0.1",
4
+ "version": "4.1.0",
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.0.1",
59
+ "@binance/common": "2.1.0",
60
60
  "axios": "^1.7.4"
61
61
  }
62
62
  }