@binance/crypto-loan 3.0.0 → 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.mjs CHANGED
@@ -10,7 +10,7 @@ import { ConfigurationRestAPI as ConfigurationRestAPI4, CRYPTO_LOAN_REST_API_PRO
10
10
 
11
11
  // package.json
12
12
  var name = "@binance/crypto-loan";
13
- var version = "3.0.0";
13
+ var version = "5.0.0";
14
14
 
15
15
  // src/rest-api/index.ts
16
16
  var rest_api_exports = {};
@@ -144,48 +144,6 @@ var FlexibleRateApiAxiosParamCreator = function(configuration) {
144
144
  timeUnit: _timeUnit
145
145
  };
146
146
  },
147
- /**
148
- *
149
- * Weight: 6000
150
- *
151
- * @summary Flexible Loan Collateral Repayment (TRADE)
152
- * @param {string} loanCoin
153
- * @param {string} collateralCoin
154
- * @param {number} repayAmount repay amount of loanCoin
155
- * @param {boolean} [fullRepayment] Default: FALSE. TRUE: Full repayment; FALSE: Partial repayment, based on loanAmount
156
- * @param {number} [recvWindow]
157
- *
158
- * @throws {RequiredError}
159
- */
160
- flexibleLoanCollateralRepayment: async (loanCoin, collateralCoin, repayAmount, fullRepayment, recvWindow) => {
161
- assertParamExists("flexibleLoanCollateralRepayment", "loanCoin", loanCoin);
162
- assertParamExists("flexibleLoanCollateralRepayment", "collateralCoin", collateralCoin);
163
- assertParamExists("flexibleLoanCollateralRepayment", "repayAmount", repayAmount);
164
- const localVarQueryParameter = {};
165
- if (loanCoin !== void 0 && loanCoin !== null) {
166
- localVarQueryParameter["loanCoin"] = loanCoin;
167
- }
168
- if (collateralCoin !== void 0 && collateralCoin !== null) {
169
- localVarQueryParameter["collateralCoin"] = collateralCoin;
170
- }
171
- if (repayAmount !== void 0 && repayAmount !== null) {
172
- localVarQueryParameter["repayAmount"] = repayAmount;
173
- }
174
- if (fullRepayment !== void 0 && fullRepayment !== null) {
175
- localVarQueryParameter["fullRepayment"] = fullRepayment;
176
- }
177
- if (recvWindow !== void 0 && recvWindow !== null) {
178
- localVarQueryParameter["recvWindow"] = recvWindow;
179
- }
180
- let _timeUnit;
181
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
182
- return {
183
- endpoint: "/sapi/v2/loan/flexible/repay/collateral",
184
- method: "POST",
185
- params: localVarQueryParameter,
186
- timeUnit: _timeUnit
187
- };
188
- },
189
147
  /**
190
148
  * Flexible Loan Repay
191
149
  *
@@ -200,11 +158,12 @@ var FlexibleRateApiAxiosParamCreator = function(configuration) {
200
158
  * @param {number} repayAmount repay amount of loanCoin
201
159
  * @param {boolean} [collateralReturn] Default: TRUE. TRUE: Return extra collateral to spot account; FALSE: Keep extra collateral in the order, and lower LTV.
202
160
  * @param {boolean} [fullRepayment] Default: FALSE. TRUE: Full repayment; FALSE: Partial repayment, based on loanAmount
161
+ * @param {number} [repaymentType] Default: 1. 1: Repayment with loan asset; 2: Repayment with collateral
203
162
  * @param {number} [recvWindow]
204
163
  *
205
164
  * @throws {RequiredError}
206
165
  */
207
- flexibleLoanRepay: async (loanCoin, collateralCoin, repayAmount, collateralReturn, fullRepayment, recvWindow) => {
166
+ flexibleLoanRepay: async (loanCoin, collateralCoin, repayAmount, collateralReturn, fullRepayment, repaymentType, recvWindow) => {
208
167
  assertParamExists("flexibleLoanRepay", "loanCoin", loanCoin);
209
168
  assertParamExists("flexibleLoanRepay", "collateralCoin", collateralCoin);
210
169
  assertParamExists("flexibleLoanRepay", "repayAmount", repayAmount);
@@ -224,6 +183,9 @@ var FlexibleRateApiAxiosParamCreator = function(configuration) {
224
183
  if (fullRepayment !== void 0 && fullRepayment !== null) {
225
184
  localVarQueryParameter["fullRepayment"] = fullRepayment;
226
185
  }
186
+ if (repaymentType !== void 0 && repaymentType !== null) {
187
+ localVarQueryParameter["repaymentType"] = repaymentType;
188
+ }
227
189
  if (recvWindow !== void 0 && recvWindow !== null) {
228
190
  localVarQueryParameter["recvWindow"] = recvWindow;
229
191
  }
@@ -627,34 +589,6 @@ var FlexibleRateApi = class {
627
589
  { isSigned: true }
628
590
  );
629
591
  }
630
- /**
631
- *
632
- * Weight: 6000
633
- *
634
- * @summary Flexible Loan Collateral Repayment (TRADE)
635
- * @param {FlexibleLoanCollateralRepaymentRequest} requestParameters Request parameters.
636
- * @returns {Promise<RestApiResponse<FlexibleLoanCollateralRepaymentResponse>>}
637
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
638
- * @memberof FlexibleRateApi
639
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Collateral-Repay Binance API Documentation}
640
- */
641
- async flexibleLoanCollateralRepayment(requestParameters) {
642
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.flexibleLoanCollateralRepayment(
643
- requestParameters?.loanCoin,
644
- requestParameters?.collateralCoin,
645
- requestParameters?.repayAmount,
646
- requestParameters?.fullRepayment,
647
- requestParameters?.recvWindow
648
- );
649
- return sendRequest(
650
- this.configuration,
651
- localVarAxiosArgs.endpoint,
652
- localVarAxiosArgs.method,
653
- localVarAxiosArgs.params,
654
- localVarAxiosArgs?.timeUnit,
655
- { isSigned: true }
656
- );
657
- }
658
592
  /**
659
593
  * Flexible Loan Repay
660
594
  *
@@ -677,6 +611,7 @@ var FlexibleRateApi = class {
677
611
  requestParameters?.repayAmount,
678
612
  requestParameters?.collateralReturn,
679
613
  requestParameters?.fullRepayment,
614
+ requestParameters?.repaymentType,
680
615
  requestParameters?.recvWindow
681
616
  );
682
617
  return sendRequest(
@@ -1871,19 +1806,6 @@ var RestAPI = class {
1871
1806
  flexibleLoanBorrow(requestParameters) {
1872
1807
  return this.flexibleRateApi.flexibleLoanBorrow(requestParameters);
1873
1808
  }
1874
- /**
1875
- *
1876
- * Weight: 6000
1877
- *
1878
- * @summary Flexible Loan Collateral Repayment (TRADE)
1879
- * @param {FlexibleLoanCollateralRepaymentRequest} requestParameters Request parameters.
1880
- * @returns {Promise<RestApiResponse<FlexibleLoanCollateralRepaymentResponse>>}
1881
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1882
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Collateral-Repay Binance API Documentation}
1883
- */
1884
- flexibleLoanCollateralRepayment(requestParameters) {
1885
- return this.flexibleRateApi.flexibleLoanCollateralRepayment(requestParameters);
1886
- }
1887
1809
  /**
1888
1810
  * Flexible Loan Repay
1889
1811
  *