@binance/wallet 1.0.0 → 2.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.mjs CHANGED
@@ -10,7 +10,7 @@ import { ConfigurationRestAPI as ConfigurationRestAPI7, WALLET_REST_API_PROD_URL
10
10
 
11
11
  // package.json
12
12
  var name = "@binance/wallet";
13
- var version = "1.0.0";
13
+ var version = "2.0.0";
14
14
 
15
15
  // src/rest-api/index.ts
16
16
  var rest_api_exports = {};
@@ -2278,6 +2278,92 @@ import {
2278
2278
  } from "@binance/common";
2279
2279
  var TravelRuleApiAxiosParamCreator = function(configuration) {
2280
2280
  return {
2281
+ /**
2282
+ * Submit a withdrawal request for brokers of local entities that required travel rule.
2283
+ *
2284
+ * If `network` not send, return with default network of the coin, but if the address could not match default network, the withdraw will be rejected.
2285
+ * You can get `network` in `networkList` of a coin in the response
2286
+ * Questionnaire is different for each local entity, please refer to
2287
+ * If getting error like `Questionnaire format not valid.` or `Questionnaire must not be blank`,
2288
+ *
2289
+ * Weight: 600
2290
+ *
2291
+ * @summary Broker Withdraw (for brokers of local entities that require travel rule) (USER_DATA)
2292
+ * @param {string} subAccountId External user ID.
2293
+ * @param {string} address
2294
+ * @param {string} coin
2295
+ * @param {number} amount
2296
+ * @param {string} withdrawOrderId withdrawID defined by the client (i.e. client's internal withdrawID)
2297
+ * @param {string} questionnaire JSON format questionnaire answers.
2298
+ * @param {string} originatorPii JSON format originator Pii, see StandardPii section below
2299
+ * @param {string} signature Must be the last parameter.
2300
+ * @param {string} [addressTag] Secondary address identifier for coins like XRP,XMR etc.
2301
+ * @param {string} [network]
2302
+ * @param {string} [addressName] Description of the address. Address book cap is 200, space in name should be encoded into `%20`
2303
+ * @param {boolean} [transactionFeeFlag] When making internal transfer, `true` for returning the fee to the destination account; `false` for returning the fee back to the departure account. Default `false`.
2304
+ * @param {number} [walletType] The wallet type for withdraw,0-spot wallet ,1-funding wallet. Default walletType is the current "selected wallet" under wallet->Fiat and Spot/Funding->Deposit
2305
+ *
2306
+ * @throws {RequiredError}
2307
+ */
2308
+ brokerWithdraw: async (subAccountId, address, coin, amount, withdrawOrderId, questionnaire, originatorPii, signature, addressTag, network, addressName, transactionFeeFlag, walletType) => {
2309
+ assertParamExists4("brokerWithdraw", "subAccountId", subAccountId);
2310
+ assertParamExists4("brokerWithdraw", "address", address);
2311
+ assertParamExists4("brokerWithdraw", "coin", coin);
2312
+ assertParamExists4("brokerWithdraw", "amount", amount);
2313
+ assertParamExists4("brokerWithdraw", "withdrawOrderId", withdrawOrderId);
2314
+ assertParamExists4("brokerWithdraw", "questionnaire", questionnaire);
2315
+ assertParamExists4("brokerWithdraw", "originatorPii", originatorPii);
2316
+ assertParamExists4("brokerWithdraw", "signature", signature);
2317
+ const localVarQueryParameter = {};
2318
+ if (subAccountId !== void 0 && subAccountId !== null) {
2319
+ localVarQueryParameter["subAccountId"] = subAccountId;
2320
+ }
2321
+ if (address !== void 0 && address !== null) {
2322
+ localVarQueryParameter["address"] = address;
2323
+ }
2324
+ if (addressTag !== void 0 && addressTag !== null) {
2325
+ localVarQueryParameter["addressTag"] = addressTag;
2326
+ }
2327
+ if (network !== void 0 && network !== null) {
2328
+ localVarQueryParameter["network"] = network;
2329
+ }
2330
+ if (coin !== void 0 && coin !== null) {
2331
+ localVarQueryParameter["coin"] = coin;
2332
+ }
2333
+ if (addressName !== void 0 && addressName !== null) {
2334
+ localVarQueryParameter["addressName"] = addressName;
2335
+ }
2336
+ if (amount !== void 0 && amount !== null) {
2337
+ localVarQueryParameter["amount"] = amount;
2338
+ }
2339
+ if (withdrawOrderId !== void 0 && withdrawOrderId !== null) {
2340
+ localVarQueryParameter["withdrawOrderId"] = withdrawOrderId;
2341
+ }
2342
+ if (transactionFeeFlag !== void 0 && transactionFeeFlag !== null) {
2343
+ localVarQueryParameter["transactionFeeFlag"] = transactionFeeFlag;
2344
+ }
2345
+ if (walletType !== void 0 && walletType !== null) {
2346
+ localVarQueryParameter["walletType"] = walletType;
2347
+ }
2348
+ if (questionnaire !== void 0 && questionnaire !== null) {
2349
+ localVarQueryParameter["questionnaire"] = questionnaire;
2350
+ }
2351
+ if (originatorPii !== void 0 && originatorPii !== null) {
2352
+ localVarQueryParameter["originatorPii"] = originatorPii;
2353
+ }
2354
+ if (signature !== void 0 && signature !== null) {
2355
+ localVarQueryParameter["signature"] = signature;
2356
+ }
2357
+ let _timeUnit;
2358
+ if ("timeUnit" in configuration)
2359
+ _timeUnit = configuration.timeUnit;
2360
+ return {
2361
+ endpoint: "/sapi/v1/localentity/broker/withdraw/apply",
2362
+ method: "POST",
2363
+ params: localVarQueryParameter,
2364
+ timeUnit: _timeUnit
2365
+ };
2366
+ },
2281
2367
  /**
2282
2368
  * Fetch deposit history for local entities that required travel rule.
2283
2369
  *
@@ -2373,6 +2459,77 @@ var TravelRuleApiAxiosParamCreator = function(configuration) {
2373
2459
  timeUnit: _timeUnit
2374
2460
  };
2375
2461
  },
2462
+ /**
2463
+ * Submit questionnaire for brokers of local entities that require travel rule.
2464
+ * The questionnaire is only applies to transactions from un-hosted wallets or VASPs that are not
2465
+ * yet onboarded with GTR.
2466
+ *
2467
+ * Questionnaire is different for each local entity, please refer
2468
+ * If getting error like `Questionnaire format not valid.` or `Questionnaire must not be blank`,
2469
+ *
2470
+ * Weight: 600
2471
+ *
2472
+ * @summary Submit Deposit Questionnaire (For local entities that require travel rule) (supporting network) (USER_DATA)
2473
+ * @param {string} subAccountId External user ID.
2474
+ * @param {string} depositId Wallet deposit ID.
2475
+ * @param {string} questionnaire JSON format questionnaire answers.
2476
+ * @param {string} beneficiaryPii JSON format beneficiary Pii.
2477
+ * @param {string} signature Must be the last parameter.
2478
+ * @param {string} [network]
2479
+ * @param {string} [coin]
2480
+ * @param {number} [amount]
2481
+ * @param {string} [address]
2482
+ * @param {string} [addressTag] Secondary address identifier for coins like XRP,XMR etc.
2483
+ *
2484
+ * @throws {RequiredError}
2485
+ */
2486
+ submitDepositQuestionnaire: async (subAccountId, depositId, questionnaire, beneficiaryPii, signature, network, coin, amount, address, addressTag) => {
2487
+ assertParamExists4("submitDepositQuestionnaire", "subAccountId", subAccountId);
2488
+ assertParamExists4("submitDepositQuestionnaire", "depositId", depositId);
2489
+ assertParamExists4("submitDepositQuestionnaire", "questionnaire", questionnaire);
2490
+ assertParamExists4("submitDepositQuestionnaire", "beneficiaryPii", beneficiaryPii);
2491
+ assertParamExists4("submitDepositQuestionnaire", "signature", signature);
2492
+ const localVarQueryParameter = {};
2493
+ if (subAccountId !== void 0 && subAccountId !== null) {
2494
+ localVarQueryParameter["subAccountId"] = subAccountId;
2495
+ }
2496
+ if (depositId !== void 0 && depositId !== null) {
2497
+ localVarQueryParameter["depositId"] = depositId;
2498
+ }
2499
+ if (questionnaire !== void 0 && questionnaire !== null) {
2500
+ localVarQueryParameter["questionnaire"] = questionnaire;
2501
+ }
2502
+ if (beneficiaryPii !== void 0 && beneficiaryPii !== null) {
2503
+ localVarQueryParameter["beneficiaryPii"] = beneficiaryPii;
2504
+ }
2505
+ if (network !== void 0 && network !== null) {
2506
+ localVarQueryParameter["network"] = network;
2507
+ }
2508
+ if (coin !== void 0 && coin !== null) {
2509
+ localVarQueryParameter["coin"] = coin;
2510
+ }
2511
+ if (amount !== void 0 && amount !== null) {
2512
+ localVarQueryParameter["amount"] = amount;
2513
+ }
2514
+ if (address !== void 0 && address !== null) {
2515
+ localVarQueryParameter["address"] = address;
2516
+ }
2517
+ if (addressTag !== void 0 && addressTag !== null) {
2518
+ localVarQueryParameter["addressTag"] = addressTag;
2519
+ }
2520
+ if (signature !== void 0 && signature !== null) {
2521
+ localVarQueryParameter["signature"] = signature;
2522
+ }
2523
+ let _timeUnit;
2524
+ if ("timeUnit" in configuration)
2525
+ _timeUnit = configuration.timeUnit;
2526
+ return {
2527
+ endpoint: "/sapi/v1/localentity/broker/deposit/provide-info",
2528
+ method: "PUT",
2529
+ params: localVarQueryParameter,
2530
+ timeUnit: _timeUnit
2531
+ };
2532
+ },
2376
2533
  /**
2377
2534
  * Submit questionnaire for local entities that require travel rule.
2378
2535
  * The questionnaire is only applies to transactions from unhosted wallets or VASPs that are not
@@ -2384,14 +2541,18 @@ var TravelRuleApiAxiosParamCreator = function(configuration) {
2384
2541
  * Weight: 600
2385
2542
  *
2386
2543
  * @summary Submit Deposit Questionnaire (For local entities that require travel rule) (supporting network) (USER_DATA)
2387
- * @param {number} tranId Wallet tran Id
2544
+ * @param {number} tranId Wallet tran ID
2388
2545
  * @param {string} questionnaire JSON format questionnaire answers.
2389
2546
  *
2390
2547
  * @throws {RequiredError}
2391
2548
  */
2392
- submitDepositQuestionnaire: async (tranId, questionnaire) => {
2393
- assertParamExists4("submitDepositQuestionnaire", "tranId", tranId);
2394
- assertParamExists4("submitDepositQuestionnaire", "questionnaire", questionnaire);
2549
+ submitDepositQuestionnaireTravelRule: async (tranId, questionnaire) => {
2550
+ assertParamExists4("submitDepositQuestionnaireTravelRule", "tranId", tranId);
2551
+ assertParamExists4(
2552
+ "submitDepositQuestionnaireTravelRule",
2553
+ "questionnaire",
2554
+ questionnaire
2555
+ );
2395
2556
  const localVarQueryParameter = {};
2396
2557
  if (tranId !== void 0 && tranId !== null) {
2397
2558
  localVarQueryParameter["tranId"] = tranId;
@@ -2503,7 +2664,7 @@ var TravelRuleApiAxiosParamCreator = function(configuration) {
2503
2664
  * limit is 180000/second. Response from the endpoint contains header
2504
2665
  * key X-SAPI-USED-IP-WEIGHT-1S, which defines weight used by the current IP.
2505
2666
  *
2506
- * @summary Withdraw History (for local entities that require travel rule) (supporting network) (USER_DATA)
2667
+ * @summary Withdraw History V2 (for local entities that require travel rule) (supporting network) (USER_DATA)
2507
2668
  * @param {string} [trId] Comma(,) separated list of travel rule record Ids.
2508
2669
  * @param {string} [txId]
2509
2670
  * @param {string} [withdrawOrderId]
@@ -2644,6 +2805,48 @@ var TravelRuleApi = class {
2644
2805
  this.configuration = configuration;
2645
2806
  this.localVarAxiosParamCreator = TravelRuleApiAxiosParamCreator(configuration);
2646
2807
  }
2808
+ /**
2809
+ * Submit a withdrawal request for brokers of local entities that required travel rule.
2810
+ *
2811
+ * If `network` not send, return with default network of the coin, but if the address could not match default network, the withdraw will be rejected.
2812
+ * You can get `network` in `networkList` of a coin in the response
2813
+ * Questionnaire is different for each local entity, please refer to
2814
+ * If getting error like `Questionnaire format not valid.` or `Questionnaire must not be blank`,
2815
+ *
2816
+ * Weight: 600
2817
+ *
2818
+ * @summary Broker Withdraw (for brokers of local entities that require travel rule) (USER_DATA)
2819
+ * @param {BrokerWithdrawRequest} requestParameters Request parameters.
2820
+ * @returns {Promise<RestApiResponse<BrokerWithdrawResponse>>}
2821
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2822
+ * @memberof TravelRuleApi
2823
+ * @see {@link https://developers.binance.com/docs/wallet/travel-rule/Broker-Withdraw Binance API Documentation}
2824
+ */
2825
+ async brokerWithdraw(requestParameters) {
2826
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.brokerWithdraw(
2827
+ requestParameters?.subAccountId,
2828
+ requestParameters?.address,
2829
+ requestParameters?.coin,
2830
+ requestParameters?.amount,
2831
+ requestParameters?.withdrawOrderId,
2832
+ requestParameters?.questionnaire,
2833
+ requestParameters?.originatorPii,
2834
+ requestParameters?.signature,
2835
+ requestParameters?.addressTag,
2836
+ requestParameters?.network,
2837
+ requestParameters?.addressName,
2838
+ requestParameters?.transactionFeeFlag,
2839
+ requestParameters?.walletType
2840
+ );
2841
+ return sendRequest5(
2842
+ this.configuration,
2843
+ localVarAxiosArgs.endpoint,
2844
+ localVarAxiosArgs.method,
2845
+ localVarAxiosArgs.params,
2846
+ localVarAxiosArgs?.timeUnit,
2847
+ { isSigned: true }
2848
+ );
2849
+ }
2647
2850
  /**
2648
2851
  * Fetch deposit history for local entities that required travel rule.
2649
2852
  *
@@ -2711,8 +2914,8 @@ var TravelRuleApi = class {
2711
2914
  );
2712
2915
  }
2713
2916
  /**
2714
- * Submit questionnaire for local entities that require travel rule.
2715
- * The questionnaire is only applies to transactions from unhosted wallets or VASPs that are not
2917
+ * Submit questionnaire for brokers of local entities that require travel rule.
2918
+ * The questionnaire is only applies to transactions from un-hosted wallets or VASPs that are not
2716
2919
  * yet onboarded with GTR.
2717
2920
  *
2718
2921
  * Questionnaire is different for each local entity, please refer
@@ -2729,6 +2932,45 @@ var TravelRuleApi = class {
2729
2932
  */
2730
2933
  async submitDepositQuestionnaire(requestParameters) {
2731
2934
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.submitDepositQuestionnaire(
2935
+ requestParameters?.subAccountId,
2936
+ requestParameters?.depositId,
2937
+ requestParameters?.questionnaire,
2938
+ requestParameters?.beneficiaryPii,
2939
+ requestParameters?.signature,
2940
+ requestParameters?.network,
2941
+ requestParameters?.coin,
2942
+ requestParameters?.amount,
2943
+ requestParameters?.address,
2944
+ requestParameters?.addressTag
2945
+ );
2946
+ return sendRequest5(
2947
+ this.configuration,
2948
+ localVarAxiosArgs.endpoint,
2949
+ localVarAxiosArgs.method,
2950
+ localVarAxiosArgs.params,
2951
+ localVarAxiosArgs?.timeUnit,
2952
+ { isSigned: true }
2953
+ );
2954
+ }
2955
+ /**
2956
+ * Submit questionnaire for local entities that require travel rule.
2957
+ * The questionnaire is only applies to transactions from unhosted wallets or VASPs that are not
2958
+ * yet onboarded with GTR.
2959
+ *
2960
+ * Questionnaire is different for each local entity, please refer
2961
+ * If getting error like `Questionnaire format not valid.` or `Questionnaire must not be blank`,
2962
+ *
2963
+ * Weight: 600
2964
+ *
2965
+ * @summary Submit Deposit Questionnaire (For local entities that require travel rule) (supporting network) (USER_DATA)
2966
+ * @param {SubmitDepositQuestionnaireTravelRuleRequest} requestParameters Request parameters.
2967
+ * @returns {Promise<RestApiResponse<SubmitDepositQuestionnaireTravelRuleResponse>>}
2968
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2969
+ * @memberof TravelRuleApi
2970
+ * @see {@link https://developers.binance.com/docs/wallet/travel-rule/deposit-provide-info Binance API Documentation}
2971
+ */
2972
+ async submitDepositQuestionnaireTravelRule(requestParameters) {
2973
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.submitDepositQuestionnaireTravelRule(
2732
2974
  requestParameters?.tranId,
2733
2975
  requestParameters?.questionnaire
2734
2976
  );
@@ -2805,12 +3047,12 @@ var TravelRuleApi = class {
2805
3047
  * limit is 180000/second. Response from the endpoint contains header
2806
3048
  * key X-SAPI-USED-IP-WEIGHT-1S, which defines weight used by the current IP.
2807
3049
  *
2808
- * @summary Withdraw History (for local entities that require travel rule) (supporting network) (USER_DATA)
3050
+ * @summary Withdraw History V2 (for local entities that require travel rule) (supporting network) (USER_DATA)
2809
3051
  * @param {WithdrawHistoryV2Request} requestParameters Request parameters.
2810
3052
  * @returns {Promise<RestApiResponse<WithdrawHistoryV2Response>>}
2811
3053
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2812
3054
  * @memberof TravelRuleApi
2813
- * @see {@link https://developers.binance.com/docs/wallet/travel-rule/Withdraw-History Binance API Documentation}
3055
+ * @see {@link https://developers.binance.com/docs/wallet/travel-rule/Withdraw-History-V2 Binance API Documentation}
2814
3056
  */
2815
3057
  async withdrawHistoryV2(requestParameters = {}) {
2816
3058
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.withdrawHistoryV2(
@@ -3457,6 +3699,25 @@ var RestAPI = class {
3457
3699
  systemStatus() {
3458
3700
  return this.othersApi.systemStatus();
3459
3701
  }
3702
+ /**
3703
+ * Submit a withdrawal request for brokers of local entities that required travel rule.
3704
+ *
3705
+ * If `network` not send, return with default network of the coin, but if the address could not match default network, the withdraw will be rejected.
3706
+ * You can get `network` in `networkList` of a coin in the response
3707
+ * Questionnaire is different for each local entity, please refer to
3708
+ * If getting error like `Questionnaire format not valid.` or `Questionnaire must not be blank`,
3709
+ *
3710
+ * Weight: 600
3711
+ *
3712
+ * @summary Broker Withdraw (for brokers of local entities that require travel rule) (USER_DATA)
3713
+ * @param {BrokerWithdrawRequest} requestParameters Request parameters.
3714
+ * @returns {Promise<RestApiResponse<BrokerWithdrawResponse>>}
3715
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3716
+ * @see {@link https://developers.binance.com/docs/wallet/travel-rule/Broker-Withdraw Binance API Documentation}
3717
+ */
3718
+ brokerWithdraw(requestParameters) {
3719
+ return this.travelRuleApi.brokerWithdraw(requestParameters);
3720
+ }
3460
3721
  /**
3461
3722
  * Fetch deposit history for local entities that required travel rule.
3462
3723
  *
@@ -3494,8 +3755,8 @@ var RestAPI = class {
3494
3755
  return this.travelRuleApi.onboardedVaspList();
3495
3756
  }
3496
3757
  /**
3497
- * Submit questionnaire for local entities that require travel rule.
3498
- * The questionnaire is only applies to transactions from unhosted wallets or VASPs that are not
3758
+ * Submit questionnaire for brokers of local entities that require travel rule.
3759
+ * The questionnaire is only applies to transactions from un-hosted wallets or VASPs that are not
3499
3760
  * yet onboarded with GTR.
3500
3761
  *
3501
3762
  * Questionnaire is different for each local entity, please refer
@@ -3512,6 +3773,25 @@ var RestAPI = class {
3512
3773
  submitDepositQuestionnaire(requestParameters) {
3513
3774
  return this.travelRuleApi.submitDepositQuestionnaire(requestParameters);
3514
3775
  }
3776
+ /**
3777
+ * Submit questionnaire for local entities that require travel rule.
3778
+ * The questionnaire is only applies to transactions from unhosted wallets or VASPs that are not
3779
+ * yet onboarded with GTR.
3780
+ *
3781
+ * Questionnaire is different for each local entity, please refer
3782
+ * If getting error like `Questionnaire format not valid.` or `Questionnaire must not be blank`,
3783
+ *
3784
+ * Weight: 600
3785
+ *
3786
+ * @summary Submit Deposit Questionnaire (For local entities that require travel rule) (supporting network) (USER_DATA)
3787
+ * @param {SubmitDepositQuestionnaireTravelRuleRequest} requestParameters Request parameters.
3788
+ * @returns {Promise<RestApiResponse<SubmitDepositQuestionnaireTravelRuleResponse>>}
3789
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3790
+ * @see {@link https://developers.binance.com/docs/wallet/travel-rule/deposit-provide-info Binance API Documentation}
3791
+ */
3792
+ submitDepositQuestionnaireTravelRule(requestParameters) {
3793
+ return this.travelRuleApi.submitDepositQuestionnaireTravelRule(requestParameters);
3794
+ }
3515
3795
  /**
3516
3796
  * Fetch withdraw history for local entities that required travel rule.
3517
3797
  *
@@ -3555,11 +3835,11 @@ var RestAPI = class {
3555
3835
  * limit is 180000/second. Response from the endpoint contains header
3556
3836
  * key X-SAPI-USED-IP-WEIGHT-1S, which defines weight used by the current IP.
3557
3837
  *
3558
- * @summary Withdraw History (for local entities that require travel rule) (supporting network) (USER_DATA)
3838
+ * @summary Withdraw History V2 (for local entities that require travel rule) (supporting network) (USER_DATA)
3559
3839
  * @param {WithdrawHistoryV2Request} requestParameters Request parameters.
3560
3840
  * @returns {Promise<RestApiResponse<WithdrawHistoryV2Response>>}
3561
3841
  * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
3562
- * @see {@link https://developers.binance.com/docs/wallet/travel-rule/Withdraw-History Binance API Documentation}
3842
+ * @see {@link https://developers.binance.com/docs/wallet/travel-rule/Withdraw-History-V2 Binance API Documentation}
3563
3843
  */
3564
3844
  withdrawHistoryV2(requestParameters = {}) {
3565
3845
  return this.travelRuleApi.withdrawHistoryV2(requestParameters);