Skip to content

Commit

Permalink
feat(): improve dynamic types for getTickers
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagosiebler committed Oct 30, 2023
1 parent a790fca commit 27192d2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/rest-client-v5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ import {
WithdrawParamsV5,
WithdrawalRecordV5,
} from './types';

import { REST_CLIENT_TYPE_ENUM } from './util';
import BaseRestClient from './util/BaseRestClient';

Expand Down Expand Up @@ -248,6 +249,22 @@ export class RestClientV5 extends BaseRestClient {
return this.get('/v5/market/orderbook', params);
}

getTickers(
params: GetTickersParamsV5<'linear' | 'inverse'>,
): Promise<
APIResponseV3WithTime<
CategoryListV5<TickerLinearInverseV5[], 'linear' | 'inverse'>
>
>;

getTickers(
params: GetTickersParamsV5<'option'>,
): Promise<APIResponseV3WithTime<CategoryListV5<TickerOptionV5[], 'option'>>>;

getTickers(
params: GetTickersParamsV5<'spot'>,
): Promise<APIResponseV3WithTime<CategoryListV5<TickerSpotV5[], 'spot'>>>;

/**
* Query the latest price snapshot, best bid/ask price, and trading volume in the last 24 hours.
*
Expand Down

0 comments on commit 27192d2

Please sign in to comment.