forked from igorek17000/alunajs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
list.ts
33 lines (21 loc) · 791 Bytes
/
list.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import debug from 'debug'
import { IAlunaExchangePublic } from '../../../../../lib/core/IAlunaExchange'
import {
IAlunaSymbolListParams,
IAlunaSymbolListReturns,
} from '../../../../../lib/modules/public/IAlunaSymbolModule'
import { BittrexHttp } from '../../../BittrexHttp'
const log = debug('alunajs:bittrex/symbol/list')
export const list = (exchange: IAlunaExchangePublic) => async (
params: IAlunaSymbolListParams = {},
): Promise<IAlunaSymbolListReturns> => {
log('listing Bittrex symbols')
const { http = new BittrexHttp(exchange.settings) } = params
const { requestWeight } = http
const { rawSymbols } = await exchange.symbol.listRaw({ http })
const { symbols } = exchange.symbol.parseMany({ rawSymbols })
return {
symbols,
requestWeight,
}
}