@binance/fiat 3.0.0 → 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.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,110 @@
1
1
  import { RestApiResponse, ConfigurationRestAPI } from '@binance/common';
2
2
  export { BadRequestError, ConnectorClientError, FIAT_REST_API_PROD_URL, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError } from '@binance/common';
3
3
 
4
+ /**
5
+ * Binance Fiat REST API
6
+ *
7
+ * OpenAPI Specification for the Binance Fiat REST API
8
+ *
9
+ * The version of the OpenAPI document: 1.0.0
10
+ *
11
+ *
12
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13
+ * https://openapi-generator.tech
14
+ * Do not edit the class manually.
15
+ */
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface DepositResponseData
20
+ */
21
+ interface DepositResponseData {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof DepositResponseData
26
+ */
27
+ orderId?: string;
28
+ }
29
+
30
+ /**
31
+ * Binance Fiat REST API
32
+ *
33
+ * OpenAPI Specification for the Binance Fiat REST API
34
+ *
35
+ * The version of the OpenAPI document: 1.0.0
36
+ *
37
+ *
38
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
39
+ * https://openapi-generator.tech
40
+ * Do not edit the class manually.
41
+ */
42
+
43
+ /**
44
+ *
45
+ * @export
46
+ * @interface DepositResponse
47
+ */
48
+ interface DepositResponse {
49
+ /**
50
+ *
51
+ * @type {string}
52
+ * @memberof DepositResponse
53
+ */
54
+ code?: string;
55
+ /**
56
+ *
57
+ * @type {string}
58
+ * @memberof DepositResponse
59
+ */
60
+ message?: string;
61
+ /**
62
+ *
63
+ * @type {DepositResponseData}
64
+ * @memberof DepositResponse
65
+ */
66
+ data?: DepositResponseData;
67
+ }
68
+
69
+ /**
70
+ * Binance Fiat REST API
71
+ *
72
+ * OpenAPI Specification for the Binance Fiat REST API
73
+ *
74
+ * The version of the OpenAPI document: 1.0.0
75
+ *
76
+ *
77
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
78
+ * https://openapi-generator.tech
79
+ * Do not edit the class manually.
80
+ */
81
+
82
+ /**
83
+ *
84
+ * @export
85
+ * @interface FiatWithdrawResponse
86
+ */
87
+ interface FiatWithdrawResponse {
88
+ /**
89
+ *
90
+ * @type {string}
91
+ * @memberof FiatWithdrawResponse
92
+ */
93
+ code?: string;
94
+ /**
95
+ *
96
+ * @type {string}
97
+ * @memberof FiatWithdrawResponse
98
+ */
99
+ message?: string;
100
+ /**
101
+ *
102
+ * @type {DepositResponseData}
103
+ * @memberof FiatWithdrawResponse
104
+ */
105
+ data?: DepositResponseData;
106
+ }
107
+
4
108
  /**
5
109
  * Binance Fiat REST API
6
110
  *
@@ -263,6 +367,113 @@ interface GetFiatPaymentsHistoryResponse {
263
367
  success?: boolean;
264
368
  }
265
369
 
370
+ /**
371
+ * Binance Fiat REST API
372
+ *
373
+ * OpenAPI Specification for the Binance Fiat REST API
374
+ *
375
+ * The version of the OpenAPI document: 1.0.0
376
+ *
377
+ *
378
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
379
+ * https://openapi-generator.tech
380
+ * Do not edit the class manually.
381
+ */
382
+ /**
383
+ *
384
+ * @export
385
+ * @interface GetOrderDetailResponseData
386
+ */
387
+ interface GetOrderDetailResponseData {
388
+ /**
389
+ *
390
+ * @type {string}
391
+ * @memberof GetOrderDetailResponseData
392
+ */
393
+ orderId?: string;
394
+ /**
395
+ *
396
+ * @type {string}
397
+ * @memberof GetOrderDetailResponseData
398
+ */
399
+ orderStatus?: string;
400
+ /**
401
+ *
402
+ * @type {string}
403
+ * @memberof GetOrderDetailResponseData
404
+ */
405
+ amount?: string;
406
+ /**
407
+ *
408
+ * @type {string}
409
+ * @memberof GetOrderDetailResponseData
410
+ */
411
+ fee?: string;
412
+ /**
413
+ *
414
+ * @type {string}
415
+ * @memberof GetOrderDetailResponseData
416
+ */
417
+ fiatCurrency?: string;
418
+ /**
419
+ *
420
+ * @type {string}
421
+ * @memberof GetOrderDetailResponseData
422
+ */
423
+ errorCode?: string;
424
+ /**
425
+ *
426
+ * @type {string}
427
+ * @memberof GetOrderDetailResponseData
428
+ */
429
+ errorMessage?: string;
430
+ /**
431
+ *
432
+ * @type {object}
433
+ * @memberof GetOrderDetailResponseData
434
+ */
435
+ ext?: object;
436
+ }
437
+
438
+ /**
439
+ * Binance Fiat REST API
440
+ *
441
+ * OpenAPI Specification for the Binance Fiat REST API
442
+ *
443
+ * The version of the OpenAPI document: 1.0.0
444
+ *
445
+ *
446
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
447
+ * https://openapi-generator.tech
448
+ * Do not edit the class manually.
449
+ */
450
+
451
+ /**
452
+ *
453
+ * @export
454
+ * @interface GetOrderDetailResponse
455
+ */
456
+ interface GetOrderDetailResponse {
457
+ /**
458
+ *
459
+ * @type {string}
460
+ * @memberof GetOrderDetailResponse
461
+ */
462
+ code?: string;
463
+ /**
464
+ *
465
+ * @type {string}
466
+ * @memberof GetOrderDetailResponse
467
+ */
468
+ message?: string;
469
+ /**
470
+ *
471
+ * @type {GetOrderDetailResponseData}
472
+ * @memberof GetOrderDetailResponse
473
+ */
474
+ data?: GetOrderDetailResponseData;
475
+ }
476
+
266
477
  /**
267
478
  * Binance Fiat REST API
268
479
  *
@@ -281,6 +492,24 @@ interface GetFiatPaymentsHistoryResponse {
281
492
  * @interface FiatApi
282
493
  */
283
494
  interface FiatApiInterface {
495
+ /**
496
+ * Submit withdraw request, in this version, we only support BRL withdrawal via bank_transfer.
497
+ *
498
+ * You need to call this api first, and call query order detail api in a loop to get the status of the order until this order is successful.
499
+ *
500
+ * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.
501
+ *
502
+ * you need to bind your bank account on web/app before using the corresponding account number
503
+ *
504
+ * Weight: 45000
505
+ *
506
+ * @summary Fiat Withdraw(WITHDRAW)
507
+ * @param {FiatWithdrawRequest} requestParameters Request parameters.
508
+ *
509
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
510
+ * @memberof FiatApiInterface
511
+ */
512
+ fiatWithdraw(requestParameters?: FiatWithdrawRequest): Promise<RestApiResponse<FiatWithdrawResponse>>;
284
513
  /**
285
514
  * Get Fiat Deposit/Withdraw History
286
515
  *
@@ -314,6 +543,32 @@ interface FiatApiInterface {
314
543
  * @memberof FiatApiInterface
315
544
  */
316
545
  getFiatPaymentsHistory(requestParameters: GetFiatPaymentsHistoryRequest): Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>;
546
+ /**
547
+ * Get Order Detail
548
+ *
549
+ * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.
550
+ *
551
+ * Weight: 45000
552
+ *
553
+ * @summary Get Order Detail(USER_DATA)
554
+ * @param {GetOrderDetailRequest} requestParameters Request parameters.
555
+ *
556
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
557
+ * @memberof FiatApiInterface
558
+ */
559
+ getOrderDetail(requestParameters: GetOrderDetailRequest): Promise<RestApiResponse<GetOrderDetailResponse>>;
560
+ }
561
+ /**
562
+ * Request parameters for fiatWithdraw operation in FiatApi.
563
+ * @interface FiatWithdrawRequest
564
+ */
565
+ interface FiatWithdrawRequest {
566
+ /**
567
+ *
568
+ * @type {number | bigint}
569
+ * @memberof FiatApiFiatWithdraw
570
+ */
571
+ readonly recvWindow?: number | bigint;
317
572
  }
318
573
  /**
319
574
  * Request parameters for getFiatDepositWithdrawHistory operation in FiatApi.
@@ -328,34 +583,34 @@ interface GetFiatDepositWithdrawHistoryRequest {
328
583
  readonly transactionType: string;
329
584
  /**
330
585
  *
331
- * @type {number}
586
+ * @type {number | bigint}
332
587
  * @memberof FiatApiGetFiatDepositWithdrawHistory
333
588
  */
334
- readonly beginTime?: number;
589
+ readonly beginTime?: number | bigint;
335
590
  /**
336
591
  *
337
- * @type {number}
592
+ * @type {number | bigint}
338
593
  * @memberof FiatApiGetFiatDepositWithdrawHistory
339
594
  */
340
- readonly endTime?: number;
595
+ readonly endTime?: number | bigint;
341
596
  /**
342
597
  * default 1
343
- * @type {number}
598
+ * @type {number | bigint}
344
599
  * @memberof FiatApiGetFiatDepositWithdrawHistory
345
600
  */
346
- readonly page?: number;
601
+ readonly page?: number | bigint;
347
602
  /**
348
603
  * default 100, max 500
349
- * @type {number}
604
+ * @type {number | bigint}
350
605
  * @memberof FiatApiGetFiatDepositWithdrawHistory
351
606
  */
352
- readonly rows?: number;
607
+ readonly rows?: number | bigint;
353
608
  /**
354
609
  *
355
- * @type {number}
610
+ * @type {number | bigint}
356
611
  * @memberof FiatApiGetFiatDepositWithdrawHistory
357
612
  */
358
- readonly recvWindow?: number;
613
+ readonly recvWindow?: number | bigint;
359
614
  }
360
615
  /**
361
616
  * Request parameters for getFiatPaymentsHistory operation in FiatApi.
@@ -370,34 +625,52 @@ interface GetFiatPaymentsHistoryRequest {
370
625
  readonly transactionType: string;
371
626
  /**
372
627
  *
373
- * @type {number}
628
+ * @type {number | bigint}
374
629
  * @memberof FiatApiGetFiatPaymentsHistory
375
630
  */
376
- readonly beginTime?: number;
631
+ readonly beginTime?: number | bigint;
377
632
  /**
378
633
  *
379
- * @type {number}
634
+ * @type {number | bigint}
380
635
  * @memberof FiatApiGetFiatPaymentsHistory
381
636
  */
382
- readonly endTime?: number;
637
+ readonly endTime?: number | bigint;
383
638
  /**
384
639
  * default 1
385
- * @type {number}
640
+ * @type {number | bigint}
386
641
  * @memberof FiatApiGetFiatPaymentsHistory
387
642
  */
388
- readonly page?: number;
643
+ readonly page?: number | bigint;
389
644
  /**
390
645
  * default 100, max 500
391
- * @type {number}
646
+ * @type {number | bigint}
392
647
  * @memberof FiatApiGetFiatPaymentsHistory
393
648
  */
394
- readonly rows?: number;
649
+ readonly rows?: number | bigint;
395
650
  /**
396
651
  *
397
- * @type {number}
652
+ * @type {number | bigint}
398
653
  * @memberof FiatApiGetFiatPaymentsHistory
399
654
  */
400
- readonly recvWindow?: number;
655
+ readonly recvWindow?: number | bigint;
656
+ }
657
+ /**
658
+ * Request parameters for getOrderDetail operation in FiatApi.
659
+ * @interface GetOrderDetailRequest
660
+ */
661
+ interface GetOrderDetailRequest {
662
+ /**
663
+ * order id retrieved from the api call of withdrawal
664
+ * @type {string}
665
+ * @memberof FiatApiGetOrderDetail
666
+ */
667
+ readonly orderId: string;
668
+ /**
669
+ *
670
+ * @type {number | bigint}
671
+ * @memberof FiatApiGetOrderDetail
672
+ */
673
+ readonly recvWindow?: number | bigint;
401
674
  }
402
675
  /**
403
676
  * FiatApi - object-oriented interface
@@ -407,6 +680,25 @@ declare class FiatApi implements FiatApiInterface {
407
680
  private readonly configuration;
408
681
  private localVarAxiosParamCreator;
409
682
  constructor(configuration: ConfigurationRestAPI);
683
+ /**
684
+ * Submit withdraw request, in this version, we only support BRL withdrawal via bank_transfer.
685
+ *
686
+ * You need to call this api first, and call query order detail api in a loop to get the status of the order until this order is successful.
687
+ *
688
+ * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.
689
+ *
690
+ * you need to bind your bank account on web/app before using the corresponding account number
691
+ *
692
+ * Weight: 45000
693
+ *
694
+ * @summary Fiat Withdraw(WITHDRAW)
695
+ * @param {FiatWithdrawRequest} requestParameters Request parameters.
696
+ * @returns {Promise<RestApiResponse<FiatWithdrawResponse>>}
697
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
698
+ * @memberof FiatApi
699
+ * @see {@link https://developers.binance.com/docs/fiat/rest-api/Fiat-Withdraw Binance API Documentation}
700
+ */
701
+ fiatWithdraw(requestParameters?: FiatWithdrawRequest): Promise<RestApiResponse<FiatWithdrawResponse>>;
410
702
  /**
411
703
  * Get Fiat Deposit/Withdraw History
412
704
  *
@@ -442,6 +734,21 @@ declare class FiatApi implements FiatApiInterface {
442
734
  * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History Binance API Documentation}
443
735
  */
444
736
  getFiatPaymentsHistory(requestParameters: GetFiatPaymentsHistoryRequest): Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>;
737
+ /**
738
+ * Get Order Detail
739
+ *
740
+ * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.
741
+ *
742
+ * Weight: 45000
743
+ *
744
+ * @summary Get Order Detail(USER_DATA)
745
+ * @param {GetOrderDetailRequest} requestParameters Request parameters.
746
+ * @returns {Promise<RestApiResponse<GetOrderDetailResponse>>}
747
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
748
+ * @memberof FiatApi
749
+ * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Order-Detail Binance API Documentation}
750
+ */
751
+ getOrderDetail(requestParameters: GetOrderDetailRequest): Promise<RestApiResponse<GetOrderDetailResponse>>;
445
752
  }
446
753
 
447
754
  /**
@@ -479,6 +786,25 @@ declare class RestAPI {
479
786
  * @returns A promise resolving to the response data object.
480
787
  */
481
788
  sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
789
+ /**
790
+ * Submit withdraw request, in this version, we only support BRL withdrawal via bank_transfer.
791
+ *
792
+ * You need to call this api first, and call query order detail api in a loop to get the status of the order until this order is successful.
793
+ *
794
+ * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.
795
+ *
796
+ * you need to bind your bank account on web/app before using the corresponding account number
797
+ *
798
+ * Weight: 45000
799
+ *
800
+ * @summary Fiat Withdraw(WITHDRAW)
801
+ * @param {FiatWithdrawRequest} requestParameters Request parameters.
802
+ *
803
+ * @returns {Promise<RestApiResponse<FiatWithdrawResponse>>}
804
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
805
+ * @see {@link https://developers.binance.com/docs/fiat/rest-api/Fiat-Withdraw Binance API Documentation}
806
+ */
807
+ fiatWithdraw(requestParameters?: FiatWithdrawRequest): Promise<RestApiResponse<FiatWithdrawResponse>>;
482
808
  /**
483
809
  * Get Fiat Deposit/Withdraw History
484
810
  *
@@ -514,6 +840,21 @@ declare class RestAPI {
514
840
  * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History Binance API Documentation}
515
841
  */
516
842
  getFiatPaymentsHistory(requestParameters: GetFiatPaymentsHistoryRequest): Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>;
843
+ /**
844
+ * Get Order Detail
845
+ *
846
+ * Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website.
847
+ *
848
+ * Weight: 45000
849
+ *
850
+ * @summary Get Order Detail(USER_DATA)
851
+ * @param {GetOrderDetailRequest} requestParameters Request parameters.
852
+ *
853
+ * @returns {Promise<RestApiResponse<GetOrderDetailResponse>>}
854
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
855
+ * @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Order-Detail Binance API Documentation}
856
+ */
857
+ getOrderDetail(requestParameters: GetOrderDetailRequest): Promise<RestApiResponse<GetOrderDetailResponse>>;
517
858
  }
518
859
 
519
860
  /**
@@ -529,19 +870,26 @@ declare class RestAPI {
529
870
  * Do not edit the class manually.
530
871
  */
531
872
 
873
+ type index_DepositResponse = DepositResponse;
874
+ type index_DepositResponseData = DepositResponseData;
532
875
  type index_FiatApi = FiatApi;
533
876
  declare const index_FiatApi: typeof FiatApi;
534
877
  type index_FiatApiInterface = FiatApiInterface;
878
+ type index_FiatWithdrawRequest = FiatWithdrawRequest;
879
+ type index_FiatWithdrawResponse = FiatWithdrawResponse;
535
880
  type index_GetFiatDepositWithdrawHistoryRequest = GetFiatDepositWithdrawHistoryRequest;
536
881
  type index_GetFiatDepositWithdrawHistoryResponse = GetFiatDepositWithdrawHistoryResponse;
537
882
  type index_GetFiatDepositWithdrawHistoryResponseDataInner = GetFiatDepositWithdrawHistoryResponseDataInner;
538
883
  type index_GetFiatPaymentsHistoryRequest = GetFiatPaymentsHistoryRequest;
539
884
  type index_GetFiatPaymentsHistoryResponse = GetFiatPaymentsHistoryResponse;
540
885
  type index_GetFiatPaymentsHistoryResponseDataInner = GetFiatPaymentsHistoryResponseDataInner;
886
+ type index_GetOrderDetailRequest = GetOrderDetailRequest;
887
+ type index_GetOrderDetailResponse = GetOrderDetailResponse;
888
+ type index_GetOrderDetailResponseData = GetOrderDetailResponseData;
541
889
  type index_RestAPI = RestAPI;
542
890
  declare const index_RestAPI: typeof RestAPI;
543
891
  declare namespace index {
544
- export { index_FiatApi as FiatApi, type index_FiatApiInterface as FiatApiInterface, type index_GetFiatDepositWithdrawHistoryRequest as GetFiatDepositWithdrawHistoryRequest, type index_GetFiatDepositWithdrawHistoryResponse as GetFiatDepositWithdrawHistoryResponse, type index_GetFiatDepositWithdrawHistoryResponseDataInner as GetFiatDepositWithdrawHistoryResponseDataInner, type index_GetFiatPaymentsHistoryRequest as GetFiatPaymentsHistoryRequest, type index_GetFiatPaymentsHistoryResponse as GetFiatPaymentsHistoryResponse, type index_GetFiatPaymentsHistoryResponseDataInner as GetFiatPaymentsHistoryResponseDataInner, index_RestAPI as RestAPI };
892
+ export { type index_DepositResponse as DepositResponse, type index_DepositResponseData as DepositResponseData, index_FiatApi as FiatApi, type index_FiatApiInterface as FiatApiInterface, type index_FiatWithdrawRequest as FiatWithdrawRequest, type index_FiatWithdrawResponse as FiatWithdrawResponse, type index_GetFiatDepositWithdrawHistoryRequest as GetFiatDepositWithdrawHistoryRequest, type index_GetFiatDepositWithdrawHistoryResponse as GetFiatDepositWithdrawHistoryResponse, type index_GetFiatDepositWithdrawHistoryResponseDataInner as GetFiatDepositWithdrawHistoryResponseDataInner, type index_GetFiatPaymentsHistoryRequest as GetFiatPaymentsHistoryRequest, type index_GetFiatPaymentsHistoryResponse as GetFiatPaymentsHistoryResponse, type index_GetFiatPaymentsHistoryResponseDataInner as GetFiatPaymentsHistoryResponseDataInner, type index_GetOrderDetailRequest as GetOrderDetailRequest, type index_GetOrderDetailResponse as GetOrderDetailResponse, type index_GetOrderDetailResponseData as GetOrderDetailResponseData, index_RestAPI as RestAPI };
545
893
  }
546
894
 
547
895
  interface ConfigurationFiat {