make method generic and add mapping

This commit is contained in:
Thijmen Maus
2023-09-12 11:25:43 +02:00
parent 9de8134286
commit 2fb2b7cc40
2 changed files with 13 additions and 7 deletions

View File

@@ -231,9 +231,9 @@ export class RestClientV5 extends BaseRestClient {
*
* Note: Spot does not support pagination, so limit & cursor are invalid.
*/
getInstrumentsInfo(
params: GetInstrumentsInfoParamsV5,
): Promise<APIResponseV3WithTime<InstrumentInfoResponseV5>> {
getInstrumentsInfo<C extends CategoryV5>(
params: GetInstrumentsInfoParamsV5 & { category: C },
): Promise<APIResponseV3WithTime<InstrumentInfoResponseV5<C>>> {
return this.get('/v5/market/instruments-info', params);
}