Nouzan / exc

An abstraction layer for exchanges
MIT License
38 stars 14 forks source link

Why delete `FetchLastCandlesService` in main branches #53

Closed rise0chen closed 1 year ago

rise0chen commented 1 year ago

I want to wrap the interface, like this:

impl<C, Req> Exchange<C, Req>
where
    Exc<C, Req>: FetchCandlesService,
{
}

but, OKX not implement FetchCandlesService. OKX had implement QueryLastCandles, but I can't find FetchLastCandlesService in main branches.

Nouzan commented 1 year ago

The implementation is still there, but not implemented directly. You can use ExcExt::into_fetch_candles_backward_with_bound to convert a Exc<impl Request<QueryLastCandles>> into a FetchCandlesService. You can find the usage example here.

rise0chen commented 1 year ago

Ok, I can use ExcService<QueryLastCandles> to constraint Exc<C, Req>