@binance/giftcard 4.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.
@@ -0,0 +1,877 @@
1
+ import { BadRequestError, ConfigurationRestAPI, ConnectorClientError, ForbiddenError, GIFT_CARD_REST_API_PROD_URL, NetworkError, NotFoundError, RateLimitBanError, RequiredError, RestApiResponse, ServerError, TooManyRequestsError, UnauthorizedError } from "@binance/common";
2
+
3
+ //#region src/rest-api/types/create-adual-token-gift-card-response-data.d.ts
4
+
5
+ /**
6
+ * Binance Gift Card REST API
7
+ *
8
+ * OpenAPI Specification for the Binance Gift Card REST API
9
+ *
10
+ * The version of the OpenAPI document: 1.0.0
11
+ *
12
+ *
13
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
14
+ * https://openapi-generator.tech
15
+ * Do not edit the class manually.
16
+ */
17
+ /**
18
+ *
19
+ * @export
20
+ * @interface CreateADualTokenGiftCardResponseData
21
+ */
22
+ interface CreateADualTokenGiftCardResponseData {
23
+ /**
24
+ *
25
+ * @type {string}
26
+ * @memberof CreateADualTokenGiftCardResponseData
27
+ */
28
+ referenceNo?: string;
29
+ /**
30
+ *
31
+ * @type {string}
32
+ * @memberof CreateADualTokenGiftCardResponseData
33
+ */
34
+ code?: string;
35
+ /**
36
+ *
37
+ * @type {number | bigint}
38
+ * @memberof CreateADualTokenGiftCardResponseData
39
+ */
40
+ expiredTime?: number | bigint;
41
+ }
42
+ //#endregion
43
+ //#region src/rest-api/types/create-adual-token-gift-card-response.d.ts
44
+
45
+ /**
46
+ *
47
+ * @export
48
+ * @interface CreateADualTokenGiftCardResponse
49
+ */
50
+ interface CreateADualTokenGiftCardResponse {
51
+ /**
52
+ *
53
+ * @type {string}
54
+ * @memberof CreateADualTokenGiftCardResponse
55
+ */
56
+ code?: string;
57
+ /**
58
+ *
59
+ * @type {string}
60
+ * @memberof CreateADualTokenGiftCardResponse
61
+ */
62
+ message?: string;
63
+ /**
64
+ *
65
+ * @type {CreateADualTokenGiftCardResponseData}
66
+ * @memberof CreateADualTokenGiftCardResponse
67
+ */
68
+ data?: CreateADualTokenGiftCardResponseData;
69
+ /**
70
+ *
71
+ * @type {boolean}
72
+ * @memberof CreateADualTokenGiftCardResponse
73
+ */
74
+ success?: boolean;
75
+ }
76
+ //#endregion
77
+ //#region src/rest-api/types/create-asingle-token-gift-card-response.d.ts
78
+
79
+ /**
80
+ *
81
+ * @export
82
+ * @interface CreateASingleTokenGiftCardResponse
83
+ */
84
+ interface CreateASingleTokenGiftCardResponse {
85
+ /**
86
+ *
87
+ * @type {string}
88
+ * @memberof CreateASingleTokenGiftCardResponse
89
+ */
90
+ code?: string;
91
+ /**
92
+ *
93
+ * @type {string}
94
+ * @memberof CreateASingleTokenGiftCardResponse
95
+ */
96
+ message?: string;
97
+ /**
98
+ *
99
+ * @type {CreateADualTokenGiftCardResponseData}
100
+ * @memberof CreateASingleTokenGiftCardResponse
101
+ */
102
+ data?: CreateADualTokenGiftCardResponseData;
103
+ /**
104
+ *
105
+ * @type {boolean}
106
+ * @memberof CreateASingleTokenGiftCardResponse
107
+ */
108
+ success?: boolean;
109
+ }
110
+ //#endregion
111
+ //#region src/rest-api/types/fetch-rsa-public-key-response.d.ts
112
+ /**
113
+ * Binance Gift Card REST API
114
+ *
115
+ * OpenAPI Specification for the Binance Gift Card REST API
116
+ *
117
+ * The version of the OpenAPI document: 1.0.0
118
+ *
119
+ *
120
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
121
+ * https://openapi-generator.tech
122
+ * Do not edit the class manually.
123
+ */
124
+ /**
125
+ *
126
+ * @export
127
+ * @interface FetchRsaPublicKeyResponse
128
+ */
129
+ interface FetchRsaPublicKeyResponse {
130
+ /**
131
+ *
132
+ * @type {string}
133
+ * @memberof FetchRsaPublicKeyResponse
134
+ */
135
+ code?: string;
136
+ /**
137
+ *
138
+ * @type {string}
139
+ * @memberof FetchRsaPublicKeyResponse
140
+ */
141
+ message?: string;
142
+ /**
143
+ *
144
+ * @type {string}
145
+ * @memberof FetchRsaPublicKeyResponse
146
+ */
147
+ data?: string;
148
+ /**
149
+ *
150
+ * @type {boolean}
151
+ * @memberof FetchRsaPublicKeyResponse
152
+ */
153
+ success?: boolean;
154
+ }
155
+ //#endregion
156
+ //#region src/rest-api/types/fetch-token-limit-response-data-inner.d.ts
157
+ /**
158
+ * Binance Gift Card REST API
159
+ *
160
+ * OpenAPI Specification for the Binance Gift Card REST API
161
+ *
162
+ * The version of the OpenAPI document: 1.0.0
163
+ *
164
+ *
165
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
166
+ * https://openapi-generator.tech
167
+ * Do not edit the class manually.
168
+ */
169
+ /**
170
+ *
171
+ * @export
172
+ * @interface FetchTokenLimitResponseDataInner
173
+ */
174
+ interface FetchTokenLimitResponseDataInner {
175
+ /**
176
+ *
177
+ * @type {string}
178
+ * @memberof FetchTokenLimitResponseDataInner
179
+ */
180
+ coin?: string;
181
+ /**
182
+ *
183
+ * @type {string}
184
+ * @memberof FetchTokenLimitResponseDataInner
185
+ */
186
+ fromMin?: string;
187
+ /**
188
+ *
189
+ * @type {string}
190
+ * @memberof FetchTokenLimitResponseDataInner
191
+ */
192
+ fromMax?: string;
193
+ }
194
+ //#endregion
195
+ //#region src/rest-api/types/fetch-token-limit-response.d.ts
196
+ /**
197
+ *
198
+ * @export
199
+ * @interface FetchTokenLimitResponse
200
+ */
201
+ interface FetchTokenLimitResponse {
202
+ /**
203
+ *
204
+ * @type {string}
205
+ * @memberof FetchTokenLimitResponse
206
+ */
207
+ code?: string;
208
+ /**
209
+ *
210
+ * @type {string}
211
+ * @memberof FetchTokenLimitResponse
212
+ */
213
+ message?: string;
214
+ /**
215
+ *
216
+ * @type {Array<FetchTokenLimitResponseDataInner>}
217
+ * @memberof FetchTokenLimitResponse
218
+ */
219
+ data?: Array<FetchTokenLimitResponseDataInner>;
220
+ /**
221
+ *
222
+ * @type {boolean}
223
+ * @memberof FetchTokenLimitResponse
224
+ */
225
+ success?: boolean;
226
+ }
227
+ //#endregion
228
+ //#region src/rest-api/types/redeem-abinance-gift-card-response-data.d.ts
229
+ /**
230
+ * Binance Gift Card REST API
231
+ *
232
+ * OpenAPI Specification for the Binance Gift Card REST API
233
+ *
234
+ * The version of the OpenAPI document: 1.0.0
235
+ *
236
+ *
237
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
238
+ * https://openapi-generator.tech
239
+ * Do not edit the class manually.
240
+ */
241
+ /**
242
+ *
243
+ * @export
244
+ * @interface RedeemABinanceGiftCardResponseData
245
+ */
246
+ interface RedeemABinanceGiftCardResponseData {
247
+ /**
248
+ *
249
+ * @type {string}
250
+ * @memberof RedeemABinanceGiftCardResponseData
251
+ */
252
+ referenceNo?: string;
253
+ /**
254
+ *
255
+ * @type {string}
256
+ * @memberof RedeemABinanceGiftCardResponseData
257
+ */
258
+ identityNo?: string;
259
+ /**
260
+ *
261
+ * @type {string}
262
+ * @memberof RedeemABinanceGiftCardResponseData
263
+ */
264
+ token?: string;
265
+ /**
266
+ *
267
+ * @type {string}
268
+ * @memberof RedeemABinanceGiftCardResponseData
269
+ */
270
+ amount?: string;
271
+ }
272
+ //#endregion
273
+ //#region src/rest-api/types/redeem-abinance-gift-card-response.d.ts
274
+ /**
275
+ *
276
+ * @export
277
+ * @interface RedeemABinanceGiftCardResponse
278
+ */
279
+ interface RedeemABinanceGiftCardResponse {
280
+ /**
281
+ *
282
+ * @type {string}
283
+ * @memberof RedeemABinanceGiftCardResponse
284
+ */
285
+ code?: string;
286
+ /**
287
+ *
288
+ * @type {string}
289
+ * @memberof RedeemABinanceGiftCardResponse
290
+ */
291
+ message?: string;
292
+ /**
293
+ *
294
+ * @type {RedeemABinanceGiftCardResponseData}
295
+ * @memberof RedeemABinanceGiftCardResponse
296
+ */
297
+ data?: RedeemABinanceGiftCardResponseData;
298
+ /**
299
+ *
300
+ * @type {boolean}
301
+ * @memberof RedeemABinanceGiftCardResponse
302
+ */
303
+ success?: boolean;
304
+ }
305
+ //#endregion
306
+ //#region src/rest-api/types/verify-binance-gift-card-by-gift-card-number-response-data.d.ts
307
+ /**
308
+ * Binance Gift Card REST API
309
+ *
310
+ * OpenAPI Specification for the Binance Gift Card REST API
311
+ *
312
+ * The version of the OpenAPI document: 1.0.0
313
+ *
314
+ *
315
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
316
+ * https://openapi-generator.tech
317
+ * Do not edit the class manually.
318
+ */
319
+ /**
320
+ *
321
+ * @export
322
+ * @interface VerifyBinanceGiftCardByGiftCardNumberResponseData
323
+ */
324
+ interface VerifyBinanceGiftCardByGiftCardNumberResponseData {
325
+ /**
326
+ *
327
+ * @type {boolean}
328
+ * @memberof VerifyBinanceGiftCardByGiftCardNumberResponseData
329
+ */
330
+ valid?: boolean;
331
+ /**
332
+ *
333
+ * @type {string}
334
+ * @memberof VerifyBinanceGiftCardByGiftCardNumberResponseData
335
+ */
336
+ token?: string;
337
+ /**
338
+ *
339
+ * @type {string}
340
+ * @memberof VerifyBinanceGiftCardByGiftCardNumberResponseData
341
+ */
342
+ amount?: string;
343
+ }
344
+ //#endregion
345
+ //#region src/rest-api/types/verify-binance-gift-card-by-gift-card-number-response.d.ts
346
+ /**
347
+ *
348
+ * @export
349
+ * @interface VerifyBinanceGiftCardByGiftCardNumberResponse
350
+ */
351
+ interface VerifyBinanceGiftCardByGiftCardNumberResponse {
352
+ /**
353
+ *
354
+ * @type {string}
355
+ * @memberof VerifyBinanceGiftCardByGiftCardNumberResponse
356
+ */
357
+ code?: string;
358
+ /**
359
+ *
360
+ * @type {string}
361
+ * @memberof VerifyBinanceGiftCardByGiftCardNumberResponse
362
+ */
363
+ message?: string;
364
+ /**
365
+ *
366
+ * @type {VerifyBinanceGiftCardByGiftCardNumberResponseData}
367
+ * @memberof VerifyBinanceGiftCardByGiftCardNumberResponse
368
+ */
369
+ data?: VerifyBinanceGiftCardByGiftCardNumberResponseData;
370
+ /**
371
+ *
372
+ * @type {boolean}
373
+ * @memberof VerifyBinanceGiftCardByGiftCardNumberResponse
374
+ */
375
+ success?: boolean;
376
+ }
377
+ //#endregion
378
+ //#region src/rest-api/modules/market-data-api.d.ts
379
+ /**
380
+ * MarketDataApi - interface
381
+ * @interface MarketDataApi
382
+ */
383
+ interface MarketDataApiInterface {
384
+ /**
385
+ * * 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.
386
+ * 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.
387
+ *
388
+ *
389
+ * To get started with, please make sure:
390
+ * You have a Binance account
391
+ * You have passed KYB
392
+ * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet
393
+ * You need Enable Withdrawals for the API Key which requests this endpoint.
394
+ *
395
+ * Weight: 1
396
+ *
397
+ * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)
398
+ * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.
399
+ *
400
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
401
+ * @memberof MarketDataApiInterface
402
+ */
403
+ createADualTokenGiftCard(requestParameters: CreateADualTokenGiftCardRequest): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>;
404
+ /**
405
+ * This API is for creating a Binance Gift Card.
406
+ *
407
+ * To get started with, please make sure:
408
+ *
409
+ * You have a Binance account
410
+ * You have passed KYB
411
+ * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet
412
+ * You need `Enable Withdrawals` for the API Key which requests this endpoint.
413
+ *
414
+ * Weight: 1
415
+ *
416
+ * @summary Create a single-token gift card (USER_DATA)
417
+ * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.
418
+ *
419
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
420
+ * @memberof MarketDataApiInterface
421
+ */
422
+ createASingleTokenGiftCard(requestParameters: CreateASingleTokenGiftCardRequest): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>;
423
+ /**
424
+ * This API is for fetching the RSA Public Key.
425
+ * This RSA Public key will be used to encrypt the card code.
426
+ *
427
+ **Please note that the RSA Public key fetched is valid only for the current day.**
428
+ *
429
+ * Weight: 1
430
+ *
431
+ * @summary Fetch RSA Public Key(USER_DATA)
432
+ * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.
433
+ *
434
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
435
+ * @memberof MarketDataApiInterface
436
+ */
437
+ fetchRsaPublicKey(requestParameters?: FetchRsaPublicKeyRequest): Promise<RestApiResponse<FetchRsaPublicKeyResponse>>;
438
+ /**
439
+ * 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.
440
+ *
441
+ * Weight: 1
442
+ *
443
+ * @summary Fetch Token Limit(USER_DATA)
444
+ * @param {FetchTokenLimitRequest} requestParameters Request parameters.
445
+ *
446
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
447
+ * @memberof MarketDataApiInterface
448
+ */
449
+ fetchTokenLimit(requestParameters: FetchTokenLimitRequest): Promise<RestApiResponse<FetchTokenLimitResponse>>;
450
+ /**
451
+ * This API is for redeeming a Binance Gift Card
452
+ * Once redeemed, the coins will be deposited in your funding wallet.
453
+ *
454
+ * Parameter code can be sent in two formats:
455
+ * Plaintext
456
+ * Encrypted
457
+ *
458
+ * 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:
459
+ * Fetch RSA public key from api stated below.
460
+ * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`
461
+ **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.:**
462
+ *
463
+ * Weight: 1
464
+ *
465
+ * @summary Redeem a Binance Gift Card(USER_DATA)
466
+ * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.
467
+ *
468
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
469
+ * @memberof MarketDataApiInterface
470
+ */
471
+ redeemABinanceGiftCard(requestParameters: RedeemABinanceGiftCardRequest): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>;
472
+ /**
473
+ * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.
474
+ *
475
+ **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.**
476
+ *
477
+ * Weight: 1
478
+ *
479
+ * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)
480
+ * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.
481
+ *
482
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
483
+ * @memberof MarketDataApiInterface
484
+ */
485
+ verifyBinanceGiftCardByGiftCardNumber(requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>;
486
+ }
487
+ /**
488
+ * Request parameters for createADualTokenGiftCard operation in MarketDataApi.
489
+ * @interface CreateADualTokenGiftCardRequest
490
+ */
491
+ interface CreateADualTokenGiftCardRequest {
492
+ /**
493
+ * The token you want to pay, example: BUSD
494
+ * @type {string}
495
+ * @memberof MarketDataApiCreateADualTokenGiftCard
496
+ */
497
+ readonly baseToken: string;
498
+ /**
499
+ * The token you want to buy, example: BNB. If faceToken = baseToken, it's the same as createCode endpoint.
500
+ * @type {string}
501
+ * @memberof MarketDataApiCreateADualTokenGiftCard
502
+ */
503
+ readonly faceToken: string;
504
+ /**
505
+ * The base token asset quantity, example : 1.002
506
+ * @type {number}
507
+ * @memberof MarketDataApiCreateADualTokenGiftCard
508
+ */
509
+ readonly baseTokenAmount: number;
510
+ /**
511
+ *
512
+ * @type {number | bigint}
513
+ * @memberof MarketDataApiCreateADualTokenGiftCard
514
+ */
515
+ readonly recvWindow?: number | bigint;
516
+ }
517
+ /**
518
+ * Request parameters for createASingleTokenGiftCard operation in MarketDataApi.
519
+ * @interface CreateASingleTokenGiftCardRequest
520
+ */
521
+ interface CreateASingleTokenGiftCardRequest {
522
+ /**
523
+ * The token type contained in the Binance Gift Card
524
+ * @type {string}
525
+ * @memberof MarketDataApiCreateASingleTokenGiftCard
526
+ */
527
+ readonly token: string;
528
+ /**
529
+ * The amount of the token contained in the Binance Gift Card
530
+ * @type {number}
531
+ * @memberof MarketDataApiCreateASingleTokenGiftCard
532
+ */
533
+ readonly amount: number;
534
+ /**
535
+ *
536
+ * @type {number | bigint}
537
+ * @memberof MarketDataApiCreateASingleTokenGiftCard
538
+ */
539
+ readonly recvWindow?: number | bigint;
540
+ }
541
+ /**
542
+ * Request parameters for fetchRsaPublicKey operation in MarketDataApi.
543
+ * @interface FetchRsaPublicKeyRequest
544
+ */
545
+ interface FetchRsaPublicKeyRequest {
546
+ /**
547
+ *
548
+ * @type {number | bigint}
549
+ * @memberof MarketDataApiFetchRsaPublicKey
550
+ */
551
+ readonly recvWindow?: number | bigint;
552
+ }
553
+ /**
554
+ * Request parameters for fetchTokenLimit operation in MarketDataApi.
555
+ * @interface FetchTokenLimitRequest
556
+ */
557
+ interface FetchTokenLimitRequest {
558
+ /**
559
+ * The token you want to pay, example: BUSD
560
+ * @type {string}
561
+ * @memberof MarketDataApiFetchTokenLimit
562
+ */
563
+ readonly baseToken: string;
564
+ /**
565
+ *
566
+ * @type {number | bigint}
567
+ * @memberof MarketDataApiFetchTokenLimit
568
+ */
569
+ readonly recvWindow?: number | bigint;
570
+ }
571
+ /**
572
+ * Request parameters for redeemABinanceGiftCard operation in MarketDataApi.
573
+ * @interface RedeemABinanceGiftCardRequest
574
+ */
575
+ interface RedeemABinanceGiftCardRequest {
576
+ /**
577
+ * Redemption code of Binance Gift Card to be redeemed, supports both Plaintext & Encrypted code.
578
+ * @type {string}
579
+ * @memberof MarketDataApiRedeemABinanceGiftCard
580
+ */
581
+ readonly code: string;
582
+ /**
583
+ * 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).
584
+ * @type {string}
585
+ * @memberof MarketDataApiRedeemABinanceGiftCard
586
+ */
587
+ readonly externalUid?: string;
588
+ /**
589
+ *
590
+ * @type {number | bigint}
591
+ * @memberof MarketDataApiRedeemABinanceGiftCard
592
+ */
593
+ readonly recvWindow?: number | bigint;
594
+ }
595
+ /**
596
+ * Request parameters for verifyBinanceGiftCardByGiftCardNumber operation in MarketDataApi.
597
+ * @interface VerifyBinanceGiftCardByGiftCardNumberRequest
598
+ */
599
+ interface VerifyBinanceGiftCardByGiftCardNumberRequest {
600
+ /**
601
+ * Enter the Gift Card Number
602
+ * @type {string}
603
+ * @memberof MarketDataApiVerifyBinanceGiftCardByGiftCardNumber
604
+ */
605
+ readonly referenceNo: string;
606
+ /**
607
+ *
608
+ * @type {number | bigint}
609
+ * @memberof MarketDataApiVerifyBinanceGiftCardByGiftCardNumber
610
+ */
611
+ readonly recvWindow?: number | bigint;
612
+ }
613
+ /**
614
+ * MarketDataApi - object-oriented interface
615
+ * @class MarketDataApi
616
+ */
617
+ declare class MarketDataApi implements MarketDataApiInterface {
618
+ private readonly configuration;
619
+ private localVarAxiosParamCreator;
620
+ constructor(configuration: ConfigurationRestAPI);
621
+ /**
622
+ * * 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.
623
+ * 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.
624
+ *
625
+ *
626
+ * To get started with, please make sure:
627
+ * You have a Binance account
628
+ * You have passed KYB
629
+ * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet
630
+ * You need Enable Withdrawals for the API Key which requests this endpoint.
631
+ *
632
+ * Weight: 1
633
+ *
634
+ * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)
635
+ * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.
636
+ * @returns {Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>}
637
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
638
+ * @memberof MarketDataApi
639
+ * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-dual-token-gift-card Binance API Documentation}
640
+ */
641
+ createADualTokenGiftCard(requestParameters: CreateADualTokenGiftCardRequest): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>;
642
+ /**
643
+ * This API is for creating a Binance Gift Card.
644
+ *
645
+ * To get started with, please make sure:
646
+ *
647
+ * You have a Binance account
648
+ * You have passed KYB
649
+ * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet
650
+ * You need `Enable Withdrawals` for the API Key which requests this endpoint.
651
+ *
652
+ * Weight: 1
653
+ *
654
+ * @summary Create a single-token gift card (USER_DATA)
655
+ * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.
656
+ * @returns {Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>}
657
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
658
+ * @memberof MarketDataApi
659
+ * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card Binance API Documentation}
660
+ */
661
+ createASingleTokenGiftCard(requestParameters: CreateASingleTokenGiftCardRequest): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>;
662
+ /**
663
+ * This API is for fetching the RSA Public Key.
664
+ * This RSA Public key will be used to encrypt the card code.
665
+ *
666
+ **Please note that the RSA Public key fetched is valid only for the current day.**
667
+ *
668
+ * Weight: 1
669
+ *
670
+ * @summary Fetch RSA Public Key(USER_DATA)
671
+ * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.
672
+ * @returns {Promise<RestApiResponse<FetchRsaPublicKeyResponse>>}
673
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
674
+ * @memberof MarketDataApi
675
+ * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-RSA-Public-Key Binance API Documentation}
676
+ */
677
+ fetchRsaPublicKey(requestParameters?: FetchRsaPublicKeyRequest): Promise<RestApiResponse<FetchRsaPublicKeyResponse>>;
678
+ /**
679
+ * 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.
680
+ *
681
+ * Weight: 1
682
+ *
683
+ * @summary Fetch Token Limit(USER_DATA)
684
+ * @param {FetchTokenLimitRequest} requestParameters Request parameters.
685
+ * @returns {Promise<RestApiResponse<FetchTokenLimitResponse>>}
686
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
687
+ * @memberof MarketDataApi
688
+ * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-Token-Limit Binance API Documentation}
689
+ */
690
+ fetchTokenLimit(requestParameters: FetchTokenLimitRequest): Promise<RestApiResponse<FetchTokenLimitResponse>>;
691
+ /**
692
+ * This API is for redeeming a Binance Gift Card
693
+ * Once redeemed, the coins will be deposited in your funding wallet.
694
+ *
695
+ * Parameter code can be sent in two formats:
696
+ * Plaintext
697
+ * Encrypted
698
+ *
699
+ * 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:
700
+ * Fetch RSA public key from api stated below.
701
+ * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`
702
+ **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.:**
703
+ *
704
+ * Weight: 1
705
+ *
706
+ * @summary Redeem a Binance Gift Card(USER_DATA)
707
+ * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.
708
+ * @returns {Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>}
709
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
710
+ * @memberof MarketDataApi
711
+ * @see {@link https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card Binance API Documentation}
712
+ */
713
+ redeemABinanceGiftCard(requestParameters: RedeemABinanceGiftCardRequest): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>;
714
+ /**
715
+ * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.
716
+ *
717
+ **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.**
718
+ *
719
+ * Weight: 1
720
+ *
721
+ * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)
722
+ * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.
723
+ * @returns {Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>}
724
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
725
+ * @memberof MarketDataApi
726
+ * @see {@link https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number Binance API Documentation}
727
+ */
728
+ verifyBinanceGiftCardByGiftCardNumber(requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>;
729
+ }
730
+ //#endregion
731
+ //#region src/rest-api/rest-api.d.ts
732
+ declare class RestAPI {
733
+ private configuration;
734
+ private marketDataApi;
735
+ constructor(configuration: ConfigurationRestAPI);
736
+ /**
737
+ * Generic function to send a request.
738
+ * @param endpoint - The API endpoint to call.
739
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
740
+ * @param params - Query parameters for the request.
741
+ *
742
+ * @returns A promise resolving to the response data object.
743
+ */
744
+ sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
745
+ /**
746
+ * Generic function to send a signed request.
747
+ * @param endpoint - The API endpoint to call.
748
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
749
+ * @param params - Query parameters for the request.
750
+ *
751
+ * @returns A promise resolving to the response data object.
752
+ */
753
+ sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
754
+ /**
755
+ * * 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
+ * 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.
757
+ *
758
+ *
759
+ * To get started with, please make sure:
760
+ * You have a Binance account
761
+ * You have passed KYB
762
+ * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet
763
+ * You need Enable Withdrawals for the API Key which requests this endpoint.
764
+ *
765
+ * Weight: 1
766
+ *
767
+ * @summary Create a dual-token gift card(fixed value, discount feature)(TRADE)
768
+ * @param {CreateADualTokenGiftCardRequest} requestParameters Request parameters.
769
+ *
770
+ * @returns {Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>}
771
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
772
+ * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-dual-token-gift-card Binance API Documentation}
773
+ */
774
+ createADualTokenGiftCard(requestParameters: CreateADualTokenGiftCardRequest): Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>;
775
+ /**
776
+ * This API is for creating a Binance Gift Card.
777
+ *
778
+ * To get started with, please make sure:
779
+ *
780
+ * You have a Binance account
781
+ * You have passed KYB
782
+ * You have a sufficient balance(Gift Card amount and fee amount) in your Binance funding wallet
783
+ * You need `Enable Withdrawals` for the API Key which requests this endpoint.
784
+ *
785
+ * Weight: 1
786
+ *
787
+ * @summary Create a single-token gift card (USER_DATA)
788
+ * @param {CreateASingleTokenGiftCardRequest} requestParameters Request parameters.
789
+ *
790
+ * @returns {Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>}
791
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
792
+ * @see {@link https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card Binance API Documentation}
793
+ */
794
+ createASingleTokenGiftCard(requestParameters: CreateASingleTokenGiftCardRequest): Promise<RestApiResponse<CreateASingleTokenGiftCardResponse>>;
795
+ /**
796
+ * This API is for fetching the RSA Public Key.
797
+ * This RSA Public key will be used to encrypt the card code.
798
+ *
799
+ **Please note that the RSA Public key fetched is valid only for the current day.**
800
+ *
801
+ * Weight: 1
802
+ *
803
+ * @summary Fetch RSA Public Key(USER_DATA)
804
+ * @param {FetchRsaPublicKeyRequest} requestParameters Request parameters.
805
+ *
806
+ * @returns {Promise<RestApiResponse<FetchRsaPublicKeyResponse>>}
807
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
808
+ * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-RSA-Public-Key Binance API Documentation}
809
+ */
810
+ fetchRsaPublicKey(requestParameters?: FetchRsaPublicKeyRequest): Promise<RestApiResponse<FetchRsaPublicKeyResponse>>;
811
+ /**
812
+ * 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.
813
+ *
814
+ * Weight: 1
815
+ *
816
+ * @summary Fetch Token Limit(USER_DATA)
817
+ * @param {FetchTokenLimitRequest} requestParameters Request parameters.
818
+ *
819
+ * @returns {Promise<RestApiResponse<FetchTokenLimitResponse>>}
820
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
821
+ * @see {@link https://developers.binance.com/docs/gift_card/market-data/Fetch-Token-Limit Binance API Documentation}
822
+ */
823
+ fetchTokenLimit(requestParameters: FetchTokenLimitRequest): Promise<RestApiResponse<FetchTokenLimitResponse>>;
824
+ /**
825
+ * This API is for redeeming a Binance Gift Card
826
+ * Once redeemed, the coins will be deposited in your funding wallet.
827
+ *
828
+ * Parameter code can be sent in two formats:
829
+ * Plaintext
830
+ * Encrypted
831
+ *
832
+ * 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:
833
+ * Fetch RSA public key from api stated below.
834
+ * Use the below algorithm to encrypt the card code using the RSA public key fetched above: `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`
835
+ **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.:**
836
+ *
837
+ * Weight: 1
838
+ *
839
+ * @summary Redeem a Binance Gift Card(USER_DATA)
840
+ * @param {RedeemABinanceGiftCardRequest} requestParameters Request parameters.
841
+ *
842
+ * @returns {Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>}
843
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
844
+ * @see {@link https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card Binance API Documentation}
845
+ */
846
+ redeemABinanceGiftCard(requestParameters: RedeemABinanceGiftCardRequest): Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>;
847
+ /**
848
+ * This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.
849
+ *
850
+ **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.**
851
+ *
852
+ * Weight: 1
853
+ *
854
+ * @summary Verify Binance Gift Card by Gift Card Number(USER_DATA)
855
+ * @param {VerifyBinanceGiftCardByGiftCardNumberRequest} requestParameters Request parameters.
856
+ *
857
+ * @returns {Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>}
858
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
859
+ * @see {@link https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number Binance API Documentation}
860
+ */
861
+ verifyBinanceGiftCardByGiftCardNumber(requestParameters: VerifyBinanceGiftCardByGiftCardNumberRequest): Promise<RestApiResponse<VerifyBinanceGiftCardByGiftCardNumberResponse>>;
862
+ }
863
+ declare namespace index_d_exports {
864
+ export { CreateADualTokenGiftCardRequest, CreateADualTokenGiftCardResponse, CreateADualTokenGiftCardResponseData, CreateASingleTokenGiftCardRequest, CreateASingleTokenGiftCardResponse, FetchRsaPublicKeyRequest, FetchRsaPublicKeyResponse, FetchTokenLimitRequest, FetchTokenLimitResponse, FetchTokenLimitResponseDataInner, MarketDataApi, MarketDataApiInterface, RedeemABinanceGiftCardRequest, RedeemABinanceGiftCardResponse, RedeemABinanceGiftCardResponseData, RestAPI, VerifyBinanceGiftCardByGiftCardNumberRequest, VerifyBinanceGiftCardByGiftCardNumberResponse, VerifyBinanceGiftCardByGiftCardNumberResponseData };
865
+ }
866
+ //#endregion
867
+ //#region src/gift-card.d.ts
868
+ interface ConfigurationGiftCard {
869
+ configurationRestAPI?: ConfigurationRestAPI;
870
+ }
871
+ declare class GiftCard {
872
+ restAPI: RestAPI;
873
+ constructor(config: ConfigurationGiftCard);
874
+ }
875
+ //#endregion
876
+ export { BadRequestError, ConfigurationGiftCard, ConnectorClientError, ForbiddenError, GIFT_CARD_REST_API_PROD_URL, GiftCard, index_d_exports as GiftCardRestAPI, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
877
+ //# sourceMappingURL=index.d.mts.map