@@ -1066,6 +1066,37 @@ public async Task<WebCallResult<BybitSpotMarginBorrowRate[]>> GetSpotMarginInter
10661066
10671067 #endregion
10681068
1069+ #region Set Spot Margin Auto Repay Mode
1070+
1071+ /// <inheritdoc />
1072+ public async Task < WebCallResult < BybitSpotMarginAutoRepayMode [ ] > > SetSpotMarginAutoRepayModeAsync ( bool enabled , string ? asset = null , CancellationToken ct = default )
1073+ {
1074+ var parameters = new ParameterCollection ( ) ;
1075+ parameters . AddOptional ( "currency" , asset ) ;
1076+ parameters . Add ( "autoRepayMode" , enabled ? "1" : "0" ) ;
1077+
1078+ var request = _definitions . GetOrCreate ( HttpMethod . Post , "v5/spot-margin-trade/set-auto-repay-mode" , BybitExchange . RateLimiter . BybitRest , 1 , true ) ;
1079+ var result = await _baseClient . SendAsync < BybitSpotMarginAutoRepayModeWrapper > ( request , parameters , ct ) . ConfigureAwait ( false ) ;
1080+ return result . As < BybitSpotMarginAutoRepayMode [ ] > ( result . Data ? . Data ) ;
1081+ }
1082+
1083+ #endregion
1084+
1085+ #region Get Spot Margin Auto Repay Mode
1086+
1087+ /// <inheritdoc />
1088+ public async Task < WebCallResult < BybitSpotMarginAutoRepayMode [ ] > > GetSpotMarginAutoRepayModeAsync ( string ? asset = null , CancellationToken ct = default )
1089+ {
1090+ var parameters = new ParameterCollection ( ) ;
1091+ parameters . AddOptional ( "currency" , asset ) ;
1092+
1093+ var request = _definitions . GetOrCreate ( HttpMethod . Get , "v5/spot-margin-trade/get-auto-repay-mode" , BybitExchange . RateLimiter . BybitRest , 1 , true ) ;
1094+ var result = await _baseClient . SendAsync < BybitSpotMarginAutoRepayModeWrapper > ( request , parameters , ct ) . ConfigureAwait ( false ) ;
1095+ return result . As < BybitSpotMarginAutoRepayMode [ ] > ( result . Data ? . Data ) ;
1096+ }
1097+
1098+ #endregion
1099+
10691100 #region Get Broker Account Info
10701101
10711102 /// <inheritdoc />
@@ -1336,5 +1367,89 @@ public async Task<WebCallResult<BybitResponse<BybitWithdrawAddress>>> GetWithdra
13361367 }
13371368
13381369 #endregion
1370+
1371+ #region Get Small Balance Assets
1372+
1373+ /// <inheritdoc />
1374+ public async Task < WebCallResult < BybitSmallBalanceAssets > > GetSmallBalanceAssetsAsync (
1375+ ConvertAccountType accountType ,
1376+ string ? fromAsset = null ,
1377+ CancellationToken ct = default )
1378+ {
1379+ var parameters = new ParameterCollection ( ) ;
1380+ parameters . AddEnum ( "accountType" , accountType ) ;
1381+ parameters . AddOptional ( "fromCoin" , fromAsset ) ;
1382+
1383+ var request = _definitions . GetOrCreate ( HttpMethod . Get , "/v5/asset/covert/small-balance-list" , BybitExchange . RateLimiter . BybitRest , 1 , true ,
1384+ limitGuard : new SingleLimitGuard ( 10 , TimeSpan . FromSeconds ( 1 ) , RateLimitWindowType . Sliding , null , SingleLimitGuard . PerApiKey ) ) ;
1385+ return await _baseClient . SendAsync < BybitSmallBalanceAssets > ( request , parameters , ct ) . ConfigureAwait ( false ) ;
1386+ }
1387+
1388+ #endregion
1389+
1390+ #region Get Small Balances Quote
1391+
1392+ /// <inheritdoc />
1393+ public async Task < WebCallResult < BybitSmallBalancesQuote > > GetSmallBalancesQuoteAsync (
1394+ ConvertAccountType accountType ,
1395+ IEnumerable < string > fromAssets ,
1396+ string toAsset ,
1397+ CancellationToken ct = default )
1398+ {
1399+ var parameters = new ParameterCollection ( ) ;
1400+ parameters . AddEnum ( "accountType" , accountType ) ;
1401+ parameters . Add ( "fromCoinList" , fromAssets . ToArray ( ) ) ;
1402+ parameters . Add ( "toCoin" , toAsset ) ;
1403+
1404+ var request = _definitions . GetOrCreate ( HttpMethod . Post , "/v5/asset/covert/get-quote" , BybitExchange . RateLimiter . BybitRest , 1 , true ,
1405+ limitGuard : new SingleLimitGuard ( 5 , TimeSpan . FromSeconds ( 1 ) , RateLimitWindowType . Sliding , null , SingleLimitGuard . PerApiKey ) ) ;
1406+ return await _baseClient . SendAsync < BybitSmallBalancesQuote > ( request , parameters , ct ) . ConfigureAwait ( false ) ;
1407+ }
1408+
1409+ #endregion
1410+
1411+ #region Confirm Small Balances Quote
1412+
1413+ /// <inheritdoc />
1414+ public async Task < WebCallResult < BybitSmallBalancesQuoteResult > > ConfirmSmallBalancesQuoteAsync (
1415+ string quoteId ,
1416+ CancellationToken ct = default )
1417+ {
1418+ var parameters = new ParameterCollection ( ) ;
1419+ parameters . Add ( "quoteId" , quoteId ) ;
1420+
1421+ var request = _definitions . GetOrCreate ( HttpMethod . Post , "/v5/asset/covert/small-balance-execute" , BybitExchange . RateLimiter . BybitRest , 1 , true ,
1422+ limitGuard : new SingleLimitGuard ( 5 , TimeSpan . FromSeconds ( 1 ) , RateLimitWindowType . Sliding , null , SingleLimitGuard . PerApiKey ) ) ;
1423+ return await _baseClient . SendAsync < BybitSmallBalancesQuoteResult > ( request , parameters , ct ) . ConfigureAwait ( false ) ;
1424+ }
1425+
1426+ #endregion
1427+
1428+ #region Get Small Balance Exchange History
1429+
1430+ /// <inheritdoc />
1431+ public async Task < WebCallResult < BybitPage < BybitSmallBalancesExchangeItem > > > GetSmallBalancesExchangeHistoryAsync (
1432+ ConvertAccountType ? accountType = null ,
1433+ string ? quoteId = null ,
1434+ DateTime ? startTime = null ,
1435+ DateTime ? endTime = null ,
1436+ int ? page = null ,
1437+ int ? pageSize = null ,
1438+ CancellationToken ct = default )
1439+ {
1440+ var parameters = new ParameterCollection ( ) ;
1441+ parameters . AddOptionalEnum ( "accountType" , accountType ) ;
1442+ parameters . AddOptional ( "quoteId" , quoteId ) ;
1443+ parameters . AddOptionalMilliseconds ( "startTime" , startTime ) ;
1444+ parameters . AddOptionalMilliseconds ( "endTime" , endTime ) ;
1445+ parameters . AddOptional ( "cursor" , page ) ;
1446+ parameters . AddOptional ( "size" , pageSize ) ;
1447+
1448+ var request = _definitions . GetOrCreate ( HttpMethod . Get , "/v5/asset/covert/small-balance-history" , BybitExchange . RateLimiter . BybitRest , 1 , true ,
1449+ limitGuard : new SingleLimitGuard ( 10 , TimeSpan . FromSeconds ( 1 ) , RateLimitWindowType . Sliding , null , SingleLimitGuard . PerApiKey ) ) ;
1450+ return await _baseClient . SendAsync < BybitPage < BybitSmallBalancesExchangeItem > > ( request , parameters , ct ) . ConfigureAwait ( false ) ;
1451+ }
1452+
1453+ #endregion
13391454 }
13401455}
0 commit comments