Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Aug 25, 2023
1 parent 91cc9ed commit 084a055
Show file tree
Hide file tree
Showing 15 changed files with 1,524 additions and 317 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ A Discord server is available [here](https://discord.gg/MSpeEtSY8t). For discuss
* Version 9.1.0 - 25 Aug 2023
* Removed deprecated endpoints
* Updated models
* Added support for rate limiting on the socket client
* Updated the weights and rate limits for the websocket API
* Added restClient.GeneralApi.Futures.GetAdjustCrossCollateralLoanToValueHistoryAsync
* Added restClient.GeneralApi.Futures.GetCrossCollateralLiquidationHistoryAsync
* Added restClient.GeneralApi.Futures.GetCrossCollateralInterestHistoryAsync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ var result = await client.CoinFuturesApi.SubscribeToUserDataUpdatesAsync(/* para
```

```csharp
Task<CallResult<UpdateSubscription>> SubscribeToUserDataUpdatesAsync(string listenKey, Action<DataEvent<BinanceFuturesStreamConfigUpdate>>? onLeverageUpdate, Action<DataEvent<BinanceFuturesStreamMarginUpdate>>? onMarginUpdate, Action<DataEvent<BinanceFuturesStreamAccountUpdate>>? onAccountUpdate, Action<DataEvent<BinanceFuturesStreamOrderUpdate>>? onOrderUpdate, Action<DataEvent<BinanceStreamEvent>> onListenKeyExpired, CancellationToken ct = default);
Task<CallResult<UpdateSubscription>> SubscribeToUserDataUpdatesAsync(string listenKey, Action<DataEvent<BinanceFuturesStreamConfigUpdate>>? onLeverageUpdate, Action<DataEvent<BinanceFuturesStreamMarginUpdate>>? onMarginUpdate, Action<DataEvent<BinanceFuturesStreamAccountUpdate>>? onAccountUpdate, Action<DataEvent<BinanceFuturesStreamOrderUpdate>>? onOrderUpdate, Action<DataEvent<BinanceStreamEvent>> onListenKeyExpired, Action<DataEvent<BinanceStrategyUpdate>>? onStrategyUpdate, Action<DataEvent<BinanceGridUpdate>>? onGridUpdate, CancellationToken ct = default);
```

|Parameter|Description|
Expand All @@ -984,6 +984,8 @@ Task<CallResult<UpdateSubscription>> SubscribeToUserDataUpdatesAsync(string list
|onAccountUpdate|The event handler for whenever an account update is received|
|onOrderUpdate|The event handler for whenever an order status update is received|
|onListenKeyExpired|Responds when the listen key for the stream has expired. Initiate a new instance of the stream here|
|onStrategyUpdate|The event handler for whenever a strategy update is received|
|onGridUpdate|The event handler for whenever a grid update is received|
|_[Optional]_ ct|Cancellation token for closing this subscription|

</p>
3 changes: 3 additions & 0 deletions docs/ClientInfo/GeneralApi/IBinanceRestClientGeneralApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ parent: Rest API documentation
*Endpoints related to savings*
**[IBinanceRestClientGeneralApiSavings](IBinanceRestClientGeneralApiSavings.html) Savings { get; }**
***
*Endpoints related to staking*
**[IBinanceRestClientGeneralApiStaking](IBinanceRestClientGeneralApiStaking.html) Staking { get; }**
***
*Endpoints related to requesting data for and controlling sub accounts*
**[IBinanceRestClientGeneralApiSubAccount](IBinanceRestClientGeneralApiSubAccount.html) SubAccount { get; }**
156 changes: 9 additions & 147 deletions docs/ClientInfo/GeneralApi/IBinanceRestClientGeneralApiFutures.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,64 +9,6 @@ grand_parent: Rest API documentation
*Binance futures interaction endpoints*


***

## AdjustCrossCollateralLoanToValueAsync

[https://binance-docs.github.io/apidocs/spot/en/#adjust-cross-collateral-ltv-v2-trade](https://binance-docs.github.io/apidocs/spot/en/#adjust-cross-collateral-ltv-v2-trade)
<p>

*Adjust cross collateral LTV*

```csharp
var client = new BinanceRestClient();
var result = await client.GeneralApi.Futures.AdjustCrossCollateralLoanToValueAsync(/* parameters */);
```

```csharp
Task<WebCallResult<BinanceCrossCollateralAdjustLtvResult>> AdjustCrossCollateralLoanToValueAsync(string collateralAsset, string loanAsset, decimal quantity, AdjustRateDirection direction, long? receiveWindow = default, CancellationToken ct = default);
```

|Parameter|Description|
|---|---|
|collateralAsset|The collateral asset|
|loanAsset|The loan asset|
|quantity|The quantity|
|direction|The direction|
|_[Optional]_ receiveWindow|The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request|
|_[Optional]_ ct|Cancellation token|

</p>

***

## BorrowForCrossCollateralAsync

[https://binance-docs.github.io/apidocs/spot/en/#borrow-for-cross-collateral-trade](https://binance-docs.github.io/apidocs/spot/en/#borrow-for-cross-collateral-trade)
<p>

*Borrow for cross-collateral*

```csharp
var client = new BinanceRestClient();
var result = await client.GeneralApi.Futures.BorrowForCrossCollateralAsync(/* parameters */);
```

```csharp
Task<WebCallResult<BinanceCrossCollateralBorrowResult>> BorrowForCrossCollateralAsync(string asset, string collateralAsset, decimal? quantity = default, decimal? collateralQuantity = default, long? receiveWindow = default, CancellationToken ct = default);
```

|Parameter|Description|
|---|---|
|asset|The asset to borrow|
|collateralAsset|The asset to use as collateral|
|_[Optional]_ quantity|The quantity to borrow|
|_[Optional]_ collateralQuantity|The quantity of collateral asset to use|
|_[Optional]_ receiveWindow|The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request|
|_[Optional]_ ct|Cancellation token|

</p>

***

## GetAdjustCrossCollateralLoanToValueHistoryAsync
Expand Down Expand Up @@ -128,24 +70,28 @@ Task<WebCallResult<BinanceQueryRecords<BinanceCrossCollateralBorrowHistory>>> Ge

***

## GetCrossCollateralInformationAsync
## GetCrossCollateralInterestHistoryAsync

[https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-information-v2-user_data](https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-information-v2-user_data)
[https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-interest-history-user_data](https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-interest-history-user_data)
<p>

*Get cross-collateral info*
*Get cross collateral interest history*

```csharp
var client = new BinanceRestClient();
var result = await client.GeneralApi.Futures.GetCrossCollateralInformationAsync();
var result = await client.GeneralApi.Futures.GetCrossCollateralInterestHistoryAsync();
```

```csharp
Task<WebCallResult<IEnumerable<BinanceCrossCollateralInformation>>> GetCrossCollateralInformationAsync(long? receiveWindow = default, CancellationToken ct = default);
Task<WebCallResult<BinanceQueryRecords<BinanceCrossCollateralInterestHistory>>> GetCrossCollateralInterestHistoryAsync(string? collateralAsset = default, DateTime? startTime = default, DateTime? endTime = default, int? limit = default, long? receiveWindow = default, CancellationToken ct = default);
```

|Parameter|Description|
|---|---|
|_[Optional]_ collateralAsset|The collateral asset|
|_[Optional]_ startTime|Filter by start time|
|_[Optional]_ endTime|Filter by end time|
|_[Optional]_ limit|The page size|
|_[Optional]_ receiveWindow|The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request|
|_[Optional]_ ct|Cancellation token|

Expand Down Expand Up @@ -267,90 +213,6 @@ Task<WebCallResult<BinanceQueryRecords<BinanceSpotFuturesTransfer>>> GetFuturesT

***

## GetMaxAmountForAdjustCrossCollateralLoanToValueAsync

[https://binance-docs.github.io/apidocs/spot/en/#get-max-amount-for-adjust-cross-collateral-ltv-v2-user_data](https://binance-docs.github.io/apidocs/spot/en/#get-max-amount-for-adjust-cross-collateral-ltv-v2-user_data)
<p>

*Get max quantity for adjust cross-collateral LTV*

```csharp
var client = new BinanceRestClient();
var result = await client.GeneralApi.Futures.GetMaxAmountForAdjustCrossCollateralLoanToValueAsync(/* parameters */);
```

```csharp
Task<WebCallResult<BinanceCrossCollateralAdjustMaxAmounts>> GetMaxAmountForAdjustCrossCollateralLoanToValueAsync(string collateralAsset, string loanAsset, long? receiveWindow = default, CancellationToken ct = default);
```

|Parameter|Description|
|---|---|
|collateralAsset|The collateral asset|
|loanAsset|The loan asset|
|_[Optional]_ receiveWindow|The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request|
|_[Optional]_ ct|Cancellation token|

</p>

***

## GetRateAfterAdjustLoanToValueAsync

[https://binance-docs.github.io/apidocs/spot/en/#calculate-rate-after-adjust-cross-collateral-ltv-v2-user_data](https://binance-docs.github.io/apidocs/spot/en/#calculate-rate-after-adjust-cross-collateral-ltv-v2-user_data)
<p>

*Calculate rate after adjust cross-collateral loan to value*

```csharp
var client = new BinanceRestClient();
var result = await client.GeneralApi.Futures.GetRateAfterAdjustLoanToValueAsync(/* parameters */);
```

```csharp
Task<WebCallResult<BinanceCrossCollateralAfterAdjust>> GetRateAfterAdjustLoanToValueAsync(string collateralAsset, string loanAsset, decimal quantity, AdjustRateDirection direction, long? receiveWindow = default, CancellationToken ct = default);
```

|Parameter|Description|
|---|---|
|collateralAsset|The collateral asset|
|loanAsset|The loan asset|
|quantity|The quantity|
|direction|The direction|
|_[Optional]_ receiveWindow|The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request|
|_[Optional]_ ct|Cancellation token|

</p>

***

## RepayForCrossCollateralAsync

[https://binance-docs.github.io/apidocs/spot/en/#repay-for-cross-collateral-trade](https://binance-docs.github.io/apidocs/spot/en/#repay-for-cross-collateral-trade)
<p>

*Repay for cross-collateral*

```csharp
var client = new BinanceRestClient();
var result = await client.GeneralApi.Futures.RepayForCrossCollateralAsync(/* parameters */);
```

```csharp
Task<WebCallResult<BinanceCrossCollateralRepayResult>> RepayForCrossCollateralAsync(string asset, string collateralAsset, decimal quantity, long? receiveWindow = default, CancellationToken ct = default);
```

|Parameter|Description|
|---|---|
|asset|The asset|
|collateralAsset|The collateral asset to repay|
|quantity|The quantity to repay|
|_[Optional]_ receiveWindow|The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request|
|_[Optional]_ ct|Cancellation token|

</p>

***

## TransferFuturesAccountAsync

[https://binance-docs.github.io/apidocs/spot/en/#new-future-account-transfer-user_data](https://binance-docs.github.io/apidocs/spot/en/#new-future-account-transfer-user_data)
Expand Down
109 changes: 109 additions & 0 deletions docs/ClientInfo/GeneralApi/IBinanceRestClientGeneralApiLoans.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,33 @@ Task<WebCallResult<BinanceCryptoLoanBorrow>> BorrowAsync(string loanAsset, strin

***

## CustomizeMarginCallAsync

<p>

*Customize margin call for ongoing orders only.*

```csharp
var client = new BinanceRestClient();
var result = await client.GeneralApi.Loans.CustomizeMarginCallAsync(/* parameters */);
```

```csharp
Task<WebCallResult<BinanceQueryRecords<BinanceCryptoLoanMarginCallResult>>> CustomizeMarginCallAsync(decimal marginCall, string? orderId = default, string? collateralAsset = default, long? receiveWindow = default, CancellationToken ct = default);
```

|Parameter|Description|
|---|---|
|marginCall|Margin call value|
|_[Optional]_ orderId|Order id. Required if collateralAsset is not send|
|_[Optional]_ collateralAsset|Collateral asset. Required if order id is not send|
|_[Optional]_ receiveWindow|The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request|
|_[Optional]_ ct|Cancellation token|

</p>

***

## GetBorrowHistoryAsync

[https://binance-docs.github.io/apidocs/spot/en/#borrow-get-loan-borrow-history-user_data](https://binance-docs.github.io/apidocs/spot/en/#borrow-get-loan-borrow-history-user_data)
Expand Down Expand Up @@ -101,6 +128,61 @@ Task<WebCallResult<BinanceQueryRecords<BinanceCryptoLoanBorrowRecord>>> GetBorro

***

## GetCollateralAssetsAsync

[https://binance-docs.github.io/apidocs/spot/en/#get-collateral-assets-data-user_data](https://binance-docs.github.io/apidocs/spot/en/#get-collateral-assets-data-user_data)
<p>

*Get LTV information and collateral limit of collateral assets. The collateral limit is shown in USD value.*

```csharp
var client = new BinanceRestClient();
var result = await client.GeneralApi.Loans.GetCollateralAssetsAsync();
```

```csharp
Task<WebCallResult<BinanceQueryRecords<BinanceCryptoLoanCollateralAsset>>> GetCollateralAssetsAsync(string? collateralAsset = default, int? vipLevel = default, long? receiveWindow = default, CancellationToken ct = default);
```

|Parameter|Description|
|---|---|
|_[Optional]_ collateralAsset|Filter by collateral asset|
|_[Optional]_ vipLevel|Vip level|
|_[Optional]_ receiveWindow|The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request|
|_[Optional]_ ct|Cancellation token|

</p>

***

## GetCollateralRepayRateAsync

[https://binance-docs.github.io/apidocs/spot/en/#check-collateral-repay-rate-user_data](https://binance-docs.github.io/apidocs/spot/en/#check-collateral-repay-rate-user_data)
<p>

*Get the the rate of collateral coin / loan coin when using collateral repay, the rate will be valid within 8 second.*

```csharp
var client = new BinanceRestClient();
var result = await client.GeneralApi.Loans.GetCollateralRepayRateAsync(/* parameters */);
```

```csharp
Task<WebCallResult<BinanceCryptoLoanRepayRate>> GetCollateralRepayRateAsync(string loanAsset, string collateralAsset, decimal quantity, long? receiveWindow = default, CancellationToken ct = default);
```

|Parameter|Description|
|---|---|
|loanAsset|Loan asset|
|collateralAsset|Collateral asset|
|quantity|Quantity|
|_[Optional]_ receiveWindow|The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request|
|_[Optional]_ ct|Cancellation token|

</p>

***

## GetIncomeHistoryAsync

[https://binance-docs.github.io/apidocs/spot/en/#get-crypto-loans-income-history-user_data](https://binance-docs.github.io/apidocs/spot/en/#get-crypto-loans-income-history-user_data)
Expand Down Expand Up @@ -131,6 +213,33 @@ Task<WebCallResult<IEnumerable<BinanceCryptoLoanIncome>>> GetIncomeHistoryAsync(

***

## GetLoanableAssetsAsync

[https://binance-docs.github.io/apidocs/spot/en/#get-loanable-assets-data-user_data-2](https://binance-docs.github.io/apidocs/spot/en/#get-loanable-assets-data-user_data-2)
<p>

*Get interest rate and borrow limit of loanable assets. The borrow limit is shown in USD value.*

```csharp
var client = new BinanceRestClient();
var result = await client.GeneralApi.Loans.GetLoanableAssetsAsync();
```

```csharp
Task<WebCallResult<BinanceQueryRecords<BinanceCryptoLoanAsset>>> GetLoanableAssetsAsync(string? loanAsset = default, int? vipLevel = default, long? receiveWindow = default, CancellationToken ct = default);
```

|Parameter|Description|
|---|---|
|_[Optional]_ loanAsset|Filter by loan asset|
|_[Optional]_ vipLevel|Vip level|
|_[Optional]_ receiveWindow|The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request|
|_[Optional]_ ct|Cancellation token|

</p>

***

## GetLtvAdjustHistoryAsync

[https://binance-docs.github.io/apidocs/spot/en/#adjust-ltv-get-loan-ltv-adjustment-history-user_data](https://binance-docs.github.io/apidocs/spot/en/#adjust-ltv-get-loan-ltv-adjustment-history-user_data)
Expand Down
29 changes: 29 additions & 0 deletions docs/ClientInfo/GeneralApi/IBinanceRestClientGeneralApiMining.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,35 @@ Task<WebCallResult<BinanceMinerList>> GetMinerListAsync(string algorithm, string

***

## GetMiningAccountEarningsAsync

[https://binance-docs.github.io/apidocs/spot/en/#mining-account-earning-user_data](https://binance-docs.github.io/apidocs/spot/en/#mining-account-earning-user_data)
<p>

*Get mining account earnings*

```csharp
var client = new BinanceRestClient();
var result = await client.GeneralApi.Mining.GetMiningAccountEarningsAsync(/* parameters */);
```

```csharp
Task<WebCallResult<BinanceMiningEarnings>> GetMiningAccountEarningsAsync(string algo, DateTime? startTime = default, DateTime? endTime = default, int? page = default, int? pageSize = default, CancellationToken ct = default);
```

|Parameter|Description|
|---|---|
|algo|Algorithm|
|_[Optional]_ startTime|Filter by start time|
|_[Optional]_ endTime|Filter by end time|
|_[Optional]_ page|Page|
|_[Optional]_ pageSize|Page size|
|_[Optional]_ ct|Cancellation token|

</p>

***

## GetMiningAccountListAsync

[https://binance-docs.github.io/apidocs/spot/en/#account-list-user_data](https://binance-docs.github.io/apidocs/spot/en/#account-list-user_data)
Expand Down
Loading

0 comments on commit 084a055

Please sign in to comment.