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