@binance/giftcard 4.1.17 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/index.d.mts +152 -102
- package/dist/index.d.ts +152 -102
- package/dist/index.js +97 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +97 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -14,14 +14,14 @@ let __binance_common = require("@binance/common");
|
|
|
14
14
|
|
|
15
15
|
//#region package.json
|
|
16
16
|
var name = "@binance/giftcard";
|
|
17
|
-
var version = "
|
|
17
|
+
var version = "5.0.1";
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/rest-api/modules/market-data-api.ts
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Gift Card REST API
|
|
23
23
|
*
|
|
24
|
-
*
|
|
24
|
+
* Create, redeem, and check the value of Binance crypto gift cards.
|
|
25
25
|
*
|
|
26
26
|
* The version of the OpenAPI document: 1.0.0
|
|
27
27
|
*
|
|
@@ -160,24 +160,29 @@ var MarketDataApi = class {
|
|
|
160
160
|
this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
|
-
* * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card
|
|
164
|
-
*
|
|
165
|
-
*
|
|
163
|
+
* * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card
|
|
164
|
+
* using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create
|
|
165
|
+
* a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at
|
|
166
|
+
* 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.
|
|
166
167
|
*
|
|
168
|
+
* Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee
|
|
169
|
+
* would be deducted from your funding wallet.
|
|
167
170
|
* To get started with, please make sure:
|
|
168
171
|
* You have a Binance account
|
|
169
172
|
* You have passed KYB
|
|
170
173
|
* You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet
|
|
171
174
|
* You need Enable Withdrawals for the API Key which requests this endpoint.
|
|
172
175
|
*
|
|
173
|
-
* Weight: 1
|
|
176
|
+
* Weight(IP): 1
|
|
177
|
+
*
|
|
178
|
+
* Security Type: TRADE
|
|
174
179
|
*
|
|
175
|
-
* @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)
|
|
180
|
+
* @summary Create a dual-token gift card (fixed value, discount feature) (TRADE)
|
|
176
181
|
* @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.
|
|
177
182
|
* @returns {Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>}
|
|
178
183
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
179
184
|
* @memberof MarketDataApi
|
|
180
|
-
* @see {@link https://developers.binance.com/docs/
|
|
185
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#create-adual-token-gift-card Binance API Documentation}
|
|
181
186
|
*/
|
|
182
187
|
async createADualTokenGiftCard(requestParameters) {
|
|
183
188
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.createADualTokenGiftCard(requestParameters?.baseToken, requestParameters?.faceToken, requestParameters?.baseTokenAmount, requestParameters?.recvWindow);
|
|
@@ -187,20 +192,21 @@ var MarketDataApi = class {
|
|
|
187
192
|
* This API is for creating a Binance Gift Card.
|
|
188
193
|
*
|
|
189
194
|
* To get started with, please make sure:
|
|
190
|
-
*
|
|
191
195
|
* You have a Binance account
|
|
192
196
|
* You have passed KYB
|
|
193
197
|
* You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet
|
|
194
198
|
* You need `Enable Withdrawals` for the API Key which requests this endpoint.
|
|
195
199
|
*
|
|
196
|
-
* Weight: 1
|
|
200
|
+
* Weight(IP): 1
|
|
201
|
+
*
|
|
202
|
+
* Security Type: USER_DATA
|
|
197
203
|
*
|
|
198
204
|
* @summary Create a single-token gift card (USER_DATA)
|
|
199
205
|
* @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.
|
|
200
206
|
* @returns {Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>}
|
|
201
207
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
202
208
|
* @memberof MarketDataApi
|
|
203
|
-
* @see {@link https://developers.binance.com/docs/
|
|
209
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#create-asingle-token-gift-card Binance API Documentation}
|
|
204
210
|
*/
|
|
205
211
|
async createASingleTokenGiftCard(requestParameters) {
|
|
206
212
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.createASingleTokenGiftCard(requestParameters?.token, requestParameters?.amount, requestParameters?.recvWindow);
|
|
@@ -212,56 +218,61 @@ var MarketDataApi = class {
|
|
|
212
218
|
*
|
|
213
219
|
**Please note that the RSA Public key fetched is valid only for the current day.**
|
|
214
220
|
*
|
|
215
|
-
* Weight: 1
|
|
221
|
+
* Weight(IP): 1
|
|
216
222
|
*
|
|
217
|
-
*
|
|
223
|
+
* Security Type: USER_DATA
|
|
224
|
+
*
|
|
225
|
+
* @summary Fetch RSA Public Key (USER_DATA)
|
|
218
226
|
* @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.
|
|
219
227
|
* @returns {Promise<RestApiResponse<FetchRsaPublicKeyResponse>>}
|
|
220
228
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
221
229
|
* @memberof MarketDataApi
|
|
222
|
-
* @see {@link https://developers.binance.com/docs/
|
|
230
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#fetch-rsa-public-key Binance API Documentation}
|
|
223
231
|
*/
|
|
224
232
|
async fetchRsaPublicKey(requestParameters = {}) {
|
|
225
233
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchRsaPublicKey(requestParameters?.recvWindow);
|
|
226
234
|
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
227
235
|
}
|
|
228
236
|
/**
|
|
229
|
-
* This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as
|
|
237
|
+
* This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as
|
|
238
|
+
* mentioned in section 2 and its’ limitation.
|
|
239
|
+
*
|
|
240
|
+
* Weight(IP): 1
|
|
230
241
|
*
|
|
231
|
-
*
|
|
242
|
+
* Security Type: USER_DATA
|
|
232
243
|
*
|
|
233
|
-
* @summary Fetch Token Limit(USER_DATA)
|
|
244
|
+
* @summary Fetch Token Limit (USER_DATA)
|
|
234
245
|
* @param {FetchTokenLimitRequest} requestParameters Request parameters.
|
|
235
246
|
* @returns {Promise<RestApiResponse<FetchTokenLimitResponse>>}
|
|
236
247
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
237
248
|
* @memberof MarketDataApi
|
|
238
|
-
* @see {@link https://developers.binance.com/docs/
|
|
249
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#fetch-token-limit Binance API Documentation}
|
|
239
250
|
*/
|
|
240
251
|
async fetchTokenLimit(requestParameters) {
|
|
241
252
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.fetchTokenLimit(requestParameters?.baseToken, requestParameters?.recvWindow);
|
|
242
253
|
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
243
254
|
}
|
|
244
255
|
/**
|
|
245
|
-
* This API is for redeeming a Binance Gift Card
|
|
246
|
-
* Once redeemed, the coins will be deposited in your funding wallet.
|
|
256
|
+
* This API is for redeeming a Binance Gift Card. Once redeemed, the coins will be deposited in your funding wallet.
|
|
247
257
|
*
|
|
248
|
-
*
|
|
249
|
-
* Plaintext
|
|
250
|
-
* Encrypted
|
|
258
|
+
* Weight(IP): 1
|
|
251
259
|
*
|
|
252
|
-
*
|
|
253
|
-
* Fetch RSA public key from api stated below.
|
|
254
|
-
* Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`
|
|
255
|
-
**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.:**
|
|
260
|
+
* Security Type: USER_DATA
|
|
256
261
|
*
|
|
257
|
-
*
|
|
262
|
+
* Notes:
|
|
263
|
+
* - Parameter `code` can be sent in two formats: `Plaintext` and `Encrypted`.
|
|
264
|
+
* - Sending `code` in encrypted format is more secure than plaintext.
|
|
265
|
+
* - To send encrypted `code`:
|
|
266
|
+
* - Fetch RSA public key from `GET /sapi/v1/giftcard/cryptography/rsa-public-key`.
|
|
267
|
+
* - Encrypt card code using `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`.
|
|
268
|
+
* - If you enter the wrong redemption code 5 times within 24 hours, you will no longer be able to redeem any Binance Gift Cards that day.
|
|
258
269
|
*
|
|
259
|
-
* @summary Redeem a Binance Gift Card(USER_DATA)
|
|
270
|
+
* @summary Redeem a Binance Gift Card (USER_DATA)
|
|
260
271
|
* @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.
|
|
261
272
|
* @returns {Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>}
|
|
262
273
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
263
274
|
* @memberof MarketDataApi
|
|
264
|
-
* @see {@link https://developers.binance.com/docs/
|
|
275
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#redeem-abinance-gift-card Binance API Documentation}
|
|
265
276
|
*/
|
|
266
277
|
async redeemABinanceGiftCard(requestParameters) {
|
|
267
278
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.redeemABinanceGiftCard(requestParameters?.code, requestParameters?.externalUid, requestParameters?.recvWindow);
|
|
@@ -270,16 +281,19 @@ var MarketDataApi = class {
|
|
|
270
281
|
/**
|
|
271
282
|
* This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.
|
|
272
283
|
*
|
|
273
|
-
**Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to
|
|
284
|
+
**Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to
|
|
285
|
+
* verify any Gift Card Number for that hour.**
|
|
286
|
+
*
|
|
287
|
+
* Weight(IP): 1
|
|
274
288
|
*
|
|
275
|
-
*
|
|
289
|
+
* Security Type: USER_DATA
|
|
276
290
|
*
|
|
277
|
-
* @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)
|
|
291
|
+
* @summary Verify Binance Gift Card by Gift Card Number (USER_DATA)
|
|
278
292
|
* @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.
|
|
279
293
|
* @returns {Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>}
|
|
280
294
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
281
295
|
* @memberof MarketDataApi
|
|
282
|
-
* @see {@link https://developers.binance.com/docs/
|
|
296
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#verify-binance-gift-card-by-gift-card-number Binance API Documentation}
|
|
283
297
|
*/
|
|
284
298
|
async verifyBinanceGiftCardByGiftCardNumber(requestParameters) {
|
|
285
299
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.verifyBinanceGiftCardByGiftCardNumber(requestParameters?.referenceNo, requestParameters?.recvWindow);
|
|
@@ -290,9 +304,9 @@ var MarketDataApi = class {
|
|
|
290
304
|
//#endregion
|
|
291
305
|
//#region src/rest-api/rest-api.ts
|
|
292
306
|
/**
|
|
293
|
-
*
|
|
307
|
+
* Gift Card REST API
|
|
294
308
|
*
|
|
295
|
-
*
|
|
309
|
+
* Create, redeem, and check the value of Binance crypto gift cards.
|
|
296
310
|
*
|
|
297
311
|
* The version of the OpenAPI document: 1.0.0
|
|
298
312
|
*
|
|
@@ -331,24 +345,29 @@ var RestAPI = class {
|
|
|
331
345
|
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0, void 0, { isSigned: true });
|
|
332
346
|
}
|
|
333
347
|
/**
|
|
334
|
-
* * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card
|
|
335
|
-
*
|
|
336
|
-
*
|
|
348
|
+
* * This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card
|
|
349
|
+
* using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create
|
|
350
|
+
* a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at
|
|
351
|
+
* 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.
|
|
337
352
|
*
|
|
353
|
+
* Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee
|
|
354
|
+
* would be deducted from your funding wallet.
|
|
338
355
|
* To get started with, please make sure:
|
|
339
356
|
* You have a Binance account
|
|
340
357
|
* You have passed KYB
|
|
341
358
|
* You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet
|
|
342
359
|
* You need Enable Withdrawals for the API Key which requests this endpoint.
|
|
343
360
|
*
|
|
344
|
-
* Weight: 1
|
|
361
|
+
* Weight(IP): 1
|
|
362
|
+
*
|
|
363
|
+
* Security Type: TRADE
|
|
345
364
|
*
|
|
346
|
-
* @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)
|
|
365
|
+
* @summary Create a dual-token gift card (fixed value, discount feature) (TRADE)
|
|
347
366
|
* @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.
|
|
348
367
|
*
|
|
349
368
|
* @returns {Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>}
|
|
350
369
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
351
|
-
* @see {@link https://developers.binance.com/docs/
|
|
370
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#create-adual-token-gift-card Binance API Documentation}
|
|
352
371
|
*/
|
|
353
372
|
createADualTokenGiftCard(requestParameters) {
|
|
354
373
|
return this.marketDataApi.createADualTokenGiftCard(requestParameters);
|
|
@@ -357,20 +376,21 @@ var RestAPI = class {
|
|
|
357
376
|
* This API is for creating a Binance Gift Card.
|
|
358
377
|
*
|
|
359
378
|
* To get started with, please make sure:
|
|
360
|
-
*
|
|
361
379
|
* You have a Binance account
|
|
362
380
|
* You have passed KYB
|
|
363
381
|
* You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet
|
|
364
382
|
* You need `Enable Withdrawals` for the API Key which requests this endpoint.
|
|
365
383
|
*
|
|
366
|
-
* Weight: 1
|
|
384
|
+
* Weight(IP): 1
|
|
385
|
+
*
|
|
386
|
+
* Security Type: USER_DATA
|
|
367
387
|
*
|
|
368
388
|
* @summary Create a single-token gift card (USER_DATA)
|
|
369
389
|
* @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.
|
|
370
390
|
*
|
|
371
391
|
* @returns {Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>}
|
|
372
392
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
373
|
-
* @see {@link https://developers.binance.com/docs/
|
|
393
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#create-asingle-token-gift-card Binance API Documentation}
|
|
374
394
|
*/
|
|
375
395
|
createASingleTokenGiftCard(requestParameters) {
|
|
376
396
|
return this.marketDataApi.createASingleTokenGiftCard(requestParameters);
|
|
@@ -381,54 +401,59 @@ var RestAPI = class {
|
|
|
381
401
|
*
|
|
382
402
|
**Please note that the RSA Public key fetched is valid only for the current day.**
|
|
383
403
|
*
|
|
384
|
-
* Weight: 1
|
|
404
|
+
* Weight(IP): 1
|
|
385
405
|
*
|
|
386
|
-
*
|
|
406
|
+
* Security Type: USER_DATA
|
|
407
|
+
*
|
|
408
|
+
* @summary Fetch RSA Public Key (USER_DATA)
|
|
387
409
|
* @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.
|
|
388
410
|
*
|
|
389
411
|
* @returns {Promise<RestApiResponse<FetchRsaPublicKeyResponse>>}
|
|
390
412
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
391
|
-
* @see {@link https://developers.binance.com/docs/
|
|
413
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#fetch-rsa-public-key Binance API Documentation}
|
|
392
414
|
*/
|
|
393
415
|
fetchRsaPublicKey(requestParameters = {}) {
|
|
394
416
|
return this.marketDataApi.fetchRsaPublicKey(requestParameters);
|
|
395
417
|
}
|
|
396
418
|
/**
|
|
397
|
-
* This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as
|
|
419
|
+
* This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as
|
|
420
|
+
* mentioned in section 2 and its’ limitation.
|
|
421
|
+
*
|
|
422
|
+
* Weight(IP): 1
|
|
398
423
|
*
|
|
399
|
-
*
|
|
424
|
+
* Security Type: USER_DATA
|
|
400
425
|
*
|
|
401
|
-
* @summary Fetch Token Limit(USER_DATA)
|
|
426
|
+
* @summary Fetch Token Limit (USER_DATA)
|
|
402
427
|
* @param {FetchTokenLimitRequest} requestParameters Request parameters.
|
|
403
428
|
*
|
|
404
429
|
* @returns {Promise<RestApiResponse<FetchTokenLimitResponse>>}
|
|
405
430
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
406
|
-
* @see {@link https://developers.binance.com/docs/
|
|
431
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#fetch-token-limit Binance API Documentation}
|
|
407
432
|
*/
|
|
408
433
|
fetchTokenLimit(requestParameters) {
|
|
409
434
|
return this.marketDataApi.fetchTokenLimit(requestParameters);
|
|
410
435
|
}
|
|
411
436
|
/**
|
|
412
|
-
* This API is for redeeming a Binance Gift Card
|
|
413
|
-
* Once redeemed, the coins will be deposited in your funding wallet.
|
|
437
|
+
* This API is for redeeming a Binance Gift Card. Once redeemed, the coins will be deposited in your funding wallet.
|
|
414
438
|
*
|
|
415
|
-
*
|
|
416
|
-
* Plaintext
|
|
417
|
-
* Encrypted
|
|
439
|
+
* Weight(IP): 1
|
|
418
440
|
*
|
|
419
|
-
*
|
|
420
|
-
* Fetch RSA public key from api stated below.
|
|
421
|
-
* Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`
|
|
422
|
-
**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.:**
|
|
441
|
+
* Security Type: USER_DATA
|
|
423
442
|
*
|
|
424
|
-
*
|
|
443
|
+
* Notes:
|
|
444
|
+
* - Parameter `code` can be sent in two formats: `Plaintext` and `Encrypted`.
|
|
445
|
+
* - Sending `code` in encrypted format is more secure than plaintext.
|
|
446
|
+
* - To send encrypted `code`:
|
|
447
|
+
* - Fetch RSA public key from `GET /sapi/v1/giftcard/cryptography/rsa-public-key`.
|
|
448
|
+
* - Encrypt card code using `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`.
|
|
449
|
+
* - If you enter the wrong redemption code 5 times within 24 hours, you will no longer be able to redeem any Binance Gift Cards that day.
|
|
425
450
|
*
|
|
426
|
-
* @summary Redeem a Binance Gift Card(USER_DATA)
|
|
451
|
+
* @summary Redeem a Binance Gift Card (USER_DATA)
|
|
427
452
|
* @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.
|
|
428
453
|
*
|
|
429
454
|
* @returns {Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>}
|
|
430
455
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
431
|
-
* @see {@link https://developers.binance.com/docs/
|
|
456
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#redeem-abinance-gift-card Binance API Documentation}
|
|
432
457
|
*/
|
|
433
458
|
redeemABinanceGiftCard(requestParameters) {
|
|
434
459
|
return this.marketDataApi.redeemABinanceGiftCard(requestParameters);
|
|
@@ -436,16 +461,19 @@ var RestAPI = class {
|
|
|
436
461
|
/**
|
|
437
462
|
* This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.
|
|
438
463
|
*
|
|
439
|
-
**Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to
|
|
464
|
+
**Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to
|
|
465
|
+
* verify any Gift Card Number for that hour.**
|
|
466
|
+
*
|
|
467
|
+
* Weight(IP): 1
|
|
440
468
|
*
|
|
441
|
-
*
|
|
469
|
+
* Security Type: USER_DATA
|
|
442
470
|
*
|
|
443
|
-
* @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)
|
|
471
|
+
* @summary Verify Binance Gift Card by Gift Card Number (USER_DATA)
|
|
444
472
|
* @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.
|
|
445
473
|
*
|
|
446
474
|
* @returns {Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>}
|
|
447
475
|
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
448
|
-
* @see {@link https://developers.binance.com/docs/
|
|
476
|
+
* @see {@link https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#verify-binance-gift-card-by-gift-card-number Binance API Documentation}
|
|
449
477
|
*/
|
|
450
478
|
verifyBinanceGiftCardByGiftCardNumber(requestParameters) {
|
|
451
479
|
return this.marketDataApi.verifyBinanceGiftCardByGiftCardNumber(requestParameters);
|