@@ -481,6 +481,40 @@ public virtual async Task<WebCallResult<OKXFundingBill[]>> GetFundingBillDetails
481481 return await _baseClient . SendAsync < OKXFundingBill [ ] > ( request , parameters , ct ) . ConfigureAwait ( false ) ;
482482 }
483483
484+ /// <inheritdoc />
485+ public virtual async Task < WebCallResult < OKXFundingBill [ ] > > GetFundingBillHistoryAsync (
486+ string ? asset = null ,
487+ FundingBillType ? type = null ,
488+ DateTime ? endTime = null ,
489+ DateTime ? startTime = null ,
490+ int limit = 100 ,
491+ string ? clientId = null ,
492+ long ? startBillId = null ,
493+ long ? endBillId = null ,
494+ CancellationToken ct = default )
495+ {
496+ if ( limit < 1 || limit > 100 )
497+ throw new ArgumentException ( "Limit can be between 1-100." ) ;
498+
499+ if ( ( startTime != null || endTime != null ) && ( startBillId != null || endBillId != null ) )
500+ throw new ArgumentException ( "Filter can be either on start/end bill id or start/end time" ) ;
501+
502+ var parameters = new ParameterCollection ( ) ;
503+ parameters . AddOptionalParameter ( "ccy" , asset ) ;
504+ parameters . AddOptionalEnum ( "type" , type ) ;
505+ parameters . AddOptionalParameter ( "before" , DateTimeConverter . ConvertToMilliseconds ( startTime ) ? . ToString ( ) ) ;
506+ parameters . AddOptionalParameter ( "after" , DateTimeConverter . ConvertToMilliseconds ( endTime ) ? . ToString ( ) ) ;
507+ parameters . AddOptionalString ( "before" , endBillId ) ;
508+ parameters . AddOptionalString ( "after" , startBillId ) ;
509+ parameters . AddOptionalParameter ( "limit" , limit . ToString ( CultureInfo . InvariantCulture ) ) ;
510+ parameters . AddOptionalParameter ( "clientId" , clientId ) ;
511+ parameters . AddOptionalParameter ( "pagingType" , startBillId != null || endBillId != null ? "2" : null ) ;
512+
513+ var request = _definitions . GetOrCreate ( HttpMethod . Get , $ "api/v5/asset/bills-history", OKXExchange . RateLimiter . EndpointGate , 1 , true ,
514+ limitGuard : new SingleLimitGuard ( 1 , TimeSpan . FromSeconds ( 1 ) , RateLimitWindowType . Sliding , keySelector : SingleLimitGuard . PerApiKey ) ) ;
515+ return await _baseClient . SendAsync < OKXFundingBill [ ] > ( request , parameters , ct ) . ConfigureAwait ( false ) ;
516+ }
517+
484518 /// <inheritdoc />
485519 public virtual async Task < WebCallResult < OKXLightningDeposit [ ] > > GetLightningDepositsAsync (
486520 string asset ,
0 commit comments